A five-fold EfficientNet-B0 ensemble that grades diabetic retinopathy (ICDRSS 0-4) from colour fundus photographs and makes a referral decision. Trained on APTOS-2019; exported to ONNX for CPU serving.
The export was checked against the original PyTorch models before publication:
maximum raw-score difference 3.1e-05 on 40 held-out images, zero grade
mismatches. export.json records that check alongside the thresholds and the
preprocessing settings the model expects.
Not a medical device. A benchmark model trained on one public dataset, with no clinical validation and no regulatory clearance. Do not use it for anyone's care.
Source, analysis and every number below: senanurcetin/APTOS-2019-diabetic-retinopathy.
Browser demo (no server, the image stays on your device): huggingface.co/spaces/senanurcetin/aptos-retinopathy-referral.
Server demo, serving these exact weights on a free CPU instance: aptos-2019-diabetic-retinopathy.onrender.com. The instance sleeps when idle, so the first request after a pause takes about a minute.
| APTOS test | IDRiD (external) | Messidor-2 (external) | |
|---|---|---|---|
| QWK | 0.9091 | 0.8045 | 0.4928 |
| referable ROC AUC | 0.983 | 0.984 | 0.819 |
| referable sensitivity | 0.956 | 0.885 | 0.328 |
| referable specificity | 0.917 | 0.987 | 0.990 |
IDRiD is a different clinic, camera and grading team (both sets are from India), and all of its images share one resolution - so the acquisition shortcut described below is unavailable there. No fine-tuning, and the APTOS thresholds were not refitted. Discrimination transferred essentially intact.
Messidor-2 (France, 1744 images graded by an adjudicating panel of three retina specialists) is where it stops. A prediction written before the run expected referable AUC >= 0.93; it came out 0.819. The next section says why.
POST /predict multipart file -> grade, referable, raw score, fold spread
GET /model-card the limitations above, as JSON
GET /health
The response includes fold_spread, the standard deviation of the five fold
models' scores for that image. A large spread means the folds disagree, and the
prediction deserves less weight.
The October research update documents the examination-disjoint Messidor-2 comparison. Its fine-tuned research arms are separate from the historical five-fold ONNX ensemble in this repository. The benchmark remains for research use. See the Kaggle research notebook for the original predictions and external-validation context.
fold1.onnx 16 MBfold2.onnx 16 MBfold3.onnx 16 MBfold4.onnx 16 MBfold5.onnx 16 MB