Stepwise Weighted Spike Coding for Deep Spiking Neural Networks

Yiwen Gu, Junchuan Gu, Haibin Shen, Kejie Huang · DOI

Introduction

Spiking Neural Networks (SNNs) are biologically inspired models known for their ultra-low power consumption. However, their practical application is often hindered by high latency. Traditional SNNs rely on rate coding or temporal coding, both of which scale linearly with the precision required. For instance, representing 256 distinct values might necessitate 256 timesteps, significantly slowing down inference and negating energy benefits.

Comparison of spike coding schemes: (a) Rate coding, (b) Time-to-first-spike (TTFS), (c) Weighted Rate coding, and (d) their respective encoding capacities.

As shown in Figure 1, while rate and temporal coding (TTFS) have limited encoding capacity, weighted rate coding offers exponential growth in information density. However, implementing weighted spikes typically requires complex hardware like dynamic multipliers or shifting thresholds, which are difficult to implement on silicon.

The Ternary Momentum Neuron (TMN)

To overcome the hardware complexity of weighted spikes, the authors propose the Ternary Momentum Neuron (TMN). This model introduces two key innovations to achieve nonlinear, exponential encoding without hardware overhead:

1. The Momentum Mechanism

Instead of applying complex time-varying weights to incoming spikes, the TMN doubles its internal membrane potential ($u$) at each step: $u \leftarrow 2 \times u$. This recursive doubling effectively applies an exponential weight ($2^{T-t}$) to the spike train. In hardware, this is a "cost-free" operation—a simple bit-shift or wiring trick.

2. Ternary Predictive Spiking (TPS)

Standard neurons fire only when the potential reaches a full threshold ($v_{th}$). TMN is "proactive," using predictive thresholds at $\pm 0.5 v_{th}$. It can fire a positive spike early if it is halfway to the threshold, or a negative spike to correct an over-firing error. This feedback loop ensures the internal state stays close to zero, minimizing representation error. The resulting spike pattern is termed Canonical Signed Spike (CSS) encoding.

Experimental Evaluation

The TMN model was tested across diverse benchmarks to prove its generalizability:

  • Image Classification: On ImageNet, a ResNet-34 achieved a tiny 0.3% conversion loss in just 8 timesteps, compared to the 256 timesteps often required by previous state-of-the-art methods.
  • Object Detection: Successfully implemented in a YOLOv2 framework on VOC2007.
  • Natural Language Processing: Minimal performance drops when converting RoBERTa models for sentiment analysis (SST-2, IMDB-MR).
  • Vision Transformers: Validated with ViT-Small on ImageNet.

Key Results and Impact

The primary advantage of TMN is its extreme speed and efficiency. On CIFAR-100, it reached 76.23% accuracy in only 2 timesteps. Quantitatively, TMN reduces energy consumption by approximately 50% compared to high-performance SNN baselines like Fast-SNN and COS. By shifting the complexity from input weights to the internal neuron state (the "doubling" trick), TMN achieves exponential encoding capacity ($O(\log N)$ timesteps) without the need for multipliers.

Conclusion and Future Directions

The Ternary Momentum Neuron represents a significant step toward practical, high-speed SNNs. While currently demonstrated through ANN-to-SNN conversion, future work could explore direct training with surrogate gradients. Additionally, while ternary spikes increase the spike rate slightly, the trade-off is justified by the dramatic reduction in latency and overall energy consumption. Real-world deployment will benefit from neuromorphic hardware, such as Intel's Loihi, which already supports ternary spike processing.

Summary updated

BibTeX
@misc{gu2024stepwise,
  author = {Yiwen Gu and Junchuan Gu and Haibin Shen and Kejie Huang},
  title = {{Stepwise Weighted Spike Coding for Deep Spiking Neural Networks}},
  year = {2024},
  eprint = {2408.17245},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.17245},
}
Figure