{'fraction_non_alphanumeric': 0.03662721479095175, 'fraction_numerical': 0.012909400751686626, 'mean_word_length': 4.6806789550457495, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
LIAF-Net: Leaky Integrate and Analog Fire Network for Lightweight and Efficient Spatiotemporal Information Processing

Spiking neural networks (SNNs) based on Leaky Integrate and Fire (LIF) model have been applied to energy-efficient temporal and spatiotemporal processing tasks. Thanks to the bio-plausible neuronal dynamics and simplicity, LIF-SNN benefits from event-driven processing, however, usually faces the embarrassment of reduced performance. This may because in LIF-SNN the neurons transmit information via spikes. To address this issue, in this work, we propose a Leaky Integrate and Analog Fire (LIAF) neuron model, so that analog values can be transmitted among neurons, and a deep network termed as LIAF-Net is built on it for efficient spatiotemporal processing. In the temporal domain, LIAF follows the traditional LIF dynamics to maintain its temporal processing capability. In the spatial domain, LIAF is able to integrate spatial information through convolutional integration or fully-connected integration. As a spatiotemporal layer, LIAF can also be used with traditional artificial neural network (ANN) layers jointly. Experiment results indicate that LIAF-Net achieves comparable performance to Gated Recurrent Unit (GRU) and Long short-term memory (LSTM) on bAbI Question Answering (QA) tasks, and achieves state-of-the-art performance on spatiotemporal Dynamic Vision Sensor (DVS) datasets, including MNIST-DVS, CIFAR10-DVS and DVS128 Gesture, with much less number of synaptic weights and computational overhead compared with traditional networks built by LSTM, GRU, Convolutional LSTM (ConvLSTM) or 3D convolution (Conv3D). Compared with traditional LIF-SNN, LIAF-Net also shows dramatic accuracy gain on all these experiments. In conclusion, LIAF-Net provides a framework combining the advantages of both ANNs and SNNs for lightweight and efficient spatiotemporal information processing.


I. INTRODUCTION
I N recent years, Leaky Integrate and Fire (LIF) neuron models have been investigated deeply [1] [2] [3]. Benefited from its bio-plausible neuronal dynamics and simplicity, LIF has been employed to simulate spiking neural networks (SNNs) and applied in scenarios of energy efficient temporal and spatiotemporal processing [3] [4] [5] [6] [7]. A large range of applications have been demonstrated including image classification [8], video processing [9] [10], posture and gesture recognition [11], [12], voice recognition [13], etc. Many neuromorphic chips are specifically designed for implementing LIF model based SNNs (termed as LIF-SNN) with high energy efficiency [14] [15] [16]. In LIF-SNN, however, for each time step the information transmitted between two neurons can only be spike or nothing, and it is usually denoted as a binary value for simplicity. Since a binary value has less accuracy compared with an analog value, LIF-SNNs deployed on neuromorphic chips usually face the embarrassment of drop in performance.
Note that, although the communication scheme in LIF models with spike works efficiently in biological SNNs, it is not difficult to transmit an analog value instead of a binary spike for neuromorphic chips, just like the artificial neurons in deep Artificial Neural Networks (ANNs). On the other hand, the structure and neuronal dynamics in artificial neurons in ANNs are greatly simplified, resulting in a lack of ability in capturing the effects of membrane potential accumulating, action potential generation and membrane resetting, and these dynamic procedures are essential for temporal information processing. Some artificial neural networks such as Long Short-Term Memory (LSTM) [17] and Gated Recurrent Unit (GRU) [18] are skill at processing temporal information, which use recurrent connections and hidden state updates. These networks rely on gating instead of threshold firing. These gate signals require extra neuronal connections and weights than biology threshold-oriented mechanism.
Thus, the key motivation is as follows: Is there any solution available that enables lightweight spatiotemporal processing to benefit from bio-plausible temporal processing mechanism, whereas keeps rich communication capability through analog values among neurons? In such case, how the spatiotemporal capability and efficiency can be attained?
To address these problems, two fundamental issues have to be solved. The first issue is that it is not always convenient to use spike trains as input and output for a neural network layer. On the one hand, most of the images and videos in current digital devices are represented as analog or multi-valued pixels. When process input data by LIF, a spike generator [19] or edge detector [20] has to be applied. Extra modules may be required for color processing [21]. These modules introduce additional cost if SNN being applied in computer vision applications. On the other hand, in recent years, many newly introduced ANN layers are applied for building deep neural networks. Such as arXiv:2011.06176v1 [cs.LG] 12 Nov 2020 pooling [22], residual connection [23], varieties of activations (ReLU [22], PReLU [24]), and normalization alternatives (Batch normalization [25], Layer normalization [26]). It is a pity that current SNNs rarely use these mechanisms for network construction, mostly due to the activation format difference (spike versus analog), therefore a coding format converter is necessary [15]. These converters make building a mixed network with LIF layer and ANN layers not efficient. Regarding this issue, including the redundancy of introducing sensor data converter and inconvenience of using ANN layer, we are motivated to design a more friendly interface for LIF.
The second issue is how to avoid performance degradation when implementing simple and bio-plausible LIF-SNNs [27]. For example, the performance of LIF-SNN is not as good as the ANN counterparts either through ANN-SNN conversion [28] or training directly [29], mostly due to the spiking (binary activation) [30]. Although it can be compensated by a temporal coding scheme and using longer temporal time steps (more than 100 [29]). To increase the accuracy, more time steps are required [31] whereas more synaptic integration computation would be consumed. For instance, a time interval higher than ten is necessary for a counterbalanced performance on recognizing a CIFAR-10 image compared with pure ANN with the same network topology [32], which makes the computational complexity one or several orders of magnitude higher when event-driven is not enabled. For event-driven case, it still not easy to reach the equivalent computation workload as ANN when the spike is not sparse enough (reach 1% sparsity for 100 time steps, then SNN has equivalent dendritic workload to ANN).
Motivated by the above-mentioned issues, in this work, we try to overcome the shortcomings of traditional LIF and propose a refined LIF model, which enhances the information transmission capability, maintains the LIF temporal dynamics, enables the friendly integration with ANNs and vision sensors, and maintains the spatial performance with limited time intervals. We propose a Leaky Integrate and Analog Fire (LIAF) neuron model and build a deep neural network based on LIAF, termed as LIAF-Net, for efficient spatiotemporal processing. To allow more information transmitted among neurons, LIAF-Net uses analog values to represent neural activations instead of the traditional binary values in LIF-SNN. In the temporal domain, LIAF keeps traditional LIF dynamics and this enables its temporal processing capability. In the spatial domain, since the LIAF data format is fully compatible with traditional ANNs, LIAF-Net can be built with LIAF and other ANN layers together easily. Thus, deep learning designers can use training framework like Tensorflow to build such network, just considering LIAF as a spatiotemporal layer like 3D Convolution (Conv3D) or Convolutional LSTM (ConvLSTM).
For verifying the performance of LIAF-Nets, we have conducted several experiments on various temporal and spatiotemporal datasets and compared them with traditional networks. The experimental results show that LIAF-Net reaches comparable performance to the networks built by GRU, LSTM on the bAbI Question Answering (QA) tasks with much less storage and computational cost than GRU or LSTM network. LIAF-Nets also reach state-of-the-art performance on several spa-tiotemporal Dynamic Vision Sensor (DVS) datasets, including MNIST-DVS, CIFAR10-DVS and DVS128 Gesture with much less number of synaptic weights and computational overhead compared to ConvLSTM network or Conv3D network. We compared the network structure of LIAF and several recurrent models and reveals that neither input gate nor output gate is used in LIAF, and therefore huge power for storage and computation can be avoided. In conclusion, LIAF-Net provides a framework combining the advantages of both ANNs and SNNs for lightweight and efficient spatiotemporal information processing.
The paper is organized as follows. In Section II, the model description of the proposed LIAF is introduced. The relationships of LIAF with Perceptron, Convolution, RNN model and LIF are discussed. Also, the way for integrating LIAF layer with other ANN layers is proposed. In Section III, the training algorithm is discussed. In Section IV and Section V LIAF is compared with traditional models to show its lightweight characteristic. In Section VI, the performance of LIAF-Net is evaluated and compared with other traditional networks, which reveals the computational efficiency and outstanding spatiotemporal processing capability of LIAF-Net. In Section VII, the bio-plausibility of LIAF and analog valued neural models are discussed. Finally, Section VIII concludes the paper.

A. Evolution from ANN and SNN models
The proposed LIAF model is quiet similar to the LIF model. It has a similar dendritic integration process, temporal dynamics including threshold compare and fire, and membrane potential reset. However, it receives analog input and outputs analog activations, illustrated in Fig.1. Different from LIF, the fire signal in LIAF is only used for resetting the membrane potential, therefore the membrane potential updates like the LIF model, whereas the output activations are calculated from the membrane potential through an activation function.

B. Mathematical description of the LIAF model
The original LIF model is described in a differential function [33] [30] to reveal the neuronal dynamic, following equation where τ is the timing factor of the neuron, V reset is the reset potential. X i (t) is the input signal (spike or none) from the ith neuron connecting to the current neuron through a synapse with strength W i . When V (t) reaches a certain threshold V th , a spike is emitted, and the V (t) is reset to its initial value V reset . We use an iterative representation in discrete-time [34] [35] for easily inference and training. We present LIF and LIAF neuron model together for comparing as follows. a). Synaptic Integration for dense; Conv(X t , W ), for convolution; for integration-free. ( where X t stands for the activations from the pre-synaptic neuron, W refers to the synaptic weights. The synaptic integration can be exist in fully connected format or convolutional format. b). Accumulates with previous membrane potential where V t−1 m and U t m refer to the previous and current membrane potential respectively. c). Compare with the threshold and fire where F t is the fire signal. For each F t j in F t , F t j = 1 indicates a firing event, otherwise F t j = 0. d). Reset the membrane potential when fired e). Perform leakage where α and β represent the multiplicative decay and additive decay respectively. f). Output for LIF; f (U t m , V th ), for LIAF. (7) f (x, V th ) is the analog activation function. It can be threshold related (TR mode) or not (NTR mode), which follows In the following illustrations, we term LIAF/LIF with dense integration, convolutional integration, and integrationfree as DenseLIAF/DenseLIF, ConvLIAF/ConvLIF and Di-rectLIAF/DirectLIF respectively. The 'Conv' mentioned here is the 2D Convolution (Conv2D). In addition, units in V th , V reset , α and β may vary for each convolutional channel (the neurons within a channel share a unique value), or vary for each neuron, or the same for all neurons, are termed as Channel-Sharing mode, Non-Sharing mode and All-Sharing mode, respectively. We avoid using Non-Sharing mode in ConvLIAF/ConvLIF in our experiments for saving parameter storage. We also would like to note that the term 'model' is equivalent to a 'layer' using the model in a network.

C. Model degradation
In this part, we compare LIAF to LIF, perceptron, convolution, and traditional recurrent neural network (RNN) models.
(1). Relationship to LIF: If Act(x) is a Heaviside step function (Act(x) = V ≥ V th ), then LIAF will degrade to LIF.
(2). Relationship to perceptron or convolution: If we set α = 0 and β = 0, then all the temporal information is missing and LIAF will degrade to perceptron or Conv2D.
(3). Relationship to RNN model: We rewrite the LIAF as which can be viewed as a high order recurrent neural network because of the term S(U l,t−1 . Therefore it consists of more non-linear features compared with traditional RNNs. The comparison with traditional RNN models (LSTM and GRU) is discussed in Section IV. In conclusion, the proposed model has the equivalent expressional capability to both ANN perceptron/convolution model and the LIF model.

D. Easily integration with ANN layers
Compared to LIF, a LIAF layer can be more easily integrated with traditional ANN layers easily. As depicted in Fig.2. For video or frame sequence processing, the inter-layer interface of ConvLIAF/Conv3D/ConvLSTM is a 5D tensor in size (B, T, H, W, L), representing batch size, time steps, height, width, and feature maps respectively. The interface of LIAF/LSTM/GRU is a 3D tensor in size (B, T, L), where L is the number of neurons (hidden size). Therefore LIAF and other ANN layers share the same data format and interface  format, which makes their integration easily, just considering LIAF as a spatiotemporal layer similar to Conv3D or ConvLSTM. On the contrary, LIF requires a spike train to represent a multi-valued pixel or an analog activation in a single time step, otherwise only binary value is allowed. Therefore, when accepting analog values from ANN layers or from image/video sensor, a converter from analog value to spike train is necessary. In addition, the spike train fired by LIF may need to be converted to an analog value to communicate with the subsequent ANN layer.

III. TRAINING THE LIAF-NET
The LIAF-Net can be trained with Back Propagation Through Time (BPTT), which has been widely applied for the training of temporal RNNs. Since training an RNN and LIF-SNN with BPTT are well discussed in many literatures [36] [35] [37] [38], and implemented in mainstream deep learning frameworks, here we just discuss the difference between training RNN and LIAF-Net using BPTT. Both RNN and LIAF-Net are recurrent networks, therefore we unfold the time domain and form a 2D grid, shown in Fig.3 (a). Each of the node represents a Node Function (NF) which is defined as where l is the layer index, and t is the current time step, V l,t m represents the membrane potential of neurons (hidden state), and X l,t denotes the activations.
Since recurrent networks follow the same graph as Fig.3 (a). They are trained with the same back propagation rule above NF level. The difference is inside the node. Following the definition in Section II-B, we can detail the LIAF node function in Fig. 3 (b). For LIAF, the relationship between U l,t m and V l,t m can be described as a τ (·) function where S(x) is the Heaviside step function. Following the BPTT algorithm, the derivative chain is applied, when performing the partial derivative of V l,t m over U l,t m , we have where in δ(x) is the Dirac Delta function, which is not friendly with the backpropagation, therefore we introduce a rectangle window approximation for the δ(x) function, defined as where µ is a small positive number. The partial derivatives of other operations in the LIAF-Net are easy to obtain and can be easily handled by the deep learning frameworks automatically.

IV. LIAF AS A LIGHTWEIGHT SPATIOTEMPORAL MODEL
In this section, the proposed LIAF is compared with several temporal/spatiotemporal models including RNN, GRU, LSTM, ConvLSTM, Conv3D, which shows the reason why LIAF can be viewed as a lightweight spatiotemporal model. The formal representation of these models are listed in reference [17] [18] [39], and depicted in Fig.4. Formal definitions are provided in Appendix A. Here the hidden state (cells) c in each sub figure in Fig.4 is a vector with size L or a tensor with size H · W · L. FC refers to a fully connected operator, named y = σ(W x + b), where the activation function σ and bias b are optional. gFC is used for gate calculation, defined as , which indicates that all the cells are participating the calculation of a gate g. The traditional RNN model (shown in Fig.4 (a)) contains a recurrent FC for hidden state information exchange, which is not applied in LIAF/LIF. LSTM and GRU shown Fig.4 (b) (c) are widely applied recurrent models. These models consist of gating units which are controlled by the input of current step X t and the output of previous time step h t−1 . In LSTM, the gating functions are used for input, output and hidden state update which requires introducing three gFCs. In GRU the input and hidden state update share one gate calculated by a gFC.
For DenseLIAF/DenseLIF, the fire, reset, and leak can be viewed as 'gates', which control how much previous state information can be kept in the current state. Different from LSTM and GRU, the gate is only controlled by the cell neuron itself, and only hidden state information is considered. Neither the input gate nor the output gate is used in LIAF, therefore no gFC is used for the overall network. Since gFC contains a large number of weights, it requires huge computational power for storage and calculation (multiplication-addition operation). Reducing gFC will lead to the reduction of implementation cost to a large extend.
For spatiotemporal models, such as ConvLSTM, the gFCs are changed to convolutional operations, denoted as Similar saving from ConvLSTM to ConvLIAF on parameter and computation are still sustainable due to the saving of these convolutions. In addition, for ConvLSTM, an additional convolution for input h t−1 is required which consumes more computation and storage. For Conv3D, the convolution operations are performed in a 3D block, which requires several times of mulplication-addition calculation compared to LIAF which only requires Conv2D.
In conclusion, LIAF can be viewed as a lightweight spatiotemporal model. In addition, for a network, LIAF can be used together with these classical models to reach a balance of performance and complexity.

V. EFFICIENCY EVALUATION
We summarized the computational overhead and number of parameters of LIF, LIAF, RNN, GRU [40] , and LSTM [17], according to equations (2)- (8), and equations defined in Appendix A. The result is shown in Table I. The calculation is based on a single time step since there is no difference among all time steps. The batch size is set to one. We denote the size of the input vector and cell vector as K and L. Note that the activation functions can be realized by look-up tables. The computational overhead of look-up table, selection and comparison operation is much lower than multiplication and addition, so we do not list them in Table I. It can be concluded that LIAF consumes the same addition and weights to LIF, while due to the presence of analog signals, the multiplications of LIAF are slightly higher than that of LIF. There are two reasons as follows. Firstly, since the data received by LIF is binary, the matrix multiplication of equation (2) can be replaced by a selection operation. Secondly, for LIF, the multiplication of reset membrane potential in equation (5) can also be reduced to a selection operation. The event-driven property of LIF is not counted in since LIAF can also benefit from similar event-driven when using appropriate activation function (such as ReLU with a bias), and the activation sparsity is highly data-dependent. Importantly, both LIAF and LIF consume far less computational overhead and the number of parameters than GRU and LSTM.
In Table II, we calculated the computational overhead and the number of parameters of spatiotemporal layers. We fix the batch size to one. The hidden state and output have the same tensor size (T, H, W, L), where T represents the temporal dimension, H and W denote the height and width of the feature map respectively, and L represents output channel size. (I, J) denotes the convolution kernel size of Conv2D, ConvLIF, ConvLIAF, and ConvLSTM, (U, I, J) denotes the convolution kernel size of Conv3D, and K denotes input channels size. To facilitate the comparison of formulas, in Table II, we use R and Q to represent T · H · W · L and I · J · K. As shown in Table II, the computational overhead of ConvLIAF is not significantly different from that of Conv2D (time-distributed). ConvLIAF shares the same additions and parameters with ConvLIF. Compared with Conv3D and Con-vLSTM, ConvLIAF can save a mass of calculation quantity and storage overhead.
Note that in our following experiments, we may split ConvLIAF into Conv2D and DirectLIAF, and insert additional layers (such as normalization) between them. In such case the overhead of ConvLIAF is used to evaluate the combination of Conv2D layer and DirectLIAF layer. Similarly, metrics for ConvLIF are used for evaluating Conv2D + DirectLIF.
In short, we concluded that LIAF has advantages in terms
of computational complexity and storage capacity. We will provide numerical results in the subsequent experiments to more intuitively reflect the efficiency advantages of LIAF.
In another aspect, the communication overhead is an important factor for building energy efficient neuromorphic implementations. In these devices, the activations are transmitted via Network on Chip using packets. Take TrueNorth [41] as a reference implementation, wherein each spike is transmitted by a 32-bit packet. If an 8-bit analog value is appended, then the additional bandwidth is 20%. A similar strategy is adopted in Tianjic chip [15], wherein each packet can transmit either 8-bit analog value or spike. For LSTM, although the size of output activations is the same, it requires much more communication or memory access resources on internal components, which may lead to much higher overhead when mapping to the neuromorphic devices.

VI. PERFORMANCE EVALUATION
In this section, we compare the performance and computational cost of LIAF-Net with traditional networks. Firstly, the temporal processing capability of LIAF-Net is evaluated and compared with candidate networks through the Question Answering (QA) tasks. Then we evaluate the spatiotemporal classification accuracy among networks by DVS datasets.

A. Experiment: LIAF-Net on bAbI QA tasks
This evaluation measures the performance disparity among the temporal models on simple Natural Language Processing (NLP) tasks. We adopt bAbI dataset [42] which is a QA dataset, containing 20 tasks. Each task contains a group of QAs. In each QA there are several statements and questions. A temporal network is required to analyze the statements and memorize the key information (such as a supporting fact, or a relative position relationship), and then answers the question by yes/no or by a word from the statement. In this work, we introduced a network shown in Fig.5. For the temporal network, one of DenseLIF/DenseLIAF/GRU/LSTM/RNN is applied. For DenseLIAF, NTR mode is applied with no activation function (expect for QA8 where RELU activation is applied for easy convergence), for GRU and LSTM, the selected activations are shown in Appendix A. The Statements and Questions are firstly encoded into vectors, then processed by the network. A vocabulary is generated from all the vectors, and the results are denoted by a one-hot coding on the dictionary of the vocabulary. Embedding hidden size (HS) of 50 and Statement/Query HS of 100 is configured. In this experiment, all the temporal layers share the same input/output and training parameters. We adopt Adam optimizer with categorical crossentropy as the loss function. For the Equivalent Condition (EC) case, we adopt a learning rate of 0.001 and trained for 60 epochs for all networks. The results are listed in Table III.
We evaluated the average scores of all tasks with the temporal models. It shows that LSTM and GRU based network reach similar performance on accuracy. LIAF (EC) reaches slightly weak performance (-3.3%) to LSTM/GRU and -0.5% to RNN. In addition, LIAF still obtains an obvious performance gain to LIF (3.9%) with the same number of weight parameters. Note that RNN contains an additional internal FC which resulting in much higher storage and computation than LIAF.
It shows in Table III that LIAF performs weaker than LSTM especially in task QA4 and QA8, which motivates us to find out the reason. Further experiments reveal that if we train LIAF with more epochs and lower learning rate (0.0005), it achieves dramatic performance gain, shown in LIAF (FC). With finetuning, LIF achieves higher accuracy on QA4/7/14 shown in LIF (FC). We also found that under this configuration, LSTM and GRU obtain limited performance gain. In conclusion, after finetuning the configuration, LIAF obtains comparable performance to LSTM and GRU, and still outperforms LIF for 4.6%.
We further investigated the characteristic of these tasks, the results revealed that for limited support facts and simple reasoning logic, LIAF / LIF (EC case) may perform better than LSTM / GRU, which happens in QA11 and QA12. On the contrary, for complicated relationships and multi-hop reasoning, LSTM / GRU may perform better than LIAF / LIF (EC case) revealed in QA8 and QA14, which may be caused by the absence of gating in LIAF / LIF.
We revealed that LIAF-Net can be treated as a lightweight temporal network model, therefore we also measured the number of parameters and computational operations in these networks. The results are shown in Table IV which reveals that with the same number of hidden units (size = 100), a LIAF layer consumes 63.5% / 90.8% / 87.7% fewer weight parameters over an RNN / LSTM / GRU layer respectively. In addition, LIAF also has lower computational overhead. A LIAF layer has 91.5% less computational overhead than an LSTM layer and 88.8% than a GRU layer.  Fig. 4. Comparison of LIAF with other temporal and spatiotemporal models. The nodes for hidden state updates are denoted as green nodes, the output nodes are shown in yellow, and the input nodes are colored in blue. The fully connected operations and convolutional opertions for calculating the gates are drawn in orange color. For simplicity, the time step delays for all variables are not drawn. It shows that LIAF and LIF update the hidden state by neuronal dynamics (membrane potential accumulation, leak and action potential generation, potential resetting), without the need of gating. Therefore, several gating (gFC) operators are saved compared to LSTM and GRU, and several convolutional gating operators (gConv) are saved compared to ConvLSTM. Each gFC/gConv requires a large amount of computation and weight storage. In addition, RNN requires additional recurrent weights that do not exist in DenseLIF/DenseLIAF. The main computational and storage overhead in ConvLIAF is the 2D convolution which is much resource-saving than Conv3D. Therefore DenseLIAF and DenseLIF can be viewed as lightweight temporal models compared to RNN, LSTM, and GRU. ConvLIAF and ConvLIF are lightweight spatiotemporal models compared to ConvLSTM and Conv3D. DVS [44], are used to verify the performance of LIAF-Net. Compared to image-based datasets, these event-based datasets contain abundant temporal information. The captured event-based data is typically spike train, where each spike is triggered by a light intensity change at each pixel. Spike is represented by a quad such as (x, y, ts, pol), where x and y are the spatial coordinates of the spike, ts is the time-stamp of the event (unit of 1µs), and pol represents the type of light intensity change (lighten to 1 or darken to -1).
For data pre-processing, we generated a single event-frame by accumulating the spike train within every 5ms. Specifically, we set up different channels for diverse light intensity changes, and adjacent T event frames in chronological order are used, then a sample is derived in size (T , 128, 128, 2). In this case, a larger T indicates that the sample has more temporal information. We set T = 20 for a MNIST-DVS sample and T = 10 for a CIFAR10-DVS sample. For CIFAR10-DVS we used the full DVS 128×128 pixel resolution, while for MNIST-DVS we cropped the event-frame from 128×128 to the size of 40×40 according to the position of the handwritten digits. MNIST-DVS has three scales (scale4, scale8, scale16), and we chose scale8 by default.  3.3 × 10 5 5.5 × 10 3 1.7 × 10 4 DenseLIF 3.4 × 10 5 6.6 × 10 3 5.5 × 10 3 1.7 × 10 4 RNN 9.9 × 10 5 9.9 × 10 5 1.5 × 10 4 3.6 × 10 4 GRU 2.9 × 10 6 3.0 × 10 6 4.5 × 10 4 9.7 × 10 4 LSTM 3.9 × 10 6 4.0 × 10 6 6.0 × 10 4 1.2 × 10 5 2) Network structure: We proposed a flexible network structure for these classification tasks. The proposed network structures are VGG-like [45] illustrated in Fig.6, where the letter N denotes that the LIAF Blocks are connected end to end for N times and similarly the letter M represents that the Dense Blocks are connected end to end for M times. LIAF Block in Fig.6 has a sequential structure, consisting of ConvLIAF, TD-layer-normalization, TD-activation (ReLU) and TD-AvgPooling, where TD refers to the time-distributed operation. Dense Block consists of a dropout layer and a dense layer. In particular, the kernel size of layer ConvLIAF is set to (3,3), and the padding is always 1. Among LIAF configurations, the one with TR mode activation and Channel- Sharing is adopted, with the activation Act(x) = x. V th , V reset , α and β are all trained by BPTT. The parameter settings are listed in Table V. For LIF-SNN, the LIAF Block is replaced by LIF Block consisting of sequentially connected layers including TD-Conv2D, TD-layer-normalization, TD-AvgPooling and DirectLIF. Since Layer normalization [26] is very effective at stabilizing the hidden state dynamics in recurrent networks, we adopt it to accelerate the inference and training of the network and prevent overfitting. It is noteworthy that the feature still has temporal dimension after passing through the N LIAF blocks. For integrating the temporal information, we designed Sumlayer, which reduces the dimension of the activation neuron shape from (T, H, W, L) to (H, W, L) by element-wise addition of the activations over all time steps and divided by T . Finally, the network ends with a softmax layer with 10 units for classification.
3) Training setup: We trained the network shown in Fig.6 and Table V on MNIST-DVS and CIFAR10-DVS datasets respectively using the optimizer Adam and learning rate of  5e-5. Necessarily, we used a learning rate fine-tuning strategy, which is to divide the learning rate by 5 when the loss of validation has stopped improving for the latest 5 epochs.

4) Performance analysis:
We tested the proposed networks on corresponding test datasets occupying 20% of the entire dataset and compare the results with existing state-of-the-art methods summarized in Table VI. On one hand, we have achieved extremely high accuracy on both the MNIST-DVS and CIFAR10-DVS datasets, in special on the CIFAR10-DVS dataset, we achieved the best accuracy, 70.4%, which is 9.9% higher than the best result of the previous work. On the other hand, by comparing the results of LIAF-Net and LIF-SNN, we have demonstrated that LIAF-Net can better analyze eventbased data than LIF-SNN. It is shown in Fig. 7 that the curve for LIAF-Net are smoother than the LIF-SNN and receives less overfitting, which may be caused by the fact that the differential function over continuous activation in LIAF is smoother than the Heaviside step function for the threshold firing in LIF. 5) Evaluating the efficiency of LIAF-Net with other spatiotemporal networks: We further compared the performance Test acc.
The result shown in Table VII indicates that LIAF-Net receives the best performance/cost balance compared with other spatiotemporal models. The accuracy and loss curves of all models over 50 training epochs are illustrated in Fig.  7. We observe that although Conv3D and ConvLSTM based networks have higher training accuracy than LIAF-Net, both suffer severe overfitting, which may due to the redundancy of weights. Besides, although Conv2D network and LIAF-Net converge at a similar speed, the Conv2D based network performance is still lower than LIAF-Net after 30 epochs, which may be caused by the absent of temporal processing capability in the Conv2D based network.
In another aspect, LIAF-Net can still achieve better perfor-    C. Experiment: DVS128 gesture recognition 1) Dataset and preparation: DVS128 Gesture Dataset [53] is directly recorded by DVS camera from real scene. This dataset contains 1,342 instances of a set of 11 hand and arm gestures under three different illumination conditions. The data Fig. 9. The event stream of a hand-clap gesture is shown in the time-width-height space, where green dots denote that polarity of an event is positive and blue ones denote negative polarity. The camera only records the changing pixel so we can only recognize the edge of the moving objects. Four frames generated by accumulating a period of events are shown above, which tells that a person is clapping his hands. [52] sample is also event-based, and the event is represented as a quad (ts, x, y, pol). It has a raw spatial pixel resolution of 128 × 128 and the 1/4 down-sampled resolution is applied, to save the graphics memory. To use the network structure for training, we generated event-frames with the size of (32, 32) by accumulating the spike trains within every 25ms. Each frame is then expanded into two channels according to whether the illumination in each pixel is weakened or strengthened. A sample of hand-clapping gesture is visualized in Fig. 9. Finally, multiple adjacent event frames are stacked in a chronological order to obtain a sample with the dimension (2, 32, 32, T ). We chose T = 60 frames for the three networks we used for comparison. After the pre-processing, the data is organized with the form of (Batchsize, Channels, Width, Height, T ) = (36,2,32,32,60). Notes that in DVS128 Gesture Dataset there are two testing tasks including classification of 10 classes and 11 classes. We chose the latter one for the experiment.
2) Network structure and training setup: The network structure used here is slightly different from the one in Fig. 6. Here all layers in the network are built using LIAF model while in Fig. 6 pooling layers and dense layers are still classical artificial neuron models. LIAF-Net is mainly built with ConvLIAF blocks and DenseLIAF blocks. A ConvLIAF block contains layers including Conv2D, BatchNorm, activation, PoolingLIAF (optional). DenseLIAF block contains layers including Fully connection, BatchNorm, and activation. PoolingLIAF is formed by a pooling layer followed by a DirectLIAF layer. The parameter N now denotes that the N ConvLIAF Blocks are connected end to end, similarly, the letter M represents that M DenseLIAF Blocks are connected  Table VIII.
There are also some parameters specific to LIAF, wherein NTR and All-Sharing configurations are adopted. We set V th = 0.5 in equation (4), α = 0.3 and β = 0 in equation (6). The scaled exponential linear unit (SELU) [54] is applied as the activation function in DirectLIAF, which induces a self-normalizing property. For LIF-SNN, all LIAF layers in the network are replaced by LIF layers. For ConvLSTM network, all LIAF layers are replaced by ConvLSTM layers. All convolutional kernels in these networks are in the size of 3 × 3.
We trained the three networks via Adam optimizer with a learning rate of 1e-4 and the weight decay of 1e-4. Necessarily, we used learning rate fine-tuning strategies for each experiment.
3) Performance analysis: We tested the proposed networks on the corresponding test set which includes 288 instances of arm and hand gestures. The test set accuracy result shows that we have achieved a new record on DVS gesture using  LIAF-Net with an accuracy of 97.56%, which is 3.46% higher than the result of the LIF-SNN and also 3.46% higher than the result of ConvLSTM based network. We also compared our solution with related works and the top 1 accuracy of all solutions is listed in Table X. It also shows that analog networks achieve better accuracy than spiking networks on average, and our proposal achieves the best accuracy among them, which reveals the spatiotemporal processing capability of LIAF. In addition, the efficiency advantage of LIAF-Net in terms of less convolutional parameters and computational overhead required than ConvLSTM based network is illustrated in Table  IX. We only list the computational overhead and weights of all convolutional layers in the network to more purely reflect the difference in efficiency between LIAF and LSTM, which reveals that ConvLIAF saves 91.6% of the computation overhead and 90.0% of the storage compared to ConvLSTM.

A. Rethinking of the bio-plausibility of LIAF
There is also evidence on the existence of analog action potentials (spikes) in vivo [61], where a multi-valued calciummediated dendritic action potentials is discovered in the L2/3 pyramidal neurons of the human cerebral cortex. The amplitude varies with different stimuli levels. It is possible to model such dendritic behavior using a LIAF-like model whose action potentials are analog. Such discovery also indicates the bioplausibility of LIAF.

B. Artificial neuron models using analog value
Beyond the neuron models in ANNs where analog value is the basic format for the activations, there are more spiking neuron models using analog value. In several Spiking Neural Network models, analog values are derived from the traces of the spike trains [62] [63] which also reveals biological consistency [64]. In another aspect, for modeling a complicated dendrite, multi-compartment model [64] is necessary, where the current is transmitted from one compartment to another through a conductance. The current between these compartments is an analog value other than spike. In addition, it is admissible to accept analog-valued batch normalization or layer normalization operations in a bio-plausible neural network since it can be viewed as a type of intrinsic homeostasis [65] of a neuron cell. To reduce the computational overhead, SpArNet [58] is proposed where network layers communicate with analog spikes. Only above threshold activations are transmitted for dramatically reducing the synaptic operations. Different from LIAF-Net which is trained on spatiotemporal data directly, the network is converted from pretrained CNN.

C. From LIAF to SNN
It is possible to build pure SNN through LIAF by introducing rate or temporal coding. The model in previous sections assume that the neuron dynamic of LIAF is based on a basic unit called 'time step', and each time step has a single analog value on either dendrite (input) or axon (output). If we introduce sub temporal intervals for a time step, more coding schemes can be realized. Then an analog value can be represented by a train of spikes within the time step, wherein the firing rate or the firing time represents the analog value. Although many sub-intervals are required for approximating an accurate analog value, limited sub-intervals can represent a quantized analog activation. It is interesting that LIAF can also be used as an intermediate representation for converting rate and temporal coding spike trains from one to another.

VIII. CONCLUSION
In this work, we proposed a Leaky Integrate and Analog Fire (LIAF) neuron model and several LIAF-Nets built on it for efficient spatiotemporal processing. LIAF-Net makes it easier for the back propagation to be applied and maintains the spatiotemporal processing capability through the LIF model dynamics. It also benefits from ANN layers, training techniques, and network building frameworks. By introducing LIAF, SNNs and ANNs can communicate with each other more easily without coding format conversion. Therefore LIAF-Net provides a framework that can be used to friendly build large scale networks. In the performance evaluation section, it is demonstrated that LIAF-Net can be applied for solving various real temporal and spatiotemporal tasks with higher accuracy while consumes lower computational and storage costs compared with existing traditional networks.
A common viewpoint is that current ANN is the 2nd generation neural network, and SNN is the 3rd generation [30] because of its event-driven advantages and bio-plausibility. However, SNN encounters training difficulty with back propagation (BP) algorithm due to the spiking format, which makes the evolution not easy. Since LIAF introduces a more flexible activation function to LIF, and LIF is a special case of LIAF, LIAF can be viewed as a 3.5th generation evolving technology for LIF SNN upgrading.

IX. APPENDIX
A. Formal definitions for the referenced models 1) RNN: We use Elman RNN [39] as a reference, following where x t is the input vector; c t is the hidden state vector; h t is the output vector; W c , W h , U c , b c , b h are trainable parameters; σ c and σ h are activation functions, we use σ c = tanh by default.
Note that we exclude the second equation from our RNN model since it can be realized by a fully connected layer outside, and the remaining part is more similar to LIF/LIAF.
2) LSTM and ConvLSTM: where x t is the input vector; f t is the forget gate; i t is the input/update gate; o t is the output gate; h t is the output vector;c t is the cell input vector; c t is the hidden state vector; σ g , σ c and σ h are configurable activation functions, and we use sigmoid, tanh, tanh by default.
3) GRU [18]: where x t is the input vector; h t is the output vector;ĥ t is the candidate activation vector; z t is the update gate vector; r t is the reset gate vector; W z , W r , W h , U z , U r , U h , b z , b r , b h are trainable parameters; σ g , σ h are activations, and we use sigmoid and tanh by default.