Manuscript Offprint

arXiv:2610.03142

CalCErt: Bin-wise Certification of Confidence Calibration in Medical Image Classification

Leo Fillioux, Stergios Christodoulidis, Stergios Christodoulidis, Maria Vakalopoulou, Jose Dolz

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Leo Fillioux 1∗^{1*}, Stergios Christodoulidis 1^{1}, Paul-Henry Cournède 1^{1}, Maria Vakalopoulou 1^{1} and Jose Dolz 2^{2}

1^{1}Université Paris-Saclay, CentraleSupélec, Gustave Roussy, INSERM, CDSU, IHU PRISM, Gif-sur-Yvette

2^{2}LIVIA, ILLS, ETS Montréal

Corresponding author: leo.fillioux@centralesupelec.fr

Abstract. Deep neural networks remain vulnerable to adversarial perturbations, which can distort not only predictions but also confidence scores, undermining uncertainty calibration. While existing certification methods focus on preserving the predicted category, providing guarantees on how calibration behaves under adversarial attacks remains overlooked. In this work, we introduce CalCErt, a simple and efficient post-hoc strategy that certifies bin-wise confidence calibration for any pretrained differentiable classifier. Our approach combines empirical calibration estimates, statistical concentration bounds, and local Lipschitz estimates of the confidence function to derive data-dependent upper bounds on worst-case miscalibration within an ℓ2\ell_{2}-ball of radius R. We evaluate CalCErt across 11 medical image classification tasks and multiple adversarial perturbations, demonstrating substantially higher certified coverage than baseline strategies while maintaining competitive tightness. Our code is available at github.com/leofillioux/calcert.

Keywords: Confidence calibration · Certification · Medical Imaging.

1 Introduction

Adversarial attacks can drastically alter the predictions of modern neural networks, even when perturbations are visually imperceptible [31]. Consequently, models that appear robust under current evaluation protocols may remain vulnerable to these attacks. Moreover, label attacks [14,20,24,29], the most prominent form of adversarial perturbations, affect not only prediction correctness, but also the confidence scores, thereby degrading overall uncertainty calibration. This is particularly concerning in safety-critical domains, such as medical image analysis [4,23], where confidence scores often play a central role in downstream decision-making, and where failures can have severe real-world consequences.

Given these risks, there is a growing need for formal guarantees on model behavior under perturbations. While adversarial training and empirical defenses

∗^{*} Work done during an internship at ILLS.

L. Fillioux et al.

can improve robustness, they provide no provable guarantees and are frequently broken by stronger attacks. In contrast, certified robustness [5,8,30] has emerged as a promising direction, providing mathematical guarantees that a model's output remains stable for all inputs within a prescribed ℓp\ell_{p}-norm ball of radius R. Nevertheless, computing exact adversarial robustness is coNP-hard [19], and attack-based evaluations provide only heuristic upper bounds on vulnerability [6,32]. This has motivated a rich and growing line of work on certification methods, such as Randomized Smoothing [5,8], which provide provable guarantees on robust accuracy. Yet, despite this progress, existing certification frameworks focus almost exclusively on providing guarantees that the model predicted class remains unchanged [18,21] given a prescribed perturbation radius, but they do not address how confidence scores behave. This is a critical omission, as robustness of accuracy does not directly imply robustness of calibration, and a model may remain correct while becoming arbitrarily over- or under-confident.

To our knowledge, certifying uncertainty calibration in the medical domain remains unexplored. Existing method provides no guarantees on how calibration may deteriorate under adversarial perturbations, or how bin-wise miscalibration behaves. This gap is critical in healthcare, where confidence (rather than accuracy alone) drives downstream actions, motivating the question: Can we certify the uncertainty calibration of a pretrained model under ℓ2\ell_{2}-bounded perturbations without retraining or attack-specific fine-tuning?

Thus, we can summarize our main contributions as:

– We take a first step toward certifying uncertainty calibration in medical image classification under adversarial perturbations. To this end, we derive a tractable, data-dependent upper bound on the worst-case change in confidence within an ℓ2\ell_{2}-ball by estimating local Lipschitz constants of the model confidence function. This provides a principled way to control how far confidence values can drift under input perturbations.

– Building on this, we obtain certified upper bounds on bin-wise miscalibration by combining empirical calibration estimates, statistical concentration inequalities, and our Lipschitz-based control of confidence variation. The resulting certificate is post-hoc, requires no adversarial training and is compatible with any differentiable model. This makes our approach simple to implement and applicable to a wide range of pretrained classifiers.

– Extensive experiments across 11 classification tasks spanning multiple medical imaging modalities, five diverse perturbations, including adversarial attacks, and four backbones (leading to a total of 220 different settings) demonstrate that CalCErt yields usable, non-vacuous bounds for calibration certification.

References (36)

  • Sorting out lipschitz function approximation
  • Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples
  • The liver tumor segmentation benchmark (lits)
  • Adversarial attack vulnerability of medical image analysis systems: Unexplored factors
  • (certified!!) adversarial robustness for free! In: The Eleventh International Conference on Learning Representations
  • Towards evaluating the robustness of neural networks
  • Parseval networks: Improving robustness to adversarial examples
  • Certified adversarial robustness via randomized smoothing
  • An image is worth $16 \times 16$ words: Transformers for image recognition at scale
  • Exploring the landscape of spatial robustness
  • Certified robustness via dynamic margin maximization and improved lipschitz regularization
  • Efficient and accurate estimation of lipschitz constants for deep neural networks
  • Breaking certified defenses: Semantic adversarial examples with spoofed robustness certificates
  • Explaining and Harnessing Adversarial Examples
  • Certifying incremental quadratic constraints for neural networks via convex optimization
  • Probability inequalities for sums of bounded random variables
  • Training certifiably robust neural networks with efficient local lipschitz bounds
  • Promptsmooth: Certifying robustness of medical vision-language models via prompt learning
  • Reluplex: An efficient SMT solver for verifying deep neural networks
  • Adversarial examples in the physical world
  • Certification of deep learning models for medical image segmentation
  • Globally-robust neural networks
  • Understanding adversarial attacks on deep learning based medical image analysis systems
  • Towards deep learning models resistant to adversarial attacks
  • Higher-order certification for randomized smoothing
  • Training robust neural networks using lipschitz bounds
  • Certified robustness to label-flipping attacks via randomized smoothing
  • Denoised smoothing: A provable defense for pretrained classifiers
  • Poison frogs! targeted clean-label poisoning attacks on neural networks
  • Boosting robustness certification of neural networks
  • Intriguing properties of neural networks
  • On adaptive attacks to adversarial example defenses
  • Ensemble adversarial training: Attacks and defenses
  • Lipschitz-margin training: Scalable certification of perturbation invariance for deep neural networks
  • Medmnist v2-a large-scale lightweight benchmark for 2d and 3d biomedical image classification
  • Rethinking lipschitz neural networks and certified robustness: A boolean function perspective