Impact of spiking neurons leakages and network recurrences on event-based spatio-temporal pattern recognition

Spiking neural networks coupled with neuromorphic hardware and event-based sensors are getting increased interest for low-latency and low-power inference at the edge. However, multiple spiking neuron models have been proposed in the literature with different levels of biological plausibility and different computational features and complexities. Consequently, there is a need to define the right level of abstraction from biology in order to get the best performance in accurate, efficient and fast inference in neuromorphic hardware. In this context, we explore the impact of synaptic and membrane leakages in spiking neurons. We confront three neural models with different computational complexities using feedforward and recurrent topologies for event-based visual and auditory pattern recognition. Our results showed that, in terms of accuracy, leakages are important when there are both temporal information in the data and explicit recurrence in the network. Additionally, leakages do not necessarily increase the sparsity of spikes flowing in the network. We also investigated the impact of heterogeneity in the time constant of leakages. The results showed a slight improvement in accuracy when using data with a rich temporal structure, thereby validating similar findings obtained in previous studies. These results advance our understanding of the computational role of the neural leakages and network recurrences, and provide valuable insights for the design of compact and energy-efficient neuromorphic hardware for embedded systems.


I. INTRODUCTION
O VER the last decade, Artificial Neural Networks (ANNs)   have been increasingly attracting interest in both academia and industry as a consequence of the explosion of open data and the high computing power of today's computers for training and inference.The state-of-the-art performance of deep neural networks on various pattern recognition tasks has given neural networks the leading role in Machine Learning (ML) algorithms and Artificial Intelligence (AI) research.However, the technological drive that has supported Moore's Law for fifty years and the increasing computing power of conventional processors is reaching a physical limit and is predicted to flatten by 2025 [1].Hence, deep learning progress with current models and implementations will become technically, economically and environmentally unsustainable [2], [3].This limit is particularly prohibitive when targeting edge application in embedded systems with severe constraints in latency and energy consumption [4].
Neuromorphic computing is a promising solution that takes inspiration from the biological brain which can reliably learn and process complex cognitive tasks at a very low power consumption.On the one hand, neuromorphic sensors are event-based sensors and capture information with a high spatio-temporal sparsity and high temporal resolution at lowlatency and low-power consumption [5], [6].On the other hand, neuromorphic processors are asynchronous and use parallel and distributed implementations of synapses and neurons where memory and computation are co-localized [7], [8], hence adapting the hardware to the computation model [9], [10].Spiking Neural Networks (SNNs) are the the generation of artificial neural models [11] that are investigated to exploit the advantages of event-based sensing and asynchronous processing at the algorithmic level.
Inspired from the neuroscience literature, Spiking Neural Networks (SNNs) show promising performance in embedded spatio-temporal pattern recognition [12].For example, compared to a conventional approach using formal neural networks on an embedded Nvidia Jetson GPU, SNNs on the Intel Loihi neuromorphic chip [13] achieve a gain in energy-efficiency of 30× in multimodal (vision and EMG) hand gesture recognition [14] and 500× in tactile braille letters recognition [15], at the cost of a loss in accuracy depending on the application.Multiple models of spiking neurons have been proposed in the literature [16], [17], [18] and implemented in hardware [19] with different levels of biological plausibility and computational complexity.However, there is a lack of understanding of how each of the factors determining the biological neuronal response can be effectively used in learning and inference.A key question for advancing the field is therefore to identify the right level of abstraction inspired from biology to achieve the best inference performance within strict constrains in speed/latency and power efficiency on neuromorphic hardware.
This work attempts to partially answer this question by studying the effect of spiking neurons leakages in feedforward and recurrent neural networks for event-based visual and auditory pattern recognition tasks, in terms of accuracy and spiking activity.Today, digital neuromorphic chips from academia and industry use both non-leaky (e.g.SPLEAT [20] and DynapCNN [21]) and leaky (e.g.MorphIC [22] and Loihi [13]) spiking neurons.Understanding the computational role of the leakages provides insights for the hardware architecture of neuromorphic processors as they require extra circuitry overheads [23].In Section 2 we introduce the spiking neuron models and present the training methodology.Then, in section 3 we present experiments on the spiking neuron leakages, the network typologies and the time constants heterogeneity, and provide a detailed analysis of the obtained results.Finally, in sections 4 and 5 we discuss the results, highlighting the main insights, limits and outlook of our work.

II. METHODS
In this section, we introduce the used spiking neuron models that are characterized with different levels of biological abstraction.We also introduce the surrogate gradient decent approach used in this work to overcome the all-or-nothing behavior of the binary spiking non-linearity.

A. Spiking neuron models
The standard spiking neuron model is formally described as a time continuous dynamical system with the differential equation [24]: where U i (t) is the membrane potential that characterizes the hidden state of the neuron, U rest is the resting potential, τ mem is the membrane time constant, R is the input resistance, and I i (t) is the input current.The hidden state of each neuron, however, is not directly communicated to downstream neurons.When the membrane potential U i reaches the firing threshold ϑ, the neuron fires an action potential (or a "spike") and the membrane potential U i is reset to its resting potential U rest .If we consider spikes to be point processes for which their spike width is zero in the limit, then a spike train S (l) j (t) is denoted with the sum of Dirac delta functions S (l) j of neuron j from layer l.Spikes are communicated to downstream neurons and trigger postsynaptic currents.A common first-order approximation to model the temporal dynamics of postsynaptic currents are exponentially decaying currents that sum linearly: (2) where we have introduced the synaptic decay time constant τ syn , and the synaptic weight matrices: W (l) ij for feed-forward connections, and V (l) ij for explicit recurrent connections within each layer.
It is customary to approximate the solutions to the above equations in discrete time assuming a small simulation time step ∆t > 0. With no loss of generality, we assume U rest = 0, R = 1, and the firing threshold ϑ = 1.The output spike train S (l) where Θ is the Heaviside step function such that S where the decay strengths are given by α ≡ e − ∆t τsyn and β ≡ e − ∆t τmem , such that 0 < α < 1 and 0 < β < 1 for finite and positive τ syn and τ mem .
There exists many extensions and variations of spiking neurons models.In order to find the right level of abstraction from biology and get the best performance in accurate, efficient and fast inference, we will derive and confront three variations with variable degrees of biological plausibility: the Current-Based Leaky Integrate-and-Fire (CUBA-LIF), the Leaky Integrateand-Fire (LIF), and the Integrate-and-Fire (IF).
1) Current-Based Leaky Integrate-and-Fire (CUBA-LIF): The CUBA-LIF neuron is the most biologically plausible model among the three models considered in this work.It accounts for the temporal dynamics of the postsynaptic current.This neuron model is governed by Equations 5 and 6.It has two exponentially decaying terms: αI i and βU i .The degree of the exponential decay of I i and U i is determined by the synaptic time constant τ syn and membrane time constant τ mem , respectively.Figure 1a illustrate the dynamics of a CUBA-LIF neuron for some random input stimuli.
2) Leaky Integrate-and-Fire (LIF): The LIF neuron model is a simplification of the CUBA-LIF and it is widely used in computational neuroscience to emulate the dynamics of biological neurons [26].It integrates the input over time with a leakage such that the internal state represented by the membrane potential goes down exponentially.As shown in Figure 1b, subsequent input spikes must be maintained for the state not to go to zero.In discrete time, the dynamics the LIF neuron are governed by Equations 7 and 8: 3) Integrate-and-Fire (IF): The IF neuron is a further simplification and the least biologically plausible model considered in this work.The IF model can be concisely described as a LIF neuron with no leak.It behaves as a standard integrator that keeps a running sum of its input.Thus, the internal state of the neuron is the mathematical integral of the input [27].IF neurons do not have any inherent temporal dynamics.In discrete time, IF dynamics are governed by Equations 9 and 10: Equations 9 and 10 do not have the decay (i.e., leak) parameters α and β.The parameter α is set to zero which causes the synapse to have an infinite leak.The current pulse width is short, it effectively looks like a weighted spike.β on the other hand is set to one, which causes the membrane potential to remain constant between two consecutive spikes.Figure 1c illustrates the dynamics of an IF neuron for some random input stimuli.

B. Supervised learning in SNNs
The choice of the three spiking neurons models considered is motivated by the intention of mapping existing machine learning methods to train SNNs.The aim of learning is to minimize a loss function L over the entire dataset.The gradientbased method, namely Backpropagation Trought Time (BPTT) [28] was used.Before BPTT can be applied to SNNs, however, a serious challenge regarding the non-differentiability of the spiking non-linearity needs to be overcome.
BPTT requires the calculation of the derivative of the neural activation function.For a spiking neuron, however, the derivative of S[t] = Θ(U [t]−ϑ) is zero everywhere except at U = ϑ, where it tends to infinity as shown in Equation 11.This means the gradient will almost always be zero and no learning can take place.This behaviour of the binary spiking non-linearity makes SNNs unsuitable for gradient based optimization and it is known as the "dead neuron problem".
In this work, we used a surrogate gradient approach [25] to provide a continuous relaxation to the real gradients.In other words, we keep the Heaviside step function the way it is during the forward pass and change the derivative term ∂S/∂U with something that does not stop learning during the backward pass.Specifically, we selected the fast sigmoid function S to smooth out the gradient of the Heaviside function: where β is the steepness parameter that modulates how smooth the surrogate function is.
In this work, cross entropy max-over-time loss function [29] is chosen.When called, the maximum membrane potential value for each output neuron in the readout layer is sampled and passed through the loss function.This cross entropy loss encourages the maximum membrane potential of the correct class to increase, and suppresses the maximum membrane potential of incorrect classes.On data with batch size of N batch and N class output classes, {(x s , y s ) | s = 1, ..., N batch ; y s ∈ {1, ..., N class }} the loss function takes the form: ) where 1 is the indicator function, and t is the time step with the maximum membrane potential for each readout unit in the readout layer L, such that ti = argmax t U The cross entropy in Equation 13 is minimized using the Adamax optimizer [30].

III. EXPERIMENTS AND RESULTS
This section present all the experiments we conducted in order to understand the effect of spiking neurons leakages and network recurrences for spike-based spatio-temporal pattern recognition and gives a detailed analysis of the results we obtained.

A. Experimental setup
We investigated the role of neurons leakages, network recurrences and neural heterogeneity by training SNNs to classify visual and auditory stimuli with varying degrees of temporal structure.We adopted a necessary and sufficient minimal architecture widely used as an universal approximator [31], [25] consisting of three layers of spiking neurons: an input layer, a hidden layer with or without recurrent connections, and a readout layer used to generate predictions.This is a universal approximator, where the readout layer consists of neurons that do not spike.Two training approaches were applied: standard training only modifies the synaptic weights, while heterogeneous training affects both the synaptic weights and the time constants.
We used two datasets.Neuromorphic MNIST (N-MNIST) [32] contains mostly spatial information.It features visual stimuli and has minimal temporal structure, as its samples are generated from static images by moving a neuromorphic vision sensor over each original MNIST sample.Therefore, the spike rate of the input neurons has sufficient information about the pattern, while the temporal component is strictly related to the movements of the vision sensor.By contrast, the Spiking Heidelberg Digits (SHD) [29] is auditory and has a rich temporal structure.It was generated using an artificial cochlea, where the spike timing of the input neurons is necessary to recognize each pattern [33].
To allow for fair baselines comparison of performance in accuracy with previous works, we used the same train/test Only when the membrane potential reaches the neuronal firing threshold (dashed line), output spikes are generated split suggested by the corresponding dataset authors in all of our experiments.The network architectures and common hyper-parameters in our experiments such as the batch size, number of epochs, learning rate η, and steepness parameter β were tuned according to state-of-the-art results obtained from the literature [29], [33], [34], as well as our own preliminary experiments.Table I gives a summary of all parameters used for our experiments.The performance of each configuration is quantified in terms of testing accuracy and sparsity as an estimation for dynamic energy-efficiency in neuromorphic hardware.We note that all reported error measures in this work correspond to the standard deviation of three experiments with different random initialization for the trained parameters.

B. Impact of the neural leakages
To assess the effects of the membrane and synaptic leakages, we started by confronting the three concerned neuron models: CUBA-LIF, LIF, and IF in a Feed-forward SNN (FSNN) using both datasets.Only synaptic weights are learned and leakage parameters are treated as hyper-parameters and chosen to be homogeneous (i.e. the same for all neurons).Leakage parameters α and β are tuned using the synaptic time constant τ syn and the membrane time constant τ mem , respectively, as described by Equations 3 and 4 in the previous chapter.
1) Accuracy analysis in FSNN: We started by the CUBA-LIF neuron where both leakages are of concern.This model can have a wide range of τ syn and τ mem .We performed a grid search across a number of time constants by fixing one and changing the other.Grid search is a simple hyperparameters tuning technique that helped us evaluate the model for a wide range of combinations to get a good understanding of the slope of change in accuracy.
Table IIa shows the SHD testing accuracy results for the chosen different combinations of τ mem and τ syn .We can see from the time constants sweeps that τ mem values below 420ms result is a significant decrease in accuracy.It is also clear that the best results seem to push τ syn , and hence α, close to zero with τ mem ≥ 420ms.In other words, CUBA-LIF performs better when its dynamics are close to those of the LIF neuron.This trend is also observed for the N-MNIST as shown in Table IIb.However, we can see a 31.55% drop between the best accuracy that reached 76.94% ± 1.13% and the 45.39% ± 1.64% worst accuracy for SHD, while only a 1.59% difference between the 97.41% ± 0.07% best and the 95.82% ± 0.11% worst accuracy for N-MNIST.This suggests that the leakages seem to have greater impact on data with rich temporal structure, than on data that is intrinsically spatial and low in temporal structure.
The LIF neuron has an infinite synaptic leak with τ syn = 0 and a tunable membrane leak.So we varied τ mem as a hyperparameter across a range of values.The results of our experiments presented in Table IIa show that the LIF neuron achieved higher accuracy than its CUBA-LIF counterpart for both datasets.but it also resulted in the lowest accuracies for very small values of τ mem .
For the IF case, there is an infinite synaptic leak similar to that of the LIF and no membrane leak.so the only possible values for time constants are τ mem = ∞ and τ syn = 0 which corresponds to β = 1 and α = 0 respectively.In spite of its simplicity and lack of temporal dynamics, IF neuron was able to match or even outperform the other models by reaching a testing accuracy of 78.36% ± 0.87% for SHD and 97.50% ± 0.06% for N-MNIST as shown in Table II.This result suggests that introducing inherent temporal dynamics and increasing neuronal complexity does not necessarily lead to an improved classification accuracy even for data with rich temporal structure when using a feed-forward network.
2) Sparsity analysis in FSNN: While learning performance is pivotal, it is also crucial to take into considerations the associated computational cost and energy consumption of using each model which are directly linked to the spiking activity of neurons when using a neuromorphic hardware like Intel Loihi [13] that computes asynchronously and exploits the sparsity of event-based sensing.To infer an output class, SNNs feed the input spikes over a number of time steps and perform event-based synaptic operations only when spikeinputs arrive.These synaptic operations are considered as a metric for benchmarking neuromorphic hardware [13], [35].
We explored the impact of the leakages on the sparsity of each model by inferring the test set.SHD spiking activity recordings in the hidden layer plotted in Figure 2 show that the time constants combinations that led to the sparsest activity (τ mem = 14ms for LIF and τ mem = τ syn = 14ms for CUBA-LIF) also resulted in the worst accuracies for both LIF and CUBA-LIF neurons.This is due to the fast decays in both membrane potential and synaptic current that result in not having enough spikes to hold the information.The same trend however cannot be observed for the N-MNIST.This could be due to the fact that leakage parameters do not have a significant impact on spatial information.Nevertheless, we can see an increase in spiking activity with higher values of τ syn for the CUBA-LIF neuron on both datasets.Although it is more apparent on the SHD.This increase in spiking activity that resulted in a decrease in accuracy, is associated with CUBA-LIF neurons' ability to sustain input spikes over longer durations.However, more spikes do not necessarily lead to better performance, at least for our datasets.These results suggest that there is a sweetspot where a sufficient number of spikes leads to a an optimal accuracy.
Intuitively, we can assume that if all three neurons were to receive the same weighted sum of input, LIF neurons would produce comparatively sparser outputs due to their infinite synaptic leak and the layer-wise decay of spikes caused by its membrane leak that acts as a forgetting mechanism.For both datasets, we can see from Figure 2 that IF neurons produced slightly less spikes than LIF neurons in some experiments, which is counter-intuitive.In an attempt to understand the cause of this misleading intuition, we plotted the distributions of the trained weights for the LIF experiment that has the highest spiking activity (τ mem = 420ms) to compare it with the weights distribution of the IF as depicted in Figure 3.Because it is hard to inspect the distributions visually, we calculated the mean and standard deviation.We can see that the standard deviation of the LIF's weight matrices W (2) is higher than that of the IF.This result suggests that BPTT tailors the LIF model to increase the synaptic weights beyond what is needed for the IF model.
The CUBA-LIF model, on the other hand, was able achieve the sparsest activity among the three models for certain combinations of time constants despite its ability to sustain input spikes for longer duration.To that effect, we plotted the weights distributions of CUBA-LIF's experiment with τ mem = 1680ms and τ syn = 28ms and compared it with that of the LIF experiment that has the same τ mem value.Again, we calculated the mean and standard deviation.We can see that the standard deviation of CUBA-LIF'S weight matrices W (2) is higher than that of the LIF.Once more, this can be attributed to BPTT.Therefore, the results clearly indicate that the leakages do not necessarily lead to sparser activity.

C. Impact of explicit recurrences
To study the effect of recurrences on learning spatiotemporal patterns, we added explicit recurrent connections to neurons in the hidden layer and confronted the three neuron models in the context of a Recurrently-connected SNN (RSNN).Similar to the experiments in the FSNN, we performed a grid search across the same combinations of time constants for CUBA-LIF, a sweep for the same τ mem values for LIF, and the same experiments for IF.
reached a significantly higher performances than their feedforward counterparts across all combinations of time constants for both CUBA-LIF and LIF.However, that is not the case for the N-MNIST.This is not surprising knowing the inherent ability of Recurrently Connected Neural Networks (RCNN) to handle time series and sequential data.For both datasets however, we can still observe the same trend as in FSNN such that τ mem values below 420ms result in a significant decrease in accuracy for both CUBA-LIF and LIF, while CUBA-LIF performed better with smaller values of τ syn .Nevertheless, Fig. 4: Trained weights distributions for LIF vs. CUBA-LIF for the weight matrices (a) W (1) and (b) W (2) .The standard deviation in LIF (1.99 × 10 −2 for W (1) and 1.15 × 10 −1 for W (2) ) is higher than CUBA-LIF (1.44 × 10 −2 for W (1) and 0.77 × 10 −1 for W (2) ).
the LIF neuron reached the highest accuracy among the two.
For the IF neuron, adding explicit recurrences reduced the accuracy by 0.43% on SHD and lead to comparable accuracy on N-MNIST.A comparison between the best accuracies obtained by the models in both FSNN and RSNN is presented if Figure 5.Given IF's good performance in FSNN with both datasets and inferior performance in RSNN with SHD, it becomes clear that leakages are important when there are both temporal information in the data and a recurrent topology in the network.This result is the most important finding of this work and our unique contribution to the neuromorphic computing literature.
To the best of our knowledge, the highest accuracies we were able to reach on the SHD dataset are very close to state-ofthe-art results [36].Table IV compares our best results with other works in the literature.

2) Sparsity analysis in RSNN:
Similar to what we did in FSNN, we recorded the spiking activity of neurons in the hidden layer when the test set is inferred.SHD spikes count recordings plotted in Figure 2a show that explicit recurrent connections increase activity in all neurons for every combination of time constants.On average, we have 53.55% increase in spiking activity for CUBA-LIF, 53.35% for LIF, and 53.58% for IF.N-MNIST spikes count, on the other hand, did not increase for every combination time constants.It even decreased for some as shown in Figure 2b.On average, we have 3.89% increase for CUBA-LIF, 16.78% for LIF, and 15.75% for IF.
It is hard to say whether or not the bigger increase in spiking activity for SHD contributed to its improved classification accuracy given that we saw similar increase for IF neurons but a worsened performance.Given the CUBA-LIF experiments that resulted in classification performance that is almost as good as that of the LIF also resulted in the slightest increase in spiking activity.The CUBA-LIF model could be more suitable for low power applications especially if tuned better to reach even higher accuracy.

D. Impact of neural heterogeneity
Most existing learning methods learn the synaptic weights only while requiring a manual tuning of leakages-related parameters similar to our previously presented experiments.These parameters are chosen to be the same for all neurons, which could limit the diversity and expressiveness of SNNs.In biological brains, neuronal cells have different time constants with distinct stereotyped distributions depending on the cell type [37], [38], [39].To assess whether this heterogeneity plays an important functional role or is just a byproduct of noisy developmental processes, we incorporated learnable time constants in the training process.Hence, τ mem and τ syn will not be treated as hyper-parameters, but learned parameters along with the synaptic weights.We refer to this training process as heterogeneous training.Since the IF neuron has fixed values of time constants: τ mem = ∞ and τ syn = 0, it is not concerned with heterogeneous training.On the other hand, LIF neuron has a fixed τ syn equal to zero but a variable τ mem which we were able to train.For CUBA-LIF, both time constants are trained.
To evaluate the performance of incorporating learnable time constants in comparison with the standard training in our previously presented experiments, we initialized τ mem and τ syn to the same values we used in our grid search for both CUBA-LIF and LIF and trained then along with the synaptic weights.We also conducted these experiments in both FSNN and RSNN.We found that incorporating learnable time constants did not have a profound impact on both datasets.As can be seen in Table V, the best accuracies obtained with heterogeneous training are slightly higher than that of the standard training for the SHD.Conversely, N-MNIST reached the best accuracies with standard training.This result tells us that heterogeneity in time constants could further improve performance for data with information content in their temporal dynamics.

IV. DISCUSSION
In the neuro-scientific literature, it has been reported that leakages in biological neurons exist in many contexts such as synaptic transmission in the visual cortex [40] and sodium ion channels [41], [42].Many spiking neuron models imitate this leaky behaviour through an exponential decay in the synaptic current and membrane potential.Other models prioritize computational efficiency by removing the leakage.To tackle the lack in understanding of the effect of these leakages from the modeling perspective, we confronted three spiking neuron models with variable degrees of leaky behaviour, namely the CUBA-LIF, LIF, and IF, in classification tasks with a number of degrees of freedom.
We first trained SNNs using the three neuron models with a feed-forward network to classify visual patterns of written digits from the N-MNIST dataset and auditory information of spoken digits from the SHD datasets.Surprisingly, the IF model, despite the absence of leaky behaviour and the resulting lack of inherent temporal dynamics, slightly outperformed the other models on the SHD by reaching an accuracy of 78.36% ± 0.87%, and closely matched the best of LIF model accuracy on the N-MNIST by reaching 97.50% ± 0.06%.CUBA-LIF on the other hand, had the inferior performance among the three models on both datasets despite its intrinsic temporal dynamics caused by both synaptic and membrane leaks.Both LIF and CUBA-LIF saw a drastic decrease in accuracy when τ mem is less than 420ms, which leads to a fast decay in membrane potential and loss of information.We also found that CUBA-LIF reached its highest accuracies when its dynamics are close to those of the LIF.We conclude that leakages do not necessarily lead to improved performances even on temporally complex tasks when using feed-forward    Furthermore, we noticed that very low spiking activity resulted in the worst classification performance on the SHD.Very high spiking activity associated with bigger τ syn values also resulted in a worsened performance.These results suggest that there is a sweet-spot where a sufficient amount of spikes produce an optimal classification accuracy.Overall, IF neurons are sufficient when using data without temporal information or a network without recurrence in terms of classification accuracy and sparsity.It suggests that the fundamental ingredient of spiking neurons is their statefullness, i.e. having an internal state with an implicit recurrence, even without leakage.Furthermore, they offer a better alternative if we consider digital neuromorphic hardware design that is based on application-specific needs.IF neurons could be very cheap in terms of hardware resources, as they only perform additions for the input integration and a comparison for the output evaluation.In contrast, the LIF and CUBA-LIF neurons require multipliers to implement the leakage in their current and/or voltage compartments as shown in Table VI, thus resulting in more expensive hardware.Next, we added explicit recurrent connections to the neurons in the hidden layer.Expectedly, we saw a big improvement in accuracy for the SHD that has a rich temporal structure and no improvement at all for the N-MNIST that hos mostly spatial structure.However, recurrences did not have any impact on the IF neuron on both datasets.Therefore, we conclude that the inherent temporal dynamics introduced by the leakages are only necessary when we use both data with a rich temporal structure and a neural network with a explicit recurrence.The best SHD accuracies we were able to obtained in a RSNN were very close to state-of-the-art results [36] such that we reached 82.74% ± 0.17% with CUBA-LIF and 83.41% ± 0.37% with the LIF.In terms of sparsity, we saw a bigger increase in spiking activity with the SHD than the N-MNIST.In both datasets, the CUBA-LIF neurons with the best time constants combinations added the smallest number of spikes, which gives them an advantage in sparsity compared to LIF neurons.
Finally, we introduced heterogeneity in the considered spiking neurons by incorporating learnable time constants in the training process along with the synaptic weights.This heterogeneous training slightly improved performance on the SHD, which has a complex temporal structure.The best SHD accuracies we obtained with heterogeneous training in RSNN were also very close to state-of-the-art results [36] with 82.84% ± 1.17% for CUBA-LIF and 83.47% ± 2.12% for LIF.

V. CONCLUSION
In this work we explored the effect of spiking neurons synaptic and membrane leakages, network explicit recurrences and time constants heterogeneity on event-based spatiotemporal pattern recognition.The main findings of our work can be summarized as follows: • Neural leakages are only important when there are both temporal information in the data and explicit recurrent connections in the network.• Neural leakages do not necessarily lead to sparser spiking activity in the network.• Time constants heterogeneity slightly improves performance on data with a rich temporal structure and does not affect performance on data with a spatial structure.This work supports the identification of the right level of model abstraction of biological evidences needed to build efficient application-specific neuromorphic hardware.This is a crucial analysis for advancing the field beyond state-of-theart, especially when constrains on resources are critical (e.g.edge computing).In fact, when using digital neuromorphic architectures, IF neurons have been shown to be 2 × smaller and more power-efficient than formal Perceptrons [23].It is nevertheless not clear how this gain evolves when adding a multiplier to implement a LIF or CUBA-LIF neuron.Further works will focus on implementing these two architectures in FPGAs for fast prototyping.In addition, IF neurons give the possibility to implement a digital asynchronous processing purely driven by the input, since there is no inherent temporal dynamics in the spiking neurons.On the other hand, LIF and CUBA-LIF neurons require algorithmic time-steps where the leakage is updated regardless of the presence of input spikes.Further works will explore the impact of both paradigms in energy-efficiency on the Loihi neuromorphic chip [13].
Furthermore, it is important to mention that our results only hold in benchmarking so far.In a real-world scenario such as continuous keyword spotting, there can be more noise in the data but also in void.Hence, when using the IF neurons that do not have any leakage, this noise can accumulate and create false positives and degrade the performance.Indeed, the low-pass filtering effect of the spiking neurons leakages has been shown to eliminate high frequency components from the input and enhance the noise robustness of SNNs, especially in real-world environments [34].In addition, given that the LIF model achieved a superior performance when compared to the CUBA-LIF, it is important to investigate where the latter could perform better.More complex tasks could show such a gain for the CUBA-LIF neuron, because of its current compartment which is an extra state that gives more potential for spatio-temporal feature extraction.Finally, spiking neural networks in neuromorphic hardware can be used beyond fast and efficient inference, by adding adaptation through local synaptic plasticity [43], [44], [45].In this context, the impact of the leakage can be different, as the inherent temporal dynamics is required in some plasticity mechanisms [46], [47] for online learning.

i
[t] ∈ {0, 1}.t is used to denote the time step to indicate discrete time.The synaptic and membrane dynamics expressed respectively by Equation 2 and Equation 1 become [25]:

Fig. 1 :
Fig.1: Synaptic current and membrane potential dynamics of each spiking neuron model in response to the same input spikes.Only when the membrane potential reaches the neuronal firing threshold (dashed line), output spikes are generated

Fig. 2 :
Fig. 2: Hidden layer spiking activity with the increase/decrease caused by adding explicit recurrences for each time constants combination of three models.Each grouped set of bars corresponds to one τ syn value while each bar within the group corresponds to one τ mem value.

TABLE I :
Hyperparameters used in our experiments.

TABLE II :
Three neuron models accuracy in FSNN.

TABLE III :
Three neuron models accuracy in RSNN.

TABLE V :
Comparison between best accuracies of standard vs. heterogeneous training.
networks.In terms of sparsity, it is IF to see sparser activity in IF neurons and CUBA-LIF neurons with smaller values of τ syn than their LIF counterpart.Upon inspection of the trained weights distributions, it seems that BPTT is tailoring LIF neurons to have bigger weights, and hence more spikes.Therefore, leakages do not always lead to sparser activity.

TABLE VI :
Number of multiplication, addition and comparison operations per spiking neuron at each time step, where N is the number of inputs (feedforward and/or recurrent) to the neuron and P is the percentage of those inputs that receive a spike.