Skip to content

Title: Mitigating multi-bias in Vision-Language Model with embedding vector redirection

License

Notifications You must be signed in to change notification settings

hataehyeok/multi-debiasing-VLM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mitigating multi-bias in Vision-Language Model with embedding vector redirection

Team9. Taehyeok Ha, Kyoosik Lee, Hyeonbeen Park

This repository is extended research of Debiasing Vision-Language Models via Biased Prompts

Environment

The code has only been tested with the below environment and this all packages can downloaded by requirements.txt

  • python=3.6
  • torch=1.10.1
  • PIL
  • diffusers
  • scikit-learn
  • clip
  • transformers
  • CUDA 12.1

Procedure

  1. Create a python virtual environment using venv in current folder, e.g., python -m venv myenv

  2. Activate the virtual environment in current folder source myenv/bin/activate

  3. Install the specified packages, run pip install -r requirements.txt

  4. Change directory to ./generative

  5. Run following or user customized commend, below commends is example

    python main.py --cls Nurse --debias-method singleGender --lam 0 --preprompt A
    python main.py --cls Florist --debias-method singleRace --lam 500 --preprompt A
    python main.py --cls HollywoodActor --debias-method singleGender --lam 500 --preprompt A
    python main.py --cls Nurse --debias-method pair --lam 500 --preprompt A
    python main.py --cls Florist --debias-method multiple --multiple-param simple --lam 500 --preprompt A
    python main.py --cls HollywoodActor --debias-method multiple --multiple-param composite --lam 500 --preprompt A
  • This is detail explanation of flags
    • --cls: Select the target class that user what to test for any job
      • e.g., Florist, HollywoodActor, Doctor
    • --lam: Hyperparameter lambda of debiasing algorithm
      • high lambda value means high level debiasing
    • --debias_method: Choice multi-vector or single-vector
      • singleRace
      • singleGender
      • multiple --multiple-param composite
      • multiple --multiple-param simple
      • pair
    • --preprompt: Type of prompt senteces
      • A: "A photo of a"
      • B: "This is a"
      • C: "Photo cropped face of a"
  1. Experiments results(Image, ) will be shown in generative folder

Research

Introduction

Bias in Vision-Language Model (VLM) has been a long issue in the Artificial Intelligence community. An example of known biases are tendency towards certain gender, race, religion, etc. There are existing works to modify the embedding vector of a prompt to mitigate the bias. However, to the best of our knowledge, these works has focused on addressing only one type of bias at a time. Our work further extends this by mitigating multi-bias at the same time.

The code aims to remove the multi-bias of Stable Diffusion v2.1.

Keywords: Vision-Language pre-trained model, Debiasing, Ethical AI

Results

Above image is generated by this code.

Figure shows the analysis of 3D visualization of embedding vectors

Experiments

In general, debiasing method shows improved performance, compared to the previouse Stable Diffusion v2.1. Figure shows the comparison of Stable Diffusion, Reference method, and method of the job nurse. Stable Diffusion is known to have bias on White female. The results show that gender is almost correctly Notably, all three participants in study produced the same results for every test case, with no indiscernable case regarding race or gender. This indicates that method not only excels in producing balanced results but also generates distinguishable images.

Conclusions

We present an extended method for removing multi-bias method

  1. In general, our method remove the bias for gender and race at the same time
  2. Visualize the embedding vector space and explain why the quality of the image is lower

About

Title: Mitigating multi-bias in Vision-Language Model with embedding vector redirection

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published