[Paper Review] Attended Temperature Scaling: A Practical Approach for Calibrating Deep Neural Networks
This paper proposes Attended Temperature Scaling (ATS), a novel post-hoc calibration method that improves deep neural network confidence calibration under challenging conditions—such as small or noisy validation sets and highly accurate models—by learning attention-weighted temperature scaling. ATS maintains the low computational cost of standard Temperature Scaling while significantly outperforming it in calibration metrics like NLL and ECE, especially in real-world medical applications.
Recently, Deep Neural Networks (DNNs) have been achieving impressive results on wide range of tasks. However, they suffer from being well-calibrated. In decision-making applications, such as autonomous driving or medical diagnosing, the confidence of deep networks plays an important role to bring the trust and reliability to the system. To calibrate the deep networks' confidence, many probabilistic and measure-based approaches are proposed. Temperature Scaling (TS) is a state-of-the-art among measure-based calibration methods which has low time and memory complexity as well as effectiveness. In this paper, we study TS and show it does not work properly when the validation set that TS uses for calibration has small size or contains noisy-labeled samples. TS also cannot calibrate highly accurate networks as well as non-highly accurate ones. Accordingly, we propose Attended Temperature Scaling (ATS) which preserves the advantages of TS while improves calibration in aforementioned challenging situations. We provide theoretical justifications for ATS and assess its effectiveness on wide range of deep models and datasets. We also compare the calibration results of TS and ATS on skin lesion detection application as a practical problem where well-calibrated system can play important role in making a decision.
Motivation & Objective
- Address the poor calibration performance of standard Temperature Scaling (TS) when validation sets are small or contain noisy labels.
- Improve confidence calibration in highly accurate deep neural networks where TS fails to generalize.
- Develop a post-hoc calibration method that preserves model accuracy and maintains low time/memory complexity.
- Enable reliable uncertainty estimation in safety-critical applications such as medical diagnosis and autonomous driving.
- Provide theoretical justification for improved robustness of ATS in low-data and noisy-label scenarios.
Proposed method
- Introduce a learnable attention mechanism that dynamically weights logits before applying temperature scaling.
- Optimize a temperature parameter $ T $ and attention weights $ \theta $ jointly to minimize negative log-likelihood (NLL) on the validation set.
- Use a differentiable attention module to assign higher importance to more reliable or confident samples during $ T $ optimization.
- Maintain post-hoc calibration without retraining the backbone network, preserving inference speed and accuracy.
- Apply the method as a plug-in layer after the softmax output, enabling deployment on already-trained models.
- The final output is $ \text{softmax}(z / T) $, where $ z $ is the input logits and $ T $ is learned via attention-weighted NLL minimization.
Experimental results
Research questions
- RQ1Can Temperature Scaling be made robust to small and noisy validation sets in deep neural network calibration?
- RQ2Does the proposed attention mechanism improve calibration performance in highly accurate models where standard TS fails?
- RQ3How does ATS compare to standard TS in terms of calibration metrics (NLL, ECE) across diverse datasets and architectures?
- RQ4Can ATS enhance decision reliability in medical diagnosis systems by better distinguishing correct from misclassified predictions?
- RQ5What is the theoretical basis for ATS’s improved stability and performance in low-data and noisy-label regimes?
Key findings
- ATS significantly reduces NLL and ECE compared to standard TS on the ISIC dataset, achieving 0.333 ECE% versus 7.978 ECE% with TS.
- On ResNet200 trained on ISIC, ATS achieves an NLL of 0.333 and ECE of 3.548%, outperforming TS (NLL: 0.379, ECE: 7.978%).
- ATS stabilizes calibration even with only 801 validation samples, while TS shows high variance and instability in small-set settings.
- ATS maintains superior performance under labeling noise, demonstrating robustness where TS fails to converge to optimal temperature.
- In the skin lesion detection application, ATS increases the AUC of the reliability diagram, indicating better separation between correct and misclassified samples.
- Visual comparisons show ATS increases the confidence gap between correctly and misclassified samples more effectively than TS.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.