Dynamic Weighted Learning for Unsupervised Domain Adaptation

Ni Xiao, Lei Zhang

TL;DR

This paper introduces Dynamic Weighted Learning (DWL), a novel approach for Unsupervised Domain Adaptation (UDA) that dynamically balances domain alignment and class discriminability during training. By adaptively adjusting the weights of these two crucial learning objectives based on their real-time performance, DWL effectively mitigates issues like discriminability vanishing and domain misalignment, leading to improved performance across various datasets.

What Problem Does This Paper Address?

Unsupervised Domain Adaptation (UDA) is a critical problem in machine learning where we aim to leverage knowledge from a labeled source domain to improve performance on a related but unlabeled target domain. A key challenge in UDA is bridging the "domain gap" – the difference in data distributions between the source and target domains. Many existing UDA methods focus on learning domain-invariant representations (domain alignment) and/or class-discriminative representations (class discrimination). However, these two objectives often work against each other. Excessive focus on domain alignment can lead to a loss of class discriminability, making it hard to distinguish between classes. Conversely, prioritizing class discrimination too much can result in domain misalignment, where the model fails to generalize to the target domain. This paper addresses the crucial need for a balanced and adaptive approach to these two competing objectives, as well as the issue of imbalanced sample sizes between domains, which can bias the training process.

Methods

The core of the proposed Dynamic Weighted Learning (DWL) method lies in its adaptive weighting strategy. DWL introduces a dynamic balance factor, denoted by $\tau$, that controls the trade-off between the domain alignment loss and the class discrimination loss. This factor is not fixed but is computed in real-time during training by monitoring the current degrees of domain alignment and class discriminability.

  1. Dynamic Weighting: The paper uses Maximum Mean Discrepancy (MMD) to measure domain alignment and Linear Discriminant Analysis (LDA) to measure class discriminability. These metrics are normalized to a [0, 1] range. The balance factor $\tau$ is then calculated based on these normalized values, ensuring that if domain alignment is poor, its weight increases, and vice-versa for class discriminability. This dynamic adjustment aims to prevent either objective from dominating and negatively impacting the other.
  2. Sample Weighting: To address the problem of imbalanced sample sizes between the source and target domains, DWL employs a sample weighting mechanism. Samples from each domain are weighted inversely proportional to their proportion in the total dataset. This helps to prevent the model from being biased towards the domain with a larger number of samples, promoting a more balanced learning process.
  3. Class Discrimination Loss: The paper builds upon existing methods like Maximum Classifier Discrepancy (MCD) for class discrimination. It uses three classifiers: two auxiliary classifiers ($C_1, C_2$) trained to detect target samples that are difficult to classify based on source domain support vectors, and a main classifier ($C$) positioned between them to enhance feature separation.

The overall training objective combines the standard cross-entropy loss for the source domain, the domain alignment loss (implemented adversarially), and the class discrimination loss, all modulated by the dynamic balance factor $\tau$.

Datasets

The proposed method was evaluated on several standard UDA benchmarks:

  • VisDA-2017: A synthetic-to-real image dataset with synthetic images as the source and real images as the target.
  • Digits Datasets: Adaptation tasks between MNIST, USPS, and SVHN datasets.
  • Office-31: A dataset with three domains (Amazon, DSLR, Webcam) used for various transfer tasks.
  • ImageCLEF-DA: A dataset with 12 classes shared across three domains (Caltech256, ImageNet, Pascal VOC 2012).

Key Insights and Ideas

  • The Interplay of Alignment and Discriminability: The paper strongly emphasizes that domain alignment and class discriminability are not independent goals but are intricately linked and can negatively impact each other if not managed carefully. This insight is the foundation for the dynamic weighting approach.
  • Dynamic Balancing as a Universal Solution: The dynamic weighting mechanism is presented as a flexible approach that can be integrated into various existing UDA methods, making it a broadly applicable technique.
  • Sample Imbalance is a Real Problem: The paper highlights that sample imbalance between domains is a significant issue that can lead to model bias and negative transfer, a problem often overlooked. Their proposed sample weighting offers a simple yet effective solution.
  • Real-time Monitoring is Key: The effectiveness of DWL relies on continuously monitoring the alignment and discriminability metrics during training, allowing for immediate adjustments to the learning process.

Key Results

DWL demonstrated strong performance across the evaluated datasets:

  • VisDA-2017: Achieved an average accuracy of 77.1%, outperforming the baseline BSP (75.9%).
  • Digits Datasets: Achieved high accuracies of 97.3% and 97.4% on USPS→MNIST and MNIST→USPS, respectively, outperforming methods like CAT and MCD.
  • Office-31: Achieved an average accuracy of 87.1%, outperforming ETD (86.2%) on challenging transfer tasks.
  • ImageCLEF-DA: Achieved an average accuracy of 90.5%, outperforming ETD (89.7%).

Qualitative results, such as t-SNE visualizations of feature spaces, showed that DWL effectively clusters source and target domain samples with clear boundaries, indicating good alignment and discriminability. Convergence analysis also showed that the classification error and the balance factor $\tau$ converge to stable values.

Limitations and Future Work

  • Limitations: The paper acknowledges that while their dynamic weighting is effective, the specific choice of MMD and LDA as metrics for alignment and discriminability might be further explored. The paper also implicitly suggests that the effectiveness of the dynamic weighting is dependent on the quality of these chosen metrics.
  • Future Work: The authors suggest that their dynamic learning idea is scalable and can be integrated into other UDA methods to enhance their universality and performance. Further research could explore different metrics for alignment and discriminability or investigate more sophisticated ways to combine them. The paper also implies that the method's adaptability to various feature types and sample sizes makes it a promising direction for future UDA research.

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