YOLO — retinal OCT classification (Kermany OCT2017)
Four-class classifier for retinal optical coherence tomography scans — choroidal neovascularisation (CNV), diabetic macular oedema (DME), drusen, normal — built with Ultralytics YOLO (classification). Trained with one fixed recipe that we apply unchanged to every dataset, without dataset-specific tuning.
96.49 % accuracy on the official OCT2017 test set, trained with every test patient removed from the training data.
| Metric on the official test set (968 scans) | Value |
|---|---|
| Accuracy | 96.49 % |
| Macro F1 | 96.51 % |
Full write-up: GitHub.
Why "test patients removed" matters
The official OCT2017 folders put scans of the same patients in both training and test. Reading the patient id in every file name (CNV-1016042-1.jpeg → 1016042) shows that 27,693 of the 83,516 training and validation scans (33 %) come from test-set patients. This model was trained without them, and validated on held-out patients too.


Results

CNV and normal: 242 / 242 each · DME: 232 / 242 · drusen: 218 / 242 (all errors called CNV).
Training and evaluation
| Training data | max 4,000 scans per class (15,310), no test-set patients |
| Training | 50 epochs, 224 px, batch 64, Ultralytics default augmentation |
| Validation | 6,026 scans of held-out patients |
| Test | official OCT2017 test set, evaluated once |
| Hardware | one NVIDIA T4 |
Usage
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
model = YOLO(hf_hub_download("ghostsas001/oct-retina-yolo", "yolo.pt"))
result = model.predict("scan.jpeg", imgsz=224)[0]
print(model.names[int(result.probs.top1)])
Labels: CNV, DME, DRUSEN, NORMAL.
Limitations
Research model, not a medical device. Trained on scans from the OCT2017 release only; other devices or protocols may reduce accuracy. One training run, no confidence intervals.
References
- Kermany D.S. et al. Identifying Medical Diagnoses and Treatable Diseases by Image-Based Deep Learning. Cell 172, 2018. doi:10.1016/j.cell.2018.02.010
- Dataset: OCT2017, Kaggle release paultimothymooney/kermany2018
- Ultralytics YOLO — docs.ultralytics.com
Licence
Built with Ultralytics YOLO, which is licensed under AGPL-3.0; these weights are distributed under the same licence. The training data (Kaggle release) is licensed CC BY-NC-SA 4.0: use these weights for non-commercial purposes only.