Pulse neural network model fault tolerance method based on dynamic neurons
By using a dynamic neuron parameter iteration algorithm in spiking neural networks, the granularity of control is refined to the channel level, and the pulse distribution characteristics of each channel are independently modeled. This solves the anomaly problem caused by bit flipping in real-world environments, and improves robustness and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- UNIV OF ELECTRONICS SCI & TECH OF CHINA
- Filing Date
- 2026-02-02
- Publication Date
- 2026-05-08
AI Technical Summary
Existing spiking neural networks are susceptible to environmental noise, voltage fluctuations, and device aging in real-world operating environments, leading to bit flips and abnormal network behavior. Existing methods struggle to balance robustness and accuracy, and uniform threshold settings cannot adapt to differences between channels.
A dynamic neuron parameter iterative algorithm is adopted to refine the control granularity by adjusting neuron parameters at the channel level, independently modeling the pulse distribution characteristics of each channel, and dynamically adjusting to return to the baseline state, thereby achieving fine-grained error blocking.
It significantly improves the ability to suppress anomaly propagation, maintains robustness and accuracy, adapts to different input distributions, and has strong adaptability and generalization ability.
Smart Images

Figure CN121997990A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of neural network model technology, and in particular relates to a fault-tolerant method for a spiking neural network model based on dynamic neurons. Background Technology
[0002] As spiking neural networks (SNNs) are gradually deployed in edge intelligence systems and safety-critical applications, their reliability in real-world operating environments is becoming increasingly prominent, gradually becoming a significant factor restricting their engineering applications. Compared to traditional deep neural networks, SNNs are typically deployed on hardware platforms with limited power consumption, small process dimensions, and long-term continuous operation, making them more susceptible to environmental noise, voltage fluctuations, and device aging, which can lead to soft errors or unexpected disturbances. In such cases, bit flipping in weight storage units is relatively common, and once it occurs, it can easily cause significant anomalies in network behavior during inference.
[0003] To address the issue of suppressing deployment-phase errors, existing methods often employ error pruning or error blocking strategies, introducing upper limits or boundary constraints at the activation layer to suppress the propagation of outliers. However, these methods typically use layers as the basic control unit, applying a uniform threshold setting to different channels within the same layer. This makes it difficult to characterize the significant differences between channels in terms of weight distribution, impulse rate, and functional sensitivity. In residual networks and deep structures, this channel heterogeneity is even more pronounced, and a uniform threshold often cannot simultaneously ensure robustness and accuracy, leading to threshold deviations from optimal settings, limited fault tolerance gains, and even the introduction of new performance losses.
[0004] Unlike traditional deep neural networks, which primarily rely on static activation functions, the nonlinear mapping process of spiking neural networks is dominated by neuronal dynamics, with its core behavior manifested in the integration, leakage, and firing processes of membrane potential. Taking the common LIF neuron as an example, its threshold voltage and membrane time constant directly determine the neuron's response to input perturbations and its pulse output characteristics. This time-based dynamic mechanism theoretically gives spiking neural networks a certain potential for anomaly suppression and self-regulation; however, this potential is highly dependent on the matching relationship between neuron parameters and the current input distribution. When weight bit flipping causes a sudden distribution drift, neurons with fixed parameter configurations often struggle to adapt to the new input scale in a timely manner, leading to pulse rate imbalance or a significant decrease in information transmission efficiency. Summary of the Invention
[0005] The purpose of this application is to overcome the shortcomings of the prior art by providing a fault-tolerant method for a spiking neural network model based on dynamic neurons. The method aims to adjust the spiking distribution characteristics of SNN neurons to a state similar to the original model by dynamically adjusting the neuron parameters, thereby achieving fine-grained error blocking.
[0006] The objective of this application is achieved through the following technical solution: A fault-tolerant method for a dynamic neuron-based spiking neural network model is applied to an already deployed computer vision application based on a spiking neural network (SNN). The method includes: Run the validation dataset and statistically analyze the total number of pulse spikes generated in each channel dimension of each layer of neurons within a fixed time period, as well as the time of the first pulse generation, to obtain baseline data. Obtain the initial SNN model weights, replace the neuron weight parameters from layer-level granularity to channel-level granularity, and replace the original SNN model weights with the modified model weights; The model is run, and during the run, the system determines whether an error has occurred based on the characteristics of the pulse spike distribution. If an error occurs, a dynamic neuron parameter iteration algorithm is triggered. The dynamic neuron parameter iteration algorithm includes: By comparing the deviations of each current layer from the baseline data, the parameters of the top-k layers with the largest deviation loss are updated to make the number of spikes and the pulse duration approach the baseline state. Top-k is a preset natural number.
[0007] Furthermore, the baseline data obtained by statistically analyzing the total number of pulse spikes and the time of the first pulse generation in each channel dimension of each layer of neurons within a fixed time period according to the channel level includes: Set a fixed inference time window and batch size; Within the model, a first function is registered for each spiking neuron layer to obtain the spiking output tensor of each layer. Without injecting faults, the application is run to perform forward inference on the verification dataset; For the output of pulses in each channel of each layer in both time and spatial dimensions, the total number of channel pulse spikes within a fixed time window is statistically analyzed. Based on the baseline data, cumulative averaging is performed on multiple batches to generate baseline pulse spike statistics and baseline first pulse delay statistics for each channel of each layer. The channel-level baseline mean and standard deviation are obtained by aggregating the validation set.
[0008] Furthermore, the method also includes: If you need to generate an additional bit-flipped error weight dataset, convert the model's data format to a format suitable for the target network. Select the error injection strategy based on the error type; Convert the data string after the injection error into a format suitable for the model, write it back to the model, and save it.
[0009] Furthermore, replacing the neuron weight parameters from layer-level granularity to channel-level granularity includes: Replace scalar parameters with vector parameters and initialize them based on their original values to make the parameters functionally equivalent before and after the replacement.
[0010] Furthermore, the step of determining whether an error has occurred based on the characteristics of the pulse spike distribution includes: For any input sample or batch, calculate the channel discharge rate and the channel first pulse delay; The current statistics are compared with the baseline data to construct the relative deviation of the channel; Set a discharge rate deviation threshold and a delay deviation threshold. When the relative deviation of the channel is greater than the discharge rate deviation threshold or the delay deviation threshold, the current channel is recorded as an abnormal channel and an abnormal indication is calculated. If the abnormal indication meets the preset judgment conditions, an error is judged.
[0011] Furthermore, updating the parameters of the top-k layers with the largest deviations from the loss to bring the number of spikes and pulse duration closer to the baseline state includes: When there are too many channel spikes, the threshold is increased to suppress discharge; when there are too few channel spikes, the threshold is decreased to restore discharge; when the first pulse of a certain channel is significantly delayed or advanced, the membrane potential integral and decay rate are changed by adjusting the time constant to make the discharge timing approach the baseline.
[0012] Furthermore, the method also includes coupling compensation for parameter adjustments of the first top-k layers, specifically including: After each round of updates, if the deviation loss decreases and the proportion of abnormal channels decreases synchronously, coupling compensation is performed, statistics are rerun and deviation loss is recalculated. If the loss increases or the abnormality expands, the update step size is reduced or the parameters are rolled back.
[0013] The beneficial effects of this application are as follows: (I) This invention employs a fine-grained error suppression and blocking strategy, breaking through the limitations of existing methods that use a uniform threshold setting at the layer level, and further refining the control granularity to the channel level. By independently modeling and constraining the pulse distribution characteristics of different channels during runtime, this invention can fully characterize the differences in weight scale, pulse rate, and timing behavior of different channels within the same layer, thereby effectively avoiding the problem of insufficient or excessive anomaly suppression caused by significant differences in the theoretically optimal control parameters between channels. This fine-grained design allows abnormal pulses to be precisely limited at their source, significantly improving the ability to suppress anomaly propagation and cross-layer amplification.
[0014] (II) This invention does not rely on offline search or static parameter settings, but instead introduces a dynamic neuron parameter iteration mechanism oriented towards runtime. After detecting a serious error, the neuron parameters of key layers and key channels are adjusted in a targeted manner based on the degree of deviation of the channel pulse distribution from the baseline state. This iterative process aims to bring the pulse distribution back to the baseline, and avoids cascading instability caused by a large-scale modification at once through gradual updates and convergence constraints. Thus, it can maintain good stability and robustness under different error intensities and different input distributions. At the same time, this mechanism allows for flexible setting of anomaly judgment criteria and iteration stopping conditions according to actual application needs, achieving a controllable balance between enhanced fault tolerance and maintenance of original inference accuracy, and possessing strong adaptability and generalization ability. Attached Figure Description
[0015] Figure 1 This is a flowchart of a fault-tolerant method for a spiking neural network model based on dynamic neurons according to the present invention.
[0016] Figure 2 This is a flowchart of the weighted dataset generation and baseline pulse statistical acquisition process of the present invention.
[0017] Figure 3 This is a flowchart of the weight acquisition and neuron parameter channelization process of the present invention.
[0018] Figure 4 This is a flowchart of the runtime anomaly detection and dynamic parameter iteration triggering of the present invention.
[0019] Figure 5 This is a flowchart of the Top-k layer dynamic parameter iteration, chain explosion suppression, and stopping conditions of the present invention. Detailed Implementation
[0020] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.
[0021] Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0022] Reference Figure 1 ,like Figure 1The diagram shown is a flowchart of a fault-tolerant method for a spiking neural network model based on dynamic neurons, according to this embodiment. This embodiment provides a fault-tolerant method for a spiking neural network model based on dynamic neurons, specifically including the following steps: S1. For the already deployed computer vision application based on SNN spiking neural network, run the validation dataset, and according to the channel level, count the total number of pulse spikes generated in each channel dimension of each layer of neurons within a fixed time period under normal conditions, as well as the time of the first pulse generation, and set them as the baseline data.
[0023] S2. Obtain the initial SNN model weights. For neuron weight parameters, change the granularity from layer level to channel level. Replace the original SNN model weights with the modified model weights.
[0024] S3. Running model: During operation, it determines whether there is a serious error based on whether the distribution characteristics of the pulse spikes exceed the proportion of the baseline data of the corresponding channel. When a serious error occurs, it triggers the dynamic neuron parameter iteration algorithm to achieve the purpose of fault tolerance enhancement.
[0025] S4. After triggering a severe bit flip error, the model triggers a dynamic neuron parameter iteration algorithm. By comparing the deviations of each current layer from the baseline data, it selects the top-k layers with the largest loss to avoid excessively large modifications at once. This modifies V... thr , This process brings the number of spikes and pulse duration close to the baseline. The loss is then recalculated to ensure that the deviation from the baseline loss is reduced after iteration. This step is repeated until the loss reaches its minimum or the proportion of abnormal pulse distributions falls below a threshold, at which point the iteration ends.
[0026] Reference Figure 2 ,like Figure 2 The diagram shows the flowchart of the weight dataset generation and baseline pulse statistical acquisition process of this invention. Weight dataset generation mainly involves collecting the original weights and erroneous weights from the deployed neural network model. To simulate bit-flipping errors generated in the hardware, we need to strictly control the error injection method. Since the target networks are stored in IEEE 754 standard, the weight format needs to be converted to 32-bit floating-point format, bit-flipped, and then converted back to decimal during error injection.
[0027] Step A1.1: Select the validation dataset for the deployment scenario As baseline acquisition input Step A1.2: Set a fixed inference time window T and batch size B.
[0028] Step A1.3: Register a hook function for each spiking neuron layer inside the model to obtain the spiking output tensor of each layer.
[0029] Step A1.4: Under normal conditions without injecting faults, run the application to complete forward inference.
[0030] Step A1.5: For the output of pulses in each channel of each layer in both time and spatial dimensions, calculate the total number of channel pulse spikes within a fixed time window: Let the pulse output of the c-th channel in the l-th layer at time step t be: ; The total number of channel spikes for this sample within a fixed time window is defined as: ; The first pulse generation time of the channel is further calculated. Specifically, the spatial dimension is summed first to obtain an indication of whether a pulse has occurred at each time step, then the first pulse time is defined, and finally the normalized channel delay is obtained. The first pulse time is defined as: ; Step A1.6: On the baseline data, perform cumulative averaging on multiple batches to generate baseline pulse spike statistics and baseline first pulse delay statistics for each channel of each layer. Aggregate these statistics on the validation set to obtain the channel-level baseline mean and standard deviation. ; ; Step A1.7: Use a JSON file to store the baseline data in a layer-channel index manner, which will serve as the target reference for subsequent runtime anomaly detection and dynamic parameter iteration.
[0031] Step A2.1: If you need to generate an additional bit-flipped error weight dataset, first convert the Float32 to an IEEE 754 format bit string.
[0032] Step A2.2: Select an error injection strategy based on whether it is a single-bit error or a multi-bit error.
[0033] Step A2.3: Convert the bit string after the injection error into float32 format.
[0034] Step A2.4: Write back the model and save it.
[0035] Reference Figure 3 ,like Figure 3 The diagram shown illustrates the weight acquisition and neuron parameter channelization flowchart of this invention. The specific process for weight acquisition and neuron parameter channelization is as follows: Step B1: Obtain the initial set of SNN model weights to be enhanced for fault tolerance. The parameters are divided into two categories: one is the internal parameters of the spiking neuron, including the threshold V. thr Membrane time constant Reset parameter V reset The second is non-neuronal weights, including weights and biases of convolutional layers and fully connected layers.
[0036] Step B2, to enhance fine-grained control, replaces neuron parameters from layer-shared parameters to channel-level granularity: for example, the original scalar V in layer l. thr and Replace with vectors
[0037] It is initialized based on the original values to ensure that the functions before and after the replacement are equivalent and that no additional errors are introduced.
[0038] Step B3: Copy all non-neuron weights and write the copied non-neuron weights and channel-level granular neuron weights back into the model to obtain the fault-tolerant enhancement initial model after channelized neuron parameters.
[0039] Figure 4 This is a flowchart of the runtime anomaly detection and dynamic parameter iteration triggering process of the present invention. The process of runtime anomaly detection and dynamic neuron parameter iteration algorithm triggering is as follows: Step C1: Load the model processed by S2 and enter the inference process.
[0040] Step C2: During model execution, continuously monitor whether the pulse distribution characteristics of each layer and channel deviate from the baseline. For any input sample or batch, calculate the channel discharge rate and the channel first pulse delay in real time using the same statistical method as in S1.
[0041] ; The current statistics are then compared with the baseline data to construct the channel relative deviation, where ε is the numerical stability constant.
[0042] ; Step C3: To implement the engineering mechanism of "proportional judgment of serious errors", set the discharge rate deviation threshold and delay deviation threshold as follows: When satisfied If this channel is designated as an abnormal channel, then the channel abnormality indicator is defined as follows: ; Simultaneously, a threshold for the proportion of abnormal channels at the full model level is set, representing the maximum allowable proportion of abnormal pulse channels within the entire model; a threshold for the proportion of abnormal channels at the l-th layer is also set, representing the maximum allowable proportion of abnormal channels within a single layer.
[0043]
[0044] If the following conditions are met:
[0045] If a serious error is detected, the dynamic neuron parameter iteration algorithm of S4 is triggered to enhance fault tolerance.
[0046] Step C4: When a serious error occurs in any layer due to severe bit flipping, weight anomalies, or abnormal pulse distribution caused by computational perturbations, the dynamic neuron parameter iteration algorithm is triggered to enter S4 to enhance runtime fault tolerance. This triggering logic can be executed online without relying on labels, making it suitable for edge deployments and long-running scenarios.
[0047] Figure 5 This is a flowchart of the Top-k layer dynamic parameter iteration, cascading explosion suppression, and stopping conditions of this invention. The process of Top-k layer dynamic parameter iteration, cascading explosion suppression, and convergence stopping is as follows: When a critical error is triggered, the system starts a dynamic neuron parameter iteration algorithm and uses a "layered screening and gradual convergence" approach to suppress the chain reaction caused by a large-scale modification at once.
[0048] Step D1: Based on the deviation between the current running statistics and the baseline data, the system calculates a deviation loss index for each layer to measure the severity of the pulse distribution anomaly in that layer. The deviation loss can simultaneously combine the deviation of the total peak amount and the deviation of the first pulse time, and assign configurable weights to different indices.
[0049] Define the loss of the l-th layer as a weighted aggregation of channel deviations:
[0050] in This is the loss weighting coefficient, used to adjust the relative weights of the total deviation of pulse spikes and the deviation of the first pulse time in the hierarchical deviation loss. When the system focuses more on suppressing abnormal pulse amplification, it can be increased. When the system prioritizes the stability of information transmission timing, it can increase... .
[0051] The loss of the entire model is then: ; The set of top-k layers with the largest loss can be represented as:
[0052] Step D2: Sort the layers by deviation loss from largest to smallest, select the top-k layers with the largest loss as the adjustment targets for this iteration, update only the channel-level neuron parameters of these layers, and keep the other layers unchanged, in order to avoid cascading amplification caused by adjusting the entire model at the same time.
[0053] Specifically, therefore, for each The error term is defined as follows:
[0054] Further configure the update rules as follows: ; ; in Step size; The parameters are limited to a feasible range. The above form satisfies the intuitive control law: when there are too many spikes... Increase the threshold to suppress discharge; when the first pulse is late Increasing the time constant slows down decay and promotes earlier attainment of the threshold.
[0055] During parameter updates, the threshold and time constant of the corresponding channel are dynamically adjusted with the goal of bringing the number of spikes and the first pulse time back to the baseline: when there are too many spikes in a channel, the threshold is increased to suppress discharge; when there are too few spikes in a channel, the threshold is decreased to restore discharge; when the first pulse of a channel is significantly delayed or advanced, the membrane potential integral and decay rate are changed by adjusting the time constant to make the discharge timing approach the baseline.
[0056] Step D3: Introduce a coupling compensation mechanism to reduce the side effects of threshold adjustment on pulse timing, thereby improving iterative stability. After each round of updates, the system reruns the statistics and recalculates the deviation loss. ; Where δ is the minimum improvement threshold in the iterative convergence and acceptance criterion, used to determine whether a single parameter update brings about effective improvement. The current update is only accepted when the deviation loss decreases and the proportion of anomalous channels decreases synchronously; if the loss increases or anomalous channels expand, divergence is avoided by reducing the update step size or backing up parameters, as follows: ; ; Step D4: The above process is repeated until the deviation loss reaches the minimum point or the decrease is insufficient, or the proportion of abnormal channels is lower than the preset threshold, or the maximum number of iterations is reached, then the iteration stops, thereby achieving online, low-overhead fault-tolerant recovery and performance stability in the event of severe bit flips or weight disturbances.
[0057] The fault-tolerant method for dynamic neuron-based spiking neural network models provided in this embodiment employs a fine-grained error suppression and blocking strategy. From a structural design perspective, it overcomes the limitations of existing methods that use uniform threshold settings at the layer level, further refining the control granularity to the channel level. By independently modeling and constraining the pulse distribution characteristics of different channels during runtime, this invention can fully characterize the differences in weight scale, pulse rate, and temporal behavior among different channels within the same layer, thereby effectively avoiding the problem of insufficient or excessive anomaly suppression caused by significant differences in the theoretically optimal control parameters between channels. This fine-grained design allows abnormal pulses to be precisely limited at their source, significantly improving the ability to suppress anomaly propagation and cross-layer amplification.
[0058] The fault-tolerant method for dynamic neuron-based spiking neural network models provided in this embodiment does not rely on offline search or static parameter settings. Instead, it introduces a runtime-oriented dynamic neuron parameter iteration mechanism. After detecting a serious error, it makes targeted adjustments to the neuron parameters of key layers and key channels based on the degree of deviation of the channel pulse distribution from the baseline state. This iterative process aims to bring the pulse distribution back to the baseline. Through gradual updates and convergence constraints, it avoids cascading instability caused by large-scale modifications at once, thus maintaining good stability and robustness under different error intensities and input distributions. Simultaneously, this mechanism allows for flexible setting of anomaly judgment criteria and iteration stopping conditions according to actual application needs, achieving a controllable balance between enhanced fault tolerance and maintenance of original inference accuracy, and possessing strong adaptability and generalization ability.
[0059] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A fault-tolerant method for a spiking neural network model based on dynamic neurons, characterized in that, The method, applied to an already deployed computer vision application based on a spiking neural network (SNN), includes: Run the validation dataset and statistically analyze the total number of pulse spikes generated in each channel dimension of each layer of neurons within a fixed time period, as well as the time of the first pulse generation, to obtain baseline data. Obtain the initial SNN model weights, replace the neuron weight parameters from layer-level granularity to channel-level granularity, and replace the original SNN model weights with the modified model weights; The model is run, and during the run, the system determines whether an error has occurred based on the characteristics of the pulse spike distribution. If an error occurs, a dynamic neuron parameter iteration algorithm is triggered. The dynamic neuron parameter iteration algorithm includes: By comparing the deviations of each current layer from the baseline data, the parameters of the top-k layers with the largest deviation loss are updated to make the number of spikes and the pulse duration approach the baseline state. Top-k is a preset natural number.
2. The fault-tolerant method for a spiking neural network model based on dynamic neurons as described in claim 1, characterized in that, The baseline data obtained by statistically analyzing the total number of pulse spikes generated within a fixed time period on each channel dimension of neurons in each layer according to the channel level includes: Set a fixed inference time window and batch size; Within the model, a first function is registered for each spiking neuron layer to obtain the spiking output tensor of each layer. Without injecting faults, the application is run to perform forward inference on the verification dataset; For the output of pulses in each channel of each layer in both time and spatial dimensions, the total number of channel pulse spikes within a fixed time window is statistically analyzed. Based on the baseline data, cumulative averaging is performed on multiple batches to generate baseline pulse spike statistics and baseline first pulse delay statistics for each channel of each layer. The channel-level baseline mean and standard deviation are obtained by aggregating the validation set.
3. The fault-tolerant method for a spiking neural network model based on dynamic neurons as described in claim 2, characterized in that, The method further includes: If you need to generate an additional bit-flipped error weight dataset, convert the model's data format to a format suitable for the target network. Select the error injection strategy based on the error type; Convert the data string after the injection error into a format suitable for the model, write it back to the model, and save it.
4. The fault-tolerant method for a spiking neural network model based on dynamic neurons as described in claim 1, characterized in that, The step of replacing neuron weight parameters from hierarchical granularity to channel-level granularity includes: Replace scalar parameters with vector parameters and initialize them based on their original values to make the parameters functionally equivalent before and after the replacement.
5. The fault-tolerant method for a spiking neural network model based on dynamic neurons as described in claim 1, characterized in that, The method of determining whether an error has occurred based on the characteristics of pulse spike distribution includes: For any input sample or batch, calculate the channel discharge rate and the channel first pulse delay; The current statistics are compared with the baseline data to construct the relative deviation of the channel; Set a discharge rate deviation threshold and a delay deviation threshold. When the relative deviation of the channel is greater than the discharge rate deviation threshold or the delay deviation threshold, the current channel is recorded as an abnormal channel and an abnormal indication is calculated. If the abnormal indication meets the preset judgment conditions, an error is judged.
6. The fault-tolerant method for a spiking neural network model based on dynamic neurons as described in claim 1, characterized in that, The step of updating the parameters of the top-k layers with the largest deviation from the loss to bring the number of spikes and the pulse duration closer to the baseline includes: When there are too many channel spikes, the threshold is increased to suppress discharge; when there are too few channel spikes, the threshold is decreased to restore discharge; when the first pulse of a certain channel is significantly delayed or advanced, the membrane potential integral and decay rate are changed by adjusting the time constant to make the discharge timing approach the baseline.
7. The fault-tolerant method for a spiking neural network model based on dynamic neurons as described in claim 1, characterized in that, The method also includes coupling compensation for parameter adjustments of the first top-k layers, specifically including: After each round of updates, if the deviation loss decreases and the proportion of abnormal channels decreases synchronously, coupling compensation is performed, statistics are rerun and deviation loss is recalculated. If the loss increases or the abnormality expands, the update step size is reduced or the parameters are rolled back.