Downloads · 30 days
55
30% of all-time downloads
DilsaraAbeywarana/glaucoma-severity-system
glaucoma-severity-system is a image classification model from DilsaraAbeywarana. Use it when you need a label for an image. It is set up for keras. The card lists the license as cc-by-nc-4.0.
Three-stage system for retinal fundus photographs: input validation, severity grading, and quantitative cup-to-disc measurement.
Downloads · 30 days
55
30% of all-time downloads
All-time downloads
186
Public
Repo size
249 MB
Likes
0
Public
Click a slice to open those files.
.keras248 MB · 100%
From the Hugging Face model README
Three-stage system for retinal fundus photographs: input validation, severity grading, and quantitative cup-to-disc measurement.
Part of the NeuroGSD project (AI-based early detection of common eye diseases).
This module grades severity in confirmed glaucoma cases. It does not screen for the presence of glaucoma. A healthy fundus photograph will still receive a severity grade. Screening is not implemented.
from inference import GlaucomaSystem
import cv2
sys = GlaucomaSystem(".")
result = sys.predict(cv2.imread("fundus.jpg"))
Accepted input returns grade, confidence, class probs, vcdr and
cup_disc_area_ratio. Rejected input returns accepted: False with the reasons
and produces no grade.
1. Input validation — two independent checks on the raw image, before any preprocessing. Order matters: the disc-cropping stage transforms an arbitrary photograph into a texture patch, destroying the evidence needed to reject it. The first check uses black-surround fraction and red-channel dominance; the second measures Mahalanobis distance from the training distribution in EfficientNetB4 feature space. Photographs of a car and of a flower passed all statistical checks and were caught only by the distance measure, so both are needed.
2. Severity classifier — EfficientNetB4 fine-tuned on optic disc crops, three-way softmax over mild / moderate / severe. Preprocessing: black-border trim, disc localisation by brightest-point detection with a 12% border exclusion, crop at 40% of the shorter dimension, CLAHE (clip 2.0, 8x8, LAB L-channel), resize to 384.
3. Cup-to-disc measurement — U-Net trained on ORIGA, REFUGE and G1020 (2,237 image-mask pairs), returning vertical CDR and cup-to-disc area ratio.
Severity classification, held-out test set (n=67), evaluated once:
| Metric | Value |
|---|---|
| Quadratic weighted kappa | 0.604 |
| Accuracy | 0.672 |
| Macro-F1 | 0.660 |
| Within-one-grade agreement | 0.940 |
Cross-validated development estimate was 0.607, closely matching the held-out result and indicating a leakage-free evaluation.
Segmentation, held-out REFUGE test partition (a source not seen during training): rim Dice 0.883, cup Dice 0.862.
Input validation: 93% of fundus images from an unseen camera accepted; all non-fundus images tested rejected.