Input: A retinal fundus image.
Output:
Image quality → Accept / RejectDR grade → Level 0–4Referable DR → Yes / NoConfidenceExplanation → Grad-CAM / lesion evidenceFundus Image
│
▼
[Preprocessing]
│
▼
[Image Quality Check]
│
├── Poor → Reject / Recapture
│
▼
[DR Classification Model]
│
├── Grade 0
├── Grade 1
├── Grade 2
├── Grade 3
└── Grade 4
│
▼
[Referable?]
│
▼
[Grad-CAM + Confidence]
│
▼
[Screening Report]
The segmentation/lesion-detection components can then be added incrementally.
ml/
│
├── data/
│ ├── raw/
│ ├── processed/
│ ├── train/
│ ├── validation/
│ └── test/
│
├── preprocessing/
│ ├── quality_assessment
│ ├── illumination_normalization
│ ├── denoising
│ └── enhancement
│
├── models/
│ ├── quality_model/
│ ├── dr_classifier/
│ ├── lesion_detection/
│ └── segmentation/
│
├── training/
│ ├── train_quality_model
│ ├── train_classifier
│ └── evaluate
│
├── explainability/
│ ├── gradcam
│ ├── confidence
│ └── lesion_evidence
│
├── pipeline/
│ └── inference
│
├── reports/
│ └── report_generation
│
├── simulink/
│
├── evaluation/
│ ├── metrics
│ ├── confusion_matrix
│ └── benchmark_comparison
│
└── README.md
Image
↓
Preprocessing
↓
DR classifier
↓
0–4 prediction
↓
Referable / non-referable
↓
Confidence
Just:
Given a fundus image, can our model reliably classify its DR severity?
We need images with ground-truth DR severity labels corresponding as closely as possible to:
0 → No DR
1 → Mild NPDR
2 → Moderate NPDR
3 → Severe NPDR
4 → Proliferative DR
The problem statement explicitly expects this five-level classification.
For the initial prototype, the most important dataset properties are:
Do not start training until the dataset and label mapping are written down.
Image → {0,1,2,3,4}
Image → {Non-referable, Referable}
where:
0, 1 → Non-referable
2, 3, 4 → Referable
The problem statement specifically defines Level 2+ as referable.
Our model can therefore produce:
Predicted class: 3
Confidence: 0.87
Referable DR: YES
Use transfer learning.
Conceptually:
Pretrained CNN
│
▼
Fundus image
│
▼
Feature extraction
│
▼
Classification head
│
▼
5 DR classes
Possible backbone families can be decided later based on MATLAB support and compute availability.
Our initial experiment should answer:
Can a pretrained image-classification network fine-tuned on the chosen dataset achieve useful DR classification performance?
Only after that should we start experimenting with architectures.
Raw image
↓
Resize
↓
Crop / remove irrelevant borders
↓
Normalize
↓
Optional contrast enhancement
↓
Model
Later we'll investigate:
CLAHE
illumination normalization
denoising
color normalization
etc.
The problem statement specifically calls for CLAHE, illumination normalization and denoising as possible enhancement techniques.
This should be a separate model/module rather than mixing it into the DR classifier initially.
Its job:
Fundus image
↓
Quality assessment
↓
┌───────────────┐
│ │
Good Ungradeable
│ │
▼ ▼
DR model Reject
Initially, we can even implement a basic rule-based quality check before training a dedicated quality model.
Eventually:
Quality Model
Input image
↓
Quality features
↓
├── Focus
├── Illumination
├── Field of view
└── Overall gradability
↓
Gradeable / Ungradeable
This is important because the problem specifically targets variable-quality portable-camera images.
The statement asks for:
Fundus → DR severity
Fundus → DR severity
↘
lesion evidence
Fundus
├── optic disc/fovea
├── vessels
├── microaneurysms
├── exudates
├── hemorrhages
└── neovascularization
Once we have:
Image → prediction
add:
Image
↓
Classifier
↓
Prediction
+
Grad-CAM
↓
Heatmap
The intended question is:
What part of the retinal image caused the model to make this prediction?
Then eventually correlate those regions with actual lesions.
The problem statement explicitly requests Grad-CAM, lesion-level evidence and calibrated confidence.
So the eventual output could look conceptually like:
DR Grade: 3
Confidence: 91%
Referable DR: YES
Evidence:
┌──────────────────────┐
│ retinal photograph │
│ + │
│ Grad-CAM │
│ overlay │
└──────────────────────┘
For the 5-class problem, track:
Accuracy
Precision
Recall
F1
Confusion matrix
For the referable DR problem, prioritize:
Sensitivity
Specificity
ROC-AUC
PR-AUC
The problem statement's explicit targets are:
Sensitivity > 90%
Specificity > 85%
for referable DR.
Result
--------------------------------
Sensitivity XX.XX%
Specificity XX.XX%
ROC-AUC X.XXX
Accuracy XX.XX%
F1 X.XXX
Dataset
↓
Train / validation / test split
↓
Resize + normalize
↓
Pretrained CNN
↓
5-class classifier
↓
Train
↓
Evaluate
Record:
Dataset version
Number of images
Class distribution
Image resolution
Preprocessing
Model architecture
Learning rate
Batch size
Epochs
Training time
Validation metrics
Test metrics
Your experiment progression can be:
EXP-001
Baseline CNN
↓
EXP-002
+ preprocessing
↓
EXP-003
+ augmentation
↓
EXP-004
different backbone
↓
EXP-005
class imbalance handling
↓
EXP-006
hyperparameter tuning
↓
EXP-007
referable-DR optimization
↓
EXP-008
Grad-CAM
↓
EXP-009
quality assessment
↓
EXP-010
integrated pipeline
For the initial skeleton, explicitly put these in the backlog:
They're part of the eventual solution, but they're downstream of the fundamental ML pipeline.
The problem statement ultimately expects the integrated pipeline plus Simulink simulation and benchmark validation.
comments (0)