Abstract
Deep learning models frequently rely on "shortcuts" or spurious correlations within datasets, a phenomenon known as dataset bias. BiaSwap is an unsupervised data augmentation framework designed to mitigate this issue by automatically identifying and swapping biases between images. By leveraging a biased teacher model to locate shortcut features via Class Activation Maps (CAM) and a Swapping Autoencoder for targeted feature transfer, BiaSwap encourages networks to focus on intrinsic, invariant features. Experimental results across synthetic and real-world benchmarks demonstrate that BiaSwap significantly outperforms existing debiasing methods without requiring prior knowledge of the bias type.
Introduction: The Problem of Shortcut Learning
Deep learning models are notorious for being "lazy." If a model can find a simple shortcut to a correct answer—like identifying a camel by the presence of sand rather than the animal's shape—it will take it. This is known as dataset bias or shortcut learning.
The challenge is that in real-world datasets, we often do not know what the bias is. While researchers have created synthetic datasets where the bias is obvious (e.g., "all zeros are red"), real-world bias is subtle and complex. Most existing debiasing methods require humans to pre-define the bias type (like texture or color), which is impractical for large-scale, messy data. BiaSwap addresses this by providing a fully unsupervised pipeline for bias removal.
Methodology
BiaSwap operates through a three-stage pipeline designed to isolate and manipulate bias without human intervention:
- Separating the "Easy" from the "Hard": Based on the observation that models learn biased "shortcuts" much faster than complex features, the authors first train an intentionally biased classifier using Generalized Cross Entropy (GCE). They then use a "bias score" to sort the training data into two groups: bias-guiding (samples the model finds easy and likely contain the shortcut) and bias-contrary (samples that defy the shortcut).
- Locating the Bias with CAM: To know what to swap, the model needs to know where the bias is. The authors use Class Activation Maps (CAM) from their biased classifier to highlight the regions the model is "looking at" to make its biased decisions.
- Bias-Tailored Swapping: Using a Swapping Autoencoder (SwapAE), the framework takes a bias-guiding image and a bias-contrary image and swaps their "style" attributes. Crucially, instead of swapping the whole image style, it uses the CAM to focus the swap on the specific regions identified as bias-relevant.
The result is a "bias-swapped" image: for example, a digit that keeps its original shape but takes on the "biased" color of a different sample. By training a final model on this augmented dataset, the network is forced to ignore the shifting "shortcuts" and focus on the invariant features.
Datasets and Experimental Setup
The authors evaluated BiaSwap on both synthetic and real-world benchmarks to test its versatility:
- Colored MNIST: A classic synthetic test where digits are highly correlated with specific colors.
- Corrupted CIFAR10: Images where object classes are correlated with specific texture corruptions (e.g., "frosted glass" or "snow").
- BAR (Biased Action Recognition): A real-world dataset where human actions are tied to specific backgrounds (e.g., "climbing" always appearing on rock walls).
- bFFHQ (Gender-biased FFHQ): A face dataset where age is spuriously correlated with gender.
Key Results
BiaSwap demonstrated significant improvements over state-of-the-art baselines like ReBias and LfF:
- Synthetic Superiority: On Colored MNIST with a 99.5% bias ratio, BiaSwap achieved 85.76% accuracy on unbiased data, compared to just 32.67% for a vanilla model and 62.82% for ReBias.
- Real-World Performance: On the bFFHQ dataset, BiaSwap reached 58.87% accuracy on bias-contrary samples, outperforming the next best unsupervised method (LfF) by over 3%.
- Generalization: Unlike some debiasing methods that hurt performance on the "easy" biased samples to gain on "hard" ones, BiaSwap maintained high accuracy across both groups, suggesting it learns a truly generalized representation.
Conclusion
BiaSwap provides a powerful, unsupervised mechanism for training robust neural networks. By automating the identification and manipulation of dataset shortcuts, it moves beyond the limitations of human-defined bias categories. While the quality of debiasing depends on the initial biased teacher and the image translation module, the framework offers a flexible solution for real-world applications where biases are complex and unknown.
Summary updated