Skip to content

Vision Transformer (ViT) is a new approach for image classification. So far, we have been using only CNNs for image classification task. ViT is a new approach that analysis the image by dividing it into patches.

Notifications You must be signed in to change notification settings

fukashi-hatake/vision_transformer

Repository files navigation

Vision Transformer

AN IMAGE IS WORTH 16X16 WORDS: TRANSFORMERS FOR IMAGE RECOGNITION AT SCALE - ICLR 2021

  • ABSTRACT While the Transformer architecture has become the de-facto standard for natural language processing tasks, its applications to computer vision remain limited. In vision, attention is either applied in conjunction with convolutional networks, or used to replace certain components of convolutional networks while keeping their overall structure in place. We show that this reliance on CNNs is not necessary and a pure transformer applied directly to sequences of image patches can perform very well on image classification tasks. When pre-trained on large amounts of data and transferred to multiple mid-sized or small image recognition benchmarks (ImageNet, CIFAR-100, VTAB, etc.), Vision Transformer (ViT) attains excellent results compared to state-of-the-art convolutional networks while requiring substantially fewer computational resources to train.

  • Figure 1: Model overview. We split an image into fixed-size patches, linearly embed each of them,add position embeddings, and feed the resulting sequence of vectors to a standard Transformer encoder. In order to perform classification, we use the standard approach of adding an extra learnable “classification token” to the sequence.

Model overview

We trained fpr CIFAR 10 and CIFAR 100 datasets

Table 1. Results

Model Dataset Accuracy Epochs
ViT-B_16 CIFAR 10 97.99% 500
ViT-B_16 CIFAR 100 87.28% 500

Table 2. Settings

Parameters Values
Device Tesla V100-SXM2-32GB
Image size 224x224
Patch size 16x16

About

Vision Transformer (ViT) is a new approach for image classification. So far, we have been using only CNNs for image classification task. ViT is a new approach that analysis the image by dividing it into patches.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published