Abstract
Unsupervised Domain Adaptation (UDA) aims to transfer knowledge from a labeled source domain to an unlabeled target domain by aligning their feature distributions. However, standard joint optimization of classification and alignment tasks often leads to optimization inconsistency, where alignment objectives may suppress discriminative features. We present MetaAlign, a meta-learning strategy that treats domain alignment as a meta-train task and classification as a meta-test task. By maximizing the inner product of their gradients, MetaAlign ensures that alignment efforts support the primary classification goal. Experimental results across multiple benchmarks, including Office-Home and PACS, demonstrate that MetaAlign consistently improves various UDA baselines and achieves state-of-the-art performance.
Introduction
The core challenge of Unsupervised Domain Adaptation (UDA) lies in bridging the "domain gap" between a labeled source dataset and an unlabeled target dataset. Standard approaches typically employ domain alignment techniques, such as adversarial training or statistical moment matching (e.g., Maximum Mean Discrepancy), to learn domain-invariant features. However, a significant limitation of these methods is the potential for optimization inconsistency. When classification and alignment losses are simply summed, their respective gradients may point in conflicting directions. In such cases, the model might achieve domain alignment by focusing on task-irrelevant background features or by discarding fine-grained details necessary for accurate classification.
Methodology: Gradient Coordination via Meta-Learning
MetaAlign addresses this inconsistency by reframing UDA as a meta-learning problem. Instead of treating alignment and classification as independent objectives, MetaAlign optimizes the model such that a step taken toward domain alignment also benefits the classification task.
Meta-Optimization Framework
Inspired by Model-Agnostic Meta-Learning (MAML), MetaAlign defines domain alignment as the Meta-Train task and object classification as the Meta-Test task. The training process involves a simulated update: the model parameters $\theta$ are updated using the gradient of the domain alignment loss ($L_{dom}$). The performance of this updated model is then evaluated using the classification loss ($L_{cls}$). The final objective is to minimize the classification loss after the alignment update, which mathematically encourages the gradients of both tasks to be positively correlated.
Gradient Consistency and Adaptive Weighting
The meta-objective effectively maximizes the inner product of the gradients $\nabla_\theta L_{dom}$ and $\nabla_\theta L_{cls}$. When these gradients are aligned, the model parameters move in a direction that satisfies both tasks. To further refine this process, MetaAlign introduces Adaptive Layer Weighting ($\beta$). Recognizing that different layers in a deep network (such as ResNet) contribute differently to alignment and classification, the method learns scalar weights for layer groups, adaptively prioritizing coordination where it is most beneficial. To maintain computational efficiency, the authors utilize a first-order approximation of the meta-gradient, mitigating the high cost of second-order derivatives.
Experimental Evaluation
The authors conducted extensive experiments to validate MetaAlign's effectiveness across three distinct scenarios: image classification, object detection, and domain generalization.
Quantitative Results
On the Office-Home dataset, MetaAlign improved the DANN baseline by 3.9% and the state-of-the-art GVB baseline by 0.9%, reaching an average accuracy of 71.3%. Similar gains were observed on Office-31, where it achieved a state-of-the-art 89.2% accuracy. In object detection, MetaAlign facilitated the transition from real-world images (Pascal VOC) to artistic styles (Watercolor2k), boosting the Mean Average Precision (mAP) of the SW-DA baseline from 53.5% to 55.6%. Furthermore, on the PACS domain generalization benchmark, it outperformed existing specialized methods with an average accuracy of 81.9%.
Visual Analysis
Qualitative analysis using Grad-CAM visualizations highlights the impact of gradient coordination. While baseline models often "lazily" align domains by focusing on background elements (e.g., the sky or floor), MetaAlign forces the alignment process to focus on the foreground objects essential for the task.
Conclusion
MetaAlign provides a principled approach to resolving the optimization conflicts inherent in Unsupervised Domain Adaptation. By treating domain alignment as a meta-learning task, it ensures that the pursuit of domain invariance does not come at the expense of discriminative power. Its generic nature allows it to be easily integrated into existing UDA architectures, consistently yielding performance improvements and more interpretable feature representations.
Summary updated