How haoyusimon/vl_debiasing works
Project type and purpose
• This is a machine-learning research codebase implementing “Joint Vision-Language Social Bias Removal for CLIP.”
• It provides scripts for training a debiased CLIP model over face-attribute datasets, measuring bias, and evaluating both bias reduction and vision-language performance.
File structure
Top-level files & dirs:
• clip_debiasing/
– datasets.py ← data ingestion & preprocessing for FairFace, UTKFace, FACET
– measure_bias.py ← routines to quantify social bias metrics
– models/ ← implementations of baseline CLIP and various debiasing strategies
– __init__.py
• train.py ← orchestrates the training loop, optimization, checkpointing
• eval_all.py ← end-to-end evaluation (bias & retrieval/classification metrics)
• eval_retrieval.py ← specialized retrieval evaluation
• eval_train.py ← evaluation on training set (sanity checks)
• utils.py ← shared helpers (logging, config parsing, seeding)
• requirements.txt ← exact PyTorch & Python dependencies
README for additional insights
• Confirms usage flow: install deps ➔ download face datasets ➔ run train.py ➔ run eval_all.py
• Notes external inspirations: ALBEF, mixed_KSG CLIP-clip, debias_vl — these are external model/code dependencies
• Outputs of training: exp/{version}/stdout.log, stderr.log, best.pth
Final advice
– Be exhaustively detailed: include each model file in the models folder as a subcomponent if needed
– Capture both control-flow (which script calls which modules) and data-flow (what data moves where)