Many clinical grades are measurements of edges. Examples include how wide a retinal vessel is, how flattened a heart wall looks, and how irregular a nodule margin appears. In medical images those edges are faint, and they are the pixels a segmentation model is least sure about. Current pipelines still throw that uncertainty away. A segmenter produces a hard yes/no mask, geometry is measured on the mask, and a classifier assigns a severity tier as if the measurement were exact. We propose a small retinal model (under one million parameters) built differently. Instead of a mask, it predicts how far each pixel is from the nearest vessel edge, together with how unsure it is about that distance. That uncertainty is carried analytically into vessel width and shape statistics, and from there into an ordered severity prediction that can decline to answer when the uncertainty straddles a tier boundary.
The opportunity matters because retinal photographs are being proposed as an objective substitute for questionnaire-based diagnoses such as autism screening, and the screening setting is a handheld phone camera, not a clinic. The one existing retinal autism pipeline, Enhancing Autism Spectrum Disorder Screening through Learning Geometric Features of Retinal Blood Vessels Using Graph Representation, grades four severity tiers from vessel geometry. It uses a plain U-Net mask and a DenseNet-264, and it reports that its errors systematically overestimate severity, which is the expected signature of mask errors leaking into geometry. Handheld footage makes those edges much worse: RVD: A Handheld Device-Based Fundus Video Dataset for Retinal Vessel Segmentation shows models trained on bench-top images falling to 28.31% mIoU on phone video.
Core Claim
When a diagnostic grade depends on quantities measured at low-contrast boundaries, a compact model should not have to be more accurate at the boundary than a large one. It should know how inaccurate it is there and propagate that to the grade.
Concretely, the segmenter outputs two maps. The first is $d(x)$, the predicted distance from pixel $x$ to the nearest vessel edge, positive inside the vessel. The second is $\sigma(x)$, its predicted standard deviation, trained with a Gaussian likelihood. At a centerline point $c$, vessel width is approximately the sum of distances to the two opposite walls. Treating the two wall estimates as independent gives a width distribution
$$w(c) \sim \mathcal{N}\big(2\,d(c),\; 2\,\sigma(c)^2 + 2\,\sigma_{\perp}(c)^2\big),$$
where $\sigma_{\perp}(c)$ is the predicted uncertainty sampled at the opposite wall along the normal. Each vessel segment then contributes a Gaussian bump, not a single count, to a soft histogram of widths, tortuosities and branching angles. The result is a fixed-length descriptor whose entries come with variances. No sampling is needed, which keeps the cost compatible with a phone.
A cumulative-link ordinal head maps the descriptor (plus a small image embedding) to a latent severity score $s$ with propagated variance $v$. The head predicts tier $k$ when $\theta_{k-1} < s < \theta_k$. It abstains when the interval $s \pm z\sqrt{v}$ crosses a threshold $\theta_k$, where the $\theta$'s are learned cut points and $z$ sets the coverage.
The novelty is not a new attention block. It is the claim that the abstention signal should come from measured boundary uncertainty rather than from the classifier's own softmax. It is also the claim that this specific signal is what lets a tiny model hold its accuracy on adjacent tiers.
The roles of the directions are uneven. Low-contrast boundary ambiguity supplies the mechanism. Diagnostic granularity is the target, ordered tiers whose neighbours differ by small geometric amounts. Lightweight design is a hard constraint: a parameter budget and an on-device latency budget. Subjective diagnostic reliance is the application regime, and it also forces an honest evaluation design, discussed below.
Relation to Prior Work
Two lines of work supply the method. Continuous distance-style supervision comes from Bounding Maps for Universal Lesion Detection, which replaces binary boxes with maps that decay from lesion center to border and gains 3.85 points of sensitivity on DeepLesion for Faster R-CNN. We reuse the idea of soft distance targets but at pixel level, and we add a predicted variance, which that paper does not model. The compact segmenter backbone comes from Efficient Retinal Vessel Segmentation with 78K Parameters, whose DSAE-Net reaches 82.44% Dice on DRIVE with 78K parameters using a skeleton-based loss and coordinate attention gates. We keep its topology and swap its output from a mask to the distance-and-variance pair.
Its acknowledged failures are dropout of the smallest vessels and false positives around complex branches, and these are exactly the errors our variance should flag. That is also why we treat it as a constraint and not only as a tool. If the skeleton loss is kept, it may push $d$ to be confidently wrong at branches, and we will test this directly.
Other papers motivate the gap. The autism retinal paper above shows that adding explicit vessel geometry improves accuracy by 3 to 4 points across backbones, but with hard masks and heavy models. RVD shows that even Mask2Former with a Swin-L backbone, at 74.09% binary mIoU, drops to roughly 31% on artery-vein labels. Deep Learning Based Prediction of Pulmonary Hypertension in Newborns Using Echocardiograms shows the same pattern outside the eye: held-out F1 is 0.78 for detection but 0.63 for three-tier severity, with errors near intermediate septal flattening. Granular grading on faint boundaries degrades first, and it does so at neighbouring tiers.
Abstention as a safety valve comes from DeepTag: inferring diagnoses from veterinary clinical notes, which defers its most uncertain 10% of notes to humans and improves precision on the rest. Our difference is the source of the uncertainty: geometry measured from the image rather than the classifier's own confidence. Abstract: RecycleNet - Latent Feature Recycling Leads to Iterative Decision Refinement and reverse attention in Parallel Res2Net-based Network with ReverseAttention for Polyp Segmentation try to resolve ambiguous edges by spending more computation. We instead accept that some edges are unresolvable at handheld quality and report that fact. CMCNet shows that structured intermediate concepts help fine-grained thyroid grading, reaching 75.17% balanced accuracy. It does so with foundation-model encoders, and our geometric descriptor plays a similar intermediate-concept role at a tiny fraction of the cost.
One contradiction must be faced head on. The 94.2% four-tier accuracy reported for retinal autism grading is very high for a construct whose labels are themselves questionnaire-derived. If images from the same child fall on both sides of the split, part of that number may be leakage. We will re-run under patient-level splits where identifiers allow, and we will state clearly if we cannot.
Research Program
We will build one model with three parts. The first is a DSAE-Net-style segmenter emitting $d$ and $\sigma$. The second is a fixed, non-learned geometry layer that skeletonizes the thresholded $d>0$ region, samples widths along normals, and accumulates soft histograms with propagated variances. The third is a small ordinal head. The total budget is under one million parameters, and we will measure latency on a mid-range Android phone.
Training happens in two phases. In the first, the segmenter is trained on DRIVE, STARE, HRF, CHASE_DB1 (which comes from schoolchildren, relevant for a pediatric target) and RVD keyframes. Distance targets are computed from the expert masks. On RVD, the eight width-class labels give a direct check that predicted widths and variances are calibrated. In the second phase, the full model is fine-tuned end-to-end on the public retinal autism dataset (57,195 images, four tiers), with an ordinal loss plus the segmentation likelihood as a regularizer. The geometry layer is differentiable almost everywhere through $d$ and $\sigma$ at fixed skeleton locations.
The subjective-label problem shapes the analysis. Autism tiers inherit clinician and questionnaire bias, so we pair the autism task with a granular task whose labels are geometric rather than subjective: RVD vessel width tiers and artery-vein labels. If uncertainty propagation helps on objective width tiers, it is demonstrably doing what we claim. If it helps only on autism tiers, it may be fitting label noise. We also test whether abstained autism cases concentrate in the Mild and Moderate tiers, where label disagreement is plausibly highest. We cannot verify that directly without multiple raters, and the note says so.
Baselines
The naive reference is a MobileNet-class classifier trained directly on fundus images with a plain ordinal loss. It uses no segmentation, matches our parameter budget, and receives the same augmentation and the same hyperparameter search budget (an equal number of trials). It answers whether any of the structure matters.
The strongest existing method on the autism task is the DenseNet-264 vessel-graph pipeline from Enhancing Autism Spectrum Disorder Screening through Learning Geometric Features of Retinal Blood Vessels Using Graph Representation, which reports 94.2% accuracy. We will retrain it ourselves on our splits, because the reported split may not be patient-level. Beating it does not require exceeding 94.2% outright. The bar is matching its accuracy within two points on identical patient-level splits with roughly a hundredth of the parameters, while beating it on adjacent-tier confusion and on handheld-degraded test images.
On RVD, the strongest reported figures are Mask2Former Swin-L at 74.09% binary mIoU and about 31% artery-vein mIoU, from RVD. We find no reported result on Lacuna for RVD's eight-class width tiers. There we will compare against DSAE-Net retrained with an eight-class head, since Efficient Retinal Vessel Segmentation with 78K Parameters is the strongest compact segmenter in the file. Its 82.44% DRIVE Dice serves as a sanity check that our modified segmenter has not lost binary quality.
The decoupled compact pipeline is the same tiny segmenter emitting a hard mask, followed by hard geometry and the same ordinal head. It differs from our model only in throwing away $\sigma$, so it is the ablation that isolates the key ingredient.
A second ablation keeps $d$ but drops $\sigma$, which separates the value of distance targets from the value of variance. A third replaces geometry-propagated abstention with softmax-entropy abstention at matched coverage, in the style of DeepTag.
All systems get the same data, the same training compute cap, and the same tuning trials. The heavy baseline is the only one exempt from the parameter limit.
Why not just…?
Why not just train a small end-to-end classifier on the raw image? This is the real threat. If a MobileNet with an ordinal loss matches our accuracy and calibration, the geometry layer is unnecessary. The cited evidence favouring explicit geometry is the 3 to 4 point gain in the autism paper, but that was measured on large backbones, and a small network might learn width cues implicitly. Our first experiment settles the question on both the autism tiers and the RVD width tiers. If end-to-end wins on clean images but loses under handheld degradation or on abstention quality, the proposal narrows to those claims. If it wins everywhere, we drop the idea.
Why not just distill the DenseNet-264 pipeline into a tiny student? Distillation, as used in LibreFace for compressing vision transformers to ResNets, would likely recover much of the teacher's accuracy. It would also copy the teacher's systematic overestimation of severity, and it provides no boundary-derived signal for deciding when to abstain. We will include a distilled student at our parameter budget. The test is whether its errors reproduce the teacher's upward severity bias while ours do not.
Why not just abstain on softmax entropy? This is cheap and often good. The difference shows on images where the classifier is confidently wrong because the mask was confidently wrong, which is the failure mode handheld blur produces. We compare risk-coverage curves at matched coverage, both on clean images and on RVD-degraded images. Our claim fails if the curves coincide.
Why not just make the segmenter better with reverse attention or iterative refinement? Better edges help every variant, and nothing stops us from adding them. The evidence from RVD, however, is that even very large models collapse on fine-grained vessel labels in phone video. Some ambiguity is in the data, not the model. We will test this by adding a recycling pass to both the hard-mask and uncertainty variants and checking whether the gap between them survives.
Proposed Experiments
The decisive check uses RVD width tiers, where labels are objective. We compare the hard-mask pipeline, the distance-only model and the full model on eight-class width accuracy and on mean absolute tier error. We also ask whether predicted width variance correlates with absolute width error, measured as Spearman correlation on held-out clinics. If variance does not track error there, the mechanism is broken, regardless of what happens on autism.
The second experiment evaluates autism four-tier grading under patient-level splits. It reports accuracy, quadratic-weighted kappa, an adjacent-tier confusion rate, and the signed mean tier error, which tests whether the overestimation bias disappears. We also report risk-coverage curves for both abstention rules. As a robustness test, we apply RVD-style blur and illumination degradations to autism test images, with degradation parameters fitted to RVD statistics, and measure how much each model degrades.
The third experiment is on-device: parameters, peak memory and per-image latency on a phone for every compact model. We set a target under 50 milliseconds, the same order as the 13.7 milliseconds reported for LSSF-Net on segmentation alone.
The outcome that would most change our minds is the end-to-end compact classifier matching the full model on both objective width tiers and degraded autism images. In that case explicit boundary uncertainty is not earning its place.
References
- Enhancing Autism Spectrum Disorder Screening through Learning Geometric Features of Retinal Blood Vessels Using Graph Representation
- RVD: A Handheld Device-Based Fundus Video Dataset for Retinal Vessel Segmentation
- Bounding Maps for Universal Lesion Detection
- Efficient Retinal Vessel Segmentation with 78K Parameters
- Deep Learning Based Prediction of Pulmonary Hypertension in Newborns Using Echocardiograms
- DeepTag: inferring diagnoses from veterinary clinical notes
- Abstract: RecycleNet - Latent Feature Recycling Leads to Iterative Decision Refinement
- Parallel Res2Net-based Network with ReverseAttention for Polyp Segmentation
- CMCNet: Aligning Ultrasound Image Embeddings with Textual TI-RADS Representations for Fine-Grained Thyroid Classification
- LibreFace: An Open-Source Toolkit for Deep Facial Expression Analysis
- LSSF-Net: Lightweight segmentation with self-awareness, spatial attention, and focal modulation