BEiT v2: Masked Image Modeling with Vector-Quantized Visual Tokenizers

Zhiliang Peng, Li Dong, Hangbo Bao, Qixiang Ye, Furu Wei
8/12/2022
472 citations
cs.CV
contrastive-ssl

Official code: microsoft/unilm (22,252 stars, Python, MIT, last commit 2026-01-23).

Abstract

Masked image modeling (MIM) has demonstrated impressive results in self-supervised representation learning by recovering corrupted image patches. However, most existing studies operate on low-level image pixels, which hinders the exploitation of high-level semantics for representation models.

Show full abstract

In this work, we propose to use a semantic-rich visual tokenizer as the reconstruction target for masked prediction, providing a systematic way to promote MIM from pixel-level to semantic-level. Specifically, we propose vector-quantized knowledge distillation to train the tokenizer, which discretizes a continuous semantic space to compact codes. We then pretrain vision Transformers by predicting the original visual tokens for the masked image patches. Furthermore, we introduce a patch aggregation strategy which associates discrete image patches to enhance global semantic representation. Experiments on image classification and semantic segmentation show that BEiT v2 outperforms all compared MIM methods. On ImageNet-1K (224 size), the base-size BEiT v2 achieves 85.5% top-1 accuracy for fine-tuning and 80.1% top-1 accuracy for linear probing. The large-size BEiT v2 obtains 87.3% top-1 accuracy for ImageNet-1K (224 size) fine-tuning, and 56.7% mIoU on ADE20K for semantic segmentation. The code and pretrained models are available at https://aka.ms/beitv2.

View on arXivView PDF

Code Implementations(1)

microsoft/unilmOfficial100%
MIT

Large-scale Self-supervised Pre-training Across Tasks, Languages, and Modalities

22,2522,699Python, Jupyter NotebookJul 23, 201910 months agoMIT
beitbeit-3bitnetdeepnetdocument-ai+15 more

Similar Papers

Cite this paper

@article{peng2022beit,
  title  = {BEiT v2: Masked Image Modeling with Vector-Quantized Visual Tokenizers},
  author = {Zhiliang Peng and Li Dong and Hangbo Bao and Qixiang Ye and Furu Wei},
  year   = {2022},
  eprint = {2208.06366},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2208.06366}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2208.06366.svg)](https://codeofpaper.com/paper/2208.06366)

Discussion