Spiking neural networks (SNNs) are emerging as an energy-efficient alternative to traditional artificial neural networks (ANNs) due to their unique spike-based event-driven nature. Coding is crucial in SNNs as it converts external input stimuli into spatio-temporal feature sequences. However, most existing deep SNNs rely on direct coding that generates powerless spike representation and lacks the temporal dynamics inherent in human vision. Hence, we introduce Gated Attention Coding (GAC), a plug-and-play module that leverages the multi-dimensional gated attention unit to efficiently encode inputs into powerful representations before feeding them into the SNN architecture. GAC functions as a preprocessing layer that does not disrupt the spike-driven nature of the SNN, making it amenable to efficient neuromorphic hardware implementation with minimal modifications. Through an observer model theoretical analysis, we demonstrate GAC's attention mechanism improves temporal dynamics and coding efficiency. Experiments on CIFAR10/100 and ImageNet datasets demonstrate that GAC achieves state-of-the-art accuracy with remarkable efficiency. Notably, we improve top-1 accuracy by 3.10\% on CIFAR100 with only 6-time steps and 1.07\% on ImageNet while reducing energy usage to 66.9\% of the previous works. To our best knowledge, it is the first time to explore the attention-based dynamic coding scheme in deep SNNs, with exceptional effectiveness and efficiency on large-scale datasets.The Code is available at https://github.com/bollossom/GAC.
翻译:脉冲神经网络(SNNs)因其独特的基于脉冲的事件驱动特性,正成为传统人工神经网络(ANNs)的一种高能效替代方案。编码在SNNs中至关重要,它将外部输入刺激转换为时空特征序列。然而,大多数现有的深度SNNs依赖于直接编码,这种编码生成的脉冲表示能力较弱,且缺乏人类视觉固有的时间动态特性。因此,我们引入了门控注意力编码(GAC),这是一个即插即用的模块,它利用多维门控注意力单元,在将输入馈送到SNN架构之前,高效地将其编码为强大的表示。GAC作为一个预处理层,不会破坏SNN的脉冲驱动特性,使其只需最小修改即可适配高效神经形态硬件实现。通过观察者模型理论分析,我们证明了GAC的注意力机制改善了时间动态特性和编码效率。在CIFAR10/100和ImageNet数据集上的实验表明,GAC以卓越的效率实现了最先进的准确率。值得注意的是,我们在CIFAR100上仅用6个时间步长就将top-1准确率提高了3.10%,在ImageNet上提高了1.07%,同时将能耗降低至先前工作的66.9%。据我们所知,这是首次在深度SNNs中探索基于注意力的动态编码方案,并在大规模数据集上展现出卓越的有效性和效率。代码可在 https://github.com/bollossom/GAC 获取。