Optic Disc Detection from Fundus Photography via Best-Buddies Similarity

Robust and effective optic disc (OD) detection is a necessary processing step in the research work of the automatic analysis of fundus images. In this paper, we propose a novel and robust method for the automated detection of ODs from fundus photographs. It is essentially carried out by performing template matching using the Best-Buddies Similarity (BBS) measure between the hand-marked OD region and the small parts of target images. For well characterizing the local spatial information of fundus images, a gradient constraint term was introduced for computing the BBS measurement. The performance of the proposed method is validated with Digital Retinal Images for Vessel Extraction (DRIVE) and Standard Diabetic Retinopathy Database Calibration Level 1 (DIARETDB1) databases, and quantitative results were obtained. Success rates/error distances of 100%/10.4 pixel and of 97.7%/12.9 pixel, respectively, were achieved. The algorithm has been tested and compared with other commonly used methods, and the results show that the proposed method shows superior performance.


Introduction
The optic disc (OD) is commonly considered one of the main features of a retinal fundus image.Accurate and early OD detection has been shown to be very important in ocular image analysis and computer-aided diagnosis.On the one hand, the change in the shape, color, or location of ODs is a critical indicator of various blinding eye diseases including glaucoma, cataract, and diabetic retinopathy [1][2][3].On the other hand, OD detection is typically a key preprocessing component in computer algorithms developed for the automatic characterization of retinal anatomical structures (e.g., retinal vessels and the macula), which is helpful for aiding the ophthalmologist in determining the position of many retinal abnormalities such as exudates, drusen, and microaneurysms.
OD detection aims to find the location and area of ODs in retinal fundus images.In general, an OD has a very different appearance compared with the rest of the retina.It usually appears as a yellowish, circular, or slightly oval region brighter than the surrounding in fundus images.An OD is the exit point of ganglion cell axons leaving the eye, roughly one-sixth the width of the image in diameter [4][5][6][7].Localizing the OD is the initial step of most vessel segmentation, disease diagnostic, and retinal recognition algorithms.It often works as a landmark and reference for the other features in fundus images [8][9][10].However, because of the presence of eye diseases, light, and noise, the accurate detection of ODs is a challenging task and is the subject of much research.
There are many studies related to the detection of the OD from fundus photography.Based on the different properties of OD presented in the fundus images, methods of OD detection can be classified into different categories, such as appearance-based methods and vessel-based methods [5,11].Due to the obvious round and bright area of the OD, and since the region of the OD in fundus photography is fixed, some scholars have proposed methods to detect ODs based on appearance features.These researchers were focused on areas in fundus images where the brightness is highest.There are many appearance-based methods.Sinthanayothin detected regions with the highest variation in the intensity of adjacent pixels between the vessels and the bright nerve fibers.Such regions are the result of this method, which are ODs [12,13].Akyol detected ODs in fundus images by using key point detection with SURF, texture analysis, and visual dictionary techniques on bright regions [14].Lalonde and Osareh detected ODs by template matching.Lalonde used pyramidal decomposition and Hausdorff-based template matching in low-resolution fundus images.Osareh had chosen the average of the color-normalized OD region in 25 retinal images as the template image [15][16][17].Li found the brightest pixels in the fundus image, combined them with the clustering algorithm to segment the candidate area of the OD, and then used principal component analysis (PCA) to find the OD [18].Vessel-based methods depend mainly upon analyzing the structure and the density of retinal vessels.Youssif and others detected ODs by analyzing the structure and the direction of the vessels, as well as the degree of template matching between the given blood vessel directions [19].Mahfouz et al. proposed a comprehensive utilization of the direction of vessels, the converged blood vessels, and the brightness information of ODs.They found that the blood vessels in the area mostly extend along the vertical direction.Therefore, the vertical gradient component is greater than the horizontal gradient component in the region's edge gradient.The total edge gradient in this region is greater than other regions.By the two projections, the center coordinates of ODs are located [20,21].Foracchia proposed a geometric model of blood vessel structures to locate ODs.They used two opposite directions parabolas to describe the direction of blood vessels, because the two parabolic common vertices are located in the area of the ODs, and they detected ODs through this feature [22,23].
Both of these methods have their strengths and weaknesses.Appearance-based methods make full use of the visual features of OD such as brightness and texture.Some researchers think that the method of detecting ODs by their appearance is effective, but these methods often fail when the fundus images have lesions and the lesions are similar to the brightness of ODs, and these methods may have high computational complexity.Vessel-based methods take full advantage of information such as the structure and orientation of blood vessels and solve the detection problem caused by the disease.However, these methods require a strict geometric template, and the formulation of the template depends on accurate image segmentation, which leads to a highly complex algorithm and an unsatisfied real-time requirement of OD detection.Thus, in the process of pattern recognition, we should pay more attention to local information [24,25].
To address these problems, many studies have demonstrated that template-based matching can be used for developing faster and more robust methods for OD detection [17,19].In the traditional template matching process, all the points in the candidate window are used for the computation of similarity.Nevertheless, these algorithms may have high computational cost and match the error area when the interested target area has nonrigid deformation and outliers.
In this paper, we propose a new method for the automated detection of ODs from fundus photography.It is carried out by applying the Best-Buddies Similarity (BBS) measure based on template matching to address the problem of OD localization [26].Specifically, we first represent both the template and each of the candidate regions within the fundus image as two point sets.We think that only similar points in the template image and the candidate window should be considered.The BBS is then employed to measure the similarity between the two sets of points, which is computed by counting the number of mutual nearest neighbors based on statistical distance measures.For capturing the spatial distribution of patches in the templates and fundus images, we adjusted the traditional BBS model by introducing a gradient constraint term to improve the accuracy of distance measurements.Our method avoids the complex work of segmenting blood vessels and strengthens the robustness against high levels of lesions in fundus images.The experimental results show that our method has lower computational complexity and performs well when the fundus images have lesions.Experiments were conducted with both the Digital Retinal Images for Vessel Extraction (DRIVE) and Standard Diabetic Retinopathy Database Calibration Level 1 (DIARETDB1) databases, and results show that our approach outperforms state-of-the-art methods.
The rest of this paper is organized as follows.The Materials and Methods section describes the proposed methodology for the detection of ODs.The Results section presents the test design and the experimental results analysis.The Discussion section is devoted to concluding remarks and suggests future work.

Materials and Methods
Given a retinal fundus image, assume that the location and area of the OD have been accurately delineated by human experts.We can then obtain a template image by constructing a minimum bounding rectangle containing the whole OD region according to the manually delineated boundary (ground truth), as shown in Figure 1.The goal of our method for OD detection is to search and find a small part of new fundus photography that matches the given template image.Specifically, we break the template and the target image into U and V distinct patches, respectively.The size of each patch is k × k.We then assume each image patch as a point, the point sets to be matched and composed by these patches.Each k × k patch is represented by its RGB values, gradient, and the x, y location of the central pixel.The value of k should be adjusted according to the size of the template.In this paper, k = 3 was chosen and fixed in all our experiments.
We then detect OD from fundus photography by computing the BBS between the template and every possible window in the target image.Details of the BBS are described in the following subsections.

Best-Buddies Similarity
Best-Buddies Similarity is based on the following assumptions: The target pixels under different backgrounds always follow the same probability distribution.The similarity between them is calculated by counting the number of matching feature points in the template and the target images candidate area.
We first define two point sets: R = {r i } U i=1 and S = s j V j=1 , where r i , s j ∈ R d , U, and V are the number of feature points in the point set of R and S, respectively.R = {r i } U i=1 and S = s j V j=1 represent the feature point set of the template and the candidate region in the target image, respectively.BBS measures the similarity between these two sets.A pair of points r i ∈ R, s j ∈ S is a Best-Buddies Pair (BBP) if r i is the nearest neighbor of s j in the set S, and vice versa.By discriminating BBP, the matching matrix of R and S is obtained.The following is the mathematical expression of BBP.
where NN (r i , S) = argmin d (r i , s) , s ∈ S, and d (r i , s) is some distance measure, ∧ is the AND operation, and NN (r i , S) = s j indicates that the nearest neighbor of r i in point set S is s j .BBS is then taken to be the fraction of Best-Buddies Pairs (BBPs) between these two sets and the equation of the BBS between the point sets R and S is given by We need to compute the distance between each pair of points to calculate the BBS between two point sets R, S. The distance measure consists of two parts in the original BBS, one part is the difference of the RGB appearance, the other part is the difference of the x, y location of the central pixel.In the actual situation, the distance measure, which only computes the difference in appearance and location, is usually limited.To improve the efficiency of OD detection, we introduced a gradient algorithm based on a first-order derivative into the distance measure, which makes the algorithm more robust and improves the accuracy of the detection results.
Mathematically, the image can be regarded as a two-dimensional discrete function, and the image gradient is the derivative of this function: where dx (p, q) = l (p + 1, q) − l (p, q), dy (p, q) = l (p, q + 1) − l (p, q), l is the gray value of the pixel, and (p, q) represents the coordinates of pixels.The distance between each pair is expressed by the following equation: where superscript A denotes pixel RGB appearance and superscript L denotes pixel location (x, y within the patch normalized to the range [0, 1]), superscript G denotes the gradient value of r i and s j , and β is the weight coefficient.β = 2 was chosen empirically and fixed in our experiments.Through Equation ( 4), the color, location, and gradient distribution information between the template and the target image can be well described.The algorithm is more robust for detecting ODs from fundus photography.

Template Matching Based on BBS
Our method is carried out by applying the BBS measure based on template matching to address the problem of OD detection.The template matching method is divided into three parts in this paper: image preprocessing, BBS computation, and finding the best result, respectively.The pseudocode for our algorithm is illustrated in Algorithm 1. for each: distinct patches r i in T do 5: Compute the distance d(r i , s j ) between s j and r i using Equation (4) 6: end for 7: end for 8: for each: candidate region in I do 9: Compute BBS between the template and it via Equations ( 1) and (2).10: end for Ensure: The location of the region with max value of BBS.

Image Preprocessing
We need to set the size of patch k according to the size of the template and the target image, and resize the target image and the template according to the size of the patch.In this way, we ensure that the length and width of the target image and the template can be divisible by k.The template and the target image are then divided into multiple patches.

BBS Computation
We compute the distance for all point pairs between the template and the candidate window in the target image according to Equation (4).We then find the BBPs between the template and the candidate window according to Equation (1).We slide the window and counting the number of BBPs between all the candidate windows and the template.The value of BBS between the template and the candidate windows is obtained according to Equation (2).

Finding the Best Result
The sum of BBPs divided by the number of patches is normalized to obtain a confidence map.The brightest region with the maximum BBS value is the target location.

Data and Parameter Settings
Algorithm performance was tested and comprehensively analyzed on the DRIVE and DIARETDB1 database, respectively.The DRIVE database contains 40 images obtained from a diabetic retinopathy screening program in The Netherlands.The images were acquired using a Canon CR5 non-mydriatic 3CCD camera (Canon, Tochigiken, Japan) with a 45-degree field of view (FOV).Each image is 565 × 584 pixel and 8 bits per color channel.The set of 40 images was divided into a training and a test set, both containing 20 images [27].The DIARETDB1 database consists of 89 retinal images, of which 84 contain at least mild diabetic retinopathy and 5 are considered normal.Images were captured using the same 50-degree field-of-view digital fundus camera with varying imaging settings, and each image is 1500 × 1152 pixel.To test our method, the OD boundary and center of each image from both databases were manually marked by a trained ophthalmologist, which were used as the ground truth for constructing the template image and evaluating the performance of OD detection, respectively.
The appearance of OD such as the shape, color, and size showed large variance, especially in the presence of retinopathies.Choosing different fundus images to construct templates and a different number of templates will correspondingly affect the final results.We selected fundus images with representative features of ODs from the DRIVE and DIARETDB1 databases at random, and we constructed minimum bounding rectangles containing the entire OD region on the basis of these images as template images.The different results using different numbers of templates are shown in the Results section.Because the proposed method has strong robustness, we only need a small number of images with complete features of ODs as template images.During the experiment, the target image selected as the template was matched using other templates without matching it to itself.
To obtain the specific performance indicators of our method, we defined criteria for correctly detecting ODs, whereby the estimated OD center was inside the contour of the OD in the fundus photograph, and the distance between the estimated OD center and its manually identified OD center was within 60 pixel [5].

Results Analysis
We presented the results of the proposed method in Table 1 on both databases, and the steps of our method to detect OD are shown in Figure 2. Some detection results are shown in Figures 3 and 4.
Specifically, the success rate in Table 1 was 100% and 97.7% for both databases when we selected 4 images from DRIVE and 8 images from DIARETDB1 as templates, respectively.The success rate is the percentage of correct detection among all attempts.The error distance is the distance between the estimated OD center and the manually identified OD center.The average error distances are 10.4 and 12.9 pixel for the DRIVE and DIARETDB1 databases, respectively, and the value of each image is shown in Figure 5.The error distances and success rates of the different databases computed using different numbers of template images are shown in Figure 6.The results of our method show success rates/error distances of 87.5%/20 pixel, 100%/17.37 pixel, 100%/16.54pixel, and 100%/10.4pixel when we construct 1, 2, 3, 4 template images from the DRIVE database, respectively.The success rates/error distances are 63%/20.58pixel, 80.9%/13.1 pixel, 91%/12.9pixel, and 97.7%/12.7 pixel when we construct 2, 4, 6, 8 template images from the DIARETDB1 database, respectively.Therefore, as templates increase, the detection success rate of the proposed method increases, and the error distances drop.The results show that the proposed method is validated, has better robustness, and can obtain very precise detection results by increasing the number of templates.We can determine the number of templates according to the different requirements of the actual application.
Table 2 shows the comparison of the success rate with different methods.From these data, we can easily conclude that the proposed method is a robust method and performs well on various public databases.

Discussion
OD detection in fundus photography is an important prerequisite for the diagnosis and treatment of retinopathy.Accurate and early detection of ODs in retinal fundus images has been shown to be an initial and critical step in both ocular image analysis and computer-aided diagnosis.However, many OD detection methods often fail when the fundus images have lesions that are similar to the brightness of ODs.Vessel-based methods can take full advantage of information, such as the structure and orientation of blood vessels, to solve problems caused by easily confused lesions.However, these methods require a strict geometric template which depends on accurate image segmentation, rendering high computational complexity of the algorithms.The template-based matching techniques are capable of developing fast and robust OD detection algorithms, but these algorithms often require high computational cost and simple targets without nonrigid deformation and outliers.
In this paper, a new method for the automated detection of OD from fundus photography is proposed, which is achieved by applying the BBS measure for template matching to deal with the problem of OD localization.First, the template and each of the candidate regions within the fundus image can be represented as two point sets.We then measure the similarity between the two sets of points by employing the BBS computed by counting the number of mutual nearest neighbors based on some statistical distance measures.Furthermore, we adjust the traditional BBS model by combining a gradient constraint term to improve the accuracy of distance measurements to capture the spatial distribution of patches in the templates and fundus images.
The performance of our method was validated on the DRIVE and DIARETDB1 databases and obtained quantitative results.The success rate was 100% and 97.7% for the DRIVE and DIARETDB1 databases, and the average error distance between the estimated and the manually identified optic disc center was 10.4 and 12.9 pixel, respectively.The proposed method compared with other commonly used methods shows superior performance, with high localization success rates and fast localization speeds.The proposed method avoids the complex work of segmenting blood vessels and is robust against high levels of lesions in fundus images.Experiments were conducted on both the DRIVE and DIARETDB1 databases and show that our approach outperforms state-of-the-art methods.Future work will explore a novel multiple target localization model, which can be used to detect multiple retinal components such as vessels, drusens, and ODs.

Figure 1 .
Figure 1.The construction of template image.The blue rectangle is the minimum bounding rectangle containing the whole OD region marked by a green circle.

Algorithm 1 :
Optic Disc Detection using Best-Buddies-Similarity-based Template Matching.Require: Template image T; target image I, patch size k.1: Resizing T and I to have rows and columns with size of a multiple of k. 2: Breaking T and I into U and V distinct patches, respectively.3: for each: distinct patches s j in I do 4:

Figure 2 .
Figure 2. The steps of our method to detect ODs in normal fundus photography and fundus photography containing pathologies.(a,e) Target image.(b,f) The blue rectangle is marked as the template, the green circle is the true optic disc.(c,g) Confidence map.The red circle is the result of our method in the confidence map.(d,h) The red cross is the final detection result.

Figure 3 .
Figure 3. Results of the proposed method (the red cross represents the estimated OD center).(a,c,e,g,i,k) The OD center annotation ground truth.(b,d,f,h,j,l) Results of the proposed method on the DRIVE database.

Figure 4 .Figure 5 .Figure 6 .
Figure 4. Results of the proposed method (the red cross represents the estimated OD center).(a,c,e,g,i,k,m,o,q,s)The OD center annotation ground truth.(b,d,f,h,j,l,n,p,r,t)Results of the proposed method on the DIARETDB1 database.

Table 1 .
Results of the proposed method.

Table 2 .
Results of different algorithms.