Exploring the Connection Between Binary and Spiking Neural Networks

Sen Lu, Abhronil SenguptaarXiv 2020

Abstract

Deploying deep learning on edge devices requires a balance between computational efficiency and model accuracy. While Binary Neural Networks (BNNs) offer extreme compression, they often suffer from significant accuracy loss on complex tasks. This paper introduces Binary Spiking Neural Networks (B-SNNs), which leverage the temporal dimension of spiking neurons to recover the accuracy lost in spatial binarization. By converting constrained Artificial Neural Networks (ANNs) to SNNs and implementing novel latency optimizations, the authors demonstrate that B-SNNs can achieve near full-precision performance on datasets like ImageNet while remaining compatible with simple binary hardware.

Introduction

The deployment of AI on resource-constrained edge devices, such as IoT sensors and wearables, necessitates extreme efficiency in both compute and storage. Binary Neural Networks (BNNs) address this by quantizing weights and activations to single bits (+1 or -1), significantly reducing memory and compute requirements. However, BNNs frequently struggle with accuracy degradation on large-scale tasks like ImageNet. Conversely, Spiking Neural Networks (SNNs) utilize event-driven, binary spike-based communication over time, offering high energy efficiency but presenting challenges in direct training for large-scale tasks. This research explores whether the hardware simplicity of BNNs can be combined with the temporal encoding of SNNs to bridge the accuracy gap without resorting to complex, power-hungry mixed-precision hardware.

Methods

The proposed approach involves training a B-SNN via an ANN-to-SNN conversion process. The process begins with training a full-precision ANN under specific constraints—omitting biases and batch normalization while using analog ReLU activations—to ensure compatibility with SNN dynamics. The weights are then binarized to create a Binary-Weight Network (BWN). This two-step process ensures that the resulting network maintains the structural simplicity required for binary hardware while benefiting from the robust training techniques available in the ANN domain.

Comparison of Artificial Neuron (AN) and Spiking Neuron (SN) dynamics during the conversion process, highlighting the relationship between weights, thresholds, and output slopes.

In the conversion step, ReLU activations are replaced with Integrate-and-Fire (IF) spiking neurons. The authors identify that standard architectural choices in ANNs, such as Max-Pooling, can degrade SNN accuracy because information is spread over time; consequently, they utilize Average-Pooling placed before the neuron layer. Additionally, they employ Subtractive-IF (SIF) neurons instead of standard Reset-IF neurons to retain residual membrane potential after a spike, preventing information loss. Furthermore, "Threshold Balancing" is applied by setting the firing threshold to the 99.7th percentile of activations, effectively reducing latency caused by long-tail outlier values.

Key Insights

A fundamental shift in this work is the use of "Time over Space." Instead of increasing spatial bit-precision to improve BNN accuracy, the B-SNN uses temporal integration across timesteps. This allows the underlying hardware to remain strictly binary, avoiding the power-hungry circuits required for mixed-precision arithmetic.

Temporal dynamics of membrane potential accumulation and spike generation in an SNN, illustrating how information is encoded over time.

This approach reveals an unexpected hardware synergy: while standard BNNs require two rows per bit-cell in RRAM crossbars to represent +1 and -1 states, the 0/1 nature of SNN spikes allows for a 50% reduction in crossbar array area. Additionally, the temporal nature of SNNs enables "Early Inference." Not all images require the same amount of processing time; by dynamically stopping inference once a final-layer neuron's membrane potential crosses a confidence threshold, the network can exit early on "easy" inputs, drastically reducing average operation counts.

Key Results

Empirical evaluations on CIFAR-100 and ImageNet highlight the effectiveness of B-SNNs. On CIFAR-100, the B-SNN achieved 62.07% accuracy, significantly outperforming the 47.16% of a standard XNOR-Net and nearing the 64.9% of a full-precision ANN. On the ImageNet dataset, the B-SNN reached 62.71% accuracy within 148 timesteps, compared to XNOR-Net's 49.77%.

The "Early Inference" optimization further enhanced efficiency. On CIFAR-100, it reduced average timesteps from 105 to 62.4 and lowered the normalized operation count from 4.30 to 3.55 without sacrificing any accuracy.

Conclusion

B-SNNs provide a promising path for high-performance, low-power edge AI by bridging the gap between binary precision and temporal encoding. While architectural constraints currently favor VGG-style models, future work will focus on extending these techniques to residual architectures like ResNets and conducting physical hardware benchmarking to quantify energy and area benefits against mixed-precision alternatives.

Summary updated

BibTeX
@misc{lu2020exploring,
  author = {Sen Lu and Abhronil Sengupta},
  title = {{Exploring the Connection Between Binary and Spiking Neural Networks}},
  year = {2020},
  eprint = {2002.10064},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.10064},
}
Figure