Back

Bias Removal in Diffusion Models (an agentic approach)

December 18, 2024

3 min read

Hi there!

This is my first blog, where I will be sharing my approach of how I tackled Gender Bias in Diffusion Models using VLM and LLM Agents.

Problem Introduction

Gender gradient header Diffusion model example

Diffusion models have shown remarkable success in generating high-quality synthetic content across various domains. However, they exhibit gender bias, which impacts fairness and reliability. Gender bias manifests in the over- or under-representation of certain genders and the reinforcement of harmful stereotypes in generated outputs. These issues not only degrade model performance but also perpetuate social inequities, necessitating effective mitigation strategies for responsible deployment.

Methodology

Our proposed framework operates in a two-step process to mitigate gender bias in diffusion models.

Step 1: Bias Assessment with Vision-Language Model (VLM)

  1. Input prompts and generated outputs are evaluated using the Vision-Language Model Llava Next.
  2. Llava Next computes a gender bias score, providing quantifiable insights into the model’s performance regarding gender representation.
    • Reasoning: The gender bias score helps identify imbalances in the representation of different genders. It quantifies potential over-representation, under-representation, or stereotypical depictions in the generated outputs, enabling a systematic approach to addressing bias.

Step 2: Query Optimization with Language Model (LLM)

  1. The gender bias score is relayed to the Language Model Phi3 for query optimization.
  2. Phi3 modifies the original query by rephrasing or adjusting the prompt to address identified gender biases.
  3. The optimized query is then used to generate more balanced and fair outputs.

Image 2 Image 3 Image 5

Sample Outputs after Bias Mitigation


Image 1 Image 4 Image 4

Sample Outputs before Bias Mitigation

Further Work

Limitations