NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

They're All Doctors: Synthesizing Diverse Counterfactuals to Mitigate Associative Bias

Salma Abdel Magid, Jui-Hsien Wang, Kushal Kafle, Hanspeter PfisterarXiv 2024 · DOI

Abstract

Vision-Language Models (VLMs) like CLIP often exhibit significant associative biases, linking professions to specific demographics based on skewed training data. We present a framework to mitigate these biases by fine-tuning models on a massive, fully synthetic dataset of counterfactual images. By generating multiple versions of the same scene—varying only the person’s race, gender, or physical appearance while maintaining the professional context—we decouple professions from human demographics. Our approach reduces bias metrics by up to 66% while maintaining performance on downstream tasks.

Introduction: The Challenge of Associative Bias

Vision-Language Models (VLMs) are foundational to modern AI applications, from image search to generative art. However, because these models are trained on uncurated internet-scale datasets, they inherit and amplify societal stereotypes. For instance, CLIP frequently associates "doctor" with white males and "flight attendant" with females. This "associative bias" poses significant fairness risks, potentially leading to the systematic exclusion or misrepresentation of protected groups in automated systems.

Addressing this challenge is difficult because real-world datasets are rarely balanced across all demographic-profession intersections. Collecting such data manually is labor-intensive and raises significant privacy concerns.

Methodology: Counterfactual Synthesis

We propose a pipeline to generate a perfectly balanced training set using generative AI, followed by a specialized fine-tuning process.

1. Neutral Captioning and Base Generation

Using LLaMA-3 (70B), we generated 270 professional captions focused solely on actions and tools (e.g., "An architect reviewing blueprints"). These were converted into base images using SDXL Turbo, employing "decorators" to ensure initial variety in age, nationality, and body type.

2. Counterfactual Generation

The core of our method involves creating counterfactual pairs. For every base image, we use SegFormer to mask the human subject. We then use inpainting to swap in different demographic profiles while keeping the background, lighting, and professional props identical. This ensures the model learns that the "profession" is defined by the environment and tools, not the person.

3. Fine-Tuning with Counterfactual Loss

We fine-tune CLIP using a combination of standard contrastive loss and a novel Counterfactual Loss. This loss encourages the model to produce similar embeddings for different counterfactual versions of the same professional scene. To prevent "catastrophic forgetting," we use Weight Ensembling (WiSE-FT) to blend the original and fine-tuned weights.

Results and Discussion

Our evaluation on the FairFace and PATA benchmarks demonstrates a significant reduction in bias.

Comparison of demographic retrieval for the query "flight attendant" between the original CLIP model and our debiased version.

As shown in the figure above, the original CLIP model exhibits extreme gender bias for the query "flight attendant," with 97% of retrieved images being female-coded. Our model achieves a near-even split (47% female, 53% male) and a more diverse racial distribution.

Quantitatively, we observed:

  • Bias Reduction: Key metrics like MaxSkew and NDKL were reduced by 40% to 66% on the FairFace dataset.
  • Performance Stability: The model retained high accuracy on standard benchmarks. ImageNet-1k accuracy only saw a minor decrease (from 0.68 to 0.61) despite the aggressive debiasing.

Limitations

While effective, the approach has limitations. Generative models used for synthesis can introduce their own artifacts or subtle biases (e.g., adding gendered accessories). Furthermore, the reliance on fixed demographic categories for evaluation is a simplification of complex social identities. Future work will explore unsupervised feature clustering to move beyond pre-defined labels.

Conclusion

By leveraging synthetic counterfactuals, we can effectively "teach" models to ignore demographic stereotypes without the need for massive real-world data collection. This framework provides a scalable, privacy-preserving path toward fairer Vision-Language Models.

Summary updated

BibTeX
@misc{magid2024they,
  author = {Salma Abdel Magid and Jui-Hsien Wang and Kushal Kafle and Hanspeter Pfister},
  title = {{They're All Doctors: Synthesizing Diverse Counterfactuals to Mitigate Associative Bias}},
  year = {2024},
  eprint = {2406.11331},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.11331},
}
Figure