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. 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.
翻译:注意力机制已被证明是提升脉冲神经网络(SNN)性能的有效手段。然而,鉴于当前SNN输入数据流需分拆为张量在GPU上处理,此前研究均未考虑利用张量特性实现注意力模块。这促使我们从张量相关理论视角重新审视现有SNN。通过张量分解,我们设计了"投影全注意力"(PFA)模块,该模块在参数线性增长下展现出卓越性能。具体而言,PFA由"脉冲张量线性投影"(LPST)模块和"注意力图合成"(AMC)模块组成。在LPST中,我们首先采用维度自适应的单属性保持策略,将原始脉冲张量压缩为三个投影张量。随后在AMC中,利用张量分解的逆过程,通过连接因子将三个张量合成为注意力图。为验证所提PFA模块的有效性,我们将其集成至广泛使用的VGG和ResNet架构中执行分类任务。该方法在静态与动态基准数据集上均达到当前最优性能,超越了基于Transformer和CNN骨干的现有SNN模型。