Vision transformer has emerged as a new paradigm in computer vision, showing excellent performance while accompanied by expensive computational cost. Image token pruning is one of the main approaches for ViT compression, due to the facts that the complexity is quadratic with respect to the token number, and many tokens containing only background regions do not truly contribute to the final prediction. Existing works either rely on additional modules to score the importance of individual tokens, or implement a fixed ratio pruning strategy for different input instances. In this work, we propose an adaptive sparse token pruning framework with a minimal cost. Specifically, we firstly propose an inexpensive attention head importance weighted class attention scoring mechanism. Then, learnable parameters are inserted as thresholds to distinguish informative tokens from unimportant ones. By comparing token attention scores and thresholds, we can discard useless tokens hierarchically and thus accelerate inference. The learnable thresholds are optimized in budget-aware training to balance accuracy and complexity, performing the corresponding pruning configurations for different input instances. Extensive experiments demonstrate the effectiveness of our approach. Our method improves the throughput of DeiT-S by 50% and brings only 0.2% drop in top-1 accuracy, which achieves a better trade-off between accuracy and latency than the previous methods.
Lahore University of Management Sciences(拉合尔管理科学大学)
One of the major challenges in deploying deep neural network architectures is their size which has an adverse effect on their inference time and memory requirements. Deep CNNs can either be pruned width-wise by removing filters based on their importance or depth-wise by removing layers and blocks. Width wise pruning (filter pruning) is commonly performed via learnable gates or switches and sparsity regularizers whereas pruning of layers has so far been performed arbitrarily by manually designing a smaller network usually referred to as a student network. We propose a comprehensive pruning stra…
Block-based Symmetric Pruning and Fusion for Efficient Vision Transformers
College of Artificial Intelligence and Green Energy National Yang Ming Chiao Tung University(人工智能与绿色能源学院,阳明交通大学);Computer Science Department University at Albany, SUNY(计算机科学系,阿尔巴尼大学);Computer Science Information Engineering Department University at Albany, SUNY(计算机科学与信息工程系,阿尔巴尼大学)
Cut-ViT: Task-Specific Model Pruning via Gram Anchoring Subspace Consistency
Nanjing University of Science and Technology(南京理工大学);State Key Laboratory of Intelligent Manufacturing of Advanced Construction Machinery(先进工程机械智能制造国家重点实验室);Zhejiang University(浙江大学);Nanjing Normal University(南京师范大学)
Vision transformer (ViT) has achieved competitive accuracy on a variety of computer vision applications, but its computational cost impedes the deployment on resource-limited mobile devices. We explore the sparsity in ViT and observe that informative patches and heads are sufficient for accurate image recognition. In this paper, we propose a cascade pruning framework named CP-ViT by predicting sparsity in ViT models progressively and dynamically to reduce computational redundancy while minimizing the accuracy loss. Specifically, we define the cumulative score to reserve the informative patches…
NVIDIA(英伟达);University of California, Berkeley(加州大学伯克利分校);Duke University(杜克大学)
Transformers yield state-of-the-art results across many tasks. However, their heuristically designed architecture impose huge computational costs during inference. This work aims on challenging the common design philosophy of the Vision Transformer (ViT) model with uniform dimension across all the stacked blocks in a model stage, where we redistribute the parameters both across transformer blocks and between different structures within the block via the first systematic attempt on global structural pruning. Dealing with diverse ViT structural components, we derive a novel Hessian-based structu…
The recently proposed Vision transformers (ViTs) have shown very impressive empirical performance in various computer vision tasks, and they are viewed as an important type of foundation model. However, ViTs are typically constructed with large-scale sizes, which then severely hinder their potential deployment in many practical resources-constrained applications. To mitigate this challenging problem, structured pruning is a promising solution to compress model size and enable practical efficiency. However, unlike its current popularity for CNNs and RNNs, structured pruning for ViT models is li…
TAP-ViTs: Task-Adaptive Pruning for On-Device Deployment of Vision Transformers
State Key Laboratory of Blockchain and Data Security(区块链与数据安全国家重点实验室);College of Computer Science and Technology(计算机科学与技术学院);College of Computer Science and Electronic Engineering(计算机科学与电子工程学院)
While vision transformers (ViTs) have continuously achieved new milestones in the field of computer vision, their sophisticated network architectures with high computation and memory costs have impeded their deployment on resource-limited edge devices. In this paper, we propose a hardware-efficient image-adaptive token pruning framework called HeatViT for efficient yet accurate ViT acceleration on embedded FPGAs. By analyzing the inherent computational patterns in ViTs, we first design an effective attention-based multi-head token selector, which can be progressively inserted before transforme…
DORA: Dynamic Online Reinforcement Agent for Token Pruning in Vision Transformers
University of Science and Technology of China(中国科学技术大学);Institute of Artificial Intelligence, Hefei Comprehensive National Science Center(合肥综合性国家科学中心人工智能研究院)
Harbin Institute of Technology, Shenzhen(哈尔滨工业大学(深圳));Tencent Youtu Lab(腾讯优图实验室)
Pruning has become a very powerful and effective technique to compress and accelerate modern neural networks. Existing pruning methods can be grouped into two categories: filter pruning (FP) and weight pruning (WP). FP wins at hardware compatibility but loses at the compression ratio compared with WP. To converge the strength of both methods, we propose to prune the filter in the filter. Specifically, we treat a filter $F \in \mathbb{R}^{C\times K\times K}$ as $K \times K$ stripes, i.e., $1\times 1$ filters $\in \mathbb{R}^{C}$, then by pruning the stripes instead of the whole filter, we can a…
Systematic Characterization of Minimal Deep Learning Architectures: A Unified Analysis of Convergence, Pruning, and Quantization
School of Computing, Newcastle University(新castle大学计算机学院);VSB-Technical University of Ostrava(奥斯特拉瓦技术大学);Queen Mary University of London(伦敦女王玛丽大学);University of Florida(佛罗里达大学);University of Catania(卡塔尼亚大学)
National Key Laboratory for Novel Software Technology(新型软件技术国家重点实验室);Nanjing University(南京大学);Nanjing(南京);China(中国)
Channel pruning is an important family of methods to speed up deep model's inference. Previous filter pruning algorithms regard channel pruning and model fine-tuning as two independent steps. This paper argues that combining them into a single end-to-end trainable system will lead to better results. We propose an efficient channel selection layer, namely AutoPruner, to find less important filters automatically in a joint training manner. Our AutoPruner takes previous activation responses as an input and generates a true binary index code for pruning. Hence, all the filters corresponding to zer…
Northeastern University(东北大学);Clemson University(克莱姆森大学);Peking University(北京大学);College of William and Mary(威廉与玛丽学院);ETH Zürich(苏黎世联邦理工学院)
Recently, Vision Transformer (ViT) has continuously established new milestones in the computer vision field, while the high computation and memory cost makes its propagation in industrial production difficult. Pruning, a traditional model compression paradigm for hardware efficiency, has been widely applied in various DNN structures. Nevertheless, it stays ambiguous on how to perform exclusive pruning on the ViT structure. Considering three key points: the structural characteristics, the internal data pattern of ViTs, and the related edge device deployment, we leverage the input token sparsity…
Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院);Megvii Technology(旷视科技)
In this paper, we propose a fully differentiable quantization method for vision transformer (ViT) named as Q-ViT, in which both of the quantization scales and bit-widths are learnable parameters. Specifically, based on our observation that heads in ViT display different quantization robustness, we leverage head-wise bit-width to squeeze the size of Q-ViT while preserving performance. In addition, we propose a novel technique named switchable scale to resolve the convergence problem in the joint training of quantization scales and bit-widths. In this way, Q-ViT pushes the limits of ViT quantiza…
Reinforcement Learning-based Token Pruning in Vision Transformers: A Markov Game Approach
School of Computer Science, Fudan University(复旦大学计算机科学学院);Data Intelligence Institute of Paris(巴黎数据智能研究院);Université Paris Cité(巴黎西岱大学);Shijiazhuang Tiedao University(石家庄铁道大学)
University of Texas at Austin(德克萨斯大学奥斯汀分校);Texas A&M University(德州农工大学);Kwai Inc.(快手公司)
Vision transformers (ViTs) have gained popularity recently. Even without customized image operators such as convolutions, ViTs can yield competitive performance when properly trained on massive data. However, the computational overhead of ViTs remains prohibitive, due to stacking multi-head self-attention modules and else. Compared to the vast literature and prevailing success in compressing convolutional neural networks, the study of Vision Transformer compression has also just emerged, and existing works focused on one or two aspects of compression. This paper proposes a unified ViT compress…
Back to Fundamentals: Low-Level Visual Features Guided Progressive Token Pruning
Xidian University(西安电子科技大学);University of Michigan – Shanghai Jiao Tong University Joint Institute(密歇根大学-上海交通大学联合学院);Shanghai Jiao Tong University(上海交通大学);Norwegian University of Science and Technology(挪威科技大学);Xi’an Jiaotong-Liverpool University(西交利物浦大学)
Filter Pruning for Efficient CNNs via Knowledge-driven Differential Filter Sampler
East China Normal University(华东师范大学);Xiamen University(厦门大学);Beihang University(北京航空航天大学);Zhongguancun Laboratory(中关村实验室);Tencent(腾讯);University of Sheffield(谢菲尔德大学);University at Buffalo(布法罗大学)
Efficient Joint Optimization of Layer-Adaptive Weight Pruning in Deep Neural Networks
Institute for Infocomm Research (IR), Agency for Science, Technology and Research (A*STAR)(新加坡科技研究局(A*STAR)信息通信研究院(IR));Nanyang Technological University, Singapore(新加坡南洋理工大学)
The University of Hong Kong(香港大学);MPI Informatics Saarland Informatics Campus(马克斯·普朗克信息学研究所萨尔信息学园区);Wuhan University(武汉大学)
Motion coherence is an important clue for distinguishing true correspondences from false ones. Modeling motion coherence on sparse putative correspondences is challenging due to their sparsity and uneven distributions. Existing works on motion coherence are sensitive to parameter settings and have difficulty in dealing with complex motion patterns. In this paper, we introduce a network called Laplacian Motion Coherence Network (LMCNet) to learn motion coherence property for correspondence pruning. We propose a novel formulation of fitting coherent motions with a smooth function on a graph of c…
We introduce Bayesian Bits, a practical method for joint mixed precision quantization and pruning through gradient based optimization. Bayesian Bits employs a novel decomposition of the quantization operation, which sequentially considers doubling the bit width. At each new bit width, the residual error between the full precision value and the previously rounded value is quantized. We then decide whether or not to add this quantized residual error for a higher effective bit width and lower quantization noise. By starting with a power-of-two bit width, this decomposition will always produce har…
Recently, vision transformer (ViT) and its variants have achieved promising performances in various computer vision tasks. Yet the high computational costs and training data requirements of ViTs limit their application in resource-constrained settings. Model compression is an effective method to speed up deep learning models, but the research of compressing ViTs has been less explored. Many previous works concentrate on reducing the number of tokens. However, this line of attack breaks down the spatial structure of ViTs and is hard to be generalized into downstream tasks. In this paper, we des…