Abstract
Counterfactual data augmentation has recently emerged as a method to mitigate confounding biases in the training data for a machine learning model. These biases, such as spurious correlations, arise due to various observed and unobserved confounding variables in the data generation process. In this paper, we formally analyze how confounding biases impact downstream classifiers and present a causal viewpoint to the solutions based on counterfactual data augmentation. We explore how removing confounding biases serves as a means to learn invariant features, ultimately aiding in generalization beyond the observed data distribution. Additionally, we present a straightforward yet powerful algorithm for generating counterfactual images, which effectively mitigates the influence of confounding effects on downstream classifiers. Through experiments on MNIST variants and the CelebA datasets, we demonstrate the effectiveness and practicality of our approach.
Introduction
Machine learning models are notorious for taking "shortcuts." If a dataset of handwritten digits consistently shows the number '1' on a green background and '9' on a red background, a model might learn to identify the color rather than the shape. In causal terms, this is a confounding bias: an external variable (the data collection process) causes a spurious correlation between the label and a non-causal feature. While Counterfactual Data Augmentation (CDA)—generating "what if" examples like a '1' on a red background—has emerged as a solution, a formal understanding of its underlying mechanics has been lacking.
A Causal Framework for Augmentation
The authors provide a formal causal framework using Structural Causal Models (SCMs) to analyze CDA. They introduce Directed Information as a measure to capture the causal flow between variables, mathematically linking the removal of confounding to the learning of invariant features.
A key contribution of this work is the "Sufficient Intervention" principle. Previous state-of-the-art methods attempted to intervene on every generative factor (shape, texture, background). This paper proves that intervening solely on the causal feature ($Z_0$)—the part of the data that actually determines the label—is sufficient to block the "back-door paths" that create spurious correlations. This insight significantly simplifies the generative requirements for effective CDA.
Methodology
The proposed approach follows a structured algorithm to generate counterfactual images:
- Identification: Identify spuriously correlated images within the training set.
- Generation: Utilize a conditional generative model, such as a Conditional Diffusion Model (C-DM), to generate counterfactual versions of these images. This is done by changing only the causal feature ($Z_0$) while keeping other environmental factors constant.
- Augmentation: Append these "unconfounded" images to the training set to force the downstream classifier to ignore non-causal features.
While the framework is compatible with VAEs and GANs, the authors found that Conditional Diffusion Models produced the highest quality counterfactuals, leading to superior downstream classification performance.
Experimental Results
The researchers evaluated their approach on four benchmarks: CM-MNIST, DCM-MNIST, WLM-MNIST, and the real-world CelebA dataset. The results consistently showed that the proposed method helps models retain high accuracy on "unconfounded" test sets where standard shortcuts fail.
- MNIST Variants: On the DCM-MNIST dataset, standard Empirical Risk Minimization (ERM) achieved only 50.06% accuracy. Using the proposed C-DM augmentation, accuracy improved to 73.79%.
- CelebA: On this real-world face dataset, the method achieved 94.73% accuracy, outperforming existing robust learning methods like GroupDRO (78.30%) and IRM (66.85%).
Conclusion and Future Work
This paper demonstrates that CDA is a powerful tool for breaking spurious correlations by targeting the causal features of a dataset. By focusing on the "Sufficient Intervention" of $Z_0$, the method is more computationally efficient than full-intervention models. A primary limitation remains the "Cold Start" problem, where the generative model itself might learn biases if the training data is perfectly confounded. Future work will explore unsupervised methods to discover generative factors without explicit labels.
Summary updated