Instructions to use manudaza/retinal-triage-efficientnetb0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use manudaza/retinal-triage-efficientnetb0 with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://manudaza/retinal-triage-efficientnetb0") - Notebooks
- Google Colab
- Kaggle
Retinal Screening Triage β Fine-tuned EfficientNetB0
Fine-tuned EfficientNetB0 for diabetic retinopathy severity grading, built as part of a retinal screening triage system for a virtual diabetic eye clinic. Not a diagnostic device β this model exists to triage a review queue, not to replace clinician assessment.
Model description
- Architecture: EfficientNetB0 (ImageNet-pretrained base) + Dropout(0.3) + Dense(5, softmax)
- Task: 5-class image classification β ICDRSS diabetic retinopathy severity grading
- Grade 0: No DR
- Grade 1: Mild NPDR
- Grade 2: Moderate NPDR
- Grade 3: Severe NPDR
- Grade 4: Proliferative DR
- Input: 224Γ224Γ3 RGB fundus photographs, preprocessed with
tensorflow.keras.applications.efficientnet.preprocess_input(not/255.0normalisation) - Training procedure: two-phase transfer learning β Phase 1 feature extraction (frozen base), Phase 2 fine-tuning (last 20 layers unfrozen, lr=1e-5). This upload is the Phase 2 (fine-tuned) model, selected over feature-extraction-only.
Training data
APTOS 2019 Blindness Detection (Kaggle competition dataset), 3,662 labelled fundus images. Stratified 70/15/15 train/val/test split. Known limitation: the dataset provides no patient identifier, so patient-level splitting was not possible β images from the same patient (e.g. both eyes) could in principle span splits.
Metrics (validation set)
| Metric | Value |
|---|---|
| Quadratic Weighted Kappa (QWK) | 0.7987 |
| Grade 3 (severe) recall | 0.690 |
| Grade 0 recall | 0.952 |
| Grade 4 recall | 0.455 |
Selected as the final model over the feature-extraction-only checkpoint (QWK 0.7910) primarily for its materially higher Grade 3 recall (0.586 β 0.690) β the clinically critical class where a false negative carries the highest cost β despite a near-identical overall QWK.
Notes / Known Issues
This file (efficientnetb0_finetuned_patched.keras) has a locally-patched
quantization_config metadata key. The model was originally saved from a
Google Colab training environment whose Keras build supported a
quantization_config parameter on Dense layers and wrote it into the
saved config.json. The latest stable Keras release on PyPI (tried at
3.12.3 and 3.12.4, both current at time of writing) does not recognise
that key on load, causing a deserialization failure. The fix strips the
quantization_config key from the Dense layer's config inside a copy of
the .keras archive (a .keras file is a zip archive) β this does not
alter model weights or architecture in any way, only a metadata key
required for the file to load successfully in current Keras versions.
Full details, including the original error traceback and fix verification,
are documented in docs/experiments.md
in the source repository.
Source code
Full project (data pipeline, rule engine, RAG report generation, Streamlit demo app): https://github.com/madatascienceml/project-ds-end-to-end-v2
Intended use and limitations
- Designed as a triage assistant for a virtual diabetic retinopathy screening clinic β flags cases for follow-up interval and referral urgency, always subject to clinician review.
- Not a diagnostic device. Every prediction from this model requires human review before any clinical action is taken.
- Does not assess diabetic macular oedema (DME) β DME requires three-dimensional retinal assessment (OCT or stereo fundus photography) that a single 2D fundus image cannot provide.
- Trained on a single public dataset (APTOS 2019); performance on other populations, camera types, or acquisition protocols is unverified.
- Downloads last month
- 251