HierarchiRetina: A Diabetic Retinopathy Screening and Grading Cascade with Heterogeneous Mixture-of-Experts Lesion Segmentation
Organizations: The authors are with the Department of Computer Science and Engineering, Brac University, Dhaka, Bangladesh
Abstract
Clinical screening for diabetic retinopathy proceeds in stages, yet most automated systems grade fundus images with a single black-box network. Three gaps remain: (i) lesions differ widely in size and contrast, but segmenters typically apply the same blocks to all; (ii) ungradable images are usually excluded or treated as an extra class, and lesion-aware graders seldom test whether lesions drive the grade; (iii) staged systems often report each stage only on the images reaching it, leaving propagated errors unmeasured. HierarchiRetina, a screening, segmentation and grading cascade with inspectable stage outputs, addresses each gap. First, HSMoE-AUNet is a U-Net whose skip, bottleneck and decoder blocks are sparse mixtures of heterogeneous experts, with lesion-matched types, counts and losses; SwinHRUNetPP, a dual-encoder vessel segmenter, uses a field-of-view-restricted loss. Second, LG-DRG separates gradability from ordinal severity and lets lesion masks query the image through gated cross-attention. Third, an end-to-end evaluation counts screening misses as errors and traces each error to its stage. Pooled Dice ranged from 0.184 (microaneurysms) to 0.579 (exudates); vessel Dice was 0.731. On 58,689 held-out images from six datasets, end-to-end quadratic weighted kappa was 0.804, with referral sensitivity 0.832 at specificity 0.947, and the screening gate caused 66% of errors. In ablations, the grade ignored the masks, even with the cross-attention gate started open. On all 4,105 official DDR test images, six-class accuracy was 85.6%, above the best published six-class result we found (83.8%). Staged screening systems should be evaluated end-to-end, with stage attribution and mask ablation, before clinical deployment.
Figures & tables
| MA | HE | EX | CWS | |
| Expert types | 4 | 5 | 7 | 8 |
| Added types | – | MS | MS, TH, DoG | MS, TH, SR, TX |
| Experts (skips) | 6/8/10 | 6/8/10 | 7/9/11 | 8/10/12 |
| Experts (bottl.) | 12 | 12 | 14 | 16 |
| Experts (dec.) | 10/8/6 | 10/8/6 | 11/9/7 | 12/10/8 |
| Parameters (M) | 218.3 | 190.5 | 187.8 | 192.7 |
| Model | Input | AUC | Sens. | Spec. | G1 routed | FN |
| SwinV2-L | 384 | 0.884 | 0.777 | 0.855 | 0.458 | 3,769 |
| ConvNeXt V2-L (fold models) | 512 | 0.889–0.902 | 0.789–0.810 | 0.860–0.869 | 0.493–0.528 | 3,209–3,558 |
| ConvNeXt V2-L | 512 | 0.904 | 0.809 | 0.868 | 0.528 | 3,214 |
| Hybrid ensemble (7 models) | mixed | 0.909 | 0.818 | 0.872 | 0.534 | 3,078 |
| ConvNeXt V2-L (final) | 768 | 0.929 | 0.854 | 0.887 | 0.645 | 2,459 |
| + hybrid, weight † | mixed | 0.933 | 0.862 | 0.889 | 0.643 | 2,336 |
| Pixel, pooled | Image | Lesion level | Image | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Target | Thr. | Dice | IoU | Sens. | Prec. | ROC AUC | PR AUC | Dice | Sens. / Prec. | F1 | sens. | |
| Hard exudates | 142 | 0.325 | 0.579 | 0.407 | 0.583 | 0.574 | 0.846 | 0.489 | 0.476 / 0.473 | 0.475 | 1.000 | |
| Haemorrhages | 157 | 0.20 | 0.510 | 0.343 | 0.407 | 0.685 | 0.800 | 0.411 | 0.412 / 0.445 | 0.428 | 1.000 | |
| Cotton-wool spots | 69 | 0.40 | 0.408 | 0.257 | 0.521 | 0.336 | 0.884 | 0.328 | 0.421 / 0.306 | 0.355 | 0.971 | |
| Microaneurysms | 175 | 0.01 | 0.184 | 0.101 | 0.137 | 0.277 | 0.749 | 0.072 | 0.405 / 0.248 | 0.307 | 0.977 | |
| Vessels | 30 | 0.46 | 0.731 | 0.576 | 0.915 | 0.609 | 0.966 | 0.852 | – | – | – | |
| Macro-AUC | G5 AUC | QWK | Acc. | Macro-F1 | |
| Fold 0 | 0.942 | 0.999 | 0.771 | 0.758 | 0.767 |
| Fold 1 | 0.945 | 0.998 | 0.783 | 0.770 | 0.768 |
| Fold 2 | 0.938 | 0.997 | 0.754 | 0.745 | 0.751 |
| Fold 3 | 0.942 | 0.999 | 0.779 | 0.764 | 0.769 |
| Fold 4 | 0.939 | 0.999 | 0.769 | 0.756 | 0.763 |
| Mean | 0.941 | 0.999 | 0.771 | 0.759 | 0.764 |
| Original | Retrained | |||
| Mask input | QWK | QWK | QWK | QWK |
| Intact | 0.7726 | – | 0.7444 | – |
| All masks zeroed | 0.7725 | 0.7446 | ||
| Masks from another image | 0.7724 | 0.7444 | ||
| Without MA | 0.7726 | 0.7444 | ||
| Without HE | 0.7726 | 0.7444 | ||
| View | QWK (95% CI) | Acc. | Macro-F1 | |
|---|---|---|---|---|
| B, OOF-fitted | 58,689 | 0.804 (0.798–0.809) | 0.814 | 0.659 |
| B, argmax | 58,689 | 0.801 | – | – |
| A, OOF-fitted | 14,409 | 0.732 (0.722–0.743) | 0.743 | – |
| A, argmax | 14,409 | 0.721 | – | – |
| EyePACS, DDR and APTOS 2019 only (no possible Stage II overlap) | ||||
| B, OOF-fitted | 58,047 | 0.800 | 0.815 | – |
| Method | Protocol | Acc. (%) | QWK |
|---|---|---|---|
| FA+KC-Net+R2 [ 7 ] | 6-class, grader | 83.78 | n/r |
| Ours | 6-class, end-to-end | 85.63 | 0.913 ∗ |
| FA+KC-Net+R2 [ 7 ] | 5-class, grader | 84.49 | 0.862 |
| RadFuse [ 6 ] | 5-class, grader | 83.32 | 0.855 |
| Dual-SwinOrd [ 5 ] | 5-class, grader | 86.54 | 0.904 |
| Ours, ungradable Grade 4 | 5-class, end-to-end | 85.10 | 0.878 |
| Dataset | DR | Grade 0 | Gate sens. | Gate spec. | DR blocked | QWK A | QWK B | Acc. B | |
|---|---|---|---|---|---|---|---|---|---|
| EyePACS | 53,576 | 14,043 | 39,533 | 0.837 | 0.883 | 2,288 | 0.721 | 0.785 | 0.812 |
| DDR | 4,105 | 2,225 | 1,880 | 0.931 | 0.969 | 154 | 0.750 | 0.878 | 0.856 |
| APTOS 2019 | 366 | 167 | 199 | 0.994 | 0.945 | 1 | 0.745 | 0.925 | 0.847 |
| FGADR | 277 | 256 | 21 | 0.996 | 0/21 | 1 | 0.872 | 0.810 | 0.776 |
| Messidor-2 | 262 | 108 | 154 | 0.889 | 0.818 | 12 | 0.782 | 0.843 | 0.752 |
| IDRiD | 103 | 69 | 34 | 0.957 | 0.647 | 3 | 0.747 | 0.830 | 0.660 |