Adversarial Teacher-Student Representation Learning for Domain Generalization

Fu-En Yang, Yuan-Chia Cheng, Zu-Yun Shiau, Yu-Chiang Frank Wang

Introduction

Most deep learning models operate under the "i.i.d. assumption"—the belief that training and testing data come from the same distribution. In the real world (e.g., autonomous driving in different cities or medical imaging across hospitals), this assumption frequently fails, leading to poor performance due to domain shift.

Domain Generalization (DG) aims to train a model on one or more "source" domains so that it performs well on completely "unseen" target domains. The challenge is that models often overfit to the specific styles of the source data. While previous methods tried to find "domain-invariant" features or used simple image rotations and color jitters, these hand-crafted tricks don't guarantee that the model will handle the specific, complex shifts found in new environments.

To address this, researchers have introduced an Adversarial Teacher-Student (ATS) framework designed to solve DG by synthesizing "plausible but unseen" data distributions. By alternating between a learnable data augmenter that maximizes feature discrepancy and a Teacher-Student distillation process that stabilizes representation learning, the model achieves state-of-the-art performance on major DG benchmarks.

The Adversarial Teacher-Student Framework

The authors propose a two-stage adversarial framework that pits a data augmenter against a Teacher-Student network pair.

The two-stage ATS framework

1. Domain Generalized Representation Learning

In the first stage, a Student network observes augmented images (synthesized styles) while a Teacher network observes the original source images. The Student is trained to minimize the discrepancy between its features and the Teacher's features, effectively "distilling" knowledge.

Crucially, the Teacher is updated via an Exponential Moving Average (EMA) of the Student’s weights. This provides a stable, "smoothed" target that prevents the model from over-correcting to unrealistic or noisy augmentations.

2. Adversarial Novel Domain Augmentation

In the second stage, a Generator (Augmenter) is trained to create new versions of the source images. Its goal is adversarial: it tries to maximize the discrepancy between the Teacher and Student features. It essentially asks, "What style can I create that the current model finds most confusing?"

To ensure the images remain recognizable, the generator is also constrained by a classification loss to preserve the original semantic content (e.g., a "dog" must still look like a "dog" even in a weird new style). By iterating between these stages, the augmenter constantly pushes the boundaries of the model's experience, while the Teacher-Student pair learns to remain robust to those pushes.

Key Insights

  • Learnable vs. Random Augmentation: While random jitters help, a learnable augmenter that specifically targets the model's "blind spots" is significantly more effective at preparing it for unseen domains.
  • The Power of EMA: Using an EMA-updated Teacher is vital. Without it, the model is prone to "collapsing" or becoming unstable when the augmenter produces extreme styles. The Teacher acts as a "steady hand" during training.
  • Plausibility over Perturbation: Unlike previous adversarial methods that just added pixel noise (like adversarial attacks), this method learns to synthesize styles that are "out-of-source yet plausible," mimicking real-world domain shifts like the difference between a sketch and a photo.
  • Single-Source Success: The model performs remarkably well even when trained on only one source domain. This is the "hard mode" of DG, as the model has no other domains to compare against to find "invariance."

Datasets and Key Results

The authors evaluated their method on several standard DG benchmarks, including PACS (Photo, Art, Cartoon, Sketch), Office-Home, and the massive DomainNet dataset (0.6 million images across 345 classes and 6 domains).

  • SOTA Performance: On the PACS dataset (using ResNet-18), the model achieved an average accuracy of 85.3%, outperforming previous data-generation methods like DDAIG (83.1%) and MixStyle (83.7%). On Office-Home, the model reached 66.7% average accuracy, a significant jump over the "DeepAll" baseline of 63.9%.
  • Large-Scale Robustness: On DomainNet, the ATS framework consistently outperformed competitors across both multi-source and single-source settings.
t-SNE visualization comparing DeepAll and ATS

Visualization: As shown in the t-SNE plots above, the ATS features for unseen target domains are much more tightly clustered by category and better aligned with source features than baseline methods (like DeepAll), proving the representations are truly more generalizable.

Limitations and Future Work

While highly effective, the framework has a few limitations:

  • Hyperparameter Sensitivity: The "margin" used in the discrepancy loss serves as a regularization term. While the authors suggest ways to calculate it automatically, it remains a sensitive parameter that might require tuning for new datasets.
  • Computational Overhead: Training an adversarial generator alongside a Teacher-Student pair is more computationally expensive than standard training.
  • Semantic Constraints: The method relies on a pre-trained (and then fixed) classifier to ensure the augmenter doesn't destroy the image's meaning. If the initial classifier is weak, the quality of the "novel domains" might suffer.

For future work, the authors suggest exploring more complex augmentation types beyond style transfer, potentially incorporating geometric or structural transformations to further improve robustness.

Summary updated

BibTeX
@inproceedings{yang2021adversarial,
  author = {Fu-En Yang and Yuan-Chia Cheng and Zu-Yun Shiau and Yu-Chiang Frank Wang},
  title = {{Adversarial Teacher-Student Representation Learning for Domain Generalization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
}
Figure