Skip to main content
QUICK REVIEW

[Paper Review] FastMIM: Expediting Masked Image Modeling Pre-training for Vision

Jianyuan Guo, Kai Han|arXiv (Cornell University)|Dec 13, 2022
Advanced Neural Network ApplicationsComputer Science4 citations
TL;DR

FastMIM accelerates masked image modeling (MIM) pre-training by training with low-resolution inputs (e.g., 128×128) and reconstructing Histogram of Oriented Gradients (HOG) features instead of raw RGB pixels. This approach reduces memory consumption and training time by ~5× while achieving 83.8%/84.1% top-1 accuracy on ImageNet-1K using ViT-B/Swin-B, matching or exceeding prior methods with significantly faster convergence.

ABSTRACT

The combination of transformers and masked image modeling (MIM) pre-training framework has shown great potential in various vision tasks. However, the pre-training computational budget is too heavy and withholds the MIM from becoming a practical training paradigm. This paper presents FastMIM, a simple and generic framework for expediting masked image modeling with the following two steps: (i) pre-training vision backbones with low-resolution input images; and (ii) reconstructing Histograms of Oriented Gradients (HOG) feature instead of original RGB values of the input images. In addition, we propose FastMIM-P to progressively enlarge the input resolution during pre-training stage to further enhance the transfer results of models with high capacity. We point out that: (i) a wide range of input resolutions in pre-training phase can lead to similar performances in fine-tuning phase and downstream tasks such as detection and segmentation; (ii) the shallow layers of encoder are more important during pre-training and discarding last several layers can speed up the training stage with no harm to fine-tuning performance; (iii) the decoder should match the size of selected network; and (iv) HOG is more stable than RGB values when resolution transfers;. Equipped with FastMIM, all kinds of vision backbones can be pre-trained in an efficient way. For example, we can achieve 83.8%/84.1% top-1 accuracy on ImageNet-1K with ViT-B/Swin-B as backbones. Compared to previous relevant approaches, we can achieve comparable or better top-1 accuracy while accelerate the training procedure by $\sim$5$ imes$. Code can be found in https://github.com/ggjy/FastMIM.pytorch.

Motivation & Objective

  • To address the high computational cost and memory burden of masked image modeling (MIM) pre-training in vision transformers.
  • To enable efficient, generic pre-training across diverse vision backbones, including hierarchical architectures like Swin Transformer.
  • To reduce training time and memory usage without sacrificing downstream performance.
  • To investigate the impact of input resolution, feature representation (RGB vs. HOG), and network depth on MIM efficiency and accuracy.

Proposed method

  • Pre-train vision backbones using low-resolution input images (e.g., 128×128 instead of 224×224) to reduce computational load and memory usage.
  • Replace pixel reconstruction with Histogram of Oriented Gradients (HOG) feature reconstruction to preserve texture and edge information despite resolution reduction.
  • Use a symmetric encoder-decoder architecture that retains all input tokens during pre-training, enabling compatibility with various backbone architectures.
  • Match the decoder size to the selected encoder’s feature map dimensions to maintain training stability and performance.
  • Introduce FastMIM-P, a progressive resolution scheduling strategy that gradually increases input resolution during pre-training to improve model capacity and transfer performance.
  • Leverage the invariance of HOG features to geometric and resolution changes, making them more robust than raw pixel targets under low-resolution settings.

Experimental results

Research questions

  • RQ1Can reducing input resolution during MIM pre-training significantly accelerate training without degrading downstream performance?
  • RQ2Does reconstructing HOG features instead of raw pixels mitigate the loss of texture information when using low-resolution inputs?
  • RQ3How does the choice of prediction target (RGB vs. HOG) affect training stability and convergence speed in low-resolution MIM?
  • RQ4To what extent can shallow layers of the encoder be prioritized during pre-training, and can deeper layers be discarded to further speed up training?
  • RQ5Can progressive input resolution scheduling during pre-training improve the transfer performance of high-capacity models?

Key findings

  • FastMIM reduces pre-training time by approximately 5× compared to MAE and SimMIM, achieving 83.8% and 84.1% top-1 accuracy on ImageNet-1K using ViT-B and Swin-B backbones, respectively.
  • Reconstructing HOG features instead of raw RGB pixels results in significantly lower pre-training loss and better reconstruction quality under low-resolution inputs, reducing ambiguity and improving training stability.
  • The performance gap between different input resolutions is substantially reduced when using HOG targets, demonstrating HOG’s robustness to resolution changes.
  • Discarding the last few layers of the encoder during pre-training does not harm fine-tuning performance, enabling faster training with minimal accuracy drop.
  • The shallow layers of the encoder are more critical for pre-training, and their representation quality strongly influences downstream transfer performance.
  • FastMIM-P, which progressively increases input resolution during pre-training, further improves transfer performance, especially for high-capacity models like Swin-L.

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.