Skip to main content
QUICK REVIEW

[Paper Review] Uniform Masking: Enabling MAE Pre-training for Pyramid-based Vision Transformers with Locality

Xiang Li, Wenhai Wang|arXiv (Cornell University)|May 20, 2022
Advanced Neural Network ApplicationsComputer Science36 citations
TL;DR

Unifies MAE-style pre-training with locality-based Pyramid ViTs via Uniform Masking, enabling efficient pre-training and preserving strong fine-tuning performance across tasks.

ABSTRACT

Masked AutoEncoder (MAE) has recently led the trends of visual self-supervision area by an elegant asymmetric encoder-decoder design, which significantly optimizes both the pre-training efficiency and fine-tuning accuracy. Notably, the success of the asymmetric structure relies on the "global" property of Vanilla Vision Transformer (ViT), whose self-attention mechanism reasons over arbitrary subset of discrete image patches. However, it is still unclear how the advanced Pyramid-based ViTs (e.g., PVT, Swin) can be adopted in MAE pre-training as they commonly introduce operators within "local" windows, making it difficult to handle the random sequence of partial vision tokens. In this paper, we propose Uniform Masking (UM), successfully enabling MAE pre-training for Pyramid-based ViTs with locality (termed "UM-MAE" for short). Specifically, UM includes a Uniform Sampling (US) that strictly samples $1$ random patch from each $2 imes 2$ grid, and a Secondary Masking (SM) which randomly masks a portion of (usually $25\%$) the already sampled regions as learnable tokens. US preserves equivalent elements across multiple non-overlapped local windows, resulting in the smooth support for popular Pyramid-based ViTs; whilst SM is designed for better transferable visual representations since US reduces the difficulty of pixel recovery pre-task that hinders the semantic learning. We demonstrate that UM-MAE significantly improves the pre-training efficiency (e.g., it speeds up and reduces the GPU memory by $\sim 2 imes$) of Pyramid-based ViTs, but maintains the competitive fine-tuning performance across downstream tasks. For example using HTC++ detector, the pre-trained Swin-Large backbone self-supervised under UM-MAE only in ImageNet-1K can even outperform the one supervised in ImageNet-22K. The codes are available at https://github.com/implus/UM-MAE.

Motivation & Objective

  • Motivate and enable MAE-style self-supervised pre-training for pyramid-based ViTs that use local windows.
  • Design Uniform Masking to maintain uniform input structure across local windows while keeping efficiency.
  • Demonstrate that UM-MAE reduces pre-training time and GPU memory while preserving or improving downstream performance.
  • Investigate how UM-MAE compares with existing MIM methods on downstream tasks such as ImageNet-1K classification, ADE20K segmentation, and COCO object detection.

Proposed method

  • Uniform Sampling (US) selects one random patch from each 2x2 grid to create a 25% visible patch set.
  • Secondary Masking (SM) randomly masks a portion (e.g., 25%) of the already sampled regions and uses learnable mask tokens.
  • Reorganize the uniform-sampled patches into a compact 2D input that feeds the Pyramid-based ViT encoder.
  • Decoder remains the lightweight ViT from MAE to reconstruct original image pixels via mean squared error on dropped patches.
  • Encoder input is reduced to 25% of tokens; pixel shuffle is used to recover resolution for Pyramid backbones.
  • Training compares UM-MAE against SimMIM and MAE baselines across IN1K, ADE20K, and COCO; occasional intermediate fine-tuning is discussed.

Experimental results

Research questions

  • RQ1Can MAE-style pre-training be effectively applied to pyramid-based ViTs with local windows without incurring excessive computation?
  • RQ2What sampling and masking strategies best preserve or enhance transferable representations for pyramid-based architectures?
  • RQ3How does UM-MAE perform in terms of pre-training efficiency and downstream task accuracy compared to existing MIM methods?
  • RQ4Does intermediate fine-tuning influence the transfer gains of UM-MAE on dense prediction tasks?

Key findings

  • UM-MAE significantly speeds up pre-training (≈2×) and reduces GPU memory (≥2×) compared to SimMIM for pyramid-based ViTs.
  • Uniform Sampling with a 25% Secondary Masking ratio yields strong trade-offs, matching or exceeding MAE baselines on downstream tasks.
  • For Swin-T, UM-MAE achieves IN1K 82.04 Top-1, ADE20K 45.96 mIoU, COCO 47.7 AP across setups, with memory/time improvements compared to SimMIM.
  • On large models (Swin-L), UM-MAE pre-trained on IN1K can outperform supervised IN22K baselines with fewer pre-training epochs.
  • Intermediate fine-tuning on IN1K is crucial for good downstream performance of pyramid-based ViTs under MIM, often yielding gains over direct fine-tuning.
  • UM-MAE maintains competitive or improved downstream performance while reducing pre-training resources versus strong MIM baselines.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.