RMP-Loss: Regularizing Membrane Potential Distribution for Spiking
  Neural Networks
Spiking Neural Networks (SNNs) as one of the biology-inspired models have
received much attention recently. It can significantly reduce energy
consumption since they quantize the real-valued membrane potentials to 0/1
spikes to transmit information thus the multiplications of activations and
weights can be replaced by additions when implemented on hardware. However,
this quantization mechanism will inevitably introduce quantization error, thus
causing catastrophic information loss. To address the quantization error
problem, we propose a regularizing membrane potential loss (RMP-Loss) to adjust
the distribution which is directly related to quantization error to a range
close to the spikes. Our method is extremely simple to implement and
straightforward to train an SNN. Furthermore, it is shown to consistently
outperform previous state-of-the-art methods over different network
architectures and datasets.
Yufei Guo, Xiaode Liu, Yuanpei Chen, Liwen Zhang, Weihang Peng, Yuhan Zhang, Xuhui Huang, Zhe Ma
# RMP-Loss: Regularizing Membrane Potential Distribution for Spiking Neural Networks

###### Abstract

Spiking Neural Networks (SNNs) as one of the biology-inspired models have received much attention recently. It can significantly reduce energy consumption since they quantize the real-valued membrane potentials to 0/1 spikes to transmit information thus the multiplications of activations and weights can be replaced by additions when implemented on hardware. However, this quantization mechanism will inevitably introduce quantization error, thus causing catastrophic information loss. To address the quantization error problem, we propose a regularizing membrane potential loss (RMP-Loss) to adjust the distribution which is directly related to quantization error to a range close to the spikes. Our method is extremely simple to implement and straightforward to train an SNN. Furthermore, it is shown to consistently outperform previous state-of-the-art methods over different network architectures and datasets.

## 1 Introduction

Recently, many efforts have been done to make deep neural networks (DNNs) lightweight, so that they can be deployed in devices where energy consumption is limited. To this end, several approaches have been proposed, including network pruning [65], network quantization [18, 40, 15], knowledge transfer/distillation [49], neural architecture search [69, 42], and spiking neural networks (SNNs) [23, 19, 22, 17, 56, 39, 47, 59, 58, 67, 53, 60, 61]. The SNN provides a special way to reduce energy consumption following the working mechanism of the brain neuron. Its neurons accumulate spikes from previous neurons and present spikes to posterior neurons when the membrane potential exceeds the firing threshold. This information transmission paradigm will convert the computationally expensive multiplication to computationally convenient additions thus making SNNs energy-efficient when implemented on hardware. Specialized neuromorphic hardware based on an event-driven processing paradigm is currently under various stages of development, _e.g._, SpiNNaker [31], TrueNorth [1], Tianjic [48], and Loihi [9], where SNNs can be efficiently implemented further. Due to the advantage of computational efficiency and rapid development of neuromorphic hardware, the SNN has gained more and more attention.

Although SNNs have been widely studied, their performance is still not comparable with that of DNNs. This performance gap is largely related to the quantization of the real-valued membrane potential to 0/1 spikes for the firing of the SNN in implementation [21]. The excessive information loss induced by the firing activity forcing all information only to two values will cause accuracy to decrease. Although information loss is important for computer vision tasks and the quantization will cause information loss too, the essential role of the activation function is to introduce non-linearity for neural networks [46]. Therefore, how to effectively reduce the information loss of membrane potential quantization is of high research importance. However, as far as we know, few studies have focused on directly solving this problem. The quantization error problem also exists in these methods that convert the ANN model to an SNN model [11, 4, 39]. However, these methods solve the problem by changing the activation function in ANNs or increasing timesteps in SNNs, which don't work for SNN training. InfLoR-SNN [21] adds a membrane potential redistribution function in the spiking neuron to reduce the quantization error via redistributing the membrane potential. However, it will decrease the biological plausibility of the SNN and increase the inference burden. This paper focuses on reducing the quantization error in SNN training directly and aims to introduce no burden for the SNN.

Quantization error is smaller when the membrane potential is close to the spiking threshold or reset values [21].
Hence, to mitigate the information loss, we suggest redistributing the membrane potential to where the membrane potential is closer to the 0/1 spike. Then an additional loss term aims at regularizing **m**embrane **p**otential is presented, called RMP-Loss, which can encourage the membrane potentials to gather around binary spike values during the training phase. The workflow of our method is shown in Fig. 1. Our main contributions can be concluded as follows:

* To our best knowledge, there have been few works noticing the quantization error in direct training of SNNs. To mitigate the quantization error, we present the RMP-Loss, which is of benefit to training an SNN model that enjoys a narrow gap between the membrane potential and its corresponding 0/1 spike. Furthermore, we also provide theoretical proof to clarify why the RMP-Loss can prevent information loss.
* Some existing methods can address information loss too. While achieving comparable performance, more parameters or computation burdens are also introduced in the inference phase. Different from those methods, the RMP-Loss can handle information loss directly without introducing any additional parameters or inference burden.
* Extensive experiments on both static and dynamic datasets show that our method performs better than many state-of-the-art SNN models.

## 2 Related Work

There are two main problems to train an SNN model [22]. The first is that the firing activity is non-differentiable thus the SNN model cannot be trained with these back-propagation methods directly. One way to mitigate the optimization difficulty is through surrogate functions. This kind of method replaces the non-differentiable firing activity with a differentiable surrogate function to calculate the gradient in the back-propagation [37, 55, 45, 54]. In [2], the derivative of a truncated quadratic function was used to approximate the derivative of the firing activity function. In [63] and [7], the derivatives of a sigmoid [63] and a rectangular function were respectively adopted to construct the surrogate gradient. Furthermore, a dynamic evolutionary surrogate gradient that could maintain accurate gradients during the training was proposed in [41, 20, 5, 6]. Another way to solve the non-differentiable problem is converting an ANN model to an SNN model, known as ANN-SNN conversion methods [27, 26, 39, 32, 3, 29, 28]. The ANN-SNN method trains a high-accuracy ANN with ReLU activation first and then transforms the network parameters into an SNN under the supposition that the activation of the ANN can be approximated by the average firing rates of an SNN. However, conversion methods will introduce conversion errors inevitably. Many efforts were made to tackle this problem, such as long inference time [14], threshold rescaling [52], soft reset [27], threshold shift [39], and the quantization clip-floor-shift activation function [4]. This paper adopts the surrogate gradient method.

The second problem is information loss. Though transmitting information with binary spikes is more efficient than that with real values, quantizing these real-valued membrane potentials to 0/1 spikes will cause information loss. There have been some works handling this problem indirectly. Such as learning the appropriate membrane leak-and-firing threshold [50, 68]. These are of benefit to finding a preferable quantization choice. Similarly, in [17, 62], some learnable neuron parameters are incorporated into the SNN to optimize the quantization choice. In [24], three regularization losses are introduced to penalize three undesired shifts of membrane potential distribution to make easy optimization and convergence for the SNN. The regularization is also beneficial to reduce quantization error. However, all

Figure 1: The overall workflow of the proposed method. We embed a membrane potential regularization loss in the task loss to redistribute the membrane potential in the training phase to reduce the quantization error.
these methods do not handle the information loss problem directly and most of them require more parameters. InfLoR-SNN [21] suggests adding a membrane potential redistribution function in the spiking neuron to redistribute the membrane potential closer to spike values, which can be seen as a direct method to reduce the quantization error. However, adding another function in spiking neurons will decrease the biological plausibility of the SNN and increase the inference burden. In this work, we focus on handling the quantization error problem directly without introducing extra parameters or computation burden in the inference phase.

## 3 Preliminary

In this section, a brief review of the primary computing element of SNNs is first provided in Sec. 3.1. Then we introduce the proposed surrogate gradient that handles the non-differentiability challenge in Sec. 3.2. Finally, in Sec. 3.3, we describe the threshold-dependent batch normalization technique used in this work.

### Spiking Neuron Model

_Spiking neuron_. The primary computing element, _i.e._, the neuron of an SNN is much different from that of an ANN. The neuron of an ANN plays the role of nonlinear transformation and can output real-valued values. Meanwhile, the neuron in an SNN accumulates the information from previous neurons into its membrane potential and presents the spike to the following neurons when its membrane potential exceeds the firing threshold. The SNN is more efficient with this special information transmission paradigm while suffering the information loss problem. A unified form of this spiking neuron model can be formulated as follows,

\[u^{(t),\mathrm{pre}}=\tau u^{(t-1)}+x^{(t)}, \tag{1}\]

\[o^{(t)}=\left\{\begin{array}{ll}1,&\mathrm{if}\ u^{(t),\mathrm{pre}}\geq V _{\mathrm{th}}\\ 0,&\mathrm{otherwise}\end{array}\right., \tag{2}\]

\[u^{(t)}=u^{(t),\mathrm{pre}}(1-o^{(t)}). \tag{3}\]

Where \(u^{(t),\mathrm{pre}}\) and \(u^{(t)}\) are pre-membrane potential and membrane potential, respectively, \(x^{(t)}\) is input information, \(o^{(t)}\) is output spike at the timestep \(t\). The range of constant leaky factor \(\tau\) is \((0,1)\), and we set \(\tau\) as \(0.25\). \(V_{\mathrm{th}}\) is the firing threshold and is set to \(0.5\) here.

_Output layer neuron_. In the general classification task, the output of the last layer will be presented to the Softmax function first and then find the winner class. We make the neuron model in the output layer only accumulate the incoming inputs without any leakage as final output like doing in recent practices[50, 66], described by

\[u^{(t)}=u^{(t-1)}+x^{(t)}. \tag{4}\]

Then the cross-entropy loss is calculated according to the final membrane potential at the last timesteps, \(u^{(T)}\).

### Surrogate Gradients of SNNs

As shown in Eq. 2. the firing activity of SNNs can be seen as a step function. Its derivative is \(0\) everywhere except at \(V_{\mathrm{th}}\). This non-differentiability problem of firing activity will cause gradient vanishing or explosion and make the back-propagation unsuitable for training SNNs, directly. As mentioned before, many prior works adopted the surrogate function to replace the firing function to obtain a suitable gradient [7, 66, 56]. In InfLoR-SNN [21], an extra membrane potential redistribution function is added before the firing function. It argues that this redistribution function will reduce the information loss in forward propagation. However, investigating it from a backward propagation perspective and considering the redistribution function being next to the firing function, it can be seen as a more suitable surrogate gradient if we gather the STE (used in [21]) gradients of the firing function and redistribution function together. In this sense, the suitable surrogate gradient can also be seen as a route to reduce quantization error. Therefore, in this paper, we adopt the gathered redistribution function in InfLoR-SNN as our surrogate function, which indeed performs better than other methods [7, 66, 56] in our experiments, denoted as

\[\varphi(u)=\left\{\begin{array}{ll}0,&u{<}0,\\ \frac{1}{2\mathrm{tanh}(3/2)}\mathrm{tanh}(3(u-1/2))+1/2,&0\leq u\leq 1,\\ 1,&u{>}1.\end{array}\right. \tag{5}\]

### Threshold-dependent Batch Normalization

Normalization techniques can effectively reduce the training time and alleviate the gradient vanishing or explosion problem for training DNNs. A most widely used technique called batch normalization (BN) [30] uses the distribution of the summed input to a neuron over a mini-batch of training cases to compute a mean and variance which are then used to normalize the summed input to that neuron on each training case. This is significantly effective for convolutional neural networks (CNNs). However, directly applying BN to SNNs will ignore the temporal characteristic and can not achieve the desired effect. To this end, a more suitable normalization technique for SNNs, named threshold-dependent BN (tdBN) was further proposed in [66]. It normalizes feature inputs on both temporal and spatial dimensions. Besides, as its name implies, tdBN makes normalized variance dependent on the firing threshold, _i.e._, the pre-activations are normalized to \(N(0,(\alpha V_{\mathrm{th}})^{2})\) instead of \(N(0,1)\). this can balance pre-synaptic input and threshold to maintain a reasonable firing rate. In this paper, we also adopt the tdBN, as follows,

\[\bar{\mathbf{X}}=\alpha V_{\mathrm{th}}\frac{\mathbf{X}-\mathrm{mean}( \mathbf{X})}{\sqrt{\mathrm{mean}((\mathbf{X}-\mathrm{mean}(\mathbf{X}))^{2}) +\epsilon}}, \tag{6}\]
\[\mathbf{\bar{X}}=\lambda\mathbf{\bar{X}}+\beta. \tag{7}\]

where \(\mathbf{X}\in\mathbb{R}^{T\times B\times C\times H\times W}\) (\(T\): timesteps; \(B\): batch size; \(C\): channel; \((H,W)\): spatial domain) is a 5D tensor and \(\alpha\) is a hyper-parameter set as 1.

## 4 RMP-Loss

As aforementioned, we suggest reducing the quantization error to avoid information loss in supervised training-based SNNs. In this section, we first try to provide a metric to measure the quantization error in SNNs. Then based on the metric, we introduce our method, a loss term for regularizing membrane potential, _i.e._, RMP-Loss, which can push the membrane potentials close to spike values to reduce the quantization error. Finally, theoretical proof to clarify why the RMP-Loss can prevent information loss is given.

### Quantization Error Estimation

Estimating the quantization error precisely is important for designing a method to reduce the prediction error. Hence, before giving the full details of the RMP-Loss, here we try to formulate the quantization error first. As shown in Eq. 2, the output of a neuron is dependent on the magnitude of the membrane potential. When the membrane potential exceeds the firing threshold, the output is \(1\), otherwise, is \(0\); that is, these full-precision values will be mapped to only two spike values. The difference between output, \(o\), and membrane potential, \(u\), can be measured as

\[\mathrm{Dis}(o,u)=\left\{\begin{array}{ll}1-u,&\mathrm{if}\ u\geq V_{\mathrm{ th}}\\ 0-u,&\mathrm{otherwise}\end{array}\right.. \tag{8}\]

Obviously, the closer a membrane potential is to its corresponding spike, the smaller the quantization error. The quantization error depends on the margin between the membrane potential and its corresponding spike. Then we define the quantization error as

\[q(u)=|\mathrm{Dis}(o,u)|^{p}, \tag{9}\]

where \(p>0\), which is usually set to \(1\) and/or \(2\) corresponding to L1-norm and/or L2-norm. Unless otherwise specified, we set it as 2 in the paper.

### Regularizing Membrane Potential Distribution

To mitigate the information loss problem in SNNs, the quantization error should be reduced to some extent. To this end, we propose RMP-Loss to carve the distribution to a range close to the spikes based on \(q(u)\), as

\[\mathcal{L}_{\mathrm{RMP}}=\frac{1}{TLBCWH}\sum_{t,l,b,c,w,h}q(u). \tag{10}\]

where \(T\), \(L\), \(B\), \(C\), \(W\), and \(H\) denote the number of timesteps, the number of layers, batch size, channel length, width, and height of the membrane potential map, respectively. Finally, taking classification loss into consideration, the total loss can be written as

\[\mathcal{L}_{\mathrm{CE-RMP}}=\mathcal{L}_{\mathrm{CE}}+\lambda(n)\mathcal{L }_{\mathrm{RMP}}, \tag{11}\]

where \(\mathcal{L}_{CE}\) is the cross-entropy loss, and \(\lambda(n)\) is a balanced coefficient, which changes dynamically with the training epoch. Obviously, \(\mathcal{L}_{RMP}\) does not take into account the classification problem at hand and will add a new constraint in the network optimization. To make the network parameter update have enough freedom at the beginning, which is important to train a well-performance network, and still focus on the classification task at the end. We adopt a strategy of increasing first and decreasing later to adjust the \(\lambda(n)\) as follows,

\[\lambda(n)=\left\{\begin{array}{ll}2k\frac{n}{N},&\mathrm{if}\ n\leq N/2\\ 2k(1-\frac{n}{N}),&\mathrm{otherwise}\end{array}\right., \tag{12}\]

where \(n\) is the \(n\)-th epoch and \(k\) is a coefficient, which controls the amplitude of regularization. Unless otherwise specified, we set it as 0.1 in the paper.

The final resulting RMP-Loss training method is defined in Algo. 1.

### Analysis and Discussion

In this work, we assume that RMP-Loss can help reduce the quantization loss of the SNNs. To verify our assump
tion, a theoretical analysis is conducted by using the information entropy concept. To mitigate the information loss, the output spike tensor \(\mathbf{O}\) should reflect the information of the membrane potential tensor \(\mathbf{U}\) as much as possible. Since KL-divergence is a metric to measure the difference between two random variable distributions. We use KL-divergence to compute the difference between \(\mathbf{O}\) and \(\mathbf{U}\), which refers to the difficulty of reconstructing \(\mathbf{U}\) from \(\mathbf{O}\), _i.e._, information loss degree. Then we provide the theoretical analysis below.

Let \(x^{u}\sim\mathcal{U}\) where \(x^{u}\) are samples \(\in\mathbf{U}\) and \(\mathcal{U}\) represents the distribution of \(x^{u}\). Similarily, we have \(x^{o}\sim\mathcal{O}\) where \(x^{o}\in\mathbf{O}\). We use \(P_{U}(x)\) and \(P_{O}(x)\) to denote the probability density function for \(\mathcal{U}\) and \(\mathcal{O}\), respectively. Then the information loss for the spike firing process can be described as

\[\mathcal{L}_{KL}(\mathcal{U}||\mathcal{O})=\int_{-\infty}^{\infty}P_{U}(x^{u} )\text{log}\frac{P_{U}(x^{u})}{P_{O}(x^{o})}dx. \tag{13}\]

Since output spike \(x^{o}\) is discrete, we can update it as

\[\mathcal{L}_{KL}(\mathcal{U}||\mathcal{O})=\int_{o-\epsilon}^{o+\epsilon}P_{ U}(x^{u})\log\frac{P_{U}(x^{u})}{P_{O}(x^{o})}dx, \tag{14}\]

where \(\epsilon\) is a small constant, \(o\) is the spike value, \(P_{O}(x^{o})\) can be seen as a very large constant in this situation, and \(\int_{o-\epsilon}^{o+\epsilon}P_{O}(x^{o})dx=1\). With RMP-Loss, it will become

\[\mathcal{L}_{KL}(\mathcal{\hat{U}}||\mathcal{O})=\int_{o-\epsilon}^{o+ \epsilon}P_{\hat{U}}(x^{\hat{a}})\log\frac{P_{\hat{U}}(x^{\hat{a}})}{P_{O}(x^{ o})}dx, \tag{15}\]

where \(x^{\hat{u}}\in\mathcal{\hat{U}}\) and \(\mathcal{\hat{U}}\) is the new distribution of \(x^{\hat{u}}\) adjusted by RMP-Loss. Here, we have the following propositions.

**Proposition 1**: \(\frac{d\mathcal{L}_{KL}}{dP_{U}(x^{u})}<0\)_, i.e., \(\mathcal{L}_{KL}\downarrow\) as \(P_{U}(x^{u})\uparrow\)._

**proof:** When a membrane potential \(u\) is below the firing threshold, it will be pushed to 0 by the RMP-Loss, considering its effect, and otherwise, 1. Hence the firing rate of the neuron can be seen as the same, whether using the RMP-Loss or not, _i.e._, \(P_{O}(x^{o})\) keep the same for \(\hat{\mathbf{U}}\) and \(\mathbf{U}\).

\[\frac{d\mathcal{L}_{KL}}{dP_{U}(x^{u})} =\frac{d\int_{o-\epsilon}^{o+\epsilon}P_{U}(x^{u})\log\frac{P_{U} (x^{u})}{P_{O}(x^{o})}dx}{dP_{U}(x^{u})} \tag{16}\] \[=\int_{o-\epsilon}^{o+\epsilon}(\log\frac{P_{U}(x^{u})}{P_{O}(x ^{o})}+\frac{1}{\ln 2})dx. \tag{17}\]

Since \(P_{O}(x^{o})\) is much larger than \(P_{U}(x^{u})\), we can get \(\int_{o-\epsilon}^{o+\epsilon}(\log\frac{P_{U}(x^{u})}{P_{O}(x^{o})}+\frac{1} {\ln 2})dx<0\), then \(\frac{d\mathcal{L}_{KL}}{dP_{U}(x^{u})}<0\). \(\blacksquare\)

**Proposition 2**: \(P_{\hat{U}}(x^{\hat{u}})>P_{U}(x^{u})|x=o\)_._

**proof:** We assume that there are \(n_{e}^{u}\) samples in the interval \((o-\epsilon,o+\epsilon)\) for \(\mathcal{U}\), where \(\epsilon\) is a small constant. Then we can get \(P_{U}(x^{u})\approx\frac{n_{e}^{u}}{2\epsilon}\). And we can simply see the RMP-Loss as a function to push the vanilla \(\mathbf{U}\) to \(\hat{\mathbf{U}}\), which is closer to \(\mathbf{O}\), based on its effect. Therefore, we can assume that these samples will be gathered to a new interval \((o-\epsilon_{l},o+\epsilon_{r})\), where \(\epsilon_{l},\epsilon_{r}<\epsilon\). Then we can get \(P_{\hat{U}(x^{\hat{a}})}\approx\frac{n_{e}^{u}}{\epsilon_{l}+\epsilon_{r}}\). Thereby we can have \(P_{\hat{U}(x^{\hat{a}})}>P_{U}(x^{u})|_{x=o}\). \(\blacksquare\)

Along with **Proposition 1** and **Proposition 2**, we can conclude that \(\mathcal{L}_{KL}(\mathcal{\hat{U}}||O)<\mathcal{L}_{KL}(U||O)\), _i.e._, our method with RMP-Loss enjoys lesser information loss.

## 5 Experiment

In this section, we first conducted extensive ablation studies to compare the SNNs with RMP-Loss and their vanilla counterparts to verify the effectiveness of the method. Next, we fully compared our method with other state-of-the-art (SoTA) methods. Finally, some further experimental visualizations are provided to understand the RMP-Loss.

### Datasets and Settings

**Datasets.** We conducted experiments on four benchmark datasets: CIFAR-10 (100) [33], CIFAR10-DVS [38], and ImageNet (ILSVRC12) [10]. The CIFAR-10 (100) dataset includes 60,000 images in 10 (100) classes with \(32\times 32\) pixels. The numbers of training images and test images are 50,000 and 10,000. The CIFAR10-DVS dataset is the neuromorphic version of the CIFAR-10 dataset. It is composed of 10,000 images in 10 classes. We split the dataset into 9000 training images and 1000 test images similar to [56]. ImageNet dataset consists of 1,250,000 training images and 50,000 test images.

**Preprocessing.** We applied data normalization on all static datasets to make input images have \(0\) mean and \(1\) variance. Besides, we conducted random horizontal flipping and cropping on these datasets to avoid overfitting. For CIFAR, the AutoAugment [8] and Cutout [13] were also used for data augmentation as doing in [24, 20]. For the neuromorphic dataset, we resized the training image frames to \(48\times 48\) as in [66] and adopted random horizontal flip and random roll within \(5\) pixels for augmentation. And the test images were merely resized to \(48\times 48\) without any additional processing.

**Training setup.** For all the datasets, the firing threshold \(V_{\mathrm{th}}\) was set as \(0.5\). For static image datasets, the images were encoded to binary spike using the first layer of the SNN, as in recent works [50, 17, 16]. This is similar to rate coding. For the neuromorphic image dataset, we used the \(0/1\) spike format directly. The neuron models in the output layer accumulated the incoming inputs without generating any spike as the output like in [50]. For CIFAR-10 (100) and CIFAR10-DVS datasets, we used the SGD optimizer with the momentum of \(0.9\) and learning rate of \(0.01\) with cosine decayed [43] to \(0\) as in [21]. All models were trained within \(400\) epochs with the same batch size of \(128\). For the ImageNet dataset, we adopted the SGD optimizer with
a momentum of \(0.9\) and a learning rate of \(0.1\) with cosine decayed to \(0\). All models are trained within \(320\) epochs.

### Ablation Study for RMP-Loss

We conducted a set of ablation experiments on CIFAR-10 using ResNet20, ResNet19, and VGG16 as backbones. The results are shown in Tab. 1. It can be seen that with the RMP-Loss, these SNNs can achieve higher accuracy than their vanilla counterparts. We also show the membrane potential distribution of the first layer of the second block in the ResNet20 with and without RMP-Loss on the test set of CIFAR-10 in Fig. 2. It can be seen that the models trained with RMP-Loss can shrink the membrane potential distribution range which enjoys less quantization error.

### Comparison with State-of-the-art Methods

We evaluated the proposed method with the accuracy performance on various widely used static and neuromorphic datasets using spiking ResNet20 [50, 52], VGG16 [50], ResNet18 [16], ResNet19 [66], and ResNet34 [16]. The results with the mean accuracy and standard deviation of 3-trials are listed in Tab. 2.

**CIFAR-10.** For CIFAR-10, we tested three different network architectures. The performance of our method is shown in Tab. 2. It can be seen that our method achieves the best results in most of these cases. In special, using ResNet19 [66], the RMP-Loss achieves 96.10% averaged top-1 accuracy, which improves 1.60% absolute accuracy compared with the existing state-of-the-art TET [12]. Though InfLoR-SNN [21] is slightly better than our method for 4 and 6 timesteps, it will decrease the biological plausibility of the SNN and increase the inference burden since a complex transform function is added in its spiking neuron. On ResNet20, our method can achieve higher accuracy with only 6 timesteps, while Diet-SNN [50] with 10 timesteps. On VGG16, the RMP-Loss also shows obvious advantages.

**CIFAR-100.** For CIFAR-100, we also experimented with these three different network structures. For all these configurations, our method achieves consistent and significant accuracy over prior work. ResNet20-based and VGG16-based RMP-Loss achieve 66.65% and 72.55% top-1 accuracy with only 4 timesteps, which outperform their Diet-SNN counterparts with 2.58% and 2.88% higher accuracy and Real spike counterparts with 0.05% and 1.93% respectively but with fewer timesteps. Noteworthy, our method significantly surpasses TET with 4.26% higher accuracy on ResNet19, which is not easy to achieve in the SNN field. Overall, our results on CIFAR-100 show that, when applied to a more complex dataset, the RMP-Loss achieves an even more favorable performance compared to competing methods.

**CIFAR10-DVS.** We also verified our method on the popular neuromorphic dataset, CIFAR10-DVS. It can be seen that RMP-Loss also shows amazing performance. RMP-Loss outperforms STBP-tdBN by 12.39%, RecDis-SNN by 3.78%, and InfLoR-SNN by 0.70% respectively with 76.20% top-1 accuracy in 10 timesteps using ResNet19 as the backbone. With ResNet20 as the backbone, RMP-Loss can also achieve well-performed results.

**ImageNet.** For ImageNet, we conducted experiments with ResNet18 and ResNet34 as backbones. Our results are presented in Tab. 4. In these normal spiking structures, our method achieves the highest accuracy among these SoTA prior works. However, our method is slightly worse than SEW ResNet [16]. This is because that SEW ResNet uses an atypical architecture, which abandons binary spike forms but will output arbitrary integers to transmit information, thus enjoying higher accuracy but the efficiency from mul

\begin{table}
\begin{tabular}{l l l l l l} \hline \hline Dataset & Architecture & Type & Timestep & Accuracy & Quantization error \\ \hline \multirow{6}{*}{CIFAR-10} & \multirow{2}{*}{ResNet20} & Without RMP-Loss & 4 & 91.26\% & 0.186 \\  & & With RMP-Loss & 4 & **91.89\%** & 0.121 \\ \cline{2-5}  & & Without RMP-Loss & 4 & 95.04\% & 0.128 \\  & & With RMP-Loss & 4 & **95.51\%** & 0.104 \\ \cline{2-5}  & \multirow{2}{*}{VGG16} & Without RMP-Loss & 4 & 92.80\% & 0.174 \\  & & With RMP-Loss & 4 & **93.33\%** & 0.135 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Ablation Study for RMP-Loss

Figure 2: The effect of RMP-Loss. The overall original membrane potential distribution (left) and the redistributed membrane potential distribution by RMP-Loss (right) of the first layer of the second block in ResNet20 on CIFAR-10 test sets.
\begin{table}
\begin{tabular}{l l l c c c} \hline \hline Dataset & Method & Type & Architecture & Timestep & Accuracy \\ \hline \multirow{8}{*}{CIFAR-10} & SpikeNorm [52] & ANN2SNN & VGG16 & 2500 & 91.55\% \\  & Hybrid-Train [51] & Hybrid training & VGG16 & 200 & 92.02\% \\  & Spike-Thrift [35] & Hybrid training & VGG16 & 100 & 91.29\% \\  & Spike-basedBP [36] & SNN training & ResNet11 & 100 & 90.95\% \\  & STBP [56] & SNN training & CIFARNet & 12 & 90.53\% \\  & TSSL-BP [64] & SNN training & CIFARNet & 5 & 91.41\% \\  & PLIF [17] & SNN training & PLIFNet & 8 & 93.50\% \\  & DSR [44] & SNN training & ResNet18 & 20 & 95.40\% \\  & Joint A-SNN [23] & SNN training & ResNet18 & 4 & 95.45\% \\ \cline{2-6}  & \multirow{4}{*}{SNN training} & VGG16 & \multirow{4}{*}{20} & 5 & 92.70\% \\  & & & & 10 & 93.44\% \\ \cline{3-6}  & & ResNet20 & 5 & 91.78\% \\  & & & & 10 & 92.54\% \\ \cline{2-6}  & \multirow{4}{*}{RecDis-SNN [24]} & \multirow{4}{*}{SNN training} & \multirow{4}{*}{ResNet19} & 2 & 93.64\% \\  & & & & 6 & 95.55\% \\ \cline{3-6}  & & & & 2 & 92.34\% \\  & & & & 4 & 92.92\% \\  & & & & 6 & 93.16\% \\ \hline \multirow{2}{*}{TET [12]} & \multirow{2}{*}{SNN training} & \multirow{2}{*}{ResNet19} & 2 & 94.16\% \\  & & & & 4 & 94.44\% \\  & & & & 6 & 94.50\% \\ \hline \multirow{2}{*}{InfLoR-SNN [21]} & \multirow{2}{*}{SNN training} & \multirow{2}{*}{ResNet19} & 2 & 94.44\% \\  & & & & 4 & 96.27\% \\  & & & & 6 & 96.49\% \\ \hline \multirow{2}{*}{**RMP-Loss**} & \multirow{2}{*}{SNN training} & ResNet19 & 2 & **95.31\%**\(\pm 0.07\) \\  & & & 4 & **95.51\%**\(\pm 0.08\) \\  & & & & 6 & **96.10\%**\(\pm 0.08\) \\ \cline{3-6}  & & & & 2 & **91.89\%**\(\pm 0.05\) \\  & & & & 6 & **92.55\%**\(\pm 0.06\) \\ \cline{3-6}  & & & & 6 & **93.33\%**\(\pm 0.07\) \\ \hline \multirow{2}{*}{CIFAR-100} & DSR [44] & SNN training & ResNet18 & 20 & 78.50\% \\  & InfLoR-SNN [21] & SNN training & VGG16 & 5 & 71.56\% \\  & IM-Loss [20] & SNN training & VGG16 & 5 & 70.18\% \\ \cline{2-6}  & \multirow{2}{*}{SNN training} & ResNet20 & 5 & 64.07\% \\  & & & VGG16 & 5 & 69.67\% \\ \cline{2-6}  & Real Spike [25] & SNN training & ResNet20 & 5 & 66.60\% \\  & & & VGG16 & 5 & 70.62\% \\ \hline \multirow{2}{*}{CIFAR-100} & \multirow{2}{*}{TET [12]} & \multirow{2}{*}{SNN training} & \multirow{2}{*}{ResNet19} & 2 & 72.87\% \\  & & & & 4 & 74.47\% \\  & & & & 6 & 74.72\% \\ \cline{3-6}  & & & ResNet20 & 4 & **66.65\%**\(\pm 0.10\) \\ \cline{3-6}  & & & & 10 & **73.30\%**\(\pm 0.11\) \\ \cline{2-6}  & \multirow{2}{*}{SNN training} & \multirow{2}{*}{ResNet19} & 2 & **74.66\%**\(\pm 0.12\) \\  & & & & 4 & **78.28\%**\(\pm 0.10\) \\  & & & & 6 & **78.98\%**\(\pm 0.08\) \\ \hline \hline \end{tabular}
\end{table}
Table 2: Comparison with SoTA methods on CIFAR-10/100.
tiplication free of SNNs will be lost. Hence, it would be limited in some applications while our method not.

### Visualization

Furthermore, we also provide some experimental visualizations to show the regularizing effects of RMP-Loss. Fig. 3 shows the membrane potential distribution of the first layer of the second block in the ResNet20/19 with and without RMP-Loss on the test set of CIFAR-10. It can be seen that the SNN models trained with RMP-Loss can shrink the membrane potential distribution range which enjoys less quantization error. On the other hand, comparing the membrane potential distribution difference between ResNet20 and ResNet19, it can be found that the membrane potential distribution of ResNet19 is thinner than that of ResNet20 too. Considering that ResNet19 can achieve higher accuracy than ResNet20, it also shows that reducing quantization error is effective to improve the accuracy of SNN models and our route to improve the SNN accuracy by reducing the quantization error is reasonable.

## 6 Conclusion

This paper aims at addressing the information loss problem caused by the \(0/1\) spike quantization of SNNs. We introduce RMP-Loss to adjust the membrane potential to

\begin{table}
\begin{tabular}{l l l l l l} \hline \hline Method & Type & Architecture & Timestep & Spike form & Accuracy \\ \hline Hybrid-Train [51] & Hybrid training & ResNet34 & 250 & Binary & 61.48\% \\ SpikeNorm [52] & ANN2SNN & ResNet34 & 2500 & Binary & 69.96\% \\ STBP-tdBN [66] & SNN training & ResNet34 & 6 & Binary & 63.72\% \\ TET [12] & SNN training & ResNet34 & 6 & Binary & 64.79\% \\ \hline SEW ResNet [16] & SNN training & ResNet18 & 4 & Integer & **63.18\%** \\  & & ResNet34 & 4 & Integer & **67.04\%** \\ \hline Spiking ResNet [16] & SNN training & ResNet18 & 4 & Binary & 62.32\% \\  & & ResNet34 & 4 & Binary & 61.86\% \\ \hline
**RMP-Loss** & SNN training & ResNet18 & 4 & Binary & 63.03\%\(\pm 0.07\) \\  & & ResNet34 & 4 & Binary & 65.17\%\(\pm 0.07\) \\ \hline \hline \end{tabular}
\end{table}
Table 4: Comparison with SoTA methods on ImageNet.

Figure 3: The original membrane potential distribution (left) and the redistributed membrane potential distribution by RMP-Loss (right) of the first layer of the second block in ResNet20/19 on CIFAR-10 test sets.

\begin{table}
\begin{tabular}{l l l l l l} \hline \hline Dataset & Method & Type & Architecture & Timestep & Accuracy \\ \hline \multirow{8}{*}{CIFAR10-DVS} & Rollout [34] & Rollout & DenseNet & 10 & 66.80\% \\  & STBP-tdBN [66] & SNN training & ResNet19 & 10 & 67.80\% \\  & LIAF [57] & Conv3D & LIAF-Net & 10 & 71.70\% \\  & LIAF [57] & LIAF & LIAF-Net & 10 & 70.40\% \\  & RecDis-SNN [24] & SNN training & ResNet19 & 10 & 72.42\% \\ \cline{2-6}  & InfLoR-SNN [21] & SNN training & ResNet19 & 10 & 75.50\% \\  & & ResNet20 & 10 & 75.10\% \\ \cline{2-6}  & & & ResNet19 & 10 & **76.20\%\(\pm 0.20\)** \\ \cline{2-6}  & & & ResNet20 & 10 & **75.60\%\(\pm 0.30\)** \\ \hline \hline \end{tabular}
\end{table}
Table 3: Comparison with SoTA methods on CIFAR10-DVS.
reduce the quantization error. Different from other methods that reduce the quantization error indirectly or will induce more parameters, RMP-Loss focuses on handling this problem directly and will introduce no extra parameters in the inference phase. We show that our method outperforms SoTA methods on both static and neuromorphic datasets.

## Acknowledgment

This work is supported by grants from the National Natural Science Foundation of China under contracts No.12202412 and No.12202413.
