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 manner 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. Code is shared at https://github.com/Intelligent-Computing-Lab-Yale/SEENN.
翻译:脉冲神经网络(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%的准确率。代码已在https://github.com/Intelligent-Computing-Lab-Yale/SEENN共享。