Skip to main content
QUICK REVIEW

[论文解读] Green Hierarchical Vision Transformer for Masked Image Modeling

Lang Huang, Shan You|arXiv (Cornell University)|May 26, 2022
Advanced Neural Network ApplicationsComputer Science被引用 25
一句话总结

提出一种绿色方法,用于带层次化视觉变换器的掩码图像建模(Masked Image Modeling,MIM),通过 Group Window Attention 使仅在可见补丁上进行训练、通过 Dynamic Programming 实现最优分组、以及 Sparse Convolution,从而在保持竞争力精度的同时实现显著的效率提升。

ABSTRACT

We present an efficient approach for Masked Image Modeling (MIM) with hierarchical Vision Transformers (ViTs), allowing the hierarchical ViTs to discard masked patches and operate only on the visible ones. Our approach consists of three key designs. First, for window attention, we propose a Group Window Attention scheme following the Divide-and-Conquer strategy. To mitigate the quadratic complexity of the self-attention w.r.t. the number of patches, group attention encourages a uniform partition that visible patches within each local window of arbitrary size can be grouped with equal size, where masked self-attention is then performed within each group. Second, we further improve the grouping strategy via the Dynamic Programming algorithm to minimize the overall computation cost of the attention on the grouped patches. Third, as for the convolution layers, we convert them to the Sparse Convolution that works seamlessly with the sparse data, i.e., the visible patches in MIM. As a result, MIM can now work on most, if not all, hierarchical ViTs in a green and efficient way. For example, we can train the hierarchical ViTs, e.g., Swin Transformer and Twins Transformer, about 2.7$ imes$ faster and reduce the GPU memory usage by 70%, while still enjoying competitive performance on ImageNet classification and the superiority on downstream COCO object detection benchmarks. Code and pre-trained models have been made publicly available at https://github.com/LayneH/GreenMIM.

研究动机与目标

  • Motivate efficient self-supervised pre-training for hierarchical ViTs in Masked Image Modeling (MIM).
  • Extend asymmetric MAE-style pre-training to Swin/Twins architectures while operating on visible patches only.
  • Reduce computation and memory by rethinking attention, grouping, and convolution for sparse inputs.
  • Ensure compatibility with downstream tasks like ImageNet classification and MS-COCO detection and segmentation.

提出的方法

  • Group Window Attention 将局部窗口划分为可见补丁的等大小分组,并在组内应用掩码注意力。
  • 将最优分组表述为约束优化问题,并通过 Dynamic Programming 求解以最小化注意力计算成本。
  • 将卷积和池化操作转换为 Sparse Convolution,以自然处理稀疏(可见)补丁。
  • 使用固定补丁大小的批量随机掩蔽策略,以实现并行计算。
  • 在层次化骨干(Swin、Twins)中用稀疏卷积替代标准卷积,以保持与可见补丁上的 MIM 兼容性。

实验结果

研究问题

  • RQ1Can hierarchical ViTs (e.g., Swin/Twins) be efficiently trained with MIM while discarding masked patches?
  • RQ2How can window-based attention and convolutions be adapted to sparse, masked inputs without sacrificing accuracy?
  • RQ3What grouping strategy minimizes computational cost for masked self-attention in local windows?
  • RQ4Does the proposed green MIM approach maintain competitive ImageNet and COCO performance while reducing training time and memory?

主要发现

  • Achieves up to 2.7× training speedup and 70% GPU memory reduction versus a baseline on Swin-L/Twins-L configurations.
  • Demonstrates competitive ImageNet-1K top-1 accuracy with Swin-B (83.8%), Twins-L (83.9%), and Swin-L (85.1%) after pre-training.
  • On MS-COCO, delivers competitive object detection and instance segmentation performance against strong baselines when fine-tuned from the green MIM pre-training.
  • Group Window Attention with Optimal Grouping reduces redundant computations in masked self-attention and scales well with larger models.
  • Batch-wise masking with fixed patch size enables efficient parallel computation and sparse convolutions to handle sparse inputs effectively.

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。