ELSA: Efficient Label Shift Adaptation through the Lens of Semiparametric Models

Qinglong Tian, Xin Zhang, Jiwei Zhao

Introduction

In machine learning, the assumption that training and testing data are drawn from the same distribution is frequently violated in real-world deployments. This phenomenon, known as distributional shift, can significantly degrade model performance. One of the most common forms is label shift (or prior probability shift), where the class proportions $p(y)$ change between the source and target domains, while the conditional distribution of features given a label $p(x|y)$ remains invariant.

Traditional approaches to label shift adaptation often force a trade-off between implementation simplicity and estimation accuracy. ELSA (Efficient Label Shift Adaptation) introduces a novel framework that bridges this gap. By leveraging semiparametric theory, ELSA provides a "calibration-free" approach that matches the accuracy of state-of-the-art maximum likelihood methods while offering significant improvements in computational speed and stability.

The Problem: The Calibration Bottleneck

Existing solutions for label shift generally fall into two categories:

  1. Confusion Matrix Methods (e.g., BBSE): These are computationally simple but often suffer from high estimation errors, particularly when the underlying classifier is not perfectly accurate.
  2. Maximum Likelihood Methods (e.g., MLLS): These are more statistically efficient but rely heavily on "post-prediction calibration" (such as Temperature Scaling or Vector Scaling).

The dependence on calibration is a major drawback. Calibration is a cumbersome extra step that requires a separate validation set, and the final adaptation results are frustratingly sensitive to the specific calibration method chosen. ELSA was designed to achieve high accuracy without this sensitivity.

Methodology: A Semiparametric Approach

ELSA reinterprets label shift through the lens of semiparametric models. Instead of attempting to model the entire joint distribution, the framework focuses specifically on the parameter of interest: the importance weights ($\omega$), which represent the ratio of class probabilities between the target and source domains.

Key Technical Components

  • Influence Functions: The authors utilize the geometry of influence functions to derive a "perpendicular space" that is orthogonal to "nuisance" parameters, such as the distribution of features $p(x)$. This allows the estimator to focus solely on the shift in $y$.
  • Moment-Matching Framework: By projecting the score function onto this perpendicular space, ELSA creates a moment-matching equation. This effectively maps features $x$ to a new space where the first moments of the source and target data can be aligned to solve for the weights.
  • Efficient Computation: Unlike MLLS, which typically requires an iterative Expectation-Maximization (EM) algorithm, ELSA can be solved using simple linear systems or a fast fixed-point iteration method.

Experimental Evaluation

The researchers evaluated ELSA against standard benchmarks, including MNIST, CIFAR-10, and CIFAR-100. To simulate realistic label shift, they employed a Dirichlet distribution to generate varying class proportions in the target set, controlled by a parameter $\alpha$ (where smaller $\alpha$ indicates more severe shift). They also tested "tweak-one" shifts, where the probability of a single class is significantly altered.

Key Findings

  • Superior Accuracy and Stability: On MNIST and CIFAR-10, ELSA consistently achieved lower Mean Squared Error (MSE) in weight estimation compared to BBSE and RLLS. Notably, while MLLS performance fluctuated wildly depending on the calibration method used, ELSA’s performance remained remarkably stable.
  • Calibration-Free Performance: ELSA matched the performance of the best-calibrated MLLS models without requiring any calibration step. This removes a significant bottleneck in the machine learning deployment pipeline.
  • Computational Efficiency: In head-to-head timing tests on CIFAR-10, ELSA completed the adaptation process in less than 2.5 seconds. In contrast, MLLS combined with Vector Scaling (VS) took over 20 seconds, and MLLS with Bias-Corrected Temperature Scaling (BCTS) took approximately 10 seconds.

Theoretical Guarantees

Beyond empirical success, the paper provides a solid statistical foundation for ELSA. The authors prove that the ELSA estimator is $\sqrt{n}$-consistent and asymptotically normal. This ensures that as the sample size increases, the estimator reliably converges to the true weights, a guarantee that some "black-box" adaptation methods lack.

Conclusion and Future Work

ELSA represents a significant step forward in making label shift adaptation more practical for real-world applications. By eliminating the need for classifier calibration, it simplifies the deployment workflow while maintaining high accuracy and providing theoretical robustness.

Future research directions include identifying the theoretically "optimal" mapping function for features to further improve efficiency and extending this semiparametric approach to "open-set" label shift, where the test set may contain entirely new classes not seen during training.

Summary updated

BibTeX
@inproceedings{tian2023elsa,
  author = {Qinglong Tian and Xin Zhang and Jiwei Zhao},
  title = {{ELSA: Efficient Label Shift Adaptation through the Lens of Semiparametric Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=Nf2JpOSDsb},
}
Figure