šŸ†
International Scholarly Publisher
Serving Researchers Since 2012

DL-ML Based Prediction of Diabetic Retinopathy Using Fundus Images

DOI : https://doi.org/10.5281/zenodo.18732179
Download Full-Text PDF Cite this Publication

Text Only Version

 

DL-ML Based Prediction of Diabetic Retinopathy Using Fundus Images

Dr. R. S. Tambe, S. D. Aware, R. S. Chaudhari, A. A. Kasar, D. D. Kulkarni

Department of Computer Science and Design, Engineering Dr. Vithalrao Vikhe Patil College of Engineering, Ahilyanagar, India – 414111

AbstractDiabetic Retinopathy (DR) is a serious eye disease caused by diabetes and is one of the main reasons for vision loss across the world. If it is not detected early, it can lead to permanent blindness. Most current screening methods depend on manual examination by eye specialists, which is slow, costly, and difcult to access in rural areas. To overcome these limitations, this paper presents an automated system based on Deep Learning (DL) and Machine Learning (ML) for detecting and classifying DR from retinal fundus images. The system uses a Convolutional Neural Network (CNN) to identify different stages of DR such as mild, moderate, and severe with high accuracy. Along with diagnosis, the platform offers patient-friendly features including separate logins for doctors and patients, secure storage of medical history, and an AI chatbot for instant support and guidance. A simple and user-friendly interface makes the system easy to use. The results show reliable performance, proving that the system can provide fast, accurate, and accessible DR screening.

Index TermsDiabetic Retinopathy (DR), Deep Learning (DL), Convolutional Neural Networks (CNN), Machine Learning (ML), Rectied Linear Unit (ReLU).

  1. Introduction

    Diabetic Retinopathy (DR) is one of the leading microvas- cular complications of diabetes and remains a major cause of preventable blindness worldwide. It occurs when persistently high glucose levels damage the retinal blood vessels, leading to leakage, formation of abnormal vessels, and progressive deterioration of vision [1][3]. Since DR develops gradually and often remains asymptomatic in the early stages, many patients fail to recognize its severity until substantial vision loss begins. With the rapid rise in global diabetes cases, the burden of DR is also increasing, creating an urgent need for efcient screening and monitoring systems [2], [7], [10]. Re- search suggests that a large proportion of diabetic individuals are likely to show signs of DR during their lifetime, reinforcing the importance of early detection and timely intervention [1], [2], [10].

    Conventional screening for DR traditionally relies on oph- thalmologists manually evaluating retinal fundus images to identify lesions such as microaneurysms, hemorrhages, and lipid exudates [2], [4], [7]. Although expert examination is effective, it is often time-consuming, labor-intensive, and requires skilled specialists who may not be readily available in many regions, especially rural or low-resource areas [2], [4]. Additionally, manual grading can lead to variations between specialists due to subjective interpretation, which may affect diagnostic consistency [3], [10]. These challenges highlight the need for automated, accurate, and scalable DR detection

    solutions that can support large populations and reduce the workload on healthcare providers [1], [2], [5].

    Recent advances in Machine Learning and Deep Learning have signicantly transformed medical image analysis. Con- volutional Neural Networks have become a preferred model for DR detection due to their strong ability to automatically extract and learn important patterns from retinal images [1], [3], [5], [11]. Multiple studies have demonstrated that DL algo- rithms can identify DR lesions with high accuracy, surpassing many classical image-processing technique [1], [2], [5], [6], [10]. Hybrid architectures that combine different DL models further enhance performance by improving lesion detection and minimizing false-positive or false-negative predictions [1], [6], [8]. Techniques such as segmentation networks, attention- based models, and multi-label classication have also been successfully applied to improve lesion localization and stage classication [1], [6], [10]. Despite signicant progress in DR detection research, many existing systems have limitations when applied in real-world healthcare environments. Several models focus exclusively on classication accuracy but do not provide essential practical features such as patient proles, multi-user access, result history tracking, or communication support between doctors and patients [3], [7], [16].

    To address these limitations, this work proposes a DL/ML- based DR detection system that not only focuses on high diagnostic accuracy but also incorporates patient-centric func- tionalities. The system uses CNN-based deep learning models to classify fundus images into DR severity stages and highlight relevant lesions with improved reliability [1], [2], [5], [11]. A dual-portal interface is provided, offering separate access for doctors and patients to ensure efcient workow management and personalized dashboards [7], [12]. Doctors can upload and review retinal images, analyze model predictions, and monitor patient progress across multiple visits. Patients can view diagnostic reports, track changes in their retinal health, and receive timely updates or reminders [?], [?], [7].An intelligent AI-based chatbot is integrated into the system to help patients understand DR levels, treatment guidelines, general eye-care tips, and frequently asked questions.

    This application paper describes the Proposed Methodol ogy in section II. Section III provides System Architecture and Mathematical Apporoach. Section IV covers Result and Performance Analysis. Section V provides Conclusion And Future Work.

  2. Proposed Methodology

    The proposed methodology introduce an automated diabetic retinopathy detection and it classies stages of disease by using deep learning techniques.This system aims to help clinicians for early dignosis which help to minimize human errors and provide reliable real-time predictions,the workow is illustarted in g.1.

    Fig. 1: Workow of the Diabetic Retinopathy Detection and Classication System

    1. Data Acquisition

      The proposed system uses a ready-made dataset of fundus images collected from kaggle source publicly available dataset named diabetic retinopathy dataset which contains hospital- acquired images to ensure medical diversity the dataset con- tains total 2750 fundus images and images are labelled for severaity of disease which are classied into 5 stages as healthy,mild, moderated, proliferative and severe the image classes distribution is shown in g 2.

      Fig. 2: Classication Of Dataset

    2. Data Preprocessing

      The raw fundus images go through the following prepro- cessing steps to improve quality and get the data ready for processing.

      • Resizing and Intensity Normalization: Resizing, ensur- ing that all images maintain the same dimensions and pixel intensity ranges.
      • Noise Reduction: removes any background noise and improves clarity by applying lters.
      • Contrast Enhancement: improves visibility of impor- tant features by enhancing intensity differences between regions.
      • Data Augmentation: Techniques like scaling, rotation, and ipping are applied to images to increase dataset similarity and reduce over-sizing.
    3. CNN-Based Diabetic Retinopathy Classication

      The convolutional Neural Network (CNN) is applied for automatic feature extraction and classication. The architecure contains:

      1. Input Layer: Accepts retinal fundus images and passes the raw pixel intensity data into the network for feature extraction.
      2. Convolutional Layer: Extracts high-level features such as blood vessels, exudates, and microaneurysms by applying learnable lters to capture spatial patterns.
      3. Activation Layer (ReLU): Introduces non-linearity into the model by replacing all negative pixel values in the feature map with zero, allowing the network to learn complex patterns.
      4. Pooling Layer: Reduces the spatial dimensions of the feature maps through down-sampling (e.g., Max Pool- ing), which decreases computational load and controls overtting.
      5. Flattening: Transforms the multi-dimensional feature maps into a 1D feature vector to prepare the data for the dense layers.
      6. Fully Connected (Dense) Layer: Integrates the global features extracted by the previous layers to map the learned representations to the target classes.
      7. Softmax/Output Layer: Applies an activation function to generate a probability distribution across the output classes:
        • Binary Classication: DR vs. No DR.
        • Multi-class Classica-

      tion:Mild,moderate,severe,No DR.

    4. Model Traning and optimization

      The model is trained using a feed-forward neural net- work implemented in PyTorch. Text input patterns are rst transformed into numerical features using a Bag-of-Words representation. During training, the network minimizes clas- sication error using the Cross-Entropy loss function and is optimized with the Adam optimizer. Training is carried out for a xed number of epochs with a predened batch size and learning rate. After training is completed, the learned model weights, along with the vocabulary and class labels, are saved for future prediction and deployment.

    5. Evaluation Metrics

    The trained model is evaluated using a common evaluation measure to check how well it classies:

    1. Accuracy: Measures the proportion of total predictions that are correct.
    2. Precision: Represents the ratio of correctly predicted positive observations to the total predicted positives.
    3. Recall: Measures the ratio of correctly predicted positive observations to all observations in the actual class.
    4. F1-Score: The harmonic mean of Precision and Recall, providing a balance between the two.
    5. ROC-AUC: Represents the models ability to discrim- inate between classes across all possible classication thresholds.
  3. System Architecture and Mathematical

    Approach

    1. System Architecture

      The proposed system architecture represents an integrated framework for automated diabetic retinopathy detection and severity classication using retinal fundus images. The system is designed to support both patients and doctors through secure login and registration mechanisms, ensuring role-based access control. All authentication details, uploaded images, and diagnostic results are securely maintained in a SQLite database, which acts as the central repository of the system. This database enables reliable data storage and seamless com- munication between user interfaces and backend processing modules while preserving data integrity and condentiality.

      Once authenticated, patients are allowed to upload retinal fundus images through the patient interface, while doctors can access and review these images via authorized credentials. The uploaded fundus images are stored in the database and forwarded to the image analysis pipeline as system input. Before analysis, the images undergo a pre-processing stage that includes normalization, resizing, and data augmentation. These operations improve image quality, standardize image dimensions, and increase dataset variability, thereby enhanc- ing the robustness and generalization capability of the deep learning model.

      After pre-processing, the rened fundus images are passed to the feature extraction module based on Convolutional Neu- ral Network layers. The CNN automatically learns discrimi- native retinal features such as microaneurysms, hemorrhages, exudates, and blood vessel patterns that are indicative of diabetic retinopathy. These learned features are subsequently used by the severity classication module to determine the

      Fig. 3: System Architecture of the Diabetic Retinopathy De- tection System.

      Where: I Input P Processing (CNN model) O Output

      • Input (I)

        I = I1,I2, …, In (2)

        Where I represents a retinal fundus image. Each image is resized and normalized before processing.

        2) Processing (P): Processing is performed using a Con- volutional Neural Network and can be represented as a function:

        P = f (I) (3)

      • Convolution Layer

        stage of the disease. The classication process enables accu-

        rate differentiation between various severity levels, supporting early diagnosis and timely medical intervention.

        Finally, the predicted results are presented through a unied patient and doctor dashboard that offers clear visualization of diagnostic outcomes. The system generates a comprehensive report containing the severity classication and relevant di- agnostic insights. Additionally, the chatbot is integrated to assist users with basic queries related to the diagnosis and system usage. Overall, the proposed architecture ensures a secure, scalable, and clinically effective solution by integrat-

        Where: Wk is the convolution kernel.

        bk is the bias term.

        Fk is the feature map.

        • R
    2. Mathematical Approach

      1) System Representation: The proposed system is mathe- matically represented as:

      S = I, P, O (1)

      Reduces spatial dimensions while retaining important features.

      • Flattening Layer

        V = Flatten(P ) (7)

        Converts feature maps into a 1-D feature vector.

        • Flattening Layer

          V = Flatten(P ) (8) Converts feature maps into a 1-D feature vector.

        • Fully Connected Layer

          Z = Wf V + bf (9)

          Combines learned features for classication.

        • Softmax Classication

      B. Training and Validation Performance

      Fig. 4 illustrates the training and validation accuracy and loss curves of the proposed CNN model. The curves indicate stable learning behavior with consistent improvement across epochs.

      (a) Accuracy (b) Loss

      Fig. 4: Training and validation accuracy and loss curves of the

      C is the number of classes and yi is probability of class i.

      1. Loss Function: The model minimizes categorical cross- entropy loss:

        proposed CNN model.

    3. Confusion Matrix Analysis

      The confusion matrix in Fig. X illustrates the models

      N 3 classication behaviour across te ve diabetic retinopathy

      classes. Based on the actual class labels, the confusion matrix shows both accurate and inaccurate predictions.

      1. Evaluation Metrics: The performance of the model is evaluated using standard metrics:

        Here,TP, TN, FP, and FN denote the number of true positives, true negatives, false positives, and false negatives, respectively.

  4. Results and Performance Analysis
      1. Dataset Overview

        After preprocessing, normalization, and augmentation, the Diabetic Retinopathy Dataset from Kaggle was divided into training, validation, and testing subsets to support multi- class classication of diabetic retinopathy severity. The dataset included ve categories representing severity levels: Healthy, Mild DR, Moderate DR, Severe DR, Proliferative DR.

        Dataset Split Healthy Mild Moderate Severe Prolif. Total
        Training 800 296 720 152 232 2200
        Validation 200 74 180 38 58 275
        Testing 200 74 180 38 58 550

        TABLE I: Dataset Split for Multi-Class Diabetic Retinopathy Classication

        Fig. 5: Confusion matrix of the proposed CNN model on the test dataset.

        Observations:

        1. The dominant diagonal values show that the model performs well in all classes, correctly classifying most of the Healthy, Mild, Moderate, Severe, and Proliferative DR samples.
        2. Due to subtle visual differences and overlapping retinal lesion patterns, there is a limited degree of misclassica- tion between adjacent severity levels, especially between Moderate, Severe, and Proliferative DR classes.
        3. The models strong ability to correctly differentiate be- tween normal and pathological retinal images is demon- strated by the Healthy (No DR) classs highest recall.
    1. Performance Metrics

      Table II presents class-wise evaluation metrics derived from the test dataset. The model achieved a macro average F1-score of 97.41% indicating balanced classication performance.

      web dashboard.This method minimises human error, lowers manual labour, and provides clinicians with accurate, real-time predictions, all of which promote early diagnosis and better patient outcomes.To improve robustness and lesion bias.

      Future work might train the model on bigger, multi-

      No DR 100.00 100.00 100.00 300
      Mild 99.66 97.33 98.48 300
      Moderate 100.00 93.33 96.55 300
      Severe 94.79 97.00 95.88 300

       

      Class Precision (%) Recall (%) F1-Score (%) Support institutional datasets. By emphasising pathological areas, ex-

      plainable AI methods like Grad-CAM can enhance clinical interpretability. To improve practical healthcare, the system can be expanded to include lightweight model deployment for

      Proliferative 93.13 99.33 96.13 300 real-time use, multi-disease retinal screening, and integration

      TABLE II: Class-wise Performance Metrics

    2. Comparison with Existing Models

      The proposed models performance was compared with existing CNN-based architectures from previous literature. Table III highlights that the proposed CNN achieves superior classication accuracy compared to conventional architectures such as VGG16, ResNet50, and the base CNN reported in the reference paper basepaper.

      with clinical decision support systems.

      ACKNOWLEDGMENT

      We would like to express our sincere gratitude to Dr.R.S.Tambe, our guide, for his continuous guidance, support, and encouragement throughout this project. We also extend our thanks to the faculty and staff of the Department of Computer Science and Design, Dr. Vithalrao Vikhe Patil College of Engineering, Ahmednagar, for providing the

      Model Accuracy (%) Source
      AlexNet 92.80 Springer (2023)
      VGG16 94.50 Springer (2023)
      ResNet50 95.47 Springer (2023) [1]
      Hybrid 94.00 IEEE Access (2024)

       

      resources and environment necessary to carry out this research.

      Vision Transformer (ViT) 95.00 Vision Transformer DR Study (2023)

      Proposed CNN Model 96.23 Proposed Work

      References

      A. Jabbar, H. B. Liaqat, A. Akram, M. U. Sana, I. D. Azp“roz, I.

      D. L. T. Diez, and I. Ashraf, A Lesion-Based Diabetic Retinopathy Detection Through Hybrid Deep Learning Model, IEEE Access, vol. 12, pp. 4001940036, Mar. 2024.

      [2] T. M. Usman, Y. K. Saheed, D. Ignace, and A. Nsang, Diabetic

      TABLE III: Performance Comparison with Existing Models

    3. Summary of Results

    Table IV presents the nal summary of experimental out- comes. The model demonstrated consistent performance across training and testing phases, achieving high generalization capability.

    Metric Achieved Value (%)

    Training Accuracy 96.31

    Test Accuracy 97.41

    Precision (Macro Avg.) 97.51

    Recall (Macro Avg.) 97.40

    F1-Score (Macro Avg.) 97.41

    TABLE IV: Summary of Overall CNN Performance

    These results conrm that the proposed custom CNN ef- fectively distinguishes between NO DR,Mild DR,Moderate DR,Severe DR and proliferative DR and generalizes well across unseen samples.

  5. Conclusion and Future Work

The suggested system effectively uses CNN-based deep learning techniques to demonstrate an automated diabetic retinopathy detection framework. The system correctly pre- dicts DR stages like No DR, Mild DR, Moderate DR, and Severe DR by processing fundus images through image clean- ing and feature learning. The results are displayed via a

retinopathy detection using principal component analysis multi-label feature extraction and classication, Int. J. Cognit. Comput. Eng., vol. 4, pp. 7888, Jun. 2023.

  1. S. Bhandari, S. Pathak, and S. A. Jain, A literature review of early stage diabetic retinopathy detection using deep learning and evolutionary computing techniques, Arch. Comput. Methods Eng., vol. 30, no. 2, pp. 799810, Mar. 2023.
  2. A. Fatima et al., Deep learning-based multiclass instance segmentation for dental lesion detection, Healthcare, vol. 11, no. 3, p. 347, Jan. 2023.
  3. E. OĀØ zbay, An active deep learning method for diabetic retinopathy detection in segmentd fundus images using articial bee colony algo- rithm, Artif. Intell. Rev., vol. 56, no. 4, pp. 32913318, Apr. 2023.
  4. B. N. Jagadesh et al., Segmentation using the IC2T model and classication of diabetic retinopathy using the rock hyrax swarm- based coordination attention mechanism, IEEE Access, vol. 11, pp. 124441124460, Nov. 2023.
  5. G. Parthasharathi, R. Premnivas, and K. Jasmine, Diabetic retinopathy detection using machine learning, J. Innov. Image Process., vol. 4, no. 1, pp. 2633, 2022.
  6. P. Madan et al., An optimization-based diabetes prediction model using CNN and bi-directional LSTM in real-time environment, Applied Sciences, vol. 12, Art. no. 3989, 2022.
  7. M. Mujahid et al., Pneumonia classication from X-ray images with inception V3 and convolutional neural network, Diagnostics, vol. 12, no. 5, p. 1280, May 2022.
  8. N. Tsiknakis et al., Deep learning for diabetic retinopathy detection and classication based on fundus images: A review, Comput. Biol. Med., vol. 135, Art. no. 104599, Jan. 2021.
  9. Z. Khan et al., Diabetic retinopathy detection using VGG-NIN a deep learning architecture, IEEE Access, vol. 9, pp. 6140861416, 2021.
  10. S. K. Bhoi, Prediction of diabetes in females of Pima Indian heritage: A complete supervised learning approach, Turkish Journal of Computer and Mathematics Education (TURCOMAT), vol. 12, pp. 30743084, 2021.
  11. S. Zhu et al., Tortuosity of retinal main and branching arterioles, venules in patients with type 2 diabetes and diabetic retinopathy in China, IEEE Access, vol. 8, pp. 62016212, Jan. 2020.
  12. A. K. Gangwar and V. Ravi, Diabetic retinopathy detection using transfer learning and deep learning, in Evolution in Computational Intelligence, vol. 1. Springer, 2020, pp. 679689.
  13. A. Panwar et al., Stratication of the lesions in color fundus images of diabetic retinopathy patients using deep learning models and machine learning classiers, in Proc. ADCOM, Springer, 2020, pp. 653666.
  14. W. L. Alyoubi et al., Diabetic retinopathy detection through deep learning techniques: A review, Informat. Med. Unlocked, vol. 20, Art. no. 100377, 2020.
  15. A. Sarwar et al., Diagnosis of diabetes type-II using hybrid machine learning based ensemble model, International Journal of Information Technology, vol. 12, pp. 419428, 2020.
  16. H. Zhou et al., Diabetes prediction model based on an enhanced deep neural network, EURASIP Journal on Wireless Communications and Networking, vol. 2020, Art. no. 148, 2020.
  17. H. Naz and S. Ahuja, Deep learning approach for diabetes prediction using PIMA Indian dataset, Journal of Diabetes and Metabolic Disor- ders, vol. 19, pp. 391403, 2020.
  18. P. Saranya and S. Prabakaran, Automatic detection of non-proliferative diabetic retinopathy in retinal fundus images using convolution neural network, J. Ambient Intell. Humanized Comput., pp. 110, Sep. 2020.