Tensor Decomposition Based Attention Module for Spiking Neural Networks

Haoyu Deng, Ruijie Zhu, Xuerui Qiu, Yule Duan, Malu Zhang +1 more
10/23/2023
21 citations
cs.LGcs.CV
transformer-attention

Official code: RisingEntropy/PFA (8 stars, Python, last commit 2024-05-08).

Abstract

The attention mechanism has been proven to be an effective way to improve spiking neural network (SNN). However, based on the fact that the current SNN input data flow is split into tensors to process on GPUs, none of the previous works consider the properties of tensors to implement an attention module.

Show full abstract

This inspires us to rethink current SNN from the perspective of tensor-relevant theories. Using tensor decomposition, we design the \textit{projected full attention} (PFA) module, which demonstrates excellent results with linearly growing parameters. Specifically, PFA is composed by the \textit{linear projection of spike tensor} (LPST) module and \textit{attention map composing} (AMC) module. In LPST, we start by compressing the original spike tensor into three projected tensors using a single property-preserving strategy with learnable parameters for each dimension. Then, in AMC, we exploit the inverse procedure of the tensor decomposition process to combine the three tensors into the attention map using a so-called connecting factor. To validate the effectiveness of the proposed PFA module, we integrate it into the widely used VGG and ResNet architectures for classification tasks. Our method achieves state-of-the-art performance on both static and dynamic benchmark datasets, surpassing the existing SNN models with Transformer-based and CNN-based backbones.

View on arXivView PDF

Code Implementations(1)

RisingEntropy/PFAOfficial100%

Official repository for paper: Tensor Decomposition Based Attention Module for Spiking Neural Networks

80PythonMar 11, 20242 years ago

Similar Papers

Cite this paper

@article{deng2023tensor,
  title  = {Tensor Decomposition Based Attention Module for Spiking Neural Networks},
  author = {Haoyu Deng and Ruijie Zhu and Xuerui Qiu and Yule Duan and Malu Zhang and Liangjian Deng},
  year   = {2023},
  eprint = {2310.14576},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2310.14576v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2310.14576.svg)](https://codeofpaper.com/paper/2310.14576)

Discussion