Beyond calibration: estimating the grouping loss of modern neural networks

Alexandre Perez-Lebel, Marine Le Morvan, Gaël Varoquaux · DOI

Introduction

In the quest for reliable machine learning, model calibration has become a standard requirement. A model is considered calibrated if its confidence scores align with its average accuracy—for instance, if a classifier predicts a 70% probability of success, it should indeed be correct 70% of the time across many such predictions. However, calibration is an aggregate metric that can mask significant internal inconsistencies. A model can be perfectly calibrated on average while being systematically wrong for specific subgroups.

This hidden variance is known as grouping loss. Consider a medical diagnostic tool that assigns a 60% risk score to a group of patients. Even if exactly 60% of that group has the condition, the model fails if the group actually comprises one subgroup with 100% risk and another with 20% risk. In such cases, the model is perfectly calibrated but suffers from high grouping loss because it ignores critical internal variance.

A calibrated classifier can still be far from true probabilities if it ignores internal variance.

Measuring the Unmeasurable

While calibration is straightforward to measure, grouping loss is notoriously difficult to estimate because the "true" posterior probabilities ($Q$) of real-world data are unknown. This paper addresses this challenge by introducing a debiased estimator for grouping loss, providing a practical lower bound for this critical uncertainty component.

The authors utilize the decomposition of proper scoring rules, such as the Brier score, where total predictive error is partitioned into three components:

  1. Calibration Loss: The error from average over- or under-confidence.
  2. Grouping Loss: The variance of true probabilities within groups sharing the same confidence score.
  3. Irreducible Loss: The inherent noise or randomness in the data itself.

Methodology: Feature Space Partitioning

To estimate grouping loss without access to ground-truth probabilities, the researchers propose a method based on partitioning the model's internal feature space. Specifically, they use decision trees to segment the penultimate layer of the neural network. By identifying regions where the model's actual error rate deviates from its predicted confidence, they can effectively "catch" the grouping loss.

Intuition: Partitioning a level set of confidence into regions reveals hidden variance in true probabilities.

A key technical contribution is the development of a debiased estimator ($GL_{LB}$). Naive "plug-in" estimators often overestimate grouping loss due to finite sample noise. The proposed estimator accounts for this, providing a reliable lower bound that remains stable even as the number of regions increases.

Experimental Insights

The study evaluated several modern architectures, including Vision Transformers (ViT), ConvNeXt, and ResNet, across vision (ImageNet-1K, ImageNet-R, ImageNet-C) and NLP (Yahoo Answers Topics) benchmarks. Several key insights emerged:

  • Recalibration is insufficient: Standard techniques like Isotonic Regression can "fix" calibration by shifting average scores, but they do nothing to reduce grouping loss. The underlying ignorance of subgroups remains unaddressed.
  • Distribution shift exacerbates grouping loss: While models often show low grouping loss on in-distribution data (e.g., ImageNet-1K), the loss spikes significantly under distribution shifts (e.g., ImageNet-R/C).
  • Architectural Robustness: Different architectures with similar top-line accuracies exhibit varying levels of grouping loss. For example, ViTs were found to have lower grouping loss than ConvNeXt models on ImageNet-R, suggesting superior robustness in their uncertainty estimates.

Conclusion

This work highlights that calibration alone is an incomplete measure of model reliability. By providing a practical way to estimate grouping loss, the authors offer a more nuanced view of model performance, particularly under distribution shift. While the current method provides a lower bound, it sets the stage for future research into upper bounds and the relationship between grouping loss and algorithmic fairness. Understanding these internal inconsistencies is vital for deploying neural networks in high-stakes environments where individual-level accuracy is paramount.

Summary updated

BibTeX
@misc{perezlebel2022beyond,
  author = {Alexandre Perez-Lebel and Marine Le Morvan and Gaël Varoquaux},
  title = {{Beyond calibration: estimating the grouping loss of modern neural networks}},
  year = {2022},
  eprint = {2210.16315},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2210.16315},
}
Figure