A clinical-grade deep learning system for automated diabetic retinopathy screening using evidential deep learning with uncertainty quantification.
RetinaGuard AI detects and grades diabetic retinopathy from retinal fundus images, providing:
- 5-class grading (No DR, Mild, Moderate, Severe, Proliferative DR)
- Uncertainty estimates for clinical decision support
- Referable DR detection with 92.4% accuracy
- Real-time inference (<50ms per image)
- 463 million people worldwide have diabetes
- 35% develop some form of diabetic retinopathy
- 95% of vision loss is preventable with early detection
- Current challenge: Only 20,000 ophthalmologists for 65,000 needed globally
- Evidential Deep Learning: Quantifies prediction uncertainty for safer clinical deployment
- Multi-Scale Analysis: Detects lesions of varying sizes
- Clinical Validation: Achieves expert-level performance (κ = 0.91)
- Production Ready: Includes preprocessing, quality checks, and clinical reporting
- Backbone: EfficientNet-B3 (pretrained on ImageNet)
- Multi-scale features: Captures lesions at different scales
- Attention modules: Focuses on clinically relevant regions
- Evidential head: Outputs Dirichlet distribution parameters
- Feature Extraction: Multi-scale CNN with attention
- Uncertainty Quantification: Epistemic + aleatoric uncertainty
- Clinical Heads: Severity score + referable DR classifier
| Metric | Value |
|---|---|
| Accuracy | 92.4% |
| Quadratic Kappa | 0.914 |
| Referable DR AUC | 0.983 |
| Sensitivity @ 95% Spec | 91.2% |
| Grade | Precision | Recall | F1-Score |
|---|---|---|---|
| No DR | 0.95 | 0.94 | 0.94 |
| Mild | 0.88 | 0.87 | 0.87 |
| Moderate | 0.91 | 0.89 | 0.90 |
| Severe | 0.93 | 0.91 | 0.92 |
| Proliferative | 0.96 | 0.95 | 0.95 |
Run the Gradio interface:
python app.pyFeatures:
- Drag-and-drop image upload
- Real-time prediction with uncertainty
- Clinical recommendations
- Attention heatmap visualization
- Prepare data: Organize images in
data/train/withlabels.csv - Configure training: Edit
config.yaml - Run training:
python scripts/train.py --config config.yaml
- Monitor progress: TensorBoard logs in
runs/
python scripts/evaluate.py --model path/to/model.pth --data path/to/testGenerates:
- Confusion matrix
- ROC curves
- Clinical performance report
- Uncertainty calibration plots
Our approach combines:
- EfficientNet backbone for robust feature extraction
- Evidential deep learning for uncertainty quantification
- Clinical loss functions respecting ordinal DR grades
- Test-time augmentation for robust predictions
- Ordinal regression loss for grade consistency
- Clinical auxiliary tasks (severity, referability)
- Uncertainty-guided referral system
This project is licensed under the MIT License - see LICENSE for details.
This software is for research purposes only. Not FDA approved. Always consult qualified healthcare professionals for medical decisions.
- Kaggle APTOS 2019 Blindness Detection Challenge
- EfficientNet authors
- Evidential deep learning community