Abstract
We consider the problem of unsupervised domain adaptation (UDA) between a source and a target domain under conditional and label shift a.k.a Generalized Target Shift (GeTarS). Unlike simpler UDA settings, few works have addressed this challenging problem. Recent approaches learn domain-invariant representations, yet they have practical limitations and rely on strong assumptions that may not hold in practice. In this paper, we explore a novel and general approach to align pretrained representations, which circumvents existing drawbacks. Instead of constraining representation invariance, it learns an optimal transport map, implemented as a NN, which maps source representations onto target ones. Our approach is flexible and scalable, it preserves the problem's structure and it has strong theoretical guarantees under mild assumptions. In particular, our solution is unique, matches conditional distributions across domains, recovers target proportions and explicitly controls the target generalization risk. Through an exhaustive comparison on several datasets, we challenge the state-of-the-art in GeTarS.
Introduction
Unsupervised Domain Adaptation (UDA) is a critical task in machine learning, aiming to leverage labeled data from a source domain to train models for an unlabeled target domain. While many UDA methods focus on covariate shift—where only the input distribution $p(X)$ varies—real-world scenarios often involve Generalized Target Shift (GeTarS). In GeTarS, both the conditional distribution $p(X|Y)$ (conditional shift) and the label distribution $p(Y)$ (label shift) differ between domains.
Standard UDA techniques often rely on learning "domain-invariant representations" to align distributions. However, this paradigm faces significant hurdles: adversarial training can be unstable, it may discard discriminative information necessary for classification, and it often relies on restrictive assumptions. This paper introduces OSTAR (Optimal Sample Transformation and Reweight), a framework that shifts away from invariance toward explicit distribution mapping.
Methodology: The OSTAR Framework
OSTAR addresses GeTarS by learning a neural network to transform source representations into target ones using Optimal Transport (OT). Instead of forcing features into a domain-agnostic bottleneck, OSTAR preserves the inherent structure of the data.
The framework consists of three main components optimized jointly:
- Optimal Transport Mapping ($\phi$): A Residual Neural Network acts as a transport map, shifting source features in the latent space to match the target distribution.
- Importance Reweighting: The model estimates target label proportions ($p_N^Y$) to account for label shift, reweighting source samples accordingly.
- Target Classifier ($f_N$): A classifier is trained on these transformed and reweighted source samples to generalize to the target domain.
Additionally, an Information Maximization (IM) step can be included to refine the classifier by encouraging confident and diverse predictions on unlabeled target data. This is particularly useful when the initial source-trained encoder is not perfectly aligned with the target task.
Experimental Evaluation
The authors evaluated OSTAR on four major UDA benchmarks: Digits (MNIST $\leftrightarrow$ USPS), VisDA12, Office31, and OfficeHome. To simulate GeTarS, these datasets were subsampled to introduce significant label imbalance.
Key Results
As shown in the results table, OSTAR+IM consistently outperforms state-of-the-art baselines:
- Digits: Achieved 96.69% balanced accuracy, significantly higher than the previous best of 93.22% (IW-WD).
- VisDA12: On the synthetic-to-real task, it reached 59.24%, a notable improvement over standard adversarial methods like DANN (53.72%).
- OfficeHome: OSTAR+IM reached 59.51%, surpassing other GeTarS-specific methods.
- Oracle Comparison: Remarkably, OSTAR+IM often outperformed "DI-Oracle," a model provided with ground-truth target label proportions, highlighting the robustness of its mapping approach.
Discussion and Conclusion
The primary insight of OSTAR is that domain adaptation does not strictly require hiding domain-specific information. By explicitly mapping distributions, the model preserves the discriminative "shape" of the data. Implementing the OT map as a neural network ensures scalability and stability, avoiding the pitfalls of adversarial alignment.
While OSTAR is highly effective, it remains dependent on the quality of the initial pretrained encoder. If the encoder fails to capture features relevant to the target task, the mapping cannot fully compensate. Future work may explore extending this framework to "open-set" adaptation, where the source and target domains do not share identical class sets. Overall, OSTAR provides a principled and scalable solution for the challenging GeTarS problem in unsupervised domain adaptation.
Summary updated