Certified Nested Star-Convex Segmentation

Many medical segmentation targets are star-shaped: every straight line from a center point to any pixel inside the object stays inside it. Skin lesions, the optic disc and the optic cup in retinal photographs, polyps, and cell nuclei all fit this description. Networks that impose this shape prior produce cleaner masks. None of them can tell you, for a given test image, whether the mask it produced is the unique answer to its own shape-constrained problem, or how much the network's pixel scores could change before that mask flips. This note proposes to compute exactly that per-image guarantee. Once a center is fixed, "star-shaped" becomes a set of linear inequalities: the foreground indicator may only decrease along each ray leaving the center. Segmentation under this constraint is then a convex linear program whose inputs are the network's scores. Its dual solution, the vector of prices on each constraint, is a dual certificate, a mathematical witness that the returned mask is the unique optimum. The size of the certificate's slack gives a guaranteed radius of score perturbation within which the mask cannot change.

The multi-task angle is where the idea gets its bite. The optic cup is a faint structure nested inside the brighter optic disc, and both share a center. If the two masks are solved as one joint program, with a shared center and the constraint that the cup lies inside the disc, the dual variables on the nesting constraint can pass evidence from the easy task to the hard one. Our central hypothesis is that joint certificates exist, and have larger margins, on images where the cup's single-task certificate fails. This mirrors the multi-task sample-complexity gain proved for linear regression in Union support recovery in high-dimensional multivariate regression, here moved into a geometric segmentation setting.

Core Claim

The proposal makes two linked claims. The first is technical. For star-constrained, nesting-coupled segmentation linear programs, a strictly complementary dual certificate can be computed as a by-product of the solver. From it we can read a lower bound on the largest per-pixel score perturbation (in the $\ell_\infty$ sense) that leaves the mask unchanged.

The second is empirical. On nested-structure data, this certified radius is a better per-image quality-control signal than ensemble variance or softmax entropy. Coupling the tasks raises both the fraction of certified images and the margins for the weaker task, beyond what independent programs with the same shared center achieve.

We deliberately do not claim a sample-complexity theorem for deep networks. The guarantee is conditional on the network's scores and concerns only the final geometric decoding step. That is precisely the step prior shape-prior work leaves uncertified.

Formulation

Fix a center $c$, predicted by a small head or taken as the disc-probability-weighted centroid. For each pixel $p$, let $\pi(p)$ be the next pixel toward $c$ along a discretized ray. For tasks $k \in \{\text{disc}, \text{cup}\}$, let $u_k \in [0,1]^N$ be a relaxed mask over the $N$ pixels, and let $f_k \in \mathbb{R}^N$ be the network's negated logits. We solve

$$\min_{u_1,u_2}\ \sum_k \left( \langle f_k, u_k\rangle + \lambda\,\|D u_k\|_1 \right)\quad \text{s.t.}\quad u_k(p) \le u_k(\pi(p))\ \ \forall p,k,\qquad u_2 \le u_1,$$

where $D$ is the discrete gradient, so the second term is an anisotropic total-variation smoothness penalty, and $\lambda$ sets its weight. Every term is linear or an $\ell_1$ norm, so the problem is a linear program. Its constraint structure (ray monotonicity and nesting, both of the form "one variable is at most another") matches the graph-cut-solvable star prior family used in K-convexity Shape Priors for Segmentation. As a result, thresholding the relaxed solution gives an integral mask.

The open question is therefore not whether the relaxation is tight, but whether the solution is unique and stable. That is exactly what dual certificates answer. Following the restrict–force–verify recipe of the primal-dual witness method, we first fix the active constraints of the thresholded mask, then solve for dual prices on them, then check strict feasibility of the reduced costs on all inactive coordinates. This parallels the unified uniqueness condition of One condition for solution uniqueness and robustness of both l1-synthesis and l1-analysis minimizations. That paper shows such a dual-vector-plus-kernel condition is necessary and sufficient for uniqueness, gives error linear in the noise level, and checks the condition numerically by solving a convex program. We reuse that verification strategy.

The certified radius $\rho$ is the smallest strict slack in the reduced costs, divided by a constant determined by the active constraint structure. It is a conservative lower bound on the true flip radius, and part of the program is to measure how conservative it is.

Research Program

The work has three parts.

The first part is the certificate computation itself. We solve the linear program with a primal-dual first-order method. We then run an exact verification step on a small restricted system: the active ray, nesting, and total-variation constraints at the thresholded mask. The output is either a certificate with its radius $\rho$ or a report of which constraints are degenerate. Degenerate constraints are pixels on rays where the network is exactly indifferent, and they localize where the mask is fragile.

The second part is the multi-task comparison. We compare three decodings: independent programs per task; programs that share the center only; and the fully coupled program with nesting. This isolates what the coupling contributes to the cup's certificate. The honest expectation is mixed. Nesting duals are nonzero only where cup evidence would push outside the disc, so the gain may come mostly from the shared center. The experiment is designed to say which.

The third part is a training signal. The certificate slack is a piecewise-linear function of the scores, so a hinge loss that pushes slack above a target at ground-truth masks can be backpropagated. This trains the backbone to produce scores whose shape-constrained decoding is robustly unique. We compare it against the soft star penalty of Star Shape Prior in Fully Convolutional Networks for Skin Lesion Segmentation and against the unrolled convex-combination star module of Convex Combination Star Shape Prior for Data-driven Image Semantic Segmentation.

The two prior works play different roles here. The soft-penalty paper motivates the proposal: it shows star priors help, with Jaccard gains of over 3% on ISIC 2017, but offers no per-image guarantee. The convex-combination paper constrains it. It already unrolls a dual variational solver into a network layer, and it handles multiple centers, which our single-center program does not. Our contribution is the certificate the convex-combination paper does not construct, together with task coupling it does not consider.

Baselines

The naive reference point is a two-head network sharing one backbone, with disc and cup masks obtained by thresholding each head's scores. No shape constraint is applied, and softmax entropy serves as the quality score. It uses the same backbone, data split, and training budget as every other method. Our method must beat it on Dice and on risk-coverage for quality control, or the whole apparatus is unjustified.

The strongest existing segmentation method is SAM with the convex-combination star module from Convex Combination Star Shape Prior for Data-driven Image Semantic Segmentation. That paper reports 80.82% Dice on Refuge, against 77.73% for plain SAM. We will rerun it on our Refuge split with the authors' settings and give it the same number of tuning trials as our method. Beating it means two things. First, our Dice must be within noise of it or better; we do not claim large accuracy gains, and a loss of more than about one Dice point would count against us. Second, and this is the main test, our certified radius must give clearly better selective-prediction curves than the uncertainty signals obtainable from it.

The strongest uncertainty baseline is the ten-model deep ensemble and Monte-Carlo dropout on radial predictions from Uncertainty Estimation in Instance Segmentation With Star-Convex Shapes. That paper reports that ensembles are well calibrated with minimal tuning, and that improvements appear after 20–30 passes. The file reports no calibration numbers for it (no reported result found on Lacuna for its ECE or Pearson correlation on DSB2018), so we will generate them ourselves. The ensemble gets ten times our training compute, which favors it. We beat it if the area under the risk-coverage curve, using Dice error as risk, is lower for $\rho$ at a single solve per image.

Three ablations isolate the key ingredient. The first uses independent per-task programs, which removes the coupling. The second shares the center without nesting, which isolates the nesting constraint. The third applies the star constraint without the certificate: the same linear program, but ranking images by the solver's objective gap rather than by $\rho$. This isolates whether the dual certificate, rather than the constrained decoding, carries the quality-control signal.

Why not just…?

Why not just use a deep ensemble's disagreement as the quality score? Ensembles are the real competitor for flagging bad masks, and they may well rank images comparably. Their signal is statistical and costs many forward passes. The certificate is deterministic, comes from one solve, and has a verifiable meaning: no score change smaller than $\rho$ changes the mask. The Uncertainty Estimation in Instance Segmentation With Star-Convex Shapes study notes that calibration degrades on non-star GlaS glands, and we will test whether $\rho$ degrades less there. If the ensemble wins on risk-coverage at matched compute, the quality-control claim fails. We would then report the certificate only as a cheap approximation.

Why not just intersect the cup with the disc after independent prediction? Post-hoc intersection enforces nesting but cannot certify anything, and it cannot move the cup boundary inward using disc evidence. The ablation that shares the center but drops nesting, compared against post-hoc intersection, directly measures whether joint solving adds anything beyond clipping. If it adds nothing, the multi-task claim reduces to "share the center," and we will say so.

Why not just empirically perturb the scores and see if the mask changes? This is a genuine threat: random or adversarial perturbation testing is simple and may track the true flip radius more tightly than our lower bound. We will run it as a reference and report both the tightness ratio of $\rho$ to the empirical flip radius and the compute ratio. The certificate is worthwhile only if it stays within a small constant factor of the empirical radius at a fraction of the cost. It also has an advantage empirical search cannot supply: a random search can miss the one perturbation that flips the mask, while the certificate cannot.

Why not just use the soft star penalty, which already won ISBI 2017? The penalty in Star Shape Prior in Fully Convolutional Networks for Skin Lesion Segmentation reached 77.3% Jaccard and 85.7% Dice, but it only encourages star shape during training and says nothing at test time. On ISIC 2017, a single-structure setting where coupling is unavailable, we compare it against our certificate-margin hinge loss at equal tuning budget. This tests whether the training signal matters, separately from the certificate as a quality-control output.

Proposed Experiments

Refuge is the primary benchmark because it naturally provides two nested, co-centered star-shaped structures. We report Dice separately for disc and cup, the fraction of test images certified by each decoding variant, and the cup's margin distribution under independent versus coupled programs. The decisive check has two parts. On the subset of images where the independent cup program fails to certify, does the coupled program certify, and are those masks' Dice scores comparable to already-certified images? If coupling rescues few images, or rescues them with poor masks, the multi-task hypothesis is rejected.

ISIC 2017 serves as a single-task control, where 99.86% of ground-truth pixels satisfy the star definition. Kvasir is added to test robustness on less regular shapes. On both, we measure risk-coverage for $\rho$ against entropy and ensembles, and Dice for the margin-trained network against the soft penalty.

DSB2018 and GlaS, taken from the star-convex uncertainty study, test calibration when the star assumption is nearly true (nuclei) and when it is often false (glands). Here the prediction is specific. The certificate should fail or report small $\rho$ on glands whose true shape violates the star constraint. That would make certificate failure itself a detector of shape-prior misspecification.

Across all datasets, we validate the bound by measuring, on 500 images per dataset, the empirical flip radius under projected-gradient score perturbations. We report its ratio to $\rho$. A ratio near one means the certificate is tight. A ratio that grows unboundedly with image size would mean the constant in the bound is too loose to be useful, and would redirect the work toward tighter local certificates.