Reproduce “A 2D Semantic-Aware Position Encoding for Vision Transformers” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Xi Chen, Shiyang Zhou, Muqi Huang, Jiaxu Feng, Yun Xiong, Kun Zhou, Biao Yang, Yuhui Zhang and 4 more

Researchers from Fudan University and Alibaba Group developed 2-Dimensional Semantic-Aware Position Encoding (SaPE²), a method for Vision Transformers that integrates semantic understanding into positional representations. This approach significantly improved Top-1 accuracy on CIFAR10 by 6.57 percentage points (to 93.98%) and on CIFAR100 by 5.69 percentage points (to 72.23%) compared to a vanilla ViT, by better leveraging local content for spatial context.

Key insights

  • Integrating semantic information directly into position encoding allows ViTs to perceive contextual information, effectively grouping semantically related patches and differentiating between foreground and background.
  • Decomposing 2D position encoding into independent 1D components for horizontal and vertical axes, combined with a gated interaction, provides a more flexible and robust way to capture spatial and semantic relationships in images.
  • Combining SaPE² with Absolute Position Encoding (APE) proves most effective, suggesting that explicit positional differentiation from APE complements the semantic and relational cues provided by SaPE².

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.