Abstract
Standard robust machine learning often fails because it is "over-pessimistic," treating all data features as equally likely to change and resulting in overly conservative models. We propose Stable Adversarial Learning (SAL), which utilizes data from multiple environments to identify "stable" versus "unstable" features. By focusing adversarial defenses specifically on features prone to shifting, SAL provides a more practical uncertainty set. Our experiments across synthetic and real-world datasets, including Colored MNIST and house price regression, demonstrate that SAL significantly outperforms existing robust baselines by maintaining high performance across diverse environments.
1. Introduction
Machine learning models typically assume that training and testing data are independent and identically distributed (i.i.d.). However, in real-world applications, this assumption is frequently violated by distributional shifts. Models often latch onto spurious correlations—such as a background environment—rather than the causal features of interest. When the test distribution changes, these models fail.
Existing approaches like Distributionally Robust Learning (DRL) attempt to minimize the "worst-case" error within a defined uncertainty set. A major drawback of these methods is their tendency toward over-pessimism: by treating all covariates equally, they prepare for unrealistic scenarios where even fundamental, stable features change. This leads to conservative models with poor predictive power. We address this by building a "practical" uncertainty set that selectively perturbs features likely to shift.
2. Stable Adversarial Learning (SAL)
The core innovation of SAL is the construction of an anisotropic uncertainty set within the Wasserstein Distributionally Robust Learning (WDRL) framework.
2.1 Differentiated Covariates
Instead of a uniform perturbation ball, SAL assigns weights ($w$) to different features. Features identified as "unstable" receive lower weights and are perturbed more heavily during training, while "stable" features are protected.
2.2 Leveraging Heterogeneity
SAL exploits data from multiple "environments" (e.g., different time periods or locations). The differences between these environments serve as a signal to identify which features are unreliable.
2.3 Iterative Optimization
The algorithm alternates between two primary steps:
- Model Update: Optimizing model parameters ($\theta$) to minimize worst-case risk given current feature weights.
- Weight Update: Adjusting weights ($w$) to minimize both the average loss across environments and the variance (disparity) of the loss between environments.
Mathematically, this approach results in a more compact uncertainty set that improves generalization by focusing on plausible shifts.
3. Experimental Evaluation
We validated SAL across several benchmarks:
- Simulation Data: Synthetic setups mimicking selection bias and anti-causal effects.
- House Price Regression: Real-world data from King County split into different decades to simulate temporal shifts.
- Adult Income Dataset: Classification task split by demographic attributes.
- Colored MNIST: A benchmark where digit colors are spuriously correlated with labels during training but reversed during testing.
3.1 Results and Discussion
SAL demonstrated superior performance and stability across all tasks. In the Colored MNIST challenge, SAL achieved 57% accuracy, outperforming IRM (51%) and WDRL (48%), while standard Empirical Risk Minimization (ERM) collapsed to 8.5% accuracy.
As shown in Figure 1, SAL maintains the lowest and most consistent RMSE across varying environments. While other methods like ERM show significant performance degradation as environments shift, SAL's error remains stable.
Figure 2 further illustrates that SAL not only achieves the lowest average error but also the lowest variance (indicated by error bars), confirming its "uniformly good performance."
4. Conclusion
SAL addresses the over-pessimism of traditional robust learning by distinguishing between stable and unstable features. By leveraging environmental heterogeneity, it discovers which features are prone to spurious shifts. Future work will explore extending SAL to latent representation levels for high-dimensional data like images, where stability may not reside in raw pixels.
Summary updated