Abstract
Empirical Risk Minimization based methods are based on the consistency hypothesis that all data samples are generated i.i.d. However, this hypothesis cannot hold in many real-world applications. Consequently, simply minimizing training loss can lead the model into recklessly absorbing all statistical correlations in the training dataset. It is why a well-trained model may perform unstably in different testing environments. Hence, learning a stable predictor that can simultaneously performs well in all testing environments is important for machine learning tasks. In this work, we study this problem from the perspective of Invariant Risk Minimization. Specifically, we propose a novel Self-supervised Invariant Risk Minimization method based on the fact that the real causality connections between features are consistent no matter how the environment changes. First, we propose a self-supervised invariant representation learning objective function, which aims to learn a stable representation of the consistent causality. Based on that, we further propose a stable predictor training algorithm. This algorithm aims to improve the predictor's stability using the invariant representation learned by using our proposed objective function. We conduct extensive experiments on both synthetic and real-world datasets to show that our proposal outperforms previous state-of-the-art stable learning methods. The code will be released later.
Introduction: The Problem of Model Misspecification
Standard machine learning relies on Empirical Risk Minimization (ERM), which assumes that training and testing data come from the same distribution. However, in real-world scenarios, data is often biased. If a training set mostly contains "bears in forests" and "cows in meadows," an ERM-based model might learn that a green background is the primary indicator of a cow. When it encounters a "cow in a forest" during testing, the model fails because it absorbed statistical correlations rather than true underlying causation.
While Invariant Risk Minimization (IRM) was proposed to solve this, it has a significant loophole: if a spurious correlation exists across all training environments (e.g., all dolphins in the training set are underwater), standard IRM will still treat the "water" feature as a causal signal. This paper introduces Self-supervised Invariant Risk Minimization (SIRM) to close this gap by focusing on feature-to-feature causality.
Methodology
SIRM treats stable learning as a feature "pretreatment" process using a two-pronged objective function designed to isolate stable features from environmental noise.
1. Self-supervised Invariant Representation
The core innovation is a feature rectification matrix ($W$). The goal of this matrix is to learn the internal causality among features. It uses a self-supervised penalty where the model tries to represent one feature dimension using others. Because causal connections between physical features (like a cow's shape) are consistent across environments, while background correlations are not, this helps isolate the "stable" features.
2. Stable Predictor Training
The algorithm follows an iterative process:
- Step A: Optimize the weight matrix $W$ using a self-supervised loss to "rectify" the feature representation.
- Step B: Fix $W$ and optimize the feature extractor and the predictor to minimize prediction error across all training environments.
Unlike previous "sample reweighting" methods, SIRM’s complexity scales with the number of features, not the number of training samples, making it much more efficient for massive datasets.
Experimental Evaluation
The researchers evaluated SIRM on both real-world and synthetic datasets:
- CIFAR-10: To simulate environment shifts, the dataset was partitioned into several sub-sets to mimic changing conditions during training.
- MMADS (Synthetic): This dataset tested three types of causal/correlational relationships ($S \perp V$, $S \to V$, and $S \leftarrow V$, where $S$ are stable features and $V$ are correlational features).
Key Results
- Superior Accuracy: On CIFAR-10, SIRM achieved 95.59% accuracy, outperforming both standard ResNet-50 (94.98%) and the previous state-of-the-art DWR (95.09%).
- Stability: SIRM showed significantly lower Stability Error (SE) across unknown test environments compared to OLS, Lasso, Ridge regression, and DWR.
- Robustness to Sample Size: While the performance of competing methods degraded as the training sample size decreased, SIRM remained remarkably stable, proving its effectiveness even with limited data.
Conclusion
SIRM addresses the fundamental limitations of ERM and IRM by leveraging the invariance of feature-to-feature causality. By using self-supervision to look at internal relationships, SIRM can "see through" persistent biases that fool standard methods. This approach offers a scalable and robust solution for building machine learning models that remain reliable across diverse and unpredictable real-world environments.
Summary updated