Semantic-Aware Mixup for Domain Generalization

Chengchao Xu, Xinmei Tian

Introduction

Deep Neural Networks (DNNs) are notoriously brittle when faced with domain shift—a scenario where a model trained on one type of data (e.g., photos) is tested on another (e.g., sketches). This challenge, known as Domain Generalization (DG), remains a significant hurdle for deploying robust AI systems. While data augmentation strategies like "mixup"—which creates new training samples by interpolating between existing ones—have shown promise, they often suffer from a critical flaw: indiscriminate mixing can produce "hard-to-fit" synthetic data that confuses the model rather than helping it.

The Fourier Perspective: Phase vs. Amplitude

Recent advancements in DG leverage the Fourier Transform to decompose images into two components:

  1. Phase Spectrum: Carries the semantic information (the "what" of the image).
  2. Amplitude Spectrum: Carries the style or domain information (the "how" of the image).

Existing Fourier-based methods often mix both components simultaneously across all image pairs. However, the authors of this paper argue that this "one-size-fits-all" approach creates overwhelming changes, leading to synthetic images that are too chaotic for the model to learn from effectively.

Semantic-Aware Mixup (SAM)

To address these limitations, the authors propose Semantic-Aware Mixup (SAM). Instead of uniform mixing, SAM categorizes the relationship between any two images into four distinct scenarios and applies a tailored strategy for each:

  • Intra-domain, Intra-label (Same style, same object): The method mixes phase only to create semantic variety within a consistent domain.
  • Intra-domain, Inter-label (Same style, different object): The method mixes phase only to sharpen the classification boundaries between different objects in the same style.
  • Inter-domain, Intra-label (Different style, same object): The method mixes both amplitude and phase. This encourages the model to recognize the same semantic object across varying styles.
  • Inter-domain, Inter-label (Different style, different object): The method mixes amplitude only. By avoiding phase mixing in this scenario, SAM prevents the creation of "semantic chaos" that typically arises when trying to blend unrelated objects from unrelated domains.

Consistency Regularization

To further stabilize the learning process, SAM incorporates Consistency Regularization. The framework utilizes a "teacher" model—maintained as an exponential moving average (EMA) of the training model—to provide stable targets. The model is then forced to maintain consistent predictions across both original and augmented images using Kullback-Leibler (KL) divergence, ensuring that the synthetic data reinforces rather than disrupts the learned features.

Experimental Results

The authors evaluated SAM against several state-of-the-art (SOTA) methods on three major Domain Generalization benchmarks:

PACS

On the PACS dataset (Art, Cartoon, Photo, Sketch), SAM achieved an average accuracy of 88.55%, surpassing the previous SOTA (FACT) at 87.88%. Notably, SAM showed significant performance gains in the "Sketch" domain, which is widely considered the most difficult domain for generalization.

OfficeHome

In the OfficeHome benchmark (Art, Clipart, Product, Real-World), SAM reached 66.75% average accuracy. It demonstrated particularly strong improvements in the "Clipart" domain, showcasing its ability to handle diverse artistic styles.

Digits-DG

For digit recognition across MNIST, MNIST-M, SVHN, and Synthetic digits, SAM achieved 82.1% average accuracy. It significantly outperformed competing methods on the SVHN (Street View House Numbers) dataset, which is often challenging due to its complex backgrounds.

Conclusion

Semantic-Aware Mixup (SAM) demonstrates that the key to effective data augmentation in Domain Generalization is not just how much we mix, but what we mix. By respecting the relationship between samples and selectively interpolating Fourier components, SAM avoids the pitfalls of "hard-to-fit" data. While the method currently relies on the Fourier assumption that phase and amplitude map cleanly to semantics and style, its success across multiple benchmarks suggests a robust path forward for building more generalizable deep learning models.

Summary updated

BibTeX
@inproceedings{xu2023semantic,
  author = {Chengchao Xu and Xinmei Tian},
  title = {{Semantic-Aware Mixup for Domain Generalization}},
  booktitle = {IJCNN},
  year = {2023},
  url = {https://openreview.net/forum?id=IRlLIJ5UUk},
}
Figure