Large Vision-Language Models (LVLMs) are increasingly popular and influential in e-commerce, retail, content creation, and fashion. Despite their growing utility, these models are known to inherit social biases from their underlying vision and language components. The research aims to address these biases, particularly in the context of non-English-speaking users, and to make LVLMs more accessible and equitable.
Create a virtual environment
python3 -m venv venv
source ./venv/bin/activate
(venv) pip install -r requirements.txt
The first step in fine-tuning the Alt-Diffusion Model is creating the datasets required for training. This involves generating prompts in various languages, creating images based on those prompts, and finally, combining the results into cohesive datasets.
We begin by creating the English prompts using the following pattern:
<STYLE> photo of a <AGE> <GENDER> <PROFESSION> <DRESSING> <PLACE>
To generate these prompts, run the following command:
python -m src.generate_prompts
Translate the English prompts into German, Chinese, and Japanese:
python -m src.translate.translate_prompts
Generate images using all prompts:
python -m src.generate_images
Combine the generated prompts and images to create a dataset for each experiment. You can choose the source of the prompts and the source of the images:
python -m src.collect_datasets
To fine-tune the Alt-Diffusion model, run the train_text_to_image CLI.
CLI Parameters:
python -m src.tti-fine-tune.train_text_to_image
First, we need to run classify.py CLI to find faces and attributes (e.g. gender, race, etc.)
CLI Parameters:
AD)m9)fairface)occupations)25)base postfix, we evaluate data/eval/generated_images_base/...python -m src.evaluate.classify --language english
This will extract faces from images generated with generate_images.py and output a file like occupations_fairface_generated.txt with lines like
musician
man: X, woman: Y
To compute the bias metrics from the extracted faces, run the evaluate_bias CLI.
CLI Parameters:
AD)m9)fairface)occupations)python -m src.evaluate.evaluate_bias --model_version finetune_english --language english
To evaluate for image/text alignment (CLIP score), run the evaluate_alignment CLI.
CLI Parameters:
AD)m9)generated)fairface)occupations)25)python -m src.evaluate.evaluate_alignment --language english --postfix base
Evaluates the images in data/eval/generated_images_base/multilang/AD_m9/english/generated/[..] for all professions and outputs the results in resutls/multilang/AD_m9/english/occupations_generated_clipscore.txt
Python
98.4%
Dockerfile
1.1%
Large Vision-Language Models (LVLMs) are increasingly popular and influential in e-commerce, retail, content creation, and fashion. Despite their growing utility, these models are known to inherit social biases from their underlying vision and language components. The research aims to address these biases, particularly in the context of non-English-speaking users, and to make LVLMs more accessible and equitable.
Create a virtual environment
python3 -m venv venv
source ./venv/bin/activate
(venv) pip install -r requirements.txt
The first step in fine-tuning the Alt-Diffusion Model is creating the datasets required for training. This involves generating prompts in various languages, creating images based on those prompts, and finally, combining the results into cohesive datasets.
We begin by creating the English prompts using the following pattern:
<STYLE> photo of a <AGE> <GENDER> <PROFESSION> <DRESSING> <PLACE>
To generate these prompts, run the following command:
python -m src.generate_prompts
Translate the English prompts into German, Chinese, and Japanese:
python -m src.translate.translate_prompts
Generate images using all prompts:
python -m src.generate_images
Combine the generated prompts and images to create a dataset for each experiment. You can choose the source of the prompts and the source of the images:
python -m src.collect_datasets
To fine-tune the Alt-Diffusion model, run the train_text_to_image CLI.
CLI Parameters:
python -m src.tti-fine-tune.train_text_to_image
First, we need to run classify.py CLI to find faces and attributes (e.g. gender, race, etc.)
CLI Parameters:
AD)m9)fairface)occupations)25)base postfix, we evaluate data/eval/generated_images_base/...python -m src.evaluate.classify --language english
This will extract faces from images generated with generate_images.py and output a file like occupations_fairface_generated.txt with lines like
musician
man: X, woman: Y
To compute the bias metrics from the extracted faces, run the evaluate_bias CLI.
CLI Parameters:
AD)m9)fairface)occupations)python -m src.evaluate.evaluate_bias --model_version finetune_english --language english
To evaluate for image/text alignment (CLIP score), run the evaluate_alignment CLI.
CLI Parameters:
AD)m9)generated)fairface)occupations)25)python -m src.evaluate.evaluate_alignment --language english --postfix base
Evaluates the images in data/eval/generated_images_base/multilang/AD_m9/english/generated/[..] for all professions and outputs the results in resutls/multilang/AD_m9/english/occupations_generated_clipscore.txt
Python
98.4%
Dockerfile
1.1%