BEiT: BERT Pre-Training of Image Transformers
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 https://aka.ms/beit.
PDF Abstract ICLR 2022 PDF ICLR 2022 AbstractCode
Datasets
Task | Dataset | Model | Metric Name | Metric Value | Global Rank | Uses Extra Training Data |
Benchmark |
---|---|---|---|---|---|---|---|
Semantic Segmentation | ADE20K | BEiT-L (ViT+UperNet) | Validation mIoU | 57.0 | # 30 | ||
Semantic Segmentation | ADE20K val | BEiT-L (ViT+UperNet, ImageNet-22k pretrain) | mIoU | 57.0 | # 21 | ||
Image Classification | ImageNet | BEiT-L (ViT; ImageNet 1k pretrain) | Top 1 Accuracy | 86.3% | # 162 | ||
Number of params | 86M | # 871 | |||||
Image Classification | ImageNet | BEiT-L (ViT; ImageNet-22K pretrain) | Top 1 Accuracy | 88.60% | # 43 | ||
Number of params | 331M | # 991 | |||||
Self-Supervised Image Classification | ImageNet (finetuned) | BEiT-L (ViT) | Number of Params | 307M | # 13 | ||
Top 1 Accuracy | 86.3% | # 14 | |||||
Self-Supervised Image Classification | ImageNet (finetuned) | BEiT-B (ViT) | Number of Params | 86M | # 36 | ||
Top 1 Accuracy | 84.6% | # 29 | |||||
Image Classification | OmniBenchmark | BeiT | Average Top-1 Accuracy | 30.1 | # 22 | ||
Document Layout Analysis | PubLayNet val | BEiT-B | Text | 0.934 | # 9 | ||
Title | 0.866 | # 10 | |||||
List | 0.924 | # 10 | |||||
Table | 0.973 | # 10 | |||||
Figure | 0.957 | # 10 | |||||
Overall | 0.931 | # 11 | |||||
Document Image Classification | RVL-CDIP | BEiT-B | Accuracy | 91.09% | # 27 | ||
Parameters | 87M | # 16 |