Mixing and Shifting: Exploiting Global and Local Dependencies in Vision MLPs

Huangjie Zheng, Pengcheng He, Weizhu Chen, Mingyuan Zhou
2/14/2022
16 citations
cs.CV
transformer-attention

Official code: JegZheng/MS-MLP (17 stars, Python, MIT, last commit 2022-02-16).

Abstract

Token-mixing multi-layer perceptron (MLP) models have shown competitive performance in computer vision tasks with a simple architecture and relatively small computational cost. Their success in maintaining computation efficiency is mainly attributed to avoiding the use of self-attention that is often computationally heavy, yet this is at the expense of not being able to mix tokens both globally and locally.

Show full abstract

In this paper, to exploit both global and local dependencies without self-attention, we present Mix-Shift-MLP (MS-MLP) which makes the size of the local receptive field used for mixing increase with respect to the amount of spatial shifting. In addition to conventional mixing and shifting techniques, MS-MLP mixes both neighboring and distant tokens from fine- to coarse-grained levels and then gathers them via a shifting operation. This directly contributes to the interactions between global and local tokens. Being simple to implement, MS-MLP achieves competitive performance in multiple vision benchmarks. For example, an MS-MLP with 85 million parameters achieves 83.8% top-1 classification accuracy on ImageNet-1K. Moreover, by combining MS-MLP with state-of-the-art Vision Transformers such as the Swin Transformer, we show MS-MLP achieves further improvements on three different model scales, e.g., by 0.5% on ImageNet-1K classification with Swin-B. The code is available at: https://github.com/JegZheng/MS-MLP.

View on arXivView PDF

Code Implementations(1)

JegZheng/MS-MLPOfficial100%
MIT

Pytorch implementation of Mix-Shifting-MLP (MS-MLP)

173PythonFeb 16, 20224 years agoMIT

Similar Papers

Cite this paper

@article{zheng2022mixing,
  title  = {Mixing and Shifting: Exploiting Global and Local Dependencies in Vision MLPs},
  author = {Huangjie Zheng and Pengcheng He and Weizhu Chen and Mingyuan Zhou},
  year   = {2022},
  eprint = {2202.06510},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2202.06510}
}

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/2202.06510.svg)](https://codeofpaper.com/paper/2202.06510)

Discussion