Abstract
In the face of dataset shift, model calibration plays a pivotal role in ensuring the reliability of machine learning systems. Calibration error (CE) is an indicator of the alignment between the predicted probabilities and the classifier accuracy. While prior works have delved into the implications of dataset shift on calibration, existing CE estimators assume access to labels from the target domain, which are often unavailable in practice. This work addresses such a challenging scenario and proposes a novel CE estimator under label shift, characterized by changes in the marginal label distribution $p(Y)$ while keeping the conditional $p(X|Y)$ constant. Our approach leverages importance re-weighting of the labeled source distribution to provide consistent and asymptotically unbiased CE estimation with respect to the shifted target distribution. Empirical results across diverse real-world datasets demonstrate the effectiveness and reliability of the proposed estimator.
Introduction
A "calibrated" model is one where the predicted probability matches the actual frequency of the outcome. In real-world deployment, models often face dataset shift, where the target data distribution differs from the source training data. A common type is label shift, where the prevalence of classes changes (e.g., a sudden disease outbreak) while the feature-label relationship remains stable. Traditionally, calculating Calibration Error (CE) to monitor model reliability requires a labeled hold-out set from the target domain. However, in high-stakes scenarios like medical diagnostics, obtaining expert labels in real-time is often impossible. This paper introduces the first consistent and asymptotically unbiased estimator for CE that works under label shift using only unlabeled data from the target domain.
Methodology
The proposed framework estimates the calibration error by "re-weighting" labeled source data to mimic the label distribution of the unlabeled target data.
- Importance Weighting: The authors define importance weights $\omega = p_t(Y)/p_s(Y)$. Since target labels are unavailable, unsupervised domain adaptation methods (such as RLLS, ELSA, or BBSL) are used to estimate these weights by comparing model predictions on source versus target data.
- The Estimator: A novel $L_p$ canonical calibration error estimator is derived using an adaptive binning kernel to estimate the conditional expectation of labels on the target distribution.
- Variance Estimation: The authors provide a formula and algorithm to calculate the variance of the estimator, which is essential for quantifying the confidence of the calibration estimate in deployment.
Experimental Results
The approach was validated on synthetic shifts (CIFAR-10/100, ImageNet-LT) and real-world datasets from the WILDS benchmark (Camelyon17, iWildCam, Amazon).
Key Findings
- High Fidelity to Ground Truth: The proposed estimator ($\widehat{\text{CE}}_t$) closely matches the "ground truth" CE calculated with actual target labels. On CIFAR-100-LT, the estimate typically stayed within 0.01–0.02 of the true value.
- Robustness to Shift Intensity: The estimator remains reliable even under extreme shifts (e.g., an Imbalance Factor of 100).
- Influence of Sample Size: As shown in empirical evaluations, the estimator's performance stabilizes and converges toward the ground truth as the sample size increases, even without access to target labels.
- Weight Estimator Performance: Among various techniques, Regularized Learning under Label Shifts (RLLS) was found to be the most stable and accurate for weight estimation, particularly in low-data regimes.
Conclusion
This work demonstrates that labels are not a prerequisite for monitoring model reliability under label shift. By assuming an anti-causal shift, the model's own output distribution on unlabeled data provides sufficient information to correct calibration estimates. While currently limited to label shift scenarios (excluding covariate shift), this estimator provides a vital tool for practitioners to monitor model degradation in real-time. Future work may explore differentiable kernels to integrate this estimator directly into model training for inherently robust calibration.
Summary updated