Spuriosity Didn’t Kill the Classifier: Using Invariant Predictions to Harness Spurious Features

Cian Eastwood, Shashank Singh, Andrei Liviu Nicolicioiu, Marin Vlastelica, Julius von Kügelgen, Bernhard Schölkopf

Introduction

Machine learning models often rely on "spurious correlations"—statistical patterns that hold in the training data but fail in new environments. A classic example is identifying a cow based on a green grass background. Standard approaches to Out-of-Distribution (OOD) generalization typically involve identifying "invariant" features (e.g., the shape of the cow) and discarding everything else. However, this often leads to sub-optimal performance because spurious features can be highly informative within a specific domain. This paper introduces Stable Feature Boosting (SFB), a framework designed to harness informative but unstable features rather than discarding them.

The challenge of spurious correlations: (a) ColorMNIST setup, (b) performance gap between invariant and optimal models, and (c) the assumed feature structure.

Stable Feature Boosting (SFB)

SFB operates in a two-stage process to bridge the gap between robustness and performance:

  1. Training Phase: The model learns to decompose features into two groups: stable (invariant across training domains) and unstable (spurious but complementary). It uses a specific objective function to ensure these sets of features don't share redundant information, a condition termed complementarity.
  2. Test-Time Adaptation: In a new, unlabeled domain, SFB uses the stable predictor as an "anchor" to generate pseudo-labels. Crucially, it avoids the pitfalls of noisy pseudo-labels by employing a bias-correction procedure. This allows the model to mathematically recover the true relationship between unstable features and actual labels in the new environment.

Theoretical Insights

The core innovation lies in framing the challenge as a "marginal problem" from probability theory—reconstructing a joint distribution from its marginals. The authors prove that an "unstable" student model, trained on the noisy pseudo-labels of a "stable" teacher, can actually become more accurate than the teacher itself once the bias is corrected. This represents a paradigm shift: instead of seeking a single universal model, we should seek a "tunable" model that uses stable features to learn the local rules of a new environment.

Comparative Analysis

SFB fills a unique gap in current research. Unlike Invariant Risk Minimization (IRM), which discards unstable features, or Domain Adaptation methods like DARE, which require test-domain labels, SFB utilizes all informative components while remaining robust and unsupervised at test time.

Comparison of SFB with existing OOD generalization and domain adaptation methods.

Experimental Results

The authors validated SFB across several benchmarks, demonstrating its ability to achieve near-oracle performance:

  • ColorMNIST (CMNIST): SFB achieved 88.1% accuracy, significantly outperforming IRM (69.7%) and approaching the Oracle performance (89.9%) that has access to true test labels.
  • PACS: SFB provided a consistent performance boost through unsupervised adaptation, performing best or joint-best on 3 out of 4 domains.
  • Camelyon17: On real-world medical imaging, SFB maintained high accuracy (90.3%) and reduced variance across different hospital domains, suggesting it can handle the complexities of real-world data shifts.

Conclusion and Future Work

SFB demonstrates that spurious features are not inherently harmful if they can be properly re-calibrated. By using stable features to anchor the adaptation of unstable ones, SFB achieves high performance without sacrificing robustness. Future work will focus on relaxing the "complementarity" assumption and improving the calibration of the initial stable predictor to make the system even more resilient.

Summary updated

BibTeX
@inproceedings{eastwood2023spuriosity,
  author = {Cian Eastwood and Shashank Singh and Andrei Liviu Nicolicioiu and Marin Vlastelica and Julius von Kügelgen and Bernhard Schölkopf},
  title = {{Spuriosity Didn’t Kill the Classifier: Using Invariant Predictions to Harness Spurious Features}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=Cc2fjBBlBD},
}
Figure