MaiT: Leverage Attention Masks for More Efficient Image Transformers

Ling Li, Ali Shafiee Ardestani, Joseph Hassoun
7/6/2022
cs.CV

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Though image transformers have shown competitive results with convolutional neural networks in computer vision tasks, lacking inductive biases such as locality still poses problems in terms of model efficiency especially for embedded applications. In this work, we address this issue by introducing attention masks to incorporate spatial locality into self-attention heads. Local dependencies are captured efficiently with masked attention heads along with global dependencies captured by unmasked attention heads. With Masked attention image Transformer - MaiT, top-1 accuracy increases by up to 1.7% compared to CaiT with fewer parameters and FLOPs, and the throughput improves by up to 1.5X compared to Swin. Encoding locality with attention masks is model agnostic, and thus it applies to monolithic, hierarchical, or other novel transformer architectures.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{li2022mait,
  title  = {MaiT: Leverage Attention Masks for More Efficient Image Transformers},
  author = {Ling Li and Ali Shafiee Ardestani and Joseph Hassoun},
  year   = {2022},
  eprint = {2207.03006},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2207.03006v1}
}

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

Discussion