Downloads · 30 days
14
36% of all-time downloads
aaronwzl/clip-vit-base-patch32-flickr-retrieval
clip-vit-base-patch32-flickr-retrieval is a zero-shot image classification model from aaronwzl. Use it for the zero-shot image classification task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
The retrieval evaluation uses specific stream indices of ThraggBilly/flickr30kdataset. The training script streams past those and takes only samples whose index is not in the evaluation set, and asserts the disjointne…
Downloads · 30 days
14
36% of all-time downloads
All-time downloads
39
Public
Parameters
151M
605 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors605 MB · 99%
From the Hugging Face model README
| base model | openai/clip-vit-base-patch32 |
| objective | symmetric InfoNCE over (image, caption) pairs, using CLIP's learned temperature — the pre-training objective continued at a low learning rate |
| data source | ThraggBilly/flickr30k_dataset (streaming split train) |
| training pairs | 4000 |
| epochs | 2 |
| optimiser steps | 126 |
| batch size | 64 |
| optimiser | AdamW, lr 1e-05, weight decay 0.1 |
| schedule | 10 % linear warmup, then linear decay to 0 |
| gradient clipping | global norm 1.0 |
| seed | 42 |
| device | cuda |
| wall-clock | 519 s |
| loss | 0.3571 → 0.0993 |
The retrieval evaluation uses specific stream indices of ThraggBilly/flickr30k_dataset. The training script
streams past those and takes only samples whose index is not in the evaluation set,
and asserts the disjointness at run time rather than assuming it.
Train/eval index overlap = 0 (verified, 500 evaluation indices held out against 4000 training indices).
Both index lists are shipped in finetune_config.json, so the disjointness is checkable
without rerunning anything.
Mean cosine similarity on a held-out sample of evaluation pairs, ground-truth versus foil caption:
| zero-shot | fine-tuned | margin change | |
|---|---|---|---|
| Flickr30K | GT 0.3043 / foil 0.1785 | GT 0.2949 / foil 0.1215 | +0.0477 |
Fine-tuning widens the ground-truth-versus-foil margin mainly by pushing foil similarity down.
from transformers import CLIPModel, CLIPProcessor
model = CLIPModel.from_pretrained("aaronwzl/clip-vit-base-patch32-flickr-retrieval")
proc = CLIPProcessor.from_pretrained("aaronwzl/clip-vit-base-patch32-flickr-retrieval")
python rebuttal/exp/retrieval/finetune_clip.py \
--dataset flickr --n-train 4000 --epochs 2 \
--batch-size 64 --lr 1e-05 --seed 42