Domain Generalization by Rejecting Extreme Augmentations

Masih Aminbeidokhti, Fidel A. Guerrero-Peña, Heitor Rapela Medeiros, Thomas Dubail, Eric Granger, Marco Pedersoli

Abstract

Data augmentation is a cornerstone of robust model training, yet "extreme" transformations often compromise semantic integrity, leading to performance degradation. We present DCAug (Domain Generalization by Rejecting Extreme Augmentations), a novel framework that pushes the boundaries of augmentation by utilizing a rejection mechanism to filter out overly chaotic transformations. By balancing diversity (model difficulty) and consistency (semantic preservation via a teacher model), DCAug identifies a "Goldilocks Zone" of augmentation that maximizes generalization without introducing semantic noise. Our method achieves state-of-the-art results across five standard benchmarks, reaching an average accuracy of 67.0%.

Introduction

In machine learning, the assumption that training and test data are independent and identically distributed (i.i.d.) rarely holds in real-world scenarios. A model trained on high-quality photographs may fail when encountering sketches or stylized artistic renderings of the same objects. This challenge, known as Domain Generalization (DG), requires models to learn features that are invariant across disparate domains.

While data augmentation (e.g., flipping, cropping, color-shifting) is a standard technique to improve robustness, conventional "weak" augmentations often fail to bridge the gap between vastly different domains. Conversely, "extreme" augmentations can be counterproductive, resulting in "semantic garbage"—images where the original class is no longer recognizable. This work addresses the critical question: how can we leverage aggressive augmentations to improve generalization while safeguarding the learning process?

Methodology: DCAug

The proposed DCAug framework introduces a dynamic selection process during training. For each input image $x$, the system generates two candidates: a "weak" (safe) augmentation and a "wider" (potentially extreme) augmentation.

The DCAug training procedure selects between weak and wider augmentations based on a reward function $R$ that balances diversity and consistency.

The selection is determined by a Reward Function ($R$) that balances two competing objectives:

  1. Diversity ($R_{div}$): Encourages challenging augmentations. It is measured by the classification loss of the current model; higher loss indicates higher diversity.
  2. Consistency ($R_{con}$): Ensures semantic preservation. This is measured using a "Teacher" model—an Exponential Moving Average (EMA) of the model's weights. A low teacher loss indicates the image remains semantically valid.

The reward is calculated as $R = (1 - \lambda) R_{div} - \lambda R_{con}$. If the "wider" augmentation yields a higher reward than the "weak" version, it is accepted for the training step; otherwise, the model reverts to the safer augmentation.

Experimental Evaluation

The researchers evaluated DCAug across five standard DG benchmarks: PACS, VLCS, OfficeHome, TerraIncognita, and the large-scale DomainNet.

Key Results

The advanced variant, TeachDCAug, established a new state-of-the-art (SOTA) performance:

  • Cross-Dataset Accuracy: Achieved an average accuracy of 67.0% across all benchmarks, significantly outperforming the Empirical Risk Minimization (ERM) baseline of 64.2%.
  • Large-Scale Robustness: On DomainNet, the method reached 46.4% accuracy, demonstrating scalability to complex, high-class-count datasets.
Diversity vs. Consistency trade-off for various augmentation methods across in-domain and out-of-domain scenarios.

As shown in the visualization above, DCAug variants (stars and diamonds) achieve a superior balance between diversity and consistency compared to standard baselines like TrivialAugment (TA) or ERM. While TA (Wider) provides high diversity at the cost of consistency, and ERM provides high consistency with minimal diversity, DCAug successfully navigates the "Goldilocks Zone."

Discussion and Insights

A core finding of this research is that the model's "appetite" for extreme augmentation is domain-dependent. For domains far from the pre-training distribution (e.g., Sketch), the model benefits from and accepts more aggressive transformations than it does for standard photographic data. This dynamic adaptation allows DCAug to outperform static augmentation strategies.

Conclusion

DCAug provides a simple yet effective modification to the data pipeline that yields significant gains in domain generalization. By rejecting "semantic garbage" while embracing challenging transformations, it allows models to learn more robust, domain-invariant features. Future work may extend this rejection-based augmentation strategy to more complex tasks such as object detection and semantic segmentation where spatial consistency is even more critical.

Summary updated

BibTeX
@inproceedings{aminbeidokhti2024domain,
  author = {Masih Aminbeidokhti and Fidel A. Guerrero-Peña and Heitor Rapela Medeiros and Thomas Dubail and Eric Granger and Marco Pedersoli},
  title = {{Domain Generalization by Rejecting Extreme Augmentations}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2024},
  doi = {10.1109/wacv57701.2024.00221},
}
Figure