Learning to Learn Single Domain Generalization

Fengchun Qiao, Long Zhao, Xi Peng

Abstract

Standard machine learning models often fail when deployed in environments that differ from their training data. While Domain Adaptation and Domain Generalization offer solutions, they typically require target data or multiple source domains. This paper introduces M-ADA (Meta-Learning based Adversarial Domain Augmentation), a framework for Single Domain Generalization (SDG). M-ADA trains a model on a single source domain to perform robustly across diverse, unseen target domains by synthesizing challenging fictitious domains through adversarial training and a meta-learning objective.

The Challenge of Single Domain Generalization

Most deep learning models assume independent and identically distributed (i.i.d.) training and test data. When this assumption is violated, performance drops significantly. Domain Adaptation (DA) mitigates this by using unlabeled data from the target domain, while Domain Generalization (DG) leverages multiple source domains to learn domain-invariant features.

However, in many real-world scenarios, we only have access to a single source domain. This is known as Single Domain Generalization (SDG). The primary difficulty in SDG is the lack of diversity; a single domain provides insufficient information for a model to distinguish between task-relevant features and domain-specific noise.

Comparison of domain generalization scenarios: (a) Single Domain Generalization (SDG), (b) Multi-source Domain Generalization, and (c) Multi-target Domain Generalization.

M-ADA: Meta-Learning based Adversarial Domain Augmentation

To address the limitations of SDG, the authors propose M-ADA, which combines adversarial data generation with a meta-learning framework.

1. Adversarial Domain Augmentation

Instead of relying on heuristic augmentations (e.g., rotation, color jittering), M-ADA uses adversarial training to generate "fictitious" domains. These synthetic domains are designed to be "hard" for the current model, forcing it to learn more robust representations.

2. Wasserstein Auto-Encoder (WAE) Relaxation

A major risk in adversarial augmentation is losing semantic meaning—transforming an image so much that its label is no longer valid. M-ADA employs a WAE-based "push-pull" strategy:

  • Push: A relaxation loss ($L_{relax}$) pushes augmented samples far from the source distribution in the input space to maximize domain shift.
  • Pull: A constraint loss ($L_{const}$) ensures that these samples remain close to the original class in the embedding space, preserving semantic identity.
Visualization of the adversarial domain augmentation process, where samples are pushed into fictitious domains while maintaining semantic consistency.

3. Meta-Learning Framework

To avoid the computational cost of training separate models for each fictitious domain, M-ADA utilizes a meta-learning scheme. In each iteration, the model "meta-trains" on the source domain and "meta-tests" on the generated fictitious domains. This optimization process teaches the model how to generalize across distribution shifts, rather than just overfitting to the source.

Experimental Evaluation

The authors evaluated M-ADA on three benchmarks:

  • Digits: Generalizing from MNIST to MNIST-M, SVHN, SYN, and USPS. M-ADA achieved 59.49% average accuracy, outperforming the Empirical Risk Minimization (ERM) baseline (49.29%) and the previous state-of-the-art GUD (54.62%).
  • CIFAR-10-C: A robustness test involving 19 corruption types. M-ADA showed superior performance, especially at high corruption levels, beating the baseline by nearly 10% at level 5 severity.
  • SYTHIA: A semantic segmentation task for urban driving. M-ADA demonstrated strong generalization across different weather and lighting conditions.

Efficiency and Adaptability

M-ADA is significantly more efficient than previous ensemble-based methods. Compared to the GUD ensemble, M-ADA uses 7x fewer parameters (4.54M vs. 31.9M) and reduces inference time from 22.1ms to 3.07ms. Furthermore, the meta-learned weights provide an excellent initialization for few-shot adaptation to new domains, requiring as few as 7-10 samples to achieve high performance.

Conclusion

M-ADA provides a powerful and efficient framework for Single Domain Generalization. By mathematically synthesizing worst-case scenarios and optimizing for generalizability via meta-learning, it enables robust performance in unseen environments without the need for target data or multiple source domains.

Summary updated

BibTeX
@inproceedings{qiao2020learning,
  author = {Fengchun Qiao and Long Zhao and Xi Peng},
  title = {{Learning to Learn Single Domain Generalization}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2020},
  doi = {10.1109/cvpr42600.2020.01257},
}
Figure