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.
翻译:脉冲神经网络(SNNs)因独特的基于脉冲的事件驱动特性,正成为传统人工神经网络(ANNs)的节能替代方案。编码在SNNs中至关重要,它将外部输入刺激转换为时空特征序列。然而,现有大多数深度SNNs依赖直接编码,这种编码生成的脉冲表示能力薄弱,且缺乏人类视觉固有的时间动态特性。为此,我们提出门控注意力编码(GAC)——一种即插即用模块,它利用多维门控注意力单元,在将输入馈入SNN架构前高效编码为强表征。GAC作为预处理层,不会破坏SNN的脉冲驱动特性,使其易于在高效神经形态硬件上实现且仅需极小修改。通过观察者模型理论分析,我们证明GAC的注意力机制能够改善时间动态特性与编码效率。在CIFAR10/100和ImageNet数据集上的实验表明,GAC以卓越效率实现了最先进的准确率。值得注意的是,我们仅用6个时间步便在CIFAR100上提升3.10%的top-1准确率,在ImageNet上提升1.07%,同时将能耗降至前人工作的66.9%。据我们所知,这是首次在深度SNNs中探索基于注意力的动态编码方案,并在大规模数据集上展现出卓越的有效性与效率。