Spiking Neural Networks (SNNs) have recently become more popular as a biologically plausible substitute for traditional Artificial Neural Networks (ANNs). SNNs are cost-efficient and deployment-friendly because they process input in both spatial and temporal manners using binary spikes. However, we observe that the information capacity in SNNs is affected by the number of timesteps, leading to an accuracy-efficiency tradeoff. In this work, we study a fine-grained adjustment of the number of timesteps in SNNs. Specifically, we treat the number of timesteps as a variable conditioned on different input samples to reduce redundant timesteps for certain data. We call our method Spiking Early-Exit Neural Networks (SEENNs). To determine the appropriate number of timesteps, we propose SEENN-I which uses a confidence score thresholding to filter out the uncertain predictions, and SEENN-II which determines the number of timesteps by reinforcement learning. Moreover, we demonstrate that SEENN is compatible with both the directly trained SNN and the ANN-SNN conversion. By dynamically adjusting the number of timesteps, our SEENN achieves a remarkable reduction in the average number of timesteps during inference. For example, our SEENN-II ResNet-19 can achieve 96.1% accuracy with an average of 1.08 timesteps on the CIFAR-10 test dataset.
翻译:脉冲神经网络(SNN)近年来因其作为传统人工神经网络(ANN)的生物可解释替代方案而日益受到关注。SNN 通过利用二元脉冲在空间和时间两种维度上处理输入,具有成本效益高和部署友好的特点。然而,我们观察到 SNN 中的信息容量受时间步长数量影响,导致准确率与效率之间存在权衡。本文研究了 SNN 中时间步长数量的细粒度调整问题。具体而言,我们将时间步长数量视为随不同输入样本变化的条件变量,以减少特定数据的冗余时间步长。我们将该方法称为尖峰早退神经网络(SEENN)。为确定合适的时间步长数量,我们提出 SEENN-I,通过置信度分数阈值过滤不确定预测;以及 SEENN-II,通过强化学习确定时间步长数量。此外,我们证明 SEENN 兼容直接训练的 SNN 和 ANN-SNN 转换。通过动态调整时间步长数量,我们的 SEENN 在推理过程中显著降低了平均时间步长数量。例如,我们的 SEENN-II ResNet-19 在 CIFAR-10 测试数据集上能以平均 1.08 个时间步长达到 96.1% 的准确率。