BEiT: BERT Pre-Training of Image Transformers

15 Jun 2021  ·  Hangbo Bao, Li Dong, Furu Wei ·

We introduce a self-supervised vision representation model BEiT, which stands for Bidirectional Encoder representation from Image Transformers. Following BERT developed in the natural language processing area, we propose a masked image modeling task to pretrain vision Transformers... Specifically, each image has two views in our pre-training, i.e, image patches (such as 16x16 pixels), and visual tokens (i.e., discrete tokens). We first "tokenize" the original image into visual tokens. Then we randomly mask some image patches and fed them into the backbone Transformer. The pre-training objective is to recover the original visual tokens based on the corrupted image patches. After pre-training BEiT, we directly fine-tune the model parameters on downstream tasks by appending task layers upon the pretrained encoder. Experimental results on image classification and semantic segmentation show that our model achieves competitive results with previous pre-training methods. For example, base-size BEiT achieves 83.2% top-1 accuracy on ImageNet-1K, significantly outperforming from-scratch DeiT training (81.8%) with the same setup. Moreover, large-size BEiT obtains 86.3% only using ImageNet-1K, even outperforming ViT-L with supervised pre-training on ImageNet-22K (85.2%). The code and pretrained models are available at read more

PDF Abstract
Task Dataset Model Metric Name Metric Value Global Rank Uses Extra
Training Data
Semantic Segmentation ADE20K BEiT-L (ViT+UperNet, ImageNet-22k pretrain) Validation mIoU 57.0 # 3
Semantic Segmentation ADE20K val BEiT-L (ViT+UperNet, ImageNet-22k pretrain) mIoU 57.0 # 3
Image Classification ImageNet BEiT-B (ViT; ImageNet 1K pretrain) Top 1 Accuracy 86.3% # 43
Number of params 86M # 71
Image Classification ImageNet BEiT-L (ViT; ImageNet-22K pretrain) Top 1 Accuracy 88.60% # 13
Top 5 Accuracy 98.66% # 7
Number of params 331M # 28
Self-Supervised Image Classification ImageNet (finetuned) BEiT-B (ViT) Number of Params 86M # 8
Top 1 Accuracy 84.6% # 2
Self-Supervised Image Classification ImageNet (finetuned) BEiT-L (ViT) Number of Params 307M # 3
Top 1 Accuracy 86.3% # 1