# Locally Enhanced Self-Attention: Combining Self-Attention and Convolution as Local and Context Terms

Source: [Locally Enhanced Self-Attention: Combining Self-Attention and Convolution as Local and Context Terms](<https://www.sota2.com/research/paper/68fa6b511e209131cea2d9e1>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2025-10-25T23:46:07.580Z

Authors: Chenglin Yang, Siyuan Qiao, Adam Kortylewski, Alan Yuille

Published: 2021-07-12T18:00:00.000Z

## Abstract

Self-Attention has become prevalent in computer vision models. Inspired by fully connected Conditional Random Fields (CRFs), we decompose self-attention into local and context terms. They correspond to the unary and binary terms in CRF and are implemented by attention mechanisms with projection matrices. We observe that the unary terms only make small contributions to the outputs, and meanwhile standard CNNs that rely solely on the unary terms achieve great performances on a variety of tasks. Therefore, we propose Locally Enhanced Self-Attention (LESA), which enhances the unary term by incorporating it with convolutions, and utilizes a fusion module to dynamically couple the unary and binary operations. In our experiments, we replace the self-attention modules with LESA. The results on ImageNet and COCO show the superiority of LESA over convolution and self-attention baselines for the tasks of image recognition, object detection, and instance segmentation. The code is made publicly available.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2107.05637>)

[PDF](<https://arxiv.org/pdf/2107.05637.pdf>)
