Regularized Learning for Domain Adaptation under Label Shifts

Kamyar Azizzadenesheli, Anqi Liu, Fanny Yang, Animashree Anandkumar

Machine learning models frequently encounter "distribution shift" in the real world—situations where the data they process during deployment differs significantly from their training data. While much of the existing research focuses on covariate shift (changes in input features), this paper addresses the equally critical problem of label shift. Under label shift, the relationship between features and labels remains constant, but the baseline frequency of the labels changes.

Consider a medical diagnostic tool trained in a region where a specific disease is rare, but deployed in an area where it is common. The symptoms (features) indicating the disease haven't changed, but the base rate (label probability) has. Adapting to this shift is challenging because target domain data is typically unlabeled.

To solve this, the authors introduce Regularized Learning under Label Shifts (RLLS), a principled algorithm that provides generalization guarantees and significantly outperforms existing methods, particularly in "low-sample" regimes where target data is scarce.

The Mechanics of RLLS

When adapting to label shifts, standard approaches attempt to estimate the new label distribution and apply "importance weights" to retrain the model. Previous methods, such as Black Box Shift Learning (BBSL), perform well with massive amounts of target data but become highly unstable when target samples are limited.

RLLS overcomes this limitation through a two-step regularized approach:

  1. Weight Estimation with Error Correction: RLLS estimates the importance weights (the ratio of target to source label frequency) using a regularized optimization objective. Unlike previous methods that simply invert a confusion matrix—which can amplify noise—RLLS explicitly accounts for finite-sample errors in both the estimated confusion matrix and the observed target feature distribution.
  2. Regularized Empirical Risk Minimization: Instead of blindly applying the estimated weights, RLLS uses a regularized weight formula: $\hat{w} = 1 + \lambda \hat{\theta}$, where $\hat{\theta}$ represents the estimated shift. The parameter $\lambda$ acts as a "trust" dial. When target data is scarce and weight estimates are uncertain, $\lambda$ is kept small, keeping the model closer to its unweighted state. As more target data becomes available, $\lambda$ approaches 1, fully weighting the model.

Crucially, the authors derive a dimension-independent generalization bound for RLLS. This mathematical proof demonstrates that the target domain error depends on the model's complexity (e.g., Rademacher complexity) rather than the number of input dimensions (like image pixels). This proves that label shift adaptation is fundamentally a "low-dimensional" problem centered on the number of classes, making it computationally tractable even for complex deep neural networks.

Experimental Results

The researchers evaluated RLLS on standard image recognition benchmarks (MNIST and CIFAR-10), artificially inducing various label shift scenarios such as Tweak-One Shift, Minority-Class Shift, and Dirichlet Shift.

The results highlight the danger of treating importance weights as perfect estimates. In low-sample regimes, a "perfectly" weighted model can actually perform worse than an unweighted one due to estimation noise. RLLS successfully navigates this trade-off.

Mean Squared Error Comparison

Weight Accuracy: RLLS achieved significantly lower mean squared error (MSE) in weight estimation compared to the BBSL baseline. This stability is especially pronounced as the shift becomes more extreme or when data is limited.

Average Accuracy Comparison

Classification Performance: In large-shift scenarios on CIFAR-10, RLLS demonstrated up to a 20% higher accuracy and F1-score than baseline methods. Furthermore, in the "low-sample regime" (e.g., only a few hundred target samples), applying partially regularized weights yielded at least a 10% accuracy improvement over both fully weighted and unweighted methods.

Limitations and Future Work

While RLLS provides a robust framework for label shift adaptation, it relies on the strict assumption that the conditional distribution $p(x|y)$ is exactly the same across domains. Although the authors tested scenarios with "slight drift," the theoretical guarantees weaken as the feature-label relationship changes.

Additionally, the current method for choosing the regularization parameter $\lambda$ is based primarily on sample size. Future work could explore data-driven, automated methods for selecting $\lambda$, such as cross-validation. The authors also suggest extending this framework to active learning, where the model could strategically request a small number of target labels to drastically improve its weight estimates and overall adaptation performance.

Summary updated

BibTeX
@inproceedings{azizzadenesheli2019regularized,
  author = {Kamyar Azizzadenesheli and Anqi Liu and Fanny Yang and Animashree Anandkumar},
  title = {{Regularized Learning for Domain Adaptation under Label Shifts}},
  booktitle = {International Conference on Learning Representations},
  year = {2019},
}
Figure