TL;DR
This paper introduces two novel data augmentation techniques—Counterfactual and Factual generation—designed to break spurious correlations in image classification. By leveraging human-provided bounding boxes to intelligently manipulate foregrounds and backgrounds, the authors produce models that are significantly more robust to distribution shifts and more focused on truly causal features.
What Problem Does This Paper Address?
Machine learning models are notorious for "shortcut learning." Instead of learning the actual object (the causal feature), they often rely on spurious correlations, such as the background (non-causal features). For example, a model might classify a bird as a "waterbird" simply because there is water in the background, rather than recognizing the bird's physical characteristics.
When these models are deployed in new environments where those correlations break (e.g., a waterbird on dry land), their performance plummets. This paper tackles the challenge of making models robust to these "background shifts" by incorporating human causal knowledge into the training process.
Methods
The authors propose two primary data generation processes based on human annotations (like bounding boxes):
- Counterfactual (CF) Generation: This asks, "How can we modify the image so it's no longer labeled as the target class?" The method removes the causal foreground (the object) and "inpaints" the area to match the background. The model is then trained to not predict the original label for these images.
- Factual (F) Generation: This asks, "How can we change the non-causal features while keeping the label the same?" Here, the foreground is kept, but the background is perturbed (e.g., shuffled, replaced with random noise, or swapped with a background from a different class). This teaches the model to be invariant to background changes.
The authors experimented with several "infilling" values for these regions, ranging from simple grey blocks and random noise to sophisticated generative models like CAGAN (Contextual Attention GAN).
Datasets
The methods were evaluated on three distinct types of datasets:
- IN-9 (ImageNet-9): A synthetic benchmark specifically designed to disentangle foregrounds and backgrounds by swapping them in controlled ways (e.g., "Mixed-Next" where the background is from a different class).
- Waterbirds: A popular dataset for studying spurious correlations, where waterbirds mostly appear on water and landbirds on land in the training set, but these pairings are swapped in the "Flip" test set.
- Caltech Camera Trap (CCT): A real-world dataset of animals captured by motion-triggered cameras. It features "cis-locations" (seen during training) and "trans-locations" (unseen backgrounds), providing a realistic test for robustness.
Key Insights and Ideas
- Invariance vs. Negation: Factual augmentation helps the model ignore the background (invariance), while Counterfactual augmentation helps the model understand that the background alone is insufficient for a classification (negation).
- The Saliency-Accuracy Gap: The authors found that while their methods successfully forced models to "look" at the foreground (measured by Saliency AUPR), looking at the right place doesn't always guarantee a correct prediction. There is a nuanced correlation between saliency focus and accuracy, especially when backgrounds are misleading.
- Synergy with Regularization: Combining these data-driven augmentations with Saliency Regularization (which penalizes the model for looking at the background) often yielded the best results, suggesting that data and loss-based constraints provide complementary benefits.
Key Results
- Waterbirds: The combined method (CF + F + Sal) achieved a 19% relative improvement in accuracy on the difficult "Flip" test set compared to the baseline model.
- IN-9: On the "Mixed-Next" test set (where backgrounds are intentionally misleading), the proposed augmentations significantly outperformed standard models and other baselines like Mix-up and Label Smoothing.
- CCT: In real-world camera trap data, the methods improved the Area Under the Curve (AUC) for unseen "trans-locations," proving that these techniques translate to practical, non-synthetic scenarios.
Limitations and Future Work
The primary limitation is the requirement for human annotations (bounding boxes or masks). While many datasets include these, they can be expensive to collect for new domains.
The authors suggest that this could be mitigated in the future by using pre-trained segmentation models or "few-shot" segmentation techniques to generate these masks automatically. Additionally, while they focused on foreground/background separation, they note that these principles could be extended to other spurious factors like color or texture bias if those factors can be identified and manipulated.
Summary updated