Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

Attention Spiking Neural Networks

  • Problem Deep spiking networks lose accuracy as they deepen and need many time steps, which keeps them behind artificial networks. Attention could help, but it must not erode the sparse spiking that gives SNNs their energy advantage.
  • Method Adds temporal, channel and spatial attention to the membrane potential of a convolutional LIF-SNN, and places channel and spatial attention inside the residual blocks of MS-Res-SNN, so the attention weights regulate spiking responses.
  • Results Reached 77.08% top-1 accuracy with 4-step CSA-Res-SNN-104 on ImageNet-1K, and cut spike counts by 81.6% on DVS128 Gait for the three-layer baseline with attention.

Figure 3: Attention residual block contains three parts: basic
Res-SNN block (MS-Res-SNN [14], details in Fig.5), shortcut,
and CSA module. We exploit MA on th…

Fig. 3 : Attention residual block contains three parts: basic Res-SNN block (MS-Res-SNN [14], details in Fig.5), shortcut, and CSA module. We exploit MA on the basic Res-SNN block outputs (i.e., membrane potential of spiking neurons) in each block. We recommend Att-Res-SNN-1 as the scheme for attention residual learning.

Original paper · CC BY 4.0 · Man Yao, Guangshe Zhao, Hengyu Zhang, Yifan Hu, Lei Deng, Yonghong Tian, Bo Xu, Guoqi Li · Attention Spiking Neural Networks · Original paper figure · Extracted the figure area from page 6 of the original PDF.

Why attention in SNNs needs care

Spiking neural networks pass binary signals between neurons, so hardware can skip work whenever a value is zero. That energy advantage depends on sparse activity, and it sits alongside a long-running accuracy gap with artificial networks.

Training deep SNNs is expensive. Running many time steps raises training time, simulation cost, inference latency and the memory traffic needed to fetch membrane potentials. Deep SNNs also degrade, because spike degradation and gradient vanishing lower results on training and test data as the network gets deeper.

Attention has become standard in ANNs, where it recalibrates features. Moving it into SNNs raises two constraints: the event-driven character must survive, and attention should not make degradation worse. The authors therefore keep the existing SNN operations and insert attention as a light auxiliary unit that acts on the membrane potential.

They link this to neuroscience evidence that attention changes synaptic efficacy and spiking rate.

Membrane potential in a LIF layer

The leaky integrate-and-fire (LIF) neuron is the spiking model used here. Its continuous form is \(\tau\,du(t)/dt=-u(t)+I(t)\), where \(u(t)\) is the membrane potential and \(I(t)\) is the input collected from presynaptic neurons. The authors chose this model as a compromise between biological detail and a simple mathematical form.

Solving that equation gives a discrete update per time step \(t\) and layer \(n\). The membrane potential \(U_{t,n}\) adds the temporal input \(H_{t-1,n}\) to the spatial feature \(X_{t,n}\), and a Heaviside step applied to \(U_{t,n}-u_{th}\) produces the spike \(S_{t,n}\). The next temporal state is \(H_{t,n}=V_{reset}S_{t,n}+(\beta U_{t,n})\odot(1-S_{t,n})\).

A neuron that fires is reset to \(V_{reset}\), while a silent neuron passes on its decayed potential, with \(\beta=e^{-dt/\tau}<1\).

The spatial feature comes from convolution, batch normalization and average pooling of the previous layer's spike tensor: \(X_{t,n}=\mathrm{AvgPool}(\mathrm{BN}(\mathrm{Conv}(W_n,S_{t,n-1})))\). Bias terms and batch normalization are left out of later notation. After convolution, every tensor in the LIF module has the same shape \(c_n\times h_n\times w_n\), so attention weights of matching shape can multiply them directly.

Temporal, channel and spatial weights

All three attention types share one form: the input is multiplied element-wise by a weight \(g(x)\) inferred from that input, so \(x_{Att}=g(x)\cdot x\). The three dimensions answer different questions. Temporal weights decide when to attend, channel weights decide what to attend to, and spatial weights decide where.

Temporal attention works on the feature blocks \(X_n\) of one layer collected over all \(T\) time steps. Its weight vector \(g_t(X_n)\in\mathbb{R}^{T\times1\times1\times1}\) multiplies each time step, so \(X^{TA}_n=g_t(X_n)\odot X_n\), and the weights are broadcast over channels and space. Average-pooled and max-pooled descriptors are formed per time step and passed through one shared MLP with a sigmoid: \[g_t(X_n)=\sigma\big(W_{nt1}\,\mathrm{ReLU}(W_{nt0}\,\mathrm{AvgPool}(X_n))+W_{nt1}\,\mathrm{ReLU}(W_{nt0}\,\mathrm{MaxPool}(X_n))\big)\] The temporal reduction factor \(r_t\) sets the MLP cost.

Channel attention refines the membrane potential rather than the convolution output. It uses the classic CBAM channel form, \[g_c(U_{t,n})=\sigma\big(W_{nc1}\,\mathrm{ReLU}(W_{nc0}\,\mathrm{AvgPool}(U_{t,n}))+W_{nc1}\,\mathrm{ReLU}(W_{nc0}\,\mathrm{MaxPool}(U_{t,n}))\big)\] and the refined potential is \(U^{CA}_{t,n}=g_c(U_{t,n})\odot U_{t,n}\).

The MLP weights are shared across time steps to limit parameters, and the channel reduction factor \(r_c\) sets the width of the bottleneck. The authors also note that channel attention suppresses minor features, which they consider important for SNN efficiency.

Spatial attention pools the membrane potential across channels, joins the average and max maps, applies a \(7\times7\) convolution and a sigmoid: \[g_s(U_{t,n})=\sigma\big(f^{7\times7}([\mathrm{AvgPool}(U_{t,n});\mathrm{MaxPool}(U_{t,n})])\big)\] The refined potential is \(U^{SA}_{t,n}=g_s(U_{t,n})\odot U_{t,n}\). The \(7\times7\) filter is the default CBAM setting, and the convolution is shared across time steps to save parameters.

When all three dimensions are used together (TCSA), the temporal weights act on the input blocks first, and the channel and spatial weights then refine the membrane potential: \[X^{TA}_n=g_t(X_n)\odot X_n,\quad U^{CA}_{t,n}=g_c(H_{t-1,n}+X^{TA}_{t,n})\odot(H_{t-1,n}+X^{TA}_{t,n}),\quad U_{t,n}=g_s(U^{CA}_{t,n})\odot U^{CA}_{t,n}\] The refined potential \(U_{t,n}\) is then passed to the Heaviside threshold, so the attention weights shape the spikes indirectly through the membrane potential.

Attention inside residual blocks

For ImageNet-1K the authors build attention residual SNNs on MS-Res-SNN, which they chose for its accuracy and its membrane shortcut. They argue that the membrane shortcut already optimizes membrane potentials, the same role the attention plays. Each attention residual block has three parts: the basic Res-SNN block, the shortcut, and a CSA module applied to the membrane potential output of the block.

Two placements are compared. Att-Res-SNN-1 applies the attention before the shortcut, and Att-Res-SNN-2 moves it after the shortcut. The authors recommend Att-Res-SNN-1 as the scheme for attention residual learning. In the ablation, Att-Res-SNN-1 is better in effectiveness, while Att-Res-SNN-2 has sparser spiking activity. Both variants are reported to reach dynamical isometry.

Event datasets and baselines

DVS128 Gesture and DVS128 Gait are event-stream datasets recorded by a DVS camera with microsecond temporal resolution and 128×128 spatial resolution. Gesture has 11 hand gesture kinds from 29 subjects under 3 illumination conditions, with 1,342 samples. Gait has 4,200 samples from 21 volunteers under 2 viewing angles.

Each vanilla model and its attention counterpart share one experimental setup, and TCSA is the attention variant used in these event-based tests. Two vanilla backbones are used: one with three convolution layers following [43] and one with five convolution layers following [38]. Output latency is set as \(t_{lat}=dt\times T\), and it is varied to test the effect across latency constraints.

Accuracy and energy on Gesture and Gait

On the three-layer model, TCSA-SNN raises accuracy by 5.9% on Gesture and by 4.7% on Gait over the vanilla three-layer SNN. The five-layer model shows gains in the same direction, which the authors describe as consistent with the three-layer result.

On Gesture, the three-layer TCSA-SNN raises energy efficiency by up to 3.4×, and the five-layer TCSA-SNN by up to 1.8×. On Gait, the spike counts of the three-layer baseline fall by 81.6%, which gives 3.2× better energy efficiency. The abstract reports spike count reductions of 84.9% on Gesture and 81.6% on Gait.

NASAR is the spiking-activity measure used here, and a lower value means sparser spiking. The three-layer and five-layer Gesture baselines have NASAR values of 0.214 and 0.074. With TCA, the five-layer SNN on Gesture drops to 0.011, which the authors read as only 1.1% of neurons being active at each time step. Energy is saved only when the saved term exceeds the added cost, that is \(E_{AC}\,\Delta_{AC} > E_{MAC}\,\Delta_{MAC}\), and the authors state that all their attention designs meet this condition.

Where attention is applied in the event models

The ablation fixes dt = 15 and T = 60 on Gesture with the three-layer SNN, and varies only where each attention type sits: before or after the convolution, or before the activation. The vanilla SNN reaches 90.63 ±0.58 with NASAR 0.174.

TA placed after the convolution reaches 92.60 ±0.47 with NASAR 0.073, higher accuracy and sparser spiking than the vanilla model. CA placed before the activation reaches 93.88 ±0.34 with NASAR 0.072, and SA placed before the convolution reaches 92.85 ±0.78 with NASAR 0.060. No single location gives the best accuracy for all three dimensions in this table, so placement has to be chosen per dimension.

Spiking response on Gait and a case study

The authors average spiking tensors over the validation set and plot each channel's spiking rate, which they call average spiking response visualization (ASRV). For the first layer of Gait, with dimension (32, 32, 64), the NASAR is 0.245 for the vanilla SNN, 0.091 for TA-SNN, 0.103 for CA-SNN and 0.045 for TCA-SNN. The authors read the drop as attention suppressing background channels, which carry high spiking rates.

A single-sample case study on Gesture and Gait compares Conv-1, Conv-2 and Conv-3 for a vanilla SNN that fails and a TCA-SNN that classifies correctly. The spiking maps are averaged over time and channels at each layer. The vanilla response is more spread out, while TCA-SNN concentrates on the target region and weakens the background. In Conv-3 on Gesture, the highest values are 0.51 for the vanilla SNN and 0.24 for TCA-SNN.

Across time steps, the NASAR of the vanilla SNN is almost unchanged, whereas TCA-SNN's activity is uneven and small along the temporal axis. The authors take this as evidence that attention yields instance-specific dynamic responses.

ImageNet accuracy at one and four time steps

ImageNet-1K has 1,000 categories, 1.28 million training images and 50k test images. The authors train MS-ResNet-SNN baselines and their attention counterparts from scratch under identical optimization. They use channel and spatial attention only, because temporal information is weak in this data.

At T = 1, CSA-Res-SNN-34 reaches 69.15 against 64.13 for MS-Res-SNN-34, a gain of +5.0. The same CSA module gives +0.7 for Res-CNN-34 in prior work, and the authors describe the SNN gain as much larger. At T = 1, CSA-Res-SNN-104 reaches 73.82 against 71.57 for MS-Res-SNN-104, a gain of +2.3.

Single-step CSA-Res-SNN-18 reaches 63.97%, higher than the 63.10% of the 6-step Res-SNN-18 backbone. Single-step CSA-Res-SNN-34 (69.15%) and CSA-Res-SNN-104 (75.92%) fall slightly short of the 6-step and 5-step backbones at 69.42% and 76.02%. The 4-step CSA-Res-SNN-104 reaches 77.08%, against 76.87% for the ANN with the same architecture.

The gap to that ANN is −0.95 percent for the single-step model and +0.21 percent for the 4-step model.

Table 2 places these results beside ANN-to-SNN and direct-training SNNs. The 4-step CSA-Res-SNN-104 at 77.08% is compared with a 75.32% ANN-to-SNN result that uses 2048 time steps. The ResNet-104 entries marked with an asterisk use inputs enlarged to 288×288 at inference, so each row should be read with its own settings.

Energy and training cost on ImageNet

At T = 1, CSA-Res-SNN-18 lowers NASAR from 0.224 to 0.148 while its top-1 accuracy rises from 61.70% to 63.97%, giving 1.5× energy efficiency. The authors treat the added energy cost of the attention module as approximately negligible for Res-SNNs, because the base energy is high. Under that view, a 33.9% decrease in spiking activity gives a 31.7% energy reduction.

Energy efficiency is expressed as rEE relative to the ANN baseline set at 1×. The 5-time-step Res-SNN-104 reaches 5.3× and the 4-step CSA-Res-SNN-104 reaches 7.4×. Single-step CSA-Res-SNN-104 reaches 31.8× relative to Res-ANN-104. These ratios are the authors' estimates from the energy evaluation described in Section 4, not measured hardware values.

The single-step training of large-scale Att-Res-SNN is reported to give a 6.4× training acceleration, with details in the supplement. The authors argue that single-step simulation can be the starting point, with extension to multi-step SNNs handled separately, for example through pre-training.

Gradient stability of attention residual SNNs

The argument uses block dynamical isometry. A deep network is treated as a composition of blocks, and the Jacobian \(J_j\) of each block should satisfy \(\varphi(J_jJ_j^T)\approx1\) and \(\phi(J_jJ_j^T)\approx0\). Here \(\varphi(J)\) is the expectation of \(\mathrm{tr}(J)\), and \(\phi(J)\) is \(\varphi(J^2)-\varphi(J)^2\). The shallow network trick (Lemma 1) states that if \(\varphi(J_jJ_j^T)=\omega+\tau\varphi(\tilde J_j\tilde J_j^T)\) and the constants \(C^{L}_{\lambda}(1-\omega)^{\lambda}\) and \(C^{L}_{\lambda}\tau^{\lambda}\) are small, the L-block network behaves as stably as a λ-layer network.

For the serial CA-then-SA block, the expectation depends on the mean of the input. That mean is 0 for Att-Res-SNN-1, whose input is a BN output, and a constant C for Att-Res-SNN-2, whose input is the BN output plus the attention output. The authors state that \(\varphi(J J^T)=1\) for the attention blocks can be reached when \(\epsilon\), \(\gamma_{w1}^2\), \(\gamma_{w0}^2\) and \(p\) are set appropriately.

Theorem 1 states that both Att-Res-SNN designs with L blocks achieve block dynamical isometry, so each behaves as a λ-layer network with \(\varphi\approx1\) and λ<L. For Att-Res-SNN-1, the attention branch is scaled by a small ζ from the normalization, so when ζ is initialized small, errors from non-optimal blocks reach only λ layers. Att-Res-SNN-2 works only if its basic residual block already achieves dynamical isometry.

The argument is analytic. It depends on the stated initialization, on the chosen parameter values, and on expectations under those assumptions, and the text gives no measured gradient norms to confirm it.

Spiking response across depth on ImageNet-1K

The spiking features are averaged over 50,000 samples and compared at stage 1, with layers 2, 4 and 6 of 64 channels, and at stage 4, with layers 29, 31 and 33 of 512 channels. At stage 1, the authors contrast CSA-Res-SNN-34 with the baseline by noting dark blue channels, with 17, 13 and 21 such channels in layers 2, 4 and 6. The authors checked these channels and found every neuron in them has a firing rate of 0.

At stage 4, the red object regions within channels become more diverse in Att-Res-SNN-34, most clearly in the last Conv layer, layer 33. The authors conjecture that this diversity supports class selectivity and links it to the +5.0 percent gain of Res-SNN-34. This is their interpretation of the visualization, not a measured quantity.

Limits of the evidence

The event-based evidence covers only Gesture and Gait, with three-layer and five-layer vanilla backbones. The attention location table is a single configuration with dt = 15 and T = 60.

Further gains from combining effectiveness and efficiency are left beyond the scope of the work.

The gradient result depends on Haar orthogonal initialization, a small initial ζ and parameter values described only as appropriate. The energy ratios assume the attention's own cost is negligible for Res-SNNs, and the energy comparison holds only under the stated condition on \(E_{AC}\,\Delta_{AC}\) and \(E_{MAC}\,\Delta_{MAC}\).

The visual analyses use one Gesture sample and one Gait sample, and the ImageNet response maps average 50,000 samples. Their meaning for class selectivity is the authors' interpretation.

Paper info

Authors
Man Yao, Guangshe Zhao, Hengyu Zhang, Yifan Hu, Lei Deng, Yonghong Tian, Bo Xu, Guoqi Li
Venue
arXiv · Preprint
First published
2022-9-28
Added
2026-11-6
Updated
2022-9-28
Version
v1
arXiv
2209.13929
Category
cs.CV
Original paper terms
CC BY 4.0
What we show
Paper info, commentary and permitted figures from the original paper

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Abstract

Benefiting from the event-driven and sparse spiking characteristics of the brain, spiking neural networks (SNNs) are becoming an energy-efficient alternative to artificial neural networks (ANNs). However, the performance gap between SNNs and ANNs has been a great hindrance to deploying SNNs ubiquitously for a long time. To leverage the full potential of SNNs, we study the effect of attention mechanisms in SNNs. We first present our idea of attention with a plug-and-play kit, termed the Multi-dimensional Attention (MA). Then, a new attention SNN architecture with end-to-end training called "MA-SNN" is proposed, which infers attention weights along the temporal, channel, as well as spatial dimensions separately or simultaneously. Based on the existing neuroscience theories, we exploit the attention weights to optimize membrane potentials, which in turn regulate the spiking response in a data-dependent way. At the cost of negligible additional parameters, MA facilitates vanilla SNNs to achieve sparser spiking activity, better performance, and energy efficiency concurrently. Experiments are conducted in event-based DVS128 Gesture/Gait action recognition and ImageNet-1k image classification. On Gesture/Gait, the spike counts are reduced by 84.9%/81.6%, and the task accuracy and energy efficiency are improved by 5.9%/4.7% and 3.4$\times$/3.2$\times$. On ImageNet-1K, we achieve top-1 accuracy of 75.92% and 77.08% on single/4-step Res-SNN-104, which are state-of-the-art results in SNNs. To our best knowledge, this is for the first time, that the SNN community achieves comparable or even better performance compared with its ANN counterpart in the large-scale dataset. Our work lights up SNN's potential as a general backbone to support various applications for SNNs, with a great balance between effectiveness and efficiency.

Quote from the paper

Man Yao, Guangshe Zhao, Hengyu Zhang, Yifan Hu, Lei Deng, Yonghong Tian, Bo Xu, Guoqi Li (2022). Attention Spiking Neural Networks. arXiv:2209.13929v1. https://arxiv.org/abs/2209.13929v1

BibTeX
@misc{yao2022attention,
  title = {{Attention Spiking Neural Networks}},
  author = {Man Yao and Guangshe Zhao and Hengyu Zhang and Yifan Hu and Lei Deng and Yonghong Tian and Bo Xu and Guoqi Li},
  year = {2022},
  eprint = {2209.13929},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2209.13929v1}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up