Title: contribute in the detection of Diabetic Retinopathy









Title: Deep Learning for Detecting Diabetic Retinopathy


Abhijitsingh Putu Gaonkar, Sanjiban Sekhar Roy



is the dissolute epidemic universally, specifically in the Indian society. This
is leading to an overabundance of Diabetes which spreads syndromes like Diabetic
Retinopathy. It is necessary to develop an automated diagnostic model to expand
the work of the Ophthalmic and condense morbidity of the patients. Diabetic
Retinopathy can hence be stated briefly as the damaged caused to retinal blood
vessels because of complications of the diabetes, leading to the loss of
vision(which in this case is irreversible) subsequently. Retinal screening is a
possible solution for diagnosis of the damaged caused to retina at initial
stages. 5 Diabetic Retinopathy is asymptotic initially and hence most of the
patients remain unaware of the condition unless it have emotional restricts
their vision. Therefore, prior and consistent screening of Diabetic Retinopathy
is essential in order to avoid further difficulties and to control progression
of disease.  A key symptom of Diabetic
Retinopathy is exudates 15, which may be bagged in the fundus image of the
eyes and is a sign of developing Diabetic Retinopathy in the patient or he may
already has developed it. Discovery of lesions in the fundus images may also
contribute in the detection of Diabetic Retinopathy at early stage. 7 To
study Diabetic Retinopathy, ophthalmologists often consider the color fundus
images, considering various feature elements related to Diabetic Retinopathy,
such as hemorrhages, soft and hard exudates and micro aneurysms (MA) which are
mini chambers like arrangements induced by local distension of the capillary
walls, visible as tiny red dots.

study and overcome these problems, the paper focuses on to get optimal model
through machine learning, which will include the preprocess dataset and apply
KNN, SVM, Random Forest and BP Neural Network with Sklearn python package, Neural Networks (NN) and the Convolution Neural
Networks (CNNs).

further proceeding, these mechanisms are followed by image preprocessing and
classification for enhancing the accuracy of the later steps. The preprocessing
of image starts with conversion of given image features to gray scale to carry
out the further analysis. The imaging classification steps works for
classifying the images according to the listed features, thus getting the
desired results. For the working considering Diabetic Retinopathy, for 6 the
image-based tactics, the provided retina image may be divided in several small
sub-images. The work also involves reduction of noise as well for obtaining enhanced
image and accurate data.



In this study fundus images containing diabetic retinopathy has been
taken into consideration. The idea behind this paper is to propose an automated
knowledge model to identify the key antecedents of Diabetic Retinopathy. The
Deep Learning models are capable of quantifying
the features as blood vessels, fluid drip, exudates, hemorrhages, and micro
aneurysms into different classes, and will calculate the weights which gives
severity level of the patient’s eye. The model will be helpful to the eye
experts for proper screening and cure essentially
for the patient.




Fuzzy C-Means:

The processed image have perhaps have some feature loss during the
resizing or filtering. The image levels can get changed because of that. Fuzzy
C-means is a standard clustering mechanism works very well to identify the membership
(µij) information out of the image 19. The cluster center update

And the centers (vj)
gets updated according to:

By using FCM clustering the given level and clustered image levels have
been compared to make the training levels valid. The idea behind using FCM is
because of the data points are not mandatory to be under one cluster center,
here data points are given to the membership of each cluster centers, because
of this nature one data point can be under multiple cluster centers2021.


Neural Networks with Multilayer Perceptron:

The first NN model considered is NN with multilayer perceptron. It’s a
basic NN model having multiple layer of computational units inter connected via
feed forward way 23. The activation function used here is the “sigmoid”
function 24. The algorithm used is the traditional “Back Propagation”  =. The nurons for Perceptron modeling is being calculated through. The epoches has being selected based on multiple runs of the NN model.


Figure: Neural Network
Perceptron Model for Statistical data


Deep Neural Network (DNN):

After validate the accuracy result of NN model with testing samples, the
next DNN models have been implemented. The idea of apply this model to check
the accuracy with the NN model. Model accuracy definitely will differ because
of utilizing with multiple hidden layer concerning input plus output 26 27.
The multiple layer extracts features from lower level of layers and increases
the potential of a small network 26. In DNN model as algorithm “Back
Propagation” is being used 31 32. Some of the study suggested that even for
sparse network “Back Propagation” performs well 28. The weight updated in
back propagation via “stochastic gradient descent” algorithm,

Here, ? is assigned as learning rate, C is considered as cost
function, and ?(t) a tpye of stochastic function. The method of DNN having
three Fully Connected (FC) layer. Two activation layer with “ReLU” as
activation function, for building model “Tanh” and “Sigmoid” activation
functions also but “ReLU” performs better thn other two approaches. “ReLU” uses
smooth rough calculation to the rectifier,. The main activation function defined as. The ReLU considered as the most popular activation function as for
Computer Vision 2829. The DNN model uses one softmax layer or normalized
exponential function as,  where, Pj represents the
class probability (output of the unit j) and xj and
xk represent the total input to unit’s j and k of the
same level respectively. Cost function defined as,  here, dj represents the target probability for output unit j and Pj
is the probability output for j after applying the activation function 30.
Both NN and DNN has been carried out on both statistical data of diabetic
images and also processed retinopathy images. The difference is came for the
training time of the both technique. During work out sessions with DNN,
statistical data taken less time than image data. Figure 8 showing the deep
learning model used in training of image data.

Figure: Structure of Deep
Neural Network


Convolutional Neural Network (CNN):

Only image data is being trained for CNN model. Processed images with
single band has been given as an input of the network with given levels. The
CNN model have been considered is the VGGnet model. The VGGnet 39 model
structured of CONV layers which performs 3×3 convolution alongside stride: 1
and pad: 1, and of POOL layers which performs 2×2 maxpooling with stride: 2. there
is no padding existed in the network. The network trained with CPU support. As
activation function ReLU has been used. All convolutional layers are followed with
Maxpool used in the pooling layer for extracting the most significant feature
between the image pixels. VGGnet works very well with dense featured images. As
per model there is no normalization layers used here, because either way it
does not improve the accuracy of the model.

Figure: CNN model for image




In this project we mainly used
OpenCV for preprocessing the image data like read the image into array and
reshape into the size we need :

The first part: Preprocess
dataset and apply KNN, SVM, Random Forest and BP Neural Network with sklearn. The problem with the other models is mainly there
preprocessing of the images and model building patterns. Most of the studied
literature lacking the image pre-processing steps which might leads to
erroneous result. This study is considered on preprocessing of images through
various filter mechanisms which enhances the features of the image. Another
approach discussed in this study about extracting statistical features out of
the image, the idea was to extract information out of the resized image of 2000×2000,
because of high resolution gives better exploration. A problem of image
training can arise because of image resize factor, because of lack of
computation power in systems the image are being resized in some of the papers,
because of this feature loss factor can arise and the image labels can varied.
To overcome this problem Fuzzy C-means clustering (FCM) has been used, the idea
behind using FCM is to find out cluster levels of the training data for
increase training accuracy. Feed Forward-NN and CNN all having different
capabilities in terms of training and predicting, a comparison of this three
models will give the proper adaptation of model. Both images and statistical
data are trained with all neural network model, to justify the difference of
using statistical method and Image processing method. FCM has been used in both
cases to identify the class labels.


Step 1:

Extracted the statistical features from unprocessed
RGB images. (average, median, standard deviation, skewness,
root mean square error, mean absolute deviation, quartiles, minimum, maximum
& threshold level)

Step 2:

RGB image
taken and converted into grayscale for image filtering (Median filter,
Morphological processing), applied edge detection for feature extraction from
images and binary conversion of image to highlight all feature.

Step 3:

Statistical data taken into consideration for image classification with Feed
Froward Neural Network (FNN) for classification, After that Deep Neural
Network) performed and compared the result with FNN.

Step 4:

image classification done on processed images with Feed forward Neural
Network (FNN) model and Deep Neural Network (DNN) model.

Step 5:

Convolutional Neural Network (CNN) on processed images (VGG16 model)

Step 6:

Both the
result of Step 3, Step 4 and Step 5 have been compared as per performance and
accuracy measurements with testing image set.





Dataset Labels

KNN Raw Pixel

KNN Histogram

MLP Raw Pixel

MLP Histogram

2 labels

K=1, 63.45%

K=1, 45.64%



5 labels

K=1, 63.40%

K=1, 46.74%




Dataset Labels

SVM Raw Pixel

SVM Histogram

RF Raw Pixel

RF Histogram

2 labels





5 labels






From the result we can see:

In k-NN, the raw pixel accuracy
and histogram accuracy are relatively same. In 5 labels sub-dataset the
histogram accuracy is a little bit higher than raw pixel, but overall, the raw
pixel shows better result. In the neural network MLP classifier, the histogram
accuracy is much lower than raw pixel accuracy. For the whole dataset (5
labels), the histogram accuracy even lower than random guessing.

In the SVM classifier, both the
accuracy are relatively same.

In the Random Forest classifier,
the histogram accuracy is much higher than raw pixel accuracy.

All these 4 sklearn methods do
not give very good performance, the accuracy for recognizing the right category
is only about 45% in the whole dataset (5 labels dataset). These results reveal
that using sklearn methods for image recognition are not good enough. They are
not able to give good performance for the complex images with many categories.
But when comparing to the random guessing, they do have made some improvement,
but not enough. Based on the results, we found that in order to improve the
accuracy, its necessary to use some deep learning method.


considered as highly rated model for image vision, model trained with 1000
images having accuracy of 72.5% with VGGnet model. The model trained with CPU
support which made an impact on training accuracy. For testing the model, 300
images have been considered, as for result concerns both the normal retinopathy
images and Proliferative diabetic retinopathy images haven predicted perfectly
by the model.



paper is about proposing an optimal model for Diabetic Retinopathy detection.
Processing of Retinopathy images is very essential to get proper features. Statistical
values can predict level of severity properly but in case of noisy images the
chances of getting poor data will lead to lower accuracy. For getting better
result selecting for proper features out of the image also important. Both CNN
and DNN models are effective in term for image, because of CPU training
accuracy level of CNN getting affected in the study, in this case DNN
outperforms CNN for training accuracy as well as validation accuracy. For
future work model can train with GPU system, with more number of processed data
for getting higher accuracy result. A standalone application will be good for
identification of retinopathy images.



Deep learning; Machine Learning,
Diabetic Retinopathy.




Abhijitsingh Gaonkar is pursuing his
M.Tech in Computer Science and Engineering with Specialization in Big Data
Analytics at the age of 24 years from VIT University of Vellore, Tamilnadu –
India and B.E studied from PCCE, Goa University, Goa – India, working as an MTS
(Intern) in NetApp Pvt ltd India.



Raman, Valliappan, Patrick Then,
and Putra Sumari. “Proposed retinal abnormality detection and
classification approach: Computer-aided detection for diabetic retinopathy by
machine learning approaches.” Communication Software and Networks
(ICCSN), 2016 8th IEEE International Conference on. IEEE, 2016.

Singh, Neera, and Ramesh Chandra
Tripathi. “Automated early detection of diabetic retinopathy using image
analysis techniques.” International Journal of Computer
Applications 8.2 (2010): 18-23.

Soomro, Toufique A., et al.
“Role of Image Contrast Enhancement Technique for Ophthalmologist as
Diagnostic Tool for Diabetic Retinopathy.” Digital Image Computing:
Techniques and Applications (DICTA), 2016 International Conference on. IEEE,

Zhao, Yitian, et al.
“Intensity and Compactness Enabled Saliency Estimation for Leakage
Detection in Diabetic and Malarial Retinopathy.” IEEE Transactions on
Medical Imaging 36.1 (2017): 51-63.

Prasad, Deepthi K., L. Vibha, and
K. R. Venugopal. “Early detection of diabetic retinopathy from digital
retinal fundus images.” Intelligent Computational Systems (RAICS),
2015 IEEE Recent Advances in. IEEE, 2015.

Nandy, Jay, Wynne Hsu, and Mong Li
Lee. “An Incremental Feature Extraction Framework for Referable Diabetic
Retinopathy Detection.” Tools with Artificial Intelligence (ICTAI),
2016 IEEE 28th International Conference on. IEEE, 2016.

ManojKumar, S. B., R. Manjunath,
and H. S. Sheshadri. “Feature extraction from the fundus images for the
diagnosis of Diabetic Retinopathy.” Emerging Research in Electronics,
Computer Science, and Technology (ICERECT), 2015 International Conference on.
IEEE, 2015.

Gulshan, Varun, et al.
“Development and validation of a deep learning algorithm for detection of
diabetic retinopathy in retinal fundus photographs.” JAMA 316.22
(2016): 2402-2410.

Gardner, G. G., et al.
“Automatic detection of diabetic retinopathy using an artificial neural
network: a screening tool.” British journal of
Ophthalmology 80.11 (1996): 940-944.

Sivakumar, R., et al.
“Diabetic retinopathy analysis.” BioMed Research
International 2005.1 (2005): 20-27.

Roychowdhury, Sohini, Dara D.
Koozekanani, and Keshab K. Parhi. “Dream: Diabetic retinopathy analysis
using machine learning.” IEEE journal of biomedical and health
informatics 18.5 (2014): 1717-1728

Wernick, Miles N., et al.
“Machine learning in medical imaging.” IEEE signal processing
magazine 27.4 (2010): 25-38.

Rakshitha, T. R., Deepashree
Devaraj, and SC Prasanna Kumar. “Comparative study of imaging transforms
on diabetic retinopathy images.” Recent Trends in Electronics,
Information & Communication Technology (RTEICT), IEEE International
Conference on. IEEE, 2016.

Vo, Holly H., and Abhishek Verma.
“Discriminant color texture descriptors for diabetic retinopathy
recognition.” Intelligent Computer Communication and Processing
(ICCP), 2016 IEEE 12th International Conference on. IEEE, 2016.

Patil, Priyadarshini, et al.
“An efficient method of detecting exudates in diabetic retinopathy: Using
texture edge features.” Advances in Computing, Communications and
Informatics (ICACCI), 2016 International Conference on. IEEE, 2016.

Williams, R., et al.
“Epidemiology of diabetic retinopathy and macular oedema: a systematic
review.” Eye 18.10 (2004): 963-983.

Bezdek, James C., Robert Ehrlich,
and William Full. “FCM: The fuzzy c-means clustering algorithm.” Computers
& Geosciences 10.2-3 (1984): 191-203.

Saine, Patrick J., and Marshall E.
Tyler. Ophthalmic photography: a textbook of fundus photography,
angiography, and electronic imaging. Butterworth-Heinemann, 1997.

Chuang, Keh-Shih, et al.
“Fuzzy c-means clustering with spatial information for image
segmentation.” computerized medical imaging and graphics 30.1
(2006): 9-15.

Fuzzy c-means
by Balaji K and Juby N Zacharias.

Cai, Weiling, Songcan Chen, and
Daoqiang Zhang. “Fast and robust fuzzy c-means clustering algorithms
incorporating local information for image segmentation.” Pattern
recognition 40.3 (2007): 825-838.

Sinthanayothin, Chanjira, et al. “Automated
localisation of the optic disc, fovea, and retinal blood vessels from digital
colour fundus images.” British Journal of Ophthalmology 83.8 (1999):

Hornik, Kurt, Maxwell Stinchcombe,
and Halbert White. “Multilayer feedforward networks are universal
approximators.” Neural networks 2.5 (1989): 359-366.

Cybenko, George.
“Approximation by superpositions of a sigmoidal
function.” Mathematics of Control, Signals, and Systems
(MCSS) 2.4 (1989): 303-314.

Hecht-Nielsen, Robert. “Theory
of the backpropagation neural network.” Neural
Networks 1.Supplement-1 (1988): 445-448.

Bengio, Yoshua. “Learning deep
architectures for AI.” Foundations and trends® in Machine
Learning 2.1 (2009): 1-127.

Schmidhuber, Jürgen. “Deep
learning in neural networks: An overview.” Neural networks 61
(2015): 85-117.

LeCun, Yann, Yoshua Bengio, and
Geoffrey Hinton. “Deep learning.” Nature 521.7553 (2015):

Glorot, Xavier, Antoine Bordes, and
Yoshua Bengio. “Deep Sparse Rectifier Neural Networks.” Aistats.
Vol. 15. No. 106. 2011.

Hinton, Geoffrey, et al. “Deep
neural networks for acoustic modeling in speech recognition: The shared views
of four research groups.” IEEE Signal Processing Magazine 29.6
(2012): 82-97.

Kelley, Henry J. “Gradient
theory of optimal flight paths.” Ars Journal 30.10 (1960):

Bryson, Arthur E. “A gradient
method for optimizing multi-stage allocation processes.” Proc.
Harvard Univ. Symposium on digital computers and their applications. 1961.

Casanova, Ramon, Santiago Saldana,
Emily Y. Chew, Ronald P. Danis, Craig M. Greven, and Walter T. Ambrosius.
“Application of Random Forests Methods to Diabetic Retinopathy
Classification Analyses.” PLOS ONE 9, no. 6 (2014): 1-7. Accessed December
26, 2014. www.plosone.org.

Sinthanayothin, C., J.F. Boyce,
T.H. Williamson, H.L. Cook, E. Mensah, S. Lal, and D. Usher. “Automated
Detection of Diabetic Retinopathy on Digital Fundus Images.” Diabetic
Medicine 19 (2002): 105-12.

Usher, D., M. Dumskyjs, M. Himaga,
T.H. Williamson, S. Nussey, and J. Boyce. “Automated Detection of Diabetic
Retinopathy in Digital Retinal Images: A Tool for Diabetic Retinopathy
Screening.” Diabetic Medicine 21 (2003): 84-90.

Jaafar, Hussain F., Asoke K. Nandi,
and Waleed Al-Nuaimy. “Automated Detection And Grading Of Hard Exudates
From Retinal Fundus Images.” 19th European Signal Processing Conference
(EUSIPCO 2011), 2011, 66-70.

“National Diabetes Statistics
Report, 2014.” Centers for Disease Control and Prevention. January 1,
2014. Accessed December 26, 2014.

“Diabetes.” World Health
Organization. November 1, 2014. Accessed December 26, 2014. http://www.who.int/mediacentre/factsheets/fs312/en/.

Simonyan, Karen, and Andrew
Zisserman. “Very deep convolutional networks for large-scale image
recognition.” arXiv preprint arXiv:1409.1556 (2014).

S. Roychowdhury, D. Koozekanani,
and K. Parhi, “Dream: Diabetic retinopathy analysis using machine learning,”
IEEE Journal of Biomedical and Health Informatics, vol. 18, no. 5, pp.
1717–1728, 2014.