1
|
Wang Y, Liu H, Zhang M, Luo X, Qu H. A universal ANN-to-SNN framework for achieving high accuracy and low latency deep Spiking Neural Networks. Neural Netw 2024; 174:106244. [PMID: 38508047 DOI: 10.1016/j.neunet.2024.106244] [Citation(s) in RCA: 0] [Impact Index Per Article: 0] [Reference Citation Analysis] [What about the content of this article? (0)] [Affiliation(s)] [Abstract] [Key Words] [MESH Headings] [Track Full Text] [Journal Information] [Subscribe] [Scholar Register] [Received: 09/15/2023] [Revised: 02/02/2024] [Accepted: 03/13/2024] [Indexed: 03/22/2024]
Abstract
Spiking Neural Networks (SNNs) have become one of the most prominent next-generation computational models owing to their biological plausibility, low power consumption, and the potential for neuromorphic hardware implementation. Among the various methods for obtaining available SNNs, converting Artificial Neural Networks (ANNs) into SNNs is the most cost-effective approach. The early challenges in ANN-to-SNN conversion work revolved around the susceptibility of converted SNNs to conversion errors. Some recent endeavors have attempted to mitigate these conversion errors by altering the original ANNs. Despite their ability to enhance the accuracy of SNNs, these methods lack generality and cannot be directly applied to convert the majority of existing ANNs. In this paper, we present a framework named DNISNM for converting ANN to SNN, with the aim of addressing conversion errors arising from differences in the discreteness and asynchrony of network transmission between ANN and SNN. The DNISNM consists of two mechanisms, Data-based Neuronal Initialization (DNI) and Signed Neuron with Memory (SNM), designed to respectively address errors stemming from discreteness and asynchrony disparities. This framework requires no additional modifications to the original ANN and can result in SNNs with improved accuracy performance, simultaneously ensuring universality, high precision, and low inference latency. We verify it experimentally on challenging object recognition datasets, including CIFAR10, CIFAR100, and ImageNet-1k. Experimental results show that the SNN converted by our framework has very high accuracy even at extremely low latency.
Collapse
Affiliation(s)
- Yuchen Wang
- School of Computer Science and Engineering, University of Electronic Science and Technology of China, Chengdu 610054, PR China.
| | - Hanwen Liu
- School of Computer Science and Engineering, University of Electronic Science and Technology of China, Chengdu 610054, PR China.
| | - Malu Zhang
- School of Computer Science and Engineering, University of Electronic Science and Technology of China, Chengdu 610054, PR China.
| | - Xiaoling Luo
- School of Computer Science and Engineering, Sichuan University of Science and Engineering, Yibin 643000, PR China.
| | - Hong Qu
- School of Computer Science and Engineering, University of Electronic Science and Technology of China, Chengdu 610054, PR China.
| |
Collapse
|
2
|
Islam R, Majurski P, Kwon J, Sharma A, Tummala SRSK. Benchmarking Artificial Neural Network Architectures for High-Performance Spiking Neural Networks. Sensors (Basel) 2024; 24:1329. [PMID: 38400487 PMCID: PMC10892219 DOI: 10.3390/s24041329] [Citation(s) in RCA: 0] [Impact Index Per Article: 0] [Reference Citation Analysis] [What about the content of this article? (0)] [Affiliation(s)] [Abstract] [Key Words] [Grants] [Track Full Text] [Subscribe] [Scholar Register] [Received: 01/22/2024] [Revised: 02/13/2024] [Accepted: 02/17/2024] [Indexed: 02/25/2024]
Abstract
Organizations managing high-performance computing systems face a multitude of challenges, including overarching concerns such as overall energy consumption, microprocessor clock frequency limitations, and the escalating costs associated with chip production. Evidently, processor speeds have plateaued over the last decade, persisting within the range of 2 GHz to 5 GHz. Scholars assert that brain-inspired computing holds substantial promise for mitigating these challenges. The spiking neural network (SNN) particularly stands out for its commendable power efficiency when juxtaposed with conventional design paradigms. Nevertheless, our scrutiny has brought to light several pivotal challenges impeding the seamless implementation of large-scale neural networks (NNs) on silicon. These challenges encompass the absence of automated tools, the need for multifaceted domain expertise, and the inadequacy of existing algorithms to efficiently partition and place extensive SNN computations onto hardware infrastructure. In this paper, we posit the development of an automated tool flow capable of transmuting any NN into an SNN. This undertaking involves the creation of a novel graph-partitioning algorithm designed to strategically place SNNs on a network-on-chip (NoC), thereby paving the way for future energy-efficient and high-performance computing paradigms. The presented methodology showcases its effectiveness by successfully transforming ANN architectures into SNNs with a marginal average error penalty of merely 2.65%. The proposed graph-partitioning algorithm enables a 14.22% decrease in inter-synaptic communication and an 87.58% reduction in intra-synaptic communication, on average, underscoring the effectiveness of the proposed algorithm in optimizing NN communication pathways. Compared to a baseline graph-partitioning algorithm, the proposed approach exhibits an average decrease of 79.74% in latency and a 14.67% reduction in energy consumption. Using existing NoC tools, the energy-latency product of SNN architectures is, on average, 82.71% lower than that of the baseline architectures.
Collapse
Affiliation(s)
- Riadul Islam
- Department of Computer Science and Electrical Engineering, University of Maryland, Baltimore County, Baltimore, MD 21250, USA
| | - Patrick Majurski
- Department of Computer Science and Electrical Engineering, University of Maryland, Baltimore County, Baltimore, MD 21250, USA
| | - Jun Kwon
- Department of Computer Science and Electrical Engineering, University of Maryland, Baltimore County, Baltimore, MD 21250, USA
| | - Anurag Sharma
- Department of Computer Science and Electrical Engineering, University of Maryland, Baltimore County, Baltimore, MD 21250, USA
| | - Sri Ranga Sai Krishna Tummala
- Department of Computer Science and Electrical Engineering, University of Maryland, Baltimore County, Baltimore, MD 21250, USA
| |
Collapse
|
3
|
Zhang H, Cheng J, Zhang J, Liu H, Wei Z. A regularization perspective based theoretical analysis for adversarial robustness of deep spiking neural networks. Neural Netw 2023; 165:164-174. [PMID: 37295205 DOI: 10.1016/j.neunet.2023.05.038] [Citation(s) in RCA: 0] [Impact Index Per Article: 0] [Reference Citation Analysis] [What about the content of this article? (0)] [Affiliation(s)] [Abstract] [Key Words] [MESH Headings] [Track Full Text] [Journal Information] [Subscribe] [Scholar Register] [Received: 05/27/2022] [Revised: 04/27/2023] [Accepted: 05/19/2023] [Indexed: 06/12/2023]
Abstract
Spiking Neural Network (SNN) has been recognized as the third generation of neural networks. Conventionally, a SNN can be converted from a pre-trained Artificial Neural Network (ANN) with less computation and memory than training from scratch. But, these converted SNNs are vulnerable to adversarial attacks. Numerical experiments demonstrate that the SNN trained by optimizing the loss function will be more adversarial robust, but the theoretical analysis for the mechanism of robustness is lacking. In this paper, we provide a theoretical explanation by analyzing the expected risk function. Starting by modeling the stochastic process introduced by the Poisson encoder, we prove that there is a positive semidefinite regularizer. Perhaps surprisingly, this regularizer can make the gradients of the output with respect to input closer to zero, thus resulting in inherent robustness against adversarial attacks. Extensive experiments on the CIFAR10 and CIFAR100 datasets support our point of view. For example, we find that the sum of squares of the gradients of the converted SNNs is 13∼160 times that of the trained SNNs. And, the smaller the sum of the squares of the gradients, the smaller the degradation of accuracy under adversarial attack.
Collapse
Affiliation(s)
- Hui Zhang
- Nanjing University of Science and Technology, Nanjing, 210094, China
| | | | - Jun Zhang
- Nanjing University of Science and Technology, Nanjing, 210094, China
| | - Hongyi Liu
- Nanjing University of Science and Technology, Nanjing, 210094, China
| | - Zhihui Wei
- Nanjing University of Science and Technology, Nanjing, 210094, China.
| |
Collapse
|
4
|
Gao H, He J, Wang H, Wang T, Zhong Z, Yu J, Wang Y, Tian M, Shi C. High-accuracy deep ANN-to-SNN conversion using quantization-aware training framework and calcium-gated bipolar leaky integrate and fire neuron. Front Neurosci 2023; 17:1141701. [PMID: 36968504 PMCID: PMC10030499 DOI: 10.3389/fnins.2023.1141701] [Citation(s) in RCA: 2] [Impact Index Per Article: 2.0] [Reference Citation Analysis] [What about the content of this article? (0)] [Affiliation(s)] [Abstract] [Key Words] [Grants] [Track Full Text] [Figures] [Journal Information] [Subscribe] [Scholar Register] [Received: 01/10/2023] [Accepted: 02/07/2023] [Indexed: 03/29/2023] Open
Abstract
Spiking neural networks (SNNs) have attracted intensive attention due to the efficient event-driven computing paradigm. Among SNN training methods, the ANN-to-SNN conversion is usually regarded to achieve state-of-the-art recognition accuracies. However, many existing ANN-to-SNN techniques impose lengthy post-conversion steps like threshold balancing and weight renormalization, to compensate for the inherent behavioral discrepancy between artificial and spiking neurons. In addition, they require a long temporal window to encode and process as many spikes as possible to better approximate the real-valued ANN neurons, leading to a high inference latency. To overcome these challenges, we propose a calcium-gated bipolar leaky integrate and fire (Ca-LIF) spiking neuron model to better approximate the functions of the ReLU neurons widely adopted in ANNs. We also propose a quantization-aware training (QAT)-based framework leveraging an off-the-shelf QAT toolkit for easy ANN-to-SNN conversion, which directly exports the learned ANN weights to SNNs requiring no post-conversion processing. We benchmarked our method on typical deep network structures with varying time-step lengths from 8 to 128. Compared to other research, our converted SNNs reported competitively high-accuracy performance, while enjoying relatively short inference time steps.
Collapse
Affiliation(s)
- Haoran Gao
- The School of Microelectronics and Communication Engineering, Chongqing University, Chongqing, China
| | - Junxian He
- The School of Microelectronics and Communication Engineering, Chongqing University, Chongqing, China
| | - Haibing Wang
- The School of Microelectronics and Communication Engineering, Chongqing University, Chongqing, China
| | - Tengxiao Wang
- The School of Microelectronics and Communication Engineering, Chongqing University, Chongqing, China
| | - Zhengqing Zhong
- The School of Microelectronics and Communication Engineering, Chongqing University, Chongqing, China
| | - Jianyi Yu
- The School of Microelectronics and Communication Engineering, Chongqing University, Chongqing, China
| | - Ying Wang
- State Key Laboratory of Computer Architecture, Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China
| | - Min Tian
- The School of Microelectronics and Communication Engineering, Chongqing University, Chongqing, China
| | - Cong Shi
- The School of Microelectronics and Communication Engineering, Chongqing University, Chongqing, China
- *Correspondence: Cong Shi
| |
Collapse
|
5
|
Li C, Ma L, Furber S. Quantization Framework for Fast Spiking Neural Networks. Front Neurosci 2022; 16:918793. [PMID: 35928011 PMCID: PMC9344889 DOI: 10.3389/fnins.2022.918793] [Citation(s) in RCA: 0] [Impact Index Per Article: 0] [Reference Citation Analysis] [What about the content of this article? (0)] [Affiliation(s)] [Abstract] [Key Words] [Track Full Text] [Download PDF] [Figures] [Journal Information] [Subscribe] [Scholar Register] [Received: 04/12/2022] [Accepted: 06/14/2022] [Indexed: 11/28/2022] Open
Abstract
Compared with artificial neural networks (ANNs), spiking neural networks (SNNs) offer additional temporal dynamics with the compromise of lower information transmission rates through the use of spikes. When using an ANN-to-SNN conversion technique there is a direct link between the activation bit precision of the artificial neurons and the time required by the spiking neurons to represent the same bit precision. This implicit link suggests that techniques used to reduce the activation bit precision of ANNs, such as quantization, can help shorten the inference latency of SNNs. However, carrying ANN quantization knowledge over to SNNs is not straightforward, as there are many fundamental differences between them. Here we propose a quantization framework for fast SNNs (QFFS) to overcome these difficulties, providing a method to build SNNs with enhanced latency and reduced loss of accuracy relative to the baseline ANN model. In this framework, we promote the compatibility of ANN information quantization techniques with SNNs, and suppress "occasional noise" to minimize accuracy loss. The resulting SNNs overcome the accuracy degeneration observed previously in SNNs with a limited number of time steps and achieve an accuracy of 70.18% on ImageNet within 8 time steps. This is the first demonstration that SNNs built by ANN-to-SNN conversion can achieve a similar latency to SNNs built by direct training.
Collapse
Affiliation(s)
- Chen Li
- Advanced Processor Technologies (APT) Group, Department of Computer Science, The University of Manchester, Manchester, United Kingdom
| | - Lei Ma
- Beijing Academy of Artificial Intelligence, Beijing, China
- National Biomedical Imaging Center, Peking University, Beijing, China
| | - Steve Furber
- Advanced Processor Technologies (APT) Group, Department of Computer Science, The University of Manchester, Manchester, United Kingdom
| |
Collapse
|
6
|
Meng Q, Yan S, Xiao M, Wang Y, Lin Z, Luo ZQ. Training much deeper spiking neural networks with a small number of time-steps. Neural Netw 2022; 153:254-268. [PMID: 35759953 DOI: 10.1016/j.neunet.2022.06.001] [Citation(s) in RCA: 0] [Impact Index Per Article: 0] [Reference Citation Analysis] [What about the content of this article? (0)] [Affiliation(s)] [Abstract] [Key Words] [Track Full Text] [Journal Information] [Subscribe] [Scholar Register] [Received: 01/13/2022] [Revised: 05/05/2022] [Accepted: 06/01/2022] [Indexed: 11/26/2022]
Abstract
Spiking Neural Network (SNN) is a promising energy-efficient neural architecture when implemented on neuromorphic hardware. The Artificial Neural Network (ANN) to SNN conversion method, which is the most effective SNN training method, has successfully converted moderately deep ANNs to SNNs with satisfactory performance. However, this method requires a large number of time-steps, which hurts the energy efficiency of SNNs. How to effectively covert a very deep ANN (e.g., more than 100 layers) to an SNN with a small number of time-steps remains a difficult task. To tackle this challenge, this paper makes the first attempt to propose a novel error analysis framework that takes both the "quantization error" and the "deviation error" into account, which comes from the discretization of SNN dynamicsthe neuron's coding scheme and the inconstant input currents at intermediate layers, respectively. Particularly, our theories reveal that the "deviation error" depends on both the spike threshold and the input variance. Based on our theoretical analysis, we further propose the Threshold Tuning and Residual Block Restructuring (TTRBR) method that can convert very deep ANNs (>100 layers) to SNNs with negligible accuracy degradation while requiring only a small number of time-steps. With very deep networks, our TTRBR method achieves state-of-the-art (SOTA) performance on the CIFAR-10, CIFAR-100, and ImageNet classification tasks.
Collapse
Affiliation(s)
- Qingyan Meng
- The Chinese University of Hong Kong, Shenzhen, China; Shenzhen Research Institute of Big Data, Shenzhen 518115, China.
| | - Shen Yan
- Center for Data Science, Peking University, China.
| | - Mingqing Xiao
- Key Laboratory of Machine Perception (MOE), School of Artificial Intelligence, Peking University, China.
| | - Yisen Wang
- Key Laboratory of Machine Perception (MOE), School of Artificial Intelligence, Peking University, China; Institute for Artificial Intelligence, Peking University, China.
| | - Zhouchen Lin
- Key Laboratory of Machine Perception (MOE), School of Artificial Intelligence, Peking University, China; Institute for Artificial Intelligence, Peking University, China; Peng Cheng Laboratory, China.
| | - Zhi-Quan Luo
- The Chinese University of Hong Kong, Shenzhen, China; Shenzhen Research Institute of Big Data, Shenzhen 518115, China.
| |
Collapse
|