TasksSotADatasetsPapersMethodsSubmitAbout
Papers With Code 2

A community resource for machine learning research: papers, code, benchmarks, and state-of-the-art results.

Explore

Notable BenchmarksAll SotADatasetsPapersMethods

Community

Submit ResultsAbout

Data sourced from the PWC Archive (CC-BY-SA 4.0). Built by the community, for the community.

Methods/RGA

RGA

Relation-aware Global Attention

GeneralIntroduced 200011 papers
Source Paper

Description

In relation-aware global attention (RGA) stresses the importance of global structural information provided by pairwise relations, and uses it to produce attention maps.

RGA comes in two forms, spatial RGA (RGA-S) and channel RGA (RGA-C). RGA-S first reshapes the input feature map XXX to C×(H×W)C\times (H\times W)C×(H×W) and the pairwise relation matrix R∈R(H×W)×(H×W)R \in \mathbb{R}^{(H\times W)\times (H\times W)}R∈R(H×W)×(H×W) is computed using \begin{align} Q &= \delta(W^QX) \end{align} \begin{align} K &= \delta(W^KX) \end{align} \begin{align} R &= Q^TK \end{align} The relation vector rir_iri​ at position iii is defined by stacking pairwise relations at all positions: \begin{align} r_i = [R(i, :); R(:,i)]
\end{align} and the spatial relation-aware feature yiy_iyi​ can be written as \begin{align} Y_i = [g^c_\text{avg}(\delta(W^\varphi x_i)); \delta(W^\phi r_i)] \end{align} where gavgcg^c_\text{avg}gavgc​ denotes global average pooling in the channel domain. Finally, the spatial attention score at position iii is given by \begin{align} a_i = \sigma(W_2\delta(W_1y_i)) \end{align} RGA-C has the same form as RGA-S, except for taking the input feature map as a set of H×WH\times WH×W-dimensional features.

RGA uses global relations to generate the attention score for each feature node, so provides valuable structural information and significantly enhances the representational power. RGA-S and RGA-C are flexible enough to be used in any CNN network; Zhang et al. propose using them jointly in sequence to better capture both spatial and cross-channel relationships.

Papers Using This Method

A Family of Robust Generalized Adaptive Filters and Application for Time-series Prediction2025-05-31Bridging the Reality Gap in Digital Twins with Context-Aware, Physics-Guided Deep Learning2025-05-17CogniSNN: A First Exploration to Random Graph Architecture based Spiking Neural Networks with Enhanced Expandability and Neuroplasticity2025-05-09Region-Guided Attack on the Segment Anything Model (SAM)2024-11-05Rate Gradient Approximation Attack Threats Deep Spiking Neural Networks2023-01-01Reinforced Genetic Algorithm for Structure-based Drug Design2022-11-28On Use of the Moore-Penrose Pseudoinverse for Evaluating the RGA of Non-Square Systems2021-06-17Adversarial Blocking Bandits2020-12-01Quantization in Relative Gradient Angle Domain For Building Polygon Estimation2020-07-10Delving into the Imbalance of Positive Proposals in Two-stage Object Detection2020-05-23Relation-Aware Global Attention for Person Re-identification2019-04-05