Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Predicting the Stages of Diabetic Retinopathy

using Deep Learning


Chava Harshitha, Alla Asha, Jangala Lakshmi Sai Pushkala, Rayapudi Naga Swetha Anogini,
Karthikeyan C
Department of Computer Science and Engineering,
Koneru Lakshmaiah Education Foundation, Vaddeswaram, Guntur, Andhra Pradesh, India.

harshithachava@gmail.com, ckarthik2k@gmail.co m
2021 6th International Conference on Inventive Computation Technologies (ICICT) | 978-1-7281-8501-9/21/$31.00 ©2021 IEEE | DOI: 10.1109/ICICT50816.2021.9358801

Abstract - Diabetic Retinopathy (DR) is a very ordinary problem are essential in solving existing problems. While, the usage of
among diabetic patients, which in turn results in the constructive loss deep learning for binary clustering has succeeded in achieving
of vision in those patients. If this abnormality is not detected in the high accuracies during validation, “multi-stage classification”
early stages, then there is no treatment to restore the eyesight. outputs are comparatively less, especially for early-stage
Hence, the only remedy from this irreversible situation is to detect detection.[2]
this disease at an early stage and undergo treatment. To sustain the
vision in the patients, the ophthalmologists use the “fundus images”In this article, an automated DR detecting system is brought
of their eyes, which the retinal images of the patients. But this forward which is convenient in clustering the images based on
detection of an abnormality in a human eye by another human disease-causing terms into a few certain levels. The
naked eye is time taking, cost- consuming and it sometimes also leads
“Convolutional Neural Network (CNN)” is used in this
to misjudgment, due to the subjective difference and considerations
among the ophthalmologists. Therefore, the “Deep Learning” proposed methodology, this network convolves an image
methodology is used to detect Diabetic retinopathy by using the which is given as the input into a calculated weighted matrix to
fundus images. Hence, leading to the reduction of misdiagnoses, a gather required image coordinates without losing the actual
computer-based diagnosing system is introduced. Recently, the information of the input images (also known as “Feature
techniques of deep learning have become the most common method extraction”). Initially, compare various models of CNN to
to achieve accuracy among image recognition or feature detection choose the optimal network model among them, for the basic
systems for both classification and regression. In this research, the
clustering task and then to gain the best results. Then, move
“Convolutional Neural Networks (CNN)” is used for image forward to train the “multi-class models” which enhance the
recognition, using the retinal images to train the neural network sensitivity in the early-stage classes, involving several
architecture and produce high accuracies. The challenges among
other techniques used and problems with existing methods were also methods available for processing of the data and augmentation,
discussed in this article. for the improvement of accuracy during testing. The CNN
architecture model is used to train and test the data. These
networks are mold into performing optimally on the dataset for
Keywords: Diabetic Retinopathy (DR), Deep Learning (DL), training using various methodologies such as dropout, learning
Convolutional Neural Networks (CNN), Machine Learning (ML).
rate policies, etc. The publicly available “Kaggle” dataset of
thousands of retinal images including five labeled clas ses
1. INTRODUCTION (mild, moderate, normal, severe, end-stage) is used as the
dataset. An optimal way of detecting and clustering the
Around the world, there are around four hundred and twenty dawning stages of Diabetic Retinopathy into various stages for
million people who are suffering from diabetics and all these critical medical benefits were focused [5].
people are under the risk of Diabetic Retinopathy (DR) and
even in the future, this disease is expected only to increase, “Deep Learning (DL)” is a part of “Machine Learning
which results in more people who are to be prone for diabetic (ML)” which supplies systems the ability to learn on its own
retinopathy [1]. DR is being non-curable disease makes it and increase the performance from experience without any
stand as more dreadful and the thought of vision loss terrifies human intervention, this tends to act as a human brain by
everyone [4]. The only solution to this problem is early learning from the environment, DL uses the concept of neural
detection, which is critical for treatment. This detection is the network in a human brain, which copies the methodology of
challenging phase which points out the lack of skillful hands training itself by learning [7]. Deep Learning focuses on the
and facilities in the traditional methods. Adding to this point, building of computer codes that can utilize data and utilize it to
the traditional or mature screening methods for DR promotes learn for them and train them to perform with high accuracies at
inconsistency among the readers and their subjective data that is new to the model or data [6]that is unlabeled.
perspectives. Therefore, given the escalation in both diabetes The methodology of learning begins with observation; in this
and the effects on the retina posed by this dreadful disease case- data and instructions, the system then searches for similar
around the globe, the traditional (or manual) methods in patterns to analyze the given dataset and make better choices in
diagnosis might not be able to keep par with the need for the future keeping in view the past experiences provided during
diagnosing services. the training. The primary objective is to allow the systems to
Automated detection methodologies for diabetic retinopathy learn automatically without human involvement or assistance
Authorized licensed use limited to: Robert Gordon University. Downloaded on May 28,2021 at 19:01:55 UTC from IEEE Xplore. Restrictions apply.
and to improve their actions accordingly. These expert systems use a statistical approach that is
generally used for textual and numerical data and is
Deep Learning is highly successful in building networks that
comparatively less efficient for image datasets.
have the capability to learn from unsupervised training,
unlabeled or unstructured data. The systems generally use a few
steps called PEAS; 3.1 Disadvantages of the existing system:
P- Performance 1. Inaccurate
2. Expensive
E- Environment 3. Time-comsuming
A- Actuators 4. Much coding
5. Mostly statistical approach
S- Sensors 6. Inaccurate training

Using such factors, the computer trains itself and improves


the accuracy by “backpropagation”, the deep neural networks
consist of several neurons are composed of these technologies. 4. METHODOLOGY OF PROPOSED WORK

To overcome the problems with the existing system, the


2. PROBLEM DESCRIPTION proposed methodology uses a deep learning technique
known as Convolutional Neural Network (CNN) to handle
the irregular and unlabeled, high number of fundus images.
Predicting the stages of diabetic retinopathy using advanced
Meanwhile, the deep learning techniques and algorithms are
deep learning techniques is used in identifying and analyzing the
based on human-like approaches that are reliable and cost-
deviations in the DR fundus images from the non-DR fundus
reducing, and time reducing methods. The CNN methods are
images i.e., the input data. The traditional approach used to
well known for their accuracy while working with unlabeled
detect the DR takes a huge time and also requires high
image data [8]. The sensitivity while considering the
experience and skills for the ophthalmologists to identify critical
accuracy is also very high compared to other models when
features, disease-causing changes in the retinal images [10]. The
training the architecture with the fundus images (unlabeled
automated method for detecting diabetic retinopathy would help
data as well).
the patients suffering from diabetes and the doctors who treat
them, for recognition of the symptoms at their early stages. To
take forward this ideology, the CNN procedures are vastly used
5. DATASET
for the implementation [13]. The CNN in the image
classification uses an image as the input and classifies it into the
category that is appropriate for this given input. This CNN The dataset used to train the model, achieve the result for the
model has certain hidden layers (based on the requirement, the model is available from a public source known as “Kaggle”.
number varies), which convolves the image, extracts its features, Here, several fundus images were used along with their labels
and also other information that is required for further to be given in a CSV file called, Training_Labels, where the
proceeding. The output from this CNN model is obtained from labels for the fundus images were given along with their
the classification layer. corresponding severity scale which is one of [0, 1, 2, 3, 4].
This dataset is used for the model to be trained and prediction
is to be done on the data to be tested keeping in view the past
3. PROBLEMS IN EXISTING SYSTEM experiences i.e., the CNN model which developedfrom
training the data.[9]

When a patient is diagnosed with diabetes, the changes in


their vision is the reason for this visual impairment is the impact
that diabetes poses on the retina on this patient, which results in
Diabetic retinopathy [3]. Generally, the ophthalmologists or the
clinical experts obverse the retinal images using their naked eye
which leads to misdiagnosing, inaccurate, time-consuming, and
also expensive for the patients. The existing automated systems
use an expert system that contains many business rules, which
also requires more time and money including a huge coding
process followed by them.

These coding methodologies may also not be very efficient


when coming to a heavy or large number of image inputs. The
irregularity of the input dataset is also a negative factor for the
existing system, resulting in less accuracy, and hospitals still
relying on the traditional methods. [14]

Authorized licensed use limited to: Robert Gordon University. Downloaded on May 28,2021 at 19:01:55 UTC from IEEE Xplore. Restrictions apply.
A. STEPS FOR BUILDING A CNN MODEL:
0- No DR
1. Import libraries
1- Mild 2. Pre-processing
2- Moderate 3. Initialize neural network model
4. Add input layer
3- Severe 5. Add hidden layers
Proliferative 6. Add output layer
4 - DR 7. Compile neural network model

Fig.1- Five stages of DR [12] B. LIBRARIES REQUIRED:


1. Pandas
2. PIL
3. OS
4. Numpy
6. IMAGE PROCESSING AND ANALYSIS 5. Random
6. Sklearn
7. Matplotlib
Class distribution of output variable: 8. Keras

To perform any task related to image processing, it is


mandatory to perform the preprocessing beforehand to make
the images suitable for the input data. For example, converting
images into suitable form i.e., from PNG or JPEG files into
data for the neural models or networks. The dataset consists of
basically eye retina images taken using fundus photography.
The images contain artifacts and some of them are out of focus,
underexposed, or overexposed, etc. Also, some of the images
have low brightness or low lightning conditions and thus
making it difficult to assess the difference between the images
Fig.1- Histogram to represent patients ranging within five as well as the increase in the risk of misjudgment.
stages of DR

From the above histogram obtained from the dataset, there is a


class imbalance in the training data-set with most cases having
a value of ‘0’ and least in ‘3’ and ‘4’ classes.

7. IMPLEMENTATION

Fig.3-Dataset of fundus images before pre-processing


Hence, apply the image processing to overcome these problems.

Fig.2- Pictorial representation of convolutional network

Authorized licensed use limited to: Robert Gordon University. Downloaded on May 28,2021 at 19:01:55 UTC from IEEE Xplore. Restrictions apply.
7.1. Pre-Processing
The image dataset will contain images of different The result after the preprocessing and application of the green
dimensions. It is required to change all of them into a channel looks like the above images.
standard dimension, and further convert the data into the
dimensions 256x256. This can be done through image
7.2. Sequential Neural Network
resizing or rescaling [15].
Neural Network models build complex features using
Green Channel is a filter applied on the images
their successive layers, sequentially. The proposed, new neural
because images contain various points few with high
network model consists of layers that are formed by a set of
densities and few with low densities but when images featured mappings. It is a linear stack of layers.
undergo this “green channel” filter, it tries to moderate the
densities of all points in an image.
7.3. Add Input Layer
It is done to apply various transformations for an
image based on some random function to build the model The input shape, a function, which is the defined
with a vast number of images in the dataset with few images. size of the input image, has been declared. This is the input
of the CNN model. It is a convolution layer with 32 filters
and a kernel of size 3x3 and the activation argument takes
the value “ReLU” and the padding argument takes the value
“same”.

7.4. Add Hidden Layers

Our model has 3 hidden layers. The first


hidden layer is a “Convolutional Layer” with 32 filters and
a kernel of size 3x3 which is succeeded by a “Max Pooling
layer” and, one dropout layer. The second hidden layer is a
convolutional layer with 64 filters and a kernel of size 3x3
and the activation argument takes the value “ReLU” and the
padding argument takes the value “same”. The third hidden
layer is a convolutional layer consisting of 64 filters and a
kernel of size 3x3, then a max-pooling and a dropout layer.
Fig.4-After applying green channel Then add the model called “Flatten” to the data into a 1-
dimensional array for inputting it to the next layer.

7.5. Add Output Layer


The last layer of the model i.e., the output layer
which is a Dense layer with 512 neurons and also consists
of a ReLU activation function, that is followed by a dropout
layer. The next dense model uses the “softmax” function as
the activation attribute, with unit value as “5”.

7.6. Compile Neural Network Model

Finally, the model is compiled using Keras


optimizer and the learning rate is “0.0001” and accuracy as
the metrics. The first attribute of model.compile is the
categorical cross-entropy between an output tensor and a
target tensor (categorical_cross entropy).

Fig.5-After applying green channel

Authorized licensed use limited to: Robert Gordon University. Downloaded on May 28,2021 at 19:01:55 UTC from IEEE Xplore. Restrictions apply.
8. RESULTS AND DISCUSSION

Hence, CNN is one of the very few methods that result in high
However, after using the above CNN model, the training accuracy for image data.
accuracy for 10 epochs was 73%, for 15 epochs were 79%
and for 50 epochs, the training accuracy was 83.6% on the
processed image data. The best accuracy obtained for the test 9. CONCLUSION
set from using the very limited number of neurons was 86%.
This shows that as an increase in the complexity of the Automated screening systems or detection systems are used to
neural net by escalating the numbers of both epochs, dramatically reduce the amount of time consumed to
neurons, or hidden layers produce an increase in accuracy determine the disease while saving the effort and costs for
for the model. It is interesting to note the accuracy score of clinical experts or “ophthalmologists” and results in the better
this model decreases after preprocessing”. According to our treatment of patients. The Automated techniques fo r Diabetic
hypothesis, the cause is the loss of crucial image features Retinopathy detection take up an important action in
during downsampling. This proposed method can be further recognizing the retinopathy at a dawning stage. The “DR
explored to determine to intensify these models to attain stages” are basically built on the type of abnormalities that
highly sensitive and very mild class DR. can be seen on the retina. In recent years, it has been stated
that CNNs can be grouped into the set of methods that are
8.1. Comparati ve Analysis used to detect diabetes. CNN’s are always an efficient
There are many techniques used for the “Automatic technique that can leverage a large number of images that
Detection of Diabetic Retinopathy”, in this study used the have been gathered by the ophthalmologists for the diagnosis,
“Convolutional Neural Networks (CNN)” to enlarge the but also with various pixel size and inconsistency. The “high
accuracy and reduce the complexity [11]. Many other variance and low bias” of these architectures allow the CNN
techniques are already used for the detection of DR. Some of to recognize a vast range of non-diabetic diseases as well and
those methodologies are: such new techniques are used to bring a revolution in the
Table 1: Methodologies and Results medical industry and help the doctors as well as the patients.

Methodologies Results obtained


REFERENCES
used
Decision Support It is a technique that is used
System (DSS) for decisions, judgments, and [1] Antal B., Hajdu A. An ensemble-based system for microaneurysm
for a certain course of actions detection and diabetic Retinopathy grading.
IEEE transactions on biomedical engineering,2012;59(6):1720–1726.
in a system. It analyses the
data and compiles the [2] Abràmoff M. D., Reinhardt J. M., Russell S. R., FolkJ. C., Mahajan
information to solve the V. B., Niemeijer M., Quellec G. Automated early detection of diabetic
problem and in decision- retinopathy. Ophthalmology, 2010;117(6):1147 –1154.
making situations. When used
[3] Chan J. C., Malik V., Jia W., Kadowaki T ., Yajnik C. S., Yoon K.-H.,
this technique on DR Hu F. B. Diabetes in asia: epidemiology, risk facto rs, and
detection the accuracy is pathophysiology. JAMA, 2009;301(20):2129– 2140.
67%. [8]
Statistical This method is used to [4] Congdon N. G., Friedman D. S., Lietman T . Important causes of
Classification visual impairment in the world today. Jama, 2003;290(15):2057–2060.
classify the data into its
appropriate category by the [5] Randive, S. N., Rahulkar, A. D., & Senapati, R. K. (2018). LVP
observations from training the extraction and triplet -based segmentation for diabetic retinopathy
dataset. The accuracy of this recognition. Evolutionary Intelligence, 11(1-2), 117-129.
doi:10.1007/s12065-018-0158-0.
method for detecting DR is
79.62%. [8] [6] Gardner G., Keating D., Williamson T ., Elliott A. Automatic
detection of diabetic retinopathy using an artificial neural network: a
screening tool. British journal of Ophthalmology.1996;80(11):940 –944.
Fuzzy C-Means FCM is the form of clustering
(FCM) Clustering that categorizes data into [7] Gargeya R, Leng T . Automated identification of diabetic retinopathy
multiple related clusters and usingdeep learning. Elsevier. 2017.
the output here will be
[8] Goh J. K. H, Cheung C. Y., Sim S. S., T an P. C., TanG. S. W, Wong
determined by the probability T . Y. Retinal imaging techniques for diabetic retinopathy screening.
of a certain point in all the Journal of diabetes science and technology,2016;10(2):282 –294.
clusters, and hence chooses
[9] Graham B. Kaggle diabetic retinopathy detection competition report.
the most probable option. The 2015.
accuracy of the FCM
clustering is 66%.[8] [10] Gulshan V., Peng L., Coram M., Stumpe M. C., Wu D.,
Narayanaswamy A., Venugopalan S., Widner K., Madams T., Cuadros J.,
et al. Development and validation of a deep learning algorithm for
detection of diabetic retinopathy in retinal fundus photographs. JAMA,
2016;316(22):2402– 2410.
Authorized licensed use limited to: Robert Gordon University. Downloaded on May 28,2021 at 19:01:55 UTC from IEEE Xplore. Restrictions apply.
[11] Gargeya, R. and Leng, T., 2017. Machine- driven identification
of diabetic retinopathy exploitation deep learning.
Ophthamology,124(7),pp.962-969.

[12] Acharya, R., Chua, C.K., Ng, E.Y.K., Yu, W. and Chee, C.,
2008. Application of upper order spectra for the identification of
polygenic disease retinopathy stages. Journal of Medical Systems,
32(6), pp.481-488.

[13] Rajesh Kumar, T ., Suresh, G.R., Kanaga Subaraja, S. &


Karthikeyan, C. (2020). “T aylor-AMS features and deep
convolutional neural network for converting nonaudible murmur to
normal speech“ . Computational Intelligence, 2020, pp. 1 -12.

[14] Reddy, Y. M. S., Ravindran, R. S. E., & Kishore, K. H. (2018).


Diabetic retinopathy through retinal image analysis: A review.
International Journal of Engineering and Technology(UAE), 7(1.5).

[15] Karthikeyan C, Bhukya Jabber, Deepak V & Vamsidhar E.


(2020). "Image Processing based Improved Face Recognition for
Mobile Devices by using Scale-Invariant Feature T ransform," 2020
Proceedings of the 5th International Conference on Inventive
Computation Technologies (ICICT ), Coimbatore, India, 2020, pp.
716-722, doi: 10.1109/ICICT 48043.2020.9112541 .

Authorized licensed use limited to: Robert Gordon University. Downloaded on May 28,2021 at 19:01:55 UTC from IEEE Xplore. Restrictions apply.

You might also like