Out-of-Domain Robustness via Targeted Augmentations

Irena Gao, Shiori Sagawa, Pang Wei Koh, Tatsunori Hashimoto, Percy Liang · DOI

Abstract

Machine learning models often fail when deployed in environments that differ from their training data due to a phenomenon known as underspecification. When models encounter distribution shifts, they frequently rely on spurious correlations that do not hold in new domains. This paper introduces Targeted Augmentations, a principled approach to improving out-of-domain (OOD) robustness. By selectively randomizing spurious domain-dependent features while preserving robust ones, this method achieves state-of-the-art performance on real-world distribution shifts, outperforming standard generic and domain-invariant methods by significant margins.

1. Introduction

A fundamental challenge in machine learning is the brittleness of models when moved from a training environment to a deployment environment—the problem of Out-of-Domain (OOD) generalization. For instance, a wildlife monitoring model trained on images from a specific set of camera traps may fail when deployed to a new location because it has overfitted to the specific backgrounds or lighting conditions of the original cameras rather than the animals themselves.

This failure is often rooted in underspecification: when the number of training domains is small relative to the complexity of the data, the model cannot distinguish between features that are truly predictive (e.g., the shape of an animal) and those that are merely spuriously correlated with the label in the training set (e.g., a specific rock in the background).

2. The Taxonomy of Features

To address this, the authors propose a four-way decomposition of features to better understand what a model learns:

  • $x_{obj}$ (Domain-independent, label-dependent): Core features like the shape of an animal.
  • $x_{noise}$ (Independent of both): Random elements like sensor noise.
  • $x_{d:robust}$ (Domain-dependent, label-predictive): Features that vary by domain but provide valid context, such as a "savanna" background predicting an elephant.
  • $x_{d:spu}$ (Domain-dependent, spurious): Features that correlate with the label only by chance in the training set, such as a specific timestamp font unique to one camera.

Existing solutions typically fall into two categories: Generic Augmentations (e.g., flips, crops) which do not address domain-specific spuriousness, and Domain-Invariant Augmentations (e.g., IRM, DeepCORAL) which attempt to force the model to ignore all domain-dependent features. The authors argue that domain-invariant methods are too aggressive because they discard $x_{d:robust}$ features—like habitat information—that actually aid in generalization.

3. Targeted Augmentations

The proposed Targeted Augmentation strategy is designed to randomize $x_{d:spu}$ while keeping $x_{d:robust}$ intact. By using a linear regression setting, the authors provide a theoretical foundation proving that when the number of domains is small, unaugmented models suffer from high OOD risk. Targeted augmentations effectively reduce the dimensionality of the problem, allowing the model to generalize even with limited domain complexity.

4. Experimental Evaluation

The authors evaluated their approach on three challenging real-world datasets:

  1. iWildCam2020-WILDS: Species classification across 243 camera traps. The authors used a Copy-Paste (Same Y) augmentation, which pastes animal foregrounds onto backgrounds from different cameras that have seen the same species, thereby preserving habitat context while breaking camera-specific correlations.
  2. Camelyon17-WILDS: Tumor identification in histopathology slides across different hospitals. They applied Stain Color Jitter to randomize hospital-specific staining styles while preserving the underlying cell morphology.
  3. BirdCalls: A newly curated dataset of bird sounds from 9 microphones across diverse regions. They utilized Copy-Paste + Jitter to move bird calls across recordings within the same geographic region, preserving habitat-specific ambient noise.

5. Results and Discussion

Targeted augmentations established new state-of-the-art OOD performances across all benchmarks:

  • iWildCam: OOD Macro F1 improved from 33.3% to 36.5%.
  • Camelyon17: OOD Accuracy increased from 75.3% to 90.5%, a 15.2 percentage point gain.
  • BirdCalls: OOD Macro F1 rose from 31.8% to 37.8%.

Notably, domain-invariant methods often performed worse than simple unaugmented training because they discarded the robust $x_{d:robust}$ features. On iWildCam, targeted augmentations demonstrated "effective robustness," where OOD performance was significantly higher than what would be predicted based solely on in-distribution performance.

6. Conclusion

The success of Targeted Augmentations highlights that OOD failure is often a matter of domain complexity rather than just sample size. While the method currently requires domain expertise to identify which features are robust versus spurious, it provides a powerful framework for building resilient models. Future research will focus on the automated discovery of these features to remove the need for hand-designed augmentations.

Summary updated

BibTeX
@inproceedings{gao2023out,
  author = {Irena Gao and Shiori Sagawa and Pang Wei Koh and Tatsunori Hashimoto and Percy Liang},
  title = {{Out-of-Domain Robustness via Targeted Augmentations}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=4SHQv4cp3I},
}
Figure