Table of Contents
Fetching ...

Optimal Conversion of Conventional Artificial Neural Networks to Spiking Neural Networks

Shikuang Deng, Shi Gu

TL;DR

The paper tackles efficient ANN-to-SNN conversion by deriving a layer-wise conversion error and proposing a weight-transfer pipeline that combines threshold balancing and soft-reset. By introducing a threshold ReLU in the source ANN and an optimal per-layer shift $\delta \approx \frac{V_{th}}{2T}$, it aligns the continuous ANN activations with discrete spiking outputs, enabling near-lossless accuracy at ~1/10 the usual SNN simulation time. The approach is validated on CIFAR-10/100 and ImageNet across CIFAR-Net, VGG-16, and ResNet-20, showing improved activation distributions, shorter simulation lengths, and competitive or superior conversion performance compared with existing methods. This work promises practical, energy-efficient SNN deployment on embedded hardware and provides a framework extendable to RNNs and BN-aware models.

Abstract

Spiking neural networks (SNNs) are biology-inspired artificial neural networks (ANNs) that comprise of spiking neurons to process asynchronous discrete signals. While more efficient in power consumption and inference speed on the neuromorphic hardware, SNNs are usually difficult to train directly from scratch with spikes due to the discreteness. As an alternative, many efforts have been devoted to converting conventional ANNs into SNNs by copying the weights from ANNs and adjusting the spiking threshold potential of neurons in SNNs. Researchers have designed new SNN architectures and conversion algorithms to diminish the conversion error. However, an effective conversion should address the difference between the SNN and ANN architectures with an efficient approximation \DSK{of} the loss function, which is missing in the field. In this work, we analyze the conversion error by recursive reduction to layer-wise summation and propose a novel strategic pipeline that transfers the weights to the target SNN by combining threshold balance and soft-reset mechanisms. This pipeline enables almost no accuracy loss between the converted SNNs and conventional ANNs with only $\sim1/10$ of the typical SNN simulation time. Our method is promising to get implanted onto embedded platforms with better support of SNNs with limited energy and memory.

Optimal Conversion of Conventional Artificial Neural Networks to Spiking Neural Networks

TL;DR

The paper tackles efficient ANN-to-SNN conversion by deriving a layer-wise conversion error and proposing a weight-transfer pipeline that combines threshold balancing and soft-reset. By introducing a threshold ReLU in the source ANN and an optimal per-layer shift , it aligns the continuous ANN activations with discrete spiking outputs, enabling near-lossless accuracy at ~1/10 the usual SNN simulation time. The approach is validated on CIFAR-10/100 and ImageNet across CIFAR-Net, VGG-16, and ResNet-20, showing improved activation distributions, shorter simulation lengths, and competitive or superior conversion performance compared with existing methods. This work promises practical, energy-efficient SNN deployment on embedded hardware and provides a framework extendable to RNNs and BN-aware models.

Abstract

Spiking neural networks (SNNs) are biology-inspired artificial neural networks (ANNs) that comprise of spiking neurons to process asynchronous discrete signals. While more efficient in power consumption and inference speed on the neuromorphic hardware, SNNs are usually difficult to train directly from scratch with spikes due to the discreteness. As an alternative, many efforts have been devoted to converting conventional ANNs into SNNs by copying the weights from ANNs and adjusting the spiking threshold potential of neurons in SNNs. Researchers have designed new SNN architectures and conversion algorithms to diminish the conversion error. However, an effective conversion should address the difference between the SNN and ANN architectures with an efficient approximation \DSK{of} the loss function, which is missing in the field. In this work, we analyze the conversion error by recursive reduction to layer-wise summation and propose a novel strategic pipeline that transfers the weights to the target SNN by combining threshold balance and soft-reset mechanisms. This pipeline enables almost no accuracy loss between the converted SNNs and conventional ANNs with only of the typical SNN simulation time. Our method is promising to get implanted onto embedded platforms with better support of SNNs with limited energy and memory.

Paper Structure

This paper contains 18 sections, 16 equations, 4 figures, 6 tables, 1 algorithm.

Figures (4)

  • Figure 1: Schematics on the conversion pipeline. (A) The SNN propagates spiking frequencies with the activation sequence $\bm{x'}_l=\{\bm{x'}_l(1),...,\bm{x'}_l(T)\}$ and averaged output $\bm{a'}_l$ for $l = 1,...,L$ through $L$ layers. (B) Activation functions of regular and threshold ReLUs for ANNs, and the step function for SNNs. (C) The error between ReLU and step function with $V_{th}/2T$ shift. See Section \ref{['sec:laywise_total_conversion_error']} for the detailed discussion.
  • Figure 2: Impact of threshold on ANN. (A)Maximum activations of VGG-16's layers on CIFAR-10. (B) The accuracy of ANN with regular or threshold ReLU on different networks. Average over 5 repeats on CIFAR-10 and 3 repeats on CIFAR-100.
  • Figure 3: Impact of threshold and shift on convergence for converting ResNet-20 on CIFAR-100. (A) SNN's accuracy losses w.r.t different simulation lengths. (B-D) Optimal shifts w.r.t different activation functions and simulation lengths.
  • Figure 4: The accuracy gap between the source ANN and target SNN along an extended simulation length.