Optic cup segmentation using adaptive threshold and morphological image processing

Glaucoma is a chronic optic neuropathy. It was predicted that people with bilateral blindness caused by glaucoma will increase each year. Hence, computer-aided diagnosis of glaucoma was proposed to assist ophthalmologist to conduct a fast and accurate glaucoma screening. One of the ocular examination in screening is optic nerve examination called disc damage likelihood scale (DDLS). It is important to find the optic disc and the optic cup to determine the narrowest width of the neuroretinal rim when using DDLS. To find the optic cup, this study proposed a segmentation scheme consisting of pre-process, segmentation, convex hull and morphological opening operation. In pre-process the blood vessel was removed to make the segmentation process of the optic cup easier. The segmentation process was done by using an adaptive thresholding followed by morphological image processing such as convex hull, opening and erosion. This algorithm was applied on Magrabia dataset and attained accuracy, specificity and sensitivity of 99.50%, 99.75% and 75.19% respectively.


Introduction
In definition, glaucoma is a group of progressive and multifactorial optic neuropathies that is acute and chronic [1]. Furthermore, glaucoma is irreversible and could lead to permanent vision loss. According to the statistical data [2], the number of people with glaucoma will increase approximately up to 80 million and people with permanent vision loss at around 11 million in 2020. The numbers are higher than the estimated numbers in 2010 that shows people with glaucoma at around 60.5 million and permanent vision loss at around 8 million. These numbers illustrate an upward trend of glaucoma. Therefore, it is a concerning matter if the numbers are keep getting higher each year.
Concerning the glaucoma trend, a screening test as a preventative measure needs to be conducted for patients with glaucoma to have a treatment as early as possible to minimize the chance of bilateral blindness. Hence, computer-aided diagnosis (CAD) of glaucoma was developed [3] to assist the ophthalmologist in conducting a fast and accurate glaucoma screening. One of the ocular examination in screening is optic nerve examination using the disc damage likelihood scale (DDLS) that is assumed to be the most complete assessment of optic nerve [1]. DDLS differentiates the severity of glaucomatous optic nerve into ten stages, consecutively from the lowest risk (stage one) to glaucoma disability (stage ten). These stages are based on the narrowest width of the neuroretinal rim, the space between the optic disc and the optic cup. Hence, finding the optic disc and the optic cup to determine the narrowest width of the neuroretinal rim is necessary to do [4] [5].
Several studies about detection and segmentation of both optic disc and optic cup have been conducted before. Isaac et al. [6] used the standard deviation of Gaussian window, red channel color space, green channel color space and the average intensity of the respective color channels to make an adaptive threshold. On the other hand, Nugroho et al. [7] used a different approach. Instead of making a certain threshold to extract the optic disc and the optic cup from the background, this research work used a morphological reconstruction followed by active contour. Both studies used CDR as their reference whilst CDR were already outperformed by DDLS [8].
This study referred to DDLS and only focused on the optic cup as it does not only contribute to finding the narrowest rim width but also to find any rim loss in the optic nerve. To find the optic cup, this study proposed an algorithm consists of preprocess and segmentation. In pre-process the blood vessel was removed to make the segmentation process of the optic cup easier, since blood vessel could cover the optic cup therefore affect the accuracy of the detection [9]. The segmentation process used an adaptive thresholding followed by morphological image processing such as convex hull, opening and erosion.

Dataset
This study used the retinal fundus images provided by the Magrabia dataset (a part of RIGA publicly dataset). The size of each image was 2743 by 1936 in RGB color space. Every image in the Magrabia dataset served in the TIFF format. The dataset also provided ground truth marked by the expert that is useful for evaluating the performance of the proposed method.

Methodology
The proposed method of this paper is concretely described in Fig. 2. The proposed method consists of pre-process, segmentation, morphological operation and convex hull. The pre-process helped in preparing the image for easier extraction in the segmentation process. After segmentation, the process continued with morphological operation and convex hull to regain the lost region of the optic cup which makes the resulted image resembled the original shape of the optic cup as closely as possible.

Pre-process
The pre-process began with the green channel extraction [10]. The green channel is chosen because it contains more information about optic cup compared to other channel [11]. After that, the optic disc localization process is conducted to gain information about the optic cup. The localization of the optic disc is performed by choosing the highest pixel intensity [12] as the center point of the optic disc region. This region is defined as a region of interest (RoI) used in the next process.
After the RoI is obtained, the blood vessel covering the optic cup is removed by applying bottom hat. The bottom hat is used to enhance the dark object from the background as the result of the difference between the closing operation (morphological operation) and the RoI image [13]. The aforementioned dark object is the blood vessel. As the blood vessel intensity intensify, the presence of the optic cup will be prominent as the blood vessel has a similar intensity to it. Equation (1) shows the details of bottom hat.
with is the input or RoI image, is the structuring element, while • is the notation of closing operation. After the blood vessel has been removed, the Gaussian filter is performed to make the optic cup even more prominent. The equation of Gaussian filter is described in the (2), where μ represents the average and σ represents the standard deviation [14].

Segmentation
After the RoI is obtained and prepared, the process proceeds to extract the optic cup from the background. The optic cup and the background is separated by using adaptive threshold T [6]. Concretely, if the pixel intensity is above of T then the pixel intensity turned into 1. Besides, if the pixel intensity is equal or below of T then the pixel intensity turned into 0. Equation (3) describes how the threshold T works.
The threshold T is determined by using (4) where is the size of gaussian window, is the standard deviation of Gaussian window, is the standard deviation of pre-process result and is the average intensity of pre-process result.
Standard deviation is determined by using (6). is the resulted image of pre-process, and , indicates the row and the column.

Convex Hull and Morphological Operation
After getting the segmented image, it is necessary to conduct a post segmentation process to regain the lost optic cup region from the segmentation process. Hence, a convex hull followed by a set of morphological operation is performed. The morphological operation consists of two steps which are opening and erosion operation.
Concretely, if a simple algorithm for convex hull of a set is called ( ), and let , = 1,2,3,4 represent the four structuring elements, this algorithm consists of implementing (7) with 0 = , and let = , then the convex hull of set can be written as (8) The algorithm iteratively applies hi-or-miss transform to with 1 . If there are no changes occur, the union with can be performed for getting 1 . The same algorithm is repeated with 2 and so on until 4 is generated. The union of all = ( = 1,2,3,4) is the convex hull of [15].
After convex hull is conducted, the opening and erosion operation is performed [16]. Opening operation is a constitution of erosion and dilation. Using s as the structuring element and ( , ) as an input image resulted by segmentation process, erosion operation can be written as Eq. (9) Therefore, the equation for opening operation is shown in (10)

Evaluation of Performance
To evaluate the performance of the proposed method, some statistical metrics such as true positive (TP), true negative (TN), false positive (FP) and false negative (FN) are used to measure the accuracy, specificity and sensitivity [17]. The ground truth is compared with the segmentation result to calculate the TP, TN, FP and FN.
Every pixel in the ground truth and segmentation result will be matched to see whether the pixel in the result is TP, TN, FP or FN. According to Fig. 3, TP happen when the system successfully includes the pixel inside the desired region to the result, while TN happen when the system successfully excludes the pixel outside the desired region to the result. These events (TP and TN) is called 'hit'. Moreover, every hit is equal to score '1' for every TP and TN that happened in the matching process.
On the other hand, FP happen when the system fails to exclude the pixel outside the desired region to the result, and FN happen when the system fails to include the pixel inside the desired region to the result. These events (FP and FN) is called 'miss'. Moreover, not any different with TP and TN, every miss is equal to score '1' for every FP and FN that happened in the matching process. After matching all the pixels of the ground truth and segmentation result, the accuracy, specificity and sensitivity is measured by using (11), (12) and (13).
Basically, accuracy, specificity and sensitivity are used subsequently to evaluate the success rate of the system in detecting whether the pixels are the part of the optic cup or not, in detecting pixels that are not part of the optic cup, and in detecting pixels that are part of the optic cup.

The Pre-process of Optic Cup
This study used 30 retinal fundus images from Magrabia dataset. These images then going through the pre-process step before proceed into segmentation. The first step of the preprocess was used to separate the green channel from other channels to get the best information about the optic cup. Afterward, the highest pixel intensity was picked to identify the center point of RoI. The size of the RoI was 121 by 121. The size is obtained based on an empirical test for the RoI size. The test was involved 60 different sizes from 3 by 3 to 121 by 121. This study opts for 121 by 121 as it gave the most encouraging result of the accuracy, specificity and sensitivity compared to other sizes. The RoI size of 121 by 121 was not only gave the most encouraging performance results but also encompassed all parts of optic cup well.
The subsequent process was intended to remove blood vessels from the optic cup area using the bottom hat and then used the Gaussian filter to make the optic cup more prominent. Fig. 4 illustrates how the Gaussian filter influences the green channel.
After the histogram blurring using the Gaussian filter is conducted, the process proceeded to segmentation. The result images of pre-processing are illustrated in Fig. 5.

Segmentation, Convex Hull, and Morphological Operation Performance of Optic Cup
After pre-processing, the optic cup was extracted from the background using the adaptive threshold, subsequently continued to convex hull and morphological operation to regained the lost optic cup region and to smooth out the cup perimeter. The result of the segmentation, convex hull and morphological operation can be seen in Fig. 6.
At this point, the optic cup was already extracted and ready to be evaluated (explained in subsection 3.4). The obtained accuracy, specificity, and sensitivity were 99.50%, 99.75%, 75.19% respectively. All these value performances were above 95% except for the value of sensitivity. This value of sensitivity showed that some pixels should be a part of the optic cup but failed to be included either when it was in the segmentation, convex hull, or opening operation process. The coordinate of the RoI presumably contributes to this problem since the coordinate only established by the highest pixel in the fundus image. In the future, RoI could be established by considering some areas with the highest of higher intensity. It is not only the development in the pre-process that necessary but also in the segmentation. It is possible to work on the adaptive threshold equation so it becomes more robust. Despite, the sensitivity is lower than other values which indicates that the proposed method still outperform the previous method [7]. The performance comparison of the previous and the proposed method can be seen in Table 1.

Conclusion
Glaucoma is a group of progressive and multifactorial optic neuropathies that is acute and chronic. It was predicted that people with bilateral blindness caused by glaucoma will increase each year. Hence, computer-aided diagnosis of glaucoma was proposed to assist the ophthalmologist in conducting a fast and accurate glaucoma screening. One of the ocular examinations in screening procedure is optic nerve examination that is called as disc damage likelihood scale (DDLS). It is important to find the optic disc and the optic cup to determine the narrowest width of the neuroretinal rim when using DDLS. To find the optic cup, this study proposed an algorithm consists of pre-processing, segmentation, convex hull and morphological opening operation. This algorithm was applied in Magrabia dataset with the RoI size of 121 by 121. The performance evaluation of the proposed algorithm attains accuracy, specificity and sensitivity of 99.50%, 99.75%, 75.19% respectively. Despite this study outperformed the previous study, a development in the future is highly necessary to make a complete and robust system using DDLS measurement.