In this paper, we propose Mixed and Masked AutoEncoder (MixMAE), a simple but efficient pretraining method that is applicable to various hierarchical Vision Transformers. Existing masked image modeling (MIM) methods for hierarchical Vision Transformers replace a random subset of input tokens with a special [MASK] symbol and aim at reconstructing original image tokens from the corrupted image. However, we find that using the [MASK] symbol greatly slows down the training and causes pretraining-finetuning inconsistency, due to the large masking ratio (e.g., 60% in SimMIM). On the other hand, MAE does not introduce [MASK] tokens at its encoder at all but is not applicable for hierarchical Vision Transformers. To solve the issue and accelerate the pretraining of hierarchical models, we replace the masked tokens of one image with visible tokens of another image, i.e., creating a mixed image. We then conduct dual reconstruction to reconstruct the two original images from the mixed input, which significantly improves efficiency. While MixMAE can be applied to various hierarchical Transformers, this paper explores using Swin Transformer with a large window size and scales up to huge model size (to reach 600M parameters). Empirical results demonstrate that MixMAE can learn high-quality visual representations efficiently. Notably, MixMAE with Swin-B/W14 achieves 85.1% top-1 accuracy on ImageNet-1K by pretraining for 600 epochs. Besides, its transfer performances on the other 6 datasets show that MixMAE has better FLOPs / performance tradeoff than previous popular MIM methods. Code is available at https://github.com/Sense-X/MixMIM.
翻译:在本文中,我们提出了混合掩模自编码器(MixMAE),这是一种可适用于各种层级视觉变换器的简单而高效的预训练方法。针对层级视觉变换器的现有掩模图像建模(MIM)方法使用特殊的 [MASK] 符号替换输入令牌的随机子集,并旨在从受损图像中重构原始图像令牌。然而,我们发现使用 [MASK] 符号会极大地减慢训练速度,并引起预训练 - 微调不一致性,因为掩蔽比例较大(例如 SimMIM 中的 60%)。另一方面,MAE 根本不在其编码器中引入 [MASK] 令牌,但不适用于层级视觉变换器。为了解决这个问题并加速层级模型的预训练,我们用另一张图片的可见令牌替换其中一个图片的掩码令牌,即创建一个混合图片。然后,我们进行双重重构以从混合输入重构两个原始图像,从而显着提高了效率。虽然 MixMAE 可适用于各种层级变换器,但本文尝试使用视窗大小较大的 Swin 变换器,并将模型尺寸扩展到 600M 参数。实证结果表明 MixMAE 可以高效地学习高质量的视觉表示。值得注意的是,MixMAE 与 Swin-B/W14 在预训练 600 个时期后在 ImageNet-1K 上实现了 85.1% 的 top-1 精度。此外,它在其他 6 个数据集上的转移性能表明,MixMAE 具有比以前流行的 MIM 方法更好的 FLOPs/性能权衡。代码可在 https://github.com/Sense-X/MixMIM 找到。