Cross-Domain Feature Augmentation for Domain Generalization

Yingnan Liu, Yingtian Zou, Rui Qiao, Fusheng Liu, Mong-Li Lee, Wynne Hsu

Abstract

Domain generalization (DG) aims to develop models that are robust to distribution shifts. Existing methods focus on learning invariance across domains to enhance model robustness, often using data augmentation in the input space. However, input-space augmentation offers limited diversity compared to feature-space augmentation. This paper introduces XDomainMix, a novel feature augmentation method that decomposes features into class-generic, class-specific, domain-generic, and domain-specific components. By leveraging these semantic decompositions, XDomainMix increases sample diversity while emphasizing the learning of invariant representations. Experiments on benchmark datasets demonstrate that XDomainMix achieves state-of-the-art performance, with quantitative analysis indicating the learning of effective, domain-invariant models.

The Challenge of Distribution Shift

Deep learning models are notoriously brittle when faced with distribution shifts—for example, a model trained to recognize cows in green pastures might fail to identify a cow on a sandy beach. This is the core challenge of Domain Generalization: training a model on a few "source" domains (e.g., sketches and photos) so that it performs well on an "unseen" target domain (e.g., oil paintings).

Examples of domain shifts in the PACS dataset, featuring sketch, cartoon, and photo styles.

Existing solutions often use data augmentation to create variety. However, augmenting the input space (like flipping or rotating images) offers limited diversity. Augmenting the feature space—the internal representations inside the model—is more powerful, but current methods like MixStyle or DSU only shuffle global statistics. They fail to consider feature semantics, often producing augmented features that are too similar to the originals to teach true invariance.

XDomainMix: Semantic Feature Augmentation

XDomainMix operates on the principle that features are a mix of four semantic components:

  1. Class-specific, Domain-specific ($Z_{c,d}$): Features unique to both the object and the environment (e.g., the specific texture of a horse's fur in a sunny photo).
  2. Class-specific, Domain-generic ($Z_{c,\neg d}$): The "core" features of an object (e.g., the shape of a horse).
  3. Class-generic, Domain-specific ($Z_{\neg c,d}$): Environmental noise (e.g., the grass in the background).
  4. Class-generic, Domain-generic ($Z_{\neg c,\neg d}$): Low-level patterns common to everything.

Importance Scores and Augmentation Strategy

To identify these components, XDomainMix uses gradient-based importance scores. If a feature dimension's value significantly changes the prediction of the class label, it is deemed "class-specific." If it significantly changes the prediction of the source domain, it is "domain-specific."

Once decomposed, the method performs two main actions:

  • Cross-Domain Mixing: It takes the domain-specific parts of a feature and mixes them with domain-specific parts from other samples. Crucially, it mixes $Z_{c,d}$ with a sample of the same class but a different domain.
  • Probabilistic Discarding: It randomly drops the $Z_{c,d}$ component entirely. This forces the classifier to stop relying on domain-specific "shortcuts" and focus on the domain-invariant $Z_{c,\neg d}$ features.

Experimental Evaluation

The authors evaluated XDomainMix on five rigorous DG benchmarks, including PACS (Photos, Art, Cartoons, Sketches), DomainNet, and Camelyon17 (medical imaging). These datasets represent a wide range of distribution shifts, from stylistic changes to environmental noise.

Visual variations across domains that challenge standard deep learning models and necessitate robust feature augmentation.

Key Results and Insights

XDomainMix achieved State-of-the-Art (SOTA) performance across all tested datasets. On the difficult Camelyon17 medical dataset, it reached 80.9% accuracy, significantly outperforming the baseline ERM (70.3%) and previous leaders like LISA (77.1%).

Key insights from the study include:

  • Semantics Matter: Targeting specific "noisy" dimensions leads to better generalization than treating all feature dimensions as equal.
  • Diversity via Decomposition: By swapping only domain-specific components, the model sees "the same object in a completely different context" more effectively than global statistical shifts.
  • Enhanced Invariance: Quantitative analysis showed that XDomainMix produced the lowest "covariance distance" between representations of the same class across different domains, meaning the model's internal "idea" of a category became much more consistent.

Conclusion

By leveraging semantic decomposition in the feature space, XDomainMix provides a powerful framework for learning robust, domain-invariant representations. This approach ensures that models focus on the core attributes of a class rather than the transient styles or environmental shortcuts of the training data, paving the way for more reliable AI in real-world, shifting environments.

Summary updated

BibTeX
@inproceedings{liu2024cross,
  author = {Yingnan Liu and Yingtian Zou and Rui Qiao and Fusheng Liu and Mong-Li Lee and Wynne Hsu},
  title = {{Cross-Domain Feature Augmentation for Domain Generalization}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2024},
  url = {https://openreview.net/forum?id=IxeDNbsaLW},
}
Figure