Attention Map Guided Transformer Pruning for Edge Device

04/04/2023
by   Junzhu Mao, et al.
0

Due to its significant capability of modeling long-range dependencies, vision transformer (ViT) has achieved promising success in both holistic and occluded person re-identification (Re-ID) tasks. However, the inherent problems of transformers such as the huge computational cost and memory footprint are still two unsolved issues that will block the deployment of ViT based person Re-ID models on resource-limited edge devices. Our goal is to reduce both the inference complexity and model size without sacrificing the comparable accuracy on person Re-ID, especially for tasks with occlusion. To this end, we propose a novel attention map guided (AMG) transformer pruning method, which removes both redundant tokens and heads with the guidance of the attention map in a hardware-friendly way. We first calculate the entropy in the key dimension and sum it up for the whole map, and the corresponding head parameters of maps with high entropy will be removed for model size reduction. Then we combine the similarity and first-order gradients of key tokens along the query dimension for token importance estimation and remove redundant key and value tokens to further reduce the inference complexity. Comprehensive experiments on Occluded DukeMTMC and Market-1501 demonstrate the effectiveness of our proposals. For example, our proposed pruning strategy on ViT-Base enjoys savings with drop on Rank-1 and improvement on mAP, respectively.

READ FULL TEXT

page 1

page 3

research
01/05/2023

Learning Feature Recovery Transformer for Occluded Person Re-identification

One major issue that challenges person re-identification (Re-ID) is the ...
research
07/02/2021

Learned Token Pruning for Transformers

A major challenge in deploying transformer models is their prohibitive i...
research
11/27/2022

Dynamic Feature Pruning and Consolidation for Occluded Person Re-Identification

Occluded person re-identification (ReID) is a challenging problem due to...
research
03/17/2022

Cascade Transformers for End-to-End Person Search

The goal of person search is to localize a target person from a gallery ...
research
06/07/2021

Person Re-Identification with a Locally Aware Transformer

Person Re-Identification is an important problem in computer vision-base...
research
09/08/2021

Pose-guided Inter- and Intra-part Relational Transformer for Occluded Person Re-Identification

Person Re-Identification (Re-Id) in occlusion scenarios is a challenging...
research
02/11/2020

Superbloom: Bloom filter meets Transformer

We extend the idea of word pieces in natural language models to machine ...

Please sign up or login with your details

Forgot password? Click here to reset