From Fake to Real: Pretraining on Balanced Synthetic Images to Prevent Spurious Correlations in Image Recognition

Maan Qraitem, Kate Saenko, Bryan A. Plummer

TL;DR

Using synthetic data to fix dataset biases seems like a no-brainer, but mixing real and fake images introduces a new problem: models learn to exploit the subtle statistical differences between the two. To solve this, From Fake to Real (FFR) introduces a simple two-stage pipeline that pretrains on balanced synthetic data before fine-tuning on real data, boosting worst-group accuracy by up to 20%.

What Problem Does This Paper Address?

Deep learning models are notorious for taking shortcuts. If a training set contains a spurious correlation—say, most pictures of "Big Dogs" are taken "Indoors"—the model might just look at the background rather than the dog. While we can use generative models (like Stable Diffusion) to create images of "Big Dogs Outdoors" to balance the dataset, mixing real and synthetic data creates a sneaky new bias.

Because generative models leave subtle "fingerprints" or artifacts, a neural network trained on a mixed dataset will quickly learn to distinguish real images from fake ones. Instead of learning robust features, it learns a joint bias based on the attribute and the data source (e.g., associating "Synthetic + Indoors" with a specific class). As a result, the model fails to generalize properly to real-world data.

Methods

The authors propose From Fake to Real (FFR), a straightforward two-stage training strategy that completely avoids mixing real and synthetic data in the same training step:

  1. Stage 1: Pretraining on Balanced Synthetic Data. A generative model samples an equal number of synthetic images for every single subgroup combination, ensuring the target class $Y$ is statistically independent of the bias variable $B$. The model is pretrained on this purely synthetic dataset to learn robust, unbiased initial representations.
  2. Stage 2: Fine-Tuning on Real Data. The model is then fine-tuned on the original, biased real dataset. Because the model already possesses strong, unbiased feature representations from Stage 1, it can be fine-tuned using standard Empirical Risk Minimization (ERM) or existing loss-based bias mitigation techniques (like GroupDRO or Resampling) without falling back on spurious shortcuts.
An overview of From Fake to Real (FFR) training pipeline

Datasets

The method was evaluated across three standard bias-mitigation benchmarks with manually varied bias ratios (ranging from a moderate 90% to a severe 99.9%):

  • CelebA-HQ: Target attribute is "Smiling"; bias attribute is "Gender".
  • UTK-Face: Target attribute is "Gender"; bias attribute is "Age".
  • SpuCo Animals: A challenging dataset where target attributes are animal types (Small dogs, Big dogs, Landbirds, Waterbirds) and bias attributes are backgrounds (Indoors, Outdoors, Land, Water).

Key Insights and Ideas

  • The Inevitability of Mixed Bias: The authors provide a mathematical proof (Theorem 1) showing that any simultaneous mixing of a biased dataset with synthetic data will mathematically guarantee a new bias toward the combination of the bias attribute and the data source $(B, G)$.
  • Embedding Separation: t-SNE visualizations revealed that traditional mixed-augmentation methods cause the model to project real and synthetic data into completely separate clusters. FFR, by contrast, projects them tightly together, proving it learns core, source-agnostic features.
  • Saliency Map Clarity: Saliency maps show that mixed-data models get distracted by generative artifacts (like a dog having an incorrect number of toes) or background details. FFR consistently focuses on the actual object of interest (e.g., the mouth when predicting "Smiling").
Fig. 1: Comparison of RISE [26] saliency maps produced for a model trained to predict the attribute Smiling Y given a bias toward Gender B (Most Women are not Smiling) using: (a) prior work in Synthetic Augmentation [25, 28], which do not address the unexpected bias toward the pair (Gender B, Data Source G), e.g., (Female-Synthetic vs Female-Real) and, thus, use spurious features leading to an incorrect prediction (not smiling) (b) our approach FFR where the Synthetic and Real Data are separated into two training stages, thereby mitigating the bias suffered by prior work enabling us to learn the correct features (Mouth) and correctly predict Smiling.

Key Results

  • Massive Worst-Group Accuracy (WA) Gains: FFR outperforms prior synthetic augmentation methods by up to 20% in worst-group accuracy. For instance, on UTK-Face with a 95% bias ratio, FFR beats existing methods by over 10%.
  • Robustness to Severe Bias: While prior methods degrade rapidly as dataset bias approaches 99.9%, FFR maintains stable performance across all bias ratios.
  • Synergy with Non-Synthetic Methods: When combined with synthetic-data-free bias mitigation methods like GroupDRO and Resampling, FFR improves their average worst-group accuracy by 13%.

Limitations and Future Work

  • Dependence on Generation Quality: FFR relies heavily on the text-to-image model's ability to faithfully generate a balanced dataset. If the generator fails to follow complex prompts or exhibits its own internal demographic biases, FFR's performance can suffer.
  • Compositional Failures: Current diffusion models occasionally struggle with compositionality (e.g., correctly rendering specific combinations of objects and backgrounds), which limits the complexity of datasets FFR can currently fix.
  • Future Directions: The authors point to the need for fairer, more prompt-accurate generative models to unlock the full potential of synthetic pretraining.

Summary updated

BibTeX
@inproceedings{qraitem2024from,
  author = {Maan Qraitem and Kate Saenko and Bryan A. Plummer},
  title = {{From Fake to Real: Pretraining on Balanced Synthetic Images to Prevent Spurious Correlations in Image Recognition}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  url = {https://openreview.net/forum?id=YeLUPJe0am},
}
Figure