TL;DR
Quantile-Adaptive Temperature Scaling (QaTS) is a new post-hoc calibration method that fixes the "overconfidence" problem in deep neural networks by adapting temperature based on a prediction's rank, rather than its raw score. By operating in quantile space, QaTS effectively targets heterogeneous miscalibration and remains remarkably robust under distributional shifts and class imbalance without degrading model accuracy.
What Problem Does This Paper Address?
Deep neural networks are notoriously overconfident, often assigning high probabilities to incorrect predictions. Confidence calibration aims to ensure that a model's predicted probability (e.g., 80%) actually corresponds to its empirical accuracy (e.g., it is correct 80% of the time).
The current industry standard, Temperature Scaling (TS), is a "blunt instrument." it applies a single global scalar to all model outputs (logits). The authors argue this is insufficient because miscalibration is heterogeneous:
- Regime Dependency: In standard settings, the biggest gaps between accuracy and confidence happen at the low-confidence end of the spectrum. In long-tailed (imbalanced) settings, these gaps shift toward the middle.
- Structural Rigidity: A single global temperature cannot fix these localized discrepancies across the entire confidence spectrum.
Methods
The authors introduce Quantile-Adaptive Temperature Scaling (QaTS). Instead of a fixed temperature $T$, QaTS uses a sample-wise temperature $T(x)$ that is a function of the prediction's empirical confidence quantile $\tau$.
- Quantile Mapping: Confidences from a calibration set are sorted to define an empirical Cumulative Distribution Function (CDF). For any new prediction, its confidence is mapped to a quantile $\tau \in [0, 1]$, representing its relative rank (e.g., "this is in the bottom 10% of my usual confidence levels").
- Adaptive Temperature Function: The temperature is defined as a monotone linear function: $T(x) = a \cdot (1 - q(x)) + b$, where $q(x)$ is the quantile.
- Optimization: The parameters $a$ and $b$ are learned by minimizing the Negative Log-Likelihood (NLL) on a small validation set.
- Rank Preservation: Because the temperature function is monotone and applied post-hoc, it changes the values of the probabilities to improve calibration but never changes the predicted class or the relative ranking of predictions.
Datasets
The authors conducted a massive evaluation across 162 different settings, including:
- Standard Vision: CIFAR-10, CIFAR-100, and ImageNet.
- Long-Tailed (Imbalanced): CIFAR-100-LT and ImageNet-LT.
- Distributional Shift: CIFAR-100-C (15 types of corruptions across 5 severity levels).
- Medical Imaging: 11 datasets including HAM10000 and the MedMNIST2D benchmark (X-ray, CT, Ultrasound, etc.).
- NLP & Segmentation: 20 Newsgroups (text classification) and Pascal VOC (semantic segmentation).
Key Insights and Ideas
- Quantile Space as a Normalizer: By shifting from raw confidence scores to quantiles, the calibration problem becomes "normalized." It doesn't matter if a model's raw scores are shifted by a new domain; as long as the relative ordering of "more certain" vs "less certain" holds, the quantile-based correction remains valid.
- Stability under Shift: Quantiles are rank-based and thus stable under monotonic transformations of logits. This explains why QaTS is significantly more robust to covariate shift (like image blur or noise) than standard TS.
- Targeted Correction: The linear function $a(1-q) + b$ naturally applies higher temperatures (more "softening") to low-quantile predictions where overconfidence is typically most severe, while leaving high-confidence, well-calibrated predictions largely untouched.
- Accuracy vs. Calibration Trade-off: Some recent SOTA methods (like FeatClip) improve calibration at the cost of accuracy. QaTS achieves better calibration while maintaining 100% of the original model's accuracy.
Key Results
- SOTA Performance: QaTS consistently achieved the lowest Expected Calibration Error (ECE) across nearly all benchmarks. On CIFAR-100 with a ResNet-50, it reduced ECE from 8.62% (uncalibrated) to 2.56%, outperforming TS (5.32%).
- Robustness to Corruption: In the presence of severe distributional shifts (CIFAR-100-C, severity 5), QaTS delivered ECE values 2x to 3x lower than other accuracy-preserving methods.
- Accuracy Dominance: Compared to FeatClip, QaTS yielded higher accuracy in 94.4% of the 161 tested settings, often by margins of 4-6% in challenging long-tailed scenarios.
- Medical Utility: In high-stakes medical tasks, QaTS showed substantial gains, for instance, reducing ECE on the DermMNIST dataset from 7.44% (Group Calibration) to just 2.22%.
Limitations and Future Work
- Linear Assumption: The paper primarily uses a linear function for the temperature-quantile relationship. While they experimented with piecewise linear functions, they found that higher-capacity functions tended to overfit sparsely populated quantile regions, especially in long-tailed settings.
- Post-hoc Only: As a post-hoc method, it requires a held-out calibration set. While this is standard, exploring how these quantile-aware objectives could be integrated directly into the training phase remains an open question.
- Quantile Estimation: The method relies on a good empirical estimate of the confidence distribution; performance might degrade if the calibration set is extremely small or unrepresentative.
Summary updated