Unsupervised Calibration under Covariate Shift

Anusri Pampari,Stefano Ermon
DOI: https://doi.org/10.48550/arXiv.2006.16405
2020-06-30
Abstract:A probabilistic model is said to be calibrated if its predicted probabilities match the corresponding empirical frequencies. Calibration is important for uncertainty quantification and decision making in safety-critical applications. While calibration of classifiers has been widely studied, we find that calibration is brittle and can be easily lost under minimal covariate shifts. Existing techniques, including domain adaptation ones, primarily focus on prediction accuracy and do not guarantee calibration neither in theory nor in practice. In this work, we formally introduce the problem of calibration under domain shift, and propose an importance sampling based approach to address it. We evaluate and discuss the efficacy of our method on both real-world datasets and synthetic datasets.
Machine Learning
What problem does this paper attempt to address?
The problem that this paper attempts to solve is the calibration problem of the model in the case of covariate shift. Specifically, the author points out that the existing classifiers are very fragile during calibration and will lose their calibration performance even under the slightest covariate shift. The existing techniques mainly focus on prediction accuracy, but cannot guarantee theoretical or practical effects in terms of calibration. ### Problem Background 1. **Importance of Calibration**: A probability model is called calibrated if its predicted probabilities match the corresponding empirical frequencies. Calibration is very important for uncertainty quantification and decision - making, especially in safety - critical applications. 2. **Limitations of Existing Methods**: Existing calibration methods usually assume that the training, validation, and test data come from the same distribution, but in many real - world scenarios, this assumption will be violated, resulting in covariate shift (i.e., a change in the input distribution). In addition, the existing unsupervised domain adaptation methods improve prediction accuracy but do not consider the calibration problem of the model. ### Main Contributions of the Paper 1. **Introducing the Problem**: The author formally introduces the calibration problem in the case of domain shift and shows the deficiencies of existing domain adaptation models (such as CDAN) in terms of calibration. 2. **Proposing a Solution**: The author proposes a method based on importance sampling to solve the calibration problem under covariate shift. This method does not require additional test label data and can be adapted to any existing calibration method. 3. **Experimental Verification**: The author evaluates the effectiveness of the proposed method on real - world and synthetic datasets and shows the performance achieved when it is close to perfect calibration or calibrated using labeled target data. ### Mathematical Formulas - Definition of Calibration: \[ P(\hat{Y} = Y|\hat{P} = p)=p, \quad \forall p\in[0, 1] \] where \(\hat{Y}\) is the predicted class and \(\hat{P}\) is the corresponding confidence level. - Expected Calibration Error (ECE): \[ \text{ECE}=\sum_{m = 1}^{M}\frac{|B_m|}{n}|\text{acc}(B_m)-\text{conf}(B_m)| \] where \(B_m\) is the set of sample indices whose confidence levels fall within the interval \([\frac{m - 1}{M},\frac{m}{M}]\), and \(\text{acc}(B_m)\) and \(\text{conf}(B_m)\) are the accuracy rate and average confidence level of these samples respectively. - Calibration Loss under Importance Sampling: \[ E(x,y)\sim\pi_{te}(X,Y)[l(h(x),y;\beta)] = E(x,y)\sim\pi_{tr}(X,Y)\left[\gamma(x)l(h(x),y;\beta)\right] \] where \(\gamma(x)=\frac{\pi_{te}(x)}{\pi_{tr}(x)}\) is the density ratio. Through these formulas and methods, the paper aims to solve the challenges of model calibration in the case of covariate shift, thereby improving the reliability and interpretability of the model in different domains.