Abstract
A reliable deep learning system should be able to accurately express its confidence with respect to its predictions, a quality known as calibration. One of the most effective ways to produce reliable confidence estimates with a pre-trained model is by applying a post-hoc recalibration method. Popular recalibration methods like temperature scaling are typically fit on a small amount of data and work in the model’s output space, as opposed to the more expressive feature embedding space, and thus usually have only one or a handful of parameters. However, the target distribution to which they are applied is often complex and difficult to fit well with such a function. To this end we propose selective recalibration, where a selection model learns to reject some user-chosen proportion of the data in order to allow the recalibrator to focus on regions of the input space that can be well-captured by such a model. We provide theoretical analysis to motivate our algorithm, and test our method through comprehensive experiments on difficult medical imaging and zero-shot classification tasks. Our results show that selective recalibration consistently leads to significantly lower calibration error than a wide range of selection and recalibration baselines.
Introduction
In high-stakes fields like medicine or autonomous driving, a model's "confidence" must equal its actual probability of being correct—a property called calibration. If a model says it is 70% sure, it should be right exactly 70% of the time. However, most modern neural networks are poorly calibrated, typically exhibiting overconfidence.
The standard solution is "post-hoc recalibration," where a simple function like Temperature Scaling is applied to the model's outputs. These functions usually have very few parameters, making them "inexpressive" and prone to failure when data is complex or contains outliers. If a dataset contains heterogeneous groups requiring different adjustments, a single scaling parameter will inevitably fail to calibrate all of them simultaneously.
Methods: Selective Recalibration
The authors propose Selective Recalibration, a framework that avoids forcing a simple recalibrator to fit an entire complex dataset. Instead, it trains two components jointly:
- A Selection Model ($g$): Identifies examples that the recalibrator can handle well, while "rejecting" difficult ones for human review or alternative processing.
- A Recalibration Model ($h$): A standard, low-parameter model (e.g., Platt or Temperature scaling) that adjusts confidence for the accepted examples.
Key Innovations
- Joint Optimization: Training these components together allows the selector to "carve out" a region of the feature space that the simple recalibrator can fit perfectly.
- S-TLBCE Loss: The Selective Top-Label Binary Cross Entropy loss specifically penalizes overconfidence in the predicted class, aligning better with Expected Calibration Error (ECE) metrics used in practice.
- Coverage Constraint: A penalty ensures the system maintains a user-defined "coverage" level (e.g., keeping 80% of the data) rather than rejecting excessively.
Experimental Results
The method was evaluated on four diverse benchmarks: Camelyon17 (medical imaging), ImageNet (object recognition), RxRx1 (genetic perturbation), and CIFAR-100-C (corrupted images used to test zero-shot classification via CLIP).
- Lower Calibration Error: On ImageNet and Camelyon17, selective recalibration consistently achieved lower ECE than all baselines, including standard recalibration and "selection-only" methods.
- Robustness to Distribution Shift: In RxRx1 and CIFAR-100-C experiments, the joint model maintained superior calibration even when test data differed from validation data.
- Theoretical Validation: The authors provided a proof showing that while standard recalibrators cannot reach zero error in the presence of outliers, selective recalibration can achieve this by rejecting those outliers.
Discussion and Future Work
While effective, selective recalibration presents trade-offs. Focusing purely on calibration can sometimes decrease overall accuracy on the accepted set, suggesting a need to explore the "Pareto front" between accuracy and reliability. Additionally, the authors highlight potential fairness concerns: selective classification might inadvertently reject data from specific protected groups more frequently. Future work should focus on mitigating these disparities and exploring the practical integration of rejected samples into expert-led workflows.
Summary updated