SNN2ANN: A Fast and Memory-Efficient Training Framework for Spiking Neural Networks

Jianxiong Tang, Jianhuang Lai, Xiaohua Xie, Lingxiao Yang, Wei-Shi Zheng

TL;DR

SNN2ANN is a novel training framework that bridges the gap between energy-efficient Spiking Neural Networks (SNNs) and easily trainable Artificial Neural Networks (ANNs). By sharing weights between an SNN and a proxy ANN branch, it allows for high-performance SNN training with a fraction of the time and memory costs required by traditional spike-based backpropagation.

What Problem Does This Paper Address?

Spiking Neural Networks (SNNs) are the "holy grail" for low-power edge computing because they process information using discrete, asynchronous spikes, much like the human brain. However, they are notoriously difficult to train.

Current methods fall into two camps:

  1. Spike-based Backpropagation (BP): This trains SNNs directly but is incredibly slow and memory-hungry because it must track gradients across both space and time.
  2. ANN-to-SNN (ANN2SNN) Conversion: This trains a standard ANN and then converts it to an SNN. While training is fast, the resulting SNN usually requires hundreds of inference time steps to reach peak accuracy, negating its speed advantages.

Furthermore, SNNs suffer from a "noisy spike" problem—neurons firing when they shouldn't—which degrades performance when weights are simply shared between ANN and SNN architectures.

Methods

The authors introduce the SNN2ANN framework, which uses a dual-branch architecture where an SNN and an ANN share the same weights.

Fig. 4. Overview of the SNN2ANN framework. The upper branch is the SNN with Integrate-and-Fire neurons, while the lower branch is the ReSU/STSU- based ANN. The ReSU/STSU incorporates the accumulated spikes on the ANN branch, and BP training works on the ANN branch for parameter updating. Both ANN and SNN branches share the weights and classifier.

Key innovations include:

  • Spiking Mapping Units (ReSU & STSU): These units (Rectified Spiking Unit and Straight-Through Spiking Unit) act as a bridge. They take the accumulated spikes from the SNN branch and map them onto the ANN branch during training. This allows the network to optimize the SNN's classification error by performing standard, efficient backpropagation on the ANN branch.
  • Adaptive Threshold Adjustment (ATA): To combat noisy spikes, the ATA algorithm dynamically increases the firing threshold of neurons that fire incorrectly (i.e., when the corresponding ANN unit is inactive). This "denoises" the SNN during the training process.
  • Weight-Sharing with Batch Normalization: The framework transfers Batch Normalization parameters from the ANN to the SNN's weights and biases using exponential moving averages, ensuring the two branches stay synchronized.

Datasets

The framework was evaluated on three standard computer vision benchmarks:

  • CIFAR-10: 60,000 32x32 images across 10 categories.
  • CIFAR-100: Similar to CIFAR-10 but with 100 categories.
  • Tiny-ImageNet: A subset of ImageNet with 100,000 64x64 images across 200 categories.

Key Insights and Ideas

  • Training on the Proxy: The core "aha" moment is that you don't need to propagate gradients through the temporal dimension of an SNN if you can accurately map its spiking behavior back to a differentiable ANN proxy. This bypasses the main computational bottleneck of SNN training.
  • The Noisy Spike Filter: The authors identified that SNNs often fire at positions where a standard ReLU-based ANN would be inactive. By using the ANN's activation positions as a mask (in the ReSU unit), they can force the SNN to focus on relevant features.
Visualization of the noisy spike problem where SNNs (top) fire at incorrect positions compared to ANNs (bottom).
  • Efficiency through Sparsity: Because the SNN2ANN models are trained to be accurate with very few time steps (often just 3 to 5), they achieve significantly higher energy efficiency than conversion-based models that require hundreds of steps.

Key Results

SNN2ANN achieves state-of-the-art performance while being significantly lighter than traditional spike-based BP (STBP) models:

  • Speed & Memory: It requires only 0.377x the training time and 0.27x the GPU memory of STBP models.
  • Inference Efficiency: It achieves comparable accuracy using only 0.625x the time steps and 0.33x the spike activity.
  • Accuracy: On CIFAR-100 with a ResNet-17 backbone, SNN2ANN reached 73.26% accuracy in just 5 time steps, outperforming many direct training and conversion methods.
Fig. 2. The activated positions of the weight sharing ANN and SNN. In the output of IF neurons, the green colors denote the same activated positions with ANN, and the red colors are the incorrect activates.

Limitations and Future Work

While SNN2ANN drastically reduces training overhead, the paper primarily focuses on image classification tasks. It remains to be seen how well this mapping approach translates to complex temporal tasks like video processing or speech recognition, where the spatio-temporal dynamics might be too complex for a simple ANN proxy to capture. Future work could explore extending these mapping units to more complex spiking neuron models beyond the basic Integrate-and-Fire (IF) neuron.

Summary updated

Abstract

Spiking neural networks are efficient computation models for low-power environments. Spike-based BP algorithms and ANN-to-SNN (ANN2SNN) conversions are successful techniques for SNN training. Nevertheless, the spike-base BP training is slow and requires large memory costs. Though ANN2NN provides a low-cost way to train SNNs, it requires many inference steps to mimic the well-trained ANN for good performance. In this paper, we propose a SNN-to-ANN (SNN2ANN) framework to train the SNN in a fast and memory-efficient way. The SNN2ANN consists of 2 components: a) a weight sharing architecture between ANN and SNN and b) spiking mapping units. Firstly, the architecture trains the weight-sharing parameters on the ANN branch, resulting in fast training and low memory costs for SNN. Secondly, the spiking mapping units ensure that the activation values of the ANN are the spiking features. As a result, the classification error of the SNN can be optimized by training the ANN branch. Besides, we design an adaptive threshold adjustment (ATA) algorithm to address the noisy spike problem. Experiment results show that our SNN2ANN-based models perform well on the benchmark datasets (CIFAR10, CIFAR100, and Tiny-ImageNet). Moreover, the SNN2ANN can achieve comparable accuracy under 0.625x time steps, 0.377x training time, 0.27x GPU memory costs, and 0.33x spike activities of the Spike-based BP model.
BibTeX
@article{tang2023snn,
  author = {Jianxiong Tang and Jianhuang Lai and Xiaohua Xie and Lingxiao Yang and Wei-Shi Zheng},
  title = {{SNN2ANN: A Fast and Memory-Efficient Training Framework for Spiking Neural Networks}},
  journal = {Pattern Recognition},
  year = {2023},
  doi = {10.1016/j.patcog.2023.109826},
}
Figure