SAVRN
Search Contact SAVRN

Open-weight model · Zero shot image classification

CLIP-convnext_base_w-laion2B-s13B-b82K-augreg

by LAION eV laion/CLIP-convnext_base_w-laion2B-s13B-b82K-augreg

A series of CLIP ConvNeXt-Base (w/ wide embed dim) models trained on subsets LAION-5B (https://laion.ai/blog/laion-5b/) using OpenCLIP (https://github.com/mlfoundations/openclip).

Parameters
Context
Weights1.4 GB
Licensemit
AccessOpen weights
Monthly Downloads1.3M

Model Card

By LAION eV, published under mit, revision f231e88547aa.

A series of CLIP ConvNeXt-Base (w/ wide embed dim) models trained on subsets LAION-5B (https://laion.ai/blog/laion-5b/) using OpenCLIP (https://github.com/mlfoundations/openclip). Explore an alternative to ViT and ResNet (w/ AttentionPooling) CLIP models that scales well with model size and image resolution First known ConvNeXt CLIP models trained at scale in the range of CLIP ViT-B/16 and RN50x4 models First released model weights exploring increase of augmentation + regularization for image tower via adding (greater scale range of RRC, random erasing, stochastic depth) The models utilize the timm ConvNeXt-Base model (convnextbase) as the image tower, and the same text tower as the RN50x4…

Read LAION eV's full model card

Model Card for CLIP-convnext_base_w.laion2B-s13B-b82k-augreg

Table of Contents

  1. Model Details
  2. Uses
  3. Training Details
  4. Evaluation
  5. Acknowledgements
  6. Citation

Model Details

Model Description

A series of CLIP ConvNeXt-Base (w/ wide embed dim) models trained on subsets LAION-5B (https://laion.ai/blog/laion-5b/) using OpenCLIP (https://github.com/mlfoundations/open_clip).

Goals: * Explore an alternative to ViT and ResNet (w/ AttentionPooling) CLIP models that scales well with model size and image resolution

Firsts: * First known ConvNeXt CLIP models trained at scale in the range of CLIP ViT-B/16 and RN50x4 models * First released model weights exploring increase of augmentation + regularization for image tower via adding (greater scale range of RRC, random erasing, stochastic depth)

The models utilize the timm ConvNeXt-Base model (convnext_base) as the image tower, and the same text tower as the RN50x4 (depth 12, embed dim 640) model from OpenAI CLIP. The base models are trained at 256x256 image resolution and roughly match the RN50x4 models on FLOPs and activation counts. The models with 320 in the name are trained at 320x320.

All models in this series were trained for 13B samples and have ImageNet Zero-Shot top-1 of >= 70.8%. Comparing to ViT-B/16 at 34B SS with zero-shot of 70.2% (68.1% for 13B SS) this suggests the ConvNeXt architecture may be more sample efficient in this range of model scale. More experiments needed to confirm.

Model Dataset Resolution AugReg Top-1 ImageNet Zero-Shot (%)
convnext_base_w.laion2b_s13b_b82k LAION-2B 256x256 RRC (0.9, 1.0) 70.8
convnext_base_w.laion2b_s13b_b82k_augreg LAION-2B 256x256 RRC (0.33, 1.0), RE (0.35), SD (0.1) 71.5
convnext_base_w.laion_aesthetic_s13b_b82k LAION-A 256x256 RRC (0.9, 1.0) 71.0
convnext_base_w_320.laion_aesthetic_s13b_b82k LAION-A 320x320 RRC (0.9, 1.0) 71.7
convnext_base_w_320.laion_aesthetic_s13b_b82k_augreg LAION-A 320x320 RRC (0.33, 1.0), RE (0.35), SD (0.1) 71.3

RRC = Random Resize Crop (crop pcts), RE = Random Erasing (prob), SD = Stochastic Depth (prob) -- image tower only

LAION-A = LAION Aesthetic, an ~900M sample subset of LAION-2B with pHash dedupe and asthetic score filtering.

Model training done by Ross Wightman across both the stability.ai cluster and the JUWELS Booster supercomputer. See acknowledgements below.

Uses

As per the original OpenAI CLIP model card, 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.

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.

Direct Use

Zero-shot image classification, image and text retrieval, among others.

Downstream Use

Image classification and other image task fine-tuning, linear probe image classification, image generation guiding and conditioning, among others.

Out-of-Scope Use

As per the OpenAI models,

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.

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.

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.

Further the above notice, the LAION-5B dataset used in training of these models has additional considerations, see below.

Training Details

Training Data

This model was trained with one of (see table in intro): * LAION-2B - A 2 billion sample English subset of LAION-5B (https://laion.ai/blog/laion-5b/). * LAION-Aesthetic - A 900M sample subset of LAION-2B with pHash dedupe and asthetic score filtering

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.

Training Procedure

All models were trained with a global batch size of 81920 for 64 checkpoint intervals of 203.7M samples for a total of ~13B samples seen over training.

For 256x256 models, a slurm script w/ srun below was used on 20 8-GPU (A100 40GB) nodes (Stability), switching to 40 4-GPU nodes for time on JUWELS.

/opt/slurm/sbin/srun --cpu_bind=v --accel-bind=gn python -m training.main \
    --save-frequency 1 \
    --name "convnext_256" \
    --resume 'latest' \
    --train-data="pipe:aws s3 cp s3://mybucket/path/{laion{00000..xxxxx}.tar -" \
    --train-num-samples 203666042 \
    --dataset-type webdataset \
    --precision amp_bfloat16 \
    --warmup 10000 \
    --batch-size=512 \
    --epochs=64 \
    --dataset-resampled \
    --clip-grad-norm 5.0 \
    --lr 1e-3 \
    --workers=6 \
    --model "convnext_base_w" \
    --seed 0 \
    --ddp-static-graph \
    --local-loss \
    --gather-with-grad \
    --grad-checkpointing

For 320x320 models, same as above but w/ 32 8-GPU nodes, local batch size 320, or 64 4-GPU nodes on JUWELs.

Evaluation

Evaluation done with code in the LAION CLIP Benchmark suite.

Testing Data, Factors & Metrics

Testing Data

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.

Results

The models achieve between 70.8 and 71.7 zero-shot top-1 accuracy on ImageNet-1k.

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

As part of exploring increased augmentation + regularization, early evalations suggest that augreg trained models evaluate well over a wider range of resolutions. This is especially true for the 320x320 LAION-A model, where the augreg run was lower than the non-augreg when evaluated at the train resolution of 320x320 (71.3 vs 71.7), but improves to 72.2 when evaluated at 384x384 (the non-augreg drops to 71.0 at 384x384).

Acknowledgements

Acknowledging 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).

Citation

BibTeX:

@inproceedings{schuhmann2022laionb,
  title={{LAION}-5B: An open large-scale dataset for training next generation image-text models},
  author={Christoph Schuhmann and
          Romain Beaumont and
          Richard Vencu and
          Cade W Gordon and
          Ross Wightman and
          Mehdi Cherti and
          Theo Coombes and
          Aarush Katta and
          Clayton Mullis and
          Mitchell Wortsman and
          Patrick Schramowski and
          Srivatsa R Kundurthy and
          Katherine Crowson and
          Ludwig Schmidt and
          Robert Kaczmarczyk and
          Jenia Jitsev},
  booktitle={Thirty-sixth Conference on Neural Information Processing Systems Datasets and Benchmarks Track},
  year={2022},
  url={https://openreview.net/forum?id=M3Y74vmsMcY}
}

OpenCLIP software

@software{ilharco_gabriel_2021_5143773,
  author       = {Ilharco, Gabriel and
                  Wortsman, Mitchell and
                  Wightman, Ross and
                  Gordon, Cade and
                  Carlini, Nicholas and
                  Taori, Rohan and
                  Dave, Achal and
                  Shankar, Vaishaal and
                  Namkoong, Hongseok and
                  Miller, John and
                  Hajishirzi, Hannaneh and
                  Farhadi, Ali and
                  Schmidt, Ludwig},
  title        = {OpenCLIP},
  month        = jul,
  year         = 2021,
  note         = {If you use this software, please cite it as below.},
  publisher    = {Zenodo},
  version      = {0.1},
  doi          = {10.5281/zenodo.5143773},
  url          = {https://doi.org/10.5281/zenodo.5143773}
}

OpenAI CLIP paper

@inproceedings{Radford2021LearningTV,
  title={Learning Transferable Visual Models From Natural Language Supervision},
  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},
  booktitle={ICML},
  year={2021}
}
@Article{liu2022convnet,
  author  = {Zhuang Liu and Hanzi Mao and Chao-Yuan Wu and Christoph Feichtenhofer and Trevor Darrell and Saining Xie},
  title   = {A ConvNet for the 2020s},
  journal = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
  year    = {2022},
}
@misc{rw2019timm,
  author = {Ross Wightman},
  title = {PyTorch Image Models},
  year = {2019},
  publisher = {GitHub},
  journal = {GitHub repository},
  doi = {10.5281/zenodo.4414861},
  howpublished = {\url{https://github.com/rwightman/pytorch-image-models}}
}

Identity and Version

Repository
laion/CLIP-convnext_base_w-laion2B-s13B-b82K-augreg
Publisher
LAION eV
Task
Zero shot image classification
Modality
Other
Library
open_clip
Parameters
Not stated by the source
Languages
Not stated by the source
Revision
f231e88547aac0dd86ad224432612fcf91aa4226
First published
2023-01-10
Last updated
2023-04-18

Files and Weights

17 files, 1.5 GB in total. The weights are 2 files totalling 1.4 GB in bin, safetensors.

Weights2 files · 1.4 GB
Configuration2 files · 1.1 KB
Tokenizer4 files · 3.6 MB
Documentation1 file · 12.6 KB
Other7 files · 52.5 MB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
open_clip_model.safetensorsWeights717.6 MB 10d40b48cf77
open_clip_pytorch_model.binWeights717.6 MB 249e2302c167
open_clip_config.jsonConfiguration591 B
special_tokens_map.jsonConfiguration472 B
README.mdDocumentation12.6 KB
convnext_base_w_zero_shot.csvOther3.0 KB
convnext_base_w_zero_shot.pngOther138.9 KB
tensorboard/events.out.tfevents.1672750551.jwb0258.juwels.16136.0Other13.5 MB 2a75485a2cca
tensorboard/events.out.tfevents.1672902868.jwb0962.juwels.17542.0Other13.9 MB f94f6c8d6983
tensorboard/events.out.tfevents.1673001505.jwb0066.juwels.4304.0Other1.6 MB 7d2274e22c66
tensorboard/events.out.tfevents.1673042436.jwb0009.juwels.11982.0Other13.8 MB 971690f123da
tensorboard/events.out.tfevents.1673130617.jwb0577.juwels.25937.0Other9.6 MB 04a494b77ff4
.gitattributesRepository1.5 KB
merges.txtTokenizer524.7 KB
tokenizer.jsonTokenizer2.2 MB
tokenizer_config.jsonTokenizer806 B
vocab.jsonTokenizer862.3 KB

License and Download

License
mit
Access
Open weights, no gate
Download size
1.4 GB
Download from LAION eV

Released by LAION eV through its official repository on Hugging Face. Read the license.

Built From

Memory Requirements

PrecisionWeights in memory
As published1.4 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About CLIP-convnext_base_w-laion2B-s13B-b82K-augreg

Can I use CLIP-convnext_base_w-laion2B-s13B-b82K-augreg commercially?

Yes. CLIP-convnext_base_w-laion2B-s13B-b82K-augreg is released under MIT License. The MIT License is a short permissive license. It permits commercial use, modification and redistribution, provided the copyright notice and permission notice are included.

Similar Models

Model · Zero shot image classification

clip-vit-base-patch32

OpenAI

Disclaimer: The model card is taken and modified from the official CLIP repository, it can be found here. The CLIP model was developed by researchers at OpenAI to learn about what contributes to robustness in computer vision tasks. The model was also developed to test the ability of models to generalize to arbitrary image classification tasks in a zero-shot manner. It was not developed for general model deployment - to deploy models like CLIP, researchers will first need to carefully study their capabilities in relation to the specific context they’re being deployed within. January 2021 The model uses a ViT-B/32 Transformer architecture as an image encoder and uses a masked self-attention…

Open weights 77 tokens transformers

Model · Zero shot image classification

clip-vit-large-patch14-336

OpenAI

This model was trained from scratch on an unknown dataset. It achieves the following results on the evaluation set: The following hyperparameters were used during training: - trainingprecision: float32 - Transformers 4.21.3 - TensorFlow 2.8.2 - Tokenizers 0.12.1

Open weights 77 tokens transformers

Model · Zero shot image classification

clip-vit-base-patch16

OpenAI

Disclaimer: The model card is taken and modified from the official CLIP repository, it can be found here. The CLIP model was developed by researchers at OpenAI to learn about what contributes to robustness in computer vision tasks. The model was also developed to test the ability of models to generalize to arbitrary image classification tasks in a zero-shot manner. It was not developed for general model deployment - to deploy models like CLIP, researchers will first need to carefully study their capabilities in relation to the specific context they’re being deployed within. January 2021 The base model uses a ViT-B/16 Transformer architecture as an image encoder and uses a masked…

Open weights 77 tokens transformers

Model · Zero shot image classification

DermLIP_ViT-B-16

Siyuan Yan

DermLIP is a vision-language model for dermatology, trained on the Derm1M dataset—the largest dermatological image-text corpus to date. python import openclip from PIL import Image import torch model,, preprocess = openclip.createmodelandtransforms( 'hf-hub:redlessone/DermLIPViT-B-16' model.eval() tokenizer = openclip.gettokenizer('hf-hub:redlessone/DermLIPViT-B-16') image = preprocess(Image.open("yourskinimage.png")).unsqueeze(0) PADCLASSNAMES = [ "nevus", "basal cell carcinoma", "actinic keratosis", "seborrheic keratosis", "squamous cell carcinoma", "melanoma" template = lambda c: f'This is a skin image of {c}' text = tokenizer([template(c) for c in PADCLASSNAMES]) with torch.nograd()…

Open weights cc-by-4.0 transformers

Model · Zero shot image classification

DermFM-Zero

Siyuan Yan

DermFM-Zero is a dermatology vision–language foundation model. It pairs a PanDerm ViT-L/16 vision encoder with native-resolution input (NaViT patch-and-pack) and a PubMedBERT-256 text encoder pretrained on a Derm1M knowledge tree (KEP), aligned on 517,455 public dermatology image–text pairs with multi-aspect knowledge contrastive learning (MAKE) and knowledge distillation. It performs zero-shot diagnosis and cross-modal retrieval, serves as a backbone for multimodal fine-tuning and VQA, and yields interpretable concepts through sparse autoencoders. Across extensive benchmarks and three multinational reader studies, DermFM-Zero achieves state-of-the-art zero-shot performance while improving…

Open weights cc-by-nc-nd-4.0 transformers

Model · Zero shot image classification

CLIP-ViT-B-32-laion2B-s34B-b79K

LAION eV

A CLIP ViT-B/32 model trained with the LAION-2B English subset of LAION-5B (https://laion.ai/blog/laion-5b/) using OpenCLIP (https://github.com/mlfoundations/openclip). Model training done by Romain Beaumont on the stability.ai cluster. As per the original OpenAI CLIP model card, 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. The OpenAI CLIP paper includes a discussion of potential downstream impacts to provide an example for this sort of analysis.…

Open weights mit 151M parameters 77 tokens open_clip