Efficient ANN-SNN Conversion with Error Compensation Learning

Chang Liu, Jiangrong Shen, Xuming Ran, Mingkun Xu, Qi Xu, Yi Xu, Gang Pan

Introduction

Artificial Neural Networks (ANNs) have become the standard for modern artificial intelligence, yet their deployment on edge devices is often limited by high computational costs and significant power consumption. Spiking Neural Networks (SNNs) offer a bio-inspired, energy-efficient alternative by processing information through discrete, asynchronous spikes. However, training SNNs from scratch remains a significant challenge due to the non-differentiable nature of spike functions.

A common solution is ANN-to-SNN conversion, where a pre-trained ANN is mapped onto an SNN architecture. While promising, this approach traditionally requires hundreds or even thousands of time steps to reach the accuracy of the source ANN, which negates the latency and energy benefits of the SNN. This paper introduces a novel Error Compensation Learning framework designed to achieve state-of-the-art accuracy with ultra-low latency—as low as two time steps.

The Challenges of ANN-to-SNN Conversion

The authors identify three primary sources of error that degrade performance during the conversion process:

  1. Clipping Error: This occurs when ANN activations exceed the maximum firing capacity of the SNN neurons, leading to a loss of information at the upper bound.
  2. Quantization Error: This arises from mapping continuous ANN activation values to discrete spike counts over a finite number of time steps.
  3. Uneven Error: This is caused by the temporal distribution of spikes. If spikes arrive at irregular intervals, they create "bursts" or "lags" that do not accurately reflect the intended ANN activation level within a short window.

Proposed Methodology: Error Compensation Learning

To address these challenges, the framework introduces three integrated components that optimize the network for conversion during the ANN training phase and the SNN inference phase.

Learnable Threshold Clipping

Rather than using standard ReLU activations in the source ANN, the authors implement a clipping function with a learnable parameter ($\lambda$). During training, the ANN learns the optimal maximum activation for each layer. This $\lambda$ is then directly mapped to the SNN’s firing threshold ($\theta$). By learning the threshold dynamically, the network virtually eliminates clipping errors by ensuring the SNN's dynamic range matches the ANN's learned activations.

Dual-Threshold Neurons (DTN)

The most significant architectural innovation is the Dual-Threshold Neuron. Standard SNN neurons are unipolar, meaning they only fire positive spikes. In low-latency scenarios, a single misplaced spike can cause a massive deviation from the target value. The DTN introduces the ability to fire negative spikes. If a neuron over-fires due to temporal noise or uneven input, it can emit a negative spike to "cancel out" the error and restore the membrane potential to a more accurate state. This acts as a real-time, temporal error correction mechanism.

Optimal Membrane Potential Initialization

Through mathematical derivation, the authors determined that starting a neuron's membrane potential at zero is sub-optimal for quantization. By initializing the potential at half the threshold ($\theta/2$), the expected quantization error is minimized. This simple shift allows the SNN to converge to high accuracy much faster than traditional zero-initialization methods, requiring no additional computational overhead during inference.

Experimental Results

The framework was evaluated across several standard benchmarks, including CIFAR-10, CIFAR-100, and ImageNet, using architectures such as VGG-16 and various ResNet variants.

  • Ultra-Low Latency: On CIFAR-10, a ResNet-18 model achieved 94.75% accuracy in just 2 time steps. This is a significant improvement over previous methods that typically require 16 to 32 steps to reach comparable performance.
  • Large-Scale Performance: On the ImageNet dataset, the proposed VGG-16 model reached 74.15% accuracy at $T=16$, outperforming the previous state-of-the-art (QCFS) by a margin of over 23%.
  • Energy Efficiency: The energy savings are substantial. For a VGG-16 model on CIFAR-100, the converted SNN consumed only 0.008 mJ of energy at $T=4$, compared to 4.170 mJ for the original ANN—representing a massive reduction in power consumption with negligible loss in accuracy.

Discussion and Limitations

While the Error Compensation Learning framework provides a breakthrough in low-latency SNNs, it does have specific requirements. The method is not a "plug-and-play" solution for existing models; it requires training the source ANN with the specific learnable clipping function to ensure compatibility. Furthermore, the introduction of negative spikes in the DTN may require modifications to current neuromorphic hardware, such as Intel's Loihi, which are often optimized for unipolar spike trains.

Conclusion

By addressing clipping, quantization, and temporal errors through learnable thresholds, dual-threshold neurons, and optimized initialization, this research successfully bridges the gap between ANNs and SNNs. The ability to achieve high-accuracy inference in as few as two time steps makes SNNs a much more viable candidate for real-time, energy-constrained applications on edge devices.

Summary updated

BibTeX
@inproceedings{liu2025efficient,
  author = {Chang Liu and Jiangrong Shen and Xuming Ran and Mingkun Xu and Qi Xu and Yi Xu and Gang Pan},
  title = {{Efficient ANN-SNN Conversion with Error Compensation Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=9lw5HYPT4Y},
}
Figure