Abstract
Spiking neural networks (SNNs) aim to realize brain-inspired intelligence on neuromorphic chips with high energy efficiency by introducing neural dynamics and spike properties. As the emerging spiking deep learning paradigm attracts increasing interest, traditional programming frameworks cannot meet the demands of the automatic differentiation, parallel computation acceleration, and high integration of processing neuromorphic datasets and deployment. In this work, we present the SpikingJelly framework to address the aforementioned dilemma. We contribute a full-stack toolkit for preprocessing neuromorphic datasets, building deep SNNs, optimizing their parameters, and deploying SNNs on neuromorphic chips. Compared to existing methods, the training of deep SNNs can be accelerated 11×, and the superior extensibility and flexibility of SpikingJelly enable users to accelerate custom models at low costs through multilevel inheritance and semiautomatic code generation. SpikingJelly paves the way for synthesizing truly energy-efficient SNN-based machine intelligence systems, which will enrich the ecology of neuromorphic computing.
Motivation and introduction of the software framework SpikingJelly for spiking deep learning.
INTRODUCTION
Recently, artificial neural networks (ANNs), such as convolutional neural networks (CNNs) (1), recurrent neural networks (RNNs) (2), and transformers (3), have defeated most other methods and even surpassed the average ability levels of humans in some areas, including image classification (1, 4, 5), object detection (6–8), machine translation (3, 9–11), speech recognition (12, 13), and gaming (14, 15). These achievements are computer science–oriented because ANNs are mainly driven by gradient-based numerical optimization methods (16, 17), big data (18, 19), and massively parallel computing with graphics processing units (GPUs) (20, 21). Although neuroscience plays a diminished role in ANNs (22), insights from neuroscience are critical for building general human-level artificial intelligence (AI) systems (23, 24). The human brain is one of the most intelligent systems, having overwhelming advantages over any other artificial system in cognition and learning tasks such as transfer learning and continual learning (24). The neuroscientific community has been exploring biologically plausible computational paradigms to understand, mimic, and exploit the impressive feats of the human brain. Correspondingly, neuroscience-oriented spiking neural networks (SNNs) have been derived and are sometimes regarded as the next generation of neural networks (25). SNNs process and transmit information using short electrical pulses or spikes, making them similar to biological neural systems.
The neurons in SNNs are lower-level abstractions of biological neurons that collect signals from dendrites and process stimuli with nonlinear neuronal dynamics, which enable SNNs to be competitive candidates for processing spatiotemporal data (26, 27). Spike-based biological neural systems are extremely energy efficient, e.g., the human brain only consumes a power budget of approximately 20 W (28). Benefiting from event-driven computing on spikes, SNNs are up to 1000× more power efficient than ANNs (29) when running on tailored neuromorphic chips, including True North (30), Loihi (31), and Tianjic (29). The biological plausibility, spatiotemporal information processing capabilities, and event-driven computational paradigm of SNNs have attracted increasing research interest in recent years.
Emerging spiking deep learning methods
Because of their nondifferentiable spike trigger mechanisms and the complex spatiotemporal propagation processes, designing high-performance learning algorithms for SNNs is challenging. Traditional learning algorithms mainly incorporate biologically plausible unsupervised learning rules and primitive gradient-based supervised learning methods. Unsupervised learning algorithms inspired by the biological nervous system are applied in SNNs, including Hebbian learning (32), spike timing–dependent plasticity (STDP) (33), and their variants (34–38). Primitive supervised learning methods including SpikeProp (39), Tempotron (40), ReSume (41), and SPAN (42) achieve higher performance than biologically plausible unsupervised methods. However, these approaches are limited. Most SpikeProp-based methods only allow spiking neurons to fire no more than one spike, while Tempotron, ReSume, and SPAN cannot train SNNs with more than one layer. Thus, these primitive supervised learning methods can only solve tasks that are no harder than classifying the Modified National Institute of Standards and Technology (MNIST) dataset (43).
One of the key technologies that have led to the rapid progress of ANNs is deep learning (44), which optimizes the parameters of multilayer ANNs via backpropagation and learns high-dimensional representations of data with multiple levels of abstraction. To overcome the challenge of training SNNs, researchers have explored the application of deep learning methods to SNNs and achieved substantial performance improvements. Two of the most commonly used deep learning methods for SNNs are the surrogate gradient method (45–47) and the ANN-to-SNN conversion (ANN2SNN) (48–53). SNNs trained by the surrogate gradient method achieve high performance on complex datasets such as the Canadian Institute for Advanced Research (CIFAR) dataset (54), the Dynamic Vision Sensor (DVS) Gesture dataset (55) and the challenging ImageNet dataset (19) using only a few simulation time steps (56–61), while SNNs converted from ANNs attain almost the same accuracy as that of the original ANNs on the ImageNet dataset with dozens of simulation time steps (51, 62, 63). Because of the rapid progress achieved by deep learning methods, the applications of SNNs have been expanded beyond classification to other tasks including object detection (64–66), object segmentation (67, 68), depth estimation (69), and optical flow estimation (70). The boom exhibited by the research community indicates that spiking deep learning has become a promising research hotspot.
Demands for frameworks
Experience derived from the development of ANNs shows that software frameworks play a vital role in deep learning. Modern frameworks, including TensorFlow (71), Keras (72), and PyTorch (73), provide user-friendly frontend application programming interfaces (APIs) implemented by Python and high-performance backend accelerated by C++ libraries, e.g., Intel MKL and NVIDIA CUDA. Statistics show that the numbers of both new adopters and projects increase exponentially after the release of modern frameworks (74), indicating that these frameworks substantially reduce the workload required to build and train ANNs, help users quickly realize ideas, and make great contributions to the growth of deep learning research. The rapid development of machine learning frameworks has additionally accelerated the progress of the research community, which also highlights the importance of frameworks for spiking deep learning.
However, there is no mature framework available for spiking deep learning. Most existing frameworks for SNNs, including NEURON (75), NEST (76), Brian1/2 (77, 78), and GENESIS (79), can build detailed spiking neurons with complex neuronal dynamics, use numerical methods to approximate ordinary differential equations (ODEs), and simulate the biological neural system with high precision but do not integrate automatic differentiation, which is the core component required for gradient-based deep learning. These frameworks construct SNNs that are highly biologically plausible and can be used to investigate the functionality of real neural systems but are not designed to solve machine learning tasks. Nengo (80), SpykeTorch (81), and BindsNET (82) use simplified neurons with smaller numbers of ODEs than detailed neurons. With their low computational complexity brought by simplified neurons, these frameworks can implement some primary machine learning and reinforcement learning algorithms but still lack the modern deep learning capabilities of SNNs.
Because of the lack of available frameworks, researchers who want to combine advanced deep learning methods with SNNs have to build basic spiking neurons and synapses from scratch, resulting in repetitive and uncoordinated efforts. Deep SNNs involve a large number of matrix operations in both spatial and temporal dimensions of the data, which requires researchers to refine their codes to create high-performance programs that are accelerated by GPUs. Such workloads increase the burden on researchers. In the neuromorphic community, SNNs are frequently used to process data from neuromorphic sensors and deployed on neuromorphic computing chips, but data processing and deployment also require considerable time and effort. After skillful researchers implement their projects, inconsistent programming languages, coding styles, and model definitions generated by different authors will be difficult to reuse and divide the community. The efficiency of scientific research can be greatly improved if there exists a modern spiking deep learning framework that has at least the following three characteristics: exploits and accelerates spike-based operations; supports both simulations on CPUs/GPUs and deployment on neuromorphic chips; and provides a full-stack toolkit for building, training, and analyzing deep SNNs.
SpikingJelly: A modern framework for spiking deep learning
To solve the above issues and promote research on spiking deep learning, we present SpikingJelly, an open-source deep learning framework, to bridge deep learning and SNNs. Figure 1A shows a hierarchical overview of the architecture of SpikingJelly. On the basis of one of the most commonly used machine learning frameworks, PyTorch, SpikingJelly supports the simulation of SNNs on both CPUs and GPUs with autograd-enabled computation. Additional CUDA kernels are used for GPU-level acceleration beyond that provided by PyTorch. To achieve a balance between ease of use, flexible extensibility, and high performance, the deep learning aspects in SpikingJelly are elaborated into four sections: Components, Functions, Acceleration, and Networks (see the “Subpackages of deep learning” section in the Supplementary Materials). Components provide essential modules such as spiking neurons and synapses to build deep SNNs. Functions contain practical functions for training, simulating, analyzing, converting, quantizing, and deploying SNNs. Some modules in Functions are the functional formulations of the corresponding modules in Components. In this way, both object-oriented programming and procedural programming are supported to satisfy the diverse demands of users. Acceleration accelerates the SNN simulation process with extra semiautomatically generated CUDA kernels, thus exploiting the efficiency of low-level programming languages and reducing the development cost via the code generation technique. On the basis of the above subpackages, Networks provide classic and large-scale network structures such as Spiking ResNet for fast model reuse and primary SNN applications for beginners, which is favorably received by the community. Considering that neuromorphic datasets obtained from neuromorphic sensors (83–85) such as ATIS, DAVIS, and DVS are widely used in SNNs, SpikingJelly integrates neuromorphic dataset processing methods, including downloading, unifying data layouts, and reading interfaces with the general NumPy (86) format. With the quantize and exchange packages provided in Functions, compatibility with neuromorphic chips is also effectively implemented by providing low-bit quantizers for network weights and exchange functions for deploying SNNs.
Fig. 1. Overview of SpikingJelly.
(A) Architecture of the whole framework. (B) A code example of building and running an SNN, whose architecture is shown in (C and D). The execution times required for a single training iteration with T = 2, 4, 8, 16, and 32 and inference with T = 128 using Spiking ResNet-18 built by SpikingJelly, Norse, and snnTorch. (E) Comparisons of the ecological niche of SpikingJelly with those of other frameworks. (F) Typical adoptions from research based on SpikingJelly.
As a full-stack framework, SpikingJelly enables researchers to build SNNs with flexible and convenient APIs, simulate SNNs with extremely high efficiency, and deploy SNNs to edge AI devices. With SpikingJelly, a method for synthesizing a truly spike-based energy-efficient machine intelligence paradigm enriches the ecology of the research in this field.
RESULTS
Convenient and flexible SNN construction
SpikingJelly provides convenient and flexible APIs for users to build SNNs with a few steps. These APIs are designed in the acclaimed PyTorch style. Thus, those who are proficient in deep learning can also quickly start working with SpikingJelly. Figure 1B is an example of building and running an SNN, whose structure is shown in Fig. 1C. Note that we input a three-dimensional (3D) tensor X with a shape of (T, N, C), where T is the number of time steps, N is the batch size, and C is the number of features. Then, we use the multi_step_forward function to input X into the SNN, which implements a for-loop over time steps to send the inputs X[t] to the network and concatenate the outputs Y[t] to Y. In SpikingJelly, all hidden states are stored inside modules, which makes it convenient to build a network with sequential layers and access attributes from a specific module. Note that the hidden states need to be reset before sending a new sample, and we call the reset_net function in this example to reset the SNN.
High-performance simulation
SpikingJelly leverages the massively parallel computing power of GPUs to achieve extremely high SNN simulation performance. For quantitative assessment purposes, we evaluated the training and inference performance of modern spiking deep learning frameworks on the Spiking ResNet, which is the spiking version of the classic ResNet ANN structure (87) and is used frequently by SNN researchers (58, 60, 62, 88, 89). The compared frameworks were Norse (90) and snnTorch (91), which were proposed at almost the same time as SpikingJelly or afterward. The versions of Norse and snnTorch are 1.0.0 and 0.6.0, respectively, which are the latest versions. We used leaky-integrate-and-fire (LIF) neurons (92) in the network, as they are among the most commonly used spiking neurons in deep SNNs. The experiments are performed on an Ubuntu 18.04 server with an Intel Xeon Silver 4210R CPU, an NVIDIA A100-SXM-80GB GPU, and 256 gigabytes of memory.
Researchers usually simulate SNNs in two ways. The first approach is to train SNNs directly via the surrogate gradient method with backpropagation through time (BPTT). Limited by the fact that the memory consumption is approximately proportional to the number of time steps T, direct training often uses few time steps; e.g., T ≤ 32 for high-resolution datasets and T ≤ 64 for small-sized datasets. The second approach is to run SNNs with weights obtained via ANN2SNN. The ANN2SNN evaluation is restricted to inference, since this procedure does not require training. Most of the ANN2SNN methods are based on rate encoding and need far more time steps, e.g., T ≥ 128, than the surrogate gradient method. Conversion methods based on latency encoding rather than rate coding are also reported (93). Note that recent research has achieved a substantial reduction of T, such as surrogate learning methods (94) with T = 5 and ANN2SNN methods (51, 95) with T ≤ 64. Our evaluation involved two steps for the most common usage: (i) training with small time steps for surrogate learning and (ii) performing inference with large time steps for ANN2SNN.
First, we trained SNNs with T = 2, 4, 8, 16, and 32 using the surrogate gradient method. Figure 1D shows the execution times required by the three frameworks for a single training iteration on Spiking ResNet-18. It can be found that SpikingJelly has a notable training speed advantage over other frameworks, yielding higher speedup when T is larger, e.g., up to 11× when T = 32. Second, we tested SNNs in terms of inference with time steps of T = 128, 256, 512, and 1024 to simulate the usage of ANN2SNN. As the experimental results suggest, the inference times of the three frameworks are all proportional to the number of time steps T. We therefore report only the results obtained with T = 128 for simplicity. As Fig. 1D shows, SpikingJelly also achieves up to 2× speedup over other frameworks. The source codes and results of the experiments are provided in the Supplementary Materials.
Neuromorphic device support
Neuromorphic devices, including sensors and computing chips, are the key components of neuromorphic engineering and are also frequently used in spiking deep learning. SpikingJelly provides an efficient interface to incorporate SNNs with neuromorphic devices.
Most neuromorphic datasets are collected from neuromorphic sensors [e.g., N-MNIST (96) was collected from the ATIS sensor, and DVS Gesture was collected from the DVS128 camera], while others, such as ES-ImageNet (97), are converted from static images by software algorithms. Raw data collected through the sensor is stored in a specific format, e.g., AEDAT, which requires a specific binary decoding method. To reduce the cost of use, decoding methods for different formats are implemented in SpikingJelly. SpikingJelly provides both event-based and downsampled frame-based representations of datasets. The event representation is identical to the address event representation (AER) format, which is also the default neuromorphic interchip communication protocol. The i-th event is E[i] = (xi, yi, ti, pi), where (xi, yi) is the coordinate, ti is the time stamp, and pi is the polarity. Frame representations are widely used (45, 56, 57, 60, 98, 99) and are usually temporally downsampled from event representations. The frame F is a 4D tensor containing event counts with a shape of (T, C, H, W), where T is the number of frames, C is the number of channels, and H and W are the height and width of the frame, respectively. Prevalent event-to-frame downsampling methods are also provided by SpikingJelly.
The advantages of SNNs largely depend on the event-driven fashion, which can only be satisfied when neuromorphic computing chips are used. To achieve this goal, researchers first train SNNs on powerful CPUs/GPUs to obtain their optimized weights and then deploy the pretrained SNNs on neuromorphic computing chips for inference purposes. Such a pipeline is also supported by SpikingJelly. SpikingJelly provides the necessary conversion functionality to convert native SpikingJelly modules to the supported formats of neuromorphic computing chips. This allows native SpikingJelly SNNs to run on neuromorphic chips (see the “Exchange modules” section in the Supplementary Materials). Currently, two of the most commonly used neuromorphic computing chips are supported by SpikingJelly: Loihi from Intel and Lynxi KA200 from the Tianjic (29) group. Deployment on other neuromorphic computing chips can also be implemented by developing specific exchange modules.
Ecological niche
A wide variety of SNN frameworks with distinctive features and specific advantages for certain usages are available, which we denote as ecological niches of frameworks. To illustrate the unique ecological niche of SpikingJelly among others, we summarize the characteristics of commonly used SNN frameworks. In general, frameworks can be divided into three categories.
The first category contains classic biological frameworks including NEURON, NEST, and Brian2, which use the lowest-level abstractions of biological neuron models and integrate (or not integrate but easy to implement) biologically plausible learning rules such as STDP. To support GPUs, some classic frameworks provide subframeworks, e.g., CoreNEURON for NEURON and Brian2GENN for Brian2, to accelerate parts of the modules derived from the parent framework. Brian2 also provides Brian2Loihi to support the Loihi chip. With rapid development in recent decades, the classical frameworks have been widely used by neuroscientists and have grown into a large and active research community.
The second category, which can be considered as the intersection of neuroscience and computer science, includes Nengo and BindsNET. These frameworks are designed in the NumPy style and use neuron models of moderate complexity, which leads to a lower computational cost than classical frameworks. These frameworks are more compatible with GPUs because they provide GPU-supported backends such as OpenCL or are directly implemented on the basis of modern machine learning frameworks that fully support GPUs. More specifically, Nengo uses OpenCL-based NengoOCL or TensorFlow-based NengoDL to use GPUs, and BindsNET is based on PyTorch. In addition, Nengo supports Loihi, which is implemented by the NengoLoihi subframework. Biologically plausible rules are the main training algorithms in these frameworks. Note that Nengo also supports ANN2SNN via the NengoDL subframework. The rich ecosystem of Nengo makes it one of the most commonly used frameworks. In addition, the rising BindsNET has attracted thousands of followers within the GitHub community.
The third category considers the intersection of neuroscience and deep learning, which includes Norse, snnTorch, and SpikingJelly. All of these frameworks are based on PyTorch and support GPUs and automatic differentiation. High-level neuron model abstraction is used, allowing these frameworks to work easily with backpropagation. All these frameworks support at least one deep learning method. These frameworks have received a lot of attention from the research community due to the increasing interest in spiking deep learning in recent years. Compared to other frameworks, SpikingJelly has the advantage of full-stack integration, which supports neuromorphic datasets and chips, ANN2SNN, and surrogate gradients, as well as biologically plausible learning rules, and maximizes its simulation efficiency with specific optimization techniques for spike-based operations.
For a clear illustration purpose, we compare available SNN frameworks for SNNs in terms of five aspects: simulation performance (Performance), support for neuromorphic sensors and computing chips (Neuromorphic Support), community scale (Community), biological abstraction level (Biology), and support for surrogate learning and ANN2SNN (Deep Learning Support). The results are presented in Fig. 1E, which shows the ecological niche of SpikingJelly. For more details about the difference with frameworks, please refer to the “Comparison of SNN frameworks” section in the Supplementary Materials.
Adoptions by the community
The increasing number of adoptions by the community is symbolic of the success of a framework. Since being open-sourced in December 2019, SpikingJelly has been widely used in many spiking deep learning studies, including adversarial attack (100, 101), ANN2SNN (95, 102–106), attention mechanisms (107, 108), depth estimation from DVS data (69, 109), development of innovative materials (110), emotion recognition (111), energy estimation (112), event-based video reconstruction (113), fault diagnosis (114), hardware design (115–117), network structure improvements (60, 61, 118–121), spiking neuron improvements (56, 122–127), training method improvements (128–138), medical diagnosis (139, 140), network pruning (141–145), neural architecture search (146, 147), neuromorphic data augmentation (148), natural language processing (149), object detection/tracking for DVS/frame data (65, 66, 150), odor recognition (151), optical flow estimation with DVS data (152), reinforcement learning for controlling (153–155), and semantic communication (156). Figure 1F shows parts of these adoptions. Its widespread adoption by the community marks SpikingJelly as one of the most commonly used spiking deep learning frameworks.
Core modules of SpikingJelly
The key factor that enables SpikingJelly to achieve a combination of flexibility, efficiency, and completeness is the design philosophy of its modules. Some of the core components and functional modules are shown in Figs. 2 and 3, respectively.
Fig. 2. Component modules contained in SpikingJelly.
(A) The general discrete-time spiking neuron model described by Eqs. 5 to 7: the neuronal charge, fire, and reset equations. (B) Simulation of an LIF neuron. The input X[t] is 0 or 10 when 0 ≤ t < 128, 0 when 128 ≤ t < 196, and 3 when 196 ≤ t < 256. Here, {H*[t]} records H[t] at all time steps and includes V[t] when S[t] = 1. (C) The inheritance relationships of an LIF neuron. (D) An example of the sigmoid surrogate function , which is an approximator of the Heaviside function Θ(x). (E) The principle of the surrogate gradient method that uses Θ(x) during forward propagation to generate discrete binary spikes while using σ′(x) during backward propagation to obtain continuous float gradients. (F) The latency encoder that encodes larger values, which are shown by darker squares, for spikes with earlier firing times. (G) Illustration of the input image and the output spikes of the Poisson encoder. (H) Visualization of synthetic events with two polarities and (I) the frames downsampled from these events. (J) The workflow of dataset processing.
Fig. 3. Functional modules in SpikingJelly.
(A) Schematic plot demonstrating the use of a step-by-step or layer-by-layer propagation pattern to simulate a network with three layers and three time steps. Xi[t] is the input of the i-th layer at time step t, and Yi[t] is the output of the i-th layer at time step t. denotes the i-th layer in the single-step mode, while denotes the i-th layer in the multistep mode. The complete computational graphs of the two propagation patterns are identical but constructed in different orders. (B) Functions of ANN2SNN that normalize weights and replace the rectified linear unit (ReLU) with an integrate-and-fire (IF) neuron layer. (C) The quantizer maps the input in the range [0,1] to the nearest fixed-point, the number of which is controlled by the bits. (D) The monitor works like a probe, recording the input, output, input gradients, output gradients, and attributes of the assigned module. (E) The STDP learner uses a monitor to record presynaptic spikes and presynaptic spikes, computes traces, and updates weights. (F) Diagram showing the process of slicing events from the DVS Gesture dataset to four bins and integrating them to four frames [shown in (G)].
Figure 2 (A to E) illustrates a spiking neuron and its components in SpikingJelly. As Fig. 2A shows, SpikingJelly uses three discrete-time equations, which are charge, fire, and reset equations, to describe the behaviors of spiking neurons. X[t], H[t], S[t], and V[t] are the input, membrane potential after charging, spikes, and membrane potential after resetting at time step t, respectively. Figure 2B shows the response of the LIF neuron in SpikingJelly for a given stimulus. Figure 2C shows the inheritance of the LIF neuron class. By inheriting the parent class, the LIF neuron can be easily implemented with only a few lines of code. Figure 2D shows the Heaviside function Θ(x), sigmoid surrogate function (where α is a hyperparameter for controlling the shape), and surrogate gradient σ′(x), which are key attributes of the spiking neuron shown in Fig. 2C. Figure 2E illustrates how surrogate learning is implemented in SpikingJelly. Θ(x) is applied during the forward propagation to generate spikes, and σ′(x) is applied during the backward propagation to calculate gradients. Figure 2 (F and G) visualizes two typical spiking encoders in SpikingJelly. The latency encoder shown in Fig. 2F encodes larger values (darker color) to earlier spikes. The Poisson encoder shown in Fig. 2G encodes the input value to spikes with a firing probability obeying the Poisson distribution. Figure 2H shows synthetic events with two polarities, and the frames downsampled by SpikingJelly are shown in Fig. 2I. The workflow used to process datasets in SpikingJelly is shown in Fig. 2J.
The modules in SpikingJelly have the step_mode attribute to decide whether to apply single-step or multistep forwarding. A module in the single-step mode receives X[t] and outputs Y[t], which are data at a single time step. In contrast, a module in the multistep mode receives X = {X[0], X[1], …, X[T − 1]} and outputs Y = {Y[0], Y[1], …, Y[T − 1]}, which are sequences with data at many time steps. Correspondingly, the SNN with all modules in a single-step or multistep mode follows the step-by-step or layer-by-layer propagation pattern, respectively, which is illustrated in Fig. 3A. The difference between these propagation patterns is the order in which the computational graphs are constructed. More specifically, the step-by-step propagation pattern is a depth-first-search (DFS), while the layer-by-layer pattern is a breadth-first-search (BFS). The propagation patterns in SpikingJelly are designed to satisfy specific user intentions (see the “Distinction of propagation patterns” section in the Supplementary Materials). The step-by-step approach is more flexible for building recurrent connections and is suitable for ANN2SNN because its memory consumption is not proportional to the number of time steps T during inference. The layer-by-layer pattern has the advantage of efficiency optimized by merging time steps into batch dimensions for stateless modules and fusing kernels for stateful modules in SpikingJelly. Figure 3B shows the ANN2SNN conversion functions, which normalize the weights and replace the rectified linear units (ReLUs) with integrate-and-fire (IF) neuron layers. Figure 3C shows the k-bit quantizer with k = 2 and 4, which quantizes the input x ∈ (0,1) to the nearest fixed-point value y. Quantizers support quantization-aware training, which quantizes weights during training. Note that the gradient of the quantizer is zero almost everywhere; hence, the surrogate gradient method is used. Figure 3D shows an example of using the monitor to record data. The monitor works like a probe, collecting data from prescribed modules. Inputs, outputs, input gradients, output gradients, and attributes can be recorded to meet the main data collection requirements. Figure 3E illustrates the STDP learner based on the trace method (157), which uses two monitors to record pre/postsynapse spikes. Then, the traces are updated, and the weights of the synapses are modified. Figure 3 (F and G) visualizes the event slicing and downsampling operations. In Fig. 3F, a sample from the DVS Gesture dataset is sliced into four bins, which are shown in four cuboids with different colors. Then, the events in each cuboid are accumulated, and four frames are generated in Fig. 3G. More details of modules in SpikingJelly can be found in Materials and Methods.
Typical applications
As a full-stack toolkit for spiking deep learning, SpikingJelly involves almost all SNN applications. For simplicity, we demonstrate three typical scenarios that use SpikingJelly in Fig. 4. The first case shown in Fig. 4A is an example of training a deep SNN to classify the neuromorphic DVS Gesture dataset. First, raw events from the DVS camera are preprocessed to tensors via the dataset subpackage in SpikingJelly. Then, we use the layer, neuron, and exchange subpackages to build and train a deep convolutional SNN for classifying the DVS Gesture dataset. The spikes flow through the convolutional layers, as shown in Fig. 4A. After training, we use the exchange subpackage to deploy the SNN on the neuromorphic Loihi chip for inference purposes. The second case shown in Fig. 4B is an example of using a deep SNN to solve the continuous control tasks from the OpenAI gym (158). First, the observation obtained from the state of the environment is encoded by different Gaussian receptive fields composed of population neurons (39), which effectively convert float values to spike trains. After processing, the discrete spike trains are converted to float values, which are the membrane potentials of subsequent layers of nonspiking neurons, to represent the action. Each module in the network can be implemented by the layer and neuron subpackages. The third case shown in Fig. 4C is an example of modeling the biological visual cortex by the deep SNN. First, we build and train the deep SNN on the ImageNet classification task by the layer and neuron subpackages. Then, to obtain the neural representations of the visual cortex and the model, the same visual stimuli are fed to the biological visual system and the pretrained SNNs. Last, the performance of SNNs in modeling the visual cortex can be quantitatively analyzed by calculating the resulting representation similarity. Source codes and experimental results for these applications are provided in the Supplementary Materials.
Fig. 4. Typical applications of SpikingJelly.
(A) The full-stack solution consists of preprocessing the raw events derived from the DVS Gesture dataset to tensors, building and training a deep SNN for classification, and deploying the SNN to the neuromorphic Loihi chip for inference. (B) Pipeline for reinforcement learning and control. The spike encoder transforms the observation obtained from the state of the environment in the OpenAI Gym into spike trains, and then, the spike trains are converted into continuous values in the spike decoder after SNN processing to represent the actions. (C) Workflow of measuring neural similarity between the biovisual system and SNNs. The same visual stimuli are fed to the biovisual system and the pretrained SNN to obtain neural representations of the two systems, and then, the brain-likeness of the model is assessed by measuring the representational similarity.
DISCUSSION
Although SNNs outperform ANNs in terms of biological plausibility and power efficiency, their applications were restricted to neuroscience rather than computational science because of the lack of available learning methods. With the introduction of deep learning methods, the performance of SNNs has been greatly improved, making spiking deep learning a new research hotspot. However, this emerging research area faces the dilemma that the classical software frameworks focus on neuroscience rather than deep learning, while new frameworks have not been developed. SpikingJelly is designed to satisfy the booming research interests of spiking deep learning (see the “Statistical trends” section in the Supplementary Materials).
Spiking deep learning is an emerging interdisciplinary field where researchers should be well versed in both neuroscience and deep learning. However, researchers who specialize in one research area may not be familiar with the other, which is consistent with our developers’ experience when answering questions and participating in discussions posed by users in GitHub. To mitigate the learning and the cost of use, SpikingJelly provides brief and convenient APIs. Classic models and frequently used training scripts are also included. With a few lines of code, users can easily build various types of SNNs and run their models even if they are not seasoned developers aware of the underlying implementation. This design philosophy of SpikingJelly frees users from painstaking coding operations when implementing more creative work.
Complex and diverse spiking neurons and synapses are the core components of SNNs. Modifying neurons and synapses by mimicking the biological neural system (56, 98, 141) or referring experience from deep ANNs (60, 89) is a practicable method for improving spiking deep learning. Researchers want to modify existing modules to define new classes of spiking modules by changing certain functions and properties. Researchers also expect that they should only need to write a few codes to make large changes to the behavior and performance of a model. Such a research paradigm is supported by SpikingJelly’s flexible APIs. Most of the modules in SpikingJelly are created by inheriting from their parents, overriding functions, and adding/deleting new attributes, which also provides a perfect reference for researchers to define new modules.
Deep learning typically uses datasets with massive numbers of samples and large-scale models (22). A larger number of training epochs is also used to achieve better performance (159). All the above characteristics are computationally intensive and hold for spiking deep learning. Moreover, because of the additional temporal dimension, deep SNNs have a higher level of computational complexity than deep ANNs. Thus, the simulation efficiency of deep SNNs is critical, especially for the recent research progress in terms of evaluating deep SNNs with more than 50 layers on the ImageNet dataset containing 1.28 million images has been a widely used performance baseline (58, 60, 62, 88, 89). Computational efficiency is emphasized in the design of SpikingJelly. The simulation process using SpikingJelly benefits from its infrastructure, PyTorch, which enables CPU acceleration with OpenMP/MKL and GPU acceleration with cuBLAS/cuDNN. Advanced acceleration with fusion operations is introduced by merging dimensions, semiautomatically generated CUDA kernels, and just-in-time (JIT) compiling, which brings extremely high training/inference efficiency. Equipped with these acceleration methods, SpikingJelly achieves state-of-the-art simulation speed, which frees researchers from wasting too much time waiting for lengthy deep SNN training processes.
Deep learning methods boost the performance of SNNs and make SNNs practical for use in real-life tasks (26). With the full-stack solution provided by SpikingJelly for building, training, and deploying SNNs, the boundaries of deep SNNs have been extended from toy dataset classification to applications with practical utility, including human-level performance classification, network deployment, and event data processing. Beyond the classic machine learning tasks, several frontier applications of deep SNNs have also been reported, including a spike-based neuromorphic perception system consisting of calibratable artificial sensory neurons (160), a neuromorphic computing model running on memristors (161), and the design of an event-driven SNN hardware accelerator (115). All the above evidence indicates that the advent of SpikingJelly will accelerate the boom of the spiking deep learning community. The future development scheme of SpikingJelly will keep track of the advances in neuromorphic computing, and the rapid symbiotic growth of SpikingJelly and the community will be witnessed.
MATERIALS AND METHODS
In this section, we first introduce the key modules of SpikingJelly and their design concepts. For clarity of exposition, we categorize modules into two categories: component modules and functional modules. Component modules are essential components of SNNs and are frequently used to define networks. Functional modules are modules or functions that simulate an SNN, accelerate its simulation process, record specific data, or modify variables. Then, the acceleration methods in SpikingJelly are discussed.
Component modules
Neuron model
Spiking neurons are the key components of SNNs. Neuroscientists prefer to use spiking neurons with complex neuronal dynamics, e.g., the Hodgkin-Huxley model (162) and the Izhikevich model (163), for high biological plausibility. When applying deep learning in SNNs, simplified spiking neuron models, including IF and LIF models, are more commonly used because of their straightforward neuronal dynamics and compact hyperparameters, which reduce the computational complexity and workload levels of researchers fine-tuning the training process of the network.
In general, the behavior of spiking neurons can be described by three processes: neuronal charging, neuronal firing, and neuronal resetting. Neuronal charging is also denoted as subthreshold dynamics, which can be defined as one or many ODEs. For example, the neuronal charging equation for an LIF neuron can be formulated as
(1) |
where τm is the membrane time constant, V(t) is the membrane potential at time t, Vrest is the resting potential, and X(t) is the input current. The spiking neuron fires a spike S(t) = 1 when its membrane potential V(t) crosses the threshold Vth and remains silent [S(t) = 0] if V(t) < Vth, which can be described as
(2) |
where Θ(x) is the Heaviside step function defined by Θ(x) = 1 for x ≥ 0 and Θ(x) = 0 for x < 0. If the neuron fires a spike, then it will be reset. There are two types of resets, hard reset and soft reset. The hard reset, which resets V(t) to Vreset, is commonly used in directly trained SNNs because of its better experimental performance (164), while the soft reset, which subtracts Vth if the neuron fires, is adopted in ANN2SNN because of its lower theoretical fitting error for ReLU activations (50). The neuronal reset can be formulated as
(3) |
To simulate a spiking neuron, the continuous-time differential equations can be approximated by discrete-time differential equations. In practice, the simplest one-order Eulerian method is used because of its low computational cost. For example, the discrete-time version of Eq. 1 is
(4) |
The neuronal charging equation is specific to different neurons, while the neuronal firing and neuronal resetting equations can be shared. Extending from our previous research (56), SpikingJelly uses three discrete-time equations to describe spiking neurons
(5) |
(6) |
(7) |
To avoid confusion, we use H[t] to represent the membrane potential after charging but before firing and V[t] to represent the membrane potential after resetting. Equation 5 is the neuronal charging equation, and f is specific to a certain neuron. Equation 6 is the neuronal firing equation, and Eq. 7 is the neuronal reset equation. Figure 2A shows the general discrete-time neuron model described by these three equations.
Figure 2B shows the simulation of an LIF neuron built by SpikingJelly with τm = 50, Vth = 1, and Vreset = 0. The input X[t] is 0 or 10 when 0 ≤ t < 128, 0 when 128 ≤ t < 196, and 3 when 196 ≤ t < 256. Here, {H*[t]} not only records H[t] at all time steps but also includes V[t′] for those time steps t′ when the neuron fires a spike (S[t′] = 1), which shows both fires and resets more clearly than only visualizing H[t] or V[t] alone.
Figure 2C takes an LIF neuron as the example and illustrates how SpikingJelly simplifies the module building process via multilevel inheritance. The StepModule is a module that can work in both single/multistep modes with a single tensor or a sequence input, and it is the base class of most modules in SpikingJelly (see the “Design of the step module” section in the Supplementary Materials). On the basis of the StepModule, the MemoryModule adds hidden states as extra attributes, making it suitable as the base class for stateful modules, including neurons and synapses in SNNs. Then, the general discrete-time neuron BaseNode can be easily designed by extending the MemoryModule with neuronal firing and resetting operations obeying Eqs. 6 and 7, respectively, and defining an empty neuronal charging function obeying Eq. 5 for child classes to complete. Last, we build the LIFNode inherited from the BaseNode by completing the neuronal charging function Eq. 5 and using an extra membrane potential parameter τm. Beyond the naive PyTorch implementation, SpikingJelly offers additional optional CUDA kernels for accelerating spiking neurons. The forward CUDA kernel LIFNodeFPTTKernel, the backward CUDA kernel LIFNodeBPTTKernel, the autograd function LIFNodeATGF, and the surrogate function of the LIF neuron are also extended through multilevel inheritance with several lines of code changes. Such a module design paradigm enhances the extensibility of SpikingJelly and reduces the workload required for researchers to develop new models. When researchers want to define a new kind of module, they only need to inherit the corresponding base class and complete or override some functions.
Surrogate gradients
The great success of deep learning models is largely due to their multiple processing layers trained by backpropagation and gradient descent (44). However, the derivative of the Heaviside function Θ(x) introduced by the spike trigger mechanism in Eq. 6 is +∞ at x = 0 and 0 at x ≠ 0, which blocks the gradient propagation process. To apply the gradient-based deep learning method in SNNs, the surrogate gradient method has been proposed (45, 46, 165, 166), which uses the derivative of the surrogate function σ(x) to define the derivative of Θ(x) during backpropagation. Commonly used surrogate functions are approximators of Θ(x), which have similar but smoother shapes; an example is the sigmoid surrogate function shown in Fig. 2D, where α is a hyperparameter used to control the shape.
As a surrogate function is used in the spike trigger mechanism, SpikingJelly packages it as a component of the spiking neuron. As shown in Fig. 2E, during forward propagation, the neuron uses S[t] = Θ(H[t] − Vth) to generate discrete binary spikes S[t] ∈ {0,1}. During backward propagation, the gradient is calculated by , where ℒ is the loss.
Encoder
The spiking encoder is a unique module used in SNNs that encodes nonbinary input data into spikes. Figure 2F illustrates the latency encoder in SpikingJelly, which can be formulated as
(8) |
(9) |
where S[t] is the output spike at time step t, tfis the firing time step, [·] is the rounding function, Tmax is the latest firing time step, and x is the input value. The latency encoder encodes a larger x into an early firing time step tf, indicating that a larger stimulus should cause a faster response, as has been observed in the retinal pathway (167).
The Poisson encoder is another commonly used encoder in SNNs that encodes inputs x ∈ [0,1] to Poisson events {s[t]} with
(10) |
For simplicity, an approximate implementation is used, which is provided in SpikingJelly as
(11) |
Figure 2G shows an example of an input image and the output spikes of the Poisson encoder. We find that the output spikes preserve most of the information from the original image. Other commonly used encoders, including weighted phase (168) and Gaussian tuning encoders (39), are also available in SpikingJelly.
Neuromorphic datasets
Neuromorphic datasets are frequently used as benchmarks for evaluating the temporal information processing abilities of SNNs (169). SpikingJelly provides commonly used datasets, including ASL-DVS (170), CIFAR10-DVS (171), DVS Gesture (55), ES-ImageNet (97), HARDVS (172), N-Caltech101 (96), N-MNIST (96), Nav Gesture (173), and Spiking Heidelberg Digits (174) (see the “Neuromorphic datasets” section in the Supplementary Materials). New datasets can be easily integrated by inheriting the dataset base and completing some processing functions.
Figure 2H visualizes a series of events with two polarities drawn in blue and green. The raw data collected from the sensor is stored in a specific format, e.g., AEDAT, which requires a specific binary decoding method. To reduce the cost of use, decoding methods for different datasets are implemented in SpikingJelly. Correspondingly, the outputs of the datasets in SpikingJelly are in the NumPy format, which is compatible with all Python applications. The number of events in a sample can be in the millions and can hardly be handled directly by the network. Widely used subsampling methods integrate events into frames. Figure 2I shows the four frames integrated from the events in Fig. 2H. SpikingJelly also provides frequently used integration methods.
Figure 2J shows the process flow of the datasets in SpikingJelly, which includes downloading from the source, extracting archives, decoding the raw data to an AER Python dictionary in the NumPy format, and downsampling events to frames. To add new datasets, the user only needs to inherit the base class and implement the “download”, “extract”, and “decode” functions, while another workload is handled by the base accelerated by multithreading, which also reveals the superior extensibility of SpikingJelly.
Functional modules
Step modes and propagation patterns
In SpikingJelly, each module has a variable attribute called step_mode, which controls whether the module uses the single-step mode or multistep mode (see the “Design of the step module” section in the Supplementary Materials). In the single-step mode, the module receives X[t] and outputs Y[t], which are data at a single time step. The input sequence for the 0-th layer is denoted as X0 = {X0[0], X0[1], …, X0[T − 1]}. When an SNN is stacked with L single-step modules {, , …, }, the SNN is simulated in the step-by-step propagation pattern, which is shown in Algorithm 1A.
Algorithm 1: Propagation patterns.
(A) Propagation pattern: step by step
Require: an SNN stacked by L single-step modules , the input sequence for the 0-th layer X0 = {X0[0], X0[1], …, X0[T − 1]}.
Create an empty list YL−1 = {}
for t ← 0,1, …T − 1
for l ← 0,1, …L − 1
Append YL−1[t] in YL−1 = {YL−1[0], YL−1[1], …, YL−1[t − 1]}
Output YL−1 = {YL−1[0], YL−1[1], …, YL−1[T − 1]}
__________
(B) Propagation pattern: layer by layer
Require: an SNN stacked by L multistep modules ,the input sequence for the 0-th layer X0 = {X0[0], X0[1], …, X0[T − 1]}
for l ← 0,1, …L − 1
Output YL−1 = {YL−1[0], YL−1[1], …, YL−1[T − 1]}
When switching the step_mode to the multistep mode, the module receives a sequence X = {X[0], X[1], …, X[T − 1]} and outputs a sequence Y = {Y[0], Y[1], …, Y[T − 1]}. Correspondingly, the SNN built with L multistep modules {, , …, } can be simulated in a layer-by-layer manner, as Algorithm 1B shows.
Figure 3A shows how identical computational graphs are built in different orders by step-by-step and layer-by-layer propagation patterns. Considering that there are two dimensions, the time step and depth, in the computational graphs of SNNs, we can find that the step-by-step and layer-by-layer propagation patterns are DFS and BFS processes for traversing the computational graph, respectively. The network can switch between two propagation patterns easily by changing the step_mode attribute of each layer in SpikingJelly. The chosen propagation mode is determined by the user’s intent. The layer-by-layer pattern has the advantage of efficiency because the calculation over time steps can be executed in parallel for stateless layers and the fusion operations can be implemented for stateful layers, which will be discussed in the “Acceleration modules” section. However, when using the layer-by-layer pattern, the inputs X[t] at all time steps t must be given simultaneously, which is impossible when X[t + 1] depends on X[t], e.g., when we use the recurrent connections between layers. In such cases, the step-by-step pattern is preferred because of its flexible usage.
Conversion methods
In addition to surrogate gradient training, another way to obtain high-performance SNNs is through ANN-to-SNN conversion, also known as ANN2SNN. The conversion process is based on the fact that a rate-coded SNN contains an equivalence relation between the firing rate and the activation of the ANN (49, 95) under the conditions that the ANN should use ReLU activations and average pooling. On the basis of this fact, one can transform a trained ANN into a corresponding SNN.
To provide a convenient resolution to the ANN2SNN problem, SpikingJelly has a Converter module that normalizes the weight of the ANN and converts the ANN to an SNN by replacing the ReLUs with IF neuron layers, which is shown in Fig. 3B. The neuronal charging function of the IF neuron is
(12) |
which has not decayed and can approximate the ReLU in ANNs by firing rates. The implementation in SpikingJelly is based on the modeling of postsynaptic potential (51, 102, 103) so that the average postsynaptic potential is equal to the activation of the original ANN. We provide a VoltageHook module to record the maximum (or some percentile) of the hidden features as the scale of the postsynaptic current for the conversed SNN. The activation is then altered by the IF neuron layer to accomplish the conversion process. Furthermore, to perform fast inference (i.e., inference with few time steps), we provide a plug-and-play optimized membrane potential initialization (102) in SpikingJelly.
Quantizer
To perform inference with SNNs on resource-constrained hardware, including field-programmable gate arrays, neuromorphic chips, and mobile phones, network quantization is a necessary technique for reducing storage and computational costs. For example, a network quantized to 8 bits has a 4× reduction in its model size and memory bandwidth requirements and up to 4× throughput when compared with a 32-bit model. SpikingJelly provides a quantizer for quantization-aware training that can be used to quantize weights and neuronal dynamics during training. Figure 3C shows a typical k-bit quantizer in SpikingJelly, which maps an input x in the range [0,1] to the nearest fixed-point , where [·] is the rounding function. Note that q′(x) is zero almost everywhere, and SpikingJelly also uses the surrogate method to redefine its gradients.
Monitor
The demands for recording data, e.g., the firing rates of spiking neuron layers, are frequently required by researchers. To satisfy the demand for recording data, SpikingJelly provides five general purpose monitors, which can monitor the input/output during forward/backward propagation and the attributes of specific layers. As Fig. 3D shows, a monitor acts like a probe, which is inserted into layers of the user-defined type and records the data with a custom transform λ. For example, if we are interested in the firing rates of all spiking neurons in an SNN, we can set the OutputMonitor with the layer type as the spiking neuron layer and the custom transform as , where T is the number of time steps and S[t] is the spike at time step t. With this monitor, we can easily record the firing rate of each spiking neuron layer.
STDP learner
Combining the local unsupervised STDP learning process and the global supervised surrogate gradient has become a promising learning method for deep SNNs (175), and it can be implemented by the STDP learner in SpikingJelly. In the minimal example with two neurons shown in Fig. 3E, the STDP learner in SpikingJelly uses the “all-to-all” STDP with the trace method (157), in which all the pre- and postsynaptic spike pairs are considered. It uses monitors to record presynaptic spikes spre and postsynaptic spikes spost. Then, the traces trpre[t], trpost[t] are updated as
(13) |
(14) |
where τpre and τpost are the time constants of presynaptic and postsynaptic traces, respectively. Then, the weight w is updated by the traces as
(15) |
where Fpre and Fpost are custom user-defined functions for controlling the amplitudes of synapse changes. In SpikingJelly, Δw can be added to the gradient , indicating that the STDP learner can work together with the gradient descent method and various kinds of optimizers, including momentum stochastic gradient descent and adaptive moment estimation (Adam) (17).
Event downsampling methods
The event-to-frame downsampling method is widely used in deep SNNs with various kinds of slicing and integration methods. Considering these diverse usages, SpikingJelly supports both predefined and user-defined custom slicing and integration methods. A commonly used downsampling method is to integrate events with a fixed time duration ΔT, which can be formulated as
(16) |
where Ip,y,x(pi, yi, xi) is an indicator function and equals 1 only when (p, y, x) = (pi, yi, xi). Figure 3F visualizes the four slices obtained by the fixed time durations of events from a sample in the DVS Gesture dataset, and the four integrated frames are shown in Fig. 3G.
However, the fixed time duration-based integration generates frames with different frame numbers because the durations of the samples in neuromorphic datasets are not identical. Another frequently used method provided in SpikingJelly is fixed-frame number-based integration (56), which can be formulated as
(17) |
where jl and jr are the indices created by a specific splitting method. For example, splitting by event number is performed as follows
(18) |
(19) |
where ⌊·⌋ is the floor operation and N is the number of events. Splitting by event duration is performed as
(20) |
(21) |
(22) |
Note that fixed frame number-based integration can be used only once all events have arrived, which makes it unsuitable for a real-time system whose event durations are unpredictable. User-defined custom slicing and integration methods are also supported in SpikingJelly; they are implemented as callable functions and are used in the initialized args for the dataset class.
Acceleration nodules
Principle of acceleration
SpikingJelly accelerates the simulation of SNNs via two methods, which are the parallelization of sequential computations for stateless layers and the fusion of CUDA kernels for stateful layers. Stateless layers, including convolutional and linear layers, are widely used in SNNs. Similar to stateful layers, these layers also receive a sequence X = {X[0], X[1], …, X[T − 1]} with a shape of (T, N, …) as input. The difference between stateless and stateful layers is that the computation of Y[t] in stateless layers only depends on X[t]. Thus, the for-loop concerning the time steps is not necessary because the computation has no temporal dependence. SpikingJelly provides the SeqToANNContainer or its functional formulation seq_to_ann_forward to wrap stateless layers or their forward propagations. The SeqToANNContainer merges the time step dimension into the batch dimension by reshaping the input tensor from a shape of (T, N, …) to (T · N, …) before sending the input sequence to the stateless layer to execute the computation over all time steps in parallel and splits the outputs into a sequence Y = {Y[0], Y[1], …, Y[T − 1]} with the original sequence length. Figure 5A shows an example of using the SeqToANNContainer to wrap a 1D convolutional layer Conv1d, whose input has a shape of (N, C, L), where C is the number of channels and L is the input size. To avoid the for-loop concerning the time steps, using an (n + 1)-D convolution to implement the n-D convolution is also a practicable method and has been applied in some frameworks. The (n + 1)-D convolution method uses the time step dimension as the last dimension, and the input sequence has a shape of (N, C, …, T). Then, the n-D convolution imposed on the (n + 1)-D input sequence is implemented by the (n + 1)-D convolution with weight and stride values of 1 in the time step dimension. Figure 5B compares the execution times of different implementations that apply 2D convolution with 128 channels, a kernel size of 3, and a stride of 1 on the input with a shape of (T, N, C, H, W) = (T,16,128,64,64), which is a common convolutional operation for deep SNNs. In Fig. 5B, “SJ” is SpikingJelly’s method that merges the batch and time step dimensions, “RAW” is the plain for-loop conducted for the time steps, and “3D” is using the time step dimension as the depth dimension of the 3D convolution, which is the (n + 1)-D convolution method. The results show that SJ is the best method because its execution time increases much more slowly than those of the other two methods with increasing time steps.
Fig. 5. Acceleration in SpikingJelly.
(A) The use of seq_to_ann_forward for wrapping stateless layers and merging the time step dimension into the batch dimension to compute in parallel over time steps. (B) Comparison of execution times for different implementations of applying 2D convolution on sequential data. SJ is SpikingJelly’s method that merges the batch and time step dimensions. RAW is the plain for-loop for time steps, and 3D regards the time step dimension as the depth dimension of the 3D convolution. (C) Comparison between the execution times of the LIF neuron in SpikingJelly (SJ) accelerated by fused operations and the plain for-loop implemented by PyTorch (RAW). (D) Example of easy implementation of forward and backward kernels for an IF neuron with inheritance. (E) An example of the IF neuron that shows the complete workflow of CUDA neurons in SpikingJelly. The parameters in each neuron are marked with different colors. Correspondingly, the CUDA codes governed by these parameters are also highlighted with the same colors. Strikethroughs such as abc represent deletions of the code abc.
For stateful layers such as spiking neurons, Y[t] depends on not only X[t] but also the hidden states H[t − 1], which successively depend on X[t − 1], X[t − 2], …X[0]. Thus, the for-loop concerning time steps is inevitable. However, when using the naive for-loop implemented in PyTorch, one or a series of CUDA kernels are invoked at each time step. The frequent launching of many small CUDA kernels wastes time on calling overhead including memory access time and kernel launch time, which decreases the computational efficiency of the network. To accelerate the stateful layers, SpikingJelly fuses many small kernels with a few large kernels, which avoids the calling overhead. Figure 5C compares the execution times of the training and inference processes of the LIF neuron in multistep mode implemented by the CUDA kernel fusion method (SJ) with the plain for-loop implemented by PyTorch (RAW). The results show that SJ is much faster than RAW. It can also be found that as T increases, the execution times of both neurons increase linearly during the inference process. However, the execution time of RAW grows quadratically during training, while that of SJ still increases slowly with T. For more details about the effect of acceleration methods in SpikingJelly, refer to the “Ablation study of acceleration methods” section in the Supplementary Materials.
On the basis of the above two acceleration methods, it is recommended to train deep SNNs with the layer-by-layer propagation pattern for higher efficiency. As Algorithm 1B shows, each module receives sequence data, and then, the parallelization of the sequential computations for stateless layers and the fusion of CUDA kernels for stateful layers can be used. However, the spatial complexity of the layer-by-layer propagation pattern is 𝒪(T · N), even during inference. When T is large, e.g., hundreds and thousands of time steps in an ANN2SNN inference case, the layer-by-layer propagation pattern cannot be used because of memory restrictions. In such a case, the step-by-step propagation pattern can be used for inference because of its spatial complexity of 𝒪(N), which is not proportional to T.
Semiautomatic CUDA code generation
The fusion of operations into one CUDA kernel has the highest computational efficiency but involves a massive workload for developers. Standard practices include writing CUDA code, wrapping CUDA functions in C++ interfaces, and binding C++ to Python via pybind. To simplify the development process, SpikingJelly uses CuPy (176) to implement CUDA kernels. After defining a raw CUDA kernel in a Python string, CuPy wraps and compiles the string to make a CUDA binary library, which is cached and reused in subsequent runs. The introduction of CuPy avoids the trivialities of binding between CUDA, C++, and Python and helps users focus on a pure Python development environment.
A notable advantage of using CuPy is that CUDA codes are written in Python strings, indicating that we can easily control CUDA codes in a Python environment. Combined with the superior extensibility of SpikingJelly, this characteristic greatly simplifies the process of creating a CUDA kernel. As mentioned in Fig. 2C, the forward kernel and backward kernel for a specific neuron class are extended from the neuron kernel base class with a relatively small number of code changes (see the “Details of the neuron kernel” section in the Supplementary Materials). According to Eqs. 5 to 7 for forward propagation, the backward propagation process is defined as
(23) |
(24) |
where is defined by the surrogate function, is defined by Eq. 5, while the other parts are generic for different kinds of neurons. Thus, the neuron kernel base class in SpikingJelly is an incomplete CUDA kernel with vacant functions for the inheritor to complete, which includes Eq. 5 for the forward propagation process and and for the backward propagation process. For example, when we use an IF neuron whose neuronal charging function and backward propagation process are defined as
(25) |
(26) |
(27) |
then the forward propagation through time (FPTT) kernel IFNodeFPTTKernel and the backward propagation through time (BPTT) kernel IFNodeBPTTKernel are defined as shown in Fig. 5D. The FPTT kernel implements the neuronal dynamics of the IF neuron including Eqs. 12, 6, and 7 at T time steps in a single CUDA kernel. Correspondingly, the BPTT kernel implements the backward propagation of the neuronal dynamics at all time steps in a single CUDA kernel (see algorithm S3). We find that completing these empty functions requires only a few lines of code.
Figure 5E shows the complete workflow of CUDA neurons in SpikingJelly by taking an IF neuron as the example. Parameters in the neuron are marked with different colors. Correspondingly, the CUDA codes governed by these parameters are also highlighted with the same color. For example, when hard_reset is true, the Python class performs the following operations, which are also shown by the blue highlights in Fig. 5E: (i) Add float & v_reset in the forward and backward kernels’ arguments. (ii) Keep the hard reset commands v_v_seq[t + dt] = h_seq[t] * (1.0f - spike_seq[t]) + v_reset * spike_seq[t], and delete the sort reset commands v_v_seq[t + dt] = h_seq[t] - v_th * spike_seq[t] in the forward kernel. (iii) Keep the backward hard reset commands float grad_v_to_h = (1.0f) - spike_seq_t, and delete the backward soft reset commands float grad_v_to_h = (1.0f) in the backward kernel.
When detach_reset is true, S[t] in Eq. 7 is detached from the backward computation (177), and then, the corresponding CUDA codes are deleted, as the purple highlights in Fig. 5E show. The CUDA codes used by surrogate learning to define are generated by the surrogate function class, as the orange highlights in Fig. 5E show. After the CUDA code generation process, CuPy compiles these CUDA codes to the CUDA library, and forward/backward computation can be accelerated by fusion operations within the large CUDA kernel.
JIT acceleration
JIT is an alternative method for accelerating a network, which can compile Python codes into high-performance C++/CUDA programs while running. Some simple elementwise operations, e.g., the neuronal firing (Eq. 6) and neuronal resetting (Eq. 7) operations, can be wrapped into one CUDA kernel by JIT. As a common optimization method, JIT has not only lower performance but also a lower development cost than specific optimization methods, such as manually writing CUDA codes. Thus, SpikingJelly uses semiautomatically generated CUDA kernels for complex operations such as forward and backward kernels through time steps with gradients for spiking neurons and uses JIT to accelerate other simple functions such as the neuronal dynamics at one time step. A typical example is shown in Fig. 5C, in which the inference process of SJ is accelerated by JIT.
Acknowledgments
We gratefully acknowledge contributors including Y. Huang, L. LYU, L. Yu, R. Zhu, Q. Pu, Y. Ye, H. Qiu, D. Ma, I. Khalfaoui-Hassani, Y. Pan, M. Xiao, C. Sun, Y. Zhu, H. Gao, H. Zhang, and M. Yao from GitHub and the OpenIntelligence (OpenI) community for code commits; OpenI for bonus and server support; Z. Ma and Peng Cheng Cloud Brain for computing resources; the Intel Neuromorphic Research Community for remote access to Intel Loihi; Y. Lin, X. Zhu, and W. Lin from Peng Cheng Laboratory and engineers from Lynxi for deployment on Lynxi KA200; T. Bu, X. Luo, and S. Ding for deployment on Intel Loihi; and D. Lee and Z. Zhou for explorations about CUDA accelerations of quantized math operations.
Funding: This work is supported by grants from the National Natural Science Foundation of China (62027804, 61825101, 62088102, 62236009, and 62176003), the major key project of the Peng Cheng Laboratory (PCL2021A13), and Beijing Natural Science Foundation (JQ21015).
Author contributions: Y.T. led the writing of the paper, proposed the initial idea of building SpikingJelly, and supervised the whole project. G.L. took part in the design of the structure of this paper; revised its contents; contributed to exchange modules, datasets, and CUDA accelerations; and popularized SpikingJelly in the community. W.F. led the development of SpikingJelly and wrote this paper. Y.C. took part in the design of the structure of SpikingJelly and contributed codes concerning complex neurons. J.D. contributed codes concerning ANN2SNN and took part in the development of architectures of deep SNN models. Z.Y. and T.M. took part in designing the datasets, stateful modules, and propagation patterns and popularized SpikingJelly in the community. D.C. contributed codes concerning reinforcement learning and the application of reinforcement learning control. L.H. contributed codes concerning encoders and the application of neural similarity. H.Z. took part in the design of the structure of SpikingJelly and applied for bonus and computing resources. All authors reviewed the manuscript.
Competing interests: The authors declare that they have no competing interests.
Data and materials availability: The source codes of SpikingJelly can be found at its GitHub page: https://github.com/fangwei123456/spikingjelly. Source codes for the experiment in Fig. 1D and the typical applications in Fig. 4 are available at https://doi.org/10.5281/zenodo.8310901. All other data needed to evaluate the conclusions in this paper are present in the paper and/or the Supplementary Materials.
Supplementary Materials
This PDF file includes:
Supplementary Information
Figs. S1 to S28
Tables S1 and S2
References
REFERENCES AND NOTES
- 1.A. Krizhevsky, I. Sutskever, G. E. Hinton, Imagenet classification with deep convolutional neural networks, in Advances in Neural Information Processing Systems (NeurIPS) (NeurIPS, 2012), pp. 1097–1105. [Google Scholar]
- 2.S. Hochreiter, J. Schmidhuber, Long short-term memory. Neural Comput. 9, 1735–1780 (1997). [DOI] [PubMed] [Google Scholar]
- 3.A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, I. Polosukhin, Attention is all you need, in Advances in Neural Information Processing Systems (NeurIPS) (NeurIPS, 2017), p. 30. [Google Scholar]
- 4.K. Simonyan, A. Zisserman, Very deep convolutional networks for large-scale image recognition. arXiv:1409.1556 (2014). 10.48550/arXiv.1409.1556. [DOI]
- 5.C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, A. Rabinovich, in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (IEEE, 2015), pp. 1–9. [Google Scholar]
- 6.R. Girshick, J. Donahue, T. Darrell, J. Malik, Rich feature hierarchies for accurate object detection and semantic segmentation, in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (IEEE, 2014), pp. 580–587. [Google Scholar]
- 7.W. Liu, D. Anguelov, D. Erhan, C. Szegedy, S. Reed, C.-Y. Fu, A. C. Berg, in European Conference on Computer Vision (ECCV) (Springer, 2016), pp. 21–37. [Google Scholar]
- 8.J. Redmon, S. Divvala, R. Girshick, A. Farhadi, in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (IEEE, 2016), pp. 779–788. [Google Scholar]
- 9.I. Sutskever, O. Vinyals, Q. V. Le, Sequence to sequence learning with neural networks, in Advances in Neural Information Processing Systems (NeurIPS) (NeurIPS, 2014), p. 27. [Google Scholar]
- 10.D. Bahdanau, K. Cho, Y. Bengio, Neural machine translation by jointly learning to align and translate. arXiv:1409.0473 (2014). 10.48550/arXiv.1409.0473. [DOI]
- 11.R. Sennrich, B. Haddow, A. Birch, Neural machine translation of rare words with subword units. arXiv:1508.07909 (2015). 10.48550/arXiv.1508.07909. [DOI]
- 12.A. Graves, A.-R. Mohamed, G. Hinton, in IEEE International Conference on Acoustics, Speech and Signal Processing (IEEE, 2013), pp. 6645–6649. [Google Scholar]
- 13.A. Graves, N. Jaitly, A.-R. Mohamed, in IEEE workshop on Automatic Speech Recognition and Understanding (IEEE, 2013), pp. 273–278. [Google Scholar]
- 14.V. Mnih, K. Kavukcuoglu, D. Silver, A. A. Rusu, J. Veness, M. G. Bellemare, A. Graves, M. Riedmiller, A. K. Fidjeland, G. Ostrovski, S. Petersen, C. Beattie, A. Sadik, I. Antonoglou, H. King, D. Kumaran, D. Wierstra, S. Legg, D. Hassabis, Human-level control through deep reinforcement learning. Nature 518, 529–533 (2015). [DOI] [PubMed] [Google Scholar]
- 15.D. Silver, A. Huang, C. J. Maddison, A. Guez, L. Sifre, G. van den Driessche, J. Schrittwieser, I. Antonoglou, V. Panneershelvam, M. Lanctot, S. Dieleman, D. Grewe, J. Nham, N. Kalchbrenner, I. Sutskever, T. Lillicrap, M. Leach, K. Kavukcuoglu, T. Graepel, D. Hassabis, Mastering the game of go with deep neural networks and tree search. Nature 529, 484–489 (2016). [DOI] [PubMed] [Google Scholar]
- 16.D. E. Rumelhart, G. E. Hinton, R. J. Williams, Learning representations by back-propagating errors. Nature 323, 533–536 (1986). [Google Scholar]
- 17.D. P. Kingma, J. Ba, Adam: A method for stochastic optimization. arXiv:1412.6980 (2014). 10.48550/arXiv.1412.6980. [DOI]
- 18.X.-W. Chen, X. Lin, Big data deep learning: Challenges and perspectives. IEEE Access 2, 514–525 (2014). [Google Scholar]
- 19.O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. Berg, L. Fei-Fei, Imagenet large scale visual recognition challenge. Int. J. Comput. Vis. 115, 211–252 (2015). [Google Scholar]
- 20.R. Raina, A. Madhavan, A. Y. Ng, Large-scale deep unsupervised learning using graphics processors, in International Conference on Machine Learning (ICML) (ICML, 2009), pp. 873–880. [Google Scholar]
- 21.A. Krizhevsky, I. Sutskever, G. E. Hinton, Imagenet classification with deep convolutional neural networks. Commun. ACM 60, 84–90 (2017). [Google Scholar]
- 22.I. Goodfellow, Y. Bengio, A. Courville, Deep Learning (MIT Press, 2016); www.deeplearningbook.org.
- 23.B. Goertzel, Artificial general intelligence: Concept, state of the art, and future prospects. J. Artif. Gen. Intell. 5, 1–46 (2014). [Google Scholar]
- 24.D. Hassabis, D. Kumaran, C. Summerfield, M. Botvinick, Neuroscience-inspired artificial intelligence. Neuron 95, 245–258 (2017). [DOI] [PubMed] [Google Scholar]
- 25.W. Maass, Networks of spiking neurons: The third generation of neural network models. Neural Netw. 10, 1659–1671 (1997). [Google Scholar]
- 26.A. Tavanaei, M. Ghodrati, S. R. Kheradpisheh, T. Masquelier, A. Maida, Deep learning in spiking neural networks. Neural Netw. 111, 47–63 (2019). [DOI] [PubMed] [Google Scholar]
- 27.D. Salaj, A. Subramoney, C. Kraisnikovic, G. Bellec, R. Legenstein, W. Maass, Spike frequency adaptation supports network computations on temporally dispersed information. eLife 10, e65459 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 28.D. D. Cox, T. Dean, Neural networks and neuroscience-inspired computer vision. Curr. Biol. 24, R921–R929 (2014). [DOI] [PubMed] [Google Scholar]
- 29.J. Pei, L. Deng, S. Song, M. Zhao, Y. Zhang, S. Wu, G. Wang, Z. Zou, Z. Wu, W. He, F. Chen, N. Deng, S. Wu, Y. Wang, Y. Wu, Z. Yang, C. Ma, G. Li, W. Han, H. Li, H. Wu, R. Zhao, Y. Xie, L. Shi, Towards artificial general intelligence with hybrid tianjic chip architecture. Nature 572, 106–111 (2019). [DOI] [PubMed] [Google Scholar]
- 30.P. A. Merolla, J. V. Arthur, R. Alvarez-Icaza, A. S. Cassidy, J. Sawada, F. Akopyan, B. L. Jackson, N. Imam, C. Guo, Y. Nakamura, B. Brezzo, I. Vo, S. K. Esser, R. Appuswamy, B. Taba, A. Amir, M. D. Flickner, W. P. Risk, R. Manohar, D. S. Modha, A million spiking-neuron integrated circuit with a scalable communication network and interface. Science 345, 668–673 (2014). [DOI] [PubMed] [Google Scholar]
- 31.M. Davies, N. Srinivasa, T.-H. Lin, G. Chinya, Y. Cao, S. H. Choday, G. Dimou, P. Joshi, N. Imam, S. Jain, Y. Liao, C.-K. Lin, A. Lines, R. Liu, D. Mathaikutty, S. McCoy, A. Paul, J. Tse, G. Venkataramanan, Y.-H. Weng, A. Wild, Y. Yang, H. Wang, Loihi: A neuromorphic manycore processor with on-chip learning. IEEE Micro 38, 82–99 (2018). [Google Scholar]
- 32.D. O. Hebb, The Organization of Behavior: A Neuropsychological Theory (Psychology Press, 2005). [Google Scholar]
- 33.G.-Q. Bi, M.-M. Poo, Synaptic modifications in cultured hippocampal neurons: Dependence on spike timing, synaptic strength, and postsynaptic cell type. J. Neurosci. 18, 10464–10472 (1998). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 34.T. Masquelier, S. J. Thorpe, Unsupervised learning of visual features through spike timing dependent plasticity. PLOS Comput. Biol. 3, e31 (2007). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 35.S. R. Kheradpisheh, M. Ganjtabesh, S. J. Thorpe, T. Masquelier, STDP-based spiking deep convolutional neural networks for object recognition. Neural Netw. 99, 56–67 (2018). [DOI] [PubMed] [Google Scholar]
- 36.Q. Liu, H. Ruan, D. Xing, H. Tang, G. Pan, Effective AER object classification using segmented probability-maximization learning in spiking neural networks, in Proceedings of the AAAI Conference on Artificial Intelligence (AAAI, 2020), vol. 34, pp. 1308–1315. [Google Scholar]
- 37.R. Xiao, H. Tang, Y. Ma, R. Yan, G. Orchard, An event-driven categorization model for aer image sensors using multispike encoding and learning. IEEE Trans. Neural Netw. Learn. Syst. 31, 3649–3657 (2020). [DOI] [PubMed] [Google Scholar]
- 38.A. Taherkhani, A. Belatreche, Y. Li, G. Cosma, L. P. Maguire, T. M. McGinnity, A review of learning in biologically plausible spiking neural networks. Neural Netw. 122, 253–272 (2020). [DOI] [PubMed] [Google Scholar]
- 39.S. M. Bohte, J. N. Kok, H. La Poutre, Error-backpropagation in temporally encoded networks of spiking neurons. Neurocomputing 48, 17–37 (2002). [Google Scholar]
- 40.R. Gütig, H. Sompolinsky, The tempotron: A neuron that learns spike timing–Based decisions. Nat. Neurosci. 9, 420–428 (2006). [DOI] [PubMed] [Google Scholar]
- 41.F. Ponulak, A. Kasiński, Supervised learning in spiking neural networks with ReSuMe: Sequence learning, classification, and spike shifting. Neural Comput. 22, 467–510 (2010). [DOI] [PubMed] [Google Scholar]
- 42.A. Mohemmed, S. Schliebs, S. Matsuda, N. Kasabov, Span: Spike pattern association neuron for learning spatio-temporal spike patterns. Int. J. Neural Syst. 22, 1250012 (2012). [DOI] [PubMed] [Google Scholar]
- 43.Y. LeCun, L. Bottou, Y. Bengio, P. Haffner, Gradient-based learning applied to document recognition. Proc. IEEE 86, 2278–2324 (1998). [Google Scholar]
- 44.Y. LeCun, Y. Bengio, G. Hinton, Deep learning. Nature 521, 436–444 (2015). [DOI] [PubMed] [Google Scholar]
- 45.Y. Wu, L. Deng, G. Li, J. Zhu, L. Shi, Spatio-temporal backpropagation for training high-performance spiking neural networks. Front. Neurosci. 12, 331 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 46.S. B. Shrestha, G. Orchard, in Advances in Neural Information Processing Systems (NeurIPS) (NeurIPS, 2018), pp. 1419–1428. [Google Scholar]
- 47.E. O. Neftci, H. Mostafa, F. Zenke, Surrogate gradient learning in spiking neural networks: Bringing the power of gradient-based optimization to spiking neural networks. IEEE Signal Process. Mag. 36, 51–63 (2019). [Google Scholar]
- 48.E. Hunsberger, C. Eliasmith, Spiking deep networks with lif neurons. arXiv:1510.08829 (2015). 10.48550/arXiv.1510.08829. [DOI]
- 49.Y. Cao, Y. Chen, D. Khosla, Spiking deep convolutional neural networks for energy-efficient object recognition. Int. J. Comput. Vis. 113, 54–66 (2015). [Google Scholar]
- 50.B. Rueckauer, I.-A. Lungu, Y. Hu, M. Pfeiffer, S.-C. Liu, Conversion of continuous-valued deep networks to efficient event-driven networks for image classification. Front. Neurosci. 11, 682 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 51.S. Deng, S. Gu, Optimal conversion of conventional artificial neural networks to spiking neural networks, in International Conference on Learning Representations (ICLR) (ICLR, 2021). [Google Scholar]
- 52.Y. Li, S. Deng, X. Dong, R. Gong, S. Gu, in International Conference on Machine Learning (ICML) (PMLR, 2021), pp. 6316–6325. [Google Scholar]
- 53.C. Stöckl, W. Maass, Optimized spiking neurons can classify images with high accuracy through temporal coding with two spikes. Nat. Mach. Intell. 3, 230–238 (2021). [Google Scholar]
- 54.A. Krizhevsky, G. Hinton, Learning multiple layers of features from tiny images (Tech. rep., 2009). [Google Scholar]
- 55.A. Amir, B. Taba, D. Berg, T. Melano, J. McKinstry, C. Di Nolfo, T. Nayak, A. Andreopoulos, G. Garreau, M. Mendoza, J. Kusnitz, M. Debole, S. Esser, T. Delbruck, M. Flickner, D. Modha, A low power, fully event-based gesture recognition system, in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (IEEE, 2017), pp. 7243–7252. [Google Scholar]
- 56.W. Fang, Z. Yu, Y. Chen, T. Masquelier, T. Huang, Y. Tian, in Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) (IEEE, 2021), pp. 2661–2671. [Google Scholar]
- 57.Y. Wu, L. Deng, G. Li, J. Zhu, Y. Xie, L. Shi, Direct training for spiking neural networks: Faster, larger, better. Proceedings of the AAAI Conference on Artificial Intelligence (AAAI) 33, 1311–1318 (2019). [Google Scholar]
- 58.A. Sengupta, Y. Ye, R. Wang, C. Liu, K. Roy, Going deeper in spiking neural networks: Vgg and residual architectures. Front. Neurosci. 13, 95 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 59.H. Zheng, Y. Wu, L. Deng, Y. Hu, G. Li, Going deeper with directly-trained larger spiking neural networks. Proceedings of the AAAI Conference on Artificial Intelligence (AAAI) 35, 11062–11070 (2021). [Google Scholar]
- 60.W. Fang, Z. Yu, Y. Chen, T. Huang, T. Masquelier, Y. Tian, Deep residual learning in spiking neural networks, in Advances in Neural Information Processing Systems (NeurIPS) (NeurIPS, 2021), p. 34. [Google Scholar]
- 61.Z. Zhou, Y. Zhu, C. He, Y. Wang, S. Yan, Y. Tian, L. Yuan, International Conference on Learning Representations (ICLR) (ICLR, 2023). [Google Scholar]
- 62.B. Han, G. Srinivasan, K. Roy, in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (IEEE, 2020), pp. 13558–13567. [Google Scholar]
- 63.B. Han, K. Roy, in European Conference on Computer Vision (ECCV) (ECCV, 2020), pp. 388–404. [Google Scholar]
- 64.S. Kim, S. Park, B. Na, S. Yoon, Spiking-YOLO: Spiking neural network for energy-efficient object detection, in Proceedings of the AAAI Conference on Artificial Intelligence (AAAI) (AAAI, 2020), vol. 34, pp. 11270–11277. [Google Scholar]
- 65.L. Cordone, B. Miramond, P. Thierion, Object detection with spiking neural networks on automotive event data. arXiv:2205.04339 (2022). 10.48550/arXiv.2205.04339. [DOI]
- 66.S. Barchid, J. Mennesson, J. Eshraghian, C. Djéraba, M. Bennamoun, Spiking neural networks for frame-based and event-based single object localization. arXiv:2206.06506 (2022). 10.48550/arXiv.2206.06506. [DOI]
- 67.K. Patel, E. Hunsberger, S. Batir, C. Eliasmith, A spiking neural network for image segmentation. arXiv:2106.0892 (2021). 10.48550/arXiv.2106.08921. [DOI]
- 68.C. M. Parameshwara, S. Li, C. Fermüller, N. J. Sanket, M. S. Evanusa, Y. Aloimonos, in 2021 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS) (IEEE, 2021), pp. 3414–3420. [Google Scholar]
- 69.U. Rançon, J. Cuadrado-Anibarro, B. R. Cottereau, T. Masquelier, Stereospike: Depth learning with a spiking neural network. arXiv:2109.13751 (2021). 10.48550/arXiv.2109.13751. [DOI]
- 70.C. Lee, A. K. Kosta, A. Z. Zhu, K. Chaney, K. Daniilidis, K. Roy, in European Conference on Computer Vision (ECCV) (Springer, 2020), pp. 366–382. [Google Scholar]
- 71.M. Abadi, P. Barham, J. Chen, Z. Chen, A. Davis, J. Dean, M. Devin, S. Ghemawat, G. Irving, M. Isard, M. Kudlur, J. Levenberg, R. Monga, S. Moore, D. G. Murray, B. Steiner, P. Tucker, V. Vasudevan, P. Warden, M. Wicke, Y. Yu, X. Zheng, in 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI 16) (OSDI, 2016), pp. 265–283. [Google Scholar]
- 72.F. Chollet, et al., Keras, https://keras.io (2015).
- 73.A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, A. Desmaison, A. Kopf, E. Yang, Z. DeVito, M. Raison, A. Tejani, S. Chilamkurthy, B. Steiner, L. Fang, J. Bai, S. Chintala, PyTorch: An imperative style, high-performance deep learning library, in Advances in Neural Information Processing Systems (NeurIPS), H. Wallach, H. Larochelle, A. Beygelzimer, F. d’Alché-Buc, E. B. Fox, R. Garnett, Eds. (Curran Associates Inc., 2019), pp. 8024–8035. [Google Scholar]
- 74.H. Ben Braiek, F. Khomh, B. Adams, in 2018 IEEE/ACM 15th International Conference on Mining Software Repositories (MSR) (IEEE, 2018), pp. 353–363. [Google Scholar]
- 75.N. T. Carnevale, M. L. Hines, The NEURON Book (Cambridge Univ. Press, 2010). [Google Scholar]
- 76.M.-O. Gewaltig, M. Diesmann, Nest (neural simulation tool). Scholarpedia 2, 1430 (2007). [Google Scholar]
- 77.D. Goodman, R. Brette, Brian: A simulator for spiking neural networks in python. Front. Neuroinform. 2, 5 (2008). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 78.M. Stimberg, R. Brette, D. F. Goodman, Brian 2, an intuitive and efficient neural simulator. eLife 8, e47314 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 79.H. Cornelis, A. L. Rodriguez, A. D. Coop, J. M. Bower, Python as a federation tool for genesis 3.0. PLOS ONE 7, e29018 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 80.T. Bekolay, J. Bergstra, E. Hunsberger, T. DeWolf, T. C. Stewart, D. Rasmussen, X. Choo, A. Voelker, C. Eliasmith, Nengo: A python tool for building large-scale functional brain models. Front. Neuroinform. 7, 48 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 81.M. Mozafari, M. Ganjtabesh, A. Nowzari-Dalini, T. Masquelier, Spyketorch: Efficient simulation of convolutional spiking neural networks with at most one spike per neuron. Front. Neurosci. 13, 625 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 82.H. Hazan, D. J. Saunders, H. Khan, D. Patel, D. T. Sanghavi, H. T. Siegelmann, R. Kozma, Bindsnet: A machine learning-oriented spiking neural networks library in python. Front. Neuroinform. 12, 89 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 83.P. Lichtsteiner, C. Posch, T. Delbruck, A 128×128 120 dB 15 μs latency asynchronous temporal contrast vision sensor. IEEE J. Solid-State Circuits 43, 566–576 (2008). [Google Scholar]
- 84.C. Posch, D. Matolin, R. Wohlgenannt, A qvga 143 db dynamic range frame-free pwm image sensor with lossless pixel-level video compression and time-domain cds. IEEE J. Solid-State Circuits 46, 259–275 (2011). [Google Scholar]
- 85.C. Brandli, R. Berner, M. Yang, S.-C. Liu, T. Delbruck, A 240 × 180 130 dB 3 μs latency global shutter spatiotemporal vision sensor. IEEE J. Solid-State Circuits 49, 2333–2341 (2014). [Google Scholar]
- 86.C. R. Harris, K. J. Millman, S. J. van der Walt, R. Gommers, P. Virtanen, D. Cournapeau, E. Wieser, J. Taylor, S. Berg, N. J. Smith, R. Kern, M. Picus, S. Hoyer, M. H. van Kerkwijk, M. Brett, A. Haldane, J. F. del Río, M. Wiebe, P. Peterson, P. Gérard-Marchant, K. Sheppard, T. Reddy, W. Weckesser, H. Abbasi, C. Gohlke, T. E. Oliphant, Array programming with numpy. Nature 585, 357–362 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 87.K. He, X. Zhang, S. Ren, J. Sun, in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (IEEE, 2016), pp. 770–778. [Google Scholar]
- 88.Y. Li, S. Deng, X. Dong, R. Gong, S. Gu, in International Conference on Machine Learning (ICML) (ICML, 2021), vol. 139, pp. 6316–6325. [Google Scholar]
- 89.Y. Hu, H. Tang, Y. Wang, G. Pan, Spiking deep residual network. arXiv:1805.01352 (2018). 10.48550/arXiv.1805.01352. [DOI]
- 90.C. Pehle, J. E. Pedersen, Norse—A deep learning library for spiking neural networks (2021). Documentation: https://norse.ai/docs/.
- 91.J. K. Eshraghian, M. Ward, E. Neftci, X. Wang, G. Lenz, G. Dwivedi, M. Bennamoun, D. S. Jeong, W. D. Lu, Training spiking neural networks using lessons from deep learning. arXiv:2109.12894 (2021). 10.48550/arXiv.2109.12894. [DOI] [Google Scholar]
- 92.W. Gerstner, W. M. Kistler, R. Naud, L. Paninski, Neuronal Dynamics: From Single Neurons to Networks and Models of Cognition (Cambridge Univ. Press, 2014). [Google Scholar]
- 93.D. Lew, K. Lee, J. Park, in Proceedings of the 59th ACM/IEEE Design Automation Conference (IEEE, 2022), pp. 265–270. [Google Scholar]
- 94.N. Rathi, K. Roy, Diet-snn: A low-latency spiking neural network with direct input encoding and leakage and threshold optimization, in IEEE Transactions on Neural Networks and Learning Systems (IEEE, 2021), pp. 1–9. [DOI] [PubMed] [Google Scholar]
- 95.J. Ding, Z. Yu, Y. Tian, T. Huang, Optimal ann-snn conversion for fast and accurate inference in deep spiking neural networks. arXiv:2105.11654 (2021). 10.48550/arXiv.2105.11654. [DOI]
- 96.G. Orchard, A. Jayawant, G. K. Cohen, N. Thakor, Converting static image datasets to spiking neuromorphic datasets using saccades. Front. Neurosci. 9, 437 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 97.Y. Lin, W. Ding, S. Qiang, L. Deng, G. Li, Es-imagenet: A million event-stream classification dataset for spiking neural networks. Front. Neurosci. 15, 726582 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 98.H. Fang, A. Shrestha, Z. Zhao, Q. Qiu, in Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence (IJCAI), C. Bessiere, Ed. (International Joint Conferences on Artificial Intelligence Organization, 2020), pp. 2799–2806. [Google Scholar]
- 99.J. Kaiser, H. Mostafa, E. Neftci, Synaptic plasticity dynamics for deep continuous local learning (decolle). Front. Neurosci. 14, 424 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 100.G. Abad, O. Ersoy, S. Picek, V. J. Ramírez-Durán, A. Urbieta, in Proceedings of the 2022 ACM SIGSAC Conference on Computer and Communications Security (ACM, 2022), pp. 3315–3317. [Google Scholar]
- 101.G. Abad, O. Ersoy, S. Picek, A. Urbieta, Sneaky spikes: Uncovering stealthy backdoor attacks in spiking neural networks with neuromorphic data. arXiv:2302.06279 (2023). 10.48550/arXiv.2302.06279. [DOI]
- 102.T. Bu, W. Fang, J. Ding, P. Dai, Z. Yu, T. Huang, International Conference on Learning Representations (ICLR) (ICLR, 2021). [Google Scholar]
- 103.T. Bu, J. Ding, Z. Yu, T. Huang, Optimized potential initialization for low-latency spiking neural networks. arXiv:2202.01440 (2022). 10.48550/arXiv.2202.01440. [DOI]
- 104.J. Tang, J. Lai, X. Xie, L. Yang, W.-S. Zheng, Snn2ann: A fast and memory-efficient training framework for spiking neural networks. arXiv preprint arXiv:2206.09449 (2022).
- 105.Z. Hao, T. Bu, J. Ding, T. Huang, Z. Yu, Reducing ann-snn conversion error through residual membrane potential. arXiv:2302.02091 (2023). 10.48550/arXiv.2302.02091. [DOI]
- 106.Z. Hao, J. Ding, T. Bu, T. Huang, Z. Yu, International Conference on Learning Representations (ICLR) (ICLR, 2023). [DOI] [PubMed] [Google Scholar]
- 107.R.-J. Zhu, Q. Zhao, T. Zhang, H. Deng, Y. Duan, M. Zhang, L.-J. Deng, Tcja-snn: Temporal-channel joint attention for spiking neural networks. arXiv:2206.10177 (2022). 10.48550/arXiv.2206.10177. [DOI] [PubMed]
- 108.M. Yao, G. Zhao, H. Zhang, Y. Hu, L. Deng, Y. Tian, B. Xu, G. Li, Attention spiking neural networks. IEEE Trans. Pattern Anal. Mach. Intell., 9393–9410 (2023). [DOI] [PubMed] [Google Scholar]
- 109.X. Wu, W. He, M. Yao, Z. Zhang, Y. Wang, G. Li, Mss-depthnet: Depth prediction with multi-step spiking neural network. arXiv:2211.12156 (2022). 10.48550/arXiv.2211.12156. [DOI]
- 110.B. Gong, C. Wei, H. Yang, Z. Yu, L. Wang, L. Xiong, R. Xiong, Z. Lu, Y. Zhang, Q. Liu, Control and regulation of skyrmionic topological charge in a novel synthetic antiferromagnetic nanostructure. Nanoscale 15, 5257–5264 (2023). [DOI] [PubMed] [Google Scholar]
- 111.B. Wang, G. Dong, Y. Zhao, R. Li, H. Yang, W. Yin, L. Liang, Spiking emotions: Dynamic vision emotion recognition using spiking neural networks, in International Conference on Algorithms, High Performance Computing and Artificial Intelligence (AHPCAI, 2022). [Google Scholar]
- 112.E. Lemaire, L. Cordone, A. Castagnetti, P.-E. Novac, J. Courtois, B. Miramond, An analytical estimation of spiking neural networks energy efficiency. arXiv:2210.13107 (2022). 10.48550/arXiv.2210.13107. [DOI]
- 113.L. Zhu, X. Wang, Y. Chang, J. Li, T. Huang, Y. Tian, in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (IEEE, 2022), pp. 3594–3604. [Google Scholar]
- 114.Z. Xu, Y. Ma, Z. Pan, X. Zheng, Deep spiking residual shrinkage network for bearing fault Diagnosis. Cybernetics, 1–6 (2022). [DOI] [PubMed] [Google Scholar]
- 115.S. Li, L. Gong, T. Wang, C. Wang, X. Zhou, in 12th International Symposium on Parallel Architectures, Algorithms and Programming (IEEE, 2021), pp. 14–18. [Google Scholar]
- 116.M. A.-A. Kaiser, G. Datta, Z. Wang, A. P. Jacob, P. A. Beerel, A. R. Jaiswal, Neuromorphic-p2m: Processing-in-pixel-in-memory paradigm for neuromorphic image sensors. arXiv:2301.09111 (2023). 10.48550/arXiv.2301.09111. [DOI] [PMC free article] [PubMed]
- 117.J. Fu, S. Gou, Z. Guo, in Intelligence Science IV, Z. Shi, Y. Jin, X. Zhang, Eds. (Springer International Publishing, 2022), pp. 37–44. [Google Scholar]
- 118.Y. Han, T. Yu, S. Cheng, J. Xu, Cascade spiking neuron network for event-based image classification in noisy environment. TechRxiv (2021).
- 119.A. Vicente-Sola, D. L. Manna, P. Kirkland, G. Di Caterina, T. Bihl, Keys to accurate feature extraction using residual spiking neural networks. arXiv:2111.05955 (2021). 10.48550/arXiv.2111.05955. [DOI]
- 120.Y. Li, Y. Lei, X. Yang, Spikeformer: A novel architecture for training high-performance low-latency spiking neural network. arXiv:2211.10686 (2022). 10.48550/arXiv.2211.10686. [DOI]
- 121.C. Yu, Z. Gu, D. Li, G. Wang, A. Wang, E. Li, Stsc-snn: Spatio-temporal synaptic connection with temporal convolution and attention for spiking neural networks. arXiv:2210.05241 (2022). 10.48550/arXiv.2210.05241. [DOI] [PMC free article] [PubMed]
- 122.C. Jin, R.-J. Zhu, X. Wu, L.-J. Deng, Sit: A bionic and non-linear neuron for spiking neural network. arXiv:2203.16117 (2022). 10.48550/arXiv.2203.16117. [DOI]
- 123.J. Tang, J.-H. Lai, W.-S. Zheng, L. Yang, X. Xie, Relaxation lif: A gradient-based spiking neuron for direct training deep spiking neural networks. Neurocomputing 501, 499–513 (2022). [Google Scholar]
- 124.X. Wu, Y. Zhao, Y. Song, Y. Jiang, Y. Bai, X. Li, Y. Zhou, X. Yang, Q. Hao, Dynamic threshold integrate and fire neuron model for low latency spiking neural networks. Available at SSRN 4179879.
- 125.H. Wang, Y.-F. Li, Bioinspired membrane learnable spiking neural network for autonomous vehicle sensors fault diagnosis under open environments. Reliab. Eng. Syst. Safety 233, 109102 (2023). [Google Scholar]
- 126.I. Hammouamri, T. Masquelier, D. G. Wilson, Mitigating catastrophic forgetting in spiking neural networks through threshold modulation. Transactions on Machine Learning Research, (2022). [Google Scholar]
- 127.X. Yao, F. Li, Z. Mo, J. Cheng, Advances in Neural Information Processing Systems (NeurIPS), A. H. Oh, A. Agarwal, D. Belgrave, K. Cho, Eds. (NeurIPS, 2022). [Google Scholar]
- 128.S. R. Kheradpisheh, M. Mirsadeghi, T. Masquelier, Spiking neural networks trained via proxy. IEEE Access 10, 70769–70778 (2022). [Google Scholar]
- 129.Q. Meng, M. Xiao, S. Yan, Y. Wang, Z. Lin, Z.-Q. Luo, in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (IEEE, 2022), pp. 12444–12453. [Google Scholar]
- 130.Y. Zhou, Y. Jin, Y. Sun, J. Ding, Surrogate-assisted cooperative co-evolutionary reservoir architecture search for liquid state machines. Comput. Intell., 1–15 (2023). [Google Scholar]
- 131.X. Lin, Z. Zhang, D. Zheng, Supervised learning algorithm based on spike train inner product for deep spiking neural networks. Brain Sci. 13, (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 132.Q. Zhan, G. Liu, X. Xie, M. Zhang, G. Sun, Bio-inspired active learning method in spiking neural network. Knowl. Based Syst. 261, 110193 (2023). [Google Scholar]
- 133.S. Lucas, E. Portillo, A. Zubizarreta, I. Cabanes, in Entrenamiento supervisado de redes neuronales de impulsos (Servizo de Publicacións, 2022), pp. 216–223. [Google Scholar]
- 134.G. Chen, P. Peng, G. Li, Y. Tian, Training full spike neural networks via auxiliary accumulation pathway. arXiv preprint arXiv:2301.11929 (2023). 10.48550/arXiv.2301.11929. [DOI]
- 135.C. Duan, J. Ding, S. Chen, Z. Yu, T. Huang, Advances in Neural Information Processing Systems (NeurIPS), A. H. Oh, A. Agarwal, D. Belgrave, K. Cho, Eds. (NeurIPS, 2022). [Google Scholar]
- 136.Q. Yang, J. Wu, M. Zhang, Y. Chua, X. Wang, H. Li, Advances in Neural Information Processing Systems (NeurIPS), A. H. Oh, A. Agarwal, D. Belgrave, K. Cho, Eds. (NeurIPS, 2022). [Google Scholar]
- 137.M. Xiao, Q. Meng, Z. Zhang, D. He, Z. Lin, Advances in Neural Information Processing Systems (NeurIPS), A. H. Oh, A. Agarwal, D. Belgrave, K. Cho, Eds. (NeurIPS, 2022). [Google Scholar]
- 138.Z. Zheng, X. Jia, Label distribution learning via implicit distribution representation. arXiv preprint arXiv:2209.13824 (2022).
- 139.Y. Feng, S. Geng, J. Chu, Z. Fu, S. Hong, Building and training a deep spiking neural network for ecg classification. Biomed. Signal Process. Control 77, 103749 (2022). [Google Scholar]
- 140.Y. Xing, L. Zhang, Z. Hou, X. Li, Y. Shi, Y. Yuan, F. Zhang, S. Liang, Z. Li, L. Yan, Accurate ecg classification based on spiking neural network and attentional mechanism for real-time implementation on personal portable devices. Electronics 11, 1889 (2022). [Google Scholar]
- 141.Y. Chen, Z. Yu, W. Fang, T. Huang, Y. Tian, in Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence (IJCAI), Z.-H. Zhou, Ed. (International Joint Conferences on Artificial Intelligence Organization, 2021), pp. 1713–1721. [Google Scholar]
- 142.F. Liu, W. Zhao, Y. Chen, Z. Wang, F. Dai, in IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP) (IEEE, 2022), pp. 2130–2134. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 143.Y. Chen, Z. Yu, W. Fang, Z. Ma, T. Huang, Y. Tian, in International Conference on Machine Learning (ICML) (PMLR, 2022), pp. 3701–3715. [Google Scholar]
- 144.Y. Kim, Y. Li, H. Park, Y. Venkatesha, R. Yin, P. Panda, Lottery ticket hypothesis for spiking neural networks. arXiv preprint arXiv:2207.01382 (2022).
- 145.Y. Chen, Z. Ma, W. Fang, X. Zheng, Z. Yu, Y. Tian, International Conference on Learning Representations (ICLR, 2023). [Google Scholar]
- 146.B. Na, J. Mok, S. Park, D. Lee, H. Choe, S. Yoon, Autosnn: Towards energy-efficient spiking neural networks. arXiv preprint arXiv:2201.12738 (2022).
- 147.Y. Kim, Y. Li, H. Park, Y. Venkatesha, P. Panda, Neural architecture search for spiking neural networks. arXiv preprint arXiv:2201.10355 (2022).
- 148.Y. Li, Y. Kim, H. Park, T. Geller, P. Panda, Neuromorphic data augmentation for training spiking neural networks. arXiv preprint arXiv:2203.06145 (2022).
- 149.R.-J. Zhu, Q. Zhao, J. K. Eshraghian, Spikegpt: Generative pre-trained language model with spiking neural networks. arXiv preprint arXiv:2302.13939 (2023).
- 150.S. Xiang, T. Zhang, S. Jiang, Y. Han, Y. Zhang, C. Du, X. Guo, L. Yu, Y. Shi, Y. Hao, Spiking siamfc++: Deep spiking neural network for object tracking. arXiv preprint arXiv:2209.12010 (2022).
- 151.Y. Xiong, Y. Chen, C. Chen, X. Wei, Y. Xue, H. Wan, P. Wang, An odor recognition algorithm of electronic noses based on convolutional spiking neural network for spoiled food identification. J. Electrochem. Soc. 168, 077519 (2021). [Google Scholar]
- 152.J. Cuadrado, U. Rançon, B. Cottereau, F. Barranco, T. Masquelier, Optical flow estimation with event-based cameras and spiking neural networks. arXiv preprint arXiv:2302.06492 (2023). [DOI] [PMC free article] [PubMed]
- 153.G. Liu, W. Deng, X. Xie, L. Huang, H. Tang, Human-level control through directly-trained deep spiking q-networks. arXiv preprint arXiv:2201.07211 (2021). [DOI] [PubMed]
- 154.D. Chen, P. Peng, T. Huang, Y. Tian, Deep reinforcement learning with spiking q-learning. arXiv preprint arXiv:2201.09754 (2022).
- 155.L. Qin, R. Yan, H. Tang, A low latency adaptive coding spiking framework for deep reinforcement learning. arXiv preprint arXiv:2211.11760 (2022).
- 156.M. Wang, J. Li, M. Ma, X. Fan, Snn-sc: A spiking semantic communication framework for classification. arXiv preprint arXiv:2210.06836 (2022).
- 157.A. Morrison, M. Diesmann, W. Gerstner, Phenomenological models of synaptic plasticity based on spike timing. Biol. Cybern. 98, 459–478 (2008). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 158.G. Brockman, V. Cheung, L. Pettersson, J. Schneider, J. Schulman, J. Tang, W. Zaremba, OpenAI gym (2016).
- 159.R. Wightman, H. Touvron, H. Jégou, Resnet strikes back: An improved training procedure in timm (2021).
- 160.R. Yuan, Q. Duan, P. J. Tiw, G. Li, Z. Xiao, Z. Jing, K. Yang, C. Liu, C. Ge, R. Huang, Y. Yang, A calibratable sensory neuron based on epitaxial vo2 for spike-based neuromorphic multisensory system. Nat. Commun. 13, 1–12 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 161.X. Li, Z. Feng, J. Zou, X. Wang, G. Hu, F. Wang, C. Ding, Y. Zhu, F. Yang, Z. Wu, Y. Dai, A model of taox threshold switching memristor for neuromorphic computing. J. Appl. Phys. 132, 064904 (2022). [Google Scholar]
- 162.A. L. Hodgkin, A. F. Huxley, A quantitative description of membrane current and its application to conduction and excitation in nerve. J. Physiol. 117, 500–544 (1952). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 163.E. M. Izhikevich, Simple model of spiking neurons. IEEE Trans. Neural Netw. 14, 1569–1572 (2003). [DOI] [PubMed] [Google Scholar]
- 164.E. Ledinauskas, J. Ruseckas, A. Juršėnas, G. Buračas, Training deep spiking neural networks. arXiv preprint arXiv:2006.04436 (2020).
- 165.J. H. Lee, T. Delbruck, M. Pfeiffer, Training deep spiking neural networks using backpropagation. Front. Neurosci. 10, 508 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 166.C. Lee, S. S. Sarwar, P. Panda, G. Srinivasan, K. Roy, Enabling spike-based backpropagation for training deep neural network architectures. Front. Neurosci. 14, 1 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 167.T. Gollisch, M. Meister, Rapid neural coding in the retina with relative spike latencies. Science 319, 1108–1111 (2008). [DOI] [PubMed] [Google Scholar]
- 168.J. Kim, H. Kim, S. Huh, J. Lee, K. Choi, Deep neural networks with weighted spikes. Neurocomputing 311, 373–386 (2018). [Google Scholar]
- 169.L. R. Iyer, Y. Chua, H. Li, Is neuromorphic mnist neuromorphic? analyzing the discriminative power of neuromorphic datasets in the time domain. Front. Neurosci. 15, 608567 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 170.Y. Bi, A. Chadha, A. Abbas, E. Bourtsoulatze, Y. Andreopoulos, Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV, 2019). [Google Scholar]
- 171.H. Li, H. Liu, X. Ji, G. Li, L. Shi, Cifar10-dvs: An event-stream dataset for object classification. Front. Neurosci. 11, 309 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 172.X. Wang, Z. Wu, B. Jiang, Z. Bao, L. Zhu, G. Li, Y. Wang, Y. Tian, Hardvs: Revisiting human activity recognition with dynamic vision sensors. arXiv preprint arXiv:2211.09648 (2022).
- 173.J.-M. Maro, S.-H. Ieng, R. Benosman, Event-based gesture recognition with dynamic background suppression using smartphone computational capabilities. Front. Neurosci. 14, 275 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 174.B. Cramer, Y. Stradmann, J. Schemmel, F. Zenke, The heidelberg spiking data sets for the systematic evaluation of spiking neural networks. IEEE Transact. Neural Netw. Learn. Syst. 33, 2744–2757 (2022). [DOI] [PubMed] [Google Scholar]
- 175.Y. Wu, R. Zhao, J. Zhu, F. Chen, M. Xu, G. Li, S. Song, L. Deng, G. Wang, H. Zheng, S. Ma, J. Pei, Y. Zhang, M. Zhao, L. Shi, Brain-inspired global-local learning incorporated with neuromorphic computing. Nat. Commun. 13, 1–14 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 176.R. Nishino, S. H. C. Loomis, Cupy: A numpy-compatible library for nvidia gpu calculations. Adv Neural Inform Process Syst (NeurIPS) 151, 1 (2017). [Google Scholar]
- 177.F. Zenke, T. P. Vogels, The remarkable robustness of surrogate gradient learning for instilling complex function in spiking neural networks. bioRxiv (2020). [DOI] [PubMed]
- 178.B. Yin, F. Corradi, S. M. Bohte, Accurate and efficient time-domain classification with adaptive spiking recurrent neural networks. Nature Machine Intelligence 3, 905–913 (2021). [Google Scholar]
- 179.R. V. Florian, Reinforcement learning through modulation of spike-timing-dependent synaptic plasticity. Neural Comput. 19, 1468–1502 (2007). [DOI] [PubMed] [Google Scholar]
- 180.S. Park, S. Kim, B. Na, S. Yoon, Proceedings of the 57th ACM/EDAC/IEEE Design Automation Conference, DAC’20 (IEEE, 2020). [Google Scholar]
- 181.Y. Zhu, Z. Yu,W. Fang, X. Xie, T. Huang, T. Masquelier, Advances in Neural Information Processing Systems, A. H. Oh, A. Agarwal, D. Belgrave, K. Cho, Eds. (2022).
- 182.A. Rao, P. Plank, A. Wild, W. Maass, A long short-term memory for ai applications in spike-based neuromorphic hardware. Nature Machine Intelligence 4, 467–479 (2022). [Google Scholar]
- 183.S. Kim, S. Kim, S. Hong, S. Kim, D. Han, H.-J. Yoo, in 2023 IEEE International Solid-State Circuits Conference (ISSCC) (IEEE, 2023), pp. 334–336. [Google Scholar]
- 184.M. Chang, A. S. Lele, S. D. Spetalnick, B. Crafton, S. Konno, Z. Wan, A. Bhat, W.-S. Khwa, Y.-D. Chih, M.-F. Chang, A. Raychowdhury, in 2023 IEEE International Solid-State Circuits Conference (ISSCC) (IEEE, 2023), pp. 426–428. [Google Scholar]
- 185.G. Bellec, D. Salaj, A. Subramoney, R. Legenstein, W. Maass, Long short-term memory and learning-to-learn in networks of spiking neurons. Advances in neural information processing systems 31 (2018).
- 186.W. Ponghiran, K. Roy, Proceedings of the AAAI Conference on. Artificial Intelligence 36, 8001–8008 (2022). [Google Scholar]
- 187.Y. Bengio, N. Leonard, A. Courville, Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432 (2013).
- 188.I. Loshchilov, F. Hutter, Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983 (2016).
- 189.A. Shymyrbay, M. E. Fouda, A. Eltawil, Low precision quantization-aware training in spiking neural networks with differentiable quantization function. arXiv preprint arXiv:2305.19295 (2023).
- 190.G. Tang, N. Kumar, R. Yoo, K. Michmizos, in Conference on Robot Learning (PMLR, 2021), pp. 2016–2029. [Google Scholar]
- 191.S. Fujimoto, H. Hoof, D. Meger, in International Conference on Machine Learning (PMLR, 2018), pp. 1587–1596. [Google Scholar]
- 192.L. Huang, Z. Ma, L. Yu, H. Zhou, Y. Tian. Deep spiking neural networks with high representation similarity model visual pathways of macaque and mouse, in Proceedings of the AAAI Conference on Artificial Intelligence (AAAI, 2023), vol. 37, pp. 31–39. [Google Scholar]
- 193.C. Choy, J. Gwak, S. Savarese, in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (IEEE, 2019), pp. 3075–3084. [Google Scholar]
- 194.D. Zhang, T. Zhang, S. Jia, B. Xu, in Proceedings of the AAAI Conference on Artificial Intelligence (AAAI, 2022), vol. 36, pp. 59–67. [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Supplementary Information
Figs. S1 to S28
Tables S1 and S2
References