Sources for "Erasing 'Ugly' from the Internet: Propagation of the Beauty Myth in Text-Image Models"
BeautyStandards/Code/
β
βββ Prompt_template/
β βββ beauty_taxonomy.py # Creates the structured beauty taxonomy for prompt generation
β βββ base_prompts.txt # Core set of base prompt templates
β βββ prompts_metadata.json # Metadata associated with taxonomy prompts
β βββ llama3.1_prompts.txt # Prompts for LLaMA 3.1 model
β βββ llama3.1_instruct_prompts.txt # Prompts for LLaMA 3.1 Instruct model
β βββ deepseek_llm_prompts.txt # Prompts for DeepSeek LLM
β βββ image_prompts.txt # Finalised prompts used for image generation
β
βββ Generate_data/
β βββ run_llms/
β β βββ run_llms.py # Runs LLMs with taxonomy-based prompts
β β βββ compute_selfBLEU.py # Computes Self-BLEU to select most diverse LLM outputs
β β βββ output_text_llama3.1.txt # LLaMA 3.1 generated text outputs
β β βββ output_text_llama3.1_instruct.txt
β β βββ output_text_deepseek_llm.txt # DeepSeek LLM outputs
β β βββ output_text_selfBleu.txt # Selected diverse LLM outputs after Self-BLEU filtering
β βββ run_image_models/
β β βββ run_stable_diff3.5_full.py # Generates images via Stable Diffusion 3.5
β β βββ run_freepik.py # Generates images via Freepik API
β β βββ image_prompts.txt # Input prompts for image generation
β
βββ Results/
β βββ analyse.ipynb # Main analysis notebook (Krippendorffβs Ξ±, ANOVA, Tukey HSD)
β βββ krippendorff_alpha.py # Computes Krippendorffβs alpha for inter-rater reliability
β βββ anova/ # ANOVA outputs
β βββ fdr_bh/ # FDR correction
β βββ tukey_hsd/ # Tukey HSD post-hoc analysis output
β βββ formatted_data_from_human.tsv # Annotated dataset with anonymised Prolific IDs
β
βββ LICENSE
βββ README.md
Run the beauty_taxonomy.py script to produce prompts based on diverse beauty-related traits.
cd Code/Prompt_template
python beauty_taxonomy.py
This will create prompt files (e.g., image_prompts.txt, llama3.1_prompts.txt, etc.) that will be used in the next stages.
Copy the image_prompts.txt into the run_image_models folder, and other prompt .txt files llama3.1, llama3.1_instruct, deepseek into the run_llms folder.
Move to the run_llms folder and run the language model generation pipeline.
cd ../Generate_data/run_llms
python run_llms.py
This will produce raw text outputs for each model:
output_text_llama3.1.txt β LLaMA 3.1 outputsoutput_text_llama3.1_instruct.txt β LLaMA 3.1 Instruct outputsoutput_text_deepseek_llm.txt β DeepSeek LLM outputsUse the Self-BLEU script to identify the most diverse LLM responses for subsequent image generation:
python compute_selfBLEU.py
The filtered outputs will be written to output_text_selfBLEu.txt.

Use both pipelines to produce AI-generated images:
Pipeline 1 (Prompt-generated images): Prompt β Image model (uses image_prompts.txt as prompt input)
Pipeline 2 (Description-generated images): Prompt β LLM description β Image model (uses output_text_selfBLEu.txt as prompt input)
Navigate to run_image_models and run the scripts:
cd ../run_image_models
python run_stable_diff3.5_full.py
python run_freepik.py
β οΈ You will need to manually copy the relevant input prompts or descriptions into the image model scripts before running.
The Code/Results folder runs all the statistical analysis given in the paper, including anova results and inter rater agreement.
Option 1: Run the Notebook
jupyter notebook analyse.ipynb
The file formatted_data_from_human.tsv contains anonymised human evaluation data.
β οΈ If you are interested in the image dataset, please contact I.Konstas [at] hw.ac.uk
If you use this code or data, please cite the corresponding paper:
Erasing 'Ugly' from the Internet: Propagation of the Beauty Myth in Text-Image Models
Tanvi Dinkar, Aiqi Jiang, Gavin Abercrombie, Ioannis Konstas
arXiv preprint arXiv:2511.00749, 2025
30 commits
4 commits
Jupyter Notebook
87.6%
Python
12.4%
Sources for "Erasing 'Ugly' from the Internet: Propagation of the Beauty Myth in Text-Image Models"
BeautyStandards/Code/
β
βββ Prompt_template/
β βββ beauty_taxonomy.py # Creates the structured beauty taxonomy for prompt generation
β βββ base_prompts.txt # Core set of base prompt templates
β βββ prompts_metadata.json # Metadata associated with taxonomy prompts
β βββ llama3.1_prompts.txt # Prompts for LLaMA 3.1 model
β βββ llama3.1_instruct_prompts.txt # Prompts for LLaMA 3.1 Instruct model
β βββ deepseek_llm_prompts.txt # Prompts for DeepSeek LLM
β βββ image_prompts.txt # Finalised prompts used for image generation
β
βββ Generate_data/
β βββ run_llms/
β β βββ run_llms.py # Runs LLMs with taxonomy-based prompts
β β βββ compute_selfBLEU.py # Computes Self-BLEU to select most diverse LLM outputs
β β βββ output_text_llama3.1.txt # LLaMA 3.1 generated text outputs
β β βββ output_text_llama3.1_instruct.txt
β β βββ output_text_deepseek_llm.txt # DeepSeek LLM outputs
β β βββ output_text_selfBleu.txt # Selected diverse LLM outputs after Self-BLEU filtering
β βββ run_image_models/
β β βββ run_stable_diff3.5_full.py # Generates images via Stable Diffusion 3.5
β β βββ run_freepik.py # Generates images via Freepik API
β β βββ image_prompts.txt # Input prompts for image generation
β
βββ Results/
β βββ analyse.ipynb # Main analysis notebook (Krippendorffβs Ξ±, ANOVA, Tukey HSD)
β βββ krippendorff_alpha.py # Computes Krippendorffβs alpha for inter-rater reliability
β βββ anova/ # ANOVA outputs
β βββ fdr_bh/ # FDR correction
β βββ tukey_hsd/ # Tukey HSD post-hoc analysis output
β βββ formatted_data_from_human.tsv # Annotated dataset with anonymised Prolific IDs
β
βββ LICENSE
βββ README.md
Run the beauty_taxonomy.py script to produce prompts based on diverse beauty-related traits.
cd Code/Prompt_template
python beauty_taxonomy.py
This will create prompt files (e.g., image_prompts.txt, llama3.1_prompts.txt, etc.) that will be used in the next stages.
Copy the image_prompts.txt into the run_image_models folder, and other prompt .txt files llama3.1, llama3.1_instruct, deepseek into the run_llms folder.
Move to the run_llms folder and run the language model generation pipeline.
cd ../Generate_data/run_llms
python run_llms.py
This will produce raw text outputs for each model:
output_text_llama3.1.txt β LLaMA 3.1 outputsoutput_text_llama3.1_instruct.txt β LLaMA 3.1 Instruct outputsoutput_text_deepseek_llm.txt β DeepSeek LLM outputsUse the Self-BLEU script to identify the most diverse LLM responses for subsequent image generation:
python compute_selfBLEU.py
The filtered outputs will be written to output_text_selfBLEu.txt.

Use both pipelines to produce AI-generated images:
Pipeline 1 (Prompt-generated images): Prompt β Image model (uses image_prompts.txt as prompt input)
Pipeline 2 (Description-generated images): Prompt β LLM description β Image model (uses output_text_selfBLEu.txt as prompt input)
Navigate to run_image_models and run the scripts:
cd ../run_image_models
python run_stable_diff3.5_full.py
python run_freepik.py
β οΈ You will need to manually copy the relevant input prompts or descriptions into the image model scripts before running.
The Code/Results folder runs all the statistical analysis given in the paper, including anova results and inter rater agreement.
Option 1: Run the Notebook
jupyter notebook analyse.ipynb
The file formatted_data_from_human.tsv contains anonymised human evaluation data.
β οΈ If you are interested in the image dataset, please contact I.Konstas [at] hw.ac.uk
If you use this code or data, please cite the corresponding paper:
Erasing 'Ugly' from the Internet: Propagation of the Beauty Myth in Text-Image Models
Tanvi Dinkar, Aiqi Jiang, Gavin Abercrombie, Ioannis Konstas
arXiv preprint arXiv:2511.00749, 2025
30 commits
4 commits
Jupyter Notebook
87.6%
Python
12.4%