King's College London Fixes AI Tumor Detectors That Lie About Their Confidence
A new differentiable loss lets medical image segmentation models learn calibrated confidences during training, cutting calibration error by up to 58% while preserving Dice scores.
ProTakeaways
- New auxiliary loss mL1-ACE turns Average Calibration Error into a differentiable per-image training signal for segmentation. Paper
- Soft-binned variant cuts macro-ACE by 33% on average and micro-ACE by up to 70%, with -0.7% DSC cost.
- Hard-binned variant reduces macro-ACE by 16% while preserving segmentation accuracy (+0.03% DSC).
- Evaluated on ACDC, AMOS, BraTS 2021 and KiTS 2023 with a SegResNet backbone in MONAI.
- Beats or matches post-hoc temperature scaling and works alongside standard Dice plus cross-entropy training.
- Open-source implementation available on GitHub.
Deep networks that segment tumors and organs tend to be dangerously sure of themselves. They routinely produce softmax probabilities near 1.0 for pixels they get wrong, which is exactly the kind of behavior you do not want when a radiologist is deciding whether to trust an AI-drawn tumor boundary. A team from King's College London, Imperial College London, and Intel has proposed a training-time fix that pushes those probabilities back toward reality.
The paper, Average Calibration Losses for Reliable Uncertainty in Medical Image Segmentation, introduces a differentiable version of the marginal L1 Average Calibration Error (mL1-ACE) that can be dropped into a standard segmentation loss as an auxiliary term. Tested across four public datasets, incorporating mL1-ACE significantly reduces calibration errors, particularly Average Calibration Error (ACE) and Maximum Calibration Error (MCE), while largely maintaining high Dice Similarity Coefficients. Code is available on GitHub.
Why segmentation networks lie about their confidence
Calibration means the confidence a model reports actually matches how often it is right. If a well-calibrated model says 80% on a batch of predictions, roughly 80% of them should be correct. Deep networks trained on limited data, as is common in medical imaging, tend to be overconfident. That matters because a model might assign high confidence to an incorrect decision, misleading clinicians, while well-calibrated models improve the trustworthiness of AI predictions by aligning predictive confidence with accuracy.
Historically, calibration has been patched on after training with methods like temperature scaling, which multiplies logits by a single scalar. That is cheap but crude: these approaches fail to leverage the model's full capacity to learn calibration directly, and they usually employ global adjustments, unable to correct instance or class-specific calibration errors.
Turning a metric into a loss
The trick that makes this work is a property of segmentation that classification does not have. Every image already produces millions of voxel-level predictions, so you can build a reliability diagram from a single image instead of needing a large batch. The authors bin predicted foreground probabilities into M bins, compute the average predicted probability and the observed frequency in each bin, and take the mean absolute difference between them.
They provide two versions of the binning:
- Hard binning (hL1-ACE): a square kernel where each voxel goes into exactly one bin.
- Soft binning (sL1-ACE): a triangular kernel where each voxel contributes to multiple neighboring bins, producing smoother gradients.
Both are combined with the standard Dice plus cross-entropy loss in a 1:1:1 weighting, using 20 bins by default. Importantly, unlike the widely used Expected Calibration Error, which weights errors by bin population and is dominated by highly confident predictions, ACE treats all confidence ranges equally. That matters in segmentation because the interesting uncertainty lives at tissue boundaries, not in the vast easy background.
The numbers across four datasets
Experiments run on ACDC 2017 (cardiac MRI), AMOS 2022 (abdominal CT), BraTS 2021 (multimodal brain tumor MRI), and KiTS 2023 (kidney and kidney tumor CT) using a SegResNet backbone in MONAI. The picture that emerges is a clear tradeoff:

Soft mL1-ACE improves macro-averaged ACE by 46% on ACDC, 19% on AMOS, 30% on BraTS and 36% on KiTS compared to the baseline. For micro-averaged ACE, soft mL1-ACE gives improvements of 70% on ACDC, 52% on AMOS, and 58% on BraTS, while on KiTS hard-binned mL1-ACE achieves the largest improvement with a 58% enhancement over the baseline.
The catch is segmentation quality. Hard binning gives moderate calibration improvements (average 16% ACE reduction) while essentially maintaining segmentation performance (average +0.03 percentage points DSC), while soft binning achieves larger calibration gains (average 33% ACE reduction) but with a small decrease in segmentation accuracy (average -0.7 percentage points DSC).
Compared to post-hoc temperature scaling, the story is more nuanced. Temperature scaling improves macro-ACE by roughly 8 to 25% across datasets while maintaining DSC. Hard mL1-ACE lands in the same ballpark, but soft mL1-ACE beats it meaningfully on calibration when a small DSC hit is acceptable.
Where it helps and where it hurts
The practical value shows up in the probability maps themselves. The mL1-ACE losses produce a more diffuse probability distribution, with a softening of class probabilities toward the decision boundary for false positive and particularly false negative regions, indicating reduced overconfidence. That is exactly the behavior you want for downstream tasks like quality control, active learning, or flagging uncertain regions for radiologist review.

The method has a real weakness worth knowing about. The softening of probability distributions toward the decision boundary can inadvertently penalize predictions when a class is entirely absent, which is a limitation in scenarios where missing classes are prevalent. This matters for datasets like KiTS, where over half of cases lack the cyst class, and it partly explains why soft binning's advantage disappears on that dataset until you filter to complete cases.
Another built-in limitation: the process of binning foreground probabilities strips away spatial information, limiting the model's ability to capture spatial correlations in uncertainty. So calibration improves in aggregate but does not always align with the specific error regions in an image.
The takeaway
The real contribution here is not just another loss function. It is the observation that segmentation gives you enough voxels per image to compute a stable calibration estimate on a single forward pass, which sidesteps the batch-size headaches that made this awkward in classification. Combined with the choice between a conservative variant (hard binning) that barely touches DSC and an aggressive one (soft binning) that trades a fraction of a DSC point for much better calibration, practitioners get an explicit knob for the calibration-accuracy tradeoff, rather than a single take-it-or-leave-it recipe. For anyone building medical imaging systems where predicted probabilities feed into downstream decisions, that knob is likely worth adding.