LC-TTFS: Towards Lossless Network Conversion for Spiking Neural Networks
  with TTFS Coding
The biological neurons use precise spike times, in addition to the spike
firing rate, to communicate with each other. The time-to-first-spike (TTFS)
coding is inspired by such biological observation. However, there is a lack of
effective solutions for training TTFS-based spiking neural network (SNN). In
this paper, we put forward a simple yet effective network conversion algorithm,
which is referred to as LC-TTFS, by addressing two main problems that hinder an
effective conversion from a high-performance artificial neural network (ANN) to
a TTFS-based SNN. We show that our algorithm can achieve a near-perfect mapping
between the activation values of an ANN and the spike times of an SNN on a
number of challenging AI tasks, including image classification, image
reconstruction, and speech enhancement. With TTFS coding, we can achieve up to
orders of magnitude saving in computation over ANN and other rate-based SNNs.
The study, therefore, paves the way for deploying ultra-low-power TTFS-based
SNNs on power-constrained edge computing platforms.
Qu Yang, Malu Zhang, Jibin Wu, Kay Chen Tan, Haizhou Li
# LC-TTFS: Towards Lossless Network Conversion for Spiking Neural Networks with TTFS Coding

###### Abstract

The biological neurons use precise spike times, in addition to the spike firing rate, to communicate with each other. The time-to-first-spike (TTFS) coding is inspired by such biological observation. However, there is a lack of effective solutions for training TTFS-based spiking neural network (SNN). In this paper, we put forward a simple yet effective network conversion algorithm, which is referred to as LC-TTFS, by addressing two main problems that hinder an effective conversion from a high-performance artificial neural network (ANN) to a TTFS-based SNN. We show that our algorithm can achieve a near-perfect mapping between the activation values of an ANN and the spike times of an SNN on a number of challenging AI tasks, including image classification, image reconstruction, and speech enhancement. With TTFS coding, we can achieve up to orders of magnitude saving in computation over ANN and other rate-based SNNs. The study, therefore, paves the way for deploying ultra-low-power TTFS-based SNNs on power-constrained edge computing platforms.

 Deep Spiking Neural Network, Time-to-first-spike Coding, ANN-to-SNN Conversion, Image Classification, Image Reconstruction, Speech Enhancement

## I Introduction

Over the last decade, we have witnessed tremendous progress in artificial intelligence technologies, that include computer vision [1, 2, 3, 4], speech processing [5, 6], natural language processing [7, 8], and robotics [9, 10]. However, the core computational model behind this revolution, i.e., artificial neural network (ANN), is computationally expensive to operate. This prompts the researchers to improve the computational efficiency of ANNs, for example, through model compression [11, 12], network accelerator [13], and reduction of on-chip data movements [14]. Nevertheless, the high computational cost remains a major roadblock to the deployment of ANNs on power-constrained platforms, such as wearable and mobile devices [15].

The human brains evolve over many millennia under strong ecological pressure to be highly efficient and effective, therefore, it is worthwhile to look into the computation principles adopted by biological neural networks. Motivated by this, the spiking neural networks (SNNs), which were initially introduced to simulate neural computations [16], are now considered a power-efficient alternative to the mainstream ANNs, with a great potential to become the solution for power-constrained platforms.

SNNs, which emulate the information processing mechanism of biological neural networks [17, 18, 19, 20, 21], represent and transmit information through asynchronous action potentials or spikes. Due to the complex spatial-temporal dependency of spike trains and the discontinuity at the spike generation time, the canonical back-propagation (BP) algorithm is not directly applicable to the training of SNNs [22, 23]. The surrogate gradient learning method [24] has been introduced recently to address these problems. It models the spiking neuron as a self-recurrent neural network that explicitly captures the spatial-temporal dependency between input and output spike trains. Furthermore, the continuous surrogate gradient functions are introduced during gradient back-propagation that effectively addresses the discontinuity issue at the spike generation time. Despite much progress on a host of machine learning and neuromorphic benchmarks [25, 26, 27, 28, 29, 30, 31], it is computationally prohibitive to exactly model the temporal dynamics of SNNs due to exorbitant memory requirement, even for a network of less than ten layers [27]. Besides, this method suffers from the vanishing and exploding gradient problem that is notorious for recurrent neural networks, making long-range temporal credit assignments ineffective. A more biologically plausible way entails considering propagating spikes only when the neuron fires spikes, which reduces the overall number of gradient propagations on neuromorphic hardware [32]. Zhu et al. [32] have rigorously proved that event-based propagation allocates gradients from one output spike to its corresponding input spikes, thus preserving the sum of gradients between layers. Armed with this insight, they successfully trained SNNs with temporal gradients on the CIFAR-100 dataset for the first time.

In another vein of research, ANN-to-SNN conversion methods are introduced as an alternative solution to address the difficulties in direct SNN training. A large body of these network conversion methods takes the firing rate of spiking neurons to approximate the activation value of analog neurons used in the ANN, which we refer to as _rate conversion_ in this paper. By carefully determining the firing threshold of spiking neurons or the weight normalization factor, the pre-trained network parameters of ANN can be directly transferred
to the SNN with an equivalent network structure [33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47]. In this way, we can avoid the expensive spatio-temporal credit assignments in surrogate gradient learning. The rate conversion methods map ANN to SNN with high precision on major machine learning benchmarks, such as ImageNet-12 [43, 48, 49, 50, 51], with a high latency [42] due to the requirement of a large simulation time window. The benefits that rate-based SNNs bring are hence limited.

It has long been identified in the biological neural systems that the precise spike firing time, in addition to the spike firing rate, carries a significant amount of information [52]. Based on these insights, the time-to-first-spike (TTFS) coding scheme was formulated [53, 54, 55, 56], where only one single spike is allowed within each time window as shown in Fig. 1 (a), and a stronger stimulus is transduced into an earlier firing spike. In this way, with a fewer number of spikes, the TTFS coding scheme is expected to be more efficient computationally than rate-based coding.

Embracing the TTFS coding, Rueckauer et al. [42] proposed an ANN-to-SNN conversion algorithm, where the activation value of ANN was treated as the instantaneous firing rate, and subsequently converted to the equivalent spike time in SNN. However, the scalability of this conversion algorithm to deeper network architecture was not demonstrated. The TDSNN [57] algorithm has been proposed to achieve better scalability, which introduces an auxiliary ticking neuron for each operating spiking neuron and a TTFS-like reverse coding scheme. However, the additional spikes generated from auxiliary ticking neurons adversely affect the model efficiency. In contrast, our method uses the same network architecture as the ANN, which does not require any additional neurons or spikes. Recently, the T2FSNN [58] algorithm has been introduced with improved conversion performance on TTFS-based SNNs, while their results still lag behind rate-based SNNs. Moreover, their kernel-based dynamic threshold is considered more computationally expensive on hardware implementation than ours layer-wise dynamic thresholds. Similar to the TDSNN work, Han and Roy [59] proposed a Temporal-Switch-Coding (TSC) scheme and a corresponding TSC spiking neuron model. However, this coding scheme requires two spikes to encode the information of each analog neuron, whereby the information is represented as the time difference between these two spikes. Besides, the introduced TSC neuron model is computationally more expensive than the Integrate-and-Fire neuron model adopted in other works. In what follows, in contrast to the rate conversion introduced earlier, we refer to the ANN-to-SNN conversion based on the TTFS coding as _TTFS conversion_.

In this work, we aim to bridge the accuracy gap between TTFS conversion and rate conversion, thereby fully realizing the computational advantages of SNNs on power-constrained platforms. Toward this goal, we make the following three contributions:

1. We perform a comprehensive analysis on the problems underlying TTFS conversion, including temporal dynamics problem and time-warping problem.
2. We propose a simple yet effective TTFS conversion algorithm that can effectively address all the above problems. As shown in Fig. 1 (c), it establishes a near-perfect mapping between activation values of ANNs and spike times of SNNs, which leads to a near-lossless TTFS conversion.
3. We successfully implement the TTFS conversion algorithm for image classification, image reconstruction, and speech enhancement tasks. To the best of our knowledge, this is the first work that applies TTFS-based SNN in solving challenging signal reconstruction tasks.

The rest of this paper is organized as follows: In Section II, we introduce the research problems to set the stage for our study. In Section III, we present the proposed TTFS conversion algorithm to address the identified problems. In Section IV, we first evaluate the proposed conversion algorithm on the image classification task. Then, we thoroughly evaluate the effectiveness of the proposed algorithm through a series of ablation studies. In Section V, we further evaluate the proposed algorithm on two signal reconstruction tasks, i.e. image reconstruction and speech enhancement. Finally, Section VI concludes the study.

## II Preliminaries and Problem Analysis

We begin by introducing the analog and spiking neuron models, as well as the TTFS coding scheme. We then analyze the problems underlying TTFS conversion.

### _Preliminaries_

#### Ii-A1 Analog neuron model

In ANN-to-SNN conversion, an ANN is first trained, wherein analog neurons are employed and formulated as follows,

\[a_{i}^{l}=f(\sum_{i}^{N}w_{ij}^{l}a_{j}^{l-1}+b_{i}^{l}) \tag{1}\]

where \(a_{j}^{l-1}\) and \(a_{i}^{l}\) are the input and output of neuron \(i\) at layer \(l\), respectively. \(w_{ij}^{l}\) is the synaptic weight between pre-synaptic neuron \(j\) and post-synaptic neuron \(i\), and \(b_{i}^{l}\) is the bias term of neuron \(i\). \(f(\cdot)\) denotes the activation function, for which we use a modified version of the Rectified Linear Unit (ReLU) function. Specifically, we clamp the activation value to be within \([0,1]\), similar to the ReLU6 function [60], and we refer to it as ReLU1 hereafter. As will be explained in the following section, this ensures a one-to-one correspondence can be established between ANN and SNN for lossless TTFS conversion.

#### Ii-A2 Spiking neuron model

For SNN, to be converted from the pre-trained ANN, we employ the Rectified Linear Postsynaptic Potential (Rel-PSP) spiking neuron model proposed in [61], whose membrane potential \(V_{i}^{l}(t)\) can be expressed as

\[V_{i}^{l}(t)=\sum_{j=1}^{N^{l-1}}w_{ij}^{l}K(t-t_{j}^{l-1}) \tag{2}\]

where \(K(\cdot)\) refers to the PSP kernel function, which is defined as

\[K(t-t_{j}^{l-1})=\begin{cases}t-t_{j}^{l-1}&\text{if}\quad t>t_{j}^{l-1}\\ 0&\text{otherwise}\end{cases} \tag{3}\]
For \(t>t_{j}^{l-1}\), Eq. (2) can be further simplified as

\[V_{i}^{l}(t)=\sum_{j=1}^{N^{l-1}}w_{ij}^{l}(t-t_{j}^{l-1}) \tag{4}\]

The neuron \(i\) fires a spike once its membrane potential exceeds the firing threshold \(\vartheta\), whose spike time \(t_{i}^{l}\) is defined as

\[t_{i}^{l}=\mathcal{F}\left\{t|V_{i}^{l}(t)=\vartheta,t\geq 0\right\} \tag{5}\]

The neuronal dynamics of the ReL-PSP spiking neuron model are illustrated in Fig. 1 (b). Without loss of generality, we set the firing threshold \(\vartheta\) to 1 in this work.

#### Ii-A3 TTFS encoding scheme

To encode the first spike time of a ReL-PSP spiking neuron with the activation value of a ReL1U1 neuron, we follow the TTFS encoding scheme. For each layer that with separate time window, as shown in Fig. 1 (a) and (c), we encode the activation value \(a_{i}^{l}\) into the spike time \(t_{i}^{l}\) as per

\[\frac{t_{i}^{l}-t_{min}^{l}}{t_{max}^{l}-t_{min}^{l}}=1-a_{i}^{l} \tag{6}\]

where \(t_{max}^{l}\) and \(t_{min}^{l}\) are the maximum and minimum permissible spike time of SNN layer \(l\). We define the time window \(T^{l}=t_{max}^{l}-t_{min}^{l}\). Without loss of generalizability, we fix this value to be 1 for all layers, i.e., \(T=1\). Hence, we can establish the following encoding function

\[t_{i}^{l}=l+1-a_{i,n}^{l}, \tag{7}\]

### _TTFS Conversion Problems_

#### Ii-B1 Temporal dynamics problem

Following the above TTFS encoding scheme, a larger activation value in the ANN layer shall be encoded into an earlier spike in the corresponding SNN layer, and vice versa. The additional temporal dynamics introduced during the conversion process may, however, give rise to missing spikes and premature spikes. The missing spike problem happens, during ANN-to-SNN conversion, when an analog neuron receives multiple tiny weighted inputs, while their corresponding spikes as a whole are insufficient to trigger an output spike within the given time window. In contrast, the premature spike problem, which has been also described in [42], happens when the positive weighted spikes arrive earlier than the negative ones, causing the actual number of output spikes more than expected.

To better understand the premature spike problem, let's consider a network formed by two input neurons \(A\) and \(B\) that is connected to an output neuron \(C\), with synaptic weights \(w_{CA}=5\) and \(w_{CB}=-10\). As shown in Fig. 2(a), assuming the activation value of analog neurons \(A\) and \(B\) is \(a_{A}=0.8\) and \(a_{B}=0.4\). As these two weighted inputs cancel out each other, the net input received by the neuron \(C\) will be \(0\). According to Eq. (6), the converted spike time of spiking neurons \(A\) and \(B\) are \(t_{A}=0.2\) and \(t_{B}=0.6\). Assuming the firing threshold is \(1\), the earlier input spike from neuron \(A\) will trigger neuron \(C\) to fire a spike at \(t_{C}=0.4\), before receiving the inhibition input from neuron \(B\). In this example, both neurons \(A\) and \(B\) contribute to neuron \(C\) in the ANN, while the contribution of neuron B has been discarded in the SNN due to the additional temporal dynamics introduced after the TTFS conversion.

We refer to both missing spike and premature spike problems as the temporal dynamics problem, which will compound across network layers and may eventually lead to a fatal mismatch between the outputs of ANN and SNN. To eliminate this problem, we propose a dynamic firing threshold mechanism

Fig. 1: (a) Comparison of rate and TTFS coding schemes. (b) Illustration of spiking neuronal dynamics with ReL-PSP kernel function. (c) Illustration of inference pipeline of the TTFS converted SNN, wherein each layer operates in consecutive but non-overlapping time windows. The inset on top shows the data distribution of activation values in an ANN and spike times of the converted SNN. The activation values are mapped to spike times in a one-to-one correspondence following the TTFS encoding scheme.

Fig. 2: Illustration of the premature spike problem. (a) For ANN, the net inputs from neurons A and B are summed to \(0\), causing neuron C to remain inactivated. (b) For SNN, after TTFS conversion, the earlier spike from neuron A will cause neuron C to fire a ‘premature’ spike at \(t_{c}=0.4\), before the arrival of the inhibition input from neuron B.
to ensure spiking neurons in the \(l\)-th layer only fire within the permissible time window \([lt,(l+1)T)\), after all their input spikes are received. This ensures the contributions from pre-synaptic spiking neurons are fully considered by the post-synaptic spiking neuron. The details of this mechanism will be explained in Section III-A.

#### Ii-B2 Time-warping problem

As we already introduced in Section II-A2, the spiking neuron will fire a spike when the membrane potential \(V_{i}^{l}(t)\) reaches the firing threshold \(\vartheta\). According to Eq. (5), the spike time \(t_{i}^{l}\) can be calculated as

\[t_{i}^{l}=\frac{\vartheta+\sum_{j=0}^{N^{l-1}}w_{ij}^{l}t_{j}^{l-1}}{\sum_{j=0 }^{N^{l-1}}w_{ij}^{l}} \tag{8}\]

Following Eq. (6), the activation value \(a_{j}^{l-1}\) of the analog neuron should be encoded into spike time \(t_{j}^{l-1}\) as per

\[t_{j}^{l-1}=l-a_{j}^{l-1} \tag{9}\]

Taking Eq. (9) into Eq. (8), we can establish the following relationship between the activation value \(a_{j}^{l-1}\) and the spike time \(t_{i}^{l}\)

\[t_{i}^{l}=\frac{\vartheta+l\times\sum_{j=0}^{N^{l-1}}w_{ij}^{l}-\sum_{j=0}^{N^ {l-1}}w_{ij}^{l}a_{j}^{l-1}}{\sum_{j=0}^{N^{l-1}}w_{ij}^{l}} \tag{10}\]

According to Eq. (10), the spike time \(t_{i}^{l}\) depends on both weighted inputs \(\sum_{j=0}^{N^{l-1}}w_{ij}^{l}a_{j}^{l-1}\) and weight sum \(\sum_{j=0}^{N^{l-1}}w_{ij}^{l}\). When transferring an activation value \(a_{j}^{l-1}\) from an analog neuron to a spiking neuron, this additional dependency on the weight sum will cause a significant mismatch between the ANN and SNN outputs if not properly addressed. Ideally, identical inputs should produce consistent outputs in \(t_{i}^{l}\). Yet, variations in the weight sum for each neuron \(i\) cause deviations in the output for the same input value. We refer to this problem as the _time-warping problem_. As will be introduced in Section III-B, we propose a weight regularization strategy to ensure the weight sum equals \(1\), thereby eliminating this time-warping problem.

## III LC-TTFS conversion algorithm

### _Solve temporal dynamics problem with dynamic threshold_

As discussed in Section II-B1, the temporal dynamics problem will result in a mismatch between the ANN and SNN outputs. To address this problem, we propose a dynamic firing threshold for spiking neurons. As shown in Fig. 3(a), the dynamic firing threshold \(\vartheta^{l}(t)\) for neurons in the \(l\)-th layer is determined according to the following piecewise linear function

\[\vartheta^{l}(t)=\begin{cases}\infty&\text{if}\quad t<Tl\\ 1&\text{if}\quad t\in[Tl,T(l+1))\\ -\infty&\text{if}\quad t\geq T(l+1)\end{cases} \tag{11}\]

The role of the proposed dynamic firing threshold is to set the spike time outside the permissible time window to the two boundary values. This is equivalent to applying a transformation function \(F^{l}(t)\), defined as in Eq. (12) and illustrated in Fig. 3(b). Following this dynamic firing threshold, the earliest spike time for neurons in the \(l\)-th layer is \(Tl\), and the latest spike should fire before \(T(l+1)\). As such, the time window is non-overlapping for each layer, and spiking neurons at layer \(l\) only start to fire after all input spikes from layer \(l-1\) are being integrated, therefore, overcoming the temporal dynamics problem.

\[F^{l}(t)=\begin{cases}Tl&\text{if}\quad t<Tl\\ t&\text{if}\quad t\in[Tl,T(l+1))\\ T(l+1)&\text{if}\quad t\geq T(l+1)\end{cases} \tag{12}\]

It is worth noting that there are two main differences between our proposed dynamic threshold and the method proposed in [42]. Concretely, 1) the dynamic threshold introduced in [42] depends on the weight of each neuron, resulting in the firing threshold varying from neuron to neuron that will cause significant hardware overhead. In contrast, our method shares one firing threshold for all neurons in the same layer. 2). our

Fig. 3: (a) Illustration of the dynamic firing threshold. (b) Illustration of the effective spike time transformation achieved by the dynamic firing threshold. The x- and y-axis represent the spike time before and after applying the dynamic firing threshold, respectively. (c) Illustration of the ReLU1 activation function used in the ANN. Note that the activation values of analog neurons in (c) can be mapped to spike times in (b) in a one-to-one correspondence, while the order of the mapping is reversed following the TTFS encoding scheme.
method does not require calculating the missing spikes which is computationally expensive.

The dynamic firing threshold ensures that the spiking neurons fire only within their permissible time window. To achieve a lossless conversion from the ANN, the activation value of each ANN layer should also be bounded within a particular interval. To this end, we employ the ReLU1 activation function, which is formulated as follows

\[y(x)=\begin{cases}0&\text{if}\quad x\leq 0\\ x&\text{if}\quad x\in(0,1]\\ 1&\text{if}\quad x>1\end{cases} \tag{13}\]

As shown in Figs. 3(b) and 3(c), with the proposed ReLU1 function, the ANN activation region is one-to-one mapped to the spike time region. The ablation study performed in Section IV-D5 highlights the necessity of this dynamic threshold mechanism toward a lossless TTFS conversion.

### _Solve time-warping problem with weight regularization_

To deal with the time-warping problem introduced in Section II-B2, we proposed a two-step weight regularization strategy to ensure the weight sum in Eq. (10) will take a constant value of 1. In the first step, we impose a soft constraint by penalizing those weight sums that are not equal to 1 with an L1 loss function \(\mathcal{L}_{W}\) that is defined as follows

\[\mathcal{L}_{W}=\sum_{l=0}^{L-1}\sum_{i=0}^{N^{l}}\left|\sum_{j=0}^{N^{l-1}}w_ {ij}^{l}-1\right| \tag{14}\]

As shown in Fig. 4(a), this step drives the overall weight sum distribution towards 1, which can largely alleviate the time-warping problem. However, these seemingly small deviations from the ideal value of 1 will compound across layers and significantly deteriorate the performance of converted SNNs.

To fully resolve the time-warping problem, we further impose a hard constraint by distributing the weight sum deviation evenly across all contributing synapses for each neuron. As shown in Fig. 4(b), by introducing soft and hard constraints during ANN pre-training, we ensure all weight sums are exactly equal to 1. As the soft constraint already drives the weight sum to approach the ideal value, the additional hard constraint has little interference to the learning dynamics and network convergence. This has been confirmed by the ablation study that will be introduced in Section IV-D.

With the time-warping problem resolved, we now can establish the relationship between \(t_{i}^{l}\) and \(a_{i}^{l}\). Considering weight regularization, we obtain

\[t_{i}^{l}=1+l-\sum_{j=0}^{N^{l-1}}w_{ij}^{l}a_{j}^{l-1}, \tag{15}\]

here, \(\sum_{j=0}^{N^{l-1}}w_{ij}^{l}=1\) and \(\vartheta=1\). With the Eqns. (12, 13) and visualization in Fig.3 (b,c), we yield

\[F^{l}(x)=T(l+1)-y(T(l+1)-x). \tag{16}\]

As mentioned in Section II-A3, we adopt \(T=1\) in this work, thereby obtaining

\[F^{l}(x)=l+1-y(l+1-x). \tag{17}\]

Substitute Eqn. (15) into Eqn. (17), we have

\[F^{l}(t_{i}^{l}) =l+1-y(l+1-t_{i}^{l}) \tag{18}\] \[=l+1-y(l+1-1-l+\sum_{j=0}^{N^{l-1}}w_{ij}^{l}a_{j}^{l-1})\] \[=l+1-a_{i}^{l}\]

Since \(F^{l}(t_{i}^{l})=t_{i}^{l}\) holds true within the permissible time window, we ultimately obtain

\[t_{i}^{l}=l+1-a_{i}^{l}, \tag{19}\]

This result is consistent with the encoding scheme for neurons in layer \(l-1\), as depicted by Eqn. (9). However, it introduces a T steps shift to have a non-overlapping window.

### _Pre-activation normalization strategy_

The BN is an important technique to accelerate the deep neural network training, which normalizes the pre-activation of each layer to follow normal distribution so as to mitigate the internal covariate shift problem. We indeed concur that the bias term from an ANN can be transposed into an SNN by injecting a constant input current at the beginning of each applicable time window. This strategy has proven effective in addressing the internal covariate shift issue in many cases [51, 62]. However, in this work, this approach is not directly

Fig. 4: Illustration of weight sum distributions of a randomly selected network layer, trained on the CIFAR-10 dataset, after imposing the (a) soft constraint, and (b) both soft and hard constraints.
applicable to our proposed TTFS conversion method. The reason for this lies in the fact that once the BN parameters are merged with the weight sum constraint inherent in the pre-trained ANN model, the constraint becomes invalidated. Essentially, the preservation of this constraint is crucial for the functionality of our proposed framework.

To compensate for the absence of BN, we propose to normalize the pre-activation distribution of each layer implicitly by introducing a new loss term \(\mathcal{L}_{A}\) as given in Eq. (20). Since we expect the activation values to lie within \((0,1]\) as desired for ReLU1, therefore, we apply an L1 loss to the pre-activation of each layer, encouraging them to fit a normal distribution with zero mean and standard deviation of 1/3, i.e., \(\mathcal{N}(0,1/9)\). This ensures \(99.7\%\) pre-activation values will lie within the interval \([-1,1]\), such that the activation values will mostly lie within \((0,1]\).

\[\mathcal{L}_{A}=\sum_{l=0}^{L-1}\sum_{i=0}^{N^{l}}\left|\sum_{j=0}^{N^{l-1}}w_ {ij}^{l}a_{j}^{l-1}-A_{i}^{l}\right| \tag{20}\]

where \(A_{i}^{l}\) is a vector, wherein entry \(i\) is the normalized form, draw from \(\mathcal{N}(0,1/9)\), of the pre-activation \(\sum_{j=0}^{N^{l-1}}w_{ij}^{l}a_{j}^{l-1}\).

In Fig. 5, we show an example of how the pre-activation normalization strategy effectively drives the distribution of pre-activation values towards a normal distribution of \(\mathcal{N}(0,1/9)\). Without the normalization, the pre-activation values are skewed towards a mean of \(-0.3\). The effectiveness of this strategy in pre-training high-performance ANNs will be further demonstrated in our ablation study introduced in Section IV-D4.

### _Overall LC-TTFS algorithm_

The proposed LC-TTFS conversion algorithm consists of two stages. In the first stage, we pre-train an ANN with the constraints described above, and the overall loss function is defined as follows

\[\mathcal{L}=\mathcal{L}_{ce}+\lambda_{W}\mathcal{L}_{W}+\lambda_{A}\mathcal{L }_{A} \tag{21}\]

where the \(\mathcal{L}_{ce}\) is the cross-entropy loss for classification tasks, \(\mathcal{L}_{W}\) is the weight regularization loss defined in Eq. (14), and \(\mathcal{L}_{A}\) is the pre-activation normalization loss defined in Eq. (20). \(\lambda_{W}\) and \(\lambda_{A}\) are hyperparameters that balance the contribution of each individual loss term. Additionally, the hard constraints are imposed after each weight update to ensure a unity weight sum for all the neurons.

In the second stage, the weights of the pre-trained ANN are directly copied to the SNN to perform inference. We set the threshold of neurons in the last SNN layer to be infinity, such that the decision can be made based on the accumulated membrane potential. By directly mapping the pre-activation of ANN into the neuron membrane potential of SNN, it frees the ANN from applying the activation function in the output layer that deteriorates the pre-training.

## IV Experiments on Image Classification

In this section, we first evaluate the effectiveness of the proposed LC-TTFS conversion algorithm on the image classification task. Then, we perform a comprehensive analysis of the conversion efficacy and computational efficiency of converted SNNs. Finally, we present ablation studies that are designed to validate the effectiveness of each individual component of the proposed algorithm.

### _Experimental Setup_

#### Iv-A1 Datasets

We perform image classification experiments on CIFAR-10 and CIFAR-100 [63] datasets, which are commonly used for benchmarking SNN learning algorithms. The CIFAR-10 dataset consists of 60,000 colored images with a standard dataset split of 45,000, 5,000, and 10,000 for train, validation, and testing. These images are categorized into 10 classes with an image size of 32\(\times\)32\(\times\)3. The CIFAR-100 dataset is an extended version of CIFAR-10, which includes the 32\(\times\)32\(\times\)3 images from 100 classes. We follow the same image pre-processing procedures as outlined in [62].

#### Iv-A2 Implementation details

To facilitate the comparison with other existing works, we adopt VGGNet [64] and ResNet [2]. In particular, we follow the same VGG-11, VGG-16, and ResNet-20 network architectures as described in [49], except that we do not include BN layers. The dropout is applied after every layer except the pooling layers in VGG-11 and VGG-16, whereas it is only applied after the fully connected (FC) layers in ResNet-20. Given the absence of BN layers, it is important to have a proper weight initialization. To this end, we initialize the weights of convolutions layers to the normal distribution \(\mathcal{N}(0,\frac{2}{k^{2}n})\), where \(k\) and \(n\) correspond to the kernel size and the number of output channels at each layer. For FC layers, the weights are initialized to the normal distribution \(\mathcal{N}(0,0.0001)\).

We use the PyTorch library for all experiments, as it supports accelerated and memory-efficient training on multi-GPU machines. We train VGG-11 and VGG-16 for 300 epochs and ResNet-20 for 200 epochs, and we adopt the SGD optimizer with a momentum of \(0.9\) and weight decay of \(0.0005\). We initialize the learning rate at \(0.01\) and decay its value by 10 at 0.6, 0.8, and 0.9 of the total number of epochs. We follow a discrete-time simulation for SNNs, with a time step of 0.02 ms

Fig. 5: Comparison of the pre-activation value distributions with (blue) and without (brown) applying the pre-activation normalization technique proposed in this work. Note that the data distribution approaches a normal distribution of N(0,1/9) after applying the pre-activation normalization. The data is extracted from a randomly selected network layer trained on the CIFAR-10 dataset. It is better to view this figure in color.
and 50 time steps for each layer. We report the classification accuracy on the test set.

### _Experimental Results and Analysis_

#### Iii-B1 Classification Accuracy

Table I reports our experimental results on CIFAR-10 and CIFAR-100 datasets. For the CIFAR-10 dataset, our VGG-11 and ResNet-20 models achieved a SNN model classification accuracy of 91.25% and 92.67%, outperforming all other existing conversion methods. Our VGG-16 model also achieved competitive accuracy to other prior works using the same network structure. The same conclusion can also be drawn from the results of the CIFAR-100 dataset. Our ResNet-20 model achieves an accuracy of 72.36%, which is the best-reported result on this dataset as far as we know. Similarly, our VGG-16 model outperforms other works using temporal coding, which is also competitive to methods based on rate coding.

The efficacy of our algorithm in achieving a lossless TTFS conversion is pronounced when looking at the conversion error. Notably, as shown in the last column of Table I, the conversion errors from the pre-trained ANNs are negligible. To better understand the origin of the conversion errors, we have plotted the activation values of the pre-trained ANN against those mapped back from the spike times of the converted SNN (following the TTFS encoding scheme). As illustrated in Fig. 6, the data distribution of the mapped back activation values closely follows that of the pre-trained ANN, except for the quantization errors arising from the discretized SNN simulation. The effect of such quantization errors is marginal from our experimental results and can be easily addressed by increasing the temporal resolution of SNN.

### _Computational Efficiency_

The TTFS-based SNNs are believed to be computationally more efficient than their rate-based counterparts. To shed light on this point, we follow the practices adopted by Intel [65] and compute the power proxy via the following equations:

\[P_{proxy}=SynOPs+NeuronOPs, \tag{22}\]

where \(SynOPs\) and \(NeuronOPs\) are the total number of synaptic operations and the total number of neuron updates, respectively. As extrapolated from the Loihi architecture [66], the energy weightage of a singular NeuronOPs corresponds approximately to that of around 10 SynOPs. This is due to the NeuronOPs being a multi-bit operation. Importantly, our utilized neuron model, ReLU-PSP, avoids the exponential leaky mechanism present in the LIF model. To update the neuronal state, ReLU-PSP requires only an addition operation at each time step, which is almost equivalent to a SynOPs.

With reference to the configuration specifics reported by Lee et al. [67], we have computed and tabulated the total \(P_{proxy}\) cross our work and that of Diehl et al. [39], and Segupta et al. [48]. As illustrated in Table II, our TTFS conversion algorithm evidently surpasses the energy efficiency metrics of traditional rate-based conversion methods.

### _Ablation Studies_

Here, we present the ablation studies that are designed to validate the necessity and contribution of each individual component in the proposed algorithm. All the experiments are performed on the CIFAR-10 dataset using VGG-11. The experimental results are summarized in Table III with more detailed discussions presented in the following.

#### Iii-D1 Model 1

We began by removing all the constraints that applied to the pre-trained ANN (i.e., soft and hard constraints for the weight sum, ReLU1 activation function, and pre-activation normalization) and the converted SNN (i.e., dynamic firing threshold). As a result, the accuracy of the ANN improved by only 0.03% over the baseline model. It suggests applying the proposed set of constraints has negligible influence on the ANN pre-training. The converted SNN, however, failed to perform the image classification task with the test accuracy dropping to a chance level, indicating it is crucial to apply the proposed set of constraints for a lossless TTFS conversion.

#### Iii-D2 Model 2a and 2b

We further studied the necessity of soft and hard constraints for the weight sum regularization. Dropping the hard constraint while keeping all the rest constraints during the ANN pre-training had minimal impact on the ANN model, whereas the accuracy of the converted SNN dropped by 4.62%. It suggests the hard constraint for weight sum regularization is essential to eliminate the time-warping problem discussed in Section III-B. We further explored dropping both the soft and hard constraints during the ANN pre-training. Interestingly, this allows the ANN model to perform better than the baseline model. However, we noticed that the accuracy of the converted SNN dropped by 62.92%, implying the soft constraint is critical for alleviating the time-warping problem.

#### Iii-D3 Model 3

ReLU1 activation function bounds the activation values within a particular interval, so as to establish a one-to-one correspondence between the ANN and SNN. To understand the contribution of this constraint, we replaced the ReLU1 activation function with a standard ReLU function, while keeping all the rest constraints during the ANN pre-training. Interestingly, compared to the baseline model with

Fig. 6: Comparison of the distribution of activation values of a pre-trained ANN and those mapped back from the spike times of the converted SNN following the TTFS encoding scheme. The data is extracted from a randomly selected network layer trained on the CIFAR-10 dataset.
full constraints, the model using the ReLU function performs slightly worse than the one using the ReLU1 function. This may be explained by the fact that the ReLU1 activation function can indirectly regularize the weight sum and hence lead to easier fulfillment of the weight sum constraint. However, when changed to the ReLU activation function, it results in a severe accuracy drop of 26.43% on the converted SNN. These results indicate the ReLU1 function is imperative to ensure a one-to-one correspondence between the activation value of ANNs and the spike time of SNNs.

#### Iii-B4 Model 4

Similar to Models 2 and 3, we pre-trained the ANN with all constraints except for the pre-activation normalization. This relaxes the pre-activation values from falling into the value range desired by the ReLU1. It, therefore, leads to poorer accuracy in the pre-trained ANN. We notice that the accuracy drop is more significant for networks with more layers (data not shown here), which is due to the internal covariate shift problem discussed in Section III-C. As expected, the absence of the pre-activation normalization technique did not affect the SNN conversion, and it can still achieve comparable accuracy to the pre-trained ANN.

#### Iii-B5 Model 5

Finally, we follow the same ANN pre-training procedures as the baseline model, while during the network conversion, we replaced the dynamic firing threshold with a fixed threshold of \(1\). This modification results in a 13.48% accuracy drop during the network conversion. To further illustrate the effectiveness of applying the dynamic threshold to address the temporal dynamics problem discussed in Section II-B1, we plotted the spike time distribution using the fixed threshold and the proposed dynamic threshold. As shown in Fig. 7 (a), the spike times spread outside their allocated time intervals, and this problem becomes more obvious for deeper layers. Consequently, it leads to a high level of mismatch from the pre-trained ANN. In contrast, with the proposed dynamic threshold, the neurons at different layers only spike in their allocated time interval, i.e., \([Tl,T(l+1))\). This ensures the pre-synaptic spiking neurons fully contribute to their post-synaptic spiking neurons, eliminating the temporal dynamics problem. Although this non-overlapping time window may scarify the synchronized benefit of SNN, we highlight that our goal is to achieve lossless conversion from ANN to SNN using temporal coding without any training in SNN. To this end, the ANN activation and SNN spiking time are needed to be perfectly matched with each other. Therefore, we adopt the proposed synchronized approach to realize this requirement. It is worth noting that the synchronized layer-wise processing is also used in other exciting temporal coding works, such as [57, 58, 68].

\begin{table}
\begin{tabular}{l c c c} \hline \hline Model & Diehl et al. & Segupta et al. & Ours \\ \hline VGG9 & 730.4M & 794M & 117M \\ ResNet9 & 956.4M & 1,226.6M & 107.8M \\ ResNet11 & 854.6M & 796.3M & 144.4M \\ \hline \hline \end{tabular}
\end{table} TABLE II: Comparison of the Total \(P_{proxy}\).

\begin{table}
\begin{tabular}{l l l c c c} \hline \hline
**Dataset** & **Method** & **Network Architecture** & **Neural Coding** & **Acc. (\%)** & \(\Delta\)**Acc. (\%)** \\ \hline \multirow{8}{*}{CIFAR10} & SPIKE-NORM [48] & VGG-16 & Rate & 91.55 & -0.15 \\  & PTL [62] & VGG-11 & Rate & 91.24 & 0.65 \\  & CQ trained SNN [51] & VGG-11 & Rate & 82.09 & -0.05 \\  & CQ trained SNN [51] & VGG-16 & Rate & 92.48 & -0.08 \\  & RMP [43] & VGG-16 & Rate & 93.63 & -0.01 \\  & RMP [43] & ResNet-20 & Rate & 91.36 & -0.11 \\  & Hybrid Training [49] & VGG-16 & Rate & 91.13 & -1.68 \\  & Hybrid Training [49] & ResNet-20 & Rate & 92.22 & -0.93 \\  & T2FNN [58] & VGG-16 & Temporal & 91.43 & - \\  & TSC [59] & VGG-16 & Temporal & 93.63 & -0.01 \\  & TSC [59] & ResNet-20 & Temporal & 91.42 & -0.05 \\  & **Ours** & **VGG-11** & **Temporal** & **91.25** & **-0.05** \\  & **Ours** & **VGG-16** & **Temporal** & **92.72** & **-0.07** \\ \hline \multirow{8}{*}{CIFAR100} & CQ trained SNN [51] & VGG-like & Rate & 71.52 & -0.4 \\  & RMP [43] & VGG-16 & Rate & 70.93 & -0.29 \\ \cline{1-1}  & RMP [43] & ResNet-20 & Rate & 67.82 & -0.9 \\ \cline{1-1}  & Hybrid Training [49] & VGG-11 & Rate & 67.87 & -3.34 \\ \cline{1-1}  & T2FNN [58] & VGG-16 & Temporal & 68.79 & - \\ \cline{1-1}  & TSC [59] & VGG-16 & Temporal & 68.18 & 0.25 \\ \cline{1-1}  & TSC [59] & ResNet-20 & Temporal & 70.97 & 0.54 \\ \cline{1-1}  & **Ours** & **VGG-16** & **Temporal** & **70.15** & **-0.13** \\ \cline{1-1}  & **Ours** & **ResNet-20** & **Temporal** & **72.36** & **0.13** \\ \hline \hline \end{tabular}
\end{table} TABLE I: Comparison of the classification accuracy of different SNN models on the CIFAR-10 and CIFAR-100 datasets. Note that Acc. refers to the accuracy of converted SNN, and \(\Delta\) Acc. refers to the difference between the pre-trained ANN and the converted SNN.
## V Experiments on Signal Reconstruction

In the previous section, we demonstrate the effectiveness and scalability of the proposed LC-TTFS conversion algorithm on image classification tasks. Existing TTFS-based learning algorithms often employ methods that achieve TTFS-based learning by either dropping or masking subsequent spikes after the first one during the training phase. Moreover, while there are gradient-based direct training algorithms cited in [45, 48], they have manifested convergence challenges, especially concerning deep neural networks. Although these methods might prove efficient for classification tasks, their efficacy diminishes notably when deployed for signal reconstruction tasks. In contrast, our proposed method adopts a conversion-based approach. This approach fundamentally eradicates the convergence issue and paves the way for establishing a direct and lossless mapping from the ANN. This ensures that information integrity remains uncompromised throughout the process. Performing TTFS encoding at each layer, allows us to preserve the information across the network and opens up the opportunity to perform signal reconstruction tasks with TTFS-based SNNs. In this section, we demonstrate the applicability and superior learning capability of the proposed LC-TTFS algorithm on two signal reconstruction tasks: image reconstruction and speech enhancement tasks.

### _Image Reconstruction with Autoencoder_

Here, we first demonstrate the applicability of our algorithm to image reconstruction tasks with an autoencoder network. The autoencoder is a typical neural network that is used to learn compact latent representations of input signals via a bottleneck layer that has a reduced latent dimension. From this compact latent representation, the autoencoder then reconstructs the original input signals as accurately as possible [69].

#### V-A1 Experimental Setup

The experiments on image reconstruction are performed using the MNIST dataset [70]. Following the approach from [62], we use a fully-connected autoencoder with a 784-128-64-32-64-128-784 architecture and train it to minimize the MSE between the original input and the reconstructed output signal.

The initial model was pre-trained as an ANN before being converted into a TTFS-based SNN using our proposed algorithm. We utilized the SGD optimizer for pre-training, with a cosine annealing learning rate schedule [71]. The output from spiking neurons was processed through a sigmoid function to generate the reconstructed image.

Evaluation of our model was carried out using two commonly used image quality metrics, PSNR and SSIM, both of which provided insight into the quality of reconstructed images. We provide the results of these evaluations on the test set.

#### V-A2 Result and Analysis

Table IV summarises the results of on the image reconstruction task. Our TTFS-based SNN model achieves a comparable performance to the ANN-based counterpart in terms of the PSRN and SSIM metrics. In addition, the qualitative results shown in Fig. 8 demonstrate the TTFS-based SNN model can effectively reconstruct the

\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Model** & **Soft** & **Hard** & **ReLU1** & **Norm** & **Dynamic** & **ANN (Acc.\%)** & **SNN (Acc.\%)** & \(\Delta\)**Acc.\%** \\ \hline Baseline & ✓ & ✓ & ✓ & ✓ & ✓ & 91.30 & 91.25 & 0.05 \\
1 & ✗ & ✗ & ✗ & ✗ & ✗ & 91.33 & 10.00 & 81.33 \\
2a & ✓ & ✗ & ✓ & ✓ & ✓ & 91.57 & 86.95 & 4.62 \\
2b & ✗ & ✗ & ✓ & ✓ & ✓ & 92.10 & 29.18 & 62.92 \\
3 & ✓ & ✓ & ✗ & ✓ & ✓ & 90.87 & 64.44 & 26.43 \\
4 & ✓ & ✓ & ✓ & ✗ & ✓ & 89.60 & 89.67 & -0.07 \\
5 & ✓ & ✓ & ✓ & ✓ & ✗ & 91.30 & 77.82 & 13.48 \\ \hline \hline \end{tabular}
\end{table} TABLE III: Summary of the result of ablation studies. Note that \(\Delta\) Acc. refers to the difference between the pre-trained ANNs and the converted SNNs given in columns 7 and 8, respectively. **Soft**: soft constraint for weight sum; **Hard**: hard constraint for weight sum; **ReLU1**: ReLU1 activation function; **Dynamic**: dynamic firing threshold; **Norm**: pre-activation normalization.

Fig. 7: Illustration of spike timing distribution of SNN models (a) with a fixed firing threshold and (b) with a dynamic firing threshold.
images with high quality. Altogether, these results suggest the proposed conversion algorithm is highly effective for the image reconstruction task.

By representing information using spike times, the TTFS-based SNN is expected to greatly improve the energy efficiency over the rate-based counterparts. Following the same evaluation metrics introduced in Section IV-C, we report the energy proxy in Table IV. As shown, the energy efficiency of our TTFS-based model remains competitive with a high-optimized rate-based SNN reported in [62].

### _Time-domain Speech Enhancement_

Speech enhancement, which improves the intelligibility and quality of noisy speech signals [66], has proven its importance in a vast amount of applications, including voice-based communication, hearing aids, speech recognition, and speaker identification [72, 73, 74, 75, 76]. Conventional speech enhancement methods are typically based on statistical models that estimate the data distribution of clean and noise signals, such as spectral subtraction [77] and Wiener filter [78]. However, these methods have shown limited improvements in speech quality under real-world scenarios. Recently, the ANN-based speech enhancement models have greatly improved the speech quality and intelligibility under complex acoustic environments [79, 80, 81, 82, 83]. Given a huge demand for speech enhancement technologies on mobile and IoT devices that have a limited power budget, it is, therefore, beneficial to develop power-efficient SNN-based speech enhancement models.

Speech enhancement can be considered as separating the human voice from the background noise. Inspired by the recent success of the time-domain speech separation model ConvTasNet [84], we proposed a TTFS-based speech enhancement model. As illustrated in Fig. 9(a), the proposed speech enhancement model takes the noisy speech waveform as input and outputs an enhanced speech waveform. This model consists of three parts: an encoder, an enhancement module, and a decoder. The **encoder** transforms the noisy speech waveform \(x(t)\) into a high-dimensional feature representation, namely embedding coefficients, using a 1D convolutional layer. The 1D convolutional layer contains \(N(=128)\) filters, and each filter is configured to have a time window of \(L(=20)\) and a stride of \(L/2(=10)\) samples. For each time window, the **enhancement module** estimates a mask, using a stack of dilated convolutional layers, to separate the noise from the human voice. A \(1\times 1\) convolution layer is first applied to normalize the encoded feature representation, and the dilated convolution layers with the filter of 128, kernel size of \(1\times 3\), and stride of \(1\) are repeated \(10\) times with doubled dilation rate of \([1,2,4,...,512]\). The mask for human voices is then estimated by applying another \(1\times 1\) convolution layer. Subsequently, the feature representation of the enhanced speech is obtained by masking the background noise with the estimated mask. Finally, the **decoder** reconstructs a high-quality speech waveform \(y(t)\) from the masked feature representation using a 1D deconvolutional layer, which takes a reverse operation to the 1D convolutional layer in the encoder.

Following the ConvTasNet, we train the proposed SNN-based speech enhancement model to minimize the multi-scale scale-invariant signal-to-distortion ratio (SI-SDR) [85] loss, which is defined as:

\[\mathcal{L}_{SI-SDR}=-10log_{10}\bigg{(}\frac{\|\frac{\langle s,s\rangle}{ \langle s,s\rangle}s\|^{2}}{\|\frac{\langle\hat{s},s\rangle}{\langle s,s \rangle}s-\hat{s}\|^{2}}\bigg{)} \tag{23}\]

where \(\hat{s}\) and \(s\) are enhanced and reference clean speech signals, respectively. We normalize these two signals to zero means to ensure scale invariance.

#### Iv-B1 Experimental Setup

To test our speech enhancement model, we employed a widely recognized dataset by Valentini et al. [86]. This dataset includes clean utterances from the Voice Bank corpus [87] and its noisy version created by combining clean utterances with environmental noise samples. The training set comprises 11,572 utterances mixed with ten types of noise at four different SNRs: 15 dB, 10 dB, 5 dB, and 0 dB. The test set contains 824 distinct utterances blended with five additional noise types at four SNRs: 17.5 dB, 12.5 dB, 7.5 dB, and 2.5 dB. Following the precedent set by SEGAN [79] and CNN-GAN [80], we reduced the original sampling rate to 16 kHz, without additional pre-processing.

Using the LC-TTFS algorithm, we pre-trained the ANN-based speech enhancement model for 100 epochs, utilizing an early stopping scheme and an Adam optimizer. The model was then converted into an SNN-based module, employing the membrane potential in the \(1\times 1\) spiking convolution layers.

We evaluate the speech enhancement models using the following standard metrics, which are available on the publisher's

\begin{table}
\begin{tabular}{l l c c c} \hline \hline
**Model** & **Coding** & **PSNR** & **SSIM** & **Energy Proxy** \\ \hline SNN [62] & Rate & 20.74 & 0.84 & 715.8K \\
**ANN (ours)** & - & 20.90 & 0.917 & - \\
**SNN (ours)** & Temporal & 20.83 & 0.916 & 581.2K \\ \hline \hline \end{tabular}
\end{table} TABLE IV: Comparison of the results of different methods on the image reconstruction task.

Fig. 8: Comparison of the original and the reconstructed images from our TTFS-based autoencoder. For each image pair, the left one is the original image, and the right one is the reconstructed image.
website1.

Footnote 1: [https://www.rcpress.com/downloads/K14513/K14513_CD_Files.zip](https://www.rcpress.com/downloads/K14513/K14513_CD_Files.zip)

1. PESQ: Perceptual evaluation of speech quality. The wide-band version recommended by ITU-T P.862.2 standard [88] is used in this work.
2. CSIG: Mean option score (MOS) prediction of the signal distortion attending only to the speech signal [89].
3. CBAK: MOS prediction of the intrusiveness of background noise [89].
4. COVID: MOS prediction of the overall effect [89].

All metrics are calculated by comparing the enhanced speech to the clean reference speech, we report the average values for all 824 utterances in the test set.

#### V-B2 Result and Analysis

Table V compares the results of our ANN- and SNN-based speech enhancement models with other existing works using the four evaluation metrics introduced earlier. Our ANN-based model outperforms other existing methods across all the evaluation metrics, suggesting the effectiveness of the proposed model architecture. Moreover, the TTFS-based SNN model achieved comparable performance to the pre-trained ANN model, demonstrating the capability of the proposed TTFS conversion algorithm in solving the challenging speech enhancement task.

We also performed subjective evaluation by listening to the enhanced speech signals generated by both the ANN- and SNN-based speech enhancement models. We find the SNN-enhanced speech samples are nearly indistinguishable from those high-quality ones generated by the ANN model. We publish some enhanced speech examples from the test set online to demonstrate our model performance2. In addition, we select a random speech sample from the test set and plot the power spectrum for the corresponding noisy, clean, ANN- and SNN-enhanced speech waveforms as shown in Fig. 9(b). It is clear that the SNN-enhanced speech spectrum exhibits a high level of similarity to the ANN-enhanced one, and both of them are very close to the ground truth clean speech spectrum. These results again highlight the effectiveness of the proposed model architecture and the TTFS conversion algorithm.

Footnote 2: The listening examples are available online at [https://drive.google.com/file/d/1g5OCATyH1B3U5z_x6qDZam8bMcmElxR/view?usp=sharing](https://drive.google.com/file/d/1g5OCATyH1B3U5z_x6qDZam8bMcmElxR/view?usp=sharing)

## VI Discussion and Conclusion

In this work, we identify and thoroughly investigate two major problems underlying the effective TTFS conversion, namely the temporal dynamics problem and time-warping problem. Based on this study, we further propose a novel TTFS conversion algorithm to address these problems, namely LC-TTFS. Firstly, to tackle the temporal dynamics problem, we introduce a dynamic firing threshold mechanism for spiking neurons that only allows neurons to fire within the allocated time window. In this way, the causal relationship between the input and output neurons is maintained throughout the network layers. Secondly, we apply a set of well-designed loss functions during the ANN pre-training to eliminate the

\begin{table}
\begin{tabular}{l c c c c} \hline \hline Model & PESQ & CSIG & CBAK & COVID \\ \hline Noisy & 1.97 & 3.35 & 2.44 & 2.63 \\ Wiener [79] & 2.22 & 3.23 & 2.68 & 2.67 \\ SEGAN [79] & 2.16 & 3.48 & 2.94 & 2.80 \\ CNN-GAN [80] & 2.34 & 3.55 & 2.95 & 2.92 \\
**ANN (Ours)** & **2.36** & **3.63** & **3.03** & **2.98** \\
**SNN (Ours)** & **2.35** & **3.64** & **3.01** & **2.98** \\ \hline \hline \end{tabular}
\end{table} TABLE V: Comparison of the experimental results of different speech enhancement models. The results are higher the better.

Fig. 9: (a) SNN-based speech enhancement network architecture. (b) From top to bottom: the power spectrum of noisy, clean, ANN-enhanced, and SNN-enhanced speech waveforms.
time-warping problem. Finally, we apply the pre-activation normalization technique during the ANN pre-training to alleviate the internal covariate shift problem due to lack of BN layer. With these problems being well addressed, we establish a near-perfect mapping, apart from the marginal discretization error in the SNN simulation, between the ANN activation values and the SNN spike times, leading to a near-lossless TTFS conversion. This also enables us to go beyond the commonly considered classification tasks and opens up a new avenue for solving high-fidelity signal reconstruction tasks with TTFS-based SNNs.

The SNNs thus converted have demonstrated superior classification and signal reconstruction capabilities on image classification, image reconstruction, and challenging speech enhancement tasks. By representing information using spike times, instead of firing rates, we show TTFS-based SNNs can significantly improve the computational efficiency over both ANN and rate-based SNNs. By avoiding costly and ineffective direct SNN training, the proposed algorithm, therefore, opens up myriad opportunities for deploying efficient TTFS-based SNNs on power-constrained edge computing platforms. The carefully designed ablation studies on each individual component of the proposed algorithm highlight the necessity and synergy of these algorithmic components in achieving a near-lossless TTFS conversion. We would like to acknowledge that the proposed TTFS-based SNN requires a separate and non-overlapping time window for each layer, which adversely affects the inference speed. Therefore, we are interested in studying whether a perfect mapping can still be achieved under a shared time window to improve the inference speed, and we leave this as future work.
