## 3 The Proposed CNN-SNN Conversion Method
### Construction of Converted SNN  
The CNN-SNN conversion method constructs a corresponding SNN model from a trained CNN model. The constructed SNN model must have the same architecture as the trained CNN model. Spiking neural networks use spike neurons such as the integrate-and-fire (IF) neuron, leaky integrate-and-fire (LIF), and their variants. The constructed SNN models use the soft-reset IF neurons, which are a variant of the IF neuron model, the operation of which is defined as follows:  
\[V_{i}(t)=V_{i}(t-1)+I_{i}(t) \tag{1}\]  
\[\text{If }V_{i}(t)\geq V_{th},\quad\text{generate a spike and set }V_{i}(t)=V_{i}(t)-V_{th} \tag{2}\]  
where \(V_{i}(t)\) is the membrane potential of the \(i\)-th neuron at time step \(t\), \(I_{i}(t)\) is the total current that is injected into the \(i\)-th neuron at time step \(t\), and \(V_{th}\) is the threshold of the neuron. The IF neuron model and the soft-reset IF neuron model are described in detail in Appendices A and B, respectively. The total input current \(I_{i}(t)\) of the \(i\)-th neuron in an SNN is computed as follows:\[I_{i}(t)= \begin{cases}\sum_{j}w_{ij}X_{j},&\text{if $i$-th neuron is in the first layer.}\\ \sum_{j}w_{ij}S_{j}(t),&\text{otherwise.}\end{cases}  \tag{2}\]  
where \(X_{j}\) is the \(j\)-th input constant current equal to the corresponding input signal and \(S_{j}(t)\) is the input spike of the \(j\)-th presynaptic neuron at time step \(t\). That is, \(S_{j}(t)=1\) if the \(j\)-th neuron has fired at time step \(t\), and \(S_{j}(t)=0\) otherwise. The convolution operation in an SNN is carried out as shown in Figure 3. It first applies the conventional convolution of the CNN to its input, then performs the potential integration to add the convolution result and the existing potential and, next, compares each integrated value with the threshold to determine whether to generate a spike at the corresponding location at the time step. Only when an integrated value is greater than or equal to the threshold, a spike is generated. Once a CNN model is trained, its weight values for convolution kernels and fully connected layers are used to set the corresponding weights of the SNN model. The remaining ones to be set are the threshold of each spike neuron, which allows it to fire a spike only when its membrane potential is greater than or equal to its threshold. The SNNs receive spike trains, which consist of spikes spread over a time window. The input spike trains should be fed until the SNNs produce enough spikes for the desired outputs. The duration for an input spike train presentation to an SNN is called the inference latency. When a CNN model is converted into an SNN model, the SNN model suffers from rather high latency. On the other hand, the converted SNN model usually experiences a loss in accuracy. That is, the performance of the SNN is usually not as good as that of its corresponding CNN model. Therefore, it is important to find the proper threshold values for SNN models to maintain comparable performance with as low latency as possible. Our concern in CNN-SNN conversion is to determine such firing thresholds for spiking neurons that minimize the conversion loss from a trained CNN to an SNN model with low latency for spiking neurons. We propose a new threshold balancing technique to determine such firing thresholds as shown in Algorithm 2. It is desirable for most neurons of an SNN to have a high, yet proper firing rate for most latencies, which leads to less conversion loss. The proposed technique determines a threshold for each channel at  
Figure 3: Convolution in an SNN. every layer. The threshold values are estimated based on the maximum of the accumulated activations over time steps at each channel.