Fair Diffusion: Instructing Text-to-Image Generation Models on Fairness

Felix Friedrich, Patrick Schramowski, Manuel Brack, Lukas Struppek, Dominik Hintersdorf, Sasha Luccioni, Kristian Kersting · DOI · OpenReview

Introduction

Generative text-to-image (T2I) models, such as Stable Diffusion, have revolutionized content creation but carry a significant burden: they inherit and often amplify social biases present in their massive, uncurated training datasets (e.g., LAION-5B). For example, a simple prompt like "firefighter" frequently results in a homogeneous set of images, typically depicting white men. Existing mitigation strategies often require computationally expensive retraining or massive data filtering, which are impractical for deployed models. Fair Diffusion addresses this gap by introducing a post-hoc, inference-time strategy to steer image generation toward fairer distributions without compromising model performance or requiring additional training.

Methodology: Fair Guidance through Semantic Steering

Fair Diffusion operates during the denoising process of a diffusion model. It leverages Semantic Guidance (SEGA) to modify the model's noise estimation without altering the original text prompt.

The Fair Diffusion framework: A lookup table provides fair instructions that guide the text-to-image generation process via a fair guidance term $\gamma$.

The core of the method is the Fair Guidance Term ($\gamma$). By hooking into the classifier-free guidance mechanism, the model is instructed to move toward a target concept (e.g., "female person") and away from a biased prior (e.g., "male person") in the latent space. This allows for precise, "surgical" edits to specific attributes like gender or ethnicity while preserving the overall composition and quality of the generated image. Unlike prompt engineering, which can drastically change the entire scene, Fair Diffusion acts as a scalpel, adjusting only the intended demographic features.

Evaluation and Datasets

The researchers conducted a multi-level audit to quantify bias across the T2I pipeline:

  1. Training Data (LAION-5B): A subset of 1.8 million images across 150 occupations was analyzed to establish a "ground truth" for dataset bias.
  2. Latent Associations (CLIP): The CLIP text-image encoder was tested using the Image Embedding Association Test (iEAT) to identify stereotypical associations, such as associating "science" more strongly with male-appearing faces than female-appearing ones.
  3. Model Output (Stable Diffusion 1.5): Over 37,000 images were generated and analyzed using the FairFace classifier to evaluate the gender and ethnicity distributions of the final outputs.

Key Results and Insights

The study confirmed that Stable Diffusion often amplifies existing biases. For many occupations, the generated images showed a more skewed gender ratio than the already biased training data.

Fair Diffusion successfully shifted these distributions. The authors defined a "Fair Boundary" as a 50% $\pm$ 4% distribution for binary gender. While standard models fell far outside this range for most occupations, Fair Diffusion moved the median of all 150 tested occupations into this fair zone.

Example of a generated image using Fair Diffusion to steer toward an East Asian female firefighter, demonstrating qualitative consistency and demographic accuracy.

Qualitatively, the images remained high-quality and contextually relevant. The method proved flexible, allowing users to target either statistical parity (50/50) or specific real-world demographic benchmarks by adjusting the guidance probability.

Discussion and Limitations

While Fair Diffusion offers a powerful tool for fairness, it has limitations. Current automated evaluation tools like FairFace are primarily built on binary gender labels, restricting the current scope of the work. Additionally, the bias to be corrected must be "describable" in natural language for the guidance to be effective.

There is also a "dual-use" risk: the same mechanism used to promote fairness could theoretically be used to reinforce stereotypes if applied maliciously. Future work aims to automate the detection of bias, allowing models to apply Fair Guidance autonomously and move toward a more inclusive generative AI ecosystem.

Summary updated

BibTeX
@misc{friedrich2023fair,
  author = {Felix Friedrich and Patrick Schramowski and Manuel Brack and Lukas Struppek and Dominik Hintersdorf and Sasha Luccioni and Kristian Kersting},
  title = {{Fair Diffusion: Instructing Text-to-Image Generation Models on Fairness}},
  year = {2023},
  eprint = {2302.10893},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2302.10893},
}
Figure