Dynamic Weighted Learning for Unsupervised Domain Adaptation

Ni Xiao, Lei Zhang

Introduction

Unsupervised Domain Adaptation (UDA) aims to bridge the gap between a labeled source domain and an unlabeled target domain. Success in UDA typically hinges on two competing objectives: Domain Alignment, which seeks to make source and target feature distributions indistinguishable, and Class Discriminability, which ensures that features remain separable for classification.

However, these objectives often exist in a state of tension. Aggressive domain alignment can lead to "feature collapse," where class boundaries are blurred, while prioritizing discriminability can prevent the domains from aligning effectively. Most existing methods rely on static weighting for these losses, failing to adapt to the evolving needs of the model during training.

The trade-off between domain alignment (MMD) and class discriminability (max J(W)) in existing methods like MCD.

The DWL Framework

To address this "tug-of-war," the authors propose Dynamic Weighted Learning (DWL). This framework introduces a feedback mechanism that monitors the state of alignment and discriminability in real-time to adjust the training objective dynamically.

1. Dynamic Weighting ($\tau$)

DWL employs a dynamic balance factor, $\tau$, to weight the Domain Alignment Loss ($L_{da}$) against the Class Discrimination Loss ($L_{cd}$).

  • Monitoring: The system tracks the Maximum Mean Discrepancy (MMD) to gauge alignment and the Linear Discriminant Analysis (LDA) criterion ($J(W)$) to measure discriminability.
  • Feedback Loop: If alignment is lagging (high MMD), $\tau$ increases to prioritize domain matching. If class boundaries begin to blur (low $J(W)$), $\tau$ decreases to emphasize discriminability. This ensures the model maintains an optimal balance throughout the learning process.

2. Universal Sample Weighting

Beyond the loss trade-off, UDA often suffers from sample imbalance between domains. DWL introduces a weighting scheme where samples are weighted inversely to their domain's proportion in the total dataset. This prevents the optimization process from being dominated by the larger domain, ensuring that information from both source and target is treated with equal importance.

Architecture

The DWL architecture consists of a feature generator ($G$), a domain discriminator ($D$), a main classifier ($C$), and two auxiliary classifiers ($C_1, C_2$).

The DWL architecture, highlighting the dynamic balance factor $\tau$ and the multi-classifier setup.

The feature generator $G$ learns representations that are both domain-invariant (guided by $D$) and class-discriminative (guided by $C, C_1, C_2$). The dynamic factor $\tau$ acts as a meta-learner, adjusting the influence of the domain alignment and class discrimination branches on the fly.

Experimental Results

DWL was evaluated on several competitive UDA benchmarks, consistently achieving state-of-the-art results:

  • VisDA-2017: Achieved 77.1% average accuracy, outperforming previous methods like BSP.
  • Office-31: Reached an average accuracy of 87.1%, showing significant gains in cross-domain tasks like DSLR $\to$ Amazon.
  • Digits: Attained a near-perfect 97.6% average accuracy across MNIST, USPS, and SVHN transfers.

Ablation studies confirmed that both the dynamic $\tau$ weighting and the universal sample weighting are critical to these performance gains. Removing either component resulted in a noticeable drop in accuracy, validating the importance of addressing both the objective trade-off and data imbalance.

Conclusion

Dynamic Weighted Learning redefines the UDA training process as a self-correcting system. By treating domain alignment and class discriminability as dynamic variables rather than static constraints, DWL effectively mitigates negative transfer and provides a robust framework for adapting models to new, unlabeled environments.

Summary updated

Abstract

Unsupervised domain adaptation (UDA) aims to improve the classification performance on an unlabeled target domain by leveraging information from a fully labeled source domain. Recent approaches explore domain-invariant and class-discriminant representations to tackle this task. These methods, however, ignore the interaction between domain alignment learning and class discrimination learning. As a result, the missing or inadequate tradeoff between domain alignment and class discrimination are prone to the problem of negative transfer. In this paper, we propose Dynamic Weighted Learning (DWL) to avoid the discriminability vanishing problem caused by excessive alignment learning and domain misalignment problem caused by excessive discriminant learning. Technically, DWL dynamically weights the learning losses of alignment and discriminability by introducing the degree of alignment and discriminability. Besides, the problem of sample imbalance across domains is first considered in our work, and we solve the problem by weighing the samples to guarantee information balance across domains. Extensive experiments demonstrate that DWL has an excellent performance in several benchmark datasets.
BibTeX
@inproceedings{xiao2021dynamic,
  author = {Ni Xiao and Lei Zhang},
  title = {{Dynamic Weighted Learning for Unsupervised Domain Adaptation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.01499},
}
Figure