MiniViT: Compressing Vision Transformers with Weight Multiplexing

Jinnian Zhang, Houwen Peng, Kan Wu, Mengchen Liu, Bin Xiao +2 more
4/14/2022
192 citations
cs.CV
transformer-attention

Official code: microsoft/Cream (1,843 stars, Python, MIT, last commit 2024-07-25).

Abstract

Vision Transformer (ViT) models have recently drawn much attention in computer vision due to their high model capability. However, ViT models suffer from huge number of parameters, restricting their applicability on devices with limited memory.

Show full abstract

To alleviate this problem, we propose MiniViT, a new compression framework, which achieves parameter reduction in vision transformers while retaining the same performance. The central idea of MiniViT is to multiplex the weights of consecutive transformer blocks. More specifically, we make the weights shared across layers, while imposing a transformation on the weights to increase diversity. Weight distillation over self-attention is also applied to transfer knowledge from large-scale ViT models to weight-multiplexed compact models. Comprehensive experiments demonstrate the efficacy of MiniViT, showing that it can reduce the size of the pre-trained Swin-B transformer by 48\%, while achieving an increase of 1.0\% in Top-1 accuracy on ImageNet. Moreover, using a single-layer of parameters, MiniViT is able to compress DeiT-B by 9.7 times from 86M to 9M parameters, without seriously compromising the performance. Finally, we verify the transferability of MiniViT by reporting its performance on downstream benchmarks. Code and models are available at here.

View on arXivView PDF

Code Implementations(1)

microsoft/CreamOfficial100%
MIT

This is a collection of our NAS and Vision Transformer work.

1,843239Python, CudaOct 12, 20202 years agoMIT
automlefficiencyknowledge-distillationnasrpe+2 more

Similar Papers

Cite this paper

@article{zhang2022minivit,
  title  = {MiniViT: Compressing Vision Transformers with Weight Multiplexing},
  author = {Jinnian Zhang and Houwen Peng and Kan Wu and Mengchen Liu and Bin Xiao and Jianlong Fu and Lu Yuan},
  year   = {2022},
  eprint = {2204.07154},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2204.07154}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2204.07154.svg)](https://codeofpaper.com/paper/2204.07154)

Discussion