Wasserstein Distance Guided Representation Learning for Domain Adaptation

Jian Shen, Yanru Qu, Weinan Zhang, Yong Yu

Abstract

This paper introduces WDGRL (Wasserstein Distance Guided Representation Learning), a novel framework for domain adaptation that leverages the Wasserstein distance to align feature distributions between source and target domains. By replacing standard binary adversarial classifiers with a "domain critic" and incorporating a gradient penalty, the authors address the vanishing gradient problem common in previous methods. WDGRL demonstrates superior stability and performance across sentiment analysis and image recognition benchmarks, providing a more robust approach to learning domain-invariant representations.

The Challenge of Domain Shift

In machine learning, "domain shift" occurs when a model trained on a source domain (e.g., professional product reviews) is applied to a related but distinct target domain (e.g., casual social media posts). Domain adaptation aims to learn feature representations that are domain-invariant—meaning the model can distinguish between classes (like positive vs. negative sentiment) without being influenced by the specific domain of the data.

Previous state-of-the-art methods, such as Domain-Adversarial Neural Networks (DANN), utilize a binary classifier to distinguish domains. However, if the domains are significantly different, this classifier can become too accurate too quickly, leading to the vanishing gradient problem. In such cases, the feature extractor stops receiving the useful feedback necessary to align the distributions effectively.

Methodology: The WDGRL Framework

The authors propose WDGRL, drawing inspiration from Wasserstein GANs (WGAN). The architecture is composed of three primary components designed to project both domains into a shared latent space.

The WDGRL architecture featuring a Feature Extractor, a standard Discriminator for classification, and a Domain Critic for Wasserstein distance estimation.
  1. Feature Extractor ($f_g$): Maps input data from both domains into a common latent space.
  2. Domain Critic ($f_w$): Instead of a binary classifier, this network estimates the empirical Wasserstein distance (Earth Mover's distance) between the source and target feature distributions.
  3. Discriminator ($f_c$): A standard classifier trained on labeled source features to ensure the learned representations remain discriminative for the primary task.

Gradient Penalty for Stability

To ensure the Wasserstein distance estimation is reliable, the critic must satisfy the 1-Lipschitz continuity condition. WDGRL employs a Gradient Penalty ($\mathcal{L}_{grad}$) rather than traditional weight clipping. This approach penalizes the critic if its gradient magnitudes deviate from 1, providing stable and informative gradients for the feature extractor even when domain distributions are initially far apart.

Experimental Evaluation

The authors evaluated WDGRL on two classic domain adaptation benchmarks:

  • Amazon Review Dataset: A sentiment analysis task involving 12 transfer tasks across four domains: Books, DVDs, Electronics, and Kitchen appliances.
  • Office-Caltech Object Recognition: An image classification task involving 10 categories across four domains: Amazon, Webcam, DSLR, and Caltech.

Results and Visual Analysis

WDGRL consistently outperformed baseline methods such as Maximum Mean Discrepancy (MMD), DANN, and Correlation Alignment (CORAL). On the Amazon Reviews dataset, WDGRL achieved an average accuracy of 82.43%, surpassing DANN's 80.74%. On the Office-Caltech benchmark, it reached an average accuracy of 92.74%, a significant improvement over the 87.67% achieved by DANN.

t-SNE visualizations of learned features, comparing the alignment quality of DANN, MMD, and WDGRL.

As shown in the t-SNE visualizations, WDGRL successfully clusters source and target samples of the same class together much more effectively than competing methods. This visual evidence confirms that the Wasserstein critic provides a superior signal for distribution alignment throughout the training process.

Conclusion

WDGRL offers a theoretically grounded and empirically successful method for domain adaptation. By utilizing the continuous and differentiable nature of the Wasserstein distance, it avoids the saturation issues of traditional cross-entropy losses. While the method requires more computational time due to the inner-loop training of the domain critic, the gains in stability and accuracy make it a powerful tool for cross-domain representation learning. Future work may involve applying WDGRL to more complex image architectures and multi-layer adaptation strategies.

Summary updated

BibTeX
@inproceedings{shen2018wasserstein,
  author = {Jian Shen and Yanru Qu and Weinan Zhang and Yong Yu},
  title = {{Wasserstein Distance Guided Representation Learning for Domain Adaptation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2018},
  doi = {10.1609/aaai.v32i1.11784},
}
Figure