# Attention Spiking Neural Networks

Attention Spiking Neural Networks

Man Yao, Guangshe Zhao, Hengyu Zhang, Yifan Hu, Lei Deng, Yonghong Tian ほか2名 · arXiv · 2022年9月28日

- **課題** SNNはエネルギー効率が高いものの、深い構造ではdegradation問題やANNとの性能差が残っています。本論文は、Attentionを膜電位の最適化に用いてスパイク活動を減らしつつ精度を高められるかを検証します。
- **手法** MAモジュールは、時間・チャネル・空間のAttention重みを膜電位に掛けてデータ依存的に補正します。深い構造では、MS-Res-SNNバックボーンにCSAを、残差ブロックとショートカット接続のあいだに配置します。
- **結果** DVS128 Gesture/Gaitで、TCSAを適用した3層SNNは精度を5.9と4.7高め、NASARを84.9%と81.6%低下させました。ImageNet-1Kでは、時間ステップ4のCSA-Res-SNN-104が77.08%のtop-1精度を報告しています。

## SNNとANNの性能差とAttention導入の必要性

スパイキングニューラルネットワーク（SNN）は、二値のスパイクでニューロン間の通信を行い、イベント駆動型の低消費電力計算を目指します。しかしSNNは深くなるほどスパイク発火の低下と勾配消失が同時に起こり、学習とテストの精度が落ちるdegradation問題を抱えています。大規模データセットでは、ANNとの性能差がなお残っています。一方、ANNではAttentionが重要な情報に集中させることで大きな成果を上げてきましたが、SNNの分野ではAttentionの適用が十分に研究されていません。

本論文は、AttentionをSNNの演算の原型を変えずに補助的な単位として入れつつ、Attentionが膜電位を調整してスパイク活動を減らし、同時に性能を高められるかを問います。

## 膜電位を調整する多次元Attention構造

基本のSNN層は、畳み込みで空間特徴を抽出した後、LIFニューロンが膜電位を積分し、閾値を超えるとスパイクを生成してリセットします。MAモジュールは、この膜電位にAttention重みを掛けてデータ依存的に値を補正します。著者らは、入力にAttentionを掛ける方法（xAtt=g(x)·x）を採用し、時間（TA）、チャネル（CA）、空間（SA）の各次元を独立に、または組み合わせて使えるように設計しました。

チャネルAttentionは、膜電位の平均プーリングと最大値プーリングを共有MLPに通して、チャネルごとの1次元の重みを得ます。空間Attentionは、チャネル方向の平均と最大値に7×7の畳み込みを適用して2次元の重みを得ます。これらを組み合わせたCSA構造は膜電位を連続して補正し、Attentionの位置については、活性化の前の膜電位に置く方が実験で最も高い性能と低いNASARを示したと報告されています。

![Figure 4: Attention Locations in Plain SNN. From left to right: baseline CNN, processing spatial information. Attention CNN, performing attention module after…](https://refivu.com/papers/2c52d99c-a249-4911-96bd-79f6720c0a09/figures/figure-593b0513daf0ee4bdd18411154ebd1ed.png?thumb=512)

**Fig. 4** : Attention Locations in Plain SNN. From left to right: baseline CNN, processing spatial information. Attention CNN, performing attention module after activation \[19\], \[28\]. Vanilla SNN, processing spatio-temporal information. Conv-PRE Attention SNN, inserting attention modules before the Conv operation. Conv-POST, acting attention modules after the Conv operation while before the spatio-temporal integration. Activate-PRE, executing attention modules on the integrated membrane potential. MA-SNN, our recommended attention locations of three dimensions in plain SNN.

[出典](https://arxiv.org/abs/2209.13929v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Man Yao, Guangshe Zhao, Hengyu Zhang, Yifan Hu, Lei Deng, Yonghong Tian, Bo Xu, Guoqi Li · Attention Spiking Neural Networks · 論文の図を引用 · 元のPDFの11ページ目から図の部分を抽出しています。

## 深いAtt-Res-SNNと勾配ノルムの同値性

深いSNNの残差学習では、MS-Res-SNNの膜電位ショートカット接続をバックボーンとして用い、Attentionモジュールを残差ブロックとショートカット接続のあいだに置くAtt-Res-SNN-1を推奨案として示しています。著者らは、この配置が膜電位の最適化という動機と整合すると説明しています。

![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…](https://refivu.com/papers/2c52d99c-a249-4911-96bd-79f6720c0a09/figures/figure-61fae03678041fe8d19504c0ec095cf6.png?thumb=512)

**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.

[出典](https://arxiv.org/abs/2209.13929v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Man Yao, Guangshe Zhao, Hengyu Zhang, Yifan Hu, Lei Deng, Yonghong Tian, Bo Xu, Guoqi Li · Attention Spiking Neural Networks · 論文の図を引用 · 元のPDFの6ページ目から図の部分を抽出しています。

勾配解析では、ブロック動的等長理論を用います。著者らは、CAブロックとSAブロックのヤコビアンの期待値を計算し、2つのブロックを直列に結合したCSAブロックが、初期化と正規化定数を適切に設定することでφ(JJT)≈1を満たせることを示しています。この結果は、重みの初期化と正規化条件を含む理論的仮定のもとで示されたもので、証明された結果はAttentionブロックとAtt-Res-SNN-1の条件付き安定性です。

## NASARとエネルギーコストの推定

SNNのエネルギーコストは、最初のエンコーダ層のMAC演算と残りの層のAC演算に分けて推定します。Attentionモジュールは追加のMAC演算を必要としますが、スパイク活動が減るとAC演算は減少します。著者らは、この2つの項の差からエネルギーの変化を計算します。

スパイク数は、NASARと、ニューロン数、時間ステップ数の積で近似されるため、著者らはNASARをエネルギーコストを近似する指標として用います。この相対エネルギー効率は実際のハードウェア測定ではなく、演算数に基づく推定値なので、解釈の際にはその点を併せて考慮する必要があります。

## DVS128 GestureとGaitのイベントベース認識の結果

イベントベースの実験では、DVS128 GestureとGaitのデータセットで、3層SNNと5層SNNをベースラインのモデルとして用いました。3層SNNにTCSAを適用すると、Gestureの精度は90.63%から96.53%へ5.9上昇し、NASARは0.173から0.026へ84.9%減少、エネルギー効率は3.4×と報告されています。Gaitでは精度が4.7上昇し、NASARは81.6%減少、効率は3.2×です。

![Table 1: Comparison with previous works on Gesture and Gait. The numbers or percentages in brackets denote the performance improvement or reduction proportions…](https://refivu.com/papers/2c52d99c-a249-4911-96bd-79f6720c0a09/figures/figure-97d4fc7ebf37b2198e17360da6dae747.png?thumb=512)

**TABLE 1** : Comparison with previous works on Gesture and Gait. The numbers or percentages in brackets denote the performance improvement or reduction proportions of spiking activity over the re-implementation baseline \[43\] and \[38\]. The format of “A±a” represents the mean and variance of the accuracy of repeat ten independent experiments.

[出典](https://arxiv.org/abs/2209.13929v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Man Yao, Guangshe Zhao, Hengyu Zhang, Yifan Hu, Lei Deng, Yonghong Tian, Bo Xu, Guoqi Li · Attention Spiking Neural Networks · 論文の図を引用 · 元のPDFの8ページ目から図の部分を抽出しています。

![Figure 6: Case study on event-based tasks. We can observe that attention drives SNNs to focus on the target while the vanilla model shows more decentralized sp…](https://refivu.com/papers/2c52d99c-a249-4911-96bd-79f6720c0a09/figures/figure-faab9084027910ac66f2fb36906bdc37.png?thumb=512)

**Fig. 6** : Case study on event-based tasks. We can observe that attention drives SNNs to focus on the target while the vanilla model shows more decentralized spiking activations.

[出典](https://arxiv.org/abs/2209.13929v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Man Yao, Guangshe Zhao, Hengyu Zhang, Yifan Hu, Lei Deng, Yonghong Tian, Bo Xu, Guoqi Li · Attention Spiking Neural Networks · 論文の図を引用 · 元のPDFの14ページ目から図の部分を抽出しています。

5層のベースラインでも精度は向上しますが、エネルギー効率の向上は1.8×程度と低く報告されています。著者らは、この差を、5層のベースラインでは最初のエンコーディング層にMAC演算が多いためだと解釈しています。

## ImageNet-1Kでの単一時間ステップの学習と精度

ImageNet-1Kの実験では、MS-Res-SNNをもとに再実装したベースラインと、CSAを付加したモデルを同じ学習条件で比較します。時間ステップT=1の設定では、CSA-Res-SNN-18の精度は63.97%で、時間ステップ6のMS-Res-SNN-18の63.10%より高く報告されています。Res-SNN-34系では、CSAを適用すると精度が5.0上昇し、NASARが減少します。

![Table 2: Comparison with previous works on ImageNet-1K. \* The input crops are enlarged to 288×288 in inference](https://refivu.com/papers/2c52d99c-a249-4911-96bd-79f6720c0a09/figures/figure-ceadf6f6f10d45bfdcb0df1b58c0b874.png?thumb=512)

**TABLE 2** : Comparison with previous works on ImageNet-1K. \* The input crops are enlarged to 288×288 in inference.

[出典](https://arxiv.org/abs/2209.13929v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Man Yao, Guangshe Zhao, Hengyu Zhang, Yifan Hu, Lei Deng, Yonghong Tian, Bo Xu, Guoqi Li · Attention Spiking Neural Networks · 論文の図を引用 · 元のPDFの9ページ目から図の部分を抽出しています。

時間ステップ4のCSA-Res-SNN-104は77.08%を記録し、単一ステップのモデルは75.92%を報告しています。この結果は、ImageNetの静止画入力を時間ステップごとに複製した設定であり、イベントベース実験の設定とは区別して読む必要があります。

## アブレーション実験で見たAttentionの位置と次元の効果

アブレーション実験では、Attentionの位置、Attentionの変種、次元の組み合わせ、残差の位置をそれぞれ変えました。3層SNNでは、Conv-PREとConv-POSTの位置の両方でTAの性能が向上し、CAは活性化の前の膜電位に置いたとき最も高い精度と低いNASARを示しました。複数の次元を同時に使うと、TCSAが最も高い精度向上（+5.9）を記録しました。

![Table 4: Effect of attention locations in three-layer SNN \[43\] at different dimensions on Gesture withdt = 15,T = 60](https://refivu.com/papers/2c52d99c-a249-4911-96bd-79f6720c0a09/figures/figure-0d555572f41a8d6cc893e0511a5dc5e3.png?thumb=512)

**TABLE 4** : Effect of attention locations in three-layer SNN \[43\] at different dimensions on Gesture withdt = 15,T = 60

[出典](https://arxiv.org/abs/2209.13929v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Man Yao, Guangshe Zhao, Hengyu Zhang, Yifan Hu, Lei Deng, Yonghong Tian, Bo Xu, Guoqi Li · Attention Spiking Neural Networks · 論文の図を引用 · 元のPDFの10ページ目から図の部分を抽出しています。

![Table 5: Effect of Different attention modules in three-layer SNN \[43\] on Gesture with dt = 15,T = 60](https://refivu.com/papers/2c52d99c-a249-4911-96bd-79f6720c0a09/figures/figure-172627cb1d552c6d70ca07124086a2b9.png?thumb=512)

**TABLE 5** : Effect of Different attention modules in three-layer SNN \[43\] on Gesture with dt = 15,T = 60

[出典](https://arxiv.org/abs/2209.13929v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Man Yao, Guangshe Zhao, Hengyu Zhang, Yifan Hu, Lei Deng, Yonghong Tian, Bo Xu, Guoqi Li · Attention Spiking Neural Networks · 論文の図を引用 · 元のPDFの11ページ目から図の部分を抽出しています。

この結果は、取り除いた構成要素の変化を示すもので、その要素を維持する有用性を意味します。すべての構成要素が常に寄与するという一般的な結論にまで広げることはできません。

## 適用範囲と解釈の限界

この研究の結果は、特定のバックボーン、データセット、指定された時間ステップと遅延条件で得られたものです。イベントベースの実験は浅い平面SNNを対象に行われ、ImageNet-1Kの実験はMS-Res-SNN系のバックボーンで行われました。

エネルギー効率はNASARと演算数に基づく推定値なので、実際のチップでの消費電力と直接同じとはみなせません。また、ブロック動的等長解析は仮定された初期化と正規化条件のもとで示されたものなので、それ以外の設定については、この論文が確認した範囲ではありません。

## 論文情報

- **著者**: Man Yao, Guangshe Zhao, Hengyu Zhang, Yifan Hu, Lei Deng, Yonghong Tian, Bo Xu, Guoqi Li
- **学会・ジャーナル**: arXiv · プレプリント
- **公開日**: 2022年9月28日
- **登録日**: 2026年11月6日
- **更新日**: 2022年9月28日
- **バージョン**: v1
- **arXiv**: 2209.13929
- **カテゴリ**: cs.CV
- **ライセンス**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **掲載内容**: 論文情報・解説・論文の図

[元論文 ↗](https://arxiv.org/abs/2209.13929v1) · [PDF ↗](https://arxiv.org/pdf/2209.13929v1)

この解説は、Refivuの韓国語解説をAIで翻訳したものです。不正確な翻訳や誤りが含まれる可能性があります。論文と図の利用条件は各出典に従います。

## アブストラクト

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.

## この論文を引用

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}
}
```

## この論文の用語

- [Top-1 accuracy](https://refivu.com/ja/terms/653c0b9eaa58-top-1-accuracy)
- [ImageNet-1K](https://refivu.com/ja/terms/d8d6444bd460-imagenet-1k)
- [degradation problem](https://refivu.com/ja/terms/19c9f79e020a-degradation-problem)

## ほかの論文解説

- [Tackling the Curse of Dimensionality with Physics-Informed Neural Networks](https://refivu.com/ja/papers/06c237e9-b634-4450-8252-7fb4dd712d2e-tackling-the-curse-of-dimensionality-with-physics-informed.md)
- [Continuous online sequence learning with an unsupervised neural network model](https://refivu.com/ja/papers/2850b462-149b-4637-8186-0e3a02a69df4-continuous-online-sequence-learning-with-an-unsupervised.md)
- [A Cost-Sensitive Deep Belief Network for Imbalanced Classification](https://refivu.com/ja/papers/140fac18-43ea-4f02-a761-0549f84a0de3-a-cost-sensitive-deep-belief-network-for-imbalanced.md)
- [OnionNet: a multiple-layer inter-molecular contact based convolutional neural network for protein-ligand binding affinity prediction](https://refivu.com/ja/papers/d363670e-b76b-46a2-bc53-1b22fb49dd68-onionnet-a-multiple-layer-inter-molecular-contact-based.md)
- [Avoiding Overfitting: A Survey on Regularization Methods for Convolutional Neural Networks](https://refivu.com/ja/papers/726fc9f2-ea0b-4f5f-b42e-cc0c9f6e4c3a-avoiding-overfitting-a-survey-on-regularization-methods-for.md)
- [Weakly-Supervised Convolutional Neural Networks for Multimodal Image Registration](https://refivu.com/ja/papers/bfc7dfd6-1596-4541-9723-c26ab0c5a3f5-weakly-supervised-convolutional-neural-networks-for.md)
- [Uncovering near-wall blood flow from sparse data with physics-informed neural networks](https://refivu.com/ja/papers/5532e81a-0a00-4722-b226-e72f33cb333a-uncovering-near-wall-blood-flow-from-sparse-data.md)
- [Deep Unsupervised Learning using Nonequilibrium Thermodynamics](https://refivu.com/ja/papers/0a712ab6-ae49-4e62-8de7-48f3f793c53f-deep-unsupervised-learning-using-nonequilibrium.md)
- [A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning](https://refivu.com/ja/papers/08306129-4598-48b6-baf3-9d1af09e03a6-a-reduction-of-imitation-learning-and-structured-prediction.md)
- [NICE: Non-linear Independent Components Estimation](https://refivu.com/ja/papers/f56da4f3-4308-4b66-a0bf-e0d6e495195a-nice-non-linear-independent-components-estimation.md)
- [Fast R-CNN](https://refivu.com/ja/papers/cf1d88ea-f632-4173-bcfd-eec504e5c175-fast-r-cnn.md)
- [Gaussian Error Linear Units (GELUs)](https://refivu.com/ja/papers/264fd129-ba49-4e4c-ac1f-59466a4e43ea-gaussian-error-linear-units-gelus.md)

---

AI解説には誤りが含まれることがあります。 [Refivu](https://refivu.com/ja/papers/2c52d99c-a249-4911-96bd-79f6720c0a09-attention-spiking-neural-networks)
