articleJun 1, 2023Closed access

Neighborhood Attention Transformer

SRI International · Meta (Israel)

Indexed incrossref

Abstract

We present Neighborhood Attention (NA), the first efficient and scalable sliding window attention mechanism for vision. NA is a pixel-wise operation, localizing self attention (SA) to the nearest neighboring pixels, and therefore enjoys a linear time and space complexity compared to the quadratic complexity of SA. The sliding window pattern allows NA's receptive field to grow without needing extra pixel shifts, and preserves translational equivariance, unlike Swin Transformer's Window Self Attention (WSA). We develop NATTEN (Neighborhood Attention Extension), a Python package with efficient C++ and CUDA kernels, which allows NA to run up to 40% faster than Swin's WSA while using up to 25% less memory. We…

Citation impact

409
total citations
FWCI
45.57
Percentile
100%
References
53
Citations per year

Authors

5

Topics & keywords

Keywords
  • Computer science
  • Pixel
  • Sliding window protocol
  • Scalability
  • Transformer
  • Artificial intelligence
  • Pattern recognition (psychology)
  • Computer vision
UN Sustainable Development Goals
  • Sustainable cities and communities
No related works found for this paper.

Funding