TL;DR
This paper introduces a novel Bayesian approach, MAPLS, to tackle the challenging problem of label shift, where the distribution of labels changes between training and testing data. By leveraging Bayesian inference and an adaptive prior learning mechanism, their method effectively estimates target label distributions, leading to improved classifier performance on large-scale, imbalanced datasets without requiring classifier retraining.
What Problem Does This Paper Address?
In machine learning, models trained on one dataset (source domain) often perform poorly when applied to a different dataset (target domain) due to "distribution shift." One specific type of shift, label shift, occurs when the proportion of different classes changes between the source and target domains, but the relationship between features and labels within each class remains the same (i.e., $P(X|Y)$ is invariant). This is particularly problematic for class-imbalanced datasets, where rare classes might be severely underrepresented in the source domain, leading to poor generalization on the target domain. Existing methods for estimating this label shift often struggle with large-scale datasets, many classes, or highly imbalanced distributions, and typically require retraining the classifier. This paper aims to address these limitations by proposing a robust Bayesian estimation framework that can adapt to various label shift scenarios without retraining.
Methods
The core of the proposed solution lies in a Bayesian framework for estimating the target label distribution, denoted by $\pi$.
- Bayesian Posterior: The authors formulate the problem by constructing a Bayesian posterior distribution for $\pi$, given the observed unlabelled target data ($X$) and a prior distribution over $\pi$. They use a Dirichlet distribution as a prior, which is a natural choice for categorical distribution parameters.
- Maximum A Posteriori (MAP) Estimation (MAPLS): They derive an Expectation-Maximization (EM) algorithm to find the Maximum A Posteriori (MAP) estimate of $\pi$. This algorithm is proven to converge to a unique global optimum.
- Adaptive Prior Learning (APL): A key innovation is the Adaptive Prior Learning (APL) model. This component adaptively learns the parameters of the Dirichlet prior based on the available data. It uses heuristics to estimate model misspecification error and sampling error, adjusting the prior to mitigate these issues. This allows the model to be more robust to imperfect classifiers and finite data.
- Posterior Sampling (PSLS): Beyond a point estimate, the authors also propose using Markov Chain Monte Carlo (MCMC), specifically Hamiltonian Monte Carlo (HMC), to draw samples from the entire posterior distribution of $\pi$. This provides a richer representation of uncertainty and can be used for more sophisticated downstream tasks.
Datasets
The paper evaluates their methods on several large-scale and challenging datasets:
- CIFAR100: A standard dataset with 100 classes.
- ImageNet 2012: A large-scale dataset for image recognition.
- Places2: A dataset focused on scene recognition.
They also utilize Long-Tailed versions of these datasets (ImageNet-LT, Places-LT, CIFAR100-LT), which are specifically designed to mimic real-world scenarios with extreme class imbalance. Additionally, they employ Dirichlet shift (randomly generated target label distributions) and Ordered/Shuffled Long-Tailed test set shifts, which are more challenging than uniform shifts.
Key Insights and Ideas
- Bayesian Approach for Label Shift: Applying a Bayesian framework to label shift estimation is novel. It allows for principled incorporation of prior knowledge and provides a natural way to quantify uncertainty through posterior distributions.
- Adaptive Prior Learning is Crucial: The performance of label shift estimation is sensitive to the choice of prior. The APL model's ability to adapt the prior based on data characteristics (like classifier accuracy and label shift magnitude) significantly improves robustness and accuracy, especially on challenging, imbalanced datasets.
- MAP vs. Posterior Sampling: The paper offers two complementary approaches: MAP estimation for a single best guess of the target distribution and posterior sampling for a more comprehensive understanding of uncertainty, which can be beneficial for downstream tasks like classifier correction.
- Robustness to Classifier Imperfection: The APL model's design explicitly accounts for potential errors in the black-box classifier, making the overall method more resilient to real-world scenarios where classifiers are not perfectly calibrated.
Key Results
- Outperforms SOTA: The proposed MAPLS-APL model consistently outperforms existing state-of-the-art methods (MLLS, BBSE, RLLS) in terms of estimation error (measured by $(w - \hat{w})^2/K$) and Top1 accuracy across various datasets and label shift settings.
- Significant Gains on Imbalanced Data: The improvements are particularly pronounced on large-scale, highly imbalanced datasets like ImageNet-LT and Places-LT, where previous methods often degrade significantly. For instance, on ImageNet-LT, their model shows a substantial margin of improvement.
- Robustness: The paper highlights that their model's performance remains relatively stable even when source domain label distributions are highly imbalanced, unlike other methods that degrade.
- Efficiency: While MCMC sampling (PSLS) is computationally more expensive, the MAP estimation (MAPLS) is efficient and converges well.
Limitations and Future Work
- Computational Cost of MCMC: The paper acknowledges that MCMC sampling can be computationally expensive, especially in high-dimensional spaces. However, they note that their posterior is strictly log-concave, allowing for efficient initialization and sampling.
- Dependence on Black-Box Classifier: While the APL model helps mitigate misspecification errors, the method still relies on a black-box classifier. The performance is inherently limited by the quality of this classifier.
- Future Work: The authors suggest that their framework can be extended to other types of distribution shifts beyond label shift. They also imply that the uncertainty quantification from posterior sampling could be further leveraged for more advanced label shift correction strategies.
Summary updated