Patch Slimming for Efficient Vision Transformers

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 top-down 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 impact 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.

PDF Abstract CVPR 2022 PDF CVPR 2022 Abstract
No code implementations yet. Submit your code now

Datasets


Task Dataset Model Metric Name Metric Value Global Rank Result Benchmark
Efficient ViTs ImageNet-1K (with DeiT-S) DPS-ViT Top 1 Accuracy 79.5 # 19
GFLOPs 2.4 # 10
Efficient ViTs ImageNet-1K (with DeiT-S) PS-ViT Top 1 Accuracy 79.4 # 22
GFLOPs 2.6 # 12
Efficient ViTs ImageNet-1K (with DeiT-T) DPS-ViT Top 1 Accuracy 72.1 # 8
GFLOPs 0.6 # 1
Efficient ViTs ImageNet-1K (with DeiT-T) PS-ViT Top 1 Accuracy 72.0 # 11
GFLOPs 0.7 # 5
Efficient ViTs ImageNet-1K (With LV-ViT-S) DPS-LV-ViT-S Top 1 Accuracy 82.9 # 12
GFLOPs 4.5 # 11
Efficient ViTs ImageNet-1K (With LV-ViT-S) PS-LV-ViT-S Top 1 Accuracy 82.4 # 18
GFLOPs 4.7 # 5

Methods


No methods listed for this paper. Add relevant methods here