Prediction of different stages in Diabetic retinopathy from retinal fundus images using radial basis function based SVM

Objectives: This study proposes an automatic computer-aided screening system for prediction of Diabetic retinopathy (DR) by using image processing and machine learning techniques.Method: This proposed model can predict DR in three different stages, Normal, Non-Proliferative Diabetic retinopathy (NPDR) and Proliferative diabetic retinopathy (PDR) based on the features those are present in an input retinal fundus image using support Vector Machine(SVM). For better feature extraction each input retinal fundus image is pre-processed using three techniques; Image compression, Color layer separation and Contrast Limited Adaptive equalization (CLAHE). After pre-processing, the feature extraction is done using different techniques like Linear Spatial filtering, image thresholding and Top-hat operation for extraction of different features like micro aneurysms, blood vessels and exudates respectively. These extracted features are used for designing the classifier. Different kernels of SVM have been applied to the same set of feature and compared. Findings: Finally, Radial Basis Function(RBF) based Kernel SVM outperform others with an accuracy value of 97.2% using a test dataset of size 255 images. Novelty: As the model addresses three class classification of DR with a vast set of feature matrix, it performs well in detection of DR at its earlier state even with minimum feature set.


Introduction
For the detection of diabetic retinopathy, the most crucial and important step is to correctly identify features responsible for diabetic retinopathy present in the retina image. In (1) , described various deep learning techniques for the recognition of exudates. It obtains accuracy, sensitivity, and specificity by using above approaches.
https://www.indjst.org/ It also uses the predefined deep learning model for the classification purpose i.e. "Resnet-50". Along with the pre-defined model, it also uses the SVM classifier as well as an automated and efficient classification of the exudates. In (2) , described a self-regulating method for the detection of diabetic maculopathy. The recommended method is performed in two phases. The pre-processing period is the first phase. In this phase, the retinal images are enhanced and the optic disc is eliminated. The above step is done to avoid incorrect detection at the phase of bright lesion identification. In the second phase, features are detected using green and blue color images. The locations of the macula and fovea are determined. All the above steps are processed by establishing a relation between the blood vessels along with the optic disc and macula. The proposed algorithm is tested upon 1374 images. It obtains an accuracy of 98.92%. In (3) the combination of different classifiers along with the back propagation of the neural network is used to enhance accuracy. The database is divided into four categories. Different images from the different sources are taken and processed. The accuracy achieved by evaluating one fundus image database is maximum i.e. 97.02%. The accuracy attained from the mixed database fundus image is 87.32%. In (4) , blood vessels are taken into account for the precise and efficient classification of the exudates. Firstly, edge detection and segmentation are performed for the accurate characterization of the width of the blood vessel. The detection of the optic disc is accomplished using the Hough Transformation approach. Then the blood vessel hierarchy and the optic disc are eliminated to get the exudates. This approach gives a growing sensitivity i.e. 80% and specificity i.e.100%. In (5) , researchers used deep CNN technique for exudates classification. The main objective of the paper is to calculate the area of the exudates. With the assistance of the calculated area, it will be easy to predict diabetic retinopathy and helps in the process of treatment in an early stage. From the above-segmented image, the accuracy obtained is 78%. In review article (6) , different techniques for the classification of the various features like haemorrhages, blood vessels, and microaneurysms are reviewed and compared. The paper gives a comparison of the tentative results of various parameters like sensitivity, accuracy, specificity, and area under curve accuracy and concludes that algorithm of deep neural network obtains best result. In (7) , different machine learning algoritms used to detect the DR. The main focus of the paper is reduction of feature, it reduced the number of features from 72 to 30. By the help of feature reduction the time complexity of the classifier reduced to 3.46sec instead of 59.54sec per each RGB retinal images with with a sensitivity of 100% and specificity of 53.16%. In literature (8) , the CNN method is used to predict diabetic retinopathy from the digital retinal images. The CNN architecture helps it to capture the complicated features of DR at its own intermediate layers and the same are used as the input for the next set of layers to predict the output. The network is trained in a high-end graphics processing unit with the available dataset. Experimented upon 5000 validated images, the CNN attains a sensitivity of 95% and an accuracy of 75%. In (9) , the prototype is trained with three different methodologies i.e. CNN, DNN, and back propagation. The techniques are proficient to enumerate the features into different modules. The prototype will help to recognize the viciousness of the diabetic retinopathy. In literature (10) , the defined model is based on the feature like micro aneurysms and the growth of new blood vessel i.e. neovascularization. The above method uses a spectrally tuned AutoCC feature and framework of ML for image classification purposes. Literatue (11) , Image processing technique combined with data mining is used for the detection of diabetic retinopathy. The preprocessing of the image is done using KNN, Sobel edge detection, ellipse fitting, and histogram thresholding. After the pre-processing phase, further data mining techniques i.e. Decision Tree algorithm is implemented to classify an image as normal or affected. In (12) a convolutional neural network is used. It deals with binocular fundus images in the form of input and their relationship makes it easier for prediction. The training phase and testing phase have 28104 and 7024 images respectively. The difference between the monocular and the binocular model is 0.011. They address 5 category classifications that achieve a kappa score of 0.829 which is more than the prevailing models. In (13) , various machine learning techniques like Probabilistic Neural network (PNN), Support vector machine (SVM) and Bayesian Classification are used to predict the output and the comparison is based on the performance. The total number of images used for the model is 350. Out of 350 images, 250 images are used for the testing purpose and rest 100 images for training. The achieved results of different classifiers are i.e., for Bayes classifier the accuracy is 94.4%, for PNN 89.6% and SVM 97.6%. In (14) , a collective micro aneurysms detector is used for prediction. The main aim of this system is to choose an algorithm with an optimum combination. In this referred model, 1200 images present in the Messidor database are assessed to achieve grading performance. From the following operation, the achieved AUC Value is 0.90±0.01. In (15) , a segmentation technique based on exudates detection is performed using Image normalization and histogram analysis. This model can handle real time data with average exudates detection time 9 sec per image. In (16) , one Morphology based method is defined for selection of features. The paper intends elucidation by placing forward the matter of retinal red lesions which are known as micro aneurysms. The methodology is conveyed with a lesion detection approach for distinguishing between the normal and affected retina. In (17) described a model that can be used to detect DR at its earlier state. This is a three class classification model which uses Random forest method to predict whether an input image is coming from normal, moderate or NPDR class. For achieving this, they consider a set of features like blood vessel, quantification as well as haemorrhages. The accuracy of the model for normal retina image is 90% whereas for PDR 87.5%. Similar to (14) , another piece of literature (18) , addresses the same problem i.e. detection of hard exudates present in the peripheral lining of the retina using https://www.indjst.org/ CNN, which achieves an AUC of 97% on training and 95% on validation.
In this work, a system is developed to study the retinal image captured from a fundus camera and predict whether it is affected by DR and the stage of DR as shown in [ Figure 1]. In initial phase, each image goes through a pre-processing phase that includes resizing, image enhancing using CLAHE and green channel extraction for precise feature extraction. After pre-processing, features like blood vessels, micro aneurysms, and exudates present in the retinal image are extracted using different image processing techniques like Linear Spatial filtering, image thresholding and Top-hat operation respectively. Then the extracted features are supplied to SVM classifier using its different kernel models like linear, polynomial and radial basis function (RBF) individually, for the prediction of DR and its type i.e. type-0 Normal, type-1 Non-Proliferative Diabetic retinopathy (NPDR) and type-2 Proliferative diabetic retinopathy(PDR).

Methodology
The proposed model is broadly defined in 4 different phases. These are:

Data acquisition
The data set used for this model is collected from kaggel repository and contains 2248 retinal images. Out of the total images, 1993 numbers of images are used for the training purpose and the rest 255 images are used for testing the model as presented in [ Table 1 ].

Image processing
Image processing is the technique of processing the image in the best way possible to fit the model and provide the highest accuracy. To do so features in the image must be distinctively enhanced. In the case of Fundus Retinal images, the images are captured in RGB format as shown in [ Figure 3](a). An RGB image is not useful to provide features needed for defining the model. Therefore, each RGB image has gone through different phases to make it ready for modelling. https://www.indjst.org/

Compression
The Fundus images are images with a very high resolution. High-resolution images, when provided to a model, don't give the best accuracy. Hence, it is needed to segregate the features area of certain abnormalities in the retina. Images with different resolutions will result in varying areas. Therefore, compressing the images to a particular lower resolution will give more accurate area density and can also best fit to a model. For that, all images are compressed to a resolution of 512 * 512.

Layer separation
RGB images are not suitable to segregate features perfectly for the defined problem. So the images are separated according to their major color channels i.e. Red channel, Green channel and the Blue channel. The green channel image has the highest intensity in which some features like the blood vessels, exudates, and retinal haemorrhages are more noticeable (13) . So, the green channel image is further referred in the rest of the steps.

Histogram equalization
Histograms equalization is a method of contrast enhancement technique that increases the intensity in the image. This is done by stretching out the most frequent intensities in the image. Here, Contrast-Limited Adaptive Histogram Equalization (CLAHE) algorithm is used to enhance the contrast. The CLAHE is a variant of adaptive histogram equalization which enhances the pixels up to a certain range and helps in the reduction of noise (13,16) . After applying CLAHE, the produced output image gives a very distinctive view of blood vessels and exudates as shown in Figure 3 (b).

Feature detection and extraction
Feature detection and extraction is the 2 nd phase of the proposed model to identify and extract the essential features those are present in retinal image and helpful in DR prediction shown in [ Figure 2]. For the better prediction of DR in this model, we are detecting and extracting the following features.

Optical disk detection and elimination
The optical disk is a circular and largest region in the fundus image. After pre-processing the image, if it is directly used for exudate detection then, the optical disk is also considered as an exudate region which creates a problem for the model in upcoming phases and finally hampers the accuracy of prediction. So the optical disk is masked to remove it from the list of https://www.indjst.org/ all features. In pre-processed phase, the optical disk is identified as a large white circular region at the center. Thereafter, the pre-processed image is morphologically enhanced using the closing operation, which results a blurry image that helps to detect the optical disk. After the optical disk is recognized it is eliminated using a mask. The mask is added on top of the optical disk to block it from further detection (2,5,6) .

Exudates detection
Exudates are the abnormal growth in the retina. Generally, the exudates appear like a pressurized nerve and its surrounding. To detect the exudates, the contrast of the pre-processed image is enhanced using morphological operation. This morphological operation increases the brightness of the image. Then Top-Hat operation is applied to the image. The top-hat results in the subtraction of the background and give a blurry vision of the exudates. Then the resultant image is threshold and binary opens. This helps in distinct identification of individual exudate regions in each retinal image, where each exudate region appears as a white pattern around the optical disk and at the borders (5,16) . The exudates are then superimposed on the original image which pops out the exudates of the original image as shown in Figure 3 (c).

Blood vessel extraction
Blood vessels are one of the important parts of our whole body. They circulate blood all over our body including our eyes and retina. So when we look at a fundus image of the retina, the blood vessels are easily identifiable. But if an image is diabetic retinopathy affected, we can see tiny overgrown blood vessels around the optical disc. Those blood vessels can be categorized as the most important feature for diabetic retinopathy. For detection of the blood vessels, each pre-processed retinal image goes through a special type of filtering technique known as Alternative Sequential Filtering (ASF). This produces an image with an average intensity for each region. Then the output of this image is further subtracted from the previous image i.e. CLAHE applied image to extract the faint traces of blood vessels. The output image again becomes the threshold which improves the contrast of the blood vessels (4,16,17) . The additional noise is removed using the Gaussian filter and the resultant image gives the segmented blood vessel as shown in Figure 3 (d).

Micro aneurysm detection
Micro aneurysms are microscopic red dots present around the optical disc in the retina. They appear in the first stage of diabetic retinopathy. A person having micro aneurysms is a potential victim of diabetic retinopathy. These microscopic particles measure around 25 to 100 µm in diameter and are nearly invisible to the naked eye. However, they can be detected and used as a feature https://www.indjst.org/ for detection of DR. For micro aneurysm detection, first the negative of pre-processed image is considered. This results in the conversion of all black spots into white and all white to black. Then linear spatial filtering is implemented on the image. This technique changes the intensities of the pixels by taking the neighboring pixels into account. Lastly image thresolding helps to capture the micro aneurysms (7,14,16) . They appear like tiny white dots on a completely black surface as shown in Figure 3 (e).

Building the model
The proposed model is a multiclass (three) classifier which classifies an input retinal image as in one of the three class i.e Normal, NPDR or PDR. For modelling the classifier, we have tried different kernel functions with SVM. A Kernel function transforms the training data so that a non-linear decision surface is transformed to a linear equation in a higher number of dimensions. Linear discriminant functions can provide very efficient 2-class classifiers, provided that the class features can be separated by a linear decision surface. For many domains, it is easier to separate the classes with a linear function if we can transform our feature data into a space with a higher number of dimensions. One way to do this is to transform the features with a "kernel" function (19,20) . In this study, three different kernel functions are used.

Linear kernel
It is the simplest kernel function. This can be calculated by the discriminant in an inner product space, Where − → W will be learned from the training data and this will give us,

Polynomial kernel
Polynomial kernel is a commonly used kernel in SVM classifier. It is a non-stationary kernel and is used where the training data is normalized. It is calculated by increasing the power of the kernel as mentioned in eq. (3).
Where n is the "order" of the kernel, and c is a constant that allows trading off the influence of the higher order and lower order terms.

Radial basis function (RBF)
RBF or Gaussian Kernel is another type of kernel, are often used in Computer Vision. Here the kernel is in the form: Where for all N point samples, − → X n Can be generated from the training data and the term − → X − − → X n can be calculated as the Euclidean distance from the set of points Then we can normalize the Euclidean distance in eq. (4) by dividing a smoothing parameter and the equation can be rewritten as eq. (5) These entire three different kernel functions are used individually with SVM for creating different models using the common feature matrix that is generated from the Feature Detection and Extraction phase and tested for prediction of DR. This whole process can be defined using a block diagram as shown in [ Figure 4]. https://www.indjst.org/

Result and Discussion
The efficiency of the classifier is evaluated in terms of average weighted precision, specificity and sensitivity as shown in eq. (7). This equation is based on the derived eq.(6), which can be calculated by 4 potential outcomes i.e. true positive (TP), false positive (FP), true negative (TN) and false negative (FN) [21].
Where the C1, C2, C3 are the size of different class those are class-0, class-1, class-2 which represent normal, NPDR and PDR respectively. The algorithm has been evaluated using 255 test cases (67 normal, 86 NPDR and 102 PDR) retinal images. Each set of images went through all three different classifiers and the different test results that we have obtained for individual class are listed in a tabular form shown in [ Table 2].  TP  FN  FP  TN  TP  FN  FP  TN  TP  FN  FP  TN  NORMAL 67  63  4  6  182  64  3  5  183  65  2  3  185  NPDR  86  79  7  4  165  80  6  3  166  82  4  2  167  PDR  102  100  2  3  150  100  2  3  150  101  1  2  151 In [ Table 2], for individual classifiers the different test results of each individual class in terms TP, FP, FN and TN are tabulated and these values are used to obtain the Accuracy comparison matrix as shown in [ Table 3].
[ Table 3], individual procession, sensitivity and specificity values for every class are listed for different classifiers, which are calculated by applying values those are listed in table-II on eq-6. These generated values are again applied on eq-7 to calculate the weighted average precision, sensitivity and specificity for each classifier. And finally the table represents the overall accuracy of the classifiers. In [ Figure 5], the ROC curve is defined for Comparison of different classifiers, in which the x-axis of the graph shows (1-Specificity) acknowledged as False Positive Rate (FPR) and the y-axis of the graph shows Sensitivity known as True Positive https://www.indjst.org/ Rate (TPR). In [ Figure 6], another comparison curve is defined known as presion recall curve, where the x-axis of the graph illustrates the Recall known as sensitivity and y-axis of the graph shows Precision value. Finally, [ Figure 7], gives the overall accuracy comparison between different classifiers using the same set of test images.
From the above set of produced tables and graphs, it is pretty clear that all different versions of classifiers defined using three different kernels of SVM are producing encouraging results with our dataset. Again the set of features that we have extracted and combined together for creating the future matrix are responding well for the defined problem. Finally, out of these three models the model defined using RBF kernel is the best among all three which has an overall accuracy of 97.25% in comparison to other two 94.9% and 95.68% for linear and polynomial kernels respectively.

Conclusion and Future Work
This study has used three different features i.e., micro aneurysms, blood vessels and exudates present in the retinal image for modelling the classifier, which makes it very powerful for addressing the multiclass classification problem. Based on the produced results and the analysis, we can conclude that all the three defined models are working fine for prediction of DR. But SVM with RBF kernel produces the best result with an overall accuracy of 97.25%. Future work can be done by applying these set of features on more powerful machine learning algorithms like convolutional neural network.
Although the proposed model performs well in detection of DR at its various stages, but it also has its own limitation in terms of computational overhead due to its large features list. So, in future this work can be extended to design a lightweight classifier that can produce result in real time.