Run this model with HF Jobs
Run SynthFairCLIP/clip-vit-base-patch16-baseline on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/SynthFairCLIP/clip-vit-base-patch16-baseline. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/SynthFairCLIP/clip-vit-base-patch16-baseline on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use SynthFairCLIP/clip-vit-base-patch16-baseline with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- OpenCLIP
How to use SynthFairCLIP/clip-vit-base-patch16-baseline with OpenCLIP:
import open_clip model, preprocess_train, preprocess_val = open_clip.create_model_and_transforms('hf-hub:SynthFairCLIP/clip-vit-base-patch16-baseline') tokenizer = open_clip.get_tokenizer('hf-hub:SynthFairCLIP/clip-vit-base-patch16-baseline') - Notebooks
- Google Colab
- Kaggle
clip-vit-base-patch16-baseline
CLIP ViT-B/16 trained from scratch for the SynthFairCLIP project, which studies whether demographically balanced synthetic data reduces social bias in CLIP. This is the baseline variant.
| Repo | Training data |
|---|---|
clip-vit-base-patch16-baseline |
CLIP-score-filtered subset of DataComp-large (about 400M real pairs) |
clip-vit-base-patch16-hybrid |
Same, with every face-containing pair (about 25%) replaced by a synthetic image and a demographically edited caption |
clip-vit-base-patch16-hybrid-mixed |
Baseline and hybrid sets mixed: each face-containing pair is seen half the time as the real pair and half the time as its synthetic replacement (about 12% of all samples seen are synthetic) |
clip-vit-base-patch16-hybrid-neutral-mixed |
As hybrid-mixed, but the synthetic images keep the original captions instead of the demographically edited ones |
clip-vit-base-patch16-mixed |
Baseline set plus Synth-So-B-IT: about one sample in six comes from Synth-So-B-IT, whose captions name only the concept ("A person who is a doctor"), never a demographic group |
Training
OpenCLIP with the DataComp training code. ViT-B/16, 224 px, trained from scratch, 12.8B samples seen, global batch size 8,192 (128 GPUs), learning rate 5e-4, 500 warm-up steps, cosine schedule, weight decay 0.2, seed 0.
Usage
import open_clip
model, _, preprocess = open_clip.create_model_and_transforms("hf-hub:SynthFairCLIP/clip-vit-base-patch16-baseline")
tokenizer = open_clip.get_tokenizer("hf-hub:SynthFairCLIP/clip-vit-base-patch16-baseline")
Evaluation
Zero-shot ImageNet-1k top-1 accuracy: 0.638. Bias evaluations (So-B-IT, SISPI) will be added here.
Evaluation code: https://github.com/lluisgomez/SynthFairCLIP/tree/main/evals
Limitations
These are research models. Training on balanced synthetic data did not consistently reduce bias in our evaluations, and some variants trade retrieval quality for more balanced rankings. Do not assume this model is less biased than a standard CLIP model. It inherits the biases of DataComp web data and of the text-to-image model used for the synthetic part.
Acknowledgement
We acknowledge EuroHPC JU for awarding the project ID EHPC-AI-2024A02-040 access to MareNostrum 5 hosted at BSC-CNS.
- Downloads last month
- 384