[Paper Review] Spikeformer: A Novel Architecture for Training High-Performance Low-Latency Spiking Neural Network
This paper proposes Spikeformer, a novel Transformer-based spiking neural network architecture that achieves state-of-the-art performance on both neuromorphic (DVS-Gesture, DVS-CIFAR10) and static (ImageNet) datasets with minimal simulation time steps. By introducing a Convolutional Tokenizer (CT) module to address data hunger and training instability, and employing spatio-temporal attention (STA) to jointly model spatial and temporal dependencies, Spikeformer outperforms its ANN counterpart by 2.2% on ImageNet and 3.1% on DVS-Gesture, demonstrating its superiority for low-latency, high-performance SNN training.
Spiking neural networks (SNNs) have made great progress on both performance and efficiency over the last few years,but their unique working pattern makes it hard to train a high-performance low-latency SNN.Thus the development of SNNs still lags behind traditional artificial neural networks (ANNs).To compensate this gap,many extraordinary works have been proposed.Nevertheless,these works are mainly based on the same kind of network structure (i.e.CNN) and their performance is worse than their ANN counterparts,which limits the applications of SNNs.To this end,we propose a novel Transformer-based SNN,termed "Spikeformer",which outperforms its ANN counterpart on both static dataset and neuromorphic dataset and may be an alternative architecture to CNN for training high-performance SNNs.First,to deal with the problem of "data hungry" and the unstable training period exhibited in the vanilla model,we design the Convolutional Tokenizer (CT) module,which improves the accuracy of the original model on DVS-Gesture by more than 16%.Besides,in order to better incorporate the attention mechanism inside Transformer and the spatio-temporal information inherent to SNN,we adopt spatio-temporal attention (STA) instead of spatial-wise or temporal-wise attention.With our proposed method,we achieve competitive or state-of-the-art (SOTA) SNN performance on DVS-CIFAR10,DVS-Gesture,and ImageNet datasets with the least simulation time steps (i.e.low latency).Remarkably,our Spikeformer outperforms other SNNs on ImageNet by a large margin (i.e.more than 5%) and even outperforms its ANN counterpart by 3.1% and 2.2% on DVS-Gesture and ImageNet respectively,indicating that Spikeformer is a promising architecture for training large-scale SNNs and may be more suitable for SNNs compared to CNN.We believe that this work shall keep the development of SNNs in step with ANNs as much as possible.Code will be available.
Motivation & Objective
- To address the performance and latency limitations of existing spiking neural networks (SNNs) trained via surrogate gradient or conversion methods.
- To overcome the data-hungry and unstable training issues of Vision Transformers (ViT) when adapted to SNNs.
- To design a new SNN architecture that outperforms CNN-based SNNs and matches or exceeds ANN performance on large-scale datasets like ImageNet.
- To enable direct training of SNNs with minimal simulation time steps while maintaining high accuracy and low energy consumption.
Proposed method
- Introduce a Convolutional Tokenizer (CT) module to replace the standard patchify stem in ViT, improving data efficiency and training stability for SNNs.
- Design a spatio-temporal attention (STA) mechanism that jointly models spatial and temporal dependencies in spiking sequences, unlike prior methods that use only spatial or temporal attention.
- Apply surrogate gradient backpropagation to train the SNN end-to-end with low latency, avoiding the need for ANN-to-SNN conversion.
- Adopt a '200 tokens' rule for architectural design, ensuring sufficient sequence length for stable training while maintaining efficiency.
- Optimize network depth and time steps through ablation studies, demonstrating robustness across different configurations.
- Use a lightweight, non-residual architecture in the initial design to prioritize the impact of the Transformer blocks and CT module.
Experimental results
Research questions
- RQ1Can a Transformer-based SNN architecture achieve competitive or state-of-the-art performance on both neuromorphic and static image datasets with low latency?
- RQ2How can the data-hungry and unstable training issues of Vision Transformers be mitigated when applied to SNNs?
- RQ3Does joint spatio-temporal attention in SNNs lead to better representation learning than spatial- or temporal-only attention?
- RQ4Can a directly trained SNN outperform its ANN counterpart on large-scale benchmarks like ImageNet?
- RQ5What architectural design principles (e.g., tokenization, sequence length) are critical for stable and high-performing SNN training?
Key findings
- Spikeformer achieves 98.96% top-1 accuracy on DVS-Gesture with only 4 time steps, outperforming prior SOTA methods by 1.04% under the same latency.
- On DVS-CIFAR10, Spikeformer achieves 85.21% accuracy with 4 time steps, surpassing the previous SOTA by 16.6% despite using fewer time steps and parameters.
- On ImageNet, Spikeformer attains 78.31% top-1 accuracy with 4 time steps and 38.75M parameters, outperforming SOTA SNNs trained via surrogate gradient or conversion by over 5%.
- Spikeformer exceeds its ANN counterpart by 2.2% on ImageNet and 3.1% on DVS-Gesture, marking the first time a directly trained SNN surpasses its ANN equivalent on these benchmarks.
- The Convolutional Tokenizer (CT) module improves accuracy on DVS-Gesture by over 16% compared to the vanilla ViT-based SNN, stabilizing training and enabling convergence.
- Ablation studies confirm the critical role of the CT module and the robustness of Spikeformer across varying depth and time step configurations.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.