Optimizing Estimators of Squared Calibration Errors in Classification
Sebastian G. Gruber, Francis Bach
TL;DR
This work tackles the problem of selecting estimators for squared calibration errors in classification by introducing a mean-squared error risk framework that facilitates principled comparison and optimization of calibration estimators. It formalizes a calibration estimation risk, connects it to canonical calibration via $CCE_2$, and recasts existing estimators as calibration estimation functions, while also proposing two kernel ridge regression-based estimators with closed-form solutions. A training–validation–testing pipeline enables hyperparameter tuning and unbiased evaluation of calibration estimators on finite data, demonstrated through simulations and real-world benchmarks like CIFAR-10/100 and ImageNet. The findings show no single estimator dominates across settings, underscoring the need for risk-guided estimator selection and highlighting practical gains from kernel-based approaches in calibration estimation.
Abstract
In this work, we propose a mean-squared error-based risk that enables the comparison and optimization of estimators of squared calibration errors in practical settings. Improving the calibration of classifiers is crucial for enhancing the trustworthiness and interpretability of machine learning models, especially in sensitive decision-making scenarios. Although various calibration (error) estimators exist in the current literature, there is a lack of guidance on selecting the appropriate estimator and tuning its hyperparameters. By leveraging the bilinear structure of squared calibration errors, we reformulate calibration estimation as a regression problem with independent and identically distributed (i.i.d.) input pairs. This reformulation allows us to quantify the performance of different estimators even for the most challenging calibration criterion, known as canonical calibration. Our approach advocates for a training-validation-testing pipeline when estimating a calibration error on an evaluation dataset. We demonstrate the effectiveness of our pipeline by optimizing existing calibration estimators and comparing them with novel kernel ridge regression-based estimators on standard image classification tasks.
