Robustness enhancement method for spiking neural networks based on neural activation and connection optimization
By introducing burst-enhanced spiking neurons and activation-perception regularization terms into spiking neural networks, the activation and connection weights of neurons are optimized, thus solving the trade-off between accuracy and robustness in computer vision tasks and achieving simultaneous improvement in both accuracy and robustness with high energy efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INST OF AUTOMATION CHINESE ACAD OF SCI
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-23
AI Technical Summary
Spiking neural networks face a trade-off between accuracy and robustness in computer vision tasks, exhibiting particularly low robustness when faced with input perturbations, making it impossible to achieve both high accuracy and strong robustness simultaneously.
We employ burst-enhanced spiking neurons and activation-aware regularization terms. By optimizing neuron activation through a quantized linear mapping function and imposing constraints on connection weights using activation-aware regularization terms, we optimize network sparsity, suppress overfitting, and enhance the model's adaptability to noise and input variations.
While maintaining the high energy efficiency of spiking neural networks, it significantly improves the accuracy and robustness of the model in computer vision tasks, and enhances its adaptability to noise and input variations.
Smart Images

Figure CN122263974A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and neural network technology, and in particular to a method for enhancing the robustness of spiking neural networks based on neural activation and connection optimization. Background Technology
[0002] Spiking Neural Networks (SNNs), as the third generation of neural networks, have shown great potential in low-power computing due to their event-driven characteristics and biologically inspired sparse computation, making them particularly suitable for deployment on resource-constrained edge devices. In recent years, with advancements in training algorithms, the performance of SNNs in computer vision tasks such as image classification and object detection has gradually approached that of traditional artificial neural networks.
[0003] However, SNNs face a key challenge in practical deployment: their performance (especially robustness) still lags behind that of Artificial Neural Networks (ANNs). Specifically, SNNs suffer from a significant accuracy-robustness tradeoff. On the one hand, traditional SNN neurons typically employ a binary (all-or-none) activation mechanism. While this simplified mechanism helps conserve energy, it also leads to larger quantization errors, limiting the model's expressive power and making it more susceptible to neuron state flipping when faced with input perturbations (such as adversarial attacks or natural corruption), resulting in error accumulation and a significant performance degradation. Summary of the Invention
[0004] This invention provides a robustness enhancement method for spiking neural networks based on neural activation and connectivity optimization, which addresses the shortcomings of existing spiking neural networks in simultaneously achieving high accuracy and strong robustness. This method achieves simultaneous improvement in accuracy and robustness while maintaining the high energy efficiency advantage of spiking neural networks.
[0005] This invention provides a robustness enhancement method for spiking neural networks based on neural activation and connection optimization, comprising the following steps: Constructing a spiking neural network model for processing computer vision tasks, wherein the neurons of the spiking neural network model are burst-enhanced spiking neurons, the input of the spiking neural network model is image data, and the output of the spiking neural network model is the image processing result corresponding to the computer vision task; wherein, when the membrane potential of the burst-enhanced spiking neurons exceeds a firing threshold, the portion exceeding the membrane potential is converted into a pulse output within a burst window through a quantized linear mapping function, the number of pulse outputs being an integer between 0 and a preset maximum number of burst pulses; during training the spiking neural network model, an activation-aware regularization term is added to the total loss function; wherein, the activation-aware regularization term imposes constraints on the connection weights based on the activation state during the forward propagation process.
[0006] According to the present invention, a robustness enhancement method for spiking neural networks based on neural activation and connection optimization is provided. The activation-aware regularization term includes a first penalty term. The method further includes: determining a plurality of activated presynaptic channels under a given input; for each of the plurality of activated presynaptic channels, determining the product between the L1 norm of the weight vector of the activated presynaptic channel and the activation value coefficient of the activated presynaptic channel; and using the sum of the products of the plurality of activated presynaptic channels as the first penalty term.
[0007] According to the present invention, a robustness enhancement method for spiking neural networks based on neural activation and connection optimization is provided. The activation-aware regularization term includes a second penalty term. The method further includes: determining a plurality of inactive presynaptic channels under the given input; for each of the plurality of inactive presynaptic channels, constraining the L1 norm of the weight vector of the inactive presynaptic channel to be no less than the maximum value of the L1 norm of the weight vectors of all activated presynaptic channels in the same layer; when the L1 norm of the weight vector of a target inactive presynaptic channel is lower than the maximum value of the L1 norm of the weight vectors of all activated presynaptic channels in the same layer, determining the difference between the maximum value and the L1 norm of the weight vector of the target inactive presynaptic channel; and summing the differences corresponding to all target inactive presynaptic channels as the second penalty term.
[0008] According to the present invention, a robustness enhancement method for spiking neural networks based on neural activation and connectivity optimization is provided, wherein the quantized linear mapping function is expressed by the following formula: ; in, This indicates the number of pulse outputs. This indicates the preset maximum number of burst pulses. This represents the membrane potential. This indicates the issuance threshold. This represents the hyperparameter indicating the potential increment required to generate an additional pulse. This represents the floor function. Describes the minimum value function. This represents the maximum value function.
[0009] According to the present invention, a robustness enhancement method for spiking neural networks based on neural activation and connectivity optimization is provided, wherein the activation-aware regularization term is expressed by the following formula: ; in, This represents the activation-aware regularization term. Indicates a given input, Indicates that in all layers given input The set of indices of the presynaptic channels that are activated. Indicates channel The activation value coefficient, Indicates channel The weight vector, Describing the L1 norm, Indicates the total number of network layers. Indicates the first In the layer, given input The set of indices of the unactivated presynaptic channels. Indicates the first In-layer passage The weight vector, Indicates the first The maximum L1 norm of the weight vectors of all activated presynaptic channels in the layer.
[0010] According to the present invention, a robust enhancement method for spiking neural networks based on neural activation and connectivity optimization is provided. The burst-enhanced spiking neuron is constructed based on a memory-parallel spiking neuron model, and the membrane potential of the burst-enhanced spiking neuron is expressed by the following formula: ; in, This represents the membrane potential. Represents the temporal convolution kernel. Represents the modulation function. Represents a memory unit. Represents the input current sequence; ; in, This represents the learnable scaling factor.
[0011] This invention also provides a robust enhancement device for spiking neural networks based on neural activation and connection optimization, comprising the following modules: a construction module for constructing a spiking neural network model for processing computer vision tasks, wherein the neurons of the spiking neural network model are burst-enhanced spiking neurons, the input of the spiking neural network model is image data, and the output of the spiking neural network model is the image processing result corresponding to the computer vision task; wherein, when the membrane potential of the burst-enhanced spiking neuron exceeds a firing threshold, the portion exceeding the membrane potential is converted into a pulse output within a burst window through a quantized linear mapping function, and the number of pulse outputs is an integer between 0 and a preset maximum number of burst pulses; and a training module for adding an activation-aware regularization term to the total loss function when training the spiking neural network model; wherein, the activation-aware regularization term imposes constraints on the connection weights according to the activation state during the forward propagation process.
[0012] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the robustness enhancement method for spiking neural networks based on neural activation and connection optimization as described above.
[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the robustness enhancement method for spiking neural networks based on neural activation and connection optimization as described above.
[0014] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the robustness enhancement method for spiking neural networks based on neural activation and connection optimization as described above.
[0015] This invention provides a robustness enhancement method for spiking neural networks based on neural activation and connection optimization. First, a spiking neural network model employing burst-enhanced spiking neurons is constructed. When the membrane potential exceeds a firing threshold, a quantized linear mapping function converts the excess threshold portion into integer pulse outputs within the burst window, ranging from 0 to a preset maximum number of burst pulses. This allows neurons to encode image features with a finer dynamic range, enhancing the richness and accuracy of information representation, thereby directly improving the model's accuracy in computer vision tasks. During the training phase, an activation-aware regularization term is introduced into the total loss function. This regularization term applies adaptive constraints to the connection weights based on the activation state during forward propagation, effectively optimizing network activation sparsity, suppressing overfitting, and enhancing the model's adaptability to noise and input variations, thus significantly improving robustness. These factors together promote the simultaneous improvement of the accuracy and robustness of spiking neural network models in computer vision tasks. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced one by one below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0017] Figure 1 This is a flowchart illustrating the robustness enhancement method for spiking neural networks based on neural activation and connection optimization provided by the present invention.
[0018] Figure 2 This is a schematic diagram illustrating the precision-robustness tradeoff between SNN and ANN provided by the present invention.
[0019] Figure 3 This is a schematic diagram of spiking neuron behavior analysis under the Modified-PLIF-Net architecture provided by this invention.
[0020] Figure 4 This is an overview diagram of the method provided by the present invention.
[0021] Figure 5 This is a network architecture diagram provided by the present invention.
[0022] Figure 6 This is a schematic diagram illustrating the statistical comparison of neuron activation rate and network weights provided by the present invention.
[0023] Figure 7 This is a schematic diagram of the corrupted CIFAR10-C and ImageNet-C examples provided by the present invention.
[0024] Figure 8This is a schematic diagram illustrating the comparison of robustness against common types of damage provided by the present invention.
[0025] Figure 9 This is a schematic diagram illustrating the effect of the maximum number of pulses provided by this invention on accuracy and robustness.
[0026] Figure 10 This is a schematic diagram illustrating the relationship between accuracy and computational overhead provided by the present invention.
[0027] Figure 11 This is a schematic diagram comparing binary pulses and burst pulses provided by the present invention.
[0028] Figure 12 This is a schematic diagram of the interlayer flip rate analysis provided by the present invention.
[0029] Figure 13 This is a schematic diagram of the t-SNE feature visualization provided by the present invention.
[0030] Figure 14 This is a schematic diagram of the input activation weight comparison provided by the present invention.
[0031] Figure 15 This is a schematic diagram of the module of the robustness enhancement device for spiking neural networks based on neural activation and connection optimization provided by the present invention.
[0032] Figure 16 This is a schematic diagram of the physical structure of the electronic device provided by the present invention. Detailed Implementation
[0033] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0034] Research has found that many SNN models have "input activation weights" (i.e., the total number of weights actually involved in the forward computation) that even exceed those of ANNs under equivalent conditions. This means that SNNs fail to effectively utilize their inherent sparsity advantage to improve robustness. Unoptimized connection weights amplify the impact of perturbations and weaken the model's stability.
[0035] Therefore, how to improve the accuracy and robustness of SNNs without sacrificing their high energy efficiency, so that they can be reliably applied to real-world scenarios with various interferences, is a technical problem that urgently needs to be solved in this field.
[0036] Figure 1This is a flowchart illustrating the robustness enhancement method for spiking neural networks based on neural activation and connection optimization provided by the present invention, as shown below. Figure 1 As shown, the method includes the following steps.
[0037] Step 101: Construct a spiking neural network model for processing computer vision tasks.
[0038] The neurons in the spiking neural network model are burst-enhanced spiking neurons. The input to the spiking neural network model is image data, and the output of the spiking neural network model is the image processing result corresponding to the computer vision task.
[0039] When the membrane potential of a burst-enhanced spiking neuron exceeds the firing threshold, the portion exceeding the membrane potential is converted into a burst output within the burst window through a quantized linear mapping function. The number of burst outputs is an integer between 0 and the preset maximum number of burst pulses.
[0040] In this embodiment of the invention, when constructing a spiking neural network model for processing computer vision tasks, traditional spiking neurons are replaced with burst-enhanced spiking neurons. The input to the spiking neural network model is image data, and the output is the image processing result for a specific computer vision task (such as image classification). Burst-enhanced spiking neurons, through an improved activation mechanism, effectively alleviate the quantization error and fragility problems caused by traditional binary pulses.
[0041] The working principle of burst-enhanced spiking neurons is based on membrane potential dynamics. When the membrane potential of a burst-enhanced spiking neuron exceeds a preset firing threshold, it does not generate only a single binary pulse, but instead converts the portion exceeding the threshold into multiple pulse outputs within a burst window through a quantized linear mapping function.
[0042] Specifically, the number of pulses output is determined by the following function: the difference between the membrane potential and the threshold is calculated, the positive value is divided by a hyperparameter (which controls the potential increment required to generate additional pulses), and then 0.5 is added before rounding down. The final result is limited by a preset maximum number of burst pulses, ensuring that the output is an integer between 0 and the preset maximum number of burst pulses. This mechanism realizes the transformation from discrete binary response to hierarchical pulse counting, making the neuron response smoother and reducing state flipping caused by input perturbations.
[0043] Furthermore, the membrane potential calculation of burst-enhanced spiking neurons is based on a memory-parallel spiking neuron model. The membrane potential is jointly determined by the temporal convolution kernel, the input current sequence, and the memory unit, and is dynamically adjusted through a modulation function. This design enhances the neuron's ability to process temporal information, providing richer feature representations for visual tasks.
[0044] Step 102: When training the spiking neural network model, add the activation-perceptual regularization term to the total loss function; Among them, the activation-aware regularization term imposes constraints on the connection weights based on the activation state during the forward propagation process.
[0045] In this embodiment of the invention, during the training of the spiking neural network model, an activation-aware regularization term is added to the total loss function to constrain the connection weights based on the activation states during the forward propagation process. This strategy aims to optimize the sparse connectivity of the network, reduce the amplification effect of redundant weights on perturbations, and thus improve robustness.
[0046] The activation-aware regularization term consists of two parts: The first part calculates the sum of the products of the L1 norm of the weight vectors of all activated presynaptic channels given an input and the corresponding activation coefficients, serving as the first penalty term. This encourages the network to reduce the weight magnitudes of active connections, avoiding overfitting. The second part, for inactive presynaptic channels given an input, requires that the L1 norm of their weight vectors be no less than the maximum value of the L1 norm of the weight vectors of all activated presynaptic channels in the same layer; if this requirement is not met, the sum of the differences is used as the second penalty term. This simulates the competition mechanism of biological synapses, prompting the network to concentrate resources on key connections.
[0047] The total loss function is defined as the weighted sum of the classification loss function and the activation-aware regularization term. During training, since the quantization function of the burst-enhanced spiking neuron is non-differentiable, a surrogate gradient method is needed for approximation. For example, during backpropagation, an arctangent-shaped surrogate gradient function is used to approximate the derivative of the quantization mapping, ensuring training stability and convergence.
[0048] Through this invention, firstly, a spiking neural network model employing burst-enhanced spiking neurons is constructed. When the membrane potential exceeds the firing threshold, the excess portion is converted into integer pulse outputs within the burst window (0 to a preset maximum number of burst pulses) using a quantized linear mapping function. This allows neurons to encode image features with a finer dynamic range, enhancing the richness and accuracy of information representation, thereby directly improving the model's accuracy in computer vision tasks. During the training phase, an activation-aware regularization term is introduced into the total loss function. This regularization term applies adaptive constraints to the connection weights based on the activation state during forward propagation, effectively optimizing network activation sparsity, suppressing overfitting, and enhancing the model's adaptability to noise and input variations, thus significantly improving robustness. These factors combined contribute to the simultaneous improvement of the accuracy and robustness of the spiking neural network model in computer vision tasks.
[0049] According to the present invention, a robustness enhancement method for spiking neural networks based on neural activation and connectivity optimization is provided. The activation perception regularization term includes a first penalty term, and the method further includes: Identify multiple activated presynaptic channels given an input; For each activated presynaptic channel among multiple activated presynaptic channels, determine the product between the L1 norm of the weight vector of the activated presynaptic channel and the activation value coefficient of the activated presynaptic channel; The sum of the products of multiple activated presynaptic channels is used as the first penalty term.
[0050] In this embodiment of the invention, the first penalty term aims to optimize the robustness of the network to input perturbations by constraining the connection weights of the activated presynaptic channels.
[0051] During training, when a spiking neural network processes given input data, it needs to identify all activated presynaptic channels. These channels correspond to neurons or connection pathways that generate non-zero activation during forward propagation.
[0052] Specifically, for a given input, an index set is defined, containing the indices of activated presynaptic channels in all network layers. The activation state of a channel is determined by whether its output is non-zero; for example, in a spiking neural network, activation might manifest as a pulse firing event. This step is achieved by monitoring the activation graph during forward propagation, ensuring that regularization is performed only on the channels actually involved in the computation.
[0053] For each activated presynaptic channel, the L1 norm of its weight vector is calculated as the product of the channel's activation value coefficients. The weight vector represents all synaptic weights connected to the activated presynaptic channel, and the L1 norm, the sum of the absolute values of the weights, measures the connection strength. The activation value coefficients are based on the channel's activation level; for example, they can be the pre-activation value or the normalized activation value of the activated presynaptic channel. Their function is to impose a weighted penalty based on the activation level: channels with higher activation levels have a greater impact on the network output, and therefore the penalty intensity increases accordingly. This design simulates the resource constraint mechanism of biological synapses, encouraging the network to reduce redundant weights while maintaining performance.
[0054] The summation of the products of all activated presynaptic channels yields the first penalty term. This summation, as part of the activation-aware regularization term, is added to the total loss function, working in conjunction with the classification loss to guide training.
[0055] In this embodiment of the invention, the first penalty term directly imposes constraints on active connections, reducing the risk of overfitting and enhancing the model's stability under perturbations. The entire implementation process is executed automatically during training iterations, ensuring that regularization and network learning occur simultaneously, thereby improving the overall robustness of the spiking neural network.
[0056] According to the present invention, a robustness enhancement method for spiking neural networks based on neural activation and connectivity optimization is provided. The activation perception regularization term includes a second penalty term, and the method further includes: Identify multiple inactive presynaptic channels given an input; For each of the multiple inactive presynaptic channels, the L1 norm of the weight vector of the inactive presynaptic channel is constrained to be no less than the maximum value of the L1 norm of the weight vectors of all activated presynaptic channels in the same layer. When the L1 norm of the weight vector of the target's unactivated presynaptic channel is lower than the maximum value of the L1 norm of the weight vectors of all activated presynaptic channels in the same layer, determine the difference between the maximum value and the L1 norm of the weight vector of the target's unactivated presynaptic channel. The sum of the differences corresponding to the unactivated presynaptic channels of all targets is used as the second penalty.
[0057] In this embodiment of the invention, the second penalty term aims to optimize network connection patterns and enhance the robustness of the model to input perturbations by simulating the competition mechanism of biological synapses.
[0058] When training a spiking neural network model, it is necessary to identify all inactive presynaptic channels when processing a given input. Inactive presynaptic channels are those presynaptic neurons or connections that do not generate any activation for the current input during forward propagation.
[0059] Specifically, by comparing the activation outputs of each layer of the network, it is possible to identify which channels have zero activation values and then aggregate the indices of these channels into a set. This set is typically organized at the layer level; for example, for each layer, a set of indices for inactive presynaptic channels is defined. This step ensures that regularization targets inactive connections, thereby optimizing network sparsity.
[0060] For each inactive presynaptic channel, a constraint is imposed requiring that the L1 norm of the weight vector of the inactive presynaptic channel be no less than the maximum L1 norm of the weight vectors of all activated presynaptic channels in the same layer. The L1 norm of the weight vector quantifies the connection strength by calculating the sum of the absolute values of all weights. The maximum L1 norm of the weight vectors of all activated presynaptic channels in the same layer is obtained by comparing the L1 norms of all activated channels in that layer and taking the maximum value. This maximum value serves as a reference benchmark, representing the maximum weight strength in the active connections of that layer. The purpose of this constraint is to encourage inactive channels to maintain a certain weight level, avoiding complete suppression, thereby preserving the potential diversity of the network.
[0061] When the L1 norm of the weight vector of an inactive presynaptic channel is lower than the maximum L1 norm of the weight vectors of all activated presynaptic channels in the same layer, the difference between the maximum value and the L1 norm of the weight vector of the inactive presynaptic channel is determined. Inactive presynaptic channels refer to those channels that do not satisfy the above constraint, i.e., their weight vector's L1 norm is less than the maximum value. The difference is calculated as the maximum value minus the L1 norm of the weight vector of the inactive presynaptic channel, reflecting the degree to which the constraint is not satisfied.
[0062] The sum of the differences corresponding to all unactivated presynaptic channels of the target is used as the second penalty term. This summation operation integrates the differences of all channels that do not meet the constraints, forming the second penalty term. The second penalty term, together with the first penalty term, constitutes the activation-aware regularization term, which is added to the total loss function.
[0063] Through the embodiments of the present invention, the second penalty term promotes a competitive balance of network connection weights, guides resources to concentrate on important connections, and maintains the potential activity of inactive connections, thereby improving robustness while avoiding excessive sparsity.
[0064] According to the present invention, a robustness enhancement method for spiking neural networks based on neural activation and connectivity optimization is provided, wherein the quantized linear mapping function is expressed by the following formula: in, Indicates the number of pulse outputs. This indicates the preset maximum number of burst pulses. Represents membrane potential. Indicates the issuance threshold. This represents the hyperparameter indicating the potential increment required to generate an additional pulse. This represents the floor function. Describes the minimum value function. This represents the maximum value function.
[0065] In this embodiment of the invention, the quantization linear mapping function is used to convert the portion of the membrane potential exceeding the firing threshold into the number of pulse outputs within the burst window, thereby realizing the transformation from binary activation to hierarchical pulse counting and improving the robustness of the model.
[0066] The calculation of the quantization linear mapping function is based on membrane potential dynamics. First, the difference between the membrane potential V and the firing threshold is calculated. If the difference is negative, i.e., the membrane potential is below the firing threshold, it is set to zero; otherwise, the actual difference is used. This step is implemented using a maximum value function to ensure that only the portion exceeding the threshold is considered.
[0067] Next, the difference is divided by the hyperparameter, which represents the potential increment required to generate an additional pulse. The result of the division is added to 0.5 (i.e., one-half), and then a floor function is applied to obtain a preliminary estimate of the number of pulses. The floor function ensures that the result is an integer, consistent with the discrete nature of the pulse output.
[0068] The initial pulse count estimate is compared with the preset maximum burst pulse count, and the smaller of the two values is taken as the final pulse output count. This minimum value function ensures that the pulse output count will not exceed the upper limit set by the preset maximum burst pulse count, maintaining the boundedness and rationality of the output.
[0069] Through the embodiments of the present invention, by quantizing the linear mapping function, the burst-enhanced spiking neuron can dynamically adjust the pulse output according to the membrane potential level, reduce quantization error, and make the neuronal response smoother under perturbation.
[0070] According to the present invention, a robustness enhancement method for spiking neural networks based on neural activation and connectivity optimization is provided, wherein the activation perception regularization term is expressed by the following formula: in, This indicates the activation of the perceptual regularization term. Indicates a given input, Indicates that in all layers given input The set of indices of the presynaptic channels that are activated. Indicates channel The activation value coefficient, Indicates channel The weight vector, Describing the L1 norm, Indicates the total number of network layers. Indicates the first In the layer, given input The set of indices of the unactivated presynaptic channels. Indicates the first In-layer passage The weight vector, Indicates the first The maximum L1 norm of the weight vectors of all activated presynaptic channels in the layer.
[0071] In this embodiment of the invention, the activation-aware regularization term is a key component in the training process, aiming to improve the robustness of the model by dynamically constraining the connection weights. The activation-aware regularization term, based on the activation state during forward propagation, penalizes the network weights and consists of two parts: a first part for activated presynaptic channels and a second part for inactive presynaptic channels.
[0072] The computation of the activation-aware regularization term requires a given input x. During training, for each input sample x, a forward propagation is performed to determine the activation state of the network. The activation state is used to identify activated and inactive presynaptic channels, serving as the basis for regularization computation.
[0073] The first part of the formula is the first penalty term, expressed as: During implementation, it is necessary to determine the set of indices of presynaptic channels activated in all layers under a given input x. An activated presynaptic channel is a channel that generates non-zero activation during forward propagation. For each activated presynaptic channel c, the activation coefficient of channel c is calculated. Weight vector of channel c The product of the L1 norms. Activation coefficients. Typically, the activation level of channel c, such as a normalized pre-activation value, is used for weighted penalty. Weight vector The L1 norm is obtained by summing the absolute values of all weights, quantifying connection strength. Finally, the products of all activated presynaptic channels are summed to form the first penalty term. This penalty encourages the network to reduce the weight magnitudes of active connections, thus reducing overfitting.
[0074] The second part of the formula is the second penalty term, expressed as: In implementation, layered processing is required. The total number of network layers is L. For each layer l, determine the set of indices of the presynaptic channels that are not activated under a given input x. Unactivated presynaptic channels are those with zero activation during forward propagation. Simultaneously, the maximum L1 norm of the weight vectors of all activated presynaptic channels in layer l is calculated. Maximum value The L1 norm of all activated channels in layer l is compared and the maximum value is taken as the reference. For each inactive presynaptic channel c, the weight vector of channel c is calculated. L1 norm and maximum value The larger of the two values is the output of the max function. If the L1 norm of channel c is lower than the maximum value... If the maximum value is found, the maximum value is taken; otherwise, the L1 norm of channel c itself is taken. This operation ensures that the weight norm of inactive channels is not lower than the maximum value of active channels, simulating a competition mechanism. Finally, the maximum values of all inactive channels in all layers are summed to form a second penalty term. This penalty promotes a balanced distribution of weights and avoids excessive suppression of inactive connections.
[0075] Through the embodiments of the present invention, the entire activation-aware regularization term It is the sum of the first penalty and the second penalty. During training, It is added to the total loss function and works with the classification loss to optimize the network. The implementation requires no manual intervention; by automatically monitoring activation states and calculating penalties, it ensures that the spiking neural network maintains sparsity while enhancing robustness.
[0076] According to the present invention, a robust enhancement method for spiking neural networks based on neural activation and connectivity optimization is provided. The burst-enhanced spiking neuron is constructed based on a memory-parallel spiking neuron model, and the membrane potential of the burst-enhanced spiking neuron is expressed by the following formula: in, Represents membrane potential. Represents the temporal convolution kernel. Represents the modulation function. Represents a memory unit. Represents the input current sequence; in, This represents the learnable scaling factor.
[0077] In this embodiment of the invention, the membrane potential is dynamically calculated by introducing a temporal convolution kernel and a modulation function, thereby enhancing the neuron's ability to process temporal information and improving the model's performance in computer vision tasks.
[0078] The temporal convolution kernel is a core parameter in membrane potential calculation, responsible for performing temporal convolution operations on the input signal. The temporal convolution kernel is typically a learnable weight matrix, whose dimensions are related to the time step and input features. In practice, the temporal convolution kernel is optimized through training data, enabling it to capture temporal patterns in the input current sequence. For example, in spiking neural networks, the temporal convolution kernel can extract event-driven temporal dependencies.
[0079] The modulation function combines the input current sequence and the memory unit, where I represents the input current sequence, which is the external stimulus signal of the neuron, usually from the pulse output of the previous layer of neurons or the raw input data; M represents the memory unit, which is the internal state of the neuron and is used to store historical information. The memory unit M can be variable and updated according to the time step. This represents the learnable scaling factor, a parameter optimized during training to adjust the contribution of the memory unit M to the modulation function. Modulation function The implementation ensures that neurons can dynamically adjust the weights of input and memory, achieving a more flexible response.
[0080] In the specific calculation of membrane potential First, the modulation function g(M,I) is calculated based on the input current sequence I and the memory unit M at the current time step. Then, the result of the modulation function g(M,I) is convolved with the temporal convolution kernel W to obtain the membrane potential V. This process is repeated at each time step, and the membrane potential V serves as the basis for the neuron's state, used for subsequent pulse firing decisions.
[0081] Learnable scaling factor Optimization is achieved during training using the backpropagation algorithm. Scaling factor. The introduction of this allows neurons to adaptively balance the effects of the input current sequence I and the memory unit M, for example, when When the value is larger, the function of the memory unit M is enhanced, and neurons rely more on historical information; when When the input current sequence I is smaller, it becomes more dominant. This learnable mechanism allows burst-enhanced spiking neurons to adapt to different task requirements.
[0082] Through this invention, burst-enhanced spiking neurons effectively encode spatiotemporal information using the membrane potential formula, laying the foundation for hierarchical pulse output. This method not only improves the representational power of neurons but also significantly enhances the robustness and accuracy of the model by dynamically reducing quantization errors through smooth membrane potentials.
[0083] The following describes an example of a robustness enhancement method for spiking neural networks based on neural activation and connection optimization provided by this invention in a practical application scenario.
[0084] refer to Figure 5 , Figure 5 This is a network architecture diagram provided by the present invention.
[0085] The "Input" section on the left displays the raw image data to be processed as an example image. The middle section is the core processing module, where the light blue "Conv Blocks" consist of multiple stackable units, representing the convolutional neural network layers used for feature extraction. The processing results are passed via arrows to the light orange "Classifier," which also consists of stackable modules responsible for classifying and judging the extracted features. The far right of the flow is the "Recognition Result" module, which outputs the model's final analysis results on the input image.
[0086] refer to Figure 2 , Figure 2 This is a schematic diagram illustrating the precision-robustness tradeoff between SNN and ANN provided by the present invention.
[0087] Spiking neural networks (SNNs), as a third-generation neural network model, exhibit significant advantages in energy efficiency compared to traditional artificial neural networks due to their event-driven and highly sparse computational characteristics. This bio-inspired computational model makes them particularly suitable for deployment in resource-constrained edge computing scenarios. However, the widespread application of SNNs has long been constrained by a fundamental challenge—the significant trade-off between accuracy and robustness. Figure 2 As shown, existing SNN methods exhibit a scattered distribution across the accuracy-robust plane, making it difficult to simultaneously achieve the high accuracy and robustness levels of traditional ANN baselines. This phenomenon profoundly reveals the inherent limitations of SNN models in their basic design, severely restricting their practical application value in complex real-world environments.
[0088] Through systematic experimental analysis, two key intrinsic factors leading to this problem were identified. The first is the oversimplification of the neural activation mechanism. Traditional SNN neurons employ a simple binary activation function, and their dynamic process can be formally described as three basic stages: in, It is a Heaviside step function. It is the issuance threshold. Indicates time step membrane potential, Indicates time step The input current sequence, Indicates time step pulse output, Indicates the issuance threshold. This represents the reset potential; when a neuron fires a pulse, the membrane potential is reset to this value. While this "all-or-none" response mechanism is biologically plausible, it exhibits extremely high sensitivity to perturbations at the computational level.
[0089] refer to Figure 3 , Figure 3 This is a schematic diagram of spiking neuron behavior analysis under the Modified-PLIF-Net architecture provided by this invention.
[0090] Figure 3Experimental data clearly demonstrates the severity of this problem—under Gaussian noise perturbation on the CIFAR10-C dataset, binary SNN neurons based on the Modified-PLIF-Net architecture exhibit a higher state-flipping rate than ANNs across all network layers. This instability persists throughout the entire network depth, from the first convolutional layer C1 to the final fully connected layer Fc. The root cause is that when the membrane potential is near the firing threshold, even a small perturbation in the input is sufficient to cause the output pulse to flip between 0 and 1. This discrete jumping behavior propagates layer by layer through the network hierarchy and accumulates, ultimately leading to catastrophic classification errors.
[0091] refer to Figure 6 , Figure 6 This is a schematic diagram illustrating the statistical comparison of neuron activation rate and network weights provided by the present invention.
[0092] Secondly, there is the suboptimal optimization problem of network connectivity. Although SNNs naturally possess the characteristic of sparse activation, theoretically they should bring the dual advantages of computational efficiency and robustness, but in practice this potential has not been fully explored. To quantify this phenomenon, this invention defines the concept of input activation weights: in, This represents the activation weights given input x. For a given input Activation weight set It should be noted that although the neuron activation rate of SNNs is significantly lower than that of ANNs, consistent with their sparse computation characteristics, the total number of input activation weights may exceed that of ANNs. This finding indicates a systematic bias in existing SNN training methods—the network compensates for the signal attenuation effect caused by sparse activation by increasing the magnitude of individual connection weights. However, this compensation mechanism brings unexpected negative consequences: larger connection weights amplify the impact of input perturbations during propagation, effectively weakening the robustness advantage that SNNs should possess.
[0093] refer to Figure 4 , Figure 4 This is an overview diagram of the method provided by the present invention (inspired by biological visual systems).
[0094] To address these in-depth identification challenges, this invention draws rich inspiration from biological nervous systems and proposes a collaboratively optimized dual-path solution. Figure 4This paper presents the overall framework of the method of this invention, which fundamentally improves SNNs from two complementary perspectives. At the level of neural activation, the invention is inspired by the burst firing patterns of biological neurons, a phenomenon widely observed in neuroscience and believed to enhance the reliability and robustness of information transmission. At the level of network connectivity, the invention draws on the fundamental principles of competitive and constrained synaptic plasticity in biological neural systems, mechanisms that enable efficient information processing under the constraints of limited biological resources.
[0095] refer to Figure 11 , Figure 11 This is a schematic diagram comparing binary pulses and burst pulses provided by the present invention.
[0096] The burst-enhanced spiking neuron is one of the core innovations proposed in this invention. Figure 11 The key difference between BSN and traditional binary neurons is vividly illustrated through comparative diagrams. The "all-or-none" response in the traditional model is replaced by a hierarchical pulse counting response; this shift fundamentally alters the neuron's sensitivity to perturbations. The mathematical model of BSN is built upon the basic framework of memory-parallel spiking neurons, with crucial extensions through the introduction of a carefully designed burst function: in, Represents membrane potential. Represents the temporal convolution kernel. Represents the modulation function. Represents a memory unit. Indicates the input pulse sequence. Indicates pulse output. Represents the burst function, This represents the threshold vector.
[0097] This burst function maps the portion of the membrane potential exceeding a threshold to a non-negative integer, representing the number of pulses that may be emitted within a single time step: min(θburst, [ + ],ΔV>0 The specific form of the function ensures the boundedness and rationality of the output, with key parameters including the potential increment control required to generate an additional pulse. Maximum number of pulses per burst In all experiments of this invention, these parameters were set to fixed values after system optimization to ensure the consistency and comparability of the methods.
[0098] The forward propagation process of BSN is a deterministic discrete mapping, preserving the computational characteristics of SNN, but the challenge of gradient propagation needs to be addressed during training. To this end, this invention designs a smooth, arctangent-shaped surrogate gradient function: in It is an indicator function. This function provides a meaningful gradient signal near the decision boundary of impulse generation, while the gradient gradually decays in the region far from the boundary, ensuring the stability and effectiveness of the training process.
[0099] refer to Figure 12 , Figure 12 This is a schematic diagram of the interlayer flip rate analysis provided by the present invention.
[0100] Figure 12 The experimental results strongly validate the significant effect of BSN in reducing state flipping rate. Under varying degrees of Gaussian noise impairment, the neuron flipping rate of each layer in BSN is significantly lower than that of traditional binary SNNs, especially in the deeper layers of the network, where this advantage is even more pronounced. This finding demonstrates the effective suppression of error accumulation by hierarchical activation mechanisms, providing a reliable path to improve the robustness of deep SNNs.
[0101] Activation-aware regularization (AAR) is another core innovation of this invention, dedicated to optimizing the connectivity patterns of SNNs. Deeply inspired by the synaptic plasticity mechanism in biological neural systems, the AAR framework comprises two complementary regularization components. The first component simulates a synaptic competition mechanism, encouraging the network to concentrate its limited computational resources on truly important connections by comparing the weight distributions of active and inactive connections. Specifically, this invention defines a set of indices for active channels for each network layer: And calculate the maximum weight norm among these active connections as a reference benchmark: The competition regularization term requires that the weight norm of inactive connections does not exceed this reference value: in, Indicates the first The set of indices of activated presynaptic channels in a layer for a given input x. Indicates the first The activation value of channel c in the layer for a given input x. Indicates the first The maximum value of the L1 norm of the weight vector of all activated presynaptic channels in the layer. Indicates the first The weight of channel k in the layer, Indicates a competition regularity term. Indicates the first The set of indices of presynaptic channels that are not activated in the layer.
[0102] This naturally guides the network to form more selective connection patterns during training.
[0103] The second component simulates the synaptic resource constraint mechanism, based on the biological principle observed in neuroscience that synaptic strength is proportional to activity level. This invention derives a weighted L1 penalty term: The penalty strength for each connection is related to its pre-activation value. Proportional. This design imposes relatively strong regularization constraints on connections that contribute more to the network output, while imposing weaker constraints on secondary connections, thus effectively controlling the risk of overfitting while maintaining model capacity. The complete AAR regularization term is a weighted combination of these two components: They work together in the training process, guiding the network to learn connection patterns that are both efficient and robust.
[0104] refer to Figure 14 , Figure 14 This is a schematic diagram of the input activation weight comparison provided by the present invention.
[0105] Figure 14 The study demonstrates the optimization effect of AAR on input activation weights, with encouraging results. After introducing AAR, the input activation weights in each layer of the model are significantly reduced, indicating that the network has learned to utilize its inherent sparsity more effectively, reducing the involvement of redundant connections in computation. This optimization not only reduces the model's sensitivity to input perturbations but also improves computational efficiency to some extent, achieving a dual improvement in robustness and efficiency.
[0106] To comprehensively evaluate the effectiveness of the proposed method, systematic experimental verification was conducted on multiple standard datasets. The experimental setup covered multiple dimensions, including clean image classification, robustness against adversarial attacks, robustness against common corruptions, and adaptability to neuromorphic data.
[0107] This invention uses the training hyperparameters shown in the table below and trains all models using the SpikingJelly framework.
[0108] Table 1 Training hyperparameters for different datasets Dataset Optimizer Batch Size Epoch Learning Rate Loss Function CIFAR-10 SGD 128 1024 0.1 CE CIFAR-100 SGD 128 1024 0.1 CE ImageNet SGD 64 320 0.001 TET CIFAR10-DVS SGD 32 200 0.1 TET This invention uses a mainstream SNN architecture as a benchmark to ensure a fair comparison with existing methods. The hyperparameters during training have been carefully tuned and detailed in the paper, ensuring the reproducibility of the experimental results.
[0109] On the CIFAR-10 dataset, BSN already achieved extremely high accuracy, and the BSN* model combined with AAR further improved performance, setting a new record for SNNs on this dataset. A detailed comparison is shown in the table below: Table 2. Accuracy comparison of different methods on the CIFAR-10 dataset method Network architecture Time Steps Accuracy (%) ANN Modified-PLIF-Net - 95.84 LIF Modified-PLIF-Net 6 95.04 TET ResNet-19 6 94.50 TDBN ResNet-19 6 93.16 TEBN ResNet-19 6 94.71 PLIF PLIF Net 8 93.50 KLIF Modified-PLIF-Net 10 92.52 GLIF ResNet-19 6 95.03 NLIF ResNet-18 4 93.73 SLTT Modified-PLIF-Net 4 95.08 CLIF ResNet-18 4 96.01 LTF-ALSF Modified-PLIF-Net 4 94.48 PSN Modified-PLIF-Net 4 95.32 MPSN Modified-PLIF-Net 4 96.18 BSN (This invention) Modified-PLIF-Net 4 96.22 BSN (This invention)* Modified-PLIF-Net 4 96.25 As shown in Table 2, BSN already achieved extremely high accuracy on the CIFAR-10 dataset, and the BSN model combined with AAR further improved performance, setting a new record for SNNs on this dataset. On the more challenging ImageNet dataset, the BSN model using the standard network structure even surpassed the performance of a full-precision ANN with the same structure. This breakthrough fully demonstrates the potential of spiking neural networks in terms of accuracy. It is particularly noteworthy that BSN uses only a limited number of discrete activation levels, yet its performance exceeds that of quantized ANNs using more discrete levels, profoundly revealing the inherent advantage of pulse coding in information representation efficiency.
[0110] On the more challenging large-scale ImageNet dataset, the method of this invention also demonstrates outstanding performance. As shown in the table below, the BSN model using the standard network structure even surpasses the performance of a full-precision ANN with the same structure. This breakthrough fully demonstrates the potential of spiking neural networks in terms of accuracy.
[0111] Table 3. Accuracy comparison of different methods on the ImageNet dataset (Top-1 %)
[0112] In the ANN row, "a / b" indicates the result of full-precision / INT4 activated quantization.
[0113] Of particular note is that BSN, using only a limited number of discrete activation levels (with a preset maximum burst pulse count of 4), outperforms quantized ANNs that use more discrete levels (INT4 provides 16 activation levels), profoundly revealing the inherent advantage of pulse coding in information representation efficiency. On the SEW ResNet-18 architecture, BSN* even surpasses the full-precision ANN baseline, fully demonstrating the effectiveness of this invention in large-scale vision tasks.
[0114] In addition to static image datasets, to evaluate the adaptability of the proposed method to neuromorphic data, this invention was further validated on the CIFAR10-DVS event stream dataset. CIFAR10-DVS contains event-driven visual representations, capable of testing the temporal modeling capabilities of SNNs. The comparison of different methods on this dataset is shown in the table below: Table 4. Accuracy comparison of different methods on the CIFAR10-DVS dataset method Network architecture Time Steps Accuracy (%) TET VGG 10 83.17 TDBN ResNet-19 10 67.80 TEBN VGG 10 84.90 PLIF PLIF Net 20 74.80 KLIF Modified-PLIF-Net 15 70.90 GLIF Wide 7B Net 16 78.10 SEW Wide 7B Net 16 74.40 PSN VGG 4, 10 82.30, 85.30 CLIF VGG 10 86.10 LTF-ALSF VGG 10 85.60 MPSN VGG 4, 10 83.30, 86.50 BSN (This invention) VGG 4, 10 84.00, 87.10 BSN (This invention)* VGG 4, 10 84.60, 86.90 As shown in Table 4, on the CIFAR10-DVS dataset, the method of this invention achieved optimal or near-optimal performance under different time step settings. In particular, at the 10-time-step setting, the BSN model achieved an accuracy of 87.10%, surpassing all compared methods. This result demonstrates that this invention is not only applicable to traditional static image recognition tasks but also exhibits excellent performance in event-driven neuromorphic vision tasks, reflecting the broad applicability of this method in real-world impulse data processing.
[0115] In the robustness evaluation of adversarial attacks, the method of this invention demonstrates strong defense capabilities. Under a white-box attack setting, this invention uses the classic fast gradient sign method and projective gradient descent method to generate adversarial examples: in, This represents the generated adversarial example. Represents the original input image. Indicates the magnitude of the disturbance. Represents a symbolic function. Represents the loss function Regarding the gradient of the input x, Indicates the predicted output. Indicates the true label; in, Indicates the first The adversarial example after the iteration, PGD is an iterative attack method that gradually enhances the perturbation through multiple updates. This represents the projection operation, which projects a point onto a set. superior, This represents the set of perturbation constraints. Indicates the iteration step size. , .
[0116] The performance comparison of different methods under adversarial attacks is shown in the table below: Table 5. Comparison of recognition accuracy of different methods under adversarial attacks (%)
[0117] The underlined items indicate that an adversarial training method was used.
[0118] As shown in Table 5, the BSN model maintains high robust accuracy under different attack intensities and types. On the CIFAR-10 dataset, BSN achieves an accuracy of 68.77% against FGSM attacks, significantly higher than MPSN's 63.11% and PSN's 61.29%. On the more challenging CIFAR-100 dataset, BSN* maintains high clean accuracy (71.23%) while significantly outperforming ANN baselines and other SNN methods in its defense against strong adversarial attacks. This finding overturns the traditional view that SNNs must trade off between accuracy and robustness, demonstrating that these two goals can be achieved simultaneously through proper design.
[0119] refer to Figure 7 , Figure 7 This is a schematic diagram of the corrupted CIFAR10-C and ImageNet-C examples provided by the present invention.
[0120] The method of this invention also performs well in common damage robustness tests. This invention is evaluated using the standard CIFAR10-C damage benchmark dataset, which contains 19 types of image degradation that may be encountered in the real world (such as noise, blur, weather effects, etc.), with five severity levels for each type. Figure 7 Representative examples of damage are shown. To eliminate the influence of differences in cleaning precision on robustness assessment, this invention introduces a specific robustness scoring index: in It's the cleaning accuracy rate. It is the average accuracy rate for each severity level.
[0121] The following table shows a comparison of different methods on CIFAR10-C: Table 6. Comparison of recognition accuracy (%) of different methods on the CIFAR10-C dataset method Cleaning accuracy L1 L2 L3 L4 L5 C-AVG Score ANN 95.84 92.27 89.65 86.52 81.22 73.9 84.71 0.884 LIF 95.04 90.9 88.05 84.85 79.32 71.5 82.92 0.8725 PLIF 95.08 91.1 88.34 85.1 79.55 72.27 83.27 0.8752 NLIF 94.96 90.22 86.52 82.37 76.25 66.95 82.83 0.8497 GLIF 93.94 90.12 87.46 84.49 79.36 72.54 82.8 0.8814 SLTT 95.08 91.43 88.59 85.39 80.14 73.27 83.77 0.881 LTF-ALSF 94.48 88.54 83.76 79.18 73.22 64.57 77.85 0.824 PSN 95.32 91.68 88.9 85.79 80.75 73.28 84.08 0.8821 MPSN 96.18 92.37 89.78 86.86 81.9 75.08 85.2 0.8858 BSN (This invention) 96.22 92.8 90.27 87.13 82.07 74.7 85.39 0.8875 96.25 93.04 90.64 87.59 82.75 75.74 85.95 0.893 Here, L1-L5 represent five severity levels, C-AVG is the average accuracy across all severity levels and damage types, and Score is the standardized robustness score.
[0122] As shown in Table 6, BSN and BSN* achieved best performance across all severity levels in CIFAR 10-C. In particular, BSN* achieved a mean damage accuracy (C-AVG) of 85.95% and a robustness score of 0.8930, both surpassing all comparable methods.
[0123] refer to Figure 8 , Figure 8 This is a schematic diagram illustrating the comparison of robustness against common types of damage provided by the present invention.
[0124] Figure 8 The performance comparisons under specific damage types are presented, with BSN consistently showing the best performance. These results collectively demonstrate, from multiple perspectives, the effectiveness and universality of the method described in this invention in improving the robustness of SNNs.
[0125] In the more challenging large-scale ImageNet-C benchmark, the method of this invention also maintains a competitive edge and sets new records for SNNs. As shown in the table below, BSN and BSN* outperform existing SNN methods on multiple network architectures, and even surpass quantized ANN baselines on compact backbone networks: Table 7. Comparison of recognition accuracy (%) of different methods on the ImageNet-C dataset On the SEW ResNet-18 and SEW ResNet-34 architectures, BSN* achieved higher C-AVG than the ANN-INT8 and ANN-INT4 baselines, while previous SNN methods failed to surpass ANN-INT8 under the same settings. In terms of robustness scores, BSN and BSN* provided a consistent advantage across all severity levels, indicating improvements in both cleaning accuracy and damage robustness.
[0126] Computational efficiency analysis reveals the energy efficiency advantages of the method presented in this invention. As shown in the table below, this invention measures the cumulative number of operations (ACs), multiply-accumulate operations (MACs), and estimated total energy consumption for different models using the Modified-PLIF-Net architecture on the CIFAR-10 dataset: Table 8 Comparison of computational cost and energy efficiency of different models on CIFAR-10 Model ACs (millions of times) MACs (millions) Total energy consumption (microjoules) LIF 692.819 7.078 656.095 PSN 1436.422 7.078 1325.338 MPSN 1788.557 7.078 1642.260 ReLU 0 1409.069 6481.718 ReLU-INT4 0 1170.044 5382.204 BSN (This invention) 1970.099 7.078 1805.648 As shown in Table 8, BSN achieves a significant reduction in energy consumption compared to the standard ReLU baseline. BSN consumes 1805.648 microjoules, while ReLU consumes 6481.718 microjoules, corresponding to an energy reduction of approximately 72%. Compared to the quantized ReLU-INT4 model, BSN reduces energy consumption by approximately 66% while maintaining pulse computation characteristics.
[0127] Comparison with other SNN methods reveals the trade-off between performance and energy efficiency. BSN uses more ACs than MPSN (1970.099M vs 1788.557M), resulting in slightly higher energy consumption (1805.648 μJ vs 1642.260 μJ). However, this increase is compensated by significant improvements in accuracy and robustness, as shown in the preceding tables, and is generally an acceptable trade-off in practical applications.
[0128] Detailed energy consumption measurements show that the BSN model achieves a significant reduction in energy consumption compared to traditional ANNs, an advantage that is invaluable in resource-constrained applications. While BSN consumes slightly more energy than some highly optimized SNN baselines, this increase is compensated by a significant improvement in accuracy and robustness, a trade-off that is generally acceptable in practical applications. Particularly noteworthy is that the method of this invention achieves a comprehensive performance improvement while maintaining energy efficiency, breaking the traditional perception that high performance must sacrifice energy efficiency.
[0129] This invention systematically studies the impact of the key parameter, the maximum number of burst pulses, on model performance.
[0130] refer to Figure 9 , Figure 9 This is a schematic diagram illustrating the effect of the maximum number of pulses provided by this invention on accuracy and robustness.
[0131] Figure 9 Experimental results show that as the parameter increases from its minimum value to the value adopted in this invention, the cleanliness accuracy, adversarial robustness, and damage robustness of the model all exhibit a monotonically increasing trend. This finding strongly supports the core hypothesis of this invention—that the hierarchical activation mechanism can indeed simultaneously improve the accuracy and robustness of SNNs.
[0132] refer to Figure 10 , Figure 10 This is a schematic diagram illustrating the relationship between accuracy and computational cost provided by the present invention. Figure 10 The study also analyzed the trade-off between accuracy and computational cost under different parameter settings, providing practical guidance for parameter selection in actual deployments.
[0133] The visualization analysis of the feature space further corroborates the effectiveness of the method in this invention. By visualizing the feature representations learned by different models through dimensionality reduction techniques, this invention allows for a direct observation of the advantages of the BSN model in terms of feature stability.
[0134] refer to Figure 13 , Figure 13 This is a schematic diagram of the t-SNE feature visualization provided by the present invention.
[0135] Figure 13The results show that both BSN and ANN can form good inter-class separation structures on clean images. However, when noise perturbation is applied, the feature distributions of ANN begin to show significant confusion and overlap, while the feature clusters of BSN still maintain good separation. This observation proves that BSN learns more robust feature representations, and this inherent stability is the underlying reason for its superior robustness.
[0136] In summary, this invention systematically solves the long-standing accuracy-robustness trade-off problem faced by SNNs. Through in-depth analysis of the inherent limitations of SNNs, this invention identifies the fragility of binary activation and suboptimal connectivity as key limiting factors. Accordingly, this invention proposes a dual solution profoundly inspired by biological neural systems: burst-enhanced spiking neurons, through a hierarchical multi-pulse activation mechanism, smooth the neuronal state transition process, significantly enhancing tolerance to perturbations while improving accuracy; activation-perception regularization, simulating the competition and constraint mechanisms of biological synapses, optimizes network connectivity patterns, enabling SNNs to fully utilize their inherent sparsity advantages. Extensive and rigorous experiments demonstrate that the method of this invention can simultaneously and significantly improve the performance of SNNs on multiple key metrics, including clean image classification accuracy, adversarial attack robustness, and robustness to common corruptions. In multiple benchmark tests, the method of this invention reaches or surpasses the performance level of traditional ANNs under equivalent conditions. This breakthrough paves the way for the widespread application of spiking neural networks in complex real-world environments.
[0137] The robustness enhancement device for spiking neural networks based on neural activation and connection optimization provided by the present invention will be described below. The robustness enhancement device for spiking neural networks based on neural activation and connection optimization described below can be referred to in correspondence with the robustness enhancement method for spiking neural networks based on neural activation and connection optimization described above.
[0138] refer to Figure 15 , Figure 15 This is a schematic diagram of the module of the robustness enhancement device for spiking neural networks based on neural activation and connection optimization provided by the present invention.
[0139] Module 1501 is used to build a spiking neural network model for processing computer vision tasks. The neurons of the spiking neural network model are burst-enhanced spiking neurons. The input of the spiking neural network model is image data, and the output of the spiking neural network model is the image processing result corresponding to the computer vision task. Among them, when the membrane potential of the burst-enhanced spiking neuron exceeds the firing threshold, the portion exceeding the membrane potential is converted into a pulse output within the burst window through a quantized linear mapping function. The number of pulse outputs is an integer between 0 and the preset maximum number of burst pulses. Training module 1502 is used to add an activation-aware regularization term to the total loss function when training a spiking neural network model; Among them, the activation-aware regularization term imposes constraints on the connection weights based on the activation state during the forward propagation process.
[0140] Specifically, the robustness enhancement device for spiking neural networks based on neural activation and connection optimization provided by the present invention can realize all the method steps implemented in the above-mentioned embodiment of the robustness enhancement method for spiking neural networks based on neural activation and connection optimization, and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiment and the beneficial effects will not be described in detail.
[0141] Figure 16 This is a schematic diagram of the physical structure of the electronic device provided by the present invention, such as... Figure 16 As shown, the electronic device may include: a processor 1610, a communications interface 1620, a memory 1630, and a communication bus 1640, wherein the processor 1610, the communications interface 1620, and the memory 1630 communicate with each other through the communication bus 1640. The processor 1610 can call logic instructions in the memory 1630 to execute a robust enhancement method for spiking neural networks based on neural activation and connection optimization. This method includes: constructing a spiking neural network model for processing computer vision tasks, wherein the neurons in the spiking neural network model are burst-enhanced spiking neurons, the input to the spiking neural network model is image data, and the output of the spiking neural network model is the image processing result corresponding to the computer vision task; wherein, when the burst-enhanced spiking neurons exceed a firing threshold, the portion exceeding the membrane potential is converted into a pulse output within a burst window through a quantized linear mapping function, and the number of pulse outputs is an integer between 0 and a preset maximum number of burst pulses; during training the spiking neural network model, an activation-aware regularization term is added to the total loss function; wherein, the activation-aware regularization term imposes constraints on the connection weights based on the activation state during the forward propagation process.
[0142] Furthermore, the logical instructions in the aforementioned memory 1630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0143] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the robustness enhancement method for spiking neural networks based on neural activation and connection optimization provided by the above methods. The method includes: constructing a spiking neural network model for processing computer vision tasks, wherein the neurons of the spiking neural network model are burst-enhanced spiking neurons, the input of the spiking neural network model is image data, and the output of the spiking neural network model is the image processing result corresponding to the computer vision task; wherein, when the membrane potential of the burst-enhanced spiking neurons exceeds the firing threshold, the portion exceeding the membrane potential is converted into a pulse output within the burst window through a quantized linear mapping function, and the number of pulse outputs is an integer between 0 and a preset maximum number of burst pulses; when training the spiking neural network model, an activation-aware regularization term is added to the total loss function; wherein, the activation-aware regularization term imposes constraints on the connection weights according to the activation state during the forward propagation process.
[0144] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the robust enhancement method for spiking neural networks based on neural activation and connection optimization provided by the above methods. The method includes: constructing a spiking neural network model for processing computer vision tasks, wherein the neurons of the spiking neural network model are burst-enhanced spiking neurons, the input of the spiking neural network model is image data, and the output of the spiking neural network model is the image processing result corresponding to the computer vision task; wherein, when the membrane potential of the burst-enhanced spiking neurons exceeds a firing threshold, the portion exceeding the membrane potential is converted into a pulse output within a burst window through a quantized linear mapping function, and the number of pulse outputs is an integer between 0 and a preset maximum number of burst pulses; when training the spiking neural network model, an activation-aware regularization term is added to the total loss function; wherein, the activation-aware regularization term imposes constraints on the connection weights according to the activation state during the forward propagation process.
[0145] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0146] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for enhancing the robustness of spiking neural networks based on neural activation and connectivity optimization, characterized in that, include: A spiking neural network model for processing computer vision tasks is constructed. The neurons of the spiking neural network model are burst-enhanced spiking neurons. The input of the spiking neural network model is image data, and the output of the spiking neural network model is the image processing result corresponding to the computer vision task. Wherein, when the membrane potential of the burst-enhanced spiking neuron exceeds the firing threshold, the portion exceeding the membrane potential is converted into a pulse output within the burst window through a quantized linear mapping function, and the number of the pulse outputs is an integer between 0 and a preset maximum number of burst pulses; When training the spiking neural network model, an activation-perceptual regularization term is added to the total loss function; The activation-aware regularization term applies constraints to the connection weights based on the activation state during the forward propagation process.
2. The robustness enhancement method for spiking neural networks based on neural activation and connection optimization according to claim 1, characterized in that, The activation-aware regularization term includes a first penalty term, and the method further includes: Identify multiple activated presynaptic channels given an input; For each of the plurality of activated presynaptic channels, determine the product between the L1 norm of the weight vector of the activated presynaptic channel and the activation value coefficient of the activated presynaptic channel; The sum of the products of the plurality of activated presynaptic channels is used as the first penalty term.
3. The robustness enhancement method for spiking neural networks based on neural activation and connectivity optimization according to claim 2, characterized in that, The activation-aware regularization term includes a second penalty term, and the method further includes: Identify multiple inactive presynaptic channels under the given input; For each of the plurality of inactive presynaptic channels, the L1 norm of the weight vector of the inactive presynaptic channel is constrained to be no less than the maximum value of the L1 norm of the weight vectors of all activated presynaptic channels in the same layer. When the L1 norm of the weight vector of a target presynaptic channel that is not activated is lower than the maximum value of the L1 norm of the weight vectors of all activated presynaptic channels in the same layer, the difference between the maximum value and the L1 norm of the weight vector of the target presynaptic channel that is not activated is determined. The sum of the differences corresponding to all targets whose presynaptic channels were not activated is used as the second penalty.
4. The robustness enhancement method for spiking neural networks based on neural activation and connectivity optimization according to claim 1, characterized in that, The quantized linear mapping function is expressed by the following formula: ; in, This indicates the number of pulse outputs. This indicates the preset maximum number of burst pulses. This represents the membrane potential. This indicates the issuance threshold. This represents the hyperparameter indicating the potential increment required to generate an additional pulse. This represents the floor function. Describes the minimum value function. This represents the maximum value function.
5. The robustness enhancement method for spiking neural networks based on neural activation and connectivity optimization according to claim 1, characterized in that, The activation-aware regularization term is expressed by the following formula: ; in, This represents the activation-aware regularization term. Indicates a given input, Indicates that in all layers given input The set of indices of the presynaptic channels that are activated. Indicates channel The activation value coefficient, Indicates channel The weight vector, Describing the L1 norm, Indicates the total number of network layers. Indicates the first In the layer, given input The set of indices of the unactivated presynaptic channels. Indicates the first In-layer passage The weight vector, Indicates the first The maximum L1 norm of the weight vectors of all activated presynaptic channels in the layer.
6. The robustness enhancement method for spiking neural networks based on neural activation and connection optimization according to claim 1, characterized in that, The burst-enhanced spiking neuron is constructed based on the memory-parallel spiking neuron model, and its membrane potential is expressed by the following formula: ; in, This represents the membrane potential. Represents the temporal convolution kernel. Represents the modulation function. Represents a memory unit. Represents the input current sequence; ; in, This represents the learnable scaling factor.
7. A robustness enhancement device for spiking neural networks based on neural activation and connectivity optimization, characterized in that, include: A construction module is used to construct a spiking neural network model for processing computer vision tasks. The neurons of the spiking neural network model are burst-enhanced spiking neurons. The input of the spiking neural network model is image data, and the output of the spiking neural network model is the image processing result corresponding to the computer vision task. Wherein, when the membrane potential of the burst-enhanced spiking neuron exceeds the firing threshold, the portion exceeding the membrane potential is converted into a pulse output within the burst window through a quantized linear mapping function, and the number of the pulse outputs is an integer between 0 and a preset maximum number of burst pulses; The training module is used to add an activation-perceptual regularization term to the total loss function when training the spiking neural network model. The activation-aware regularization term applies constraints to the connection weights based on the activation state during the forward propagation process.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the robustness enhancement method for spiking neural networks based on neural activation and connection optimization as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the robustness enhancement method for spiking neural networks based on neural activation and connection optimization as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the robustness enhancement method for spiking neural networks based on neural activation and connection optimization as described in any one of claims 1 to 6.