Meta-Cal: Well-controlled Post-hoc Calibration by Ranking

Xingchen Ma, Matthew B. Blaschko

TL;DR

This paper introduces Meta-Cal, a novel post-hoc calibration method for neural networks that goes beyond simply minimizing calibration error. By incorporating two new constraints – miscoverage rate and coverage accuracy – Meta-Cal offers better control over the reliability of probability estimates, outperforming existing methods on standard benchmarks.

What Problem Does This Paper Address?

In many real-world applications, such as medical diagnosis or autonomous driving, it's not enough for a classifier to be accurate; its predicted probabilities must also be "calibrated." This means that if a model predicts a class with 80% probability, then 80% of the time it makes that prediction, it should actually be correct. Unfortunately, many modern deep neural networks produce poorly calibrated probabilities. While "post-hoc calibration" methods exist to fix this after a model is trained, they often focus solely on reducing calibration error (like Expected Calibration Error or ECE). However, the authors argue that this sole focus is insufficient for a calibrator to be truly useful. They highlight that existing methods might achieve low ECE but still be unreliable in practice, leading to a need for more controlled calibration.

Methods

The core of Meta-Cal is a two-part system: a base calibrator and a ranking model.

  1. Base Calibrator: This is a standard post-hoc calibration method (like temperature scaling) that is applied first. The paper shows that accuracy-preserving base calibrators are a good starting point.
  2. Ranking Model: This is a novel component that learns to rank samples based on their likelihood of being correctly classified. The paper explores two main ways to use this ranking model:
  3. Miscoverage Rate Control: This aims to control the rate at which instances that were originally correctly classified become misclassified after calibration. It involves constructing a binary classifier that has a controlled Type I error (false positive rate).
  4. Coverage Accuracy Control: This focuses on ensuring that when the model makes a prediction, it does so with a certain level of confidence. It involves building a binary classifier that controls the precision of its predictions.

Meta-Cal combines these two components to create a final calibration map that not only aims for low calibration error but also adheres to these new control mechanisms. The paper provides theoretical bounds to show that Meta-Cal can effectively control these constraints.

Datasets

The paper evaluates Meta-Cal on the following standard image classification datasets:

  • CIFAR-10
  • CIFAR-100
  • ImageNet

Key Insights and Ideas

  • Calibration Error Isn't Enough: Simply minimizing calibration error (like ECE) doesn't guarantee a useful calibrator. Other factors, like miscoverage rate and coverage accuracy, are crucial for practical reliability.
  • The Power of Ranking: A ranking model, which learns to distinguish between more and less reliable predictions, is key to achieving controlled calibration.
  • Two Sides of the Coin: Meta-Cal offers control over two complementary aspects:
  • Miscoverage Rate: How many "good" predictions are turned "bad" by calibration.
  • Coverage Accuracy: How reliable the predictions are among those that are covered (i.e., not rejected or significantly altered).
  • Augmenting Existing Methods: Meta-Cal can be built upon existing, accuracy-preserving calibration methods, improving their performance and adding control.

Key Results

  • Improved Calibration Error: Meta-Cal significantly outperforms existing state-of-the-art post-hoc calibration methods in terms of empirical Expected Calibration Error (ECE) across various network architectures and datasets. For instance, on CIFAR-10 with DenseNet40, Meta-Cal achieved an ECE of 0.00355, compared to 0.00634 for GPC and 0.00510 for Uncalibrated.
  • Controlled Constraints: Empirical results (Figures 1 and 2) demonstrate that Meta-Cal effectively controls the miscoverage rate and coverage accuracy to the desired levels set by the user.
  • Computational Efficiency: Meta-Cal adds minimal computational overhead compared to its base calibrator, making it practical for deployment. In some cases, it's even faster than the base calibrator due to using a subset of data.

Limitations and Future Work

  • Independence Assumption: The theoretical guarantees for Meta-Cal rely on the assumption that the calibration data is independent of the training data for the base classifier. This is a standard assumption in post-hoc calibration but might not always hold in practice.
  • Ranking Model Choice: While the paper uses the entropy of the classifier's output as a ranking score, learning a dedicated ranking model could potentially yield better results, though it might require more data.
  • Future Work: The authors suggest that their framework could be extended to other areas, such as selective classification, and that further exploration of different ranking models and base calibrators could be beneficial.

Summary updated

Abstract

In many applications, it is desirable that a classifier not only makes accurate predictions, but also outputs calibrated posterior probabilities. However, many existing classifiers, especially deep neural network classifiers, tend to be uncalibrated. Post-hoc calibration is a technique to recalibrate a model by learning a calibration map. Existing approaches mostly focus on constructing calibration maps with low calibration errors, however, this quality is inadequate for a calibrator being useful. In this paper, we introduce two constraints that are worth consideration in designing a calibration map for post-hoc calibration. Then we present Meta-Cal, which is built from a base calibrator and a ranking model. Under some mild assumptions, two high-probability bounds are given with respect to these constraints. Empirical results on CIFAR-10, CIFAR-100 and ImageNet and a range of popular network architectures show our proposed method significantly outperforms the current state of the art for post-hoc multi-class classification calibration.
BibTeX
@inproceedings{ma2021meta,
  author = {Xingchen Ma and Matthew B. Blaschko},
  title = {{Meta-Cal: Well-controlled Post-hoc Calibration by Ranking}},
  booktitle = {International Conference on Machine Learning},
  year = {2021},
  url = {https://openreview.net/forum?id=aoF0T3elG3M},
}
Figure