Polarity multi-spiking neuron-based spiking neural network single time step conversion method
By combining polar quantization activation functions and enhanced integral-fire neurons, the problems of information loss and high latency in ANN-to-SNN conversion are solved, achieving efficient SNN conversion and improving conversion accuracy and inference efficiency.
Patent Information
- Application Number
- CN202511095191.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-06
- Publication Date
- 2025-11-07
AI Technical Summary
Existing ANN-to-SNN conversion methods struggle to achieve lossless conversion under low latency conditions, and common quantization strategies neglect the encoding of negative value information, leading to a decline in the classification performance of SNNs.
By employing polar quantization activation functions and enhanced integral-fire neurons, and optimizing hyperparameters through grid search, SNNs supporting multi-pulse firing are constructed, preserving the positive and negative activation information of the batch normalization layer output, and firing multiple pulses within a single time step.
It achieves accuracy comparable to ANNs in a single time step and maintains stable performance in subsequent time steps, reducing inference latency and energy consumption, and improving the feasibility of SNN applications.
Smart Images

Figure CN120911522A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the field of brain-like computing and spiking neural networks, and particularly relates to a spiking neural network single time step conversion method based on a polar multi-spiking neuron. BACKGROUND
[0002] Spiking neural networks (SNNs) are a class of biological-inspired neural networks that encode and transmit information through discrete spike events. Compared with traditional artificial neural networks (ANNs), SNNs have natural event-driven characteristics and energy efficiency advantages, and are particularly suitable for deployment in low-power, edge computing and other resource-constrained scenarios.
[0003] The current mainstream technical path for constructing deep SNNs mainly includes two categories: one is a direct training method that introduces a differentiable proxy gradient to approximate the non-differentiable spike firing operation, but this method needs to set a longer time step in the training stage to ensure the reliability of the proxy gradient, which significantly increases the computational complexity and training energy consumption. The second is an ANN-to-SNN conversion method, which first trains ANNs using traditional backpropagation algorithms and maps the pre-trained ANN weights to SNNs, thereby avoiding the complex training process of SNNs and achieving similar performance to ANNs on multiple large-scale datasets. However, due to the essential difference between continuous activation values in ANNs and discrete spike expressions in SNNs, direct conversion can easily cause accuracy loss, and this error is easily amplified layer by layer in deep networks. Previous methods usually introduce longer time steps to approximate continuous output during the inference stage, but this also significantly increases the inference delay and energy consumption.
[0004] Some current research on ANN-to-SNN conversion methods quantizes the activation function of ANNs to discretize continuous activation values to a limited bit width. The converted SNNs can more accurately reproduce the outputs of the corresponding quantized activations of each layer of ANNs in a shorter time step, thereby effectively reducing the delay required for conversion. However, the single spike firing mechanism is still used in common quantization strategies, which makes it difficult to achieve lossless conversion in the case of ultra-low delay. In addition, the quantized activation function usually ignores the encoding of negative value components in the output of the batch normalization layer, resulting in the truncation or loss of negative value information, which weakens the representation ability of ANNs in negative value encoding and ultimately reduces the classification performance of the converted SNNs. SUMMARY
[0005] In order to solve the prior art problems, the application provides a single time step conversion method of a spiking neural network based on a polar multi-pulse neuron, which proposes a polar quantization activation function for an artificial neural network (ANN) in view of the problem that a traditional quantization activation function is easy to cause information loss; a matching search strategy is introduced to obtain a local optimal super parameter combination to improve the expression ability of the ANN; and an enhanced integrate-and-fire neuron supporting multiple positive and negative pulses in a single time step is used to construct a spiking neural network (SNN) with the same structure as the original ANN. The experimental results show that the SNN converted by the method provided by the application reaches the accuracy of the ANN in the first time step, and maintains stable performance in multi-time step reasoning. Therefore, the application will help to improve the conversion accuracy and reasoning efficiency of the SNN model, and has a wide application prospect in intelligent edge devices and brain-like chips and the like.
[0006] The application achieves the following technical solutions:
[0007] A single time step conversion method of a spiking neural network based on a polar multi-pulse neuron, comprising the following steps:
[0008] S1: constructing an artificial neural network with a polar quantization activation (PQA) function; wherein the polar quantization activation function is used in the output model of the first layer of the artificial neural network
[0009]
[0010] wherein, x represents an input activation value, f represents a learnable quantization threshold value of the first layer, clip represents a clipping function for limiting the input x in the interval [-a, a], a and b respectively represent the lower limit and the upper limit of the clipping, and satisfy a < b, q represents a quantization level, and represents rounding a real number to the nearest integer.
[0011] S2: determining the quantization level q and the initial threshold value of the activation function of each layer in the artificial neural network, and screening the super parameters a and b in the polar quantization activation function by using a grid search strategy configuring the artificial neural network;
[0012] S3 adopts the back propagation method to train the artificial neural network to obtain the optimal weight parameters and threshold values of each layer of the artificial neural network ;
[0013] S4 constructs a pulse neural network with the same structure as the artificial neural network described in step S1 based on an enhanced integrate-and-fire (AIF) neuron that can fire multiple polarity pulses in a single time step
[0014] S5 maps the weight parameters in the artificial neural network trained in step S3 to the pulse neural network described in step S4; wherein
[0015] The threshold value of the first layer neuron is set as: The threshold value of the first layer neuron is set as:
[0016]
[0017] wherein: is the threshold value of the first layer in the ANNs; is the threshold value of the first layer in the ANNs;
[0018] The initial membrane potential is set as:
[0019]
[0020] Test the effect of the SNN model to obtain a trained deep SNN.
[0021] Further, the S2 step adopts a grid search strategy to screen the hyperparameters in the polarity quantization activation function and The process comprises:
[0022] 201 split the information entropy of the output model of the polarity quantization activation function through an intermediate variable , respectively: the discrete entropy of the truncated interval , the discrete entropy of the main interval , and the discrete entropy of the upper truncated interval ; wherein:
[0023]
[0024]
[0025]
[0026] wherein: denotes the cumulative distribution function of the standard normal distribution, and correspond to the upper limit of the shear and the lower bound of the clipping , , , for determining the range of discrete activation intervals covered by the quantized output value, the symbol represents the floor operation; The three parts of , , and have their own accurate values;
[0027] 202 compares the output information entropy of the polar quantized activation function with the output information entropy of the batch normalization layer , and screens out parameters that satisfy , .
[0028] Further, the mechanism of the enhanced integrate-fire neuron in the S4 step supporting the firing of multiple polar pulses in a single time step includes:
[0029] 401 obtains the output of the layer by the following formula: The enhanced integrate-fire neuron of the layer receives the output from the layer at time step
[0030] , and updates the membrane potential as:
[0031]
[0032] where represents the firing threshold of the layer, represents the pulse output of the layer at time ; represents the membrane potential of the neuron before firing a pulse at time ; represents the membrane potential of the neuron of the layer after firing a pulse at time ;
[0033] 402 obtains the pulse firing of the enhanced integrate-fire neuron of the layer at time according to the membrane potential intensity in a single time step by the firing function :
[0034]
[0035] When , the neuron will fire a corresponding number of positive pulses according to the ratio of membrane potential to threshold ; conversely, when , a negative pulse is fired until the membrane potential returns to the interval or Shear function Set upper and lower limits for the number of positive and negative pulses in each time step, respectively and ;
[0036] The enhanced integrate-and-fire neuron of the first layer adopts a soft reset mechanism to obtain the membrane potential after firing a pulse at time According to the following formula :
[0037]
[0038] Advantages
[0039] 1、The pulse neural network single time step conversion method based on the polarity multi-pulse neuron proposed by the application can significantly reduce the inference delay and energy consumption of the pulse neural network while maintaining the accuracy of the artificial neural network.
[0040] 2、The application designs an information entropy lossless polarity quantization activation function, retains the positive and negative activation information in the batch normalization layer output, and alleviates the information loss caused by traditional quantization; an enhanced integrate-and-fire neuron model supporting multi-pulse firing is introduced, so that the pulse expression is more rich.
[0041] 3、The application cooperates with the threshold mapping mechanism and the membrane potential initialization strategy, can reach the accuracy comparable to the original ANNs in the first time step, and keeps the performance stable in the subsequent time steps, effectively improves the application feasibility of SNNs in low-delay neuromorphic computing. DETAILED DESCRIPTION
[0042] Figure 1 is a flowchart of a pulse neural network conversion method based on a polarity quantization activation function and an enhanced integrate-and-fire neuron proposed by the application;
[0043] Figure 2 is a schematic diagram of the firing mechanism of the enhanced integrate-and-fire neuron. DETAILED DESCRIPTION
[0044] The technical scheme of the application will be described in detail below with reference to the accompanying Figure 1 drawings Figure 2 .
[0045] The application aims at the problems existing in the prior art, and provides a high-efficiency single-time-step conversion method of a pulse neural network based on a polarity multi-pulse neuron.
[0046] The application provides a high-efficiency single-time-step conversion method of a pulse neural network based on a polarity multi-pulse neuron, as shown in the formula (1), comprising the following steps: Figure 1
[0047] The application aims at the problems existing in the prior art, and provides a high-efficiency single-time-step conversion method of a pulse neural network based on a polarity multi-pulse neuron.
[0048] S1: constructing an artificial neural network (ANN), wherein a polarity-aware quantization activation (PQA) function is introduced in each layer activation function of the network to reduce information loss caused by a traditional quantization function.
[0049]
[0050] wherein, is an input activation value, is a learnable quantization threshold of an i-th layer, is a clipping function for limiting input values in an interval [a, b], and a, b are a lower bound and an upper bound of clipping, respectively, and satisfy a < b, is a quantization level, and represents rounding a real number to the nearest integer. S2: determining a quantization level q and initial thresholds of activation functions of each layer in the ANN, and performing a grid search strategy on hyperparameters a and b in the PQA function in S1 to configure the artificial neural network. In the search process, information entropy is used as a measurement index, theoretical calculation is performed on information entropy H(PQA) of an output distribution of the PQA function, and comparison is performed with theoretical information entropy H(BN) corresponding to an output of a BN layer to screen out a parameter group satisfying H(PQA) < H(BN).
[0051] S2: determining a quantization level q and initial thresholds of activation functions of each layer in the ANN, and performing a grid search strategy on hyperparameters a and b in the PQA function in S1 to configure the artificial neural network. In the search process, information entropy is used as a measurement index, theoretical calculation is performed on information entropy H(PQA) of an output distribution of the PQA function, and comparison is performed with theoretical information entropy H(BN) corresponding to an output of a BN layer to screen out a parameter group satisfying H(PQA) < H(BN). parameters.
[0052] Specifically, considering that the BN layer normalizes the input to approximately obey a standard normal distribution with mean 0 and variance 1, the corresponding information entropy is The present application calculates the corresponding information entropy of the PQA output by establishing a probability model of the PQA output , and uses it as a basis for evaluating whether different hyperparameter combinations are optimal.
[0053] The form definition of the PQA function is shown in the formula The intermediate variable is defined as , and it can be known that obeys a normal distribution with mean 0 and variance , and the value range is . For any integer , , it can be obtained that Therefore, after clipping, the probability mass function of the PQA function output can be composed of three parts: the cumulative probability of the lower clipping limit, the discrete probability in the quantization interval, and the cumulative probability after the upper clipping limit.
[0054] Correspondingly, the information entropy of the output variable can be divided into three parts: the discrete entropy of the lower truncated interval , the discrete entropy of the main interval , and the discrete entropy of the upper truncated interval .
[0055] The corresponding formula is:
[0056]
[0057]
[0058]
[0059]
[0060] wherein denotes the cumulative distribution function of the standard normal distribution, and correspond to the integer interval boundaries mapped by the upper clipping limit and the lower clipping limit of the clipping, i.e. , , which are used to determine the discrete activation interval range covered by the quantized output value, and the symbol denotes the floor operation. The three parts of , , and Each has its own exact value. Fixed. and Then, a grid search strategy can be used to calculate the result under these conditions. All values of , and thus find a set of hyperparameters that satisfy
[0061] S3: Train the artificial neural network constructed above using the backpropagation method to obtain the final weight parameters and thresholds for each layer. .
[0062] S4: Construct a spiking neural network (SNN) with the same ANN structure as described in S1 using enhanced integral-fire (AIF) neurons. The membrane potential update method of the AIF neurons is as shown in the formula. As shown in the formula, the disbursement function is... As shown, the membrane potential reset mechanism is as follows: As shown. Specific details:
[0063] Based on AIF neurons, SNNs with the same structure as the ANNs described in S1 are constructed. AIF neurons support firing multiple polar pulses within a single time step.
[0064] In the AIF neurons in the layer at time step Receive from the Layer output The membrane potential update rule is:
[0065]
[0066]
[0067] in Indicates the first The layer's distribution threshold, Indicates the first Layer in The pulse output at any given moment. Indicates that neurons are The membrane potential before the pulse is emitted at any time. Indicates the first Neurons in the layer The membrane potential after the pulse is emitted at any given time. AIF neurons in a layer fire multiple pulses of positive and negative polarity within a single time step based on the membrane potential intensity; their firing function... exist Pulse delivery at specific times satisfy:
[0068]
[0069] When , the neuron will fire a corresponding number of positive pulses according to the ratio of membrane potential to threshold ; conversely, when , it will fire negative pulses until the membrane potential returns to the interval or . The clipping function sets upper and lower limits for the number of positive and negative pulses in each time step, respectively and .
[0070] The AIF neuron adopts a soft reset mechanism, and the membrane potential of the neuron in the first layer after firing a pulse at time satisfies the formula:
[0071]
[0072] S5 maps the weight parameters in the artificial neural network trained in step S3 to the pulse neural network described in step S4; wherein:
[0073] The threshold value of the neuron in the first layer is set as:
[0074] ;
[0075] Wherein: is the threshold value of the first layer in the ANN;
[0076] The initial membrane potential is set as:
[0077]
[0078] Test the effect of the SNN model to obtain a trained deep SNN.
[0079] Table 1 shows the comparison of the present application and the current latest pulse neural network model, the accuracy in the table is obtained based on the mainstream CIFAR10 and CIFAR100 data sets using the VGG16 architecture. Among them, the TSO method is derived from the paper “Toward High-Accuracy and Low-Latency Spiking Neural Networks With Two-Stage Optimization”, the COS method is derived from the paper “Bridging the Gap between ANNs and SNNs by Calibrating Offset Spikes”, and the QCFS method is derived from the paper “Optimal ANN-SNN Conversion for High-accuracy and Ultra-low-latency Spiking Neural Networks”.
[0080] Table 1
[0081]
[0082] Although the present application is described above, the present application is not limited to the specific embodiments described above, and the specific embodiments described above are merely illustrative and not limiting, and a person of ordinary skill in the art can make many modifications under the inspiration of the present application without departing from the purpose of the present application, and these all belong to the protection of the present application.
Claims
1. A polar multi-pulse neuron based spiking neural network single time step conversion method, characterized in that, Comprising the following steps: S1 constructs an artificial neural network with a polar quantization activation function, which can reduce the information loss of the output of the batch normalization layer after activation compared with the traditional quantization function; wherein: the polar quantization activation function is used in the output model of the first layer of the artificial neural network : ; wherein, is the weighted input value, is the weight of the layer, is the output of the layer, is the learnable quantization threshold of the layer, is a clipping function that limits the intermediate computation result to the interval , and are the lower and upper clipping bounds, respectively, satisfying and , is the quantization level, denotes rounding a real number to the nearest integer. S2 determines the quantization order and the initial threshold of the activation function of each layer in the artificial neural network and adopts a grid search strategy to screen the hyperparameters in the polar quantization activation function and configuring an artificial neural network; S3 adopts the back propagation method to standard train the artificial neural network to obtain the most weight parameters and threshold of each layer of the artificial neural network ; S4, constructing a pulse neural network with the same structure as the artificial neural network in step S1 based on the enhanced integrate-and-fire neuron that fires multiple polarity pulses within a single time step; S5, mapping the weight parameters in the artificial neural network trained in step S3 to the pulse neural network in step S4; wherein: The first Threshold of a layer neuron is set to: ; wherein: is the threshold value of the layer in the ANNs; The initial membrane potential is set as: Test the effect of the SNN model, and obtain a trained deep SNN.
2. The single time step conversion method of a polar multi-pulse neuron-based spiking neural network according to claim 1, wherein, The S2 step adopts a grid search strategy to screen the hyperparameters in the polar quantization activation function With The process comprises: 201 through intermediate variables Splitting information entropy of polar quantization activation function output model , respectively: discrete entropy of the truncated interval , discrete entropy of the main interval , and discrete entropy of the upper truncated interval ; wherein: ; wherein: denotes the cumulative distribution function of the standard normal distribution, and correspond to the upper shear bound and the lower shear bound mapped to the integer interval boundaries, i.e. , , used to determine the range of discrete activation intervals covered by the quantized output value, the sign denotes the floor operation; the three parts of , , and have respective accuracy values; 202 Entropy of output information of polar quantized activation function Entropy of output information of batch normalization layer Comparison is made, and parameters satisfying , are screened out. 3. The single time step conversion method of a polar multi-pulse neuron-based spiking neural network according to claim 1, wherein, The mechanism of the enhanced integrate-and-fire neuron in the S4 step that fires multiple polarity pulses within a single time step comprises: 401 The first layer's output is obtained by the formula The enhanced integrate-and-fire neuron in the time step Receives from the first layer The layer's output And updates the membrane potential: ; ; in: Indicates the first The layer's distribution threshold, Indicates the first Layer in Pulse output at any given moment; Indicates that neurons are The membrane potential before the pulse is emitted at any given moment; Indicates the first Neurons in the layer Membrane potential after each pulse is emitted; 402 through a firing function obtained the first layer of enhanced integrate-and-fire neurons obtains a spike at a time instant according to the membrane potential intensity at a single time step : ; When , the neuron fires a positive spike of size proportional to the ratio of the membrane potential to the threshold ; conversely, when , it fires a negative spike until the membrane potential returns to the interval or ; the shear function sets upper and lower bounds on the number of positive and negative spikes per time step, respectively and ; The first The enhanced integrate-and-fire neuron of the layer adopts a soft reset mechanism to obtain the membrane potential after firing a pulse at time t according to the following formula : V(t) = (1 - a) * V(t - 1) + a * I(t - 1) : 。