Sample-Dependent Adaptive Temperature Scaling for Improved Calibration

Authors

  • Tom Joy Five AI, University of Oxford
  • Francesco Pinto University of Oxford
  • Ser-Nam Lim Meta AI
  • Philip H.S. Torr University of Oxford
  • Puneet K. Dokania Five AI, University of Oxford

DOI:

https://doi.org/10.1609/aaai.v37i12.26742

Keywords:

General

Abstract

It is now well known that neural networks can be wrong with high confidence in their predictions, leading to poor calibration. The most common post-hoc approach to compensate for this is to perform temperature scaling, which adjusts the confidences of the predictions on any input by scaling the logits by a fixed value. Whilst this approach typically improves the average calibration across the whole test dataset, this improvement typically reduces the individual confidences of the predictions irrespective of whether the classification of a given input is correct or incorrect. With this insight, we base our method on the observation that different samples contribute to the calibration error by varying amounts, with some needing to increase their confidence and others needing to decrease it. Therefore, for each input, we propose to predict a different temperature value, allowing us to adjust the mismatch between confidence and accuracy at a finer granularity. Our method is applied post-hoc, enabling it to be very fast with a negligible memory footprint and is applied to off-the-shelf pre-trained classifiers. We test our method on the ResNet50 and WideResNet28-10 architectures using the CIFAR10/100 and Tiny-ImageNet datasets, showing that producing per-data-point temperatures improves the expected calibration error across the whole test set.

Downloads

Published

2023-06-26

How to Cite

Joy, T., Pinto, F., Lim, S.-N., Torr, P. H., & Dokania, P. K. (2023). Sample-Dependent Adaptive Temperature Scaling for Improved Calibration. Proceedings of the AAAI Conference on Artificial Intelligence, 37(12), 14919-14926. https://doi.org/10.1609/aaai.v37i12.26742

Issue

Section

AAAI Special Track on Safe and Robust AI