Graph-enhanced deep learning for diabetic retinopathy diagnosis: A quality-aware and uncertainty-driven approach

Zarin Akter, Jawad Ibn Ahad, Md. Mutasim Farhan, Riasat Khan

βœ… Published in PLOS Computational Biology (Q1, Open Access)

πŸ“„ Paper: PLOS Computational Biology
DOI: 10.1371/journal.pcbi.1013745
πŸ’» Code: github.com/mfar201/diabetic_retinopathy_classification_gcn
Received: April 02, 2025 Β· Accepted: November 13, 2025 Β· Published: December 5, 2025


Abstract

Diabetic retinopathy (DR) is a leading cause of vision impairment, significantly impacting working-class populations and necessitating accurate early diagnosis. Traditional DR classification relies on CNN-based models and extensive preprocessing. We propose a novel approach leveraging pre-trained models for feature extraction, followed by Graph Convolutional Networks (GCNs) for refined embedding representation. The extracted feature vectors are structured as a graph, where GCN enhances embeddings before classification. The model incorporates quality assessment (QA) by predicting a confidence score through a dedicated fully connected layer trained with binary cross-entropy loss, and uncertainty estimation (UE) by calculating variance across multiple stochastic passes. Evaluated on APTOS2019, Messidor-2, and EyePACS, the framework achieves superior performance over state-of-the-art methods: 98.45% accuracy (MobileViT, APTOS2019), 94.90% accuracy (DenseNet-169, Messidor-2), and 97.38% accuracy (DenseNet-169, EyePACS) β€” all without requiring intensive image preprocessing.


Introduction

Traditional vs Proposed DR Pipeline

Figure 1: Traditional DR classification (top) relies on CNN-based models with extensive preprocessing on raw fundus images. The proposed strategy (bottom) utilizes pre-trained models for feature extraction (FE). The generated feature vectors (FV) are refined using a GCN and subsequently leveraged for classification, quality assessment (QA), and uncertainty estimation (UE).

Diabetic retinopathy progresses in four stages: (a) Mild NPDR β€” microaneurysms in retinal blood vessels; (b) Moderate NPDR β€” increased microaneurysms, hemorrhages, hard exudates; (c) Severe NPDR β€” body signals abnormal vessel formation; (d) Proliferative DR (PDR) β€” neovascularization causing fragile leaking vessels and potential blindness. 537 million adults worldwide live with diabetes (IDF); 22.27% suffer DR (2021).

Existing deep learning models excel at binary DR classification but struggle with reliable multiclass grading. They also depend on heavy preprocessing (CLAHE, Ben Graham normalization) and lack quality awareness and uncertainty quantification. We address all these gaps in a unified GCN-based framework.


🎯 Key Contributions

  • Preprocessing-free pipeline β€” GCN framework achieves SOTA performance directly on fundus images with only basic resizing and normalization, without CLAHE or Ben Graham preprocessing.
  • Graph-Structured Feature Refinement β€” Fundus image features structured as a graph G = (V, E); GCN aggregates spatial and semantic neighborhood information to enhance embeddings.
  • Quality Assessment (QA) β€” Fully connected layer predicts confidence score qΜ‚ = Οƒ(W_QA h^L + b_QA) ∈ [0,1], trained with binary cross-entropy loss.
  • Uncertainty Estimation (UE) β€” T=10 Monte Carlo dropout passes compute prediction variance σ² = (1/T)Ξ£(Ε·^(t) βˆ’ Θ³)Β²; high variance flags uncertain cases for clinical review.
  • Grad-CAM Interpretability β€” Heatmaps demonstrate clinically relevant focus on retinal pathologies (microaneurysms, hemorrhages, neovascularization).
  • 15 backbone architectures evaluated β€” CNN (DenseNet, ResNet, Inception, EfficientNet, Xception) and Transformer (ViT, Swin, DeiT, MobileViT).

Methodology

GCN-DR Model Architecture

Figure 2: Model architecture. Dataset D undergoes basic preprocessing (resize to 224Γ—224, transform, rotation). FE function f processes each sample x ∈ D to generate FV z ∈ R^d, refined to R^d via Global Average Pooling (GAP). A graph G = (V, E) is constructed with nodes corresponding to FVs; edge distance is computed from spatial distance d_sp and semantic distance d_se. Two GCN layers refine embeddings h^(1) ∈ R^512 β†’ h^(2) ∈ R^256. Two FCLs produce: Ε· ∈ R^{256Γ—5} (classification) and qΜ‚ ∈ [0,1] (quality assessment). Total loss: L_total = L_cls + Ξ»L_q.

Problem Formulation

Input dataset D of retinal images x_i ∈ R^{HΓ—W}. A backbone f extracts feature vector z = f(x) ∈ R^d. Graph G = (V, E) is constructed where nodes = features z, edges = spatial + semantic distances. GCN refines embeddings h. Softmax classifier: Ε· = softmax(W_cls h + b_cls) ∈ R^5.

Graph Construction

Combined edge distance between nodes i and j: \(d_{\text{comb}}(i,j) = \beta \cdot d_{\text{sp}}(i,j) + (1-\beta) \cdot d_{\text{se}}(i,j), \quad \beta \in [0,1]\)

Parameters: k=4 nearest neighbors, radius=0.1, Ξ²=0.5.

GCN Layer Update Rule

\[\mathbf{h}_i^{(l+1)} = \sigma\!\left(\sum_{j \in \mathcal{N}(i)} \frac{1}{\sqrt{\deg(i)\deg(j)}} \mathbf{W}_l \mathbf{h}_j^{(l)} + \mathbf{b}_l\right)\]

Two GCN layers: R^1024 β†’ R^512 β†’ R^256.

Quality Assessment & Uncertainty Estimation

QA loss: \(\mathcal{L}_q = \text{BCE}(\hat{q}, q) = -q\log(\hat{q}) - (1-q)\log(1-\hat{q})\)

Uncertainty (T=10 MC dropout passes): \(\bar{y} = \frac{1}{T}\sum_{t=1}^T \hat{y}^{(t)}, \qquad \sigma = \sqrt{\frac{1}{T}\sum_{t=1}^T (\hat{y}^{(t)} - \bar{y})^2}\)

Dropout rates: p=0.3 (classifier head), p=0.2 (GCN layers). Total loss: L_total = L_cls + Ξ»L_q (Ξ»=0.1).


πŸ“Š Datasets

Table 2: Dataset Statistics (5 DR Severity Classes)

ClassDR GradeAPTOS2019Messidor-2EyePACS
Class-0No DR1,8051,01725,810
Class-1Mild NPDR9992702,443
Class-2Moderate NPDR3703475,292
Class-3Severe NPDR29575873
Class-4PDR19335708
TotalΒ 3,6621,74835,126

Dataset split: 70% train / 15% validation / 15% test (stratified). Class imbalance handled via oversampling with Albumentations augmentation (rotations, flips, blur, brightness/contrast).


πŸ“Š Experimental Setup

Table 3: Hyperparameter Values

CategoryHyperparameterValue
TrainingEpochs50
Β Batch Size32
Β Learning Rate5e-5
Β OptimizerAdamW
Β Weight Decay0.01
Β LR SchedulerReduceLROnPlateau
Β Scheduler Patience7
Β Early Stopping Patience15
Graph ConstructionNeighbors (k)4
Β Radius0.1
Β Feature Weight (Ξ²)0.5
UncertaintyMC Dropout Samples (T)10
Β Inference Dropout Rate0.3
GCNInput Dimension1024
Β Hidden Dimensions[512, 256]
Β Output Dimension1024
Β Dropout Rate0.2
LossClassification Weight1.0
Β QA Loss Weight (Ξ»)0.1

Table 4: Model-Specific Training Parameters (15 Backbones)

ArchitectureBackboneModel Size (MB)ParametersSIIT (ms)Time/Epoch (s)
CNNResNet50295.2725,755,46216.5988.95
Β ResNet101513.0744,747,59019.2395.61
Β ResNet152692.5260,391,23822.821138.60
Β Xception458.7640,017,99015.261458.57
Β InceptionV3275.6924,032,99818.8893.30
Β InceptionResNetV2642.5856,025,51036.20100.40
Β EfficientNetB3142.9912,415,27817.8299.00
Β DenseNet12194.208,144,51820.92114.47
Β DenseNet161332.2928,884,55026.13103.75
Β DenseNet169165.5814,335,62223.3497.11
Β DenseNet201233.2320,208,26228.93105.91
TransformerViT-Base992.7686,725,12615.65104.87
Β Swin-Base1006.8487,933,88624.36101.43
Β DeiT-Base992.7786,726,66213.4991.84
Β MobileViT28.602,463,03019.2298.91

SIIT = Single Image Inference Time. Hardware: NVIDIA GeForce RTX 4070 (12GB VRAM), PyTorch.


πŸ“Š Results

Figure 3: Normalized Confusion Matrices

Confusion Matrices - APTOS and Messidor-2

Figure 3: Normalized confusion matrices for multiclass DR classification on APTOS2019 and Messidor-2 under three preprocessing conditions: No Preprocessing (left), CLAHE (middle), Ben-Graham (right). MobileViT on APTOS2019 shows excellent performance with minimal misclassification (AP=1.00). DenseNet-169 achieves high accuracy on Messidor-2.

Figure 4: Precision-Recall Curves

Precision-Recall Curves

Figure 4: Precision-recall curves for all 5 DR classes on APTOS2019 and Messidor-2 under three preprocessing conditions. Our pipeline (No Preprocessing) achieves AP=1.00 across all classes on APTOS2019 with MobileViT.

Table 5: Full SOTA Comparison (APTOS2019 & Messidor-2)

Legend: β–  CNN Β· β–΄ Transformer Β· ♣ CLAHE preprocessing Β· ♦ Ben-Graham preprocessing Β· β™‘ Our pipeline (no preprocessing)

Prior State-of-the-Art Methods

ArchRefBackboneAPTOS AccAPTOS F1APTOS AUROCAPTOS KappaMessidor AccMessidor F1Messidor AUROCMessidor Kappa
β– [6]ResNet5084.8084.30β€”90.9067.1065.50β€”66.30
β– [6]DenseNet12185.5084.90β€”90.6068.0066.00β€”67.30
β– [17]DenseNet12197.30β€”β€”β€”β€”β€”β€”β€”
β– [18]RSG-Netβ€”β€”β€”β€”99.3699.4099.98β€”
β– [21]ResNet5085.65β€”89.00β€”β€”β€”β€”β€”
β– [38]DenseNet20191.6291.52β€”β€”85.7985.08β€”β€”
β– [38]MobileNetV293.0993.53β€”β€”83.8185.23β€”β€”
β– [40]DenseNet12197.6897.0096.2098.50β€”β€”β€”β€”
β– [43]Xception84.3670.4993.82β€”74.2155.1887.26β€”
β–΄[44]Swin-Base88.7088.70β€”β€”83.1283.12β€”β€”

Our Pipeline β™‘ β€” No Preprocessing (Primary Results)

ArchBackboneAPTOS AccAPTOS F1APTOS AUROCAPTOS AUPRAPTOS KappaMessidor AccMessidor F1Messidor AUROCMessidor AUPRMessidor Kappa
β– ResNet5093.9594.0299.7098.9892.4470.4667.2892.5578.9063.07
β– ResNet10184.6584.0497.7993.5480.8140.0022.8679.6054.0725.00
β– ResNet15292.1892.1399.2597.6790.2279.8780.0796.5390.6174.84
β– Xception95.2895.2699.5998.6794.1093.0793.0599.1497.3491.34
β– InceptionV396.9796.9799.8299.3896.2294.1294.0899.4998.3592.65
β– InceptionResNetV294.9894.9599.4197.9793.7394.3894.3799.3797.9592.97
β– EfficientNetB396.8396.8299.8399.4096.0394.1294.1299.5298.4292.65
β– DenseNet12193.8793.8099.4498.1292.3487.5887.5998.6596.0684.48
β– DenseNet16196.2496.2399.7099.0295.3094.3894.3999.5298.4192.97
β– DenseNet16996.7596.7499.8199.3795.9494.9094.8799.5098.4293.63
β– DenseNet20196.6196.6099.8499.4395.7692.9492.9299.3597.9091.18
β–΄ViT-Base95.5795.5599.6298.7994.4688.6388.6698.0694.1785.78
β–΄Swin-Base96.9096.8999.8399.4496.1391.2491.2399.0496.8589.05
β–΄DeiT-Base95.7295.7199.7199.0794.6590.2090.1798.9196.5287.75
β–΄MobileViT98.4598.4599.9499.8198.0692.0392.0299.2597.4590.03

CLAHE Preprocessing ♣ (Comparison)

ArchBackboneAPTOS AccAPTOS KappaMessidor AccMessidor Kappa
β– MobileViT98.0197.5191.3789.22
β– DenseNet16996.6895.8593.4691.83
β– EfficientNetB396.9796.2292.9491.18
β–΄Swin-Base96.9096.1391.2489.05

Ben-Graham Preprocessing ♦ (Comparison)

ArchBackboneAPTOS AccAPTOS KappaMessidor AccMessidor Kappa
β– MobileViT93.9592.4492.5590.69
β– DenseNet16994.8393.5495.0393.79
β– EfficientNetB393.2191.5191.5089.38
β–΄Swin-Base95.4294.2890.5988.24

Our pipeline (β™‘) with NO preprocessing achieves the best overall results. MobileViT β™‘ reaches 98.45% Acc and 98.06% Kappa on APTOS2019 β€” surpassing CLAHE (98.01%) and Ben-Graham (93.95%) variants. DenseNet-169 β™‘ achieves 94.90% Acc on Messidor-2. Extensive preprocessing is unnecessary and often harmful.

Table 6: External Validation β€” EyePACS Dataset

Initially Trained OnBackboneEyePACS AccEyePACS F1EyePACS AUROCEyePACS AUPREyePACS Kappa
Messidor-2DenseNet-16997.38%97.37%99.83%99.39%96.72%
APTOS2019MobileViT96.02%96.02%99.60%98.69%95.03%

Strong cross-dataset generalization: DenseNet-169 pretrained on Messidor-2, fine-tuned on EyePACS (35,126 images), achieves 97.38% accuracy β€” demonstrating the framework’s robustness across diverse imaging conditions, demographics, and grading variations.


Explainability β€” Grad-CAM

Grad-CAM Heatmaps

Figure 5: Grad-CAM heatmaps for retinal fundus images across 5 DR severity levels. Each row: original image, Grad-CAM heatmap, prediction. Red regions indicate high classification influence. (a) No preprocessing (our approach). (b) CLAHE preprocessing. Stage-by-stage clinical interpretation:

  • No DR (Class 0): Diffuse, unfocused activations β€” confirming absence of pathological markers
  • Mild NPDR (Class 1): Small punctate activation areas β€” highlighting microaneurysms (earliest DR signs)
  • Moderate NPDR (Class 2): Larger, more pronounced regions β€” aligned with dot/blot hemorrhages and hard exudates
  • Severe NPDR & PDR (Class 3–4): Large intense activation areas β€” focused on retinal hemorrhages and neovascularization

πŸ“Š Ablation Study

Ablation Study

Figure 6 (a): Impact of class balancing strategies on APTOS2019 (MobileViT). Compared: original imbalanced dataset (OgD), Compute Class Weight (OgD WC), Weighted Random Sampler (OgD RS). Our balanced oversampling approach (black bar) consistently achieves highest Accuracy, F1, AUROC, AUPR, and Kappa. (b) AdamW vs SGD optimizer: AdamW outperforms SGD across all metrics, demonstrating better generalization and robustness.


πŸ“š Citation

@article{akter2025graph,
  title={Graph-enhanced deep learning for diabetic retinopathy diagnosis: A quality-aware and uncertainty-driven approach},
  author={Akter, Zarin and Ahad, Jawad Ibn and Farhan, Md. Mutasim and Khan, Riasat},
  journal={PLOS Computational Biology},
  volume={21},
  number={12},
  pages={e1013745},
  year={2025},
  publisher={Public Library of Science},
  doi={10.1371/journal.pcbi.1013745}
}