Skip to main navigation Skip to search Skip to main content

Patch Slimming for Efficient Vision Transformers

  • Yehui Tang
  • , Kai Han
  • , Yunhe Wang*
  • , Chang Xu
  • , Jianyuan Guo
  • , Chao Xu
  • , Dacheng Tao
  • *Corresponding author for this work

Research output: Chapters, Conference Papers, Creative and Literary Works › RGC 32 - Refereed conference paper (with host publication) › peer-review

Abstract

This paper studies the efficiency problem for visual transformers by excavating redundant calculation in given networks. The recent transformer architecture has demonstrated its effectiveness for achieving excellent performance on a series of computer vision tasks. However, similar to that of convolutional neural networks, the huge computational cost of vision transformers is still a severe issue. Considering that the attention mechanism aggregates different patches layer-by-layer, we present a novel patch slimming approach that discards useless patches in a topdown paradigm. We first identify the effective patches in the last layer and then use them to guide the patch selection process of previous layers. For each layer, the impact of a patch on the final output feature is approximated and patches with less impacts will be removed. Experimental results on benchmark datasets demonstrate that the proposed method can significantly reduce the computational costs of vision transformers without affecting their performances. For example, over 45% FLOPs of the ViT-Ti model can be reduced with only 0.2% top-1 accuracy drop on the ImageNet dataset. © 2022 IEEE.
Original languageEnglish
Title of host publicationProceedings - 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2022
Place of PublicationLos Alamitos, Calif.
PublisherIEEE Computer Society
Pages12155-12164
ISBN (Electronic)9781665469463
ISBN (Print)9781665469470
DOIs
Publication statusPublished - 2022
Externally publishedYes
Event2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR 2022) - Hybrid, New Orleans, United States
Duration: 19 Jun 2022 → 24 Jun 2022
https://cvpr2022.thecvf.com/

Publication series

NameProceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition
Volume2022-June
ISSN (Print)1063-6919
ISSN (Electronic)2575-7075

Conference

Conference2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR 2022)
PlaceUnited States
CityNew Orleans
Period19/06/22 → 24/06/22
Internet address

Funding

We propose to accelerate vision transformers by reducing the number of patches required to calculate. Considering that the attention mechanism aggregates different patches layer-by-layer, a top-down framework is developed to excavate the redundant patches. The importance of each patch is also approximated according to its impact on the effective output features. After pruning, a compact vision transformer with a pyramid-like architecture is obtained. Extensive experiments on benchmark datasets validate that the proposed method can effectively reduce the computational cost. In the future, we plan to combine the patch slimming methods with more compression technologies (e.g., weight pruning, model quantization) to explore extremely efficient vision transformers. Acknowledgment. This work is supported by National Natural Science Foundation of China under Grant No.61876007, Australian Research Council under Project DP210101859 and the University of Sydney SOAR Prize.

Research Keywords

  • Deep learning architectures and techniques
  • Efficient learning and inferences
  • Machine learning
  • Representation learning

Fingerprint

Dive into the research topics of 'Patch Slimming for Efficient Vision Transformers'. Together they form a unique fingerprint.

Cite this