GTP-ViT: Efficient Vision Transformers via Graph-based Token Propagation

6 Nov 2023  ·  Xuwei Xu, Sen Wang, Yudong Chen, Yanping Zheng, Zhewei Wei, Jiajun Liu ·

Vision Transformers (ViTs) have revolutionized the field of computer vision, yet their deployments on resource-constrained devices remain challenging due to high computational demands. To expedite pre-trained ViTs, token pruning and token merging approaches have been developed, which aim at reducing the number of tokens involved in the computation. However, these methods still have some limitations, such as image information loss from pruned tokens and inefficiency in the token-matching process. In this paper, we introduce a novel Graph-based Token Propagation (GTP) method to resolve the challenge of balancing model efficiency and information preservation for efficient ViTs. Inspired by graph summarization algorithms, GTP meticulously propagates less significant tokens' information to spatially and semantically connected tokens that are of greater importance. Consequently, the remaining few tokens serve as a summarization of the entire token graph, allowing the method to reduce computational complexity while preserving essential information of eliminated tokens. Combined with an innovative token selection strategy, GTP can efficiently identify image tokens to be propagated. Extensive experiments have validated GTP's effectiveness, demonstrating both efficiency and performance improvements. Specifically, GTP decreases the computational complexity of both DeiT-S and DeiT-B by up to 26% with only a minimal 0.3% accuracy drop on ImageNet-1K without finetuning, and remarkably surpasses the state-of-the-art token merging method on various backbones at an even faster inference speed. The source code is available at https://github.com/Ackesnal/GTP-ViT.

PDF Abstract

Datasets


Results from the Paper


Task Dataset Model Metric Name Metric Value Global Rank Result Benchmark
Image Classification ImageNet GTP-ViT-B-Patch8/P20 Top 1 Accuracy 85.8% # 187
Image Classification ImageNet GTP-EVA-L/P8 Top 1 Accuracy 85.4% # 221
Image Classification ImageNet GTP-ViT-L/P8 Top 1 Accuracy 83.7% # 365
Image Classification ImageNet GTP-LV-ViT-M/P8 Top 1 Accuracy 82.8% # 453
GFLOPs 8 # 267
Image Classification ImageNet GTP-LV-ViT-S/P8 Top 1 Accuracy 81.9% # 543
GFLOPs 4.8 # 226
Image Classification ImageNet GTP-DeiT-B/P8 Top 1 Accuracy 81.5% # 577
GFLOPs 13.1 # 323
Image Classification ImageNet GTP-DeiT-S/P8 Top 1 Accuracy 79.5% # 691
GFLOPs 3.4 # 178

Methods