Color Feature Segmentation Image for Identification of Cotton Wool Spots on Diabetic Retinopathy Fundus

Fundus is an image of the inner eye surface in the form of a colored image. This image has a lot of pixel values because it consists of three basic color components. The three colors are red, green, and blue, so they need a good technique in analyzing this image. This image can be used to diagnose diabetic retinal disease caused by diabetes mellitus. This disease can interfere with human vision because objects that cover the retina of the eye is called Cotton Wool Spot (CWS). The severity of this disease can be observed from the large area of the CWS covering the retina. This study aims to calculate the exact area ratio of CWS with the retina area. The method used in this research is Image Color Feature Segmentation (ICFS). This method has four stages, namely preprocessing, segmentation, feature extraction, and feature areas. The dataset processed in this study was sourced from the Radiology Department, General Hospital of M. Djamil Padang. The dataset consists of 16 fundus images of patients who were treated at the hospital. The results of this study can identify and calculate the percentage of retinal damage is very well. Therefore, this study can be a reference in measuring the severity of diabetic retinopathy for prevention and subsequent treatment for patients and doctors. Keywords— diabetic retinopathy; Cotton Wool Spot (CWS); fundus image; feature region; pixel area.


I. INTRODUCTION
The retina is the core of the eye's tissue located behind the eyeball. This tissue functions to receive and convert light into nerve signals to the human brain [1]. If there is damage to the retina, vision will be disturbed [2]. Retinal damage is caused by complications of diabetic retinopathy [3]. The diabetic retinopathy had two types. Types were proliferative and non-proliferative [4]. Proliferative retinopathy is a severe stage. It has many brittle blood vessels so that the surface of the retina becomes damaged. These brittle blood vessels break easily, resulting in bleeding in the middle of the eyeball. As a result, proliferative retinopathy can permanently damage the retina and result in loss of vision or blindness [5].
Non-proliferative type is an early symptom. In this early stage, there are small protrusions in blood vessels (microaneurysms) due to weakened vessel walls. If the diabetic disease gets worse, this bulge will rupture. In this fraction will secrete protein and form patches called cotton wool. These patches are gray or white and will settle. These deposits are white-yellow (hard exudate), so that it affects vision. If the deposition process continues, it will form swelling in the center of the retina (macula) called macular edema [6].
One pathology of this type of advanced non-proliferative diabetic retinopathy is Cotton Wool Spot (CWS). CWS is a soft exudate, which is a blockage in the nerve fiber layer with the appearance of pale white patches like cotton [7]. CWS size is rather small and yellowish-white or grayishwhite like clouds. So, the blurred boundaries are difficult to determine [8], and presents differences in color in the fundus image that characterizes each object of diabetic retinopathy sufferers [9]. The image is presented in Fig. 1.
Fundus images such as Fig. 1 was recorded using a fundus camera [10] and was used to identify CWS [11]. The problem often occurs in the identification of CWS is the presence of noise and uneven lighting, so that the details of CWS are not observed clearly with the naked eye [12]. Thus, identification of CWS becomes difficult and difficult [13]. A better way to process fundus image processing is needed to identify CWS. Image processing plays an essential role in identifying CWS in fundamental images. Several studies have been carried out, such as the development of methods based on multi-resolution analysis with the symlet wavelet method and classifying CWS using the K-Means algorithm [14]. Machine learning systems to automatically distinguish Drusen, Exudates, and CWS [15]. Artificial Neural Networks (ANN) in detecting CWS [16]. Bank Gabor filter and Gabor threshold method for detecting CWS [17]. Other research used 3 stages, namely the use of morphological operations to remove blood vessels, the use of bank Gabor filters to improve image quality, and the use of Otsu to extract features and use Support Vector Machines classifier (SVM) for CWS classification [18]. The adaptive threshold, ant colony optimization, and methods of ant colony SVM for CWS classification [19]. Thus, the research developed a method of measuring the percentage of fundus area width to identify CWS better. This is very helpful in making the right decision to treat diabetic retinopathy patients.

II. MATERIAL AND METHOD
Research in identifying CWS on fundus color images of diabetic retinopathy patients uses several stages of the process. Each stage is interrelated and produces a new image that would be used by the next step as input. The new image generated is not stored permanently in memory; it is still temporary storage. Hence, each stage is interdependent and systematically ordered. In general, the stages of the process are grouped into four parts. The stages of the process are presented in Fig. 2.
In Fig. 2, Pre-processing consists of Gray-scaling and CLAHE methods. Segmentation covers of Otsu thresholding. Feature extraction includes Morphological methods, namely, Erosion and Dilation. The region feature consists of the YCbCr Transformation and the Region Properties. All these processes are tested on Personal Computer (PC) using Mathlab R2018a software.

A. The Input Image
The dataset in this study was sourced from the Central General Hospital (RSUP) in Padang against retinopathy diabetic patients. Lots of data tested amounted to 16 images. The data format is in the form of Joint Photographic Experts Group (jpg) with dimensions of 3,696 x 2,448 pixels. The dataset is a color image of a diabetic retinopathy patient seeking treatment at the hospital. This dataset has been diagnosed by an ophthalmologist used in research on a different topic from this study [20]. The images were recorded using a Fundus camera brand Nonmyd7 produced by Kowa Company Ltd. Recording specifications are presented in Table 1. Optic nerve head color, non-red images, 3D

B. Pre-processing
This stage is a supporting stage that must be done in this study. At this stage, the process of filtering the image of noise and pixel values irrelevant to the image is carried out. The next step, namely segmentation, would process image results from this stage. The method used in this stage is gray-scaling and contrast enhancement. The enhancement used the Contrast Limited Adaptive Histogram Equalization (CLAHE) technique. Gray-scaling is the process of converting color images into grayscale [21]. In the grayscale image, there is an intensity value based on the gray level [22]. To determine the intensity value using the formula presented in Formula (1).
Where Y (k, l) is grayscale intensity, R (k, l), G (k, l), and B (k, l) are the intensity values of red, green, and blue colors on the original goal.
CLAHE technique is used to increase image contrast by providing a limit value (clip limit) so that the image looks clearer [23]. The contrast value given must be limited so that there is no excessive contrast increase in the histogram [24]. To calculate the clip limit of a histogram using Formula (2).
Where M represents the area, N represents the gray value (256), and α is a clip factor that states the addition of a histogram with a value ranging from 0 to 100.

C. Segmentation
The segmentation process stage is dividing the image into several regions. The segmentation process to separate objects from the background. The segmentation process is carried out using Otsu thresholding and binary thresholding. Otsu is the best performing segmentation compared to the advanced techniques in fundus images [25].
Otsu thresholding is used to determine the threshold value by distinguishing two parts between the observed object and the background. Threshold values must be optimal and rely on each other based on the histogram. The threshold value of the optimal threshold is presented in Fig. 3.
In Formula (3) it is used to find the probability that Pb is the probability of the b-level; this is the number of pixels at the b-level. N was the total of pixels. Formula (4) is used to find the zeroth cumulative moment value, Formula (5) is to find the first cumulative moment, Formula (6) is used to calculate the total average value. To determine the threshold value, you can maximize it with Formula (7) and Formula (8).
After the threshold value is obtained, the binary is performed. This thresholding technique aims to convert the background value to black and change the color of the object to white. If the image has a pixel value that exceeds the threshold value, the image will be mapped to the desired value [26]. In Formula (9) is the equation used to get binary thresholding.
Where H is the threshold value, x (k, l) is the pixel of source, and g (k, l) is the pixel of the result after the threshold is done. The process of binary thresholding is presented in Fig.  4.

Fig. 4 Binary thresholding process
If a pixel value higher than the threshold, than the pixel will be replaced by 1, but if a pixel value smaller than the threshold, then the pixel replaced with 0 [27].

D. Feature Extraction
Feature extraction functions to take the characteristics of objects contained in the image. This feature can define the characteristics of an object. In the feature extraction process using erosion and dilation operations contained in the mathematical morphology method [28]. Where this method requires the element structure (strel), while the strel used is the disk type. The matrix form of the disk is presented in Fig.  5. Erosion operation is the process of eroding objects in an image [29]. The erosion occurs because of a pixel reduction operation in the process of image pixels with strels. The erosion equation is presented in Formula (10).
Where g (k, l) is the result of morphological erosion, f (k, l) is an object, and SE is a structural element (strel).
Dilation operation is the process of thickening an object in an image [30]. Thickening occurs due to the operation of adding pixels in the process of pixel images with strings. The dilation equation is presented in Formula (11).
Where g (k, l) is the result of dilation morphology, f (k, l) is an object, and SE is a structural element (strel).

E. Feature Region
The region features functions to calculate the area of an object in an image. The region features in this study carry out two processes, namely the YCbCr color transformation and the property region. The YCbCr method has 3 color components, namely Y as the brightness level, Cb as the blueness level, and Cr as the redness level. Relationships between these color components can be exchanged [31], and the relationships between colors are presented in Fig. 6. The result of the conversion into the YCbCr color space, proceed to the object detection process based on the Cb value. Cb value used to detect objects between 110 and 125. The results of this object detection are used in the property region process to count the number of pixels in the object [32]. Pixels are calculated using the ellipse-shaped approach presented in Fig. 7. Fig. 7 Representation of the region with the ellipse approach In Fig. 7, there is a blue line as the axis, the red dot is the focus, and the orientation of the angle is between the horizontal dashed line, and the main axis [33].

III. RESULTS AND DISCUSSION
In this study presented one test image of 16 images of patients with diabetic retinopathy. The input image, which has a pixel size of 3,696 x 2,448 in JPG format of one of the patients contained CWS is presented in Fig. 8. Fig. 8 One patient input image The next step is pre-processing with gray-scaling and CLAHE techniques. The results of this pre-processing are presented in Fig. 9. In Fig. 9 of part (a) shows that there has been a change in the color of RGB to grayscale, but the object that appears not prominent yet. To sharpen this object, sharpening is done using CLAHE. The image of the results of this process is presented in Fig. 9 (b), where the low group gray level is lowered, and the high group is raised higher. Hence, a significant change in value is seen, and the object can be identified. After the pre-processing stage is completed, the next stage is segmentation using Otsu thresholding and binary thresholding techniques. The results of these two processes are presented in Fig. 10.  Fig. 10 there has been a change from grayscale image to binary, where the object has a value of 1 while the background has a value of 0. This change occurs because the object has a gray value that changed to 1-while the background has a lower gray value from the threshold value, then replaced with the value 0. At this stage, the object can already be distinguished with a more transparent background. The drawback of this result is that it still has noise about pixels that are scattered randomly and irregularly.
The results of the segmentation process are continued by feature extraction using erosion operations and dilation in mathematical morphology. Erosion operations aim to reduce the pixel on an object so that small objects will disappear, and large objects will shrink. This process automatically removes noise, but the size of the object shrinks, so it does not match its original size. To return the size of the object to its original size, a dilation operation is performed. The results of this operation are shown in Fig. 11. The image in Fig. 11 shows that no longer has noise, and objects can appear clearly from the edge detection of each object. In the objects that are seen, there are two types, namely CWS and an optical disk, so that CWS objects cannot be identified yet. For this reason, the regional feature stage is performed to distinguish CWS objects from optical disks. The process steps undertaken are the YCbCr color transformation and region properties. The results of the region feature stage are presented in Fig. 12. In Fig. 12 (a), the RGB color changes to the YCbCr color in the input image. The YCbCr color space is extracted by the Cb value component to get the CWS object. This Cb value is used for image results from feature extraction. The results of this process are presented in Fig. 12 (b), where the CWS object has been identified with a yellow boundary. To calculate the area size of the CWS object, the region properties process is used. This process can count the number of pixels circled by a yellow boundary. The results of calculating the number of pixels per object are presented in Fig. 12 (c) and the total value of the total CWS object area is 359.650 pixels.
The fundus color images can also be obtained by the number of pixels from the entire area of the retina by using region properties. After knowing the number of CWS areas and the overall retinal area, a comparison of CWS areas with retinal areas can be made using the equation (12).
The ratio value is obtained from the division between the CWS area and the retina area, then multiplied by 100%. The CWS area value is obtained from the calculation of the number of CWS pixels, while the retina area value is obtained from the calculation of the number of retinal pixels. The results of the calculation ratio of the CWS area are shown in Table 2.

IV. CONCLUSION
From the results of the fundus color image processing of diabetic retinopathy patients, it was concluded that CWS can be identified very well. From the identification results it can be calculated the area of the CWS in units of pixels and can be determined outside the CWS ratio compared to outside the retina. So, the results of these ratios can help patients and ophthalmologists in making quick decisions to be able to take proper prevention and care.