Direct Training for Spiking Neural Networks: Faster, Larger, Better

Yujie Wu, Lei Deng, Guoqi Li, Jun Zhu, Luping Shi

Abstract

Spiking neural networks (SNNs) that enable energy-efficient implementation on emerging neuromorphic hardware are gaining more attention. Yet now, SNNs have not shown competitive performance compared with artificial neural networks (ANNs), due to the lack of effective learning algorithms and efficient programming frameworks. We address this issue from two aspects: (1) We propose a neuron normalization technique to adjust the neural selectivity and develop a direct learning algorithm for deep SNNs. (2) Via narrowing the rate coding window and converting the leaky integrate-and-fire (LIF) model into an explicitly iterative version, we present a Pytorch-based implementation method towards the training of large-scale SNNs. In this way, we are able to train deep SNNs with tens of times speedup. As a result, we achieve significantly better accuracy than the reported works on neuromorphic datasets (N-MNIST and DVS-CIFAR10), and comparable accuracy as existing ANNs and pre-trained SNNs on non-spiking datasets (CIFAR10). To our best knowledge, this is the first work that demonstrates direct training of deep SNNs with high performance on CIFAR10, and the efficient implementation provides a new way to explore the potential of SNNs.

Introduction

Spiking Neural Networks (SNNs) represent the "third generation" of neural networks, designed to emulate the energy-efficient, event-driven nature of biological brains. Despite their potential, SNNs have historically struggled to compete with standard Artificial Neural Networks (ANNs). This performance gap stems from three primary challenges: the non-differentiable nature of discrete spikes which complicates backpropagation, the complex spatio-temporal dynamics of stateful neurons, and a lack of high-performance deep learning frameworks tailored for SNNs. Most existing simulators prioritize biological realism over computational efficiency, limiting research to small-scale models.

Methods

To bridge the gap between SNNs and ANNs, we propose a multi-layered optimization strategy encompassing model architecture, training algorithms, and implementation frameworks.

Explicitly Iterative LIF Model

We convert the continuous Leaky Integrate-and-Fire (LIF) differential equations into a discrete, iterative form. This transformation allows the SNN to be represented as a computational graph compatible with modern deep learning frameworks like PyTorch, facilitating automatic differentiation.

Spatio-temporal dynamics of the LIF model and its conversion into an explicitly iterative version for training.

Spatio-Temporal Backpropagation (STBP) and NeuNorm

To address the non-differentiability of spikes, we utilize Spatio-Temporal Backpropagation (STBP) with a surrogate gradient approach. Specifically, a rectangular function approximates the derivative of spike activity during the backward pass. Furthermore, we introduce NeuNorm (Neuron Normalization). Unlike standard Batch Normalization, NeuNorm uses auxiliary neurons to normalize input strength across feature maps, preventing signal degradation or explosion in deep architectures.

Optimized Coding and Voting Strategy

We significantly reduce the required simulation window ($T$) by employing a voting strategy at the output layer. By assigning groups of neurons to represent specific classes, the network can reach high-accuracy decisions in as few as 4 to 12 time steps, drastically lowering computational overhead.

Results

The proposed framework was evaluated on both neuromorphic datasets (N-MNIST, DVS-CIFAR10) and the standard static CIFAR10 dataset.

Training Efficiency

The transition from traditional Matlab-based scripts to an explicitly iterative PyTorch implementation yielded a massive performance gain. Our method achieves a 10x to 100x speedup in training time across various model scales.

Comparison of training time between the proposed PyTorch-based implementation and traditional Matlab-based methods across different datasets and model sizes.

Accuracy and Performance

Our direct training method achieved state-of-the-art results on neuromorphic benchmarks:

  • N-MNIST: 99.53% accuracy.
  • DVS-CIFAR10: 60.5% accuracy.

On the static CIFAR10 dataset, the model reached an accuracy of 90.53%. This performance is comparable to traditional non-spiking ANNs and significantly outperforms existing ANN-to-SNN conversion methods, demonstrating that deep SNNs can be trained directly to high performance.

Conclusion

This work presents a comprehensive solution for training high-performance, large-scale SNNs. By combining the NeuNorm technique with an efficient, iterative PyTorch implementation, we demonstrate that SNNs can achieve competitive accuracy with ANNs while benefiting from significant training speedups. This framework opens new avenues for exploring the potential of energy-efficient neuromorphic computing in large-scale deep learning applications.

Summary updated

BibTeX
@inproceedings{wu2019direct,
  author = {Yujie Wu and Lei Deng and Guoqi Li and Jun Zhu and Luping Shi},
  title = {{Direct Training for Spiking Neural Networks: Faster, Larger, Better}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2019},
  doi = {10.1609/aaai.v33i01.33011311},
}
Figure