Ordering, Not Edges: Supervising the Unlabeled Margin Between Scribbles

When a surgeon or radiologist marks a tumor with quick strokes ("scribbles"), they draw confidently inside the tumor and confidently in healthy tissue. They avoid the region that matters most for resection, which is the diffuse band where cancer cells thin out into normal tissue. The strongest simple method for learning from scribbles trains a standard segmentation network only on the scribbled pixels and ignores everything else. That method therefore gets no training signal in exactly this band. Methods that try to fill the gap either snap predictions to image edges, which infiltrative margins do not have, or invent soft labels that fix where the boundary sits.

We propose a third option. Between an inner tumor scribble and an outer normal-tissue scribble, the network's predicted tumor probability should never increase as one moves outward. This ordering constraint says nothing about where the transition happens, only that it happens once and monotonically. It matches the biology of infiltrative tumors, where cell density decays as a gradient rather than stopping at a step edge. It is a single differentiable loss term added to the simple baseline, with no iterative refinement loop. Our claim is that this constraint removes the characteristic failures of scribble-trained models in the margin band (islands, holes, leakage past the normal-tissue scribble, fragmented rims) and yields better-calibrated graded margin maps. The benefit should grow as annotators draw more conservatively.

Core Claim

Let $p(x)$ be the predicted tumor probability at pixel or voxel $x$. Let $d_T(x)$ and $d_N(x)$ be distances from $x$ to the nearest tumor and normal scribble. Let $t(x) = d_T/(d_T+d_N)$, which runs from 0 on tumor scribbles to 1 on normal scribbles. For neighboring pairs $(x, y)$ inside the unlabeled band with $t(y) > t(x)$, we add

$$ \mathcal{L}_{\text{order}} = \frac{1}{|P|}\sum_{(x,y)\in P} \max\big(0,\; p(y) - p(x)\big), $$

where $P$ is the set of such pairs sampled each step. The total objective is the partial loss on scribbled pixels plus $\lambda \mathcal{L}_{\text{order}}$.

The design choice that matters is what the loss leaves out. The loss never names a target value, so the location of the 0.5 crossing is still decided by image features that the network learns across patients. This is the claim that distinguishes the proposal from the obvious "turn scribbles into soft distance labels" idea. A soft target such as $1-t$ plants the boundary at the midpoint between strokes, which is wrong whenever the annotator placed strokes asymmetrically. The ordering constraint only removes non-monotone solutions.

Relation to Prior Work

The simple baseline that motivates and constrains the proposal is Embarrassingly Simple Scribble Supervision for 3D Medical Segmentation. That paper shows nnU-Net trained with partial loss reaches mean Dice 0.813 on ScribbleBench against 0.856 for full supervision. It also shows that elaborate scribble methods collapse outside their home benchmarks: ShapePU falls to 0.05 on brain tumors. This result rules out multi-stage pseudo-labeling designs. We therefore add one loss term to that exact pipeline and nothing else.

Pipelines that propagate scribbles with graph cuts, k-means, and dense conditional random fields (CRFs, post-processors that pull labels toward intensity edges) are the designs we avoid. These include Scribble-based Hierarchical Weakly Supervised Learning for Brain Tumor Segmentation and Learning to Segment Medical Images with Scribble-Supervision Alone. Their appearance kernels assume that intensity differs across the boundary. Radiomics analysis of non-enhancing lesions after Bevacizumab administration in recurrent glioblastoma reports that non-enhancing tumor and edema overlap in structural MRI signal, which undercuts that assumption.

Boundary Perception Guidance also uses scribbles but regresses toward edges from an off-the-shelf edge detector. It reaches 76.0% mIoU on PASCAL VOC versus 76.4% fully supervised, because natural images have edges. We drop the edge assumption. Polyp networks with reverse and boundary attention concentrate capacity on ambiguous rims but require dense masks: MISNet and Parallel Res2Net with Reverse Attention. The latter also polarizes outputs to hard binary values, which erases the gradient we want to keep.

Two papers supply ingredients we reuse in modified form. The graded-confidence idea comes from Bounding Maps for Universal Lesion Detection, which replaces binary boxes with maps decaying linearly from 1.0 at the center to 0.5 at the edge. We keep the graded output but replace the fixed linear profile with an ordering constraint. Constrained Deep Weak Supervision for Histopathology Image Segmentation curbs weak-supervision overgrowth with a global area penalty, raising F-measure from 0.778 to 0.835. Our constraint targets the same failure but acts locally and needs no area estimate.

EMReDL models unlabeled peritumoral voxels as latent variables inside an expectation-maximization loop. It uses a prior from diffusion and perfusion MRI and reports recurrence AUC 0.938 versus 0.707 for a U-Net. It is the most ambitious existing treatment of the infiltrative band. However, it depends on physiological sequences that are often missing intraoperatively. Our constraint requires only scribbles and could serve as a regularizer inside such a loop.

Research Program

We will build the loss into nnU-Net's partial-loss configuration, leaving nnU-Net's automatic configuration and training schedule unchanged. Pairs are sampled from the band where both $d_T$ and $d_N$ exceed zero and neither scribble is touched, along the local direction of increasing $t$. For multi-class tasks such as HELICoiD's tumor, normal, vessel, and background classes, the constraint applies only to the tumor-versus-normal channel. Vessel scribbles are excluded from the band, so that vessels embedded in the margin do not break monotonicity.

The multi-scale direction enters as a controlled question rather than a headline. The "receptive field trap" in Constrained Deep Weak Supervision is the finding that very large receptive fields wash out the local texture that identifies tumor. Dilated context, following Multi-Scale Context Aggregation by Dilated Convolutions, argues the opposite. We will test, on band-restricted metrics only, whether adding a dilated-convolution context branch to the nnU-Net encoder helps or hurts, with and without the ordering loss. Our hypothesis is that wide context is mainly responsible for leakage past normal scribbles. If so, the ordering loss should let wider context help rather than hurt. This hypothesis is falsifiable and secondary.

We will also run a scribble-conservativeness sweep. Scribbles are regenerated from dense masks after eroding the tumor and normal regions by increasing distances. This widens the unlabeled band in controlled steps and mimics annotators who stay clear of the margin.

Baselines

The naive reference point is nnU-Net with partial loss, exactly as in Embarrassingly Simple Scribble Supervision. It reports mean Dice 0.813 across ScribbleBench (full supervision 0.856). It is also the strongest existing competitor, since it beats specialized scribble methods by wide margins in that paper. We run it from the released configuration on identical scribbles, folds, and epochs. The ordering loss adds only its own weight, which is tuned on a validation fold with a budget of five values. Beating it means better band-restricted Dice and 95th-percentile Hausdorff distance (HD95, the near-worst-case boundary error) on the brain-tumor task, with global Dice no worse than the baseline's.

The upper reference is fully supervised nnU-Net on the same splits. On BraTS2017, the file's reported full-supervision numbers are WT Dice 0.8987. The best published scribble pipeline on that benchmark, Scribble-based Hierarchical Weakly Supervised Learning, reports WT Dice 0.8823. We will re-evaluate its style of dense-CRF refinement on our scribbles rather than compare against the published number. The published figure uses that paper's own scribbles.

Three ablations isolate the key ingredient. The first replaces the ordering loss with a Bounding-Map-style soft target of $1-t$ in the band, following Bounding Maps. The second replaces it with the global area constraint of Constrained Deep Weak Supervision, using the true area fraction, an optimistic setting. The third is dense-CRF post-processing of the partial-loss output.

As a prompt-based competitor, we run box-prompted MedSAM from Point-supervised Brain Tumor Segmentation with Box-prompted MedSAM, with boxes derived from the scribble extents; no reported result was found on Lacuna for it on our band metrics. On the intraoperative hyperspectral data, the fully supervised 3D-2D hybrid CNN of Hyperspectral Imaging for Glioblastoma Surgery serves as the reference. It reports 80% overall accuracy and 68% tumor sensitivity at 98% tumor specificity under leave-one-patient-out validation. Matching its tumor sensitivity at comparable specificity while training only on simulated scribbles would count as success. Exceeding it would be a strong result.

Why not just…?

Why not just use nnU-Net with partial loss and accept the small gap? This is the real threat. On ScribbleBench the gap to full supervision is only four Dice points. Global Dice, however, is dominated by the interior, where scribbles already give signal, so the gap could hide most of the margin error. We will settle this with band-restricted Dice and HD95 and the conservativeness sweep. If the ordering loss does not beat partial loss in the band as scribbles move away from the margin, the proposal fails and we will say so.

Why not just turn scribbles into soft distance labels? This is the most natural competitor to our specific loss. It gives dense gradient everywhere, as Bounding Maps do for boxes. However, it forces the transition to sit midway between strokes, and annotators do not place strokes symmetrically around the boundary. The soft-target ablation, run under an asymmetric-erosion setting where tumor and normal regions are eroded by different amounts, tests this directly. If soft targets match ordering even there, the simpler method wins and the contribution reduces to that finding.

Why not just add a dense CRF? CRFs pull labels toward intensity differences. Radiomics analysis of non-enhancing lesions indicates that such differences are absent between infiltrative tumor and edema. Learning to Segment Medical Images with Scribble-Supervision Alone reports that CRF refinement reinforced model errors without uncertainty gating. The CRF ablation measures whether this holds on the brain-tumor data.

Why not just prompt MedSAM with a box? It needs no training. Its natural-image pretraining, however, favors sharp contrast, and OpenSRH found natural-image pretraining transfers poorly to intraoperative optical tissue. We include it as a baseline rather than dismiss it. It may be competitive on MRI and weak on hyperspectral data.

Proposed Experiments

The primary testbed is the BraTS2020 task inside ScribbleBench, with LiTS and KiTS2023 as low-contrast controls from the same benchmark. BraTS2017 is used for comparison with the hierarchical scribble method. The metrics are global Dice, Dice and HD95 restricted to a band within a fixed distance of the true boundary, a topology count (connected components and holes in the band), and expected calibration error of $p$ within the band. Calibration is the measure of whether graded margin maps can be trusted.

The intraoperative test is HELICoiD under leave-one-patient-out validation, with scribbles simulated from its pixel labels. Here the question is whether the ordering loss raises tumor sensitivity above 68% without losing specificity. The vessel exclusion rule is essential in this setting, and we will report the result with and without it. OpenSRH supplies only patch and patient labels. It cannot evaluate dense margins, so we use it only as optional in-domain pretraining and do not claim margin results on it.

Three checks decide the proposal. First, band HD95 must improve over partial loss at every erosion level on BraTS, with the improvement growing with band width. Second, ordering must beat the $1-t$ soft target under asymmetric erosion. Third, the dilated-context branch must switch from harmful to helpful on band metrics once the ordering loss is present. The first two are necessary for the claim; the third tests the multi-scale hypothesis. If the EMReDL recurrence cohort can be accessed, a scribble-only model scored against its 0.938 recurrence AUC would test whether ordering alone recovers part of what physiological priors provide.