TL;DR
When an AI segments a medical image, it’s often up to a confidence score to decide whether a doctor needs to double-check the result. The catch? Different clinical tasks care about different kinds of errors—some care about overall region overlap, others about exact boundaries—and standard confidence scores don't let you choose. Metric-Aligned Confidence (MAC) is a simple, plug-and-play method that scores a segmentation mask using the exact same metric you actually care about, without any extra model training or inference calls.
What Problem Does This Paper Address?
In selective medical image segmentation, a model’s predictions are triaged: high-confidence masks are accepted automatically, while low-confidence ones are flagged for human review. Suppose a clinician only has time to inspect 20 out of 100 scans—the confidence score determines which 20 get human eyes.
Traditionally, image-level confidence is built by averaging pixel-level uncertainties, or by estimating a single overlap metric like Dice (which measures how much two regions overlap). But overlap isn't everything. In many medical applications, boundary accuracy—measured by metrics like the full Hausdorff distance (HD), which captures the worst-case distance between predicted and true contours—matters far more.
As Figure 1 illustrates, Dice and HD can rank the exact same predictions in completely opposite ways. A tiny, remote false-positive island leaves Dice nearly perfect ($0.989$) while blowing up the Hausdorff distance ($\text{HD}/D = 0.225$). Conversely, uniformly dilating a mask hurts Dice ($0.832$) but keeps the boundary error small ($\text{HD}/D = 0.028$). If your confidence score only speaks "Dice," it will miss the exact boundary errors your clinicians need to catch.
Methods
The authors introduce Metric-Aligned Confidence (MAC), a post-hoc, mask-aware method that works on top of any frozen segmentation model. Given a single probability map $p(x)$ and a deployed binary mask $\widehat{Y}(x)$ (thresholded at $0.5$), MAC works in three steps:
- Generate candidate masks: Instead of sampling new masks from the model, MAC sweeps a shared threshold $t$ across all pixels ($32$ evenly spaced midpoint thresholds between $0$ and $1$) to create $32$ complete candidate masks.
- Compare against the deployed mask: It computes the segmentation loss $\ell_d$ between each candidate mask and the deployed mask $\widehat{Y}(x)$ under your chosen target metric $d$.
- Average and negate: The confidence score is simply the negative average of these losses. Smaller average discrepancy across thresholds means higher confidence.
Because the probability map, deployed mask, and candidate masks stay identical, you can swap the loss function to get MAC-Dice or MAC-HD (using HD normalized by the image diagonal) with zero extra training or model calls.
Datasets
The authors evaluate MAC across three public medical segmentation datasets and one nonmedical benchmark, using two distinct model families (CLIPSeg and DeepLabV3 with a ResNet-50 backbone):
- Kvasir-SEG (polyps): 800 training / 200 test images
- ISIC 2018 (skin lesions): 2,594 training / 1,000 test images
- TN3K (thyroid nodules): 2,879 training / 614 test images
- Oxford-IIIT Pet (nonmedical): 3,680 training / 3,669 test images
Key Insights and Ideas
- Aligning the scoring metric with the evaluation metric pays off: In a controlled comparison where everything else is held fixed, MAC-HD consistently beats MAC-Dice when evaluated on boundary error (HD), and MAC-Dice consistently beats MAC-HD when evaluated on overlap (Dice).
- Spatial structure matters for boundary-based triage: Heuristics that account for distance from the boundary (like the authors' Farthest baseline) outperform pure overlap baselines on HD ranking, reinforcing that pixel-level aggregation misses crucial geometric context.
- Metric alignment isn't a silver bullet on its own: While MAC-HD dominates HD-based ranking, Soft Dice Confidence (SDC)—an analytical Dice estimator—remains very competitive under Dice risk, beating MAC-Dice on two of the four datasets. How you construct the confidence score still matters.
Key Results
Performance is measured using the Area Under the Risk–Coverage Curve (AURC $\times 100$), where lower values mean better selective ranking across all review budgets.
- Under normalized HD loss: MAC-HD achieves the lowest AURC across all 8 dataset–model conditions, outperforming MAC-Dice, SDC, Thr-IoU, and Farthest. For example, on Kvasir-SEG with CLIPSeg, MAC-HD scores 10.172 compared to 12.863 for MAC-Dice and 11.010 for Farthest.
- Under Dice loss: MAC-Dice outperforms MAC-HD in all 8 conditions. Across all baselines, MAC-Dice wins on Pet (3.316 / 3.241) and ISIC (7.176 / 6.354), while SDC wins on Kvasir (8.923 / 5.165) and TN3K (15.566 / 7.922).
Limitations and Future Work
- Nested candidate masks: Because MAC generates candidates by sweeping a single shared threshold, lowering the threshold can only add pixels. It cannot represent arbitrary combinations of adding and removing regions. If a model assigns high probability to a false-positive region, that error may persist across most candidates and leave confidence artificially high.
- No free-lunch guarantees: A lower AURC doesn't guarantee lower risk at every specific review budget. Formal risk-control guarantees at a fixed acceptance threshold still require independent labeled calibration data.
- Scope: Experiments are limited to 2D binary segmentation with diagonal-normalized distances; future work is needed to test 3D/multi-class settings, distribution shifts, and actual clinical review workloads.
Summary updated