Model card for clip-vit-b32-unlearncanvas-style
CLIP ViT-B/32 (OpenAI weights) finetuned on the UnlearnCanvas style corpus with a style-only contrastive objective: each image aligns to its style prompt ("A painting in {style} style.") while the original content caption ("An {object} image in {style} style.") serves as an in-batch negative — so the image encoder learns style, not content.
Model Details
- Dataset: OPTML-Group/UnlearnCanvas — 24,400 deduplicated images, 61 styles (the repo ships duplicate parquet shards; they were deduplicated by shard index)
- Base model: ViT-B-32 (quickgelu) pretrained on OpenAI WIT-400M
- Objective: contrastive; positive = style prompt, negative = content caption (both directions, 61 style prompts + 256 in-batch content captions per step)
- Train images: 21,960 (90% split, eval 2,440)
- Epochs: 10 (850 steps at batch 256)
- LR: 2e-05 (AdamW, cosine, warmup 50)
- Resolution: 224x224, bicubic center-crop, horizontal-flip augmentation
Evaluation (held-out 10% split, 2,440 images, 61 styles)
| Metric | Zero-shot (OpenAI ViT-B/32) | This checkpoint |
|---|---|---|
| Top-1 style retrieval | 6.52% | 97.50% |
| Mean image–style CLIP score | 25.20 | 30.80 |
| Style score std within style | 0.0160 | 0.0004 |
| Mean image–content CLIP score | 29.90 | 14.44 |
| Style − content gap | −4.71 | +16.36 |
The checkpoint nearly saturates style retrieval and strongly compresses within-style variation (std 0.0004), while content alignment is deliberately degraded (29.90 → 14.44) — the intended behavior of the style-only objective.
Usage
import open_clip
model, _, _ = open_clip.create_model_and_transforms("hf-hub:Sasikanth/clip-vit-b32-unlearncanvas-style")
tokenizer = open_clip.get_tokenizer("hf-hub:Sasikanth/clip-vit-b32-unlearncanvas-style")
Citation
Dataset: UnlearnCanvas (arXiv:2402.11846)
@article{zhang2024unlearncanvas,
title={UnlearnCanvas: A Stylized Image Dataset for Benchmarking Machine Unlearning Methods on Diffusion Models},
author={Zhang, Chongyu and Lin, JingHao and Li, Kuangqi and Deng, YanScholars and Schwing, Alexander},
journal={arXiv preprint arXiv:2402.11846},
year={2024}
}