Skip to main content
QUICK REVIEW

[论文解读] Optimal ANN-SNN Conversion for Fast and Accurate Inference in Deep Spiking Neural Networks

Jianhao Ding, Zhaofei Yu|arXiv (Cornell University)|May 25, 2021
Advanced Memory and Neural Computing参考文献 25被引用 13
一句话总结

该论文提出了一种理论基础坚实的最优人工神经网络-脉冲神经网络(ANN-SNN)转换方法,采用速率归一化层(Rate Norm Layers)和最优拟合曲线,实现近乎无损的精度,同时推理速度提升至基线方法的8.6倍,能耗降低至0.265倍。该方法通过在训练过程中重新定义激活值的缩放方式,以最小化转换误差并优化推理速度。

ABSTRACT

Spiking Neural Networks (SNNs), as bio-inspired energy-efficient neural networks, have attracted great attentions from researchers and industry. The most efficient way to train deep SNNs is through ANN-SNN conversion. However, the conversion usually suffers from accuracy loss and long inference time, which impede the practical application of SNN. In this paper, we theoretically analyze ANN-SNN conversion and derive sufficient conditions of the optimal conversion. To better correlate ANN-SNN and get greater accuracy, we propose Rate Norm Layer to replace the ReLU activation function in source ANN training, enabling direct conversion from a trained ANN to an SNN. Moreover, we propose an optimal fit curve to quantify the fit between the activation value of source ANN and the actual firing rate of target SNN. We show that the inference time can be reduced by optimizing the upper bound of the fit curve in the revised ANN to achieve fast inference. Our theory can explain the existing work on fast reasoning and get better results. The experimental results show that the proposed method achieves near loss less conversion with VGG-16, PreActResNet-18, and deeper structures. Moreover, it can reach 8.6x faster reasoning performance under 0.265x energy consumption of the typical method. The code is available at https://github.com/DingJianhao/OptSNNConvertion-RNL-RIL.

研究动机与目标

  • 为解决ANN-SNN转换中的精度下降与长推理时间问题,这些问题是脉冲神经网络实际部署的主要障碍。
  • 推导最优ANN-SNN转换的充分理论条件,以实现从人工网络到脉冲网络的精确映射。
  • 通过用可训练的速率归一化层替代ReLU,动态基于运行最大值缩放激活值,从而提升转换保真度。
  • 通过最小化ANN激活值与SNN发放率之间拟合曲线的上界,优化推理速度。
  • 在VGG-16和PreActResNet-18等深度网络上实现最先进性能,仅带来极小的精度损失和能耗开销。

提出的方法

  • 引入速率归一化层,替代ReLU,利用可学习参数 $ p_k $ 和运行最大值 $ \text{r\_max}_k $ 对激活值进行缩放,从而改善ANN与SNN动态之间的对齐。
  • 提出最优拟合曲线 $ K_l < \frac{2\Omega_l}{t} $,其中 $ \Omega_l = \frac{\|\hat{\bm{r}}_l\|_1}{\|\hat{\bm{r}}_l\|_2^2} $,用于量化模拟与实际SNN发放率之间的误差。
  • 采用两阶段训练流程:第一阶段,使用速率归一化层训练源网络ANN以保持精度;第二阶段,微调缩放参数 $ p_k $,以最小化激活值与发放率之间的拟合误差。
  • 在第二阶段中,跨层共享 $ p_k $ 以提升训练稳定性,并对 $ p_k $ 应用 $ \text{sigmoid}(p'_k) $ 以约束其取值范围在 $[0,1]$。
  • 通过直接转移权重、偏置和阈值,将最终的ANN转换为SNN,其中 $ v_{\text{th},k} = \theta_k = p_k \cdot \text{r\_max}_k $。
  • 在第二阶段中引入一种新型损失函数 $ \mathscr{T}(\hat{\bm{r}}_L^*, \hat{\bm{r}}_L') $,以最小化原始激活轨迹与变换后轨迹之间的 $ L^2 $ 误差。

实验结果

研究问题

  • RQ1何种理论条件可确保从ANN到SNN的最优转换,实现最小精度损失?
  • RQ2如何定量建模ANN激活值与SNN发放率之间的关系,以提升转换保真度?
  • RQ3可训练的归一化层是否可替代ReLU,实现在不重新训练整个SNN的前提下实现更优转换?
  • RQ4通过优化ANN与SNN输出之间拟合曲线的上界,推理速度最多可提升多少?
  • RQ5所提出方法是否能在VGG-16和PreActResNet-18等深度架构上实现近乎无损转换?

主要发现

  • 所提方法在VGG-16和PreActResNet-18上实现了近乎无损转换,与原始ANN相比精度下降极小。
  • 与典型转换方法相比,该方法将推理时间最多减少8.6倍,同时能耗仅为0.265倍。
  • 理论分析表明,模拟与实际发放率之间的拟合误差被限制在 $ \frac{2\Omega_l}{t} $ 以内,为控制转换质量提供了理论依据。
  • 使用可学习缩放参数 $ p_k $ 的速率归一化层,相比固定归一化方法(如Max Norm或Robust Norm),显著提升了转换精度。
  • 两阶段训练流程——先聚焦精度,再优化速度的微调——使得单一框架内同时实现高精度与高速推理成为可能。
  • 该方法在精度与推理速度方面均优于现有方法,尤其在更深网络与复杂数据集上表现更优。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。