An AI-assisted diabetic retinopathy (DR) screening prototype that detects and grades DR from fundus images, highlights suspicious retinal regions, and provides interpretable outputs for clinical decision support.
DRP_segmentation/
├── notebooks/
│ ├── 01_disease_segmentation.ipynb # DR grading preprocessing — APTOS 2019
│ ├── 02_vessel_segmentation.ipynb # Vessel segmentation preprocessing — DRIVE
│ └── 03_binary_classification_filter.ipynb # Binary DR filter — DR Resized
├── src/
│ └── engine/
│ └── image_preprocessing.py # Core preprocessing pipeline
├── data/
│ ├── raw/ # Downloaded datasets (gitignored)
│ └── processed/ # Preprocessed .npz files (gitignored)
└── README.md
| # | Notebook | Dataset | Task | Images |
|---|---|---|---|---|
| 01 | 01_disease_segmentation.ipynb |
APTOS 2019 | DR Grading (0–4) + Preprocessing | 3,662 |
| 02 | 02_vessel_segmentation.ipynb |
DRIVE | Vessel Segmentation + Masks | 40 |
| 03 | 03_binary_classification_filter.ipynb |
DR Resized | Binary DR vs No-DR Filter | ~35k |
All notebooks share the same core pipeline (src/engine/image_preprocessing.py):
- Load — Read fundus image (PNG/JPEG/TIFF)
- Resize — Standardize to ×ばつ512
- CLAHE — Contrast Limited Adaptive Histogram Equalization for vessel/lesion enhancement
- Normalize — Zero-one scaling [0, 1]
- Save — Export as compressed
.npzwith image array + metadata
Before running any notebook, add your Kaggle credentials to Colab Secrets (🔑 icon):
| Secret Name | Value |
|---|---|
KAGGLE_TOKEN |
Full content of your kaggle.json |
Get your token from: kaggle.com/settings → API → Create New Token
1. Open notebook in Colab (use badge above)
2. Runtime → Run all (Ctrl+F9)
3. Run Cell 11 separately to save .npz files to Google Drive
| Dataset | Source | DR Grading | Lesion Masks | License |
|---|---|---|---|---|
| APTOS 2019 | Kaggle | ✅ 0–4 | ❌ | CC BY 4.0 |
| DRIVE | Kaggle | ❌ | ✅ Vessel masks | Research |
| DR Resized | Kaggle | ✅ 0–4 | ❌ | CC BY 4.0 |
- DR Grading: Quadratic Weighted Kappa (QWK), AUC-ROC, Accuracy per grade
- Segmentation: Dice coefficient, IoU, Sensitivity, Specificity
- Classification: AUC-ROC, F1-score, Sensitivity, Specificity
- Explainability: Grad-CAM heatmaps for lesion localization
- Notebook 06 — Grad-CAM Explainability
- Notebook 07 — Clinical Interface (Gradio/Streamlit)