Skip to main content
QUICK REVIEW

[Paper Review] HiViT: Hierarchical Vision Transformer Meets Masked Image Modeling

Xiaosong Zhang, Yunjie Tian|arXiv (Cornell University)|May 30, 2022
Advanced Neural Network ApplicationsComputer Science12 citations
TL;DR

HiViT proposes a hierarchical vision transformer architecture that removes local inter-unit operations—such as shifted-window self-attention—while preserving multi-scale feature maps, enabling efficient masked image modeling (MIM) by serializing tokens like plain ViT. This design achieves +0.6% ImageNet-1K top-1 accuracy over ViT-B and 1.9× faster training than Swin-B under MAE pre-training.

ABSTRACT

Recently, masked image modeling (MIM) has offered a new methodology of self-supervised pre-training of vision transformers. A key idea of efficient implementation is to discard the masked image patches (or tokens) throughout the target network (encoder), which requires the encoder to be a plain vision transformer (e.g., ViT), albeit hierarchical vision transformers (e.g., Swin Transformer) have potentially better properties in formulating vision inputs. In this paper, we offer a new design of hierarchical vision transformers named HiViT (short for Hierarchical ViT) that enjoys both high efficiency and good performance in MIM. The key is to remove the unnecessary "local inter-unit operations", deriving structurally simple hierarchical vision transformers in which mask-units can be serialized like plain vision transformers. For this purpose, we start with Swin Transformer and (i) set the masking unit size to be the token size in the main stage of Swin Transformer, (ii) switch off inter-unit self-attentions before the main stage, and (iii) eliminate all operations after the main stage. Empirical studies demonstrate the advantageous performance of HiViT in terms of fully-supervised, self-supervised, and transfer learning. In particular, in running MAE on ImageNet-1K, HiViT-B reports a +0.6% accuracy gain over ViT-B and a 1.9$ imes$ speed-up over Swin-B, and the performance gain generalizes to downstream tasks of detection and segmentation. Code will be made publicly available.

Motivation & Objective

  • Address the inefficiency of hierarchical vision transformers in masked image modeling (MIM) due to spatially dependent local operations.
  • Enable token serialization in hierarchical transformers by eliminating 'local inter-unit operations' that hinder MIM efficiency.
  • Preserve the performance benefits of hierarchical feature representation while achieving ViT-like computational flexibility.
  • Demonstrate state-of-the-art results in self-supervised, fully supervised, and downstream detection/segmentation tasks.
  • Provide a simple, efficient, and MIM-friendly alternative to both plain ViT and complex hierarchical models like Swin Transformer.

Proposed method

  • Categorize operations in hierarchical vision transformers into intra-unit, global inter-unit, and local inter-unit operations.
  • Identify 'local inter-unit operations'—such as shifted-window self-attention and patch merging—as the main barrier to token serialization in MIM.
  • Remove all local inter-unit operations in the main stage of Swin Transformer, retaining only global self-attention and hierarchical feature maps.
  • Replace early-stage local operations with equivalent intra-unit MLPs to maintain FLOPs and model capacity.
  • Merge the final stage into the main stage to preserve FLOPs while simplifying the architecture.
  • Enable full serialization of visible tokens during MIM pre-training by discarding masked units and processing only visible ones.

Experimental results

Research questions

  • RQ1Can hierarchical vision transformers be made as efficient as plain ViTs in masked image modeling without sacrificing performance?
  • RQ2Do 'local inter-unit operations' in hierarchical transformers significantly contribute to recognition accuracy, or is the hierarchical design itself the key?
  • RQ3Can a minimal modification to Swin Transformer—removing local attention—yield better MIM efficiency and accuracy than both ViT and Swin?
  • RQ4Does the resulting architecture, HiViT, maintain strong performance across self-supervised, fully supervised, and downstream detection/segmentation tasks?
  • RQ5Can the hierarchical structure be leveraged effectively in MIM without requiring spatially aware attention mechanisms?

Key findings

  • HiViT-B achieves 83.8% top-1 accuracy on ImageNet-1K, a +0.6% gain over ViT-B and a +0.3% gain over Swin-B.
  • HiViT-B trains 1.9× faster than Swin-B under MAE pre-training, while outperforming ViT-B in accuracy.
  • Self-supervised pre-training of HiViT-B achieves 84.2% top-1 accuracy on ImageNet-1K, competitive with supervised baselines.
  • With improved feature pyramid usage, HiViT-B achieves 51.2% AP^box and 44.2% AP^mask on COCO object detection and instance segmentation.
  • On ADE20K semantic segmentation, HiViT-B achieves 51.2% mIoU, outperforming ViT-B under the same pre-training protocol.
  • Ablation studies confirm that removing local inter-unit operations has minimal impact on performance, validating the core design choice.

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.