


ImageNet zero-sample accuracy exceeds 80% for the first time, and the strongest open source CLIP model on the planet is updated
Although ImageNet has long completed its historical mission, it is still a key data set in the field of computer vision.
In 2016, the sota accuracy rate of the classification model trained on ImageNet was still less than 80%; to this day, zero-shot generalization based on large-scale pre-trained models alone can achieve an accuracy of 80.1%.
##Laion recently trained a brand new ViT-G/14 CLIP## using the open source OpenCLIP framework # Model, on the ImageNet data set, the accuracy of the original OpenAI CLIP is only 75.4%, while OpenCLIP achieves a zero-shot accuracy of 80.1%, and achieves a zero-shot of 74.9% on MS COCO Image retrieval (Recall@5), which is also currently the most powerful open source CLIP model.
Interested friends can update the CLIP model at hand!
Model address: https://huggingface.co/laion/CLIP-ViT-bigG-14 -laion2B-39B-b160k
The specific performance of the OpenCLIP model on each data set is shown in the table below.
The generalization problem is especially important in fields that lack large amounts of training data.
Ideally, a CV model should learn the semantic content of images rather than focusing too much on specific labels in the training set. For example, for an image of a dog, the model should be able to understand that there is a dog in the image, and further understand that there are trees in the background, the time is daytime, the dog is on the grass, etc.
But the current results obtained by "classification training" are exactly opposite to expectations. The model learns to push the dog's internal representation into the same "dog vector space" and the cat into the same "Cat vector space", the answer to all questions is binary, that is, whether the image can be aligned with a category label.
Fortunately, OpenAI’s CLIP model is a very flexible classification model and can usually be used in new classification tasks without retraining.
Why CLIP can Zero-Shot
Contrastive Language-Image Pretraining (CLIP, Contrastive Language-Image Pretraining) is a model released by OpenAI in 2021, mainly based on Transformer.
CLIP consists of two models, a Transformer encoder to convert text to embedding, and a Visual Transformer (ViT) to encode images.
Both text and image models within CLIP are optimized during pre-training to align similar text and images in vector space. During the training process, image-text pairs in the data are pushed closer together in the vector space, while image and text vectors that do not belong to a pair are separated.
There are several differences between CLIP and general classification models:
First, OpenAI uses crawled data from the Internet The benefits of training on a very large-scale data set containing 400 million text-image pairs are:
1. CLIP training only requires "image-text pairs" and does not require specific class labels, and this Types of data are abundant in today’s social media-centric online world.
2. Large datasets mean CLIP’s ability to understand common textual concepts in images.
3. The text descriptor often contains various features in the image, not just a category feature, which means that a more comprehensive image and text representation can be established.
The above advantages are also a key factor in CLIP's ability to establish Zero-shot. The author of the paper also compared the ResNet-101 model and CLIP model specially trained on ImageNet, and applied it to other data derived from ImageNet. Set, the figure below shows the performance comparison.
It can be seen that although ResNet-101 is trained on ImageNet, its performance on similar datasets is better than CLIP Performance on the same task is much worse.
When applying the ResNet model to other fields, a common method is "linear probe", that is, the characteristics learned in the last few layers of the ResNet model are input into a linear classifier, and then Fine-tuned for specific data sets.
In the CLIP paper, linear detection ResNet-50 is compared with zero-shot CLIP. The conclusion is that in the same scenario, zero-shot CLIP performs better than ResNet in multiple tasks. Linear detection in -50.
However, it is worth noting that when given more training samples, Zero-shot does not outperform linear detection.
Use CLIP for Zero-shot classification
As you can know from the above description, the image and text encoder can create a 512-dimensional vector that maps the input image and text input to the same vector space.
Using CLIP for zero-shot classification means putting category information into text sentences.
For example, if you input an image and want to determine whether its category is a car, bird or cat, you can create three text strings to represent the category:
T1 represents car: a photo of a car
T2 represents a bird: a photo of a bird
T3 represents a cat: a photo of a cat
Enter the category description into the text encoder, and A vector can be obtained that can represent the category.
Assume that the input is a photo of a cat. Use the ViT model to encode it. After obtaining the image vector, calculate the cosine distance between it and the category vector as the similarity. If the similarity with T3 is the highest, it means The category of the image belongs to cats.
As you can see, the category label is not a simple word, but based on the template 「a photo of a {label}」 The format of is rewritten into a sentence, which can be extended to category prediction without training restrictions.
In the experiment, using this prompt template improved the classification accuracy of ImageNet by 1.3 percentage points. However, the prompt template does not always improve performance. In actual use, it needs to be tested based on different data sets.
Python implementation
It is also very easy to quickly use CLIP for zero-shot classification. The author selected the frgfm/imagenette data set in Hugging Face as a demonstration. The data set contains 10 labels. , and all are saved as integer values.
Using CLIP for classification requires converting integer value labels into corresponding text content.
#Before directly calculating the similarity between tags and photos, you need to initialize the CLIP model, which can be implemented using the CLIP found through Hugging Face transformers.
The text transformer cannot read text directly, but requires a set of integer values called token IDs (or input_IDs), where each A unique integer represents a word or sub-word (ie token).
Input the converted tensor into the text transformer to obtain the text embedding of the label
Note that currently CLIP The output vector has not been normalized, and the similarity results obtained after dot multiplication are inaccurate.
Next, you can select an image in the data set for testing, and obtain the image vector after the same processing process.
After converting the image into a vector with dimensions of (1, 3, 224, 224), input it into the model to obtain embedding
The next step is to calculate the dot product similarity between the image embedding and the ten label text embeddings in the data set. The one with the highest score is the predicted category.
The model gives the result for the cassette player (cassette player), in the entire data set After running it again, we can get an accuracy of 98.7%
In addition to Zero-shot classification, multi-modal search, target detection, generative Models such as OpenAI's Dall-E and Stable disusion, CLIP open a new door to computer vision.
The above is the detailed content of ImageNet zero-sample accuracy exceeds 80% for the first time, and the strongest open source CLIP model on the planet is updated. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Imagine an artificial intelligence model that not only has the ability to surpass traditional computing, but also achieves more efficient performance at a lower cost. This is not science fiction, DeepSeek-V2[1], the world’s most powerful open source MoE model is here. DeepSeek-V2 is a powerful mixture of experts (MoE) language model with the characteristics of economical training and efficient inference. It consists of 236B parameters, 21B of which are used to activate each marker. Compared with DeepSeek67B, DeepSeek-V2 has stronger performance, while saving 42.5% of training costs, reducing KV cache by 93.3%, and increasing the maximum generation throughput to 5.76 times. DeepSeek is a company exploring general artificial intelligence

Earlier this month, researchers from MIT and other institutions proposed a very promising alternative to MLP - KAN. KAN outperforms MLP in terms of accuracy and interpretability. And it can outperform MLP running with a larger number of parameters with a very small number of parameters. For example, the authors stated that they used KAN to reproduce DeepMind's results with a smaller network and a higher degree of automation. Specifically, DeepMind's MLP has about 300,000 parameters, while KAN only has about 200 parameters. KAN has a strong mathematical foundation like MLP. MLP is based on the universal approximation theorem, while KAN is based on the Kolmogorov-Arnold representation theorem. As shown in the figure below, KAN has

Boston Dynamics Atlas officially enters the era of electric robots! Yesterday, the hydraulic Atlas just "tearfully" withdrew from the stage of history. Today, Boston Dynamics announced that the electric Atlas is on the job. It seems that in the field of commercial humanoid robots, Boston Dynamics is determined to compete with Tesla. After the new video was released, it had already been viewed by more than one million people in just ten hours. The old people leave and new roles appear. This is a historical necessity. There is no doubt that this year is the explosive year of humanoid robots. Netizens commented: The advancement of robots has made this year's opening ceremony look like a human, and the degree of freedom is far greater than that of humans. But is this really not a horror movie? At the beginning of the video, Atlas is lying calmly on the ground, seemingly on his back. What follows is jaw-dropping

The performance of JAX, promoted by Google, has surpassed that of Pytorch and TensorFlow in recent benchmark tests, ranking first in 7 indicators. And the test was not done on the TPU with the best JAX performance. Although among developers, Pytorch is still more popular than Tensorflow. But in the future, perhaps more large models will be trained and run based on the JAX platform. Models Recently, the Keras team benchmarked three backends (TensorFlow, JAX, PyTorch) with the native PyTorch implementation and Keras2 with TensorFlow. First, they select a set of mainstream

AI is indeed changing mathematics. Recently, Tao Zhexuan, who has been paying close attention to this issue, forwarded the latest issue of "Bulletin of the American Mathematical Society" (Bulletin of the American Mathematical Society). Focusing on the topic "Will machines change mathematics?", many mathematicians expressed their opinions. The whole process was full of sparks, hardcore and exciting. The author has a strong lineup, including Fields Medal winner Akshay Venkatesh, Chinese mathematician Zheng Lejun, NYU computer scientist Ernest Davis and many other well-known scholars in the industry. The world of AI has changed dramatically. You know, many of these articles were submitted a year ago.

Today I would like to share a recent research work from the University of Connecticut that proposes a method to align time series data with large natural language processing (NLP) models on the latent space to improve the performance of time series forecasting. The key to this method is to use latent spatial hints (prompts) to enhance the accuracy of time series predictions. Paper title: S2IP-LLM: SemanticSpaceInformedPromptLearningwithLLMforTimeSeriesForecasting Download address: https://arxiv.org/pdf/2403.05798v1.pdf 1. Large problem background model

The latest video of Tesla's robot Optimus is released, and it can already work in the factory. At normal speed, it sorts batteries (Tesla's 4680 batteries) like this: The official also released what it looks like at 20x speed - on a small "workstation", picking and picking and picking: This time it is released One of the highlights of the video is that Optimus completes this work in the factory, completely autonomously, without human intervention throughout the process. And from the perspective of Optimus, it can also pick up and place the crooked battery, focusing on automatic error correction: Regarding Optimus's hand, NVIDIA scientist Jim Fan gave a high evaluation: Optimus's hand is the world's five-fingered robot. One of the most dexterous. Its hands are not only tactile

Target detection is a relatively mature problem in autonomous driving systems, among which pedestrian detection is one of the earliest algorithms to be deployed. Very comprehensive research has been carried out in most papers. However, distance perception using fisheye cameras for surround view is relatively less studied. Due to large radial distortion, standard bounding box representation is difficult to implement in fisheye cameras. To alleviate the above description, we explore extended bounding box, ellipse, and general polygon designs into polar/angular representations and define an instance segmentation mIOU metric to analyze these representations. The proposed model fisheyeDetNet with polygonal shape outperforms other models and simultaneously achieves 49.5% mAP on the Valeo fisheye camera dataset for autonomous driving
