CVLGMay 26, 2022

Green Hierarchical Vision Transformer for Masked Image Modeling

arXiv:2205.13515v288 citationsh-index: 134Has Code
Originality Incremental advance
AI Analysis

This work addresses the high computational cost of MIM for researchers and practitioners using hierarchical ViTs, offering an incremental improvement in efficiency.

The paper tackles the computational inefficiency of Masked Image Modeling (MIM) with hierarchical Vision Transformers by proposing an approach that discards masked patches and operates only on visible ones, resulting in training speeds up to 2.7× faster and GPU memory reduction by 70% while maintaining competitive performance on ImageNet classification and COCO object detection.

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$\times$ 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.

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes