# Code for the Paper titled ["Perpetual Misogyny: How Gendered Tropes Shape Text-To-Image AI Personalization"](http://arxiv.org/pdf/2505.04600) ### Repository Structure ``` CIVITAI_VISUALIZATIONS/ ├── .virtual_documents/ # Temporary files from Jupyter ├── data/ # Final curated datasets │ ├── subset1/ # Specific data splits or versions │ ├── subset2/ │ └── ... ├── misc/ │ └── credentials/ # API keys and sensitive config (excluded from versioning) ├── plots/ # Output plots and figures used in the paper ├── ├── jupyter_notebooks/ # Main analysis notebooks │ ├── 0_Scraping_image_metadata.ipynb # Scrapes CivitAI metadata via API │ ├── Section_1_Figure_1_image_grid.ipynb # Grid of sample images │ ├── Section_3-2-1_Figure_3_histogram.ipynb # Histogram of upload trends │ ├── Section_3-2-1_Figure_4_Mivolo.ipynb # Model activity plot (Mivolo-focused) │ ├── Section_3-3-1_Figure_5_tags.ipynb # Tag frequency and usage visualizations │ ├── Section_3-3-3_download_popular_models.ipynb # Download models for analysis │ ├── Section_3-3-3_Figure_6.ipynb # Promotional tag usage patterns │ ├── Section_3-3-4_Figure_8a.ipynb # Ranking of popular models │ ├── Section_3-3-4_Figure_8b.ipynb # Continuation of model rankings │ ├── Section_3-3-4_Figure_9_Sankey.ipynb # Sankey diagram: user-model contributions │ ├── Section_3-3-4_LLM_annotation.ipynb # Annotations using large language models │ ├── Section_3-4_extract_LoRA_metadata.ipynb # LoRA metadata extraction │ ├── SuppM_Figure_12_Danbooru_Taxonomy.ipynb # Danbooru tag taxonomy: visualization │ ├── SuppM_Figure_13_Danbooru_taxonomy.ipynb # Tag grouping and structure │ └── SuppM_Figure_13.ipynb # Supplementary figure generation ├── misc/ # Utility scripts and API credentials (excluded) ├── plots/ # Output plots and visualizations ├── public/ # Optional public-facing files ├── .gitignore ├── .gitmodules ├── README.md # This file └── requirements.txt # Python dependencies ``` # Project Setup ## Requirements This project requires Python 3.8 or higher. Ensure you have it installed before proceeding. ## Installation 1. **Clone the Repository** ```sh git clone https://gitlab.uzh.ch/latent-canon/pm-paper.git cd pm-paper ``` 2. **Create a Virtual Environment** (Recommended to avoid dependency conflicts) ```sh python -m venv venv source venv/bin/activate # On macOS/Linux venv\Scripts\activate # On Windows ``` 3. **Install Dependencies** ```sh pip install -r requirements.txt ``` 4. **Jupyter Notebook Setup (Optional)** If running Jupyter notebooks, ensure the environment is linked: ```sh python -m ipykernel install --user --name=venv --display-name "Python (venv)" ``` ## Notes - Ensure you have necessary system dependencies installed (e.g., `opencv` may require additional system libraries). - If you encounter any issues, ensure you're using the correct Python environment (`venv` activated).