MHuangX commited on
Commit
30adb0f
ยท
verified ยท
1 Parent(s): f52cca4

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +203 -3
README.md CHANGED
@@ -1,3 +1,203 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-sa-4.0
3
+ task_categories:
4
+ - image-classification
5
+ - zero-shot-classification
6
+ language:
7
+ - en
8
+ tags:
9
+ - vision-language
10
+ - CLIP
11
+ - out-of-pre-training
12
+ - OOP
13
+ - benchmark
14
+ - multimodal
15
+ - few-shot
16
+ - zero-shot
17
+ pretty_name: LAION-Beyond
18
+ size_categories:
19
+ - 100K<n<1M
20
+ ---
21
+
22
+ # LAION-Beyond
23
+
24
+ **LAION-Beyond: Reproducible Vision-Language Models Meet Concepts Out of Pre-Training**
25
+
26
+ ๐Ÿ“„ [Paper (CVPR 2025)](https://openaccess.thecvf.com/content/CVPR2025/papers/Chen_Reproducible_Vision-Language_Models_Meet_Concepts_Out_of_Pre-Training_CVPR_2025_paper.pdf) | ๐Ÿ’ป [Code](https://github.com/M-HuangX/LAION-Beyond) | ๐ŸŒ [Project Page](https://m-huangx.github.io/laion_beyond/)
27
+
28
+ ---
29
+
30
+ ## Dataset Summary
31
+
32
+ LAION-Beyond is the **first multi-domain benchmark** specifically designed to evaluate the Out-of-Pre-training (OOP) generalization of vision-language models (e.g., CLIP, OpenCLIP, EVA-CLIP).
33
+
34
+ We distinguish two types of visual concepts:
35
+ - **IP (In-Pre-training)**: concepts that appear in the pre-training data (e.g., LAION-400M / 2B / 5B)
36
+ - **OOP (Out-of-Pre-training)**: concepts entirely absent from the pre-training data
37
+
38
+ The key finding of our paper is that despite OpenCLIP's image encoder forming well-separated clusters for OOP concepts, **zero-shot transfer fails significantly** due to poor image-text alignment โ€” the token embeddings for OOP class names were never aligned with visual features during pre-training.
39
+
40
+ ---
41
+
42
+ ## Dataset Statistics
43
+
44
+ | Split | Images | Concepts |
45
+ |-------|--------|----------|
46
+ | OOP | 106,052 | 674 |
47
+ | IP | 51,330 | 324 |
48
+ | **Total** | **157,382** | **998** |
49
+
50
+ The dataset spans **9 diverse domains**:
51
+ - ๐Ÿพ Animals
52
+ - ๐Ÿ›๏ธ Architecture
53
+ - ๐Ÿ‘˜ Attire
54
+ - ๐ŸŽจ FolkArt
55
+ - ๐Ÿœ Food
56
+ - ๐Ÿฆ‹ Insects & Spiders
57
+ - ๐Ÿ—บ๏ธ Landmark
58
+ - ๐ŸŒฟ Plants & Fungi
59
+ - ๐ŸŽฎ Pokemon
60
+
61
+ Each domain contains an IP subset and an OOP subset, covering LAION-400M, LAION-2B, and LAION-5B scales to support neural scaling law research.
62
+
63
+ ---
64
+
65
+ ## Dataset Structure
66
+
67
+ Each domain folder is named `{Domain}{NumClasses}_{IP/OOP}`, e.g., `Animals42_IP`, `Animals92_OOP`.
68
+
69
+ ```
70
+ LAION_Beyond/
71
+ โ”œโ”€โ”€ Animals42_IP/
72
+ โ”‚ โ”œโ”€โ”€ images/ # jpg images organized by class
73
+ โ”‚ โ”œโ”€โ”€ label2name.json # label index โ†’ class name
74
+ โ”‚ โ”œโ”€โ”€ name2label.json # class name โ†’ label index
75
+ โ”‚ โ”œโ”€โ”€ merged_mapping.json # merged label mapping
76
+ โ”‚ โ””โ”€โ”€ split_Xin_Animals42_IP.json # train/val/test split info
77
+ โ”œโ”€โ”€ Animals92_OOP/
78
+ โ”‚ โ””โ”€โ”€ ...
79
+ โ”œโ”€โ”€ Architecture23_IP/
80
+ โ”œโ”€โ”€ Architecture50_OOP/
81
+ โ”œโ”€โ”€ Attire28_IP/
82
+ โ”œโ”€โ”€ Attire54_OOP/
83
+ โ”œโ”€โ”€ FolkArt27_IP/
84
+ โ”œโ”€โ”€ FolkArt59_OOP/
85
+ โ”œโ”€โ”€ Food27_IP/
86
+ โ”œโ”€โ”€ Food53_OOP/
87
+ โ”œโ”€โ”€ Insects_Spiders52_IP/
88
+ โ”œโ”€โ”€ Insects_Spiders106_OOP/
89
+ โ”œโ”€โ”€ Landmark30_IP/
90
+ โ”œโ”€โ”€ Landmark59_OOP/
91
+ โ”œโ”€โ”€ Plants_Fugi56_IP/
92
+ โ”œโ”€โ”€ Plants_Fugi113_OOP/
93
+ โ”œโ”€โ”€ Pokemon39_IP/
94
+ โ””โ”€โ”€ Pokemon89_OOP/
95
+ ```
96
+
97
+ ### File Descriptions
98
+
99
+ | File | Description |
100
+ |------|-------------|
101
+ | `images/` | Raw image files (JPG), organized by class subfolder |
102
+ | `label2name.json` | Mapping from integer label to class name string |
103
+ | `name2label.json` | Mapping from class name string to integer label |
104
+ | `merged_mapping.json` | Combined label mapping across splits |
105
+ | `split_Xin_*.json` | Train / val / test split assignments per image |
106
+
107
+ ---
108
+
109
+ ## Loading the Dataset
110
+
111
+ ### Option 1: Direct file access (recommended)
112
+
113
+ ```python
114
+ import json
115
+ import os
116
+ from PIL import Image
117
+
118
+ domain = "Animals42_IP"
119
+ root = f"path/to/LAION_Beyond/{domain}"
120
+
121
+ # Load label mapping
122
+ with open(os.path.join(root, "label2name.json")) as f:
123
+ label2name = json.load(f)
124
+
125
+ # Load split info
126
+ with open(os.path.join(root, f"split_Xin_{domain}.json")) as f:
127
+ split_info = json.load(f)
128
+
129
+ # Load an image
130
+ img = Image.open(os.path.join(root, "images", "some_class", "image.jpg"))
131
+ ```
132
+
133
+ ### Option 2: Using HuggingFace `datasets`
134
+
135
+ ```python
136
+ from datasets import load_dataset
137
+
138
+ dataset = load_dataset("MHuangX/LAION-Beyond")
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Key Findings
144
+
145
+ 1. **Strong image features for OOP concepts**: OpenCLIP's image encoder forms well-separated clusters for OOP concepts (clustering accuracy gap < 3% on most domains vs. IP concepts).
146
+
147
+ 2. **Image-text alignment failure**: Zero-shot accuracy on OOP concepts is significantly lower than IP concepts, persisting even as pre-training data scales from 400M to 5B.
148
+
149
+ 3. **Name-tuning is the key**: Our proposed FSNL and ZSNL algorithms, which fine-tune only the name (token) embeddings of OOP concepts, efficiently restore OOP generalization without degrading IP performance.
150
+
151
+ ---
152
+
153
+ ## Algorithms
154
+
155
+ ### FSNL โ€” Few-Shot Name Learning
156
+ Optimizes only OOP concept name embeddings using a few image-text pairs, with context augmentation via similar concept shuffling. Achieves state-of-the-art on 8/9 domains.
157
+
158
+ ### ZSNL โ€” Zero-Shot Name Learning
159
+ Requires no image-text pairs. Uses Novel Class Discovery (NCD) and image-text bipartite graph matching to optimize OOP name embeddings from unlabeled images only.
160
+
161
+ ---
162
+
163
+ ## Benchmark Results (400M split)
164
+
165
+ ### OOP Few-Shot Learning (4-shot, H-mean of OOP & IP accuracy)
166
+
167
+ | Method | Animals | Architecture | Attire | FolkArt | Food | Insects | Landmark | Plants | Pokemon | Avg |
168
+ |--------|---------|--------------|--------|---------|------|---------|---------|--------|---------|-----|
169
+ | OpenCLIP | 26.75 | 30.75 | 25.88 | 35.04 | 15.36 | 22.38 | 40.25 | 21.43 | 24.48 | 26.92 |
170
+ | CoOp | 31.37 | 57.8 | 50.39 | 52.06 | 42.55 | 25.73 | 85.89 | 24.78 | 35.52 | 45.12 |
171
+ | CLIP-Adapter | 38.98 | 59.27 | 64.56 | 56.32 | 64.32 | 32.51 | 90.82 | 31.97 | 54.99 | 54.86 |
172
+ | **FSNL (ours)** | **46.17** | **62.63** | **71.65** | **63.03** | **70.0** | **44.03** | **94.48** | **44.12** | **68.87** | **62.55** |
173
+
174
+ ---
175
+
176
+ ## Citation
177
+
178
+ If you use LAION-Beyond in your research, please cite:
179
+
180
+ ```bibtex
181
+ @inproceedings{chen2025laionbeyond,
182
+ title={Reproducible Vision-Language Models Meet Concepts Out of Pre-Training},
183
+ author={Chen, Ziliang and Huang, Xin and Fan, Xiaoxuan and Wang, Keze and Zhou, Yuyu and Guan, Quanlong and Lin, Liang},
184
+ booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
185
+ year={2025}
186
+ }
187
+ ```
188
+
189
+ ---
190
+
191
+ ## License
192
+
193
+ This dataset is released under the [Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA 4.0)](http://creativecommons.org/licenses/by-sa/4.0/).
194
+
195
+ ---
196
+
197
+ ## Authors
198
+
199
+ [Xin Huang](https://www.linkedin.com/in/mhuangx/)โ€ , [Ziliang Chen](https://scholar.google.com/citations?user=RC-LN4QAAAAJ&hl=en)โ€ , Xiaoxuan Fan, [Keze Wang](https://kezewang.com/), Yuyu Zhou, [Quanlong Guan](https://scholar.google.com/citations?user=v4JiSqsAAAAJ&hl=en), [Liang Lin](http://www.linliang.net/)*
200
+
201
+ Affiliations: Peng Cheng Laboratory, Sun Yat-sen University, EPFL, Jinan University
202
+
203
+ โ€ Equal Contribution ยท *Corresponding Author