137. Vision Transformers

Vision Transformers is inspired by Transformers for natural language processing. Unlike traditional convolution networks with pyramid architectures, ViT has an isotropic architecture, where the input does not downsize.

The steps are the following.

  1. Split images into “patches”
  2. Flatten each path to a 1d array
  3. Connect with a dense layer
  4. Add vector with positioning information
  5. Connect all Vectors, including the token for classification, to the multi-head attention layer
  6. Connect with a dense layer
  7. Apply this again
  8. Softmax Output and get probability

Compared to Resnet, ViT performs better when the training dataset is larger than 100 million.