rwightman HF staff commited on
Commit
ef4a41a
1 Parent(s): bdc37c7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +256 -0
README.md CHANGED
@@ -6,3 +6,259 @@ library_tag: open_clip
6
  license: mit
7
  ---
8
  # Model card for CLIP-convnext_xxlarge-laion2B-s34B-b82K-augreg
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  license: mit
7
  ---
8
  # Model card for CLIP-convnext_xxlarge-laion2B-s34B-b82K-augreg
9
+
10
+ # Table of Contents
11
+
12
+ 1. [Model Details](#model-details)
13
+ 2. [Uses](#uses)
14
+ 3. [Training Details](#training-details)
15
+ 4. [Evaluation](#evaluation)
16
+ 5. [Acknowledgements](#acknowledgements)
17
+ 6. [Citation](#citation)
18
+
19
+ # Model Details
20
+
21
+ ## Model Description
22
+
23
+ A series of CLIP ConvNeXt-XXLarge (a custom `timm` ConvNeXt size) models trained on LAION-2B (english), a subset of [LAION-5B](https://arxiv.org/abs/2210.08402), using [OpenCLIP](https://github.com/mlfoundations/open_clip).
24
+
25
+ Goals:
26
+ * Push the size of largest convolutional CLIP image tower into the performance range of ViT-g to ViT-G w/ improved image size scaling for downstream use.
27
+
28
+ Firsts:
29
+ * Largest released ConvNeXt model pretrained (847M params,)
30
+ * A non-ViT image tower CLIP model (with no previous image tower pretrain) achieving > 79% ImageNet top-1 zero-shot
31
+
32
+ The models utilize:
33
+ * the [timm](https://github.com/rwightman/pytorch-image-models) ConvNeXt-XXLarge model (`convnext_xxlarge`) as the image tower
34
+ * a standard projection at end of image tower
35
+ * a text tower with same size (with 1024, heads 16, depth 24) as ViT-H-14 and ViT-g-14 models
36
+
37
+ The models are trained at 256x256 image resolution.
38
+
39
+ At 256x256, the ConvNext-XXLarge sits just above a ViT-H-14 CLIP configuration in FLOPS and params while being lower in activation counts. It is well under both g-14 and G-14 while being between them in capabilities.
40
+
41
+ | Model | Dataset | Resolution | AugReg | Top-1 ImageNet Zero-Shot (%) |
42
+ | ----- | ------- | ---------- | ------------ | --------- |
43
+ | [convnext_xxlarge.laion2b_s34b_b82k-augreg](CLIP-convnext_xxlarge-laion2B-s34B-b82K-augreg) | LAION-2B | 256x256 | RRC (0.33, 1.0), RE (0.35), SD (0.1), D(0.1) | 79.1 |
44
+ | [convnext_xxlarge.laion2b_s34b_b82k-augreg-rewind](CLIP-convnext_xxlarge-laion2B-s34B-b82K-augreg-rewind) | LAION-2B | 256x256 | RRC (0.3, 1.0), RE (0.4), SD (0.1) | 79.3 |
45
+ | [convnext_xxlarge.laion2b_s34b_b82k-augreg-soup](CLIP-convnext_xxlarge-laion2B-s34B-b82K-augreg-soup) | LAION-2B | 256x256 | N/A | 79.4 |
46
+
47
+ RRC = Random Resize Crop (crop pcts), RE = Random Erasing (prob), SD = Stochastic Depth (prob) -- image tower only
48
+
49
+ The core training run was performed in pieces over a period of ~ 2 months. The global batch size for the core run was 81920. The last ~10% of training was re-done at a 95744 global batch size w/ higher LR and aug than original finish. The two were averaged together in a 'soup'. See more details in [Training Details](#training-details).
50
+
51
+ Model training done by Ross Wightman across both the [stability.ai](https://stability.ai/) cluster and the [JUWELS Booster](https://apps.fz-juelich.de/jsc/hps/juwels/booster-overview.html) supercomputer. See acknowledgements below.
52
+
53
+ # Uses
54
+
55
+ As per the original [OpenAI CLIP model card](https://github.com/openai/CLIP/blob/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1/model-card.md), this model is intended as a research output for research communities. We hope that this model will enable researchers to better understand and explore zero-shot, arbitrary image classification. We also hope it can be used for interdisciplinary studies of the potential impact of such model.
56
+
57
+ The OpenAI CLIP paper includes a discussion of potential downstream impacts to provide an example for this sort of analysis. Additionally, the LAION-5B blog (https://laion.ai/blog/laion-5b/) and upcoming paper include additional discussion as it relates specifically to the training dataset.
58
+
59
+ ## Direct Use
60
+
61
+ Zero-shot image classification, image and text retrieval, among others.
62
+
63
+ ## Downstream Use
64
+
65
+ Image classification and other image task fine-tuning, linear probe image classification, image generation guiding and conditioning, among others.
66
+
67
+ ## Out-of-Scope Use
68
+
69
+ As per the OpenAI models,
70
+
71
+ **Any** deployed use case of the model - whether commercial or not - is currently out of scope. Non-deployed use cases such as image search in a constrained environment, are also not recommended unless there is thorough in-domain testing of the model with a specific, fixed class taxonomy. This is because our safety assessment demonstrated a high need for task specific testing especially given the variability of CLIP’s performance with different class taxonomies. This makes untested and unconstrained deployment of the model in any use case currently potentially harmful.
72
+
73
+ Certain use cases which would fall under the domain of surveillance and facial recognition are always out-of-scope regardless of performance of the model. This is because the use of artificial intelligence for tasks such as these can be premature currently given the lack of testing norms and checks to ensure its fair use.
74
+
75
+ Since the model has not been purposefully trained in or evaluated on any languages other than English, its use should be limited to English language use cases.
76
+
77
+ Further the above notice, the LAION-5B dataset used in training of these models has additional considerations, see below.
78
+
79
+ # Training Details
80
+
81
+ ## Training Data
82
+
83
+ This model was trained with LAION-2B -- A 2 billion sample English subset of LAION-5B (https://laion.ai/blog/laion-5b/).
84
+
85
+ **IMPORTANT NOTE:** The motivation behind dataset creation is to democratize research and experimentation around large-scale multi-modal model training and handling of uncurated, large-scale datasets crawled from publically available internet. Our recommendation is therefore to use the dataset for research purposes. Be aware that this large-scale dataset is uncurated. Keep in mind that the uncurated nature of the dataset means that collected links may lead to strongly discomforting and disturbing content for a human viewer. Therefore, please use the demo links with caution and at your own risk. It is possible to extract a “safe” subset by filtering out samples based on the safety tags (using a customized trained NSFW classifier that we built). While this strongly reduces the chance for encountering potentially harmful content when viewing, we cannot entirely exclude the possibility for harmful content being still present in safe mode, so that the warning holds also there. We think that providing the dataset openly to broad research and other interested communities will allow for transparent investigation of benefits that come along with training large-scale models as well as pitfalls and dangers that may stay unreported or unnoticed when working with closed large datasets that remain restricted to a small community. Providing our dataset openly, we however do not recommend using it for creating ready-to-go industrial products, as the basic research about general properties and safety of such large-scale models, which we would like to encourage with this release, is still in progress.
86
+
87
+ ## Training Procedure
88
+
89
+ The main training run was done at global batch size of 81920 for 256 checkpoint intervals of 135.6M samples for a total of ~34B samples seen over training.
90
+
91
+ For 256x256 models, a slurm script w/ srun below for a 128 8-GPU (40GB A100) configuration:
92
+
93
+ ```
94
+ srun --cpu_bind=v --accel-bind=gn python -m training.main \
95
+ --save-frequency 1 \
96
+ --name "xxlarge-2b-81920-bf16" \
97
+ --resume "latest" \
98
+ --logs "/runs" \
99
+ --log-every-n-steps 50 \
100
+ --train-data="pipe:aws s3 cp s3://laion5b/laion2B-data/{000000..231349}.tar -" \
101
+ --train-num-samples 135646078 \
102
+ --dataset-type webdataset \
103
+ --warmup 10000 \
104
+ --batch-size=80 \
105
+ --epochs=256 \
106
+ --dataset-resampled \
107
+ --aug-cfg use_timm=True scale='(0.33, 1.0)' re_prob=0.35 \
108
+ --precision amp_bfloat16 \
109
+ --grad-clip-norm 5.0 \
110
+ --lr 1e-3 \
111
+ --workers=6 \
112
+ --beta2 0.98 \
113
+ --model "convnext_xxlarge" \
114
+ --seed 0 \
115
+ --ddp-static-graph \
116
+ --local-loss \
117
+ --gather-with-grad \
118
+ --grad-checkpointing \
119
+ --report-to "tensorboard"
120
+ ```
121
+
122
+ For the rewind of last 10%, a higher global batch size of 95744 was used w/ a higher LR and slightly increased augmentation strength. The slurm srun cmd for 136 8-GPU (40GB A100) nodes:
123
+ ```
124
+ srun --cpu_bind=v --accel-bind=gn python -m training.main \
125
+ --save-frequency 1 \
126
+ --name "xxlarge-2b-81920-r-bf16" \
127
+ --resume "latest" \
128
+ --logs "/runs" \
129
+ --log-every-n-steps 50 \
130
+ --train-data="pipe:aws s3 cp s3://laion5b/laion2B-data/{000000..231349}.tar -" \
131
+ --train-num-samples 135646078 \
132
+ --dataset-type webdataset \
133
+ --warmup 10000 \
134
+ --batch-size=88 \
135
+ --epochs=256 \
136
+ --dataset-resampled \
137
+ --aug-cfg use_timm=True scale='(0.3, 1.0)' re_prob=0.4 \
138
+ --precision amp_bfloat16 \
139
+ --grad-clip-norm 5.0 \
140
+ --lr 2e-3 \
141
+ --workers=6 \
142
+ --beta2 0.98 \
143
+ --model "convnext_xxlarge" \
144
+ --seed 0 \
145
+ --ddp-static-graph \
146
+ --local-loss \
147
+ --gather-with-grad \
148
+ --grad-checkpointing \
149
+ --report-to "tensorboard"
150
+ ```
151
+
152
+ # Evaluation
153
+
154
+ Evaluation done with code in the [LAION CLIP Benchmark suite](https://github.com/LAION-AI/CLIP_benchmark).
155
+
156
+ ## Testing Data, Factors & Metrics
157
+
158
+ ### Testing Data
159
+
160
+ The testing is performed with VTAB+ (A combination of VTAB (https://arxiv.org/abs/1910.04867) w/ additional robustness datasets) for classification and COCO and Flickr for retrieval.
161
+
162
+ ## Results
163
+
164
+ These models achieve between 79.1 and 79.4 top-1 zero-shot accuracy on ImageNet-1k.
165
+
166
+ ![](convnext_xxlarge_zero_shot.png)
167
+
168
+ Zoom:
169
+
170
+ ![](convnext_xxlarge_zero_shot_zoom.png)
171
+
172
+ An initial round of benchmarks have been performed on a wider range of datasets, to be viewable at https://github.com/LAION-AI/CLIP_benchmark/blob/main/benchmark/results.ipynb
173
+
174
+ # Acknowledgements
175
+
176
+ Acknowledging [stability.ai](https://stability.ai/) and the Gauss Centre for Supercomputing e.V. (http://gauss-centre.eu) for funding this part of work by providing computing time through the John von Neumann Institute for Computing (NIC) on the GCS Supercomputer JUWELS Booster at Jülich Supercomputing Centre (JSC).
177
+
178
+ # Citation
179
+
180
+ **BibTeX:**
181
+
182
+ LAION-5B
183
+ ```bibtex
184
+ @inproceedings{schuhmann2022laionb,
185
+ title={{LAION}-5B: An open large-scale dataset for training next generation image-text models},
186
+ author={Christoph Schuhmann and
187
+ Romain Beaumont and
188
+ Richard Vencu and
189
+ Cade W Gordon and
190
+ Ross Wightman and
191
+ Mehdi Cherti and
192
+ Theo Coombes and
193
+ Aarush Katta and
194
+ Clayton Mullis and
195
+ Mitchell Wortsman and
196
+ Patrick Schramowski and
197
+ Srivatsa R Kundurthy and
198
+ Katherine Crowson and
199
+ Ludwig Schmidt and
200
+ Robert Kaczmarczyk and
201
+ Jenia Jitsev},
202
+ booktitle={Thirty-sixth Conference on Neural Information Processing Systems Datasets and Benchmarks Track},
203
+ year={2022},
204
+ url={https://openreview.net/forum?id=M3Y74vmsMcY}
205
+ }
206
+ ```
207
+
208
+ OpenCLIP software
209
+ ```bibtex
210
+ @software{ilharco_gabriel_2021_5143773,
211
+ author = {Ilharco, Gabriel and
212
+ Wortsman, Mitchell and
213
+ Wightman, Ross and
214
+ Gordon, Cade and
215
+ Carlini, Nicholas and
216
+ Taori, Rohan and
217
+ Dave, Achal and
218
+ Shankar, Vaishaal and
219
+ Namkoong, Hongseok and
220
+ Miller, John and
221
+ Hajishirzi, Hannaneh and
222
+ Farhadi, Ali and
223
+ Schmidt, Ludwig},
224
+ title = {OpenCLIP},
225
+ month = jul,
226
+ year = 2021,
227
+ note = {If you use this software, please cite it as below.},
228
+ publisher = {Zenodo},
229
+ version = {0.1},
230
+ doi = {10.5281/zenodo.5143773},
231
+ url = {https://doi.org/10.5281/zenodo.5143773}
232
+ }
233
+ ```
234
+
235
+ OpenAI CLIP paper
236
+ ```bibtex
237
+ @inproceedings{Radford2021LearningTV,
238
+ title={Learning Transferable Visual Models From Natural Language Supervision},
239
+ author={Alec Radford and Jong Wook Kim and Chris Hallacy and A. Ramesh and Gabriel Goh and Sandhini Agarwal and Girish Sastry and Amanda Askell and Pamela Mishkin and Jack Clark and Gretchen Krueger and Ilya Sutskever},
240
+ booktitle={ICML},
241
+ year={2021}
242
+ }
243
+ ```
244
+
245
+ ```bibtex
246
+ @Article{liu2022convnet,
247
+ author = {Zhuang Liu and Hanzi Mao and Chao-Yuan Wu and Christoph Feichtenhofer and Trevor Darrell and Saining Xie},
248
+ title = {A ConvNet for the 2020s},
249
+ journal = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
250
+ year = {2022},
251
+ }
252
+ ```
253
+
254
+ ```bibtex
255
+ @misc{rw2019timm,
256
+ author = {Ross Wightman},
257
+ title = {PyTorch Image Models},
258
+ year = {2019},
259
+ publisher = {GitHub},
260
+ journal = {GitHub repository},
261
+ doi = {10.5281/zenodo.4414861},
262
+ howpublished = {\url{https://github.com/rwightman/pytorch-image-models}}
263
+ }
264
+ ```