Yiyuan commited on
Commit
80c579e
·
1 Parent(s): d6d798b

update readme

Browse files
Files changed (1) hide show
  1. README.md +217 -0
README.md CHANGED
@@ -1,3 +1,220 @@
1
  ---
 
 
 
 
2
  license: apache-2.0
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ tags:
3
+ - zero-shot-image-classification
4
+ - clip
5
+ library_tag: open_clip
6
  license: apache-2.0
7
+ library_name: open_clip
8
+ pipeline_tag: zero-shot-image-classification
9
  ---
10
+ # Model card for CLIP-UniRepLKNet_large-laion5B-s11B-b75K
11
+
12
+ # Table of Contents
13
+ 1. [Quick Start](#model-details)
14
+ 2. [Model Details](#model-details)
15
+ 3. [Uses](#uses)
16
+ 4. [Training Details](#training-details)
17
+ 5. [Evaluation](#evaluation)
18
+ 6. [Citation](#citation)
19
+
20
+ # Quick Start
21
+ ```python
22
+ model_large = unireplknet_l()
23
+ print(model_large)
24
+ ckpt = torch.load("UniRepLKNet-L-b75k_s10B_CLIP-in1k_75.72.pt")
25
+ model_large.load_state_dict(ckpt,strict=False)
26
+ # Since we do not need cls heads in CLIP pretraining.
27
+ print("Loaded CLIP Pretrained Models")
28
+ ```
29
+ # Model Details
30
+
31
+ ## Model Description
32
+
33
+ A series of CLIP UniRepLKNet 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).
34
+
35
+ | Model | Dataset | Resolution | Top-1 ImageNet Zero-Shot (%) |
36
+ | ----- | ------- | ---------- | ------------ |
37
+ | [UniRepLKNet_large.laion5b_s11b_b75k](https://huggingface.co/Yiyuan/CLIP-UniRepLKNet-L-laion5B-s10B-b75k) | LAION-5B | 224x224 | 75.7 |
38
+
39
+
40
+ The core training run was performed in pieces over a period of ~ 2 months. The global batch size for the core run was 76800. The last ~25% of training was re-done at a 320x320 image resolution. See more details in [Training Details](#training-details).
41
+
42
+ Goals:
43
+ * 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.
44
+
45
+ Firsts:
46
+ * Largest released ConvNeXt model pretrained (847M params w/ 198 GMAC and 125 MActs @ 256x256 for image)
47
+ * A non-ViT image tower CLIP model (with no previous image tower pretrain) achieving > 79% ImageNet top-1 zero-shot
48
+
49
+ The models utilize:
50
+ * the UniRepLKNet model (`unireplknet_l`) as the image tower
51
+ * a standard projection at end of image tower
52
+ * a text tower with same size (with 1024, heads 16, depth 24) as ViT-H-14 and ViT-g-14 models
53
+
54
+
55
+ The models are trained at 224x224 image resolution at the beginning 192 epochs, then they're rewinded to 320x320 image resolution in the following 64 epochs. The size of the combined image + text CLIP model is 1.2B params w/ 222 GMAC and 146 MActs. UniRepLKNet excels in the both training and inference efficiency.
56
+
57
+
58
+ 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.
59
+
60
+ # Uses
61
+
62
+ 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.
63
+
64
+ 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.
65
+
66
+ ## Direct Use
67
+
68
+ Zero-shot image classification, image and text retrieval, among others.
69
+
70
+ ## Downstream Use
71
+
72
+ Image classification and other image task fine-tuning, linear probe image classification, image generation guiding and conditioning, among others.
73
+
74
+ ## Out-of-Scope Use
75
+
76
+ As per the OpenAI models,
77
+
78
+ **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.
79
+
80
+ 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.
81
+
82
+ 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.
83
+
84
+ Further the above notice, the LAION-5B dataset used in training of these models has additional considerations, see below.
85
+
86
+ # Training Details
87
+
88
+ ## Training Data
89
+
90
+ This model was trained with LAION-2B -- A 2 billion sample English subset of LAION-5B (https://laion.ai/blog/laion-5b/).
91
+
92
+ ## Training Procedure
93
+
94
+ The main training run was done at global batch size of 76800 for 256 checkpoint intervals of 45M samples for a total of ~11.5B samples seen over training.
95
+
96
+
97
+ A slurm srun command line below for a 128 8-GPU (40GB A100) configuration:
98
+
99
+ ```
100
+ srun --cpu_bind=v --accel-bind=gn python -m training.main \
101
+ --save-frequency 1 \
102
+ --name "large-5b-76800-bf16" \
103
+ --resume "latest" \
104
+ --logs "/runs" \
105
+ --log-every-n-steps 100 \
106
+ --train-data="pipe:aws s3 cp s3://laion5b/laion2B-data/{000000..231349}.tar -" \
107
+ --train-num-samples 45646078 \
108
+ --dataset-type webdataset \
109
+ --warmup 10000 \
110
+ --batch-size=600 \
111
+ --epochs=256 \
112
+ --dataset-resampled \
113
+ --precision amp_bfloat16 \
114
+ --grad-clip-norm 5.0 \
115
+ --lr 5e-4 \
116
+ --workers=6 \
117
+ --beta2 0.99 \
118
+ --model "unireplknet_l" \
119
+ --seed 0 \
120
+ --ddp-static-graph \
121
+ --local-loss \
122
+ --gather-with-grad \
123
+ --grad-checkpointing \
124
+ --report-to "tensorboard"
125
+ ```
126
+
127
+
128
+ # Evaluation
129
+
130
+ Evaluation done with code in the [LAION CLIP Benchmark suite](https://github.com/LAION-AI/CLIP_benchmark).
131
+
132
+
133
+ ## Results
134
+
135
+ These models achieve between 75.7 and 76.3 top-1 zero-shot accuracy on ImageNet-1k.
136
+
137
+
138
+ # Citation
139
+
140
+ **BibTeX:**
141
+
142
+ UniRepLKNet
143
+
144
+ ```bibtex
145
+ @inproceedings{ding2024unireplknet,
146
+ title={UniRepLKNet: A Universal Perception Large-Kernel ConvNet for Audio Video Point Cloud Time-Series and Image Recognition},
147
+ author={Ding, Xiaohan and Zhang, Yiyuan and Ge, Yixiao and Zhao, Sijie and Song, Lin and Yue, Xiangyu and Shan, Ying},
148
+ booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
149
+ pages={5513--5524},
150
+ year={2024}
151
+ }
152
+ ```
153
+
154
+ LAION-5B
155
+ ```bibtex
156
+ @inproceedings{schuhmann2022laionb,
157
+ title={{LAION}-5B: An open large-scale dataset for training next generation image-text models},
158
+ author={Christoph Schuhmann and
159
+ Romain Beaumont and
160
+ Richard Vencu and
161
+ Cade W Gordon and
162
+ Ross Wightman and
163
+ Mehdi Cherti and
164
+ Theo Coombes and
165
+ Aarush Katta and
166
+ Clayton Mullis and
167
+ Mitchell Wortsman and
168
+ Patrick Schramowski and
169
+ Srivatsa R Kundurthy and
170
+ Katherine Crowson and
171
+ Ludwig Schmidt and
172
+ Robert Kaczmarczyk and
173
+ Jenia Jitsev},
174
+ booktitle={Thirty-sixth Conference on Neural Information Processing Systems Datasets and Benchmarks Track},
175
+ year={2022},
176
+ url={https://openreview.net/forum?id=M3Y74vmsMcY}
177
+ }
178
+ ```
179
+
180
+ OpenCLIP software
181
+ ```bibtex
182
+ @software{ilharco_gabriel_2021_5143773,
183
+ author = {Ilharco, Gabriel and
184
+ Wortsman, Mitchell and
185
+ Wightman, Ross and
186
+ Gordon, Cade and
187
+ Carlini, Nicholas and
188
+ Taori, Rohan and
189
+ Dave, Achal and
190
+ Shankar, Vaishaal and
191
+ Namkoong, Hongseok and
192
+ Miller, John and
193
+ Hajishirzi, Hannaneh and
194
+ Farhadi, Ali and
195
+ Schmidt, Ludwig},
196
+ title = {OpenCLIP},
197
+ month = jul,
198
+ year = 2021,
199
+ note = {If you use this software, please cite it as below.},
200
+ publisher = {Zenodo},
201
+ version = {0.1},
202
+ doi = {10.5281/zenodo.5143773},
203
+ url = {https://doi.org/10.5281/zenodo.5143773}
204
+ }
205
+ ```
206
+
207
+ OpenAI CLIP paper
208
+
209
+
210
+ ```bibtex
211
+ @misc{rw2019timm,
212
+ author = {Ross Wightman},
213
+ title = {PyTorch Image Models},
214
+ year = {2019},
215
+ publisher = {GitHub},
216
+ journal = {GitHub repository},
217
+ doi = {10.5281/zenodo.4414861},
218
+ howpublished = {\url{https://github.com/rwightman/pytorch-image-models}}
219
+ }
220
+ ```