TL;DR
This paper introduces "Structured Matrix Scaling" (SMS), a novel post-hoc calibration method for multi-class classifiers. By leveraging structured regularization, SMS effectively balances model expressiveness with the risk of overfitting, leading to significant improvements in calibration accuracy over existing methods, especially when calibration data is scarce.
What Problem Does This Paper Address?
Many machine learning classifiers, even when trained with standard techniques like cross-entropy, often produce miscalibrated probability estimates. This means the predicted probabilities don't accurately reflect the true likelihood of events. Post-hoc calibration methods aim to fix this by applying a recalibration function to the classifier's output. However, for multi-class problems, more expressive calibration models (like matrix scaling) introduce many parameters, which can lead to overfitting, especially with limited calibration data. This creates a bias-variance tradeoff: simple models might not correct miscalibration well, while complex models might overfit the calibration set, degrading performance. The paper addresses this challenge by proposing a principled way to use more complex calibration models safely through structured regularization.
Methods
The core contribution is the Structured Matrix Scaling (SMS) method. It builds upon the idea that logistic regression, even in simple settings, can motivate more complex calibration functions than standard temperature scaling. SMS uses a hierarchical structure for the calibration function's parameters, allowing for different regularization strengths on different groups of parameters (e.g., diagonal vs. off-diagonal). This structured regularization adapts the model's complexity to the amount of available calibration data, defaulting to simpler forms when data is scarce and leveraging more expressive structures when sufficient data is present. The authors also propose a Structured Vector Scaling (SVS) method, which is a simpler version of SMS. They provide efficient Python implementations and discuss the use of various regularization penalties (ridge, LASSO, group LASSO) and optimization algorithms (SAGA, L-BFGS).
Datasets
The paper uses the TabRepo dataset, a large collection of model predictions from various tabular datasets. This benchmark includes predictions from M=7 different models (logistic regression, CatBoost, LightGBM, XGBoost, random forest, and two neural nets) across D=65 multi-class classification datasets. For evaluation, they also use datasets from computer vision experiments with logits from deep neural networks trained on CIFAR-10, CIFAR-100, and ImageNet.
Key Insights and Ideas
- Theoretical Motivation for Complexity: The paper shows that even simple binary classification problems with Gaussian class-conditional data can necessitate quadratic recalibration functions, suggesting that simpler linear or affine methods are fundamentally inadequate in some cases.
- Structured Regularization as the Key: The core insight is that structured regularization, rather than just applying a blanket penalty, is crucial for managing the bias-variance tradeoff in complex calibration models. By grouping parameters and applying different regularization strengths, they can safely use more expressive models.
- Adaptability to Data Scarcity: The proposed methods naturally adapt their complexity based on the amount of calibration data, making them robust even when data is limited.
- Outperforming Simpler Methods: The experiments consistently show that SMS and SVS, with their structured regularization, outperform standard temperature, vector, and matrix scaling methods, especially in challenging scenarios.
Key Results
- Substantial Calibration Gains: SMS and SVS consistently achieve significant improvements in test logloss and Brier score compared to existing methods across various benchmarks. For instance, Table 1 shows average absolute differences in test logloss after recalibration, with SMS often showing the largest negative (i.e., improvement) values.
- Robustness to Overfitting: The structured regularization effectively prevents overfitting, even with more complex models, as demonstrated by the consistent performance gains across different datasets and model types.
- Efficiency: The authors provide efficient open-source implementations that are significantly faster than some existing methods, such as Dirichlet calibration. Figure 3 shows SMS fitting time is orders of magnitude faster.
- Statistical Significance: Statistical analysis (Friedman test and Nemenyi post-hoc test) confirms that SMS is statistically superior to most other methods for multi-class calibration.
Limitations and Future Work
- Hyperparameter Tuning: While the paper proposes default hyperparameters, fine-tuning might still be beneficial for specific applications. The paper explores hyperparameter search using meta-learning to find good default values.
- Computational Cost: While faster than some alternatives, fitting more complex models like SMS can still be computationally intensive, especially for very large numbers of classes. The paper notes that fitting matrix scaling for ImageNet (1000 classes) is prohibitively large.
- Future Work: The paper suggests that their structured regularization approach can be extended to other parametric calibration models and potentially to other machine learning tasks where similar bias-variance tradeoffs exist. The authors also highlight the importance of carefully designed regularization for unlocking the full potential of richer calibration functions.
Summary updated