Glaucoma Segmentation
Master's thesis: neural networks that outline the optic disc and cup in eye images.
About the project
Glaucoma is diagnosed partly from the ratio between the optic cup and the optic disc. For my master's thesis I designed, implemented and evaluated two network architectures for finding them: a cascade, where a second network looks for the cup inside the disc found by the first, and a dual-decoder network with one shared encoder.
The models were trained on the ORIGA dataset and tested on DRISHTI-GS. The best one reached a Dice score of 96.8 % for the disc and 89.7 % for the cup.
Highlights
- Cascade and dual-decoder architectures in PyTorch
- Region-of-interest detection and training in polar coordinates
- Explainability with Grad-CAM
Under the hood
- Exploratory data analysis showed class imbalance and very different image quality, which shaped the preprocessing
- Before settling on CenterNet I tried simpler ways of finding the optic disc: thresholding, an intensity-weighted centroid, the brightest spot and template matching
- A CenterNet model first finds the region of interest around the optic disc, and the segmentation runs on that crop in polar coordinates
- Both architectures were built on three U-Net variants (Residual Attention U-Net++, Refined U-Net 3+ with CBAM and Swin-Unet) and trained on polar as well as Cartesian images
- The loss combines Dice and cross-entropy; in the dual-decoder network the cup counts five times more than the disc
- Predictions are cleaned up afterwards: holes are filled, only the largest region is kept and an ellipse is fitted to each mask
- The vertical cup-to-disc ratio from the predictions was compared with values measured by experts, and a threshold of 0.63 taken from the ROC curve sorts eyes into glaucoma and healthy
- Probability maps, activation maps and Grad-CAM show what the networks look at
- Command-line scripts train and evaluate the models and segment new images with any of the architectures
- When
- 2023 – 2024
- Type
- University
- Supervision
- Supervised by doc. RNDr. Silvester Czanner, PhD.
- Versions
- Python 3.10
- PyTorch 2.0
- Stack
- Python
- PyTorch
- OpenCV
- NumPy
- pandas
- scikit-learn
- Albumentations
Matplotlib
- Jupyter
- Weights & Biases
Gallery





