Skip to main content
QUICK REVIEW

[Paper Review] Unleashing Vanilla Vision Transformer with Masked Image Modeling for Object Detection

Y.K. Fang, Shusheng Yang|arXiv (Cornell University)|Apr 6, 2022
Advanced Neural Network ApplicationsComputer Science4 citations
TL;DR

This paper proposes MimDet, a novel object detection framework that adapts a masked image modeling (MIM)-pretrained vanilla Vision Transformer (ViT) for object detection by feeding it only 25–50% of randomly sampled input embeddings during fine-tuning. By replacing the pre-trained patchify stem with a randomly initialized convolutional stem to enable multi-scale feature extraction, MimDet achieves 54.3 AP⁠⁠box and 48.2 AP⁠⁠mask on COCO, outperforming hierarchical Swin Transformer by 2.5 and 2.6 AP respectively, while converging 2.8× faster with a simpler fine-tuning recipe.

ABSTRACT

We present an approach to efficiently and effectively adapt a masked image modeling (MIM) pre-trained vanilla Vision Transformer (ViT) for object detection, which is based on our two novel observations: (i) A MIM pre-trained vanilla ViT encoder can work surprisingly well in the challenging object-level recognition scenario even with randomly sampled partial observations, e.g., only 25% $\sim$ 50% of the input embeddings. (ii) In order to construct multi-scale representations for object detection from single-scale ViT, a randomly initialized compact convolutional stem supplants the pre-trained large kernel patchify stem, and its intermediate features can naturally serve as the higher resolution inputs of a feature pyramid network without further upsampling or other manipulations. While the pre-trained ViT is only regarded as the 3$^{rd}$-stage of our detector's backbone instead of the whole feature extractor. This results in a ConvNet-ViT hybrid feature extractor. The proposed detector, named MIMDet, enables a MIM pre-trained vanilla ViT to outperform hierarchical Swin Transformer by 2.5 box AP and 2.6 mask AP on COCO, and achieves better results compared with the previous best adapted vanilla ViT detector using a more modest fine-tuning recipe while converging 2.8$ imes$ faster. Code and pre-trained models are available at https://github.com/hustvl/MIMDet.

Motivation & Objective

  • To investigate whether MIM-pretrained vanilla ViT can be effectively adapted for object detection without architectural modifications.
  • To address the challenge of single-scale feature representation in vanilla ViT for multi-scale object detection.
  • To minimize the distribution gap between MIM pre-training and detection fine-tuning by avoiding window attention.
  • To enable efficient, high-performance detection using a simpler, faster fine-tuning recipe compared to prior ViT-based detectors.

Proposed method

  • Replace the pre-trained large-kernel patchify stem in ViT with a randomly initialized compact convolutional stem to generate multi-scale features.
  • Feed only 25–50% of randomly sampled input embeddings to the MIM-pretrained ViT encoder during fine-tuning, treating the rest as masked tokens.
  • Use a lightweight decoder to reconstruct the full feature map from the masked input, implicitly performing MIM during detection fine-tuning.
  • Utilize intermediate features from the convolutional stem as high-resolution inputs to a standard feature pyramid network (FPN), eliminating the need for upsampling.
  • Treat the ViT encoder as the third stage of a hybrid ConvNet-ViT backbone, rather than the full feature extractor.
  • Apply standard Mask R-CNN as the detection head with minimal data augmentation and a 36-epoch fine-tuning schedule.

Experimental results

Research questions

  • RQ1Can a MIM-pretrained vanilla ViT generalize effectively to object detection when fine-tuned with only partial input sequences?
  • RQ2Does replacing the pre-trained patchify stem with a randomly initialized convolutional stem enable effective multi-scale representation learning for object detection?
  • RQ3Can a simpler fine-tuning recipe with fewer epochs and less data augmentation still achieve state-of-the-art performance when using MIM-pretrained ViT?
  • RQ4How does the distribution gap between MIM pre-training and detection fine-tuning affect performance, and can it be reduced by avoiding window attention?

Key findings

  • MimDet achieves 54.3 AP⁠⁠box and 48.2 AP⁠⁠mask on COCO object detection and instance segmentation using a base-sized model with only 36 fine-tuning epochs.
  • The model outperforms the hierarchical Swin Transformer by 2.5 AP⁠⁠box and 2.6 AP⁠⁠mask under the same evaluation protocol.
  • MimDet converges 2.8× faster than the previous best-performing adapted vanilla ViT detector, despite using a more modest fine-tuning recipe.
  • The approach maintains strong performance even without relative position biases, which typically add significant training cost.
  • The method achieves state-of-the-art results with minimal architectural modifications, using only a lightweight convolutional stem and partial input sampling.
  • The results demonstrate that MIM-pretrained vanilla ViT can be effectively leveraged for object-level recognition without re-designing the backbone or introducing complex attention mechanisms.

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.