nazneen's picture
model documentation
ee02ce7
metadata
tags:
  - generated_from_keras_callback
widget:
  - src: >-
      https://huggingface.co/datasets/mishig/sample_images/resolve/main/cat-dog-music.png
    candidate_labels: playing music, playing sports
    example_title: Cat & Dog
model-index:
  - name: clip-vit-large-patch14-336
    results: []

Clip-vit-large-patch14-336

Model Card for Clip-vit-large-patch14-336

{{ the_model_description }}

Model Details

Model Description

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.

  • Developed by: OpenAI
  • Shared by [Optional]: HuggingFace
  • Model type: Zero-Shot Classification
  • Language(s) (NLP): en
  • License: MIT
  • Related Models: More information needed
    • Parent Model: More information needed
  • Resources for more information:

Uses

Direct Use

The 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 models - the CLIP paper includes a discussion of potential downstream impacts to provide an example for this sort of analysis.

Downstream Use [Optional]

The primary intended users of these models are AI researchers.

We primarily imagine the model will be used by researchers to better understand robustness, generalization, and other capabilities, biases, and constraints of computer vision models.

Out-of-Scope Use

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.

Bias, Risks, and Limitations

CLIP and our analysis of it have a number of limitations. CLIP currently struggles with respect to certain tasks such as fine grained classification and counting objects. CLIP also poses issues with regards to fairness and bias which we discuss in the paper and briefly in the next section. Additionally, our approach to testing CLIP also has an important limitation- in many cases we have used linear probes to evaluate the performance of CLIP and there is evidence suggesting that linear probes can underestimate model performanc

We find that the performance of CLIP - and the specific biases it exhibits - can depend significantly on class design and the choices one makes for categories to include and exclude. We tested the risk of certain kinds of denigration with CLIP by classifying images of people from Fairface into crime-related and non-human animal categories. We found significant disparities with respect to race and gender. Additionally, we found that these disparities could shift based on how the classes were constructed. (Details captured in the Broader Impacts Section in the paper).

We also tested the performance of CLIP on gender, race and age classification using the Fairface dataset (We default to using race categories as they are constructed in the Fairface dataset.) in order to assess quality of performance across different demographics. We found accuracy >96% across all races for gender classification with ‘Middle Eastern’ having the highest accuracy (98.4%) and ‘White’ having the lowest (96.5%). Additionally, CLIP averaged ~93% for racial classification and ~63% for age classification. Our use of evaluations to test for gender, race and age classification as well as denigration harms is simply to evaluate performance of the model across people and surface potential risks and not to demonstrate an endorsement/enthusiasm for such tasks.

Recommendations

Our goal with building this dataset was to test out robustness and generalizability in computer vision tasks. As a result, the focus was on gathering large quantities of data from different publicly-available internet data sources. The data was gathered in a mostly non-interventionist manner. However, we only crawled websites that had policies against excessively violent and adult images and allowed us to filter out such content. We do not intend for this dataset to be used as the basis for any commercial or deployed model and will not be releasing the dataset.

Training Details

Training Data

The model was trained on publicly available image-caption data. This was done through a combination of crawling a handful of websites and using commonly-used pre-existing image datasets such as YFCC100M. A large portion of the data comes from our crawling of the internet. This means that the data is more representative of people and societies most connected to the internet which tend to skew towards more developed nations, and younger, male users.

Training Procedure

The following hyperparameters were used during training:

  • Optimizer: None
  • Training_precision: float32

Preprocessing

More information needed

Speeds, Sizes, Times

More information needed

Framework versions

  • Transformers 4.21.3
  • TensorFlow 2.8.2
  • Tokenizers 0.12.1

Evaluation

Testing Data, Factors & Metrics

Testing Data

We have evaluated the performance of CLIP on a wide range of benchmarks across a variety of computer vision datasets such as OCR to texture recognition to fine-grained classification. The paper describes model performance on the following datasets:

  • Food101
  • CIFAR10
  • CIFAR100
  • Birdsnap
  • SUN397
  • Stanford Cars
  • FGVC Aircraft
  • VOC2007
  • DTD
  • Oxford-IIIT Pet dataset
  • Caltech101
  • Flowers102
  • MNIST
  • SVHN
  • IIIT5K
  • Hateful Memes
  • SST-2
  • UCF101
  • Kinetics700
  • Country211
  • CLEVR Counting
  • KITTI Distance
  • STL-10
  • RareAct
  • Flickr30
  • MSCOCO
  • ImageNet
  • ImageNet-A
  • ImageNet-R
  • ImageNet Sketch
  • ObjectNet (ImageNet Overlap)
  • Youtube-BB
  • ImageNet-Vid

Factors

More information needed

Metrics

More information needed

Results

More information needed

Model Examination

More information needed

Environmental Impact

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).

  • Hardware Type: More information needed
  • Hours used: More information needed
  • Cloud Provider: More information needed
  • Compute Region: More information needed
  • Carbon Emitted: More information needed

Technical Specifications [optional]

Model Architecture and Objective

More information needed

Compute Infrastructure

More information needed

Hardware

CUDA GPU machine

Software

Install PyTorch 1.7.1 (or later) and torchvision, as well as small additional dependencies, and then install this repo as a Python package.

Citation

BibTeX:

If you find this model card useful for your research, please cite the following paper:

@inproceedings{meng2021coco,
  title={{COCO-LM}: Correcting and contrasting text sequences for language model pretraining},
  author={Meng, Yu and Xiong, Chenyan and Bajaj, Payal and Tiwary, Saurabh and Bennett, Paul and Han, Jiawei and Song, Xia},
  booktitle={NeurIPS},
  year={2021}
}

Glossary [optional]

More information needed

More Information [optional]

More information needed

Model Card Authors [optional]

OpenAI

Model Card Contact

Please use this Google Form

How to Get Started with the Model

Use the code below to get started with the model.

Click to expand
 
from transformers import AutoProcessor, AutoModel
 
processor = AutoProcessor.from_pretrained("openai/clip-vit-large-patch14-336")
 
model = AutoModel.from_pretrained("openai/clip-vit-large-patch14-336")