A PROJECT REPORT
on
Diabetic Retinopathy classification
Submitted to
KIIT Deemed to be University
In Partial Fulfilment of the Requirement for the Award of
BACHELOR’S DEGREE IN
INFORMATION TECHNOLOGY
BY
Anshuman Sen 2105180
Deep Murari 2105273
Nihith Wudali 21052123
Gagan Bansal 21052153
UNDER THE GUIDANCE OF
Dr. Rabi Shaw
SCHOOL OF COMPUTER ENGINEERING
KALINGA INSTITUTE OF INDUSTRIAL TECHNOLOGY
BHUBANESWAR, ODISHA - 751024
April 2024
KIIT Deemed to be University
School of Computer Engineering
Bhubaneswar, ODISHA 751024
CERTIFICATE
This is certify that the project entitled
Diabetic Retinopathy Classification
submitted by
Anshuman Sen 2105180
Deep Murari 2105273
Nihith Wudali 21052125
Gagan Bansal 21052153
is a record of bonafide work carried out by them, in the partial fulfilment of the
requirement for the award of Degree of Bachelor of Engineering (Computer Sci-
ence & Engineering) at KIIT Deemed to be university, Bhubaneswar. This work is
done during year 2023-2024, under our guidance.
Date: 06/04/2024
Dr. Rabi Shaw
Project Guide
Acknowledgements
We are profoundly grateful to Dr. Rabi Shaw of School of Computer Science,
Kalinga Institute of Industrial Technology for his expert guidance and
continuous encouragement throughout to see that this project rights its target since
its commencement to its completion.
Anshuman Sen
Deep Murari
Nihith Wudali
Gagan Bansal
ABSTRACT
Diabetic retinopathy (DR) is a prevalent complication of diabetes mellitus and a
leading cause of vision impairment worldwide. Early detection and timely
intervention are crucial to prevent irreversible vision loss. In this project, we
propose an automated image classification system using Convolutional Neural
Networks (CNNs) to assist in the diagnosis of diabetic retinopathy. However,
the dataset used for training the model exhibits a significant class imbalance,
posing a challenge to accurate classification. To address this issue, we employ
resampling techniques to balance the dataset, ensuring adequate representation
of all severity levels of diabetic retinopathy. The implementation involves
preprocessing the retinal images, designing a CNN model architecture optimized
for image classification, and training the model on the balanced dataset.
Through meticulous evaluation, the trained model demonstrates promising
accuracy. The model holds significant potential to enhance diabetic retinopathy
screening programs, facilitate early intervention, and improve patient outcomes.
Future research directions include integration with clinical workflows,
exploration of advanced model architectures, and expansion to detect other
ophthalmic conditions. Overall, this project contributes to the advancement of
computer-aided diagnosis in ophthalmology, paving the way for more accessible
and efficient diabetic retinopathy screening.
Keywords: Classification,Convolutional Neural Network, Diabetic Retinopathy
Contents
1 Introduction 1
2 Basic Concepts/ Literature Review 2
2.1 Sub Section Name........................... 2
3 Problem Statement / Requirement Specifications 3
3.1 Project Planning........................... 3
3.2 Project Analysis (SRS)................. 3
3.3 System Design ………………….. 3
3.3.1 Design Constraints …… 3
3.3.2 System Architecture (UML) / Block Diagram … 3
4 Implementation 4
4.1 Methodology / Proposal ........................... 4
4.2 Testing / Verification Plan ……………. 4
4.3 Result Analysis / Screenshots …………. 4
4.4 Quality Assurance …………………….. 4
5 Standard Adopted 5
5.1 Design Standards . . . . . . . . . . . . . . . 5
5.2 Coding Standards . . . . . . . . . . . . . . 5
5.3 Testing Standards . . . . . . . . . . . . . . . 5
6 Conclusion and Future Scope 6
6.1 Conclusion ……………………….. 6
6.2 Future Scope ………………………. 6
References 7
Individual Contribution 8
Plagiarism Report 9
List of Figures
1.1 IMAGE CAPTION ......................... 2
4.1 IMAGE CAPTION ......................... 9
Diabetic Retinopathy Classification
Chapter 1
Introduction
Diabetic retinopathy (DR) stands as a critical complication of diabetes mellitus,
affecting the delicate network of blood vessels within the retina and posing a
significant threat to vision health globally. This project endeavors to construct a
comprehensive classification system for diabetic retinopathy, aiming to enhance
diagnostic accuracy, streamline treatment approaches, and ultimately mitigate
the risk of vision loss among individuals afflicted by this condition.
The pathogenesis of diabetic retinopathy is intricate, evolving from prolonged
exposure to elevated blood glucose levels in individuals with diabetes. This
metabolic insult instigates a series of microvascular changes within the retina,
progressing from non-proliferative to proliferative stages, each characterized by
distinct vascular alterations and clinical manifestations.
Despite the well-established association between diabetes and retinopathy, the
precise mechanisms underlying its progression remain elusive. Furthermore, the
heterogeneity in clinical presentation and disease severity necessitates a refined
classification framework to stratify patients based on their risk profile, prognosis,
and therapeutic response.
This classification endeavor encompasses a multidimensional approach,
integrating clinical, imaging, and molecular markers to delineate distinct
phenotypes of diabetic retinopathy. Leveraging advanced imaging modalities
such as optical coherence tomography (OCT) and fluorescein angiography,
alongside machine learning algorithms, promises to enhance our ability to detect
subtle retinal abnormalities and predict disease progression.
The ultimate goal of this classification system is to empower healthcare
professionals with a refined diagnostic tool that facilitates personalized
management strategies tailored to the unique needs of each patient. By
elucidating the underlying pathophysiology and refining our understanding of
disease phenotypes, we aspire to optimize clinical outcomes, minimize vision
loss, and alleviate the burden of diabetic retinopathy on affected individuals and
healthcare systems alike.
School of Computer Engineering, KIIT, BBSR 1
Diabetic Retinopathy Classification
Chapter 2
Basic Concepts
Convolutional Neural Networks (CNN):
Convolutional Neural Networks (CNNs) are a class of deep learning algorithms
specifically designed for tasks like image classification and computer vision.
They comprise various layers such as convolutional layers, pooling layers, and
fully connected layers.
CNNs excel at capturing intricate spatial patterns within images, making them
particularly useful for tasks like classifying diabetic retinopathy images.
TensorFlow, a widely used deep learning framework, offers robust capabilities
for constructing and training CNN models.
Numpy:
NumPy serves as a cornerstone tool for scientific computation in Python,
offering crucial backing for multi-dimensional arrays and matrices. Alongside a
suite of mathematical functions tailored for efficient array operations, it's
instrumental for tasks ranging from image data handling and preprocessing to
executing mathematical computations within CNN models in projects like ours,
frequently employed in machine learning and data analysis workflows.
Pandas:
Pandas serves as a robust Python library for handling and analyzing data. It
introduces versatile data structures like DataFrames and Series, simplifying the
management of structured data. With Pandas, tasks like data cleansing,
manipulation, summarization, and visualization become more accessible.
In our project, Pandas streamline tasks such as organizing metadata linked to
retinal images, conducting initial data exploration, and formatting datasets for
training and evaluating CNN models.
School of Computer Engineering, KIIT, BBSR 2
Diabetic Retinopathy Classification
TensorFlow:
TensorFlow, an open-source deep learning framework from Google, offers a
robust set of tools and libraries for creating and deploying machine learning
models, particularly neural networks. It includes high-level interfaces such as
Keras, simplifying the process of building and training deep learning models.
With support for both CPU and GPU acceleration, TensorFlow is adept at
efficiently training large-scale models. In our project, TensorFlow is utilized to
implement Convolutional Neural Network (CNN) architectures, train them using
retinal image data, and assess their performance.
Matplotlib:
Matplotlib is a versatile plotting library in Python renowned for its MATLAB-
like interface, facilitating the creation of an array of plots and visualizations. Its
extensive capabilities encompass diverse plot types, such as line plots, scatter
plots, histograms, and heatmaps.
In the context of a project involving Convolutional Neural Network (CNN)
training, Matplotlib proves invaluable for several tasks. Firstly, it facilitates the
visualization of training/validation loss and accuracy curves, crucial for
assessing the performance and convergence of the CNN model. These
visualizations aid in understanding the training dynamics and identifying
potential issues such as overfitting or underfitting.
Chapter 3
Problem Statement
Diabetic retinopathy (DR) is a common complication of diabetes and a leading
cause of vision loss and blindness among working-age adults. Early detection
and timely treatment are critical in preventing irreversible vision impairment.
However, manual screening for diabetic retinopathy is time-consuming and
resource-intensive, often leading to delays in diagnosis and treatment.
The aim of this project is to develop an automated image classification system
for diabetic retinopathy using deep learning techniques. The system will analyze
retinal images and classify them into different stages of diabetic retinopathy,
ranging from mild to severe, as well as distinguishing healthy retinas from those
affected by the disease.
School of Computer Engineering, KIIT, BBSR 3
Diabetic Retinopathy Classification
Severity 0 Severity 1 Severity 2
Severity 3 Severtiy 4
Sample Data
Dataset Description:
The dataset comprises a vast collection of high-resolution retina images captured
under diverse imaging conditions. Each subject is associated with a pair of
images, one for the left eye and another for the right eye. The images are labeled
with a unique subject ID along with an indication of whether it's the left or right
eye (e.g., 1_left.jpeg represents the left eye of subject ID 1).
A clinician has assessed the presence of diabetic retinopathy in each image on a
severity scale ranging from 0 to 4, where:
0 indicates no diabetic retinopathy (No DR)
1 denotes mild diabetic retinopathy
2 signifies moderate diabetic retinopathy
3 represents severe diabetic retinopathy
4 indicates proliferative diabetic retinopathy (PDR)
The task is to develop an automated analysis system capable of assigning a score
to each image based on this severity scale.
The images in the dataset are captured using different models and types of
cameras, which can influence the visual appearance of left versus right images.
Some images are anatomically represented, with the macula (central dark area)
on the left and the optic nerve on the right for the right eye. Others are depicted
as one would see through a microscope condensing lens, resulting in an inverted
appearance. Identification of inverted images can be based on two criteria:
School of Computer Engineering, KIIT, BBSR 4
Diabetic Retinopathy Classification
The macula being slightly higher than the midline through the optic nerve
indicates an inverted image.
Presence of a notch (square, triangle, or circle) on the side of the image indicates
a non-inverted image.
As with any real-world dataset, noise is present in both the images and labels.
Images may contain artifacts, be out of focus, underexposed, or overexposed.
The primary objective of this competition is to develop robust algorithms
capable of functioning effectively in the presence of noise and variations.
Objective:
To create a machine learning model capable of accurately classifying retinal
images into various stages of diabetic retinopathy.
To develop a scalable and efficient system that can handle large volumes of
retinal images for screening purposes.
To address the challenge of data imbalance in the retinal image dataset by
implementing resampling techniques to ensure adequate representation of all
diabetic retinopathy severity levels.
Scope:
The project will focus on leveraging convolutional neural networks (CNNs) for
image classification, given their proven effectiveness in analyzing medical
images.
The classification model will be trained and validated using publicly available
datasets of retinal images labeled with diabetic retinopathy severity levels.
Due to the imbalanced nature of the dataset, resampling techniques, such as
oversampling minority classes or undersampling majority classes, will be
employed to mitigate the effects of class imbalance.
The performance of the classification model will be evaluated based on standard
metrics such as accuracy, sensitivity, specificity, and area under the receiver
operating characteristic curve (AUC-ROC).
School of Computer Engineering, KIIT, BBSR 5
Diabetic Retinopathy Classification
Challenges:
Limited availability of annotated retinal image datasets for training and
evaluation.
Significant class imbalance in the dataset, with a disproportionate number of
images in class 0 (no diabetic retinopathy) compared to other classes
representing different severity levels.
Variability in image quality, resolution, and artifacts across different imaging
devices and acquisition settings.
Ensuring the generalization of the classification model across diverse patient
demographics, ethnicities, and disease manifestations.
Chapter 4
Implementation
1. IntroductionThe aim of this project is to develop an automated image
classification system for diabetic retinopathy using Convolutional Neural
Networks (CNNs). Diabetic retinopathy is a common complication of diabetes,
and early detection plays a crucial role in preventing vision loss. However, the
dataset used for training the model exhibits a significant class imbalance issue,
with a disproportionate number of images in the majority class (class 0)
compared to other severity levels of diabetic retinopathy. This report details the
implementation process, focusing on addressing the class imbalance to improve
model performance.2. Data PreprocessingIn this phase, we loaded the retinal
image dataset containing images labeled with diabetic retinopathy severity
levels. The preprocessing steps included resizing images to a uniform resolution,
normalization of pixel intensity values, and augmentation techniques such as
rotation and flipping to increase dataset diversity. Additionally, we conducted
exploratory data analysis to understand the distribution of classes and identified
the class imbalance issue.
3. Resampling to Address Imbalance
To address the class imbalance, we employed resampling techniques provided by
scikit-learn. Specifically, we downsampled the majority class (class 0) to obtain
a balanced dataset with an equal number of images for each severity level.
Additionally, we utilized oversampling or synthetic sample generation methods
to increase the number of images for minority classes, ensuring adequate
representation of all severity levels in the dataset.
School of Computer Engineering, KIIT, BBSR 6
Diabetic Retinopathy Classification
4. Splitting the Dataset
The balanced dataset was split into training, validation, and test sets using a
stratified approach to preserve the class distribution in each set. Approximately
70% of the dataset was allocated for training, 15% for validation, and 15% for
testing. This ensured that the model was trained and evaluated on representative
samples from each severity level.
5. Model Architecture
We designed a CNN model architecture tailored for diabetic retinopathy image
classification. The architecture comprised multiple convolutional layers for
feature extraction, followed by max-pooling layers to downsample feature maps.
Fully connected layers were added at the end for classification, with softmax
activation in the output layer for multi-class classification. The model
architecture was optimized to balance complexity and performance.
6. Training the Model
The compiled CNN model was trained on the balanced training dataset using
backpropagation and stochastic gradient descent. During training, we employed
techniques such as batch normalization and dropout to prevent overfitting.
We have used Adam optimizer and used branched training to have gain more
accuracy, Training progress was monitored by evaluating performance metrics,
including accuracy and loss, on the validation set at regular intervals.
7. Model Evaluation
After training, the trained model was evaluated on the balanced test dataset to
assess its performance. Evaluation metric accuracy was calculated to measure
the model's effectiveness in classifying diabetic retinopathy severity levels. The
model demonstrated promising performance indicating its ability to accurately
classify retinal images.
8. Fine-tuning and Optimization
We conducted fine-tuning of hyperparameters, including learning rate, batch
size, and model architecture, based on validation performance to optimize the
model's performance further. Experimentation with different CNN architectures
and optimization techniques was performed to improve classification accuracy
and generalization capability.
School of Computer Engineering, KIIT, BBSR 7
Diabetic Retinopathy Classification
Model Architecture
School of Computer Engineering, KIIT, BBSR 8
Diabetic Retinopathy Classification
Chapter 6
Conclusion
In conclusion, the implementation of the Convolutional Neural Network (CNN)
model for diabetic retinopathy image classification has been successful in
addressing the class imbalance issue within the dataset. By employing
resampling techniques and optimizing the model architecture, we have
developed an automated classification system capable of accurately identifying
diabetic retinopathy severity levels from retinal images. The model has
demonstrated promising accuracy, indicating its effectiveness in diagnosing
diabetic [Link] meticulous data preprocessing, model training, and
evaluation, we have created a robust framework that can assist healthcare
professionals in early detection and intervention for diabetic retinopathy. The
model holds significant potential for improving diabetic retinopathy screening
programs, reducing the burden on healthcare providers, and ultimately enhancing
patient outcomes by facilitating timely treatment.
Future Scope
While the current implementation marks a significant milestone in diabetic
retinopathy image classification, there are several avenues for future exploration
and enhancement:
Integration with Clinical Workflow: Explore opportunities to integrate the
automated classification system into existing clinical workflows, enabling
seamless integration with electronic health records (EHR) systems and
ophthalmology practices. This integration would streamline the screening
process and enhance accessibility for healthcare professionals.
Advanced Model Architectures: Investigate advanced CNN architectures and
transfer learning techniques to further improve model performance. Experiment
with pre-trained models on larger datasets or explore novel architectures tailored
specifically for diabetic retinopathy detection to achieve higher accuracy and
generalization capability.
School of Computer Engineering, KIIT, BBSR 9
Diabetic Retinopathy Classification
Real-Time Deployment: Explore opportunities for real-time deployment of the
classification system in clinical settings, enabling instant diagnosis and
intervention during patient visits. Develop lightweight models optimized for
deployment on edge devices such as smartphones or portable retinal imaging
devices for point-of-care screening.
Continuous Model Refinement: Implement a continuous model refinement
process that incorporates feedback from healthcare professionals and patient data
to adapt the model to evolving clinical needs and data distributions. Regularly
update the model with new data to ensure its relevance and effectiveness over
time.
Expansion to Other Ophthalmic Conditions: Extend the capabilities of the
classification system to detect and classify other ophthalmic conditions such as
age-related macular degeneration (AMD), glaucoma, and retinal vein occlusion.
Develop multi-task learning models capable of simultaneously identifying
multiple eye diseases from retinal images.
References
[1 ]S. M. Metev and V. P. Veiko, Laser Assisted Microtechnology, 2nd ed., R. M. Osgood, Jr., Ed. Berlin,
Germany: Springer-Verlag, 1998.
[2] Breckling, Ed., The Analysis of Directional Time Series: Applications to Wind Speed and Direction, ser.
Lecture Notes in Statistics. Berlin, Germany: Springer, 1989, vol. 61.
[3] S. Zhang, C. Zhu, J. K. O. Sin, and P. K. T. Mok, “A novel ultrathin elevated channel low-temperature poly-
Si TFT,” IEEE Electron Device Lett., vol. 20, pp. 569–571, Nov. 1999.
[4] M. Wegmuller, J. P. von der Weid, P. Oberson, and N. Gisin, “High resolution fiber distributed measurements
with coherent OFDR,” in Proc. ECOC’00, 2000, paper 11.3.4, p. 109.
[5] R. E. Sorace, V. S. Reinhardt, and S. A. Vaughn, “High-speed digital-to-RF converter,” U.S. Patent 5 668
842, Sept. 16, 1997.
[6] (2002) The IEEE website. [Online]. Available: [Link]
[7] M. Shell. (2002) IEEEtran homepage on CTAN. [Online]. Available:
[Link]
School of Computer Engineering, KIIT, BBSR 10
NAME OF PROJECT
SAMPLE INDIVIDUAL CONTRIBUTION REPORT:
<TITLE OF THE PROJECT IN FONT SIZE 14, FONT STYLE TIMES
NEW ROMAN, BOLD AND CENTERED>
<Student Name (in capital letters in font size 12, Times New Roman and
centered>
<Student Roll number (font size 12, Times New Roman and centered>
Abstract: A short description of the aim and objective of the project work carried out in 3-4
lines. This part should be common to all students in the group. The font size and style will
remain same from this point onwards. The font size will be 12 and font style will be Times
New Roman. The line spacing will be 1.5.
This report should be prepared in A4 page format with ‘default’ option under ‘Margin’ of the
‘Page Layout’ tab in Microsoft Word. Word limit for this section is 80.
Individual contribution and findings: The student should clearly indicate his/her role
in the project group and the contribution in implementing the project work. The student should
also outline his /her planning involved in implementing his/her part in the work. This
contribution report should be different for every student in the group. The student would also
write his./her technical findings and experience while implementing the corresponding part of
the project. The overall contribution report should not be less than 1 page for each student.
The Student should provide both the soft copy and signed hard copy to the project supervisor.
Individual contribution to project report preparation: Student should mention
his/her role in preparing the group project report indicating which chapter and portions
contributed.
Individual contribution for project presentation and demonstration: Student
should mention his/her role in preparing presentations and part of the project demonstrated.
Full Signature of Supervisor: Full signature of the
student:
……………………………. ……………………………..
School of Computer Engineering, KIIT, BBSR 8
TURNITIN PLAGIARISM REPORT
(This report is mandatory for all the projects and plagiarism
must be below 25%)
School of Computer Engineering, KIIT, BBSR 9