DOI 10.1186/s12886-026-04897-4
A clinically interpretable deep learning pipeline for diabetic retinopathy classification using EfficientNet, advanced data augmentation and GradCAM.
Аннотация
BACKGROUND
Early and reliable grading of diabetic retinopathy is important for preventing avoidable vision loss. Although deep learning methods have shown strong performance on retinal fundus images, grading remains difficult because of class imbalance, variable image quality, subtle differences between adjacent disease stages, and the need for interpretable predictions. This study developed a clinically interpretable deep learning pipeline for five-class diabetic retinopathy grading.
METHODS
A classification framework based on EfficientNet-B1 was developed using contrast-limited adaptive histogram equalization for image enhancement, sample-mixing augmentation, focal loss, and test-time augmentation. Model behavior was further examined using calibration analysis, gradient-weighted class activation mapping, and t-distributed stochastic neighbor embedding. The public APTOS 2019 dataset was used. Under the fixed held-out protocol, 2,930 images were used for training, 364 for validation, and 366 for testing. Robustness was further examined using stratified 5-fold cross-validation on a 3,294-image development set with an independent 366-image test set. Performance was summarized using accuracy, macro F1-score, weighted F1-score, average area under the receiver operating characteristic curve, confusion matrices, and calibration error. No formal hypothesis-testing framework was applied.
RESULTS
The best validation accuracy under the fixed split was 84.07%. On the independent test set, the proposed model achieved 83.61% accuracy without test-time augmentation and 84.97% with test-time augmentation. The average area under the receiver operating characteristic curve was 90.40%. Removing contrast-limited adaptive histogram equalization reduced test accuracy to 80.87%, supporting its contribution to performance. The model showed improved robustness to class imbalance and provided clinically meaningful visual explanations, although Severe diabetic retinopathy remained the most challenging category.
CONCLUSIONS
The proposed pipeline achieved competitive benchmark performance for five-class diabetic retinopathy grading and combined classification accuracy with supportive calibration and interpretability analyses. The method appears suitable as a research-stage decision-support approach, but the remaining difficulty in advanced disease grading and the use of a single public dataset indicate that external validation is still required before clinical deployment.
TRIAL REGISTRATION: This study used a publicly available benchmark dataset and did not involve a randomized controlled trial or prospective enrollment of human participants.
Другие публикации по теме
Перевод полного текста: Перевод в очереди
Полный текст источника
https://creativecommons.org/licenses/by-nc-nd/4.0/ Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/ .
Текст сохранён. Часть иллюстраций пока доступна только в первоисточнике; загрузка будет проверена повторно.
Introduction
In 2019, the International Diabetes Federation (IDF) reported that more than 460 million adults aged 20–79 years were living with diabetes worldwide [ 1 ]. According to the IDF’s projections, the global diabetic population is expected to rise to around 700 million by 2045. Diabetes is associated with serious systemic complications, including DR, cardiovascular events, renal failure, and stroke. Among these, DR remains a major cause of preventable vision impairment and blindness worldwide, particularly in working-age populations. Retinal damage often progresses silently, without obvious symptoms in its early stages. For this reason, early screening and timely treatment are crucial to reducing the risk of permanent vision loss [ 2 ]. Figure 1 presents a representative fundus image showing lesion patterns commonly used in diabetic retinopathy (DR) assessment. In routine practice, DR grading is usually carried out by experienced ophthalmologists, but manual evaluation is labor-intensive, requires specialized expertise, and can be difficult to scale, particularly in under-resourced settings where delays in detection and referral are more likely [ 3 ]. Advances in deep learning, especially convolutional neural networks (CNNs), have made automated fundus image analysis increasingly feasible and have shown promising diagnostic performance. However, real-world DR classification remains challenging due to class imbalance, subtle visual differences between disease grades, and the clinical need for predictions that are both reliable and interpretable [ 4 , 5 ]. Motivated by these challenges, this study presents an enhanced deep learning framework for diabetic retinopathy grading that combines robust preprocessing, augmentation, and transfer learning, while also incorporating calibration- and interpretability-aware evaluation through Expected Calibration Error (ECE) analysis and Gradient-weighted Class Activation Mapping (Grad-CAM) visualization. We also clarify that the observed ECE improvement with TTA represents a supporting reliability result, not the central uniqueness of the work. The methodological contribution of this work is not the introduction of a new loss or architecture, but a validated integration of these components into a single DR grading framework that targets three practical challenges simultaneously: (i) fundus image contrast variability, (ii) class imbalance with minority advanced grades, and (iii) inference stability and calibration. To make this clearer, we revised the major contribution in the introduction section:
An EfficientNet-B1–based DR grading pipeline that integrates CLAHE, sample-mixing augmentation, and focal loss to improve classification performance under class imbalance. A systematic ablation study to quantify the contribution of each component in the proposed pipeline. A standard classification metrics with calibration analysis (ECE) and Grad-CAM-based visual interpretation is used to provide additional evidence on prediction confidence and model transparency. The effect of TTA/No-TTA at inference is evaluated with CLAHE and without CLAHE to compare the performance of the model. A reproducible DR grading pipeline evaluated on a public benchmark dataset and complement standard performance analysis with calibration and interpretability assessment.
Fig. 1 Shows a normal retina image and diabetic retinopathy fundus image
Иллюстрация — в первоисточнике ↗
The remainder of this paper is organized as follows: Section “ Introduction ” contains introduction and in section “ Related work ”: Related Work reviews the current state-of-the-art in automated DR detection and DL approaches for fundus image analysis. Sections “ Methodology ”, “ Experimental results & discussion ”, “ Conclusion and future scope ” are organized as follows: Section “ Methodology ” (Methodology) describes the dataset, preprocessing and augmentation strategies, and the proposed deep learning architecture with its training protocols; Section “ Experimental results & discussion ” (Experimental Results & Discussion) presents the experimental setup, ablation studies, training, validation and test performance with TTA /No-TTA, with CLAHE/No-CLAHE, Cross-validation performance, confusion matrix, per-class metrics, and visualization results, including GradCAM-based interpretability analyses, ECE calibration and t-SNE visualization the main findings, highlights the strengths and limitations of the model, and explores clinical implications and potential improvements; and Section “ Conclusion and future scope ” (Conclusion & Future Scope) summarizes the key contributions of this work and outlines directions for future research. Figure 2 presents the architecture of the proposed DR classification model. The framework is built as a robust and interpretable deep learning pipeline that integrates preprocessing, data augmentation, feature extraction, and test-time augmentation (TTA) to enhance classification performance. On this basis, we propose a DR grading framework that not only seeks strong performance on fundus images but also provides interpretable evidence, supporting its role as an assistive tool for DR screening and grading.
Fig. 2 Proposed model block diagram
Иллюстрация — в первоисточнике ↗
The proposed pipeline offers a robust and interpretable approach for analyzing retinal fundus images. Each raw image is first converted to LAB color space, where CLAHE is applied only to the luminance channel, and then converted back to RGB. This improves local contrast without disturbing the original color information, allowing vessels and lesion patterns to appear more clearly. During training, Mixup and CutMix are applied to increase data diversity and improve generalization, especially under class imbalance and image variation. The enhanced images are then processed by a fine-tuned EfficientNet-B1 network, which extracts discriminative features for diabetic retinopathy grading. These features are used to assign the image to one of five DR stages. To better handle hard examples and minority classes, the model is optimized using focal loss. Finally, Grad-CAM visualizations are used to highlight the retinal regions that most influence the predictions, improving the interpretability of the framework. Although CLAHE, sample-mixing augmentation, focal loss, and test-time augmentation have each been studied previously, their effects are often reported in isolation and under varying protocols. In this work, we evaluate a unified DR grading pipeline that integrates these components and quantify their incremental contributions through a structured ablation study, complemented by calibration and interpretability analyses to better characterize model behavior beyond accuracy alone. The primary contribution is therefore the validated integration of established techniques into a coherent and reproducible pipeline for five-grade DR grading, supported by ablation and reliability-related evaluation rather than by proposing new algorithms.
Related work
Automated diabetic retinopathy (DR) screening has progressed substantially with the development of deep learning. Early studies showed that convolutional neural networks (CNNs) can learn useful retinal representations for DR grading from fundus images. For example, Islam et al. (2022) reported that Xception can capture hierarchical retinal features effectively for DR classification [ 6 ]. Khojasteh et al. (2021) also showed promising results with DenseNet-based models, where dense connectivity supports feature reuse and stable optimization in multi-grade DR assessment [ 7 ]. More recently, Ghosh et al. (2023) explored EfficientNet-based ensembles and found that they offer a more favorable balance between accuracy and computational cost than heavier CNN backbones [ 8 ]. These developments support the use of efficient modern CNNs for DR grading, although real-world performance is still affected by class imbalance and the subtle visual differences between adjacent DR stages.
Interpretability has also become an important consideration in automated DR screening. Selvaraju et al. (2017) introduced Grad-CAM, which highlights the image regions that contribute most to a model’s prediction and helps clinicians judge whether the decision is based on relevant lesion areas [ 9 ]. At the clinical level, large validation studies have strengthened confidence in deep learning–based screening systems. Gulshan et al. (2016), for instance, showed that a deep learning system could achieve performance comparable to expert graders, which significantly increased interest in clinical deployment [ 10 ]. Public datasets have likewise played a major role in model development and comparison. Among them, the Messidor dataset introduced by Decencière et al. (2014) has been widely used to evaluate DR algorithms under varied imaging conditions [ 11 ].
CNN-based DR classification began attracting broad attention with early work such as Pratt et al. (2016), which demonstrated encouraging performance even before large labeled datasets became common [ 12 ]. Since then, representation learning in medical imaging has advanced considerably. Azizi et al. (2021) proposed large self-supervised models that are particularly useful when labeled data are scarce or imbalanced [ 13 ]. Clinical studies also continued to support the practicality of automated screening. Tufail et al. (2017) examined both diagnostic performance and cost-effectiveness relative to human graders, highlighting the potential value of such systems in screening programs [ 14 ]. In low-resource settings, Li et al. (2021) further emphasized accessibility by developing a mobile-ready DR detection approach aimed at environments with limited infrastructure and specialist availability [ 15 ].
Beyond the earliest CNN baselines, a number of architectural refinements have been explored to improve DR screening performance. Al Bander et al. (2019) reported gains with DenseNet-based variants, where improved feature reuse and gradient flow contributed to better results [ 16 ]. Likewise, Ramachandran and Manikandan (2021) proposed enhanced residual network designs to better separate fine-grained DR severity levels under challenging fundus conditions [ 17 ]. Attention mechanisms have also become increasingly relevant in this area. Yan et al. (2021), for example, introduced a multi-scale attention-guided network that helps the model focus more directly on lesion-relevant regions during DR severity classification [ 18 ]. Earlier review and methodological studies also helped frame the field. Mookiah et al. (2013) summarized persistent challenges such as lesion variability and poor image quality [ 19 ], while Quellec et al. (2017) advanced lesion-oriented retinal interpretation through deep image mining [ 20 ]. Taken together, these works point toward the need for DR systems that are not only accurate, but also robust and interpretable.
Training strategy has been another major area of improvement. Hacisoftaoglu and Karabatak (2021) showed that augmentation-driven approaches can improve robustness [ 21 ], and Lim et al. (2021) found that DR performance is sensitive not only to the chosen backbone but also to the specific training configuration [ 22 ]. Transfer learning remains especially important in retinal image analysis. Li et al. (2020), for instance, proposed a cross-modality transfer strategy to improve DR grading when labeled data are limited [ 23 ]. At the same time, segmentation-oriented preprocessing has influenced DR pipelines as well, especially following the introduction of U-Net by Ronneberger et al. (2015), which encouraged lesion- and structure-aware learning in medical imaging [ 24 ].
Several studies have also demonstrated that autonomous DR screening is becoming increasingly feasible in practice. Abràmoff et al. (2018) evaluated an AI-based DR system within a real clinical workflow, helping move the field closer to routine use and regulatory acceptance [ 25 ]. Ting et al. (2017) further reported strong performance across multiethnic populations, underscoring the importance of generalizability across different demographic groups and imaging conditions [ 26 ]. Even with these advances, class imbalance remains a persistent challenge in DR datasets. Liu et al. (2020) addressed this problem using a transfer learning strategy designed for imbalanced medical data [ 27 ]. Later, Gulshan et al. (2019) evaluated deep learning systems in Indian clinical settings, reinforcing the importance of population-specific validation before deployment [ 28 ].
Methodological progress in deep learning has also continued to shape modern DR analysis. Szegedy et al. (2016) improved feature extraction through the redesigned Inception architecture [ 29 ], while Zhou et al. (2016) demonstrated class activation mapping as a way to localize the image regions influencing classification decisions [ 30 ]. In addition, focal loss proposed by Lin et al. (2017) helped address class imbalance by placing greater emphasis on hard and minority-class examples during training [ 31 ]. Data augmentation strategies such as CutMix (Yun et al., 2019) and Mixup (Zhang et al., 2018) have further improved generalization by encouraging smoother decision boundaries and reducing overreliance on spurious cues [ 32 , 33 ]. These advances build on broader deep learning principles described by Goodfellow et al. (2016) [ 34 ] and on residual learning concepts established by He et al. (2016), which continue to influence medical image analysis because of their stability in deeper architectures [ 35 ].
Alongside these methodological advances, real-world and deployment-focused studies have strengthened the case for automated DR screening. Rajalakshmi et al. (2018) reported encouraging outcomes for automated screening workflows in clinical settings [ 36 ], while Gargeya and Leng (2017) presented an end-to-end DR detection framework that highlighted readiness for deployment beyond retrospective evaluation [ 37 ]. More broadly, deep learning–based ophthalmic screening has expanded to related tasks as well, including glaucoma detection, as shown by Li et al. (2018) [ 38 ]. Overall, the literature suggests that reliable DR grading depends not only on strong backbone architectures, but also on robust training strategies, clinically meaningful validation, and interpretable outputs that can support real screening practice.
Additional work in this area includes ensemble-based glaucoma screening by Fu et al. (2018) [ 39 ] and the GRAM-CNN model proposed by Saha et al. (2020), which introduced grid attention for DR classification [ 40 ]. In this study, we use the public APTOS 2019 dataset from Kaggle [ 41 ], a widely used benchmark for DR grading that forms the basis of our experiments.
Even with the progress reported in earlier studies, a number of challenges still affect how reliably DR can be graded in real clinical settings. Many models are tested under different protocols, and their performance may drop when image quality changes because of lighting, contrast, or acquisition-related variations. Class imbalance is also a major concern, since severe and proliferative DR cases are much less common, which often leads to poorer performance on these clinically important categories. Another difficulty is the overlap between neighboring stages such as Mild and Moderate or Moderate and Severe, since DR progresses gradually rather than through clearly separated classes. For clinical use, it is therefore important that models provide not only good accuracy, but also reliable confidence estimates and visual evidence that can support referral decisions.
To address these issues, we propose a robust and interpretable DR grading framework using APTOS 2019. Our model combines CLAHE-based enhancement, Mixup and CutMix augmentation, focal loss, and an EfficientNet-B1 backbone. We further support the framework with safe test-time augmentation and Grad-CAM explanations. The model is evaluated through ablation studies and detailed analysis, including class-wise metrics, ROC and PR analysis, calibration using ECE, and t-SNE feature visualization, so that both performance and interpretability can be assessed. The below Table 1 represents the existing works summary details.
Table 1 Comparative summary of existing models Study (Author, Year) Model/Technique Dataset(s) Key Innovations/Limitations Contributions Islam et al., 2022 [ 6 ] Supervised Contrastive Learning APTOS Strong hierarchical features; limited augmentation Xception CNN Khojasteh et al., 2021 [ 7 ] DenseNet Messidor, IDRiD Dense blocks for improved feature flow; moderate size Compound-scaled feature extractor Ghosh et al., 2023 [ 8 ] EfficientNet Ensemble Multiple Ensemble improves accuracy; lacks contrast boosting Integrated CLAHE, single model Pratt et al., 2016 [ 12 ] Early CNN Kaggle DR Proved feasibility of CNNs; shallow depth Modern deep CNN backbone Yan et al., 2021 [ 18 ] Attention-guided Network IDRiD, Messidor Multi-scale attention improves focus on lesions Mixup/CutMix + SCL, focus on rare Hacisoftaoglu & Karabatak, 2021 [ 21 ] Augmented Deep Learning IDRiD Data augmentation improves generalization Advanced pipeline: CLAHE, Mixup, CutMix Lim et al., 2021 [ 22 ] Various CNN Architectures Kaggle, Messidor Comparative study of deep models EfficientNet-B1 + TTA, SCL loss Liu et al., 2020 [ 27 ] Transfer Learning EyePACS Class imbalance handling; moderate augmentation Focal Loss + class weighting Lin et al., 2017 [ 31 ] Focal Loss COCO (general) Handles class imbalance; not DR-specific Used Focal Loss for rare DR grades Yun et al., 2019 [ 32 ] CutMix Augmentation ImageNet Mixes samples; improved robustness Combined Mixup and CutMix for DR Selvaraju et al., 2017 [ 9 ] Grad-CAM Various Visual explainability; post-hoc analysis Explainability via GradCAM Gulshan et al., 2016 [ 10 ] CNN EyePACS Human-comparable DR detection; limited augmentation Extensive ablation and explainability
Table 1
Comparative summary of existing models
| Study (Author, Year) | Model/Technique | Dataset(s) | Key Innovations/Limitations | Contributions |
| Islam et al., 2022 [ 6 ] | Supervised Contrastive Learning | APTOS | Strong hierarchical features; limited augmentation | Xception CNN |
| Khojasteh et al., 2021 [ 7 ] | DenseNet | Messidor, IDRiD | Dense blocks for improved feature flow; moderate size | Compound-scaled feature extractor |
| Ghosh et al., 2023 [ 8 ] | EfficientNet Ensemble | Multiple | Ensemble improves accuracy; lacks contrast boosting | Integrated CLAHE, single model |
| Pratt et al., 2016 [ 12 ] | Early CNN | Kaggle DR | Proved feasibility of CNNs; shallow depth | Modern deep CNN backbone |
| Yan et al., 2021 [ 18 ] | Attention-guided Network | IDRiD, Messidor | Multi-scale attention improves focus on lesions | Mixup/CutMix + SCL, focus on rare |
| Hacisoftaoglu & Karabatak, 2021 [ 21 ] | Augmented Deep Learning | IDRiD | Data augmentation improves generalization | Advanced pipeline: CLAHE, Mixup, CutMix |
| Lim et al., 2021 [ 22 ] | Various CNN Architectures | Kaggle, Messidor | Comparative study of deep models | EfficientNet-B1 + TTA, SCL loss |
| Liu et al., 2020 [ 27 ] | Transfer Learning | EyePACS | Class imbalance handling; moderate augmentation | Focal Loss + class weighting |
| Lin et al., 2017 [ 31 ] | Focal Loss | COCO (general) | Handles class imbalance; not DR-specific | Used Focal Loss for rare DR grades |
| Yun et al., 2019 [ 32 ] | CutMix Augmentation | ImageNet | Mixes samples; improved robustness | Combined Mixup and CutMix for DR |
| Selvaraju et al., 2017 [ 9 ] | Grad-CAM | Various | Visual explainability; post-hoc analysis | Explainability via GradCAM |
| Gulshan et al., 2016 [ 10 ] | CNN | EyePACS | Human-comparable DR detection; limited augmentation | Extensive ablation and explainability |
Methodology
In this study, we propose a DR severity detection framework that combines Focal Loss with advanced data augmentation, and further improves test-time robustness using TTA. Prior to training, the fundus images are pre-processed using CLAHE (LAB-L) to enhance local contrast and improve overall image quality. The complete workflow of the proposed approach is illustrated in Fig. 3 , and each component of the framework is explained in detail in the following subsections. The proposed DR classification workflow combines contrast enhancement, robust augmentation, and transfer learning to grade retinal fundus images into five severity levels. The APTOS dataset is split into training, validation, and test subsets to enable an unbiased assessment of generalization. During training, we use a combination of geometric augmentations (random scaling and cropping) and sample-mixing strategies (Mixup and CutMix) to increase appearance diversity and mitigate overfitting under the class-imbalanced distribution typical of DR datasets; however, as reflected by the train–validation performance gap, these measures reduce but do not fully eliminate overfitting. The gap between training and validation curves, without divergence, confirms that strong augmentation and regularization (CLAHE, CutMix, Focal Loss) indicate generalization is improved but not fully resolved. The difference between training and validation/test performance indicates a non-trivial degree of overfitting. This is not unexpected for five-class DR grading on APTOS, where the dataset is both imbalanced and clinically subtle, particularly at the boundaries between Mild, Moderate, and Severe classes. The adopted strategies—CLAHE, Mixup/CutMix, and focal loss—improve generalization, as demonstrated by the ablation study, but they should be interpreted as mitigating rather than fully resolving overfitting. For classification, we adopt an ImageNet-pretrained EfficientNet-B1 backbone and replace its final layer with a task-specific classifier head for multi-class prediction. The model is trained with focal loss so that it pays less attention to easy examples and focuses more on hard and underrepresented classes. The best model checkpoints are chosen based on validation performance across training epochs. To improve clinical interpretability, Grad-CAM heatmaps are used to highlight the retinal regions that most influence each prediction. Performance is evaluated using accuracy, confusion matrices, and class-wise precision, recall, and F1-score to give a clearer picture of how the model performs across different DR severity levels.
Evaluation protocols used for fixed split and stratified 5-fold cross-validation experiments.
(a) Experimental Protocol 1: Fixed held-out split: We first evaluated the proposed pipeline using a fixed stratified split of 2,930 training images, 364 validation images, and 366 test images. This setup was used to examine learning curves, validation performance, and held-out test results under both TTA and No-TTA settings, with and without CLAHE.
(b) Experimental protocol 2: stratified 5-fold cross-validation with independent test set: To further evaluate robustness, we conducted stratified 5-fold cross-validation on the 3,294-image development set formed by combining the original training and validation subsets, while keeping the 366-image test set completely unseen for the final evaluation. In each fold, about 2,635 images were used for training and 659 for validation. The fold-wise results are presented separately from those of the fixed-split experiment.
Fig. 3 Proposed DR detection framework
Иллюстрация — в первоисточнике ↗
Dataset description
In this study, we use the APTOS 2019 Blindness Detection dataset, a publicly available collection of color fundus photographs labeled by DR severity. Each image belongs to one of five grades: 0 (No DR), 1 (Mild), 2 (Moderate), 3 (Severe), and 4 (Proliferative DR). The dataset captures many of the challenges seen in real screening practice, including variation in lighting, sharpness, field of view, and disease appearance. These factors make automated DR grading both difficult and clinically relevant. To develop and evaluate the model, we divided the data into separate training, validation, and test sets while keeping the naturally imbalanced class distribution unchanged. The final split included 2,930 images for training, 364 for validation, and 366 for testing (10%). We used a fixed train/validation/test split with the test set comprising approximately 10% of the dataset. This design ensures that the reported test metrics are computed on a held-out set not used for model selection, enabling a consistent comparison across ablation variants and inference settings (No-TTA vs. TTA). In this work, we adopted a fixed held-out test split (10%) primarily to (i) preserve an unseen evaluation set for final reporting, (ii) maintain realistic class imbalance reflecting screening prevalence, and (iii) support consistent ablation and inference comparisons under a single protocol. The split was constructed to preserve the naturally imbalanced class prevalence, and the per-class counts for each subset are reported in Table 2 .
Table 2 Class distribution Class (DR Grade) Train Val Test No DR (0) 1434 171 199 Mild (1) 300 40 30 Moderate (2) 808 103 87 Severe (3) 154 22 17 Proliferative (4) 234 28 33
Table 2
Class distribution
| Class (DR Grade) | Train | Val | Test |
| No DR (0) | 1434 | 171 | 199 |
| Mild (1) | 300 | 40 | 30 |
| Moderate (2) | 808 | 103 | 87 |
| Severe (3) | 154 | 22 | 17 |
| Proliferative (4) | 234 | 28 | 33 |
Fig. 4 Class distribution in train/validation/test splits
Иллюстрация — в первоисточнике ↗
Fig. 5 Sample fundus images
Иллюстрация — в первоисточнике ↗
Table 2 ; Fig. 4 show how the images are distributed across the training, validation, and test sets for each class. The dataset follows the imbalance commonly seen in DR screening, with the majority of samples belonging to the No DR and Moderate classes, while Severe and Proliferative DR appear less often. Figure 5 presents example raw fundus images before preprocessing is applied in the pipeline.
Preprocessing
Image enhancement
Preprocessing is an important step for reliable DR grading because fundus images often suffer from uneven lighting, low contrast, and acquisition artifacts that can hide subtle lesion features. To handle this, our pipeline uses CLAHE as the main image enhancement method. Instead of adjusting contrast across the whole image at once, CLAHE improves it locally by dividing the image into small regions and applying histogram equalization within each region. A clipping limit helps avoid excessive enhancement and noise in smoother areas. The enhanced regions are then combined using bilinear interpolation so that the final image remains visually smooth and free from obvious boundary artifacts. After that, each image is resized to 224 × 224 and normalized before being passed to the EfficientNet backbone.
Step 1: Color Space Conversion: Fundus images are first converted from RGB to the LAB color space, where the L channel encodes luminance (brightness), and A/B encode chromaticity. Enhancement is performed on the L channel only, preserving natural color relationships. 1 \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{I}_{LAB}={f}_{\mathrm{RGB}\to\:\mathrm{LAB}}\left({I}_{RGB}\right)$$\end{document}
Where: \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{I}_{LAB}=(L,A,B)$$\end{document} with L denoting luminance and (A, B) encoding chromatic information.
Step 2: Histogram Clipping: To prevent over-amplification of noise, the histogram \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:H\left(i\right)\:$$\end{document} of the luminance channel is clipped at a threshold \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\tau\:\:$$\end{document} 2 \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{H}_{c}\left(i\right)=\mathrm{min}\left(H\left(i\right),\hspace{0.17em}{\uptau\:}\right)$$\end{document}
Step 3: Redistribution of Clipped Pixels: Clipped pixels are uniformly redistributed across all bins to preserve the total pixel count: 3 \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{H}_{r}\left(i\right)={H}_{c}\left(i\right)+\frac{1}{L}{\sum\:}_{k=0}^{L-1}\left(H\left(k\right)-{H}_{c}\left(k\right)\right)$$\end{document}
Step 4: CLAHE Tile-based Equalization with Bilinear Interpolation: CLAHE is applied by dividing the image into contextual tiles, independently equalizing each, and blending results via bilinear interpolation: 4 \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:T\left(x,y\right)={\sum\:}_{m=1}^{4}{w}_{m}\left(x,y\right)\hspace{0.17em}{E}_{m}\left(I\left(x,y\right)\right)$$\end{document}
where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{w}_{m}\left(x,y\right)\:$$\end{document} are bilinear interpolation weights and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{E}_{m}$$\end{document} is the equalization transform in the \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:m$$\end{document} -th tile.
Step 5: CLAHE Applied to Luminance Only: The enhanced luminance channel is then given by: 5 \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{L}^{{\prime\:}}=\mathrm{CLAHE}\left(L\right)$$\end{document}
Step 6: Recombination and RGB Reconstruction: Finally, the enhanced luminance \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{L}^{{\prime\:}}\:$$\end{document} is recombined with the original chromaticity channels, and the image is converted back to RGB: 6 \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{I}^{{\prime\:}}=\mathrm{LA}{\mathrm{B}}^{\mathrm{-1}}\left({L}^{{\prime\:}},\hspace{0.17em}A,\hspace{0.17em}B\right)$$\end{document}
This enhancement method improves local contrast while keeping noise under control and maintaining the overall visual quality of the image. Because of this, vessel patterns and subtle lesion features are easier to observe, which helps support more reliable DR grading. Figure 6 shows sample APTOS images before and after CLAHE preprocessing, where the enhanced images display clearer contrast and better visibility of retinal structures.
Fig. 6 Original fundus images and their corresponding CLAHE-enhanced versions
Иллюстрация — в первоисточнике ↗
Data augmentation
Even though augmentation and focal loss help improve generalization, a clear gap between training and validation performance still remains. Along with standard augmentations such as random rotations, flips, and mild brightness or contrast adjustments, we apply Mixup and CutMix during training. Mixup forms new samples by blending pairs of images and their labels, helping the model learn smoother decision boundaries and handle label ambiguity more effectively. CutMix, in contrast, replaces a random patch of one image with part of another and mixes the labels based on the exchanged area. This pushes the model to use broader retinal evidence rather than depending too heavily on a single dominant cue. Overall, these strategies make the training data more diverse and improve robustness to occlusion, noise, and common fundus image artefacts.
CLAHE Enhancement: Each input RGB image \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{I}_{\mathrm{RGB}}$$\end{document} is enhanced using CLAHE (LAB-L) to improve local contrast, as expressed in above sub-section: 7 \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{I}_{\mathrm{CLAHE}}=\mathrm{CLAHE}\left({I}_{\mathrm{RGB}}\right)$$\end{document}
Geometric Transformations: The CLAHE-enhanced image undergoes random geometric augmentations including rotation, scaling, and flipping—parameterized by angle \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\theta\:\:$$\end{document} , scale \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:s$$\end{document} , and flip indicator \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:f$$\end{document} 8 \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{I}_{\mathrm{aug}}=\mathrm{GeomAug}\left({I}_{\mathrm{CLAHE}};\hspace{0.17em}{\uptheta\:},\hspace{0.17em}s,\hspace{0.17em}f\right)$$\end{document}
(i) Resizing: Augmented images are then resized to a standardized resolution of \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:224\times\:224$$\end{document} pixels: 9 \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{I}_{\mathrm{crop}}=\mathrm{Resize}\left({I}_{\mathrm{aug}},\hspace{0.17em}224\times\:224\right)$$\end{document} (ii) Mixup Augmentation: For further regularization, Mixup is applied, blending two images and their labels with a random mixing coefficient 10 \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\lambda:\stackrel{\sim}{I}=\lambda\:{I}_{\mathrm{crop}}+\left(1-\lambda\:\right){I}_{\mathrm{crop}}^{{\prime\:}},\:\:\stackrel{\sim}{y}=\lambda\:y+\left(1-\lambda\:\right){y}^{{\prime\:}}$$\end{document} CutMix Augmentation: Alternatively, CutMix combines two images by replacing a random region in one image with a patch from another, controlled by a binary mask M: 11 \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\stackrel{\sim}{I}=M\odot\:{I}_{\mathrm{crop}}+\left(1-M\right)\odot\:{I}_{\mathrm{crop}}^{{\prime\:}},\:\:\stackrel{\sim}{y}=\lambda\:y+\left(1-\lambda\:\right){y}^{{\prime\:}}$$\end{document}
This augmentation strategy makes the training data more diverse and helps the network learn features that generalize better to the variations commonly found in fundus images. However, the validation and test results still indicate some residual overfitting. Figure 7 illustrates CutMix on a batch of enhanced images. The left panel shows the original batch, while the right panel shows the generated CutMix samples (λ = 0.724), where image patches are exchanged and the labels are mixed in proportion to the swapped area to improve robustness and generalization.
Fig. 7 CutMix-augmented batch
Иллюстрация — в первоисточнике ↗
Network architecture selection
To choose the best encoder for DR grading, we compared five CNN backbones—Xception, DenseNet121, ResNet50, VGG19, and EfficientNet—using the same experimental setup and then examined their test performance. The highest test accuracies achieved were 82.00% for Xception, 81.31% for DenseNet121, 80.90% for ResNet50, 49.25% for VGG19, and 85.00% for EfficientNet. Figure 8 shows how training and test accuracy changed over the epochs for each model. Among the evaluated backbones, EfficientNet consistently performed the best on the test set, which is why it was selected for the proposed framework. The final model therefore uses a pretrained EfficientNet-B1 backbone for feature extraction, since it offers a strong balance between performance and computational efficiency. It processes the input fundus images and produces compact feature representations that are used for classification. These features are forwarded to a dense classifier head comprising fully connected layers, which outputs logits for each DR class. The entire end-to-end architecture is summarized in Fig. 3 and formalized above.
Fig. 8 Training and test accuracy comparison of pretrained models on the APTOS2019 dataset for diabetic retinopathy severity classification
Иллюстрация — в первоисточнике ↗
Given an input fundus image \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{I}_{\mathrm{aug}}\:$$\end{document} (after preprocessing and augmentation), high-level features are extracted by EfficientNet-B1 as: \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:z\leftarrow\:\mathrm{EfficientNet-B1}\left({I}_{\mathrm{aug}};\hspace{0.17em}{{\Theta\:}}_{\mathrm{EffB1}}\right)$$\end{document}
where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{{\Theta\:}}_{\mathrm{EffB1}}\:$$\end{document} denotes the network weights.
These features are passed to a dense classifier head: \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:h\leftarrow\:{\upphi\:}\left({W}_{1}z+{b}_{1}\right)$$\end{document} \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:o\leftarrow\:{W}_{2}h+{b}_{2}$$\end{document}
where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\phi\:\:$$\end{document} is the ReLU activation, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{W}_{1}$$\end{document} , \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{W}_{2}$$\end{document} and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{b}_{1},\:{b}_{2}$$\end{document} are trainable parameters.
Class probabilities are computed via the SoftMax function: \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\widehat{{y}_{c}}\leftarrow\:\frac{\mathrm{exp}\left({o}_{c}\right)}{{\sum\:}_{k=1}^{5}\:\mathrm{exp}\left({o}_{k}\right)}$$\end{document}
with the predicted class: \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\widehat{c}\leftarrow\:\mathrm{arg}\underset{c}{\mathrm{max}}\:\widehat{{y}_{c}}$$\end{document}
Model training is guided by the focal loss: \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathcal{\:}\mathcal{\:}\mathcal{L}focal\leftarrow\:-\hspace{0.17em}{{\upalpha\:}}_{y}\hspace{0.17em}{\left(1-\widehat{{y}_{y}}\right)}^{{\upgamma\:}}\hspace{0.17em}\mathrm{log}\left(\widehat{{y}_{y}}\right)\:$$\end{document}
where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\alpha\:}_{y}$$\end{document} is a class-balancing weight and γ modulates loss for hard examples.
The overall mapping from image to prediction is: 12 \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\widehat{y}\leftarrow\:{f}_{\mathrm{DR}}\left({I}_{\mathrm{aug}};\hspace{0.17em}{\Theta\:}\right)=\mathrm{Softmax}!\left(\mathrm{Dense}\left(\mathrm{EfficientNet-B1}\left({I}_{\mathrm{aug}}\right)\right)\right)$$\end{document}
For model explainability, GradCAM visualizations are generated from the last convolutional layer’s activations \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{A}_{k}$$\end{document} and weights \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\alpha\:}_{k}$$\end{document} as: \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{CAM}\left(x,y\right)\leftarrow\:\mathrm{ReLU}\left({\sum\:}_{k}{{\upalpha\:}}_{k}{A}_{k}\left(x,y\right)\right)$$\end{document}
This architecture is designed to support both robust DR grading and interpretable visual analysis, as demonstrated in the results section.
Loss function and class imbalance handling
Training deep models for DR classification is not straightforward because the class distribution is highly imbalanced, and some DR grades are much less represented than the No DR class. To address this problem, we combine two strategies in training: focal loss and class weighting.
Focal loss
In this work, we use focal loss [ 27 ] as the main loss function because it is particularly effective for highly imbalanced multi-class classification. Unlike standard cross-entropy loss, focal loss reduces the impact of easily classified examples and places greater emphasis on hard or misclassified samples. For a given true label y and predicted probability \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\widehat{{y}_{y}}$$\end{document} , the focal loss is defined as: \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathcal{L}\mathrm{focal}\leftarrow\:-\hspace{0.17em}{{\upalpha\:}}_{y}\hspace{0.17em}{\left(1-\widehat{{y}_{y}}\right)}^{{\upgamma\:}}\hspace{0.17em}\mathrm{log}\left(\widehat{{y}_{y}}\right)$$\end{document}
Where:
\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\widehat{{y}_{y}}$$\end{document} is the predicted SoftMax probability for the ground-truth class y, γ is the focusing parameter (set empirically, γ = 2), \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\alpha\:}_{y}$$\end{document} is a class-specific weighting factor that counterbalances label imbalance.
Focal loss works by putting more emphasis on harder examples, which helps the model focus better on minority classes and difficult cases that are important for detecting referable DR reliably.
Class weights
Along with focal loss, we further handle class imbalance by using inverse-frequency class weights in the loss function. As a result, the less represented classes receive more importance during training. The weight for each class c is defined as::
\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{{\upalpha\:}}_{c}\leftarrow\:\frac{1}{{N}_{c}}$$\end{document}
where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{N}_{c}$$\end{document} is the number of training samples in class c. This ensures that underrepresented DR grades contribute more to the overall loss, reducing bias towards majority classes.
Implementation
During training, we use focal loss (γ = 2.0) with label smoothing (0.05) so that the model pays more attention to hard examples and avoids becoming overly confident under class imbalance. The choice of γ was guided by validation results, with macro-level metrics used to keep precision and recall more balanced across the five DR grades. In our implementation, the TTA set consists of the identity view, horizontal flip, and vertical flip applied to normalized tensors and small-angle rotations. We refer to these transforms as “safe” because they preserve retinal anatomy and do not modify lesion content; they only change orientation, thereby reducing prediction variance without altering disease semantics. We clarify that “safe” refers to transformations that are semantics-preserving for DR grading, i.e., they do not create or remove lesions and only change image orientation.
Training protocol and implementation details
All experiments were carried out in PyTorch using a fine-tuned EfficientNet-B1 backbone. The original classification head was replaced with a task-specific fully connected layer to predict the five DR grades: No_DR, Mild, Moderate, Severe, and Proliferative. Fundus images were resized to 224 × 224 and normalized to match the input requirements of EfficientNet. The dataset split included 2,930 images for training, 364 for validation, and 366 for final testing.
During training, CLAHE-enhanced images were used as inputs, and data diversity was increased through a combination of standard geometric augmentation and sample-mixing augmentation. In particular, Mixup and CutMix were applied to improve robustness to noise, partial occlusions, and class imbalance. Model optimization employed the AdamW optimizer with a learning rate of 2 × 10⁻⁴ and weight decay of 1 × 10⁻⁴, using a batch size of 16 for 30 epochs. To mitigate class imbalance and emphasize hard examples, the network was trained with focal loss using focusing parameter γ = 2.0, together with label smoothing = 0.05 to reduce overconfident predictions. Validation performance was evaluated at the end of each epoch, and the final model checkpoint was selected based on the best validation performance.
At test time, results were reported under both standard inference (No-TTA) and safe test-time augmentation (TTA). For TTA, predicted probabilities from multiple views of the same image were averaged. This helped improve prediction stability without changing the trained model weights.
Stratified 5-fold cross-validation protocol
To further evaluate the robustness of the proposed EfficientNet-based five-class DR grading framework, we performed stratified 5-fold cross-validation on a development set of 3,294 images created by combining the original training and validation sets. A separate test set of 366 images was kept completely unseen and used only for the final evaluation. The development set included 1,605 No_DR, 340 Mild_DR, 911 Moderate_DR, 176 Severe_DR, and 262 Proliferative_DR images, while the independent test set contained 199, 30, 87, 17, and 33 images from these classes, respectively.
All model selection steps were carried out only on the development set. In each fold, the model was trained on the training portion and evaluated on the corresponding validation portion. Early stopping was applied, and the checkpoint with the best validation score was saved for that fold. Importantly, the best epoch was selected based on validation accuracy measured without test-time augmentation (TTA). After training, the saved best checkpoint was reloaded and the same validation fold was evaluated again using the final inference setting with TTA, matching the configuration later used for the independent test set.
Once all five folds were completed, the best epoch from each fold was recorded, and the rounded median value was used to determine the final training length. This resulted in 13 epochs. The final model was then retrained on the full development set and evaluated once on the independent test set. This protocol ensured that the test set had no role in model selection, early stopping, or epoch tuning.
Evaluation metrics
We evaluate model performance using several complementary metrics so that both overall accuracy and clinically important error patterns can be assessed. Overall accuracy is reported first as a general measure of how often the predicted DR grades match the ground-truth labels. Since DR datasets are typically imbalanced, accuracy is interpreted together with class-wise precision, recall, and F1-score for the No DR, Mild, Moderate, Severe, and Proliferative classes. These measures help show the balance between false positives and false negatives more clearly. In screening practice, low recall can mean missed disease, while low precision may lead to unnecessary referrals.
We also use the confusion matrix to examine how the model misclassifies different grades and to identify common confusion between adjacent stages. To further evaluate discrimination ability, one-vs-rest ROC-AUC is calculated for each class. Precision-recall curves are also included where relevant, since they are especially informative in imbalanced settings. Together, these metrics provide a more detailed and clinically meaningful view of model performance. Accuracy is defined as the proportion of correctly classified samples out of all evaluated cases, where TP, TN, FP, and FN represent true positives, true negatives, false positives, and false negatives. 13 \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{A}\mathrm{c}\mathrm{c}\mathrm{u}\mathrm{r}\mathrm{a}\mathrm{c}\mathrm{y}=\frac{\mathrm{T}\mathrm{P}}{TP+TN+FP+FN}$$\end{document} 14 \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{P}\mathrm{r}\mathrm{e}\mathrm{c}\mathrm{i}\mathrm{s}\mathrm{i}\mathrm{o}\mathrm{n}=\frac{\mathrm{T}\mathrm{P}}{TP+FP}$$\end{document} 15 \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{R}\mathrm{e}\mathrm{c}\mathrm{a}\mathrm{l}\mathrm{l}=\frac{TP}{TP+FN}\:$$\end{document} 16 \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{F}1\:\mathrm{s}\mathrm{c}\mathrm{o}\mathrm{r}\mathrm{e}=\frac{2\:\times\:\:Precision\:\times\:\:Recall}{Precision\:+\:Recall}$$\end{document}
Explainability
To make the model’s decisions easier to interpret, we use Grad-CAM as a qualitative visualization method. After the EfficientNet-B1 backbone extracts the high-level feature maps, Grad-CAM calculates how strongly different image regions influence the predicted class and generates a weighted activation map. This heatmap is then resized and overlaid on the original fundus image so that the model’s area of focus can be inspected more easily.
We generate Grad-CAM visualizations for representative samples from all five DR grades—No_DR, Mild, Moderate, Severe, and Proliferative—including both correct predictions and some misclassified cases. These visualizations help us check whether the model is focusing on retinal structures that are likely to matter for DR grading, such as vessels and lesion-related regions. They are also useful for understanding common failure patterns, especially confusion between adjacent severity grades. However, this analysis is intended only as a qualitative aid and should not be interpreted as clinically validated lesion localization. Expert review of these attention maps remains an important area for future work.
Experimental results & discussion
Training and validation performance with CLAHE
The EfficientNet-based classifier was trained for 30 epochs on 2,930 training images, and validated on 364 images (image size 224 × 224, batch size 16). Training accuracy increased steadily from 70.38% to 96.11% while training loss decreased from 0.4785 to 0.0644, indicating stable convergence. Validation accuracy peaked at 84.07% (epoch 20), after which mild oscillations were observed, suggesting the onset of saturation rather than severe overfitting. Importantly, the best checkpoint was selected using maximum validation accuracy, and this checkpoint was used for all subsequent validation/test analyses. Table 3 ; Fig. 9 shows the model train & validation results and validation set confusion matric displayed in Fig. 10 . Section “ Training and validation performance with CLAHE ”, “ Test set performance and TTA comparison with CLAHE ”, “ Test set performance and TTA comparison without-CLAHE ”, “ Comparative analysis of CLAHE and No-CLAHE on the test set ” and “ Comparison with state-of-the-art methods on APTOS 2019 ”, “ Ablation results ”, “ Feature-space analysis using t-SNE (test set) ”, “ Explainability GradCAM visualizations ”, “ Error analysis ” report results from Experimental Protocol 1 (fixed stratified train/validation/test split), whereas section “ Cross-validation performance ” reports results from Experimental Protocol 2 (stratified 5-fold cross-validation on the development set with a final independent test evaluation).
Table 3 Summarizes the best epoch performances Epoch Train Loss Train Acc (%) Val Loss Val Acc (%) 5 0.2399 83.14 0.3181 80.77 10 0.1370 91.19 0.3524 79.67 20 0.0820 95.02 0.3631 84.07 30 0.0644 96.11 0.3942 82.14
Table 3
Summarizes the best epoch performances
| Epoch | Train Loss | Train Acc (%) | Val Loss | Val Acc (%) |
| 5 | 0.2399 | 83.14 | 0.3181 | 80.77 |
| 10 | 0.1370 | 91.19 | 0.3524 | 79.67 |
| 20 | 0.0820 | 95.02 | 0.3631 | 84.07 |
| 30 | 0.0644 | 96.11 | 0.3942 | 82.14 |
Fig. 9 Training and validation accuracy/loss curves
Иллюстрация — в первоисточнике ↗
The proposed EfficientNet-based five-class DR grading model was trained on 2,930 images and evaluated on an independent validation set (364 images) and test set (366 images). The validation accuracy reached 84.07% with a macro-F1 of 0.6962 (no-TTA), indicating good overall performance while reflecting the impact of class imbalance through the macro-averaged score. Class-wise validation results showed excellent discrimination for No_DR (F1 ≈ 0.983) and Moderate DR (F1 ≈ 0.795), whereas Severe DR remained the most challenging category (recall ≈ 0.318), frequently being under-graded as Moderate DR. The learning curves indicate that the model fits the training distribution effectively, reaching a final training accuracy of 96.11%. However, the validation and test accuracies remain around 84–85%, revealing a noticeable generalization gap of approximately 11–12% points. This suggests that, although CLAHE, augmentation, and focal loss improve robustness relative to the baseline, they do not fully eliminate overfitting. The remaining gap is likely influenced by class imbalance, limited minority-class support, and the intrinsic visual overlap between adjacent DR grades. The current study is based entirely on the APTOS 2019 dataset, which, although widely used and representative of realistic image variability, remains a single-source benchmark rather than a clinically curated, multi-center validation cohort. As such, the reported results should be interpreted as evidence of benchmark performance rather than as proof of broad clinical generalizability. Performance may change across populations, devices, acquisition protocols, and labeling standards that are not represented in APTOS. Consequently, the present findings should be viewed as benchmark-based evidence, and external validation on independent, clinically curated datasets is necessary before claims of deployment readiness or broad clinical applicability can be made.
Fig. 10 Confusion matrix of validation results
Иллюстрация — в первоисточнике ↗
Test set performance and TTA comparison with CLAHE
To understand how TTA influences each DR grade, we report class-wise precision, recall, and F1-score on the held-out test set in Table 4 . Overall, TTA provides a modest improvement in calibration and overall test performance the macro-F1 (0.6434 → 0.6627) and accuracy (0.8361 → 0.8497), indicating a net gain in class-balanced performance; however, the effect is class-dependent and reflects the inherent ambiguity between adjacent DR stages. No-DR (Class 0) remains consistently strong across both settings. Under No-TTA, the model achieves an F1 of 0.9800 with near-ceiling recall (0.9849). With TTA, performance is essentially unchanged (F1: 0.9799). This stability suggests that healthy fundus patterns are highly separable and robust to mild geometric perturbations. Mild DR (Class 1) shows the largest improvement with TTA. Precision increases from 0.6154 to 0.7500 and recall from 0.5333 to 0.6000, producing an F1 gain of + 0.0953 (0.5714 → 0.6667). In terms of counts, correct Mild predictions increase from 16/30 to 18/30, indicating that TTA reduces borderline errors particularly mild cases being absorbed into the adjacent Moderate grade. Moderate DR (Class 2) benefits primarily through higher recall. Recall rises from 0.8736 to 0.9195, improving F1 from 0.7677 to 0.7921 (+ 0.0244), corresponding to 76/87 to 80/87 correct classifications. This suggests that averaging predictions across safe views stabilizes moderate-grade evidence that may be sensitive to small spatial variations. Severe DR (Class 3) is the only class that degrades under TTA. Both precision (0.4286 → 0.3846) and recall (0.3529 → 0.2941) drop, reducing F1 by − 0.0538 (0.3871 → 0.3333), with correct predictions decreasing from 6/17 to 5/17. This behavior is consistent with the limited support of class 3 and its strong overlap with class 2, where TTA can smooth predictions toward the dominant neighboring grade. Proliferative DR (Class 4) shows a modest improvement: recall increases from 0.3636 to 0.3939 and F1 from 0.5106 to 0.5417 (+ 0.0311), corresponding to 12/33 to 13/33 correct predictions. Although the absolute gain is small, improved sensitivity for PDR is clinically meaningful, as this category typically requires urgent referral. Tables 4 and 5 shows Class-wise test performance comparison (No-TTA vs. + TTA).
Table 4 Class-wise performance on the TEST set with CLAHE Class Support No-TTA Precision No-TTA Recall No-TTA F1 +TTA Precision +TTA Recall +TTA F1 ΔF1 (+ TTA − No-TTA) No_DR_0 199 0.9751 0.9849 0.98 0.9799 0.9799 0.9799 −0.0001 Mild_DR_1 30 0.6154 0.5333 0.5714 0.75 0.6 0.6667 0.0953 Moderate_DR_2 87 0.6847 0.8736 0.7677 0.6957 0.9195 0.7921 0.0244 Severe_DR_3 17 0.4286 0.3529 0.3871 0.3846 0.2941 0.3333 −0.0538 PDR_4 33 0.8571 0.3636 0.5106 0.8667 0.3939 0.5417 0.0311
Table 4
Class-wise performance on the TEST set with CLAHE
| Class | Support | No-TTA Precision | No-TTA Recall | No-TTA F1 | +TTA Precision | +TTA Recall | +TTA F1 | ΔF1 (+ TTA − No-TTA) |
| No_DR_0 | 199 | 0.9751 | 0.9849 | 0.98 | 0.9799 | 0.9799 | 0.9799 | −0.0001 |
| Mild_DR_1 | 30 | 0.6154 | 0.5333 | 0.5714 | 0.75 | 0.6 | 0.6667 | 0.0953 |
| Moderate_DR_2 | 87 | 0.6847 | 0.8736 | 0.7677 | 0.6957 | 0.9195 | 0.7921 | 0.0244 |
| Severe_DR_3 | 17 | 0.4286 | 0.3529 | 0.3871 | 0.3846 | 0.2941 | 0.3333 | −0.0538 |
| PDR_4 | 33 | 0.8571 | 0.3636 | 0.5106 | 0.8667 | 0.3939 | 0.5417 | 0.0311 |
Severe DR remains the most challenging grade. On the test set, the recall for Severe DR was 0.35 with standard inference and dropped slightly to 0.29 with TTA. This means that a noticeable number of Severe cases were being under-graded, most often as Moderate. This pattern is also consistent with the confusion matrices and with the known visual similarity between neighboring DR stages. So, even though the proposed pipeline improved overall accuracy, macro-F1, and calibration, it still showed limited sensitivity for Severe DR.
From a screening perspective, this is a meaningful concern because missing advanced DR may delay referral and increase the risk of permanent vision loss. For that reason, the model should not be treated as a standalone triage system for advanced disease. It is more appropriate as a decision-support tool that can assist clinical review, particularly in borderline cases between Moderate and Severe DR. The dominant failure mode was underestimation between adjacent grades, suggesting that the model can recognize the presence of disease but struggles to separate later stages reliably, likely due in part to the limited number of class-3 samples. Although TTA improved overall test performance and calibration, it did not help every class equally. In the case of Severe DR, the small drop in recall suggests that averaging predictions across augmented views may push uncertain cases toward the more common neighboring class. Table 5 summarizes the class-wise test-set performance of the proposed CLAHE-based model under No-TTA and + TTA settings.
Table 5 Class-wise discrimination performance (AUC/AP) under No-TTA and TTA with CLAHE Class AUC No-TTA AP No-TTA AUC + TTA AP + TTA No_DR_0 0.9958 0.9961 0.9971 0.9975 Mild_DR_1 0.9171 0.6805 0.9391 0.6607 Moderate_DR_2 0.9432 0.7963 0.9465 0.7929 Severe_DR_3 0.7201 0.2692 0.7591 0.2741 Proliferative_DR_4 0.8984 0.676 0.9077 0.6584
Table 5
Class-wise discrimination performance (AUC/AP) under No-TTA and TTA with CLAHE
| Class | AUC No-TTA | AP No-TTA | AUC + TTA | AP + TTA |
| No_DR_0 | 0.9958 | 0.9961 | 0.9971 | 0.9975 |
| Mild_DR_1 | 0.9171 | 0.6805 | 0.9391 | 0.6607 |
| Moderate_DR_2 | 0.9432 | 0.7963 | 0.9465 | 0.7929 |
| Severe_DR_3 | 0.7201 | 0.2692 | 0.7591 | 0.2741 |
| Proliferative_DR_4 | 0.8984 | 0.676 | 0.9077 | 0.6584 |
Consistent with the above findings, one-vs-rest ROC analysis indicates strong separability for No-DR and Moderate DR, while Severe remains the most difficult. Importantly, TTA increases AUC for most grades—including Severe (0.7201 → 0.7591)—suggesting improved ranking quality even when thresholded classification remains challenging. Precision–recall behavior is more sensitive to prevalence, and AP changes are class-dependent, reflecting the effect of rarity and decision thresholds. The gains from TTA are most pronounced for the borderline Mild and Moderate grades and are accompanied by improved calibration (lower ECE), making TTA a valuable low-risk inference enhancement that may support future decision-support development. Figure 11 (a-f) shows precision–recall curves on the test set for No-TTA and TTA. ROC-AUC curves for No-TTA + TTA on the test set. Reliability diagrams (10-bin calibration) comparing No-TTA and + TTA test predictions with CLAHE.
Fig. 11 ( a ) precision–recall curve No-TTA. ( b ) ROC-AUC curve No-TTA. ( c ) ECE curve No-TTA. ( d ) precision–recall curve + TTA. ( e ) ROC-AUC curve + TTA. ( f ) ECE curve + TTA
Иллюстрация — в первоисточнике ↗
Test set performance and TTA comparison without-CLAHE
To understand how contrast enhancement affects different DR grades, we report class-wise precision/recall/F1 for the No-CLAHE pipeline on the held-out test set (Table 6 ), and compare the key behavior against the CLAHE (LAB-L) pipeline discussed earlier. Without CLAHE, overall test performance No-TTA decreases (accuracy 0.8087 , macro-F1 0.6194) relative to the CLAHE pipeline No-TTA (accuracy 0.8361, macro-F1 0.6434), indicating reduced generalization on unseen images. A notable class-specific change is observed for Moderate DR and PDR: Moderate recall decreases substantially without CLAHE (0.7126) compared with the CLAHE model ( 0.8736 ), suggesting that contrast enhancement helps preserve lesion evidence needed for consistent Moderate detection. PDR recall also drops (0.2727 vs. 0.3636 with CLAHE), implying that subtle proliferative cues are harder to capture without contrast normalization. Interestingly, Severe DR recall becomes high (0.7059) under No-CLAHE, but this is accompanied by very low precision (0.2667), indicating that the model over-predicts Severe by absorbing cases from adjacent grades (primarily Moderate). Therefore, the apparent gain in Severe sensitivity under No-CLAHE is misleading: it reflects increased false positives rather than improved discriminative ability. This behavior is consistent with the task’s ordinal nature and the strong visual overlap between Moderate and Severe grades. When safe TTA is applied to the No-CLAHE model (identity + flips), calibration improves (ECE decreases 0.0395 → 0.0259), but accuracy and macro-F1 decrease slightly (0.8087 → 0.8005, macro-F1 0.6194 → 0.6084). Class-wise, TTA reduces Mild and Moderate recall marginally while leaving Severe recall unchanged; for PDR, precision increases (0.75 → 0.90) but recall remains low (0.2727). Overall, these results suggest that in the absence of CLAHE, TTA primarily stabilizes confidence estimates rather than improving class-balanced discrimination. Table 6 reports the class wise performance results without CLAHE approach.
Table 6 Test set class-wise performance for the full pipeline without CLAHE Class Support Precision (No-TTA) Recall (No-TTA) F1 (No-TTA) Precision (+ TTA) Recall (+ TTA) F1 (+ TTA) No_DR_0 199 0.9801 0.9899 0.985 0.9703 0.9849 0.9776 Mild_DR_1 30 0.6957 0.5333 0.6038 0.6 0.5 0.5455 Moderate_DR_2 87 0.7294 0.7126 0.7209 0.7262 0.7011 0.7135 Severe_DR_3 17 0.2667 0.7059 0.3871 0.2667 0.7059 0.3871 Proliferative_DR_4 33 0.75 0.2727 0.4 0.9 0.2727 0.4186
Table 6
Test set class-wise performance for the full pipeline without CLAHE
| Class | Support | Precision (No-TTA) | Recall (No-TTA) | F1 (No-TTA) | Precision (+ TTA) | Recall (+ TTA) | F1 (+ TTA) |
| No_DR_0 | 199 | 0.9801 | 0.9899 | 0.985 | 0.9703 | 0.9849 | 0.9776 |
| Mild_DR_1 | 30 | 0.6957 | 0.5333 | 0.6038 | 0.6 | 0.5 | 0.5455 |
| Moderate_DR_2 | 87 | 0.7294 | 0.7126 | 0.7209 | 0.7262 | 0.7011 | 0.7135 |
| Severe_DR_3 | 17 | 0.2667 | 0.7059 | 0.3871 | 0.2667 | 0.7059 | 0.3871 |
| Proliferative_DR_4 | 33 | 0.75 | 0.2727 | 0.4 | 0.9 | 0.2727 | 0.4186 |
Comparative analysis of CLAHE and No-CLAHE on the test set
Looking at the class-wise results more closely, CLAHE generally improved test performance, especially for the clinically important intermediate and advanced DR grades, although the benefit was not uniform across all classes. Among all settings, CLAHE + TTA gave the best overall result, with an accuracy of about 84.97%, a macro-F1 of 66.27%, and a weighted-F1 of 84.00%. In comparison, the best No-CLAHE setting was the version without TTA, which reached about 80.87% accuracy, 61.94% macro-F1, and 81.05% weighted-F1. This suggests that CLAHE helped the model perform in a more balanced way across the different classes, particularly when combined with TTA. Table 7 presents the overall comparison of CLAHE and No-CLAHE settings under No-TTA and + TTA on the test set.
Table 7 Overall comparison CLAHE Vs No-CLAHE Setting Accuracy Macro-F1 Weighted-F1 No-CLAHE, No-TTA 80.87% 61.94% 81.05% No-CLAHE, +TTA 80.05% 60.85% 80.16% CLAHE, No-TTA 83.61% 64.34% 82.62% CLAHE, +TTA 84.97% 66.27% 84.00%
Table 7
Overall comparison CLAHE Vs No-CLAHE
| Setting | Accuracy | Macro-F1 | Weighted-F1 |
| No-CLAHE, No-TTA | 80.87% | 61.94% | 81.05% |
| No-CLAHE, +TTA | 80.05% | 60.85% | 80.16% |
| CLAHE, No-TTA | 83.61% | 64.34% | 82.62% |
| CLAHE, +TTA | 84.97% | 66.27% | 84.00% |
These results suggest that the effect of CLAHE was generally positive, although not equally strong for every DR grade. In our experiments, two patterns stood out. First, CLAHE tended to improve the model’s ability to separate the DR classes overall. Second, test-time augmentation was helpful only when it was used together with CLAHE; without CLAHE, TTA led to a slight decline in performance. So, while the benefit was not uniform at the class level, the overall trend remained favorable. Looking more closely at the individual classes, both pipelines handled the No_DR category very well, and the difference between them was small. In the No-TTA setting, the No-CLAHE model gave a slightly better F1-score, but this changed once TTA was applied, where CLAHE became marginally better. This suggests that normal cases were relatively easy for both versions of the model to identify. For Mild_DR, the picture was a little different. CLAHE alone did not help much and slightly reduced the F1-score, but when it was combined with TTA, the improvement became much clearer. In other words, the benefit of CLAHE for mild disease appeared only when the inference setting was also made more robust. For Moderate_DR, however, the effect was much more consistent. CLAHE improved performance in both settings, and the gain was mainly due to higher recall. From our perspective, this is an important finding, since it suggests that contrast enhancement helped the model pick up moderate DR features more reliably. The results for Severe_DR were less encouraging. Without TTA, both approaches produced the same F1-score, although they behaved differently: No-CLAHE gave better recall, whereas CLAHE gave slightly better precision. After applying TTA, CLAHE became weaker for this class, while No-CLAHE retained the better result. This indicates that the most difficult minority class still remains a challenge, and that CLAHE does not necessarily help when the visual distinction from adjacent grades is already subtle. In contrast, Proliferative_DR showed the clearest improvement with CLAHE. Here, the F1-score increased in both inference settings, mainly because precision improved and recall also increased to some extent. Taken together, these findings suggest that CLAHE + TTA is the strongest overall configuration in our five-class DR grading framework. Although No-CLAHE retained a slight advantage for the normal class and somewhat better sensitivity for Severe_DR, the CLAHE-based model gave more consistent gains in the clinically important Moderate_DR and Proliferative_DR categories. This is also reflected in the higher macro-F1 and weighted-F1 values, which indicate better balance across classes and stronger overall generalization.
In addition, TTA did not help the No-CLAHE pipeline, but it further improved the CLAHE-based model, suggesting that contrast enhancement and inference-time augmentation worked well together. Figure 12 (a-f) shows precision–recall curves on the test set for No-TTA and TTA. ROC-AUC curves for No-TTA + TTA on the test set. Reliability diagrams (10-bin calibration) comparing No-TTA and + TTA test predictions without CLAHE.
Fig. 12 ( a ) precision–recall curve No-TTA. ( b ) ROC-AUC curve No-TTA. ( c ) ECE curve No-TTA. ( d ) precision–recall curve (+ TTA). ( e ) ROC-AUC curve (+ TTA). ( f ) ECE curve (+ TTA)
Иллюстрация — в первоисточнике ↗
Cross-validation performance
Experimental Protocol 2 Performance was assessed using accuracy, macro-precision, macro-recall, macro-F1, weighted-precision, weighted-recall, weighted-F1, and Quadratic Weighted Kappa (QWK). The macro-averaged metrics were included to better reflect performance on minority classes, while weighted metrics were included to summarize overall performance under class imbalance. QWK was used as an important agreement measure because diabetic retinopathy grading is an ordinal classification task, and QWK accounts for the severity of disagreement between predicted and true grades.
The fold-wise cross-validation results are summarized in Table 8 . Across the five stratified folds, the model achieved a mean accuracy of 0.8422 ± 0.0085, macro-precision of 0.7416 ± 0.0129, macro-recall of 0.6884 ± 0.0459, macro-F1 of 0.7026 ± 0.0308, weighted-precision of 0.8452 ± 0.0084, weighted-recall of 0.8422 ± 0.0085, weighted-F1 of 0.8398 ± 0.0112, and QWK of 0.8983 ± 0.0036. These results indicate stable overall performance across folds, with limited variation in accuracy and QWK, but relatively larger variation in macro-recall and macro-F1. This pattern suggests that the model generalized consistently on the majority classes, while the minority disease stages remained more challenging and fold-sensitive.
Table 8 Fold-wise cross-validation performance on the development set Fold Accuracy Precision (Macro) Recall (Macro) F1-score (Macro) Precision (Weighted) Recall (Weighted) F1-score (Weighted) QWK Fold 1 0.83 0.7254 0.6361 0.6625 0.834 0.83 0.8219 0.8952 Fold 2 0.8388 0.7342 0.641 0.6765 0.842 0.8388 0.836 0.8958 Fold 3 0.8513 0.7592 0.7234 0.7285 0.857 0.8513 0.849 0.9043 Fold 4 0.842 0.7412 0.7128 0.7191 0.845 0.842 0.8444 0.8975 Fold 5 0.8491 0.7482 0.7287 0.7265 0.848 0.8491 0.8475 0.8988 Mean ± SD 0.8422 ± 0.0085 0.7416 ± 0.0129 0.6884 ± 0.0459 0.7026 ± 0.0308 0.8452 ± 0.0084 0.8422 ± 0.0085 0.8398 ± 0.0112 0.8983 ± 0.0036
Table 8
Fold-wise cross-validation performance on the development set
| Fold | Accuracy | Precision (Macro) | Recall (Macro) | F1-score (Macro) | Precision (Weighted) | Recall (Weighted) | F1-score (Weighted) | QWK |
| Fold 1 | 0.83 | 0.7254 | 0.6361 | 0.6625 | 0.834 | 0.83 | 0.8219 | 0.8952 |
| Fold 2 | 0.8388 | 0.7342 | 0.641 | 0.6765 | 0.842 | 0.8388 | 0.836 | 0.8958 |
| Fold 3 | 0.8513 | 0.7592 | 0.7234 | 0.7285 | 0.857 | 0.8513 | 0.849 | 0.9043 |
| Fold 4 | 0.842 | 0.7412 | 0.7128 | 0.7191 | 0.845 | 0.842 | 0.8444 | 0.8975 |
| Fold 5 | 0.8491 | 0.7482 | 0.7287 | 0.7265 | 0.848 | 0.8491 | 0.8475 | 0.8988 |
| Mean ± SD | 0.8422 ± 0.0085 | 0.7416 ± 0.0129 | 0.6884 ± 0.0459 | 0.7026 ± 0.0308 | 0.8452 ± 0.0084 | 0.8422 ± 0.0085 | 0.8398 ± 0.0112 | 0.8983 ± 0.0036 |
Class-wise analysis on the independent test set showed that No_DR was classified very reliably, achieving precision = 0.9657, recall = 0.9899, and F1-score = 0.9777. Moderate_DR also showed comparatively strong performance, with precision = 0.7157, recall = 0.8391, and F1-score = 0.7725. In contrast, the minority and clinically more difficult classes remained more challenging. Mild_DR achieved an F1-score of 0.5769, Severe_DR achieved 0.4000, and Proliferative_DR achieved 0.4651, despite a very high precision of 1.0000 for the latter. The lower recall for Proliferative_DR (0.3030) indicates that the model was conservative in predicting the most severe class. Overall, these findings show that the framework achieved strong global and ordinal grading performance, while still facing reduced sensitivity for minority severe stages. This behavior is consistent with the underlying class imbalance and the visual similarity between adjacent disease grades. Independent test classification report are mentioned in Table 9 .
Table 9 Class-wise independent test results Class Precision Recall F1-score Support No_DR_0 0.9657 0.9899 0.9777 199 Mild_DR_1 0.6818 0.5 0.5769 30 Moderate_DR_2 0.7157 0.8391 0.7725 87 Severe_DR_3 0.3214 0.5294 0.4 17 Proliferative_DR_4 1 0.303 0.4651 33
Table 9
Class-wise independent test results
| Class | Precision | Recall | F1-score | Support |
| No_DR_0 | 0.9657 | 0.9899 | 0.9777 | 199 |
| Mild_DR_1 | 0.6818 | 0.5 | 0.5769 | 30 |
| Moderate_DR_2 | 0.7157 | 0.8391 | 0.7725 | 87 |
| Severe_DR_3 | 0.3214 | 0.5294 | 0.4 | 17 |
| Proliferative_DR_4 | 1 | 0.303 | 0.4651 | 33 |
Figure 13 . Confusion matrix of the final model on the independent APTOS 2019 test set. The matrix shows strong performance for No_DR and Moderate_DR, while most misclassifications occur between adjacent diabetic retinopathy grades, consistent with the ordinal nature of the task.
Fig. 13 Shows the confusion matrix on the independent test set
Иллюстрация — в первоисточнике ↗
Comparison with state-of-the-art methods on APTOS 2019
To better understand how the proposed EfficientNet-B1 framework compares with existing work, we examined its test-set performance on APTOS 2019 against several widely used deep CNN baselines reported for five-class DR grading. The comparison in Table 10 includes overall accuracy, precision, and recall from earlier studies, along with our own results under standard inference (No-TTA) and safe test-time augmentation (TTA), with and without CLAHE. As the table shows, commonly used backbones such as ResNet50 and InceptionV3 generally achieve moderate performance, with accuracy usually falling in the 74–79% range. Their recall values also suggest that recovering true positive cases remains difficult in an imbalanced five-class setting. Among the standard CNN models, Xception appears comparatively stronger, and the modified Xception variant performs better than the original model, indicating that task-specific architectural or training adaptations can make a meaningful difference in DR grading.
Against these baselines, our method achieved 83.61% accuracy under No-TTA and improved further to 84.97% when TTA was applied. Precision increased from 84.06% to 85.56%, and recall rose from 83.61% to 84.97%. In our view, this suggests that safe test-time augmentation, restricted to label-preserving geometric transformations, does more than provide a small boost in accuracy. It also appears to make predictions more stable under mild image variations, which in turn helps reduce both false positives and false negatives. At the same time, these comparisons should be interpreted with care, since differences in data splits, preprocessing, and evaluation protocols can influence the reported numbers across studies. Even with that limitation, the results in Table 10 indicate that our pipeline is consistently competitive with, and in several cases comparably than, conventional CNN backbones evaluated on APTOS 2019.
Another point worth noting is that our evaluation goes beyond the metrics most commonly reported in earlier work, where the focus is often limited to accuracy or quadratic weighted kappa. In this study, we also examined calibration, and the use of TTA produced a modest improvement, with ECE decreasing from 0.0327 to 0.0239. This suggests that the model’s confidence estimates were better aligned with actual correctness after TTA was applied. In addition, Grad-CAM visualizations, including selected failure cases, provide qualitative support for interpretability. Taken together, these results suggest that the combination of CLAHE, CutMix, focal loss, and safe TTA offers a practical and reproducible improvement over standard baseline models on this benchmark.
Table 10 Comparison of the proposed method with state-of-the-art approaches on APTOS 2019 References No. of DR Class Accuracy Precision Recall [ 42 ] 5 80.96 [ 43 ] 5 77.9 76 77 [ 44 ] 5 82.18 [ 45 ] Xception 5 79.59 82.35 [ 45 ] ResNet50 5 74.64 56.52 [ 45 ] InceptionV3 5 78.72 63.64 [ 45 ] Modified Xception 5 84.32 70.53 73.51 [ 46 ] 5 77 [ 6 ] 5 84.36 70.51 73.84 Proposed –TTA 5 83.61 84.06 83.61 Proposed + TTA 5 84.97 85.56 84.97
Table 10
Comparison of the proposed method with state-of-the-art approaches on APTOS 2019
| References | No. of DR Class | Accuracy | Precision | Recall |
| [ 42 ] | 5 | 80.96 | ||
| [ 43 ] | 5 | 77.9 | 76 | 77 |
| [ 44 ] | 5 | 82.18 | ||
| [ 45 ] Xception | 5 | 79.59 | 82.35 | |
| [ 45 ] ResNet50 | 5 | 74.64 | 56.52 | |
| [ 45 ] InceptionV3 | 5 | 78.72 | 63.64 | |
| [ 45 ] Modified Xception | 5 | 84.32 | 70.53 | 73.51 |
| [ 46 ] | 5 | 77 | ||
| [ 6 ] | 5 | 84.36 | 70.51 | 73.84 |
| Proposed –TTA | 5 | 83.61 | 84.06 | 83.61 |
| Proposed + TTA | 5 | 84.97 | 85.56 | 84.97 |
Ablation results
Figure 14 (a-b) summarize the impact of safe test-time augmentation on overall test-set behavior. Compared with standard inference (No-TTA), TTA yields consistent gains in discrimination metrics. Specifically, accuracy increases from 0.8361 to 0.8497, macro-F1 from 0.6434 to 0.6627, and weighted-F1 from 0.8262 to 0.8400. Improvements are also observed in macro precision (0.7122 → 0.7354) and macro recall (0.6217 → 0.6375), indicating that TTA provides a measurable boost in class-balanced performance rather than only improving majority-class predictions. Macro ROC-AUC increases (0.8949 → 0.9099), supporting improved ranking quality under one-vs-rest evaluation. In contrast, macro average precision (AP) shows a slight decrease (0.6836 → 0.6767), which is expected in highly imbalanced multi-class settings where PR behavior is sensitive to class prevalence and decision thresholds. In addition to improving classification performance, safe TTA reduced the expected calibration error from 0.0327 to 0.0239. Although modest, this reduction suggests a better alignment between predicted confidence and empirical correctness. Together with the Grad-CAM analysis, these findings provide supplementary evidence regarding prediction reliability and interpretability. As shown in Fig. 14 (b), calibration error decreases from ECE = 0.0327 to 0.0239 (10-bin ECE), indicating that confidence scores become better aligned with observed correctness after averaging predictions across safe augmented views. Overall, these results suggest that safe TTA provides a low-cost inference enhancement that improves both predictive performance and confidence calibration on the APTOS test set.
Fig. 14 ( a ) Ablation on the test set comparing standard inference (No-TTA) and (TTA). ( b ) Test-set calibration comparison between No-TTA and TTA using ECE
Иллюстрация — в первоисточнике ↗
We have presented TTA as a lightweight inference enhancement that provides incremental improvements in discrimination and calibration. Applying TTA resulted in a small but consistent improvement in test performance (accuracy 0.8361 → 0.8497; macro-F1 0.6434 → 0.6627) and reduced ECE from 0.0327 to 0.0239, suggesting a modest improvement in confidence–accuracy alignment. Although the improvements from TTA are not large in absolute terms, they are consistent across several aggregate metrics and come at negligible training cost, making TTA a practical inference-time refinement rather than a primary source of performance gain.it improves performance for Mild and Moderate grades but does not improve Severe recall.
Feature-space analysis using t-SNE (test set)
To evaluate whether the proposed network learns separable representations for DR severity grading, we extracted the 1280-dimensional penultimate features from EfficientNet-B1 for all 366 test images and projected them into 2-D using t-SNE. The embedding reveals a moderately structured embedding: No-DR (class 0) forms distinct, compact islands on the right side of the map, indicating that healthy fundus patterns are consistently encoded and highly separable. In contrast, disease grades (classes 1–4) occupy a broader region on the left with partial overlap, reflecting the clinical continuum of DR severity. Mild (class 1) tends to cluster adjacent to Moderate (class 2), while Moderate spreads over the largest region, visually acting as a bridge between early and advanced grades consistent with the confusion matrices where most errors occur between neighboring severities. Quantitatively, this behavior is supported by the cluster summary computed on the test set. The model achieves 83.61% test accuracy, while the silhouette score (computed using ground-truth labels on the t-SNE embedding) is 0.2799, indicating moderate but non-trivial separation among the five grades. The mean inter-centroid distance is 19.093, suggesting that class centroids are partial separation relative to within-class variation in the projected space. Class-wise dispersion (mean distance to centroid) shows that No-DR has the largest intra-class spread (10.639), which is expected given the wide diversity of normal retinal appearance and imaging conditions. In contrast, diseased classes show lower intra-class spread (Mild: 5.840; Moderate: 5.708; Severe: 5.035; Proliferative: 4.863), but they overlap more strongly with adjacent grades, explaining why misclassifications concentrate near class boundaries rather than within cluster cores. The misclassification-highlighted plots confirm that errors occur primarily in boundary regions especially around the Mild–Moderate interface and the Moderate–Severe/Proliferative interface supporting the interpretation that the remaining failure modes are driven by intrinsic feature overlap and limited minority-class support rather than a lack of learned structure. Table 11 shows t-SNE cluster summary on the test set ( n = 366). Table 12 with Intra-class spread (mean distance to class centroid). Figure 15 (a-c). t-SNE visualization of test-set feature embeddings ( n = 366) extracted from the 1280-D penultimate representation of EfficientNet-B1. (a) Ground-truth clusters with misclassified samples highlighted. (b) Ground-truth clusters showing overall class geometry. (c) Predicted-label clusters with misclassified samples highlighted. The embedding shows strong separability for No-DR and partial overlap among adjacent DR grades, with misclassifications concentrated near class boundaries. We projected penultimate-layer features for the test set into 2-D using t-SNE to qualitatively inspect representation structure. The resulting embedding suggests a moderately structured feature space: No-DR samples form a comparatively distinct region, whereas disease grades exhibit partial overlap, particularly between adjacent severities (Mild–Moderate and Moderate–Severe/Proliferative). Quantitatively, the silhouette score computed on the t-SNE embedding using ground-truth labels is 0.2799, indicating moderate separation rather than strong clustering. This observation aligns with the confusion matrix trends, where most errors occur between neighboring grades. We therefore interpret t-SNE as a supportive visualization to complement the quantitative evaluation, not as a standalone measure of class separability. The overlap observed in the embedding is expected in five-grade DR classification because severity transitions represent a continuum and minority classes have limited support.
Table 11 t-SNE cluster summary Metric Value Test Accuracy (%) 83.61 Silhouette score (GT on t-SNE) 0.2799 Mean inter-centroid distance 19.093
Table 11
t-SNE cluster summary
| Metric | Value |
| Test Accuracy (%) | 83.61 |
| Silhouette score (GT on t-SNE) | 0.2799 |
| Mean inter-centroid distance | 19.093 |
Table 12 Intra-class spread Class Spread No_DR_0 10.639 Mild_DR_1 5.84 Moderate_DR_2 5.708 Severe_DR_3 5.035 Proliferative_DR_4 4.863
Table 12
Intra-class spread
| Class | Spread |
| No_DR_0 | 10.639 |
| Mild_DR_1 | 5.84 |
| Moderate_DR_2 | 5.708 |
| Severe_DR_3 | 5.035 |
| Proliferative_DR_4 | 4.863 |
Fig. 15 ( a ) Ground-truth clusters t-SNE visualization. ( b ) Ground-truth clusters showing overall class geometry. ( c ) Predicted-label clusters visualization in 2-D space
Иллюстрация — в первоисточнике ↗
Explainability GradCAM visualizations
Figure 16 (a–c) show Grad-CAM visualizations provide qualitative insight into which retinal regions contributed most to the model’s decisions; however, they should be interpreted as explanatory cues rather than clinically validated lesion localization including lesion-like regions associated with DR (e.g., microaneurysm- and exudate-type patterns), rather than peripheral image borders or background artifacts. Importantly, even for misclassified examples, the highlighted regions often coincide with visible pathological cues, suggesting that errors are more likely due to subtle inter-grade boundaries than a failure to localize relevant evidence. By presenting both correctly classified cases and typical failure scenarios, Fig. 16 provides a qualitative and interpretable explanation of the model’s decisions and offers supportive visual evidence of lesion-relevant regions in the grading outputs.
Fig. 16 ( a ) GradCAM Heatmaps for Class 0. ( b ) GradCAM Heatmaps for Class 2. ( c ) GradCAM Heatmaps for Class 4
Иллюстрация — в первоисточнике ↗
The Grad-CAM analysis is qualitative and was not evaluated by ophthalmologists in this study. Formal expert assessment of whether highlighted regions align with clinically confirmed lesions is an important direction particularly for establishing trust in high-stakes screening settings.
Error analysis
To better understand the failure cases under Experimental Protocol 1, we examined representative misclassified images from the validation set. Figure 17 shows randomly selected samples where the predicted grade differed from the ground-truth label. Most of these errors occurred between Moderate_DR_2 and Severe_DR_3, and in a few cases Proliferative_DR_4 was misclassified as Moderate_DR_2. Many of these challenging images showed overlapping pathological features, and some also had poor image quality, which likely contributed to the wrong predictions. These observations suggest that future improvements may need stronger augmentation and more targeted loss weighting to better handle difficult cases. Figure 17 provides these misclassified examples, together with their true and predicted labels, to illustrate the main failure patterns of the model.
Fig. 17 Sample misclassifications
Иллюстрация — в первоисточнике ↗
Conclusion and future scope
In this study, we developed a five-class diabetic retinopathy (DR) grading framework on the APTOS 2019 dataset by combining luminance-based CLAHE, robust augmentation strategies including CutMix, and focal loss with label smoothing on top of an EfficientNet-B1 backbone. The overall results were encouraging. On the validation set, the model reached 84.07% accuracy with a macro-F1 of 0.6962, and the ablation study showed that these gains were linked to the design choices in the pipeline rather than to chance alone. On the held-out test set, the full model achieved 83.61% accuracy and a macro-F1 of 0.6434 under standard inference. When safe test-time augmentation was applied, performance improved modestly to 84.97% accuracy and 0.6627 macro-F1. Calibration also improved, with ECE decreasing from 0.0327 to 0.0239, suggesting that the confidence scores were better aligned with actual prediction correctness. A closer look at the class-wise results showed that the benefit of TTA was more noticeable for the Mild and Moderate classes, while Severe remained the most difficult grade to classify reliably. This is likely related to the limited number of Severe samples and the visual overlap with neighboring stages. The ablation analysis also made the role of CLAHE clearer: when it was removed, test performance dropped to 80.87% accuracy and 0.6194 macro-F1. This indicates that luminance-based contrast enhancement contributed meaningfully to generalization in this benchmark setting. Additional analyses helped put these results into context. The t-SNE feature-space visualization showed moderate separation between classes, with a silhouette score of 0.2799. No-DR formed a relatively clearer cluster, whereas the diseased grades showed more overlap, which matched the confusion-matrix patterns. Grad-CAM heatmaps also provided useful qualitative insight by highlighting the retinal regions that influenced the model’s decisions, although these maps should be viewed as supportive interpretability evidence rather than as clinically validated lesion localization. We used cross-validation to examine performance consistency and the fixed held-out test set to report final unbiased performance. Taken together, these two evaluation settings suggest that the proposed framework is reasonably robust and generalizes well within the limits of this dataset.
At the same time, several limitations should be acknowledged. The gap between training and validation or test performance shows that overfitting was reduced, but not fully eliminated. In addition, all experiments were conducted on a single public benchmark dataset, APTOS 2019, so the findings should be interpreted as benchmark-level evidence rather than proof of real-world deployment readiness. Another important limitation is the relatively low sensitivity for Severe DR. From a clinical perspective, this matters because missed advanced cases may delay referral and treatment. For that reason, the proposed system should not be viewed as a standalone decision-maker for advanced disease detection. At its current stage, it is better understood as an assistive, research-oriented decision-support framework. Future work will focus on improving discrimination between adjacent grades, especially Moderate and Severe, through class-balanced or margin-based optimization, and on testing generalization more rigorously through external validation. Overall, the proposed method shows promise, but it should still be regarded as a research-stage framework rather than a deployment-ready clinical system.
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Author contributions
The corresponding author composed the principal manuscript, while the co-authors edited it, and KKG organized all figures. All co-authors conducted a review of the manuscript. All authors contributed to conceptualization, analysis, visualization, coding implementation, validation, data management, and proofreading.
Funding
Open access funding provided by Siksha 'O' Anusandhan (Deemed To Be University). This research did not receive any specific grant from funding agencies in the public, commercial, or not-for-profit sectors.
Data availability
Data availability statement: The data that support the findings of this study are available on request from the corresponding author upon reasonable request.
Declarations
Ethical approval
The data used in this study were obtained from the publicly available Kaggle database. All datasets on Kaggle are shared under licenses that allow open research use. Therefore, this study did not require separate ethical approval, and no exemption was necessary under applicable institutional and national guidelines.
Consent to participate
Not applicable.
Consent for publication
Not applicable.
Competing interests
The authors declare no competing interests.
References
1. International Diabetes Federation IDF diabetes atlas 2015 7 Brussels International Diabetes Federation 35914061 International Diabetes Federation. IDF diabetes atlas. 7th ed. Brussels: International Diabetes Federation; 2015.
2. Boyd K. Diabetic retinopathy: causes, symptoms, treatment. American Academy of Ophthalmology. 2025. Available at: https://www.aao.org/eye-health/diseases/what-is-diabetic-retinopathy . Accessed 31 Mar 2026.
3. Alyoubi WL Abulkhair MF Shalash WM Diabetic retinopathy fundus image classification and lesions localization system using deep learning Sensors 2021 21 11 3704 10.3390/s21113704 34073541 PMC8198489 Alyoubi WL, Abulkhair MF, Shalash WM. Diabetic retinopathy fundus image classification and lesions localization system using deep learning. Sensors. 2021;21(11):3704. 34073541 10.3390/s21113704 PMC8198489
4. Gayathri S Gopi VP Palanisamy P A lightweight CNN for diabetic retinopathy classification from fundus images Biomed Signal Process Control 2020 62 102115 10.1016/j.bspc.2020.102115 Gayathri S, Gopi VP, Palanisamy P. A lightweight CNN for diabetic retinopathy classification from fundus images. Biomed Signal Process Control. 2020;62:102115.
5. Alwakid G Gouda W Humayun M Enhancement of diabetic retinopathy prognostication using deep learning, CLAHE, and ESRGAN Diagnostics 2023 13 14 2375 10.3390/diagnostics13142375 37510123 PMC10378524 Alwakid G, Gouda W, Humayun M. Enhancement of diabetic retinopathy prognostication using deep learning, CLAHE, and ESRGAN. Diagnostics. 2023;13(14):2375. 37510123 10.3390/diagnostics13142375 PMC10378524
6. Islam MR Abdulrazak LF Nahiduzzaman M Goni MOF Anower MS Ahsan M Haider J Kowalski M Applying supervised contrastive learning for the detection of diabetic retinopathy and its severity levels from fundus images Comput Biol Med 2022 146 105602 10.1016/j.compbiomed.2022.105602 35569335 Islam MR, Abdulrazak LF, Nahiduzzaman M, Goni MOF, Anower MS, Ahsan M, Haider J, Kowalski M. Applying supervised contrastive learning for the detection of diabetic retinopathy and its severity levels from fundus images. Comput Biol Med. 2022;146:105602. 35569335 10.1016/j.compbiomed.2022.105602
7. Khojasteh P Alipanahi B Khojasteh F Alipanahi A Using DenseNet for automated diabetic retinopathy grading J Digit Imaging 2021 34 2 441 8 Khojasteh P, Alipanahi B, Khojasteh F, Alipanahi A. Using DenseNet for automated diabetic retinopathy grading. J Digit Imaging. 2021;34(2):441–8.
8. Ghosh R Bhattacharya M Das A EfficientNet-based ensemble for retinal disease detection Biomed Signal Process Control 2023 80 104248 Ghosh R, Bhattacharya M, Das A. EfficientNet-based ensemble for retinal disease detection. Biomed Signal Process Control. 2023;80:104248.
9. Selvaraju RR, Cogswell M, Das A, Vedantam R, Parikh D, Batra D. Grad-CAM: visual explanations from deep networks via gradient-based localization. In: Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2017. pp 618–626.
10. Gulshan V Peng L Coram M Stumpe MC Wu D Narayanaswamy A Development and validation of a deep learning algorithm for detection of diabetic retinopathy in retinal fundus photographs JAMA 2016 316 22 2402 10 10.1001/jama.2016.17216 27898976 Gulshan V, Peng L, Coram M, Stumpe MC, Wu D, Narayanaswamy A, et al. Development and validation of a deep learning algorithm for detection of diabetic retinopathy in retinal fundus photographs. JAMA. 2016;316(22):2402–10. 27898976 10.1001/jama.2016.17216
11. Decencière E Zhang X Cazuguel G Lay B Cochener B Trone C Feedback on a publicly distributed image database: the Messidor database Image Anal Stereol 2014 33 3 231 4 10.5566/ias.1155 Decencière E, Zhang X, Cazuguel G, Lay B, Cochener B, Trone C, et al. Feedback on a publicly distributed image database: the Messidor database. Image Anal Stereol. 2014;33(3):231–4.
12. Pratt H Coenen F Broadbent DM Harding SP Zheng Y Convolutional neural networks for diabetic retinopathy Procedia Comput Sci 2016 90 200 5 10.1016/j.procs.2016.07.014 Pratt H, Coenen F, Broadbent DM, Harding SP, Zheng Y. Convolutional neural networks for diabetic retinopathy. Procedia Comput Sci. 2016;90:200–5.
13. Azizi S, Mustafa B, Ryan F, et al. Big self-supervised models advance medical image classification. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2021. pp 3478–3488.
14. Tufail A Rudisill C Egan C Kapetanakis VV Salas-Vega S Owen CG Automated diabetic retinopathy image assessment software: diagnostic accuracy and cost-effectiveness compared with human graders Ophthalmology 2017 124 3 343 51 10.1016/j.ophtha.2016.11.014 28024825 Tufail A, Rudisill C, Egan C, Kapetanakis VV, Salas-Vega S, Owen CG, et al. Automated diabetic retinopathy image assessment software: diagnostic accuracy and cost-effectiveness compared with human graders. Ophthalmology. 2017;124(3):343–51. 28024825 10.1016/j.ophtha.2016.11.014
15. Li F Chen H Liu Z Zhang X Wu Z A mobile-friendly deep learning system for diabetic retinopathy detection IEEE J Biomed Health Inf 2021 25 10 3799 807 Li F, Chen H, Liu Z, Zhang X, Wu Z. A mobile-friendly deep learning system for diabetic retinopathy detection. IEEE J Biomed Health Inf. 2021;25(10):3799–807.
16. Al-Bander B Williams BM Al-Taay A DenseNet for screening and diagnosis of diabetic retinopathy Med Image Anal 2019 55 88 107 Al-Bander B, Williams BM, Al-Taay A, et al. DenseNet for screening and diagnosis of diabetic retinopathy. Med Image Anal. 2019;55:88–107.31035060
17. Ramachandran N Sabarimalai Manikandan M Diabetic retinopathy detection using improved residual network Comput Biol Med 2021 140 105102 Ramachandran N, Sabarimalai Manikandan M. Diabetic retinopathy detection using improved residual network. Comput Biol Med. 2021;140:105102.34973521
18. Yan Z Zeng Z Shi W Multi-scale attention-guided network for diabetic retinopathy grading IEEE Trans Med Imaging 2021 40 3 818 28 33180722 10.1109/TMI.2020.3037771 Yan Z, Zeng Z, Shi W, et al. Multi-scale attention-guided network for diabetic retinopathy grading. IEEE Trans Med Imaging. 2021;40(3):818–28. 33180722 10.1109/TMI.2020.3037771
19. Mookiah MRK Computer-aided diagnosis of diabetic retinopathy: a review Comput Biol Med 2013 43 12 2136 55 10.1016/j.compbiomed.2013.10.007 24290931 Mookiah MRK, et al. Computer-aided diagnosis of diabetic retinopathy: a review. Comput Biol Med. 2013;43(12):2136–55. 24290931 10.1016/j.compbiomed.2013.10.007
20. Quellec G Charrière K Boudi Y Cochener B Lamard M Deep image mining for diabetic retinopathy screening Med Image Anal 2017 39 178 93 10.1016/j.media.2017.04.012 28511066 Quellec G, Charrière K, Boudi Y, Cochener B, Lamard M. Deep image mining for diabetic retinopathy screening. Med Image Anal. 2017;39:178–93. 28511066 10.1016/j.media.2017.04.012
21. Hacisoftaoglu RE Karabatak M Augmented deep learning model for automated grading of diabetic retinopathy Biomed Signal Process Control 2021 69 102926 Hacisoftaoglu RE, Karabatak M. Augmented deep learning model for automated grading of diabetic retinopathy. Biomed Signal Process Control. 2021;69:102926.
22. Lim G Bellemo V Xie Y Different deep learning architectures for automated detection of diabetic retinopathy in retinal images Comput Biol Med 2021 133 104334 Lim G, Bellemo V, Xie Y, et al. Different deep learning architectures for automated detection of diabetic retinopathy in retinal images. Comput Biol Med. 2021;133:104334.33823398
23. Li Q Feng B Xie L A cross-modality transfer learning approach for improved DR grading IEEE Access 2020 8 198879 87 Li Q, Feng B, Xie L, et al. A cross-modality transfer learning approach for improved DR grading. IEEE Access. 2020;8:198879–87.
24. Ronneberger O, Fischer P, Brox T. U-Net: convolutional networks for biomedical image segmentation. In: Medical Image Computing and Computer-Assisted Intervention (MICCAI), 2015. pp 234–241.
25. Abràmoff MD Lavin PT Birch M Shah N Folk JC Pivotal trial of an autonomous AI-based diagnostic system for detection of diabetic retinopathy in primary care offices npj Digit Med 2018 1 39 10.1038/s41746-018-0040-6 31304320 PMC6550188 Abràmoff MD, Lavin PT, Birch M, Shah N, Folk JC. Pivotal trial of an autonomous AI-based diagnostic system for detection of diabetic retinopathy in primary care offices. npj Digit Med. 2018;1:39. 31304320 10.1038/s41746-018-0040-6 PMC6550188
26. Ting DSW Cheung CY Lim G Development and validation of a deep learning system for diabetic retinopathy and related eye diseases using retinal images from multiethnic populations with diabetes JAMA 2017 318 22 2211 23 10.1001/jama.2017.18152 29234807 PMC5820739 Ting DSW, Cheung CY, Lim G, et al. Development and validation of a deep learning system for diabetic retinopathy and related eye diseases using retinal images from multiethnic populations with diabetes. JAMA. 2017;318(22):2211–23. 29234807 10.1001/jama.2017.18152 PMC5820739
27. Liu H Li L Jin J A novel transfer learning approach for medical imaging with class imbalance: application to diabetic retinopathy grading IEEE Trans Med Imaging 2020 39 11 3730 41 Liu H, Li L, Jin J, et al. A novel transfer learning approach for medical imaging with class imbalance: application to diabetic retinopathy grading. IEEE Trans Med Imaging. 2020;39(11):3730–41.
28. Gulshan V Rajan RP Widner K Performance of a deep learning algorithm vs manual grading for detecting diabetic retinopathy in India JAMA Ophthalmol 2019 137 9 987 93 10.1001/jamaophthalmol.2019.2004 31194246 PMC6567842 Gulshan V, Rajan RP, Widner K, et al. Performance of a deep learning algorithm vs manual grading for detecting diabetic retinopathy in India. JAMA Ophthalmol. 2019;137(9):987–93. 31194246 10.1001/jamaophthalmol.2019.2004 PMC6567842
29. Szegedy C, Vanhoucke V, Ioffe S, et al. Rethinking the Inception architecture for computer vision. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. pp 2818–2826.
30. Zhou B, Khosla A, Lapedriza A, et al. Learning deep features for discriminative localization. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. pp 2921–2929.
31. Lin T-Y, Goyal P, Girshick R, et al. Focal loss for dense object detection. In: Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2017. pp 2980–2988.
32. Yun S, Han D, Oh SJ, Chun S, Choe J, Yoo Y. CutMix: regularization strategy to train strong classifiers with localizable features. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), 2019. pp 6023–6032.
33. Zhang H, Cisse M, Dauphin YN, Lopez-Paz D. mixup: beyond empirical risk minimization. In: International Conference on Learning Representations (ICLR). 2018.
34. Goodfellow I Bengio Y Courville A Deep learning 2016 Cambridge MIT Press Goodfellow I, Bengio Y, Courville A. Deep learning. Cambridge: MIT Press; 2016.
35. He K, Zhang X, Ren S, Sun J. Deep residual learning for image recognition. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. pp 770–778.
36. Rajalakshmi R Subashini R Anjana RM Mohan V Automated retinal image analysis for diabetic retinopathy detection using deep learning methods J Diabetes Sci Technol 2018 12 4 688 95 Rajalakshmi R, Subashini R, Anjana RM, Mohan V. Automated retinal image analysis for diabetic retinopathy detection using deep learning methods. J Diabetes Sci Technol. 2018;12(4):688–95.
37. Gargeya R Leng T Automated identification of diabetic retinopathy using deep learning Ophthalmology 2017 124 7 962 9 10.1016/j.ophtha.2017.02.008 28359545 Gargeya R, Leng T. Automated identification of diabetic retinopathy using deep learning. Ophthalmology. 2017;124(7):962–9. 28359545 10.1016/j.ophtha.2017.02.008
38. Li Z He Y Keel S Meng W Chang RT He M Efficacy of a deep learning system for detecting glaucomatous optic neuropathy based on color fundus photographs Ophthalmology 2018 125 8 1199 206 10.1016/j.ophtha.2018.01.023 29506863 Li Z, He Y, Keel S, Meng W, Chang RT, He M. Efficacy of a deep learning system for detecting glaucomatous optic neuropathy based on color fundus photographs. Ophthalmology. 2018;125(8):1199–206. 29506863 10.1016/j.ophtha.2018.01.023
39. Fu H Cheng J Xu Y Zhang C Wong DWK Liu J Cao X Disc-aware ensemble network for glaucoma screening from fundus image IEEE Trans Med Imaging 2018 37 11 2493 501 10.1109/TMI.2018.2837012 29994764 Fu H, Cheng J, Xu Y, Zhang C, Wong DWK, Liu J, Cao X. Disc-aware ensemble network for glaucoma screening from fundus image. IEEE Trans Med Imaging. 2018;37(11):2493–501. 29994764 10.1109/TMI.2018.2837012
40. Saha S Chandak AL Rajashekar D Sivaswamy J GRAD-CNN: a novel grid-based attention mechanism for diabetic retinopathy classification in fundus images Comput Biol Med 2020 116 103588 Saha S, Chandak AL, Rajashekar D, Sivaswamy J. GRAD-CNN: a novel grid-based attention mechanism for diabetic retinopathy classification in fundus images. Comput Biol Med. 2020;116:103588.
41. Kaggle. APTOS 2019 blindness detection. 2019. Available at: https://www.kaggle.com/competitions/aptos2019-blindness-detection . Accessed 31 Mar 2026.
42. Bodapati JD Shareef SN Naralasetti V Composite deep neural network with gated-attention mechanism for diabetic retinopathy severity classification J Ambient Intell Humaniz Comput 2021 12 10 9825 39 10.1007/s12652-020-02727-z Bodapati JD, Shareef SN, Naralasetti V. Composite deep neural network with gated-attention mechanism for diabetic retinopathy severity classification. J Ambient Intell Humaniz Comput. 2021;12(10):9825–39.
43. Dondeti V Bodapati JD Shareef SN Veeranjaneyulu N Deep convolution features in non-linear embedding space for fundus image classification Rev Intell Artif 2020 34 3 307 13 Dondeti V, Bodapati JD, Shareef SN, Veeranjaneyulu N. Deep convolution features in non-linear embedding space for fundus image classification. Rev Intell Artif. 2020;34(3):307–13.
44. Gangwar AK Ravi V Bhateja V Peng S-L Satapathy SC Zhang Y-D Diabetic retinopathy detection using transfer learning and deep learning Evolution in computational intelligence 2020 Singapore Springer 679 89 Gangwar AK, Ravi V. Diabetic retinopathy detection using transfer learning and deep learning. In: Bhateja V, Peng S-L, Satapathy SC, Zhang Y-D, editors. Evolution in computational intelligence. Singapore: Springer; 2020. pp. 679–89.
45. Kassani SH, Kassani PH, Khazaeinezhad R, Wesolowski MJ, Schneider KA, Deters R. Diabetic retinopathy classification using a modified Xception architecture. In: 2019 IEEE International Symposium on Signal Processing and Information Technology (ISSPIT), Ajman, United Arab Emirates, 2019. pp 1–6.
46. Dekhil O, Naglah A, Shaban M, Ghazal M, Taher F, Elbaz A. Deep learning based method for computer aided diagnosis of diabetic retinopathy. In: 2019 IEEE International Conference on Imaging Systems and Techniques (IST), Abu Dhabi, United Arab Emirates, 2019. pp 1–4.
Предметные рубрики MeSH
Подготовка и перевод публикации
Обработка статьи · этапы, ошибки и управление
Ошибки и ограничения
История · было → стало
Состояние обновляется каждые 5 секунд, пока блок открыт. Процент показывается только там, где известен объём работы. Пауза останавливает продолжение этапа; текущий запрос к источнику может завершиться.
Тип публикации указан по данным источника. Уровень доказательности автоматически не присваивается.