Abstract
Deep spiking neural networks (SNNs) offer the promise of low-power artificial intelligence. However, training deep SNNs from scratch or converting deep artificial neural networks to SNNs without loss of performance has been a challenge. Here we propose an exact mapping from a network with Rectified Linear Units (ReLUs) to an SNN that fires exactly one spike per neuron. For our constructive proof, we assume that an arbitrary multi-layer ReLU network with or without convolutional layers, batch normalization and max pooling layers was trained to high performance on some training set. Furthermore, we assume that we have access to a representative example of input data used during training and to the exact parameters (weights and biases) of the trained ReLU network. The mapping from deep ReLU networks to SNNs causes zero percent drop in accuracy on CIFAR10, CIFAR100 and the ImageNet-like data sets Places365 and PASS. More generally our work shows that an arbitrary deep ReLU network can be replaced by an energy-efficient single-spike neural network without any loss of performance.
Introduction
Deep Neural Networks (DNNs) have achieved state-of-the-art performance across numerous tasks but are computationally expensive and energy-intensive. Spiking Neural Networks (SNNs) represent a bio-inspired alternative that leverages sparse, asynchronous communication via discrete spikes, potentially offering significant energy savings on neuromorphic hardware. Despite their promise, SNNs face two primary hurdles: the difficulty of training due to non-differentiable activation functions and "conversion loss" when mapping pre-trained ANNs to SNNs. The latter often arises from the "call back" problem, where early spikes in an asynchronous system cannot be retracted even if subsequent inhibitory inputs would have cancelled the activation in a continuous-valued model.
Methodology: A Two-Phase Constructive Mapping
To address these challenges, we propose a mathematically exact mapping from ReLU-based ANNs to SNNs using a Time-To-First-Spike (TTFS) coding scheme. The conversion process is divided into two distinct phases.
Phase 1: Preprocessing
The initial phase involves lossless transformations of the original ReLU network. Batch Normalization (BN) layers are fused into the weights and biases. A critical step is parameter rescaling: weights are adjusted such that the sum of incoming weights to any neuron is bounded (typically < 1). This ensures that once all input spikes have arrived, the membrane potential trajectory of a spiking neuron maintains a positive slope, preventing premature threshold crossings that would lead to errors.
Phase 2: Conversion
In the second phase, the continuous ReLU activations ($x$) are mapped to discrete spike times ($t$). In our TTFS scheme, each neuron fires at most once; higher activation values in the ANN correspond to earlier spike times in the SNN. We derive specific thresholds ($\vartheta$) and integration biases ($\alpha$) that ensure the SNN's temporal dynamics perfectly mirror the ANN's spatial activations.
Neuron Dynamics and Temporal Coding
The core of our approach lies in ensuring that the SNN correctly integrates inputs despite the asynchronous arrival of spikes. By defining a specific temporal window $[t_{min}, t_{max}]$ for each layer, we can guarantee that the "call back" problem is eliminated.
As shown in the figure above, the membrane potential $V_i^{(n)}$ integrates spikes from the previous layer. The mapping ensures that the time of the first spike $t_i^{(n)}$ is a linear function of the scaled ANN activation $\bar{x}_i^{(n)}$. This linearity is maintained by the integration bias $\alpha^{(n)}$, which governs the slope of the potential rise between $t_{min}$ and $t_{max}$.
Experimental Validation
We validated this mapping across several benchmarks, ranging from MNIST to large-scale datasets like Places365 and PASS (a privacy-preserving ImageNet substitute). The results demonstrate 100% agreement between the ANN and SNN models on an image-by-image basis. For instance, on CIFAR-100, the converted SNN achieved the exact same 70.48% accuracy as the original ANN. Furthermore, the SNNs exhibited high sparsity: only 38% to 53% of neurons fired a spike during inference on large-scale tasks, highlighting the potential for energy efficiency.
Conclusion
This work provides a theoretical bridge between high-performance ReLU networks and energy-efficient SNNs. By proving that an exact mapping exists, we show that the performance-efficiency trade-off typically associated with SNN conversion can be entirely eliminated. Future work will focus on extending this framework to non-feedforward architectures like ResNets and addressing hardware-induced noise in temporal slopes.
Summary updated