Downloads · 30 days
39
23% of all-time downloads
lebiraja/retinal-disease-classifier
retinal-disease-classifier is a machine learning model from lebiraja. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as mit.
A deep learning model for multi-label classification of 45 retinal diseases in fundus images using EfficientNet-B4.
Downloads · 30 days
39
23% of all-time downloads
All-time downloads
168
Public
Repo size
213 MB
Likes
0
Public
Click a slice to open those files.
.bin213 MB · 100%
From the Hugging Face model README
A deep learning model for multi-label classification of 45 retinal diseases in fundus images using EfficientNet-B4.
Diabetic Retinopathy (DR), Age-Related Macular Degeneration (ARMD), Myopia (MH), Drusen (DN), Myopic Astigmatism (MYA), Branch Retinal Vein Occlusion (BRVO), Tessellation (TSLN), Epiretinal Membrane (ERM), Laser Scar (LS), Macular Scar (MS), Central Serous Retinopathy (CSR), Optic Disc Cupping (ODC), Central Retinal Vein Occlusion (CRVO), Tire Venture (TV), Anterior Chamber (AH), Optic Disc Pallor (ODP), Optic Disc Edema (ODE), Shunt (ST), Anterior Ischemic Optic Neuropathy (AION), Parafoveal Telangiectasia (PT), Retinal Traction (RT), Retinal Scar (RS), Corneal Reflex Shadow (CRS), Exudates (EDN), RPE Changes (RPEC), Macular Hole (MHL), Retinitis Pigmentosa (RP), Cotton Wool Spots (CWS), Conjunctival Bleed (CB), Optic Disc Pallor Margin (ODPM), Peripapillary Retinal Hemorrhage (PRH), Macular Neovascularization (MNF), Hard Retinal Exudate (HR), Central Retinal Artery Occlusion (CRAO), Temporal Disc (TD), Cystoid Macular Edema (CME), Posterior Capsular Rent (PTCR), Cotton Fiber (CF), Vitreous Hemorrhage (VH), Microaneurysms (MCA), Vitreous Synchysis (VS), Branch Retinal Artery Occlusion (BRAO), Placoid Lesion (PLQ), Hemorrhagic Pigment Epithelial Detachment (HPED), Cotton Lint (CL)
pip install torch torchvision pillow albumentations scikit-learn
import torch
from PIL import Image
import numpy as np
import albumentations as A
from albumentations.pytorch import ToTensorV2
# Load model from Hugging Face
from transformers import AutoModel
model = AutoModel.from_pretrained("username/retinal-disease-classifier")
model.eval()
# Prepare image
transform = A.Compose([
A.Resize(384, 384),
A.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225)),
ToTensorV2(),
])
image = np.array(Image.open("fundus.png").convert("RGB"))
tensor = transform(image=image)["image"].unsqueeze(0)
# Inference
with torch.no_grad():
logits = model(tensor)
probs = torch.sigmoid(logits)[0].cpu().numpy()
# Get predictions
disease_names = ["DR", "ARMD", "MH", ...] # 45 diseases
threshold = 0.5
detected = {name: float(prob) for name, prob in zip(disease_names, probs) if prob >= threshold}
print(f"Detected diseases: {list(detected.keys())}")
print(f"Probabilities: {detected}")
{
"disease_risk": true,
"predictions": {
"DR": 0.993,
"BRVO": 0.752,
"LS": 0.859,
"CRVO": 0.899
},
"detected_diseases": ["DR", "BRVO", "LS", "CRVO"],
"num_detected": 4
}
| Metric | Value |
|---|---|
| Mean AUC-ROC | 0.8204 |
| Train Loss | 0.2118 |
| Val Loss | 0.2578 |
| Macro F1 | 0.1517 |
| Micro F1 | 0.4450 |
⚠️ Medical Disclaimer:
MIT License - Free for research and commercial use
@article{mindcraft2026,
title={Retinal Disease Classification with EfficientNet-B4},
author={Mindcraft},
year={2026}
}
For issues or questions, contact the model authors or visit the repository.
Last Updated: February 22, 2026 Model Status: Production Ready ✅