arXiv:2608.28681cs.CVAug 2026

Manuscript Offprint

arXiv:2608.28681

CARD: Calibration via Agreement in Reverse Diffusion for Out-of-Domain MRI Segmentation

Jiaheng Dai, Weidong Guo, Qingbiao Li, Jie Xu, Yi Guo, Yuanyuan Wang, Zeju Li

Jiaheng Dai, Weidong Guo, Qingbiao Li, Jie Xu, Yi Guo, Yuanyuan Wang and Zeju Li

Abstract—Probability calibration aligns model confidence with predictive accuracy, enabling clinicians to identify unreliable segmentation regions. This alignment breaks down under domain shift, where artifacts and unseen protocols produce confident errors. Existing post-hoc methods adapt the correction at test time, conditioning on predictive entropy, the logit pattern, or augmentation response, but each proxy is read from the terminal prediction, the very quantity that shift corrupts. This motivates reliability evidence beyond the terminal prediction, which categorical diffusion provides in two ways. First, a generative shape prior keeps a capacity-limited reference intact when appearance is corrupted, so its disagreement with the primary segmentor highlights primary-model errors. Second, every reverse step yields a class distribution, separating persistent disagreement from transient discrepancy. Aggregated over the trajectory, this disagreement correlates with Dice at 0.788, against 0.521 for a matched discriminative control. We therefore propose CARD (Calibration via Agreement in Reverse Diffusion), which maps the temporal aggregate of this disagreement to a temperature field applied per pixel across all classes, so that confidence changes while the segmentation does not. Across cardiac, prostate and brain MRI shifts, CARD lowers calibration error in 45 of 49 comparisons against the strongest baseline in each setting.¹

Index Terms—Probability calibration, diffusion models, medical image segmentation, magnetic resonance imaging.

I. INTRODUCTION

Modern segmentation networks are accurate, yet often produce miscalibrated and overconfident probability estimates. Probability calibration addresses this mismatch by aligning predicted probabilities with empirical pixel-wise accuracy [1], [2]. Miscalibration becomes more pronounced under out-of-domain (OOD) shifts in magnetic resonance imaging (MRI), where imaging artifacts and unseen acquisition protocols often lead to localized errors with high confidence.

Probability calibration for medical image segmentation faces two practical challenges. First, calibration errors are spatially heterogeneous, with high-confidence errors often concentrated near anatomical boundaries and small or sparse foreground regions. A global temperature applies the same correction across all pixels and cannot account for this spatial variation. Second, both the location and severity of miscalibration vary across test cases, so the correction has to adapt to the current prediction instead of remaining fixed [2]–[4].

Existing post-hoc calibration methods differ in what they condition on at deployment. Static calibration, including temperature scaling (TS) and ensemble temperature scaling (ETS), applies a fixed correction fitted on labeled source-validation data [1], [5]. Output-conditioned calibration, including local temperature scaling (LTS), Entropy-based Temperature Scaling (HTS), and Parameterized Temperature Scaling (PTS), makes the correction depend on the terminal model output [6]–[8]. Image-conditioned calibration, represented by CalibNet, adds evidence extracted from the test image itself [9]. Section II describes each family in detail, and Fig. 1(a) compares them by the evidence available at deployment and the freedom of the resulting correction.

Across these families the evidence is read from the terminal prediction, and its relationship to error is established on source data. Under shift, confidence, entropy, logits, and augmentation responses change without preserving that relationship, and the mismatch varies across test cases. Calibration therefore needs evidence that requires no test labels, varies across cases and locations, and stays informative as appearance changes, which points beyond the endpoint to the prediction process.

Diffusion-based segmentation offers a natural source of such evidence, as predictions are formed through a sequence of intermediate reverse states [10], [11]. We find that capacity-limited Diffusion Probabilistic Models (DPMs) preserve consistent shape representations across varying domains and acquisition conditions, providing a structurally stable comparator when image appearance changes under distribution shift.

Prior diffusion-based work characterizes ambiguity or uncertainty through multiple sampled predictions [12], [13]. We instead reuse a single reverse denoising trajectory. CARD pairs a high-capacity primary diffusion model with a capacity-limited reference and measures their disagreement across shared intermediate reverse states. The aggregated agreement captures how prediction contrast evolves during reverse refinement and remains associated with segmentation error across the evaluated shifts. Fig. 1(b) shows the resulting calibration behavior under controlled cardiac artifact shifts.

Our contributions can be summarized as follows:

  • We present CARD, a post-hoc test-time calibration framework for diffusion-based segmentation that converts primary and reference disagreement across shared reverse states into a pixel-wise, input-dependent temperature field without updating the segmentor.
  • We identify trajectory disagreement between a primary and a capacity-limited reference as a test-time reliability signal, and show that its association with segmentation

Jiaheng Dai, Weidong Guo, Jie Xu, Yi Guo, Zeju Li, and Yuanyuan Wang are with the College of Biomedical Engineering, Fudan University, Shanghai, China. Qingbiao Li is with the Faculty of Information Science and Computing, University of Macau, Macau, China.

Corresponding authors: Yi Guo, Yuanyuan Wang and Zeju Li (e-mail: zejuli@fudan.edu.cn).

¹Code is available at https://github.com/fdu-farm/CARD.

(a) Confidence calibration families

Figure

FamilyMethodsCalibration mapSignal sourceAssociation under shift
Input-dependentPixel-wiseBeyond terminal outputProcess-level
StaticTS, ETS [1, 3]✗✗✗✗—
Output-conditionedLTS [8]✓✓✗✗degrades
HTS, PTS [9, 4]✓✗✗✗degrades
Image-conditionedCalibNet [5]✓✓✗✗partial
Trajectory-conditionedCARD (ours)✓✓✓✓stable

(b) Calibration under deployment shifts

Fig. 1. CARD derives reliability evidence from the prediction process. (a) Existing families take their evidence from the final prediction, or from nothing at all: static methods apply a frozen correction, output-conditioned methods read the terminal output, and image-conditioned methods add augmented views and a shape prior. CARD instead compares a primary and a capacity-limited reference across shared reverse states, the only evidence source in the table that is not terminal. (b) NLL on clean cardiac MRI and four artifact shifts. CARD stays lowest across every corruption, and the margin widens with severity.

error remains stable across the evaluated domain shifts, where terminal-output evidence does not.

  • We introduce Temporal Aggregation Calibration (TAC), which aggregates discrepancies observed at multiple reverse states into a single spatial calibration map.

  • We evaluate CARD on cardiac artifact and cross-vendor shifts, prostate source-to-target transfer, and brain-lesion scanner shift, lowering calibration error in 45 of 49 comparisons against the strongest baseline in each setting.

References (52)