Detecting and Correcting for Label Shift with Black Box Predictors
Zachary C. Lipton, Yu-Xiang Wang, Alex Smola
TL;DR
This work tackles label shift, where $q(y)$ changes between training and deployment while $p(x|y)$ stays fixed, by introducing Black Box Shift Estimation (BBSE). BBSE leverages a fixed black-box predictor with invertible confusion matrices to recover the label ratio $w(y)=q(y)/p(y)$ from unlabeled test data, enabling both shift detection (BBSD) and prediction correction (BBSC) via importance-weighted ERM. The authors prove consistency and finite-sample error bounds for BBSE, present a practical two-sample test for shift detection, and demonstrate improved performance on high-dimensional datasets (e.g., MNIST, CIFAR-10) compared to kernel-based domain adaptation methods. The framework provides a scalable, theoretically grounded approach for detecting and correcting label shift without test labels, with broad applicability to medical diagnosis and other real-world deployment settings.
Abstract
Faced with distribution shift between training and test set, we wish to detect and quantify the shift, and to correct our classifiers without test set labels. Motivated by medical diagnosis, where diseases (targets) cause symptoms (observations), we focus on label shift, where the label marginal $p(y)$ changes but the conditional $p(x| y)$ does not. We propose Black Box Shift Estimation (BBSE) to estimate the test distribution $p(y)$. BBSE exploits arbitrary black box predictors to reduce dimensionality prior to shift correction. While better predictors give tighter estimates, BBSE works even when predictors are biased, inaccurate, or uncalibrated, so long as their confusion matrices are invertible. We prove BBSE's consistency, bound its error, and introduce a statistical test that uses BBSE to detect shift. We also leverage BBSE to correct classifiers. Experiments demonstrate accurate estimates and improved prediction, even on high-dimensional datasets of natural images.
