TL;DR
Deep neural networks often learn spurious correlations, like relying on image backgrounds, leading to poor performance in real-world scenarios. This paper introduces Causal Feature Alignment (CFA), a method that uses minimal foreground segmentation to train models to focus on causal features, significantly improving robustness and out-of-domain generalization.
What Problem Does This Paper Address?
Deep learning models, despite achieving impressive accuracy on benchmark datasets, suffer from a critical vulnerability: they often learn to rely on "spurious correlations." These are features that happen to be correlated with the target variable in the training data but are not causally related. A prime example is an image classifier learning to associate a specific background (e.g., a chest tube in the background of an X-ray) with a disease, rather than the actual clinical indicators. This leads to catastrophic failures when the model encounters real-world data where these spurious correlations don't hold, particularly in safety-critical applications like healthcare. Existing methods to combat this often require extensive group labels or domain information, which are not always available or practical. This paper tackles the problem of spurious correlations, specifically when they manifest as background features, by proposing a method that requires minimal, easily obtainable annotations.
Methods
The proposed method, Causal Feature Alignment (CFA), is a two-stage algorithm.
Stage 1: ERM Training: This is a standard supervised learning step where a deep neural network is trained using Empirical Risk Minimization (ERM) on the entire dataset. This initial training allows the model to learn both causal and spurious features.
Stage 2: Causal Feature Alignment: This stage focuses on teaching the model to ignore spurious features. It uses a small subset of the training data for which foreground segmentations are obtained. These segmentations are generated using a foundation model (Segment Anything - SAM) and refined with human review, significantly reducing annotation burden. The key idea is to train the feature extractor to produce representations that are invariant to background variations. This is achieved by minimizing two loss functions:
- Alignment Loss: A cosine loss that encourages the representations of original images to match the representations of foreground-only images (derived from the segmentations).
- Classification Loss: A cross-entropy loss that ensures the model's discriminative ability on the original images is maintained.
Crucially, the classifier is kept frozen during this stage, leveraging its prior training on the ERM model. The method does not require explicit group labels or domain information.
Datasets
The paper evaluates CFA on several datasets:
- Colored MNIST: A binarized version of the semi-synthetic dataset where digits "1" and "5" are correlated with red and green backgrounds, respectively. The test set breaks this correlation.
- ImageNet Backgrounds Challenge: A subset of ImageNet with 9 coarse-grain classes, featuring variations like "Original," "fg-only" (foreground only), and "Mixed-rand" (random backgrounds) to specifically test background reliance.
- Waterbirds Dataset: A benchmark dataset where bird type (waterbird/landbird) is confounded with background (water/land). This dataset has imbalanced group distributions, making it challenging for worst-group accuracy.
- Novel Challenging Dataset: A new test dataset created by the authors with novel backgrounds (mountains, dams) to specifically test out-of-domain generalization capabilities.
Key Insights and Ideas
- Backgrounds as a Common Spurious Feature: The paper highlights that backgrounds are a frequent source of spurious correlations in computer vision tasks, and addressing this specific manifestation can yield significant improvements.
- Minimal Supervision is Sufficient: CFA demonstrates that a small amount of foreground segmentation data is enough to effectively train models to ignore spurious background features, drastically reducing annotation effort compared to methods requiring extensive group labels.
- Human Review as an Efficient Annotation Strategy: By combining a foundation model (SAM) with human review, the annotation process for segmentations becomes a "review task" rather than a full pixel-wise annotation, making it more practical.
- Robustness to Unseen Backgrounds: CFA shows remarkable generalization capabilities, maintaining performance on novel, unseen backgrounds, unlike group-based methods that struggle with out-of-domain shifts.
- Causal Features are Key to Robustness: The core idea is that by forcing models to learn from causal features (foreground), they become inherently more robust to variations in spurious features (background).
Key Results
- Colored MNIST: CFA achieved an impressive 99.2% accuracy on an out-of-domain test set where the spurious background correlation was broken, significantly outperforming previous methods.
- ImageNet Backgrounds Challenge: CFA improved accuracy on the "mixed-rand" subset (where background reliance is high) from 72.2% to 77.8% (CFA-Min) and 78.4% (CFA-BB), demonstrating its ability to ignore spurious backgrounds.
- Waterbirds Dataset: CFA achieved state-of-the-art worst-group accuracy of 93.02% (CFA-BB) and 92.62% (CFA-Min), significantly outperforming existing methods like Group-DRO and DFR.
- Novel Challenging Dataset: CFA maintained high accuracy (93%) on a new test set with unseen backgrounds, while group-based methods like DFR saw a significant drop from 92% to 84%.
- Segmentation Granularity: The paper shows that performance increases significantly with the percentage of segmented samples up to 20%, after which it saturates, indicating that a small amount of causal localization is sufficient.
Limitations and Future Work
- Spatial Disjointness Assumption: The current method is limited to spurious features that are spatially disjoint from the causal features (e.g., background vs. foreground). Other types of spurious features, like brightness or saturation variations, are not directly addressed.
- Future Work: The authors suggest the need to develop methods for other manifestations of spurious features that require even lower cognitive input from humans. They also highlight the importance of extending these causal approaches to address a wider range of real-world AI challenges.
Summary updated