valhalla commited on
Commit
6cef4ad
1 Parent(s): a564c9d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +36 -5
README.md CHANGED
@@ -4,19 +4,27 @@ tags:
4
  ---
5
  # Model Card: CLIP
6
  Disclaimer: The model card is taken and modified from the official CLIP repository, it can be found [here](https://github.com/openai/CLIP/blob/main/model-card.md).
 
 
7
  ## Model Details
8
  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.
 
 
9
  ### Model Date
10
  January 2021
 
 
11
  ### Model Type
12
- The base model uses a ViT-B/16 Transformer architecture as an image encoder and uses a masked self-attention Transformer as a text encoder. These encoders are trained to maximize the similarity of (image, text) pairs via a contrastive loss. There is also a variant of the model where the ResNet image encoder is replaced with a Vision Transformer.
13
- ### Model Version
14
- Initially, we’ve released one CLIP model based on the Vision Transformer architecture equivalent to ViT-B/32, along with the RN50 model, using the architecture equivalent to ResNet-50.
15
- *This port does not include the ResNet model.*
16
- Please see the paper linked below for further details about their specification.
17
  ### Documents
18
  - [Blog Post](https://openai.com/blog/clip/)
19
  - [CLIP Paper](https://arxiv.org/abs/2103.00020)
 
 
20
  ### Use with Transformers
21
  ```python3
22
  from PIL import Image
@@ -31,21 +39,36 @@ outputs = model(**inputs)
31
  logits_per_image = outputs.logits_per_image # this is the image-text similarity score
32
  probs = logits_per_image.softmax(dim=1) # we can take the softmax to get the label probabilities
33
  ```
 
 
34
  ## Model Use
 
35
  ### Intended Use
36
  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.
 
 
37
  #### Primary intended uses
38
  The primary intended users of these models are AI researchers.
39
  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.
 
 
40
  ### Out-of-Scope Use Cases
41
  **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.
42
  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.
43
  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.
 
 
44
  ## Data
45
  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](http://projects.dfki.uni-kl.de/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.
 
 
46
  ### Data Mission Statement
47
  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.
 
 
48
  ## Performance and Limitations
 
 
49
  ### Performance
50
  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:
51
  - Food101
@@ -81,11 +104,19 @@ We have evaluated the performance of CLIP on a wide range of benchmarks across a
81
  - ObjectNet (ImageNet Overlap)
82
  - Youtube-BB
83
  - ImageNet-Vid
 
 
84
  ## Limitations
85
  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 performance.
 
 
86
  ### Bias and Fairness
87
  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](https://arxiv.org/abs/1908.04913) 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).
88
  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.
 
 
89
  ## Feedback
 
 
90
  ### Where to send questions or comments about the model
91
  Please use [this Google Form](https://forms.gle/Uv7afRH5dvY34ZEs9)
 
4
  ---
5
  # Model Card: CLIP
6
  Disclaimer: The model card is taken and modified from the official CLIP repository, it can be found [here](https://github.com/openai/CLIP/blob/main/model-card.md).
7
+
8
+
9
  ## Model Details
10
  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.
11
+
12
+
13
  ### Model Date
14
  January 2021
15
+
16
+
17
  ### Model Type
18
+ The base model uses a ViT-B/16 Transformer architecture as an image encoder and uses a masked self-attention Transformer as a text encoder. These encoders are trained to maximize the similarity of (image, text) pairs via a contrastive loss.
19
+
20
+ The original implementation had two variants: one using a ResNet image encoder and the other using a Vision Transformer. This repository has the variant with the Vision Transformer.
21
+
22
+
23
  ### Documents
24
  - [Blog Post](https://openai.com/blog/clip/)
25
  - [CLIP Paper](https://arxiv.org/abs/2103.00020)
26
+
27
+
28
  ### Use with Transformers
29
  ```python3
30
  from PIL import Image
 
39
  logits_per_image = outputs.logits_per_image # this is the image-text similarity score
40
  probs = logits_per_image.softmax(dim=1) # we can take the softmax to get the label probabilities
41
  ```
42
+
43
+
44
  ## Model Use
45
+
46
  ### Intended Use
47
  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.
48
+
49
+
50
  #### Primary intended uses
51
  The primary intended users of these models are AI researchers.
52
  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.
53
+
54
+
55
  ### Out-of-Scope Use Cases
56
  **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.
57
  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.
58
  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.
59
+
60
+
61
  ## Data
62
  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](http://projects.dfki.uni-kl.de/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.
63
+
64
+
65
  ### Data Mission Statement
66
  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.
67
+
68
+
69
  ## Performance and Limitations
70
+
71
+
72
  ### Performance
73
  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:
74
  - Food101
 
104
  - ObjectNet (ImageNet Overlap)
105
  - Youtube-BB
106
  - ImageNet-Vid
107
+
108
+
109
  ## Limitations
110
  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 performance.
111
+
112
+
113
  ### Bias and Fairness
114
  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](https://arxiv.org/abs/1908.04913) 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).
115
  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.
116
+
117
+
118
  ## Feedback
119
+
120
+
121
  ### Where to send questions or comments about the model
122
  Please use [this Google Form](https://forms.gle/Uv7afRH5dvY34ZEs9)