A method, system, and device for failure assessment of a spiking neural network circuit.

By injecting faults into spiking neural network circuits, the failure indicators of spiking neural network circuits are evaluated and optimized, solving the problem that existing technologies cannot improve the reliability of spiking neural network circuits, and achieving higher stability and accuracy.

CN116757266BActive Publication Date: 2025-10-28GUANGDONG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310823424.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-05
Publication Date
2025-10-28
Estimated Expiration
2043-07-05

AI Technical Summary

Technical Problem

Existing neural network circuit evaluation and optimization methods cannot effectively improve the reliability of spiking neural network circuits, and ignore the impact of hardware failures on the performance of spiking neural networks.

Method used

By injecting pre-set faults into the spiking neural network units of the spiking neural network circuit, the accuracy before and after the fault is calculated, the failure index is evaluated, and the spiking neural network circuit is optimized based on the failure index and optimization strategy, replacing neurons with poor fault tolerance or redundant neurons.

Benefits of technology

This improves the reliability of the spiking neural network circuit, enhances its fault tolerance to hardware failures, and improves the stability and accuracy of the network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116757266B_ABST
    Figure CN116757266B_ABST
Patent Text Reader

Abstract

This invention discloses a failure assessment method, system, and device for spiking neural network circuits, relating to the field of spiking neural network circuit technology. The method includes: injecting a pre-set fault into the spiking neural network unit of the spiking neural network circuit to change the stability of the spiking neural network circuit, obtaining a faulty spiking neural network circuit; then, based on a pre-set sample set, calculating the first accuracy of the spiking neural network deployed in the spiking neural network circuit before the fault injection, and the second accuracy of the spiking neural network in the faulty spiking neural network circuit after the fault injection; finally, optimizing the spiking neural network circuit based on the first accuracy, the second accuracy, and a pre-set optimization strategy. This solves the technical problem that existing neural network circuit evaluation and optimization methods cannot effectively improve the reliability of the spiking neural network circuit itself.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of spiking neural network circuits, and more particularly to a failure assessment method for spiking neural network circuits. Background Technology

[0002] The neural networks connected to the brain are the most complex, consume extremely low power (approximately 25W), and exhibit strong robustness, thus attracting considerable attention and research from scholars. One research direction is the construction of software / hardware to simulate biological neural networks. Spiking neural networks (SNNs) transmit information using discrete action potentials. By simulating the biological brain, they offer advantages such as faster recognition speed, higher temporal resolution, lower latency, and lower energy consumption, leading to their widespread application. Since SNNs require deployment on SNN circuits, circuits with higher stability and fault tolerance can effectively improve the accuracy of SNNs.

[0003] It is widely believed that spiking neural network (SNN) circuits inherit the excellent robustness of the biological brain, possessing a certain degree of fault tolerance to approximation errors caused by manufacturing defects and hardware aging. Therefore, during fault-tolerant training, software fault injection is typically employed. This involves injecting faults into the spiking neural network deployed within the circuit to evaluate and optimize its stability. However, hardware failures can lead to a decrease in the accuracy of spiking neural networks. Software fault injection ignores the impact of hardware failures on the spiking neural network's performance, meaning that optimizations based on software fault injection cannot effectively improve the reliability of the spiking neural network circuit itself. Summary of the Invention

[0004] This invention provides a failure assessment method, system, and device for spiking neural network circuits, which addresses the technical problem that existing neural network circuit evaluation and optimization methods cannot effectively improve the reliability of spiking neural network circuits themselves.

[0005] The first aspect of this application provides

[0006] Based on a preset sample set, the first accuracy of the spiking neural network deployed in the spiking neural network circuit is calculated; wherein the spiking neural network circuit includes spiking neural network units;

[0007] A pre-set fault is injected into the spiking neural network unit to obtain a faulty spiking neural network circuit.

[0008] Based on the preset sample set, the second accuracy of the spiking neural network deployed in the faulty spiking neural network circuit is calculated;

[0009] The failure index of the spiking neural network circuit is evaluated based on the first accuracy and the second accuracy, and the spiking neural network circuit is optimized according to the failure index and the preset optimization strategy.

[0010] Preferably, when the preset fault is preset noise, the step of injecting the preset fault into the spiking neural network unit to obtain the faulty spiking neural network circuit includes:

[0011] The preset noise is injected into the neurons of the spiking neural network unit to obtain a faulty spiking neural network circuit;

[0012] The neurons are either input layer neurons, hidden layer neurons, output layer neurons, or input layer neurons, hidden layer neurons, or output layer neurons.

[0013] Preferably, calculating the second accuracy of the spiking neural network deployed in the faulty spiking neural network circuit based on the preset sample set includes:

[0014] Using the preset sample set as input to the spiking neural network, the second accuracy of the spiking neural network is calculated when the neuron is the input layer neuron group, the hidden layer neuron group, or the output layer neuron group, respectively.

[0015] Wherein, the second accuracy of the spiking neural network when the neuron is the input layer neuron group is denoted as the input layer second accuracy, the second accuracy of the spiking neural network when the neuron is the hidden layer neuron group is denoted as the hidden layer second accuracy, and the second accuracy of the spiking neural network when the neuron is the output layer neuron group is denoted as the output layer second accuracy.

[0016] Preferably, the step of evaluating the failure index of the spiking neural network circuit based on the first accuracy and the second accuracy, and optimizing the spiking neural network circuit based on the failure index and a preset optimization strategy includes:

[0017] The absolute value of the difference between the first accuracy and the second accuracy of the input layer is recorded as the input layer failure index; the absolute value of the difference between the first accuracy and the second accuracy of the hidden layer is recorded as the hidden layer failure index; the absolute value of the difference between the first accuracy and the second accuracy of the output layer is recorded as the output layer failure index.

[0018] The neuron corresponding to the failure index with the largest value among the input layer failure index, the hidden layer failure index, and the output layer failure index is designated as the neuron to be optimized, and the neuron to be optimized is replaced with a preset first neuron; wherein, the preset first neuron is a noise-reducing neuron.

[0019] Preferably, when the preset fault is a disabled neuron, the step of injecting the preset fault into the spiking neural network unit to obtain a faulty spiking neural network circuit includes:

[0020] The number of pulses of each neuron in the spiking neural network unit is obtained, and the neurons are disabled by accumulating the number of pulses from smallest to largest to obtain several faulty spiking neural network circuits.

[0021] Preferably, calculating the second accuracy of the spiking neural network deployed in the faulty spiking neural network circuit based on the preset sample set includes:

[0022] Using the preset sample set as input to the spiking neural network, the second accuracy of the spiking neural network in the several faulty spiking neural network circuits is calculated respectively, and several second accuracies are obtained.

[0023] Preferably, the step of evaluating the failure index of the spiking neural network circuit based on the first accuracy and the second accuracy, and optimizing the spiking neural network circuit based on the failure index and a preset spiking neural network circuit evaluation optimization strategy includes:

[0024] Calculate the absolute value of the difference between the first accuracy and several second accuracies to obtain several failure indicators;

[0025] The spiking neural network circuit is optimized based on a preset failure index threshold, several failure indices, and a preset spiking neural network circuit evaluation and optimization strategy.

[0026] Preferably, the optimization of the spiking neural network circuit based on a preset failure index threshold, several failure indices, and a preset spiking neural network circuit evaluation and optimization strategy includes:

[0027] The neurons corresponding to failure indices that are not greater than a preset failure index threshold are designated as neurons to be optimized. The neurons to be optimized are replaced with a preset second neuron to optimize the spiking neural network circuit.

[0028] The number of pulses of the preset second neuron is greater than the number of pulses of any of the neurons to be optimized.

[0029] A second aspect of this application also provides a failure assessment system for spiking neural network circuits, comprising:

[0030] The first calculation module is used to calculate the first accuracy of the spiking neural network deployed in the spiking neural network circuit based on a preset sample set; wherein the spiking neural network circuit includes spiking neural network units;

[0031] The fault injection module is used to inject a preset fault into the spiking neural network unit to obtain a faulty spiking neural network circuit.

[0032] The second calculation module is used to calculate the second accuracy of the spiking neural network deployed in the faulty spiking neural network circuit based on the preset sample set.

[0033] An evaluation and optimization module is used to evaluate the failure indicators of the spiking neural network circuit based on the first accuracy and the second accuracy, and to optimize the spiking neural network circuit according to the failure indicators and a preset optimization strategy.

[0034] A third aspect of this application also provides a failure assessment device for a spiking neural network circuit, including a memory and a processor;

[0035] The memory is used to store computer programs;

[0036] The processor is configured to implement the failure assessment method for the spiking neural network circuit as described in the first aspect of this application when executing the computer program.

[0037] The failure assessment method for spiking neural network circuits provided by the above-mentioned technical solution of this application involves injecting a pre-set fault into the spiking neural network unit of the spiking neural network circuit to change the stability of the spiking neural network circuit, thereby obtaining a faulty spiking neural network circuit. Then, based on a pre-set sample set, the method calculates the first accuracy of the spiking neural network of the spiking neural network circuit before the fault injection and the second accuracy of the spiking neural network of the faulty spiking neural network circuit after the fault injection. Finally, the method optimizes the spiking neural network circuit based on the first accuracy, the second accuracy, and a pre-set optimization strategy.

[0038] By directly injecting pre-set faults into the spiking neural network units of the spiking neural network circuit, and analyzing the impact of the injected faults on the stability of the spiking neural network circuit based on the accuracy of the spiking neural network deployed in the circuit, the spiking neural network circuit itself is directly optimized, thereby improving the reliability of the spiking neural network circuit itself. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1The overall method flow diagram of a failure assessment method for a spiking neural network circuit provided in the embodiments of this application is intended to illustrate this method.

[0041] Figure 2 A flowchart of the first spiking neural network circuit evaluation and optimization method provided in the embodiments of this application;

[0042] Figure 3 A flowchart of the second spiking neural network circuit evaluation and optimization method provided in the embodiments of this application;

[0043] Figure 4 This is a schematic diagram of the structure of a failure assessment system for a spiking neural network circuit provided in an embodiment of this application. Detailed Implementation

[0044] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0045] Embodiment 1 of this application provides a failure assessment method for a spiking neural network circuit. Please refer to [link to documentation]. Figure 1 In Example 1, the method includes:

[0046] 100. Based on a pre-set sample set, calculate the first accuracy of a spiking neural network deployed on a spiking neural network circuit; wherein the spiking neural network circuit contains spiking neural network units.

[0047] The spiking neural network is deployed in the spiking neural network unit. The preset sample set is used as the input of the spiking neural network to obtain the output of the spiking neural network. The accuracy of the spiking neural network in the current (before fault injection) spiking neural network circuit can be determined by comparing the output with the preset theoretical output, which is denoted as the first accuracy.

[0048] 200. Inject a pre-set fault into the spiking neural network unit to obtain a faulty spiking neural network circuit.

[0049] Spiking neural networks are deployed on spiking neural network circuits. When the spiking neural network circuits malfunction, it will affect the accuracy of the spiking neural network deployed on the spiking neural network circuits. By artificially injecting preset faults into the spiking neural network circuits, various faults that may occur during the operation of the spiking neural network circuits can be simulated, thereby analyzing the accuracy of the spiking neural network under various faulty spiking neural network circuits.

[0050] 300. Based on a pre-set sample set, calculate the second accuracy of the spiking neural network deployed on the faulty spiking neural network circuit.

[0051] The stability of the spiking neural network circuit decreases after a fault is injected, and the accuracy of the spiking neural network deployed on the faulty spiking neural network circuit is also affected. Using the same preset sample set as in step 100 as the input of the spiking neural network deployed on the faulty spiking neural network circuit, the output of the spiking neural network is obtained. Comparing the output with the preset theoretical output can determine the accuracy of the spiking neural network in the current (after fault injection) spiking neural network circuit, which is denoted as the second accuracy.

[0052] 400. Evaluate the failure indicators of the spiking neural network circuit based on the first accuracy and the second accuracy, and optimize the spiking neural network circuit according to the failure indicators and the preset optimization strategy.

[0053] The first accuracy represents the accuracy of the spiking neural network before fault injection, and also indicates the stability of the spiking neural network circuit before fault injection. The second accuracy represents the accuracy of the spiking neural network after fault injection, and also indicates the stability of the spiking neural network circuit after fault injection. By comparing the first accuracy and the second accuracy, we can know the degree of influence of the injected fault on the accuracy of the spiking neural network, that is, the degree of influence on the stability of the spiking neural network circuit. Furthermore, based on the preset fault injected in step 300, the part with poor fault tolerance in the corresponding optimized spiking neural network circuit is optimized.

[0054] For example, in a specific instance, when it is known that the input layer neurons in the original spiking neural network unit are affected by noise, the accuracy of the spiking neural network deployed on the spiking neural network circuit decreases significantly. In this case, the input layer neurons can be replaced with units (components) with stronger noise resistance to optimize the spiking neural network circuit. When it is known that one or more neurons in the original spiking neural network unit are faulty, the accuracy of the spiking neural network deployed on the spiking neural network circuit decreases significantly. In this case, redundant neurons can be set up for the faulty neurons, which actively replace the faulty neurons in the faulty neurons, thereby improving the fault tolerance of the spiking neural network circuit and optimizing the spiking neural network circuit.

[0055] The failure assessment method for the spiking neural network circuit provided in Example 1 involves injecting a pre-set fault into the spiking neural network unit of the spiking neural network circuit to change the stability of the spiking neural network circuit, thereby obtaining a faulty spiking neural network circuit. Then, based on a pre-set sample set, the method calculates the first accuracy of the spiking neural network deployed in the spiking neural network circuit before the fault injection and the second accuracy of the spiking neural network in the faulty spiking neural network circuit after the fault injection. Finally, the method optimizes the spiking neural network circuit based on the first accuracy, the second accuracy, and a pre-set optimization strategy.

[0056] By directly injecting pre-set faults into the spiking neural network units of the spiking neural network circuit, and analyzing the impact of the injected faults on the stability of the spiking neural network circuit based on the accuracy of the spiking neural network deployed in the circuit, the spiking neural network circuit itself is directly optimized, thereby improving the reliability of the spiking neural network circuit itself.

[0057] Based on the aforementioned Embodiment 1, this application provides another preferred Embodiment 2, see [link to Embodiment 2]. Figure 2 In Example 2, when the preset fault is preset noise, steps 200-400 can be implemented in the following way.

[0058] Preset noise is injected into the neurons of the spiking neural network unit to obtain a faulty spiking neural network circuit; wherein, the preset noise includes, but is not limited to, Gaussian noise and salt-and-pepper noise.

[0059] It is important to note that the neurons in a spiking neural network unit can be divided into input layer neuron groups, hidden layer neuron groups, and output layer neuron groups. Each input layer neuron group also contains several input layer neurons, each hidden layer neuron group also contains several hidden layer neurons, and each output layer neuron group also contains several output layer neurons.

[0060] Therefore, injecting preset noise into the neurons of the spiking neural network unit can specifically be done by injecting preset noise into the input layer neuron group (or input layer neurons) to obtain the input layer fault spiking neural network circuit, injecting preset noise into the hidden layer neuron group (or hidden layer neurons) to obtain the hidden layer fault spiking neural network circuit, and injecting preset noise into the output layer neuron group (or output layer neurons) to obtain the output layer fault spiking neural network circuit.

[0061] After obtaining the faulty spiking neural network circuit, the accuracy of the spiking neural networks deployed in the faulty spiking neural network circuit (input layer faulty spiking neural network circuit / hidden layer faulty spiking neural network circuit / output layer faulty spiking neural network circuit) can be analyzed to determine the impact of preset noise on the stability of the spiking neural network circuit. Specifically:

[0062] By using a pre-set sample set as the input to a spiking neural network deployed on a faulty spiking neural network circuit, the second accuracy of the spiking neural network is calculated when the neurons are the input layer neuron group, the hidden layer neuron group, or the output layer neuron group, respectively; that is, the accuracy of the spiking neural network is calculated when the faulty spiking neural network circuit is the input layer faulty spiking neural network circuit, the hidden layer faulty spiking neural network circuit, and the output layer faulty spiking neural network circuit, respectively.

[0063] To distinguish it from the first accuracy of the spiking neural network on the spiking neural network circuit before fault injection, the accuracy of the spiking neural network deployed on the faulty spiking neural network circuit is referred to here as the second accuracy. Simultaneously, by using the same preset sample set and controlling the input variables, it is ensured that the cause affecting the accuracy of the spiking neural network is the spiking neural network circuit itself, thus facilitating precise optimization of the spiking neural network circuit based on its accuracy.

[0064] The second accuracy of the spiking neural network deployed in the input layer fault spiking neural network circuit is denoted as the input layer second accuracy, the second accuracy of the spiking neural network deployed in the hidden layer fault spiking neural network circuit is denoted as the hidden layer second accuracy, and the second accuracy of the spiking neural network deployed in the output layer fault spiking neural network circuit is denoted as the output layer second accuracy.

[0065] Furthermore, the failure index of the spiking neural network circuit can be determined through the first and second accuracies obtained above. Then, the faulty spiking neural network circuit can be optimized based on the failure index and a preset optimization strategy. Here, the failure index can be understood as the degree of influence of injected faults (preset noise) on the stability of the spiking neural network circuit.

[0066] In this embodiment, the absolute value of the difference between the first accuracy and the second accuracy of the input layer is recorded as the input layer failure index; the absolute value of the difference between the first accuracy and the second accuracy of the hidden layer is recorded as the hidden layer failure index; and the absolute value of the difference between the first accuracy and the second accuracy of the output layer is recorded as the output layer failure index.

[0067] Then, the neuron corresponding to the failure index with the largest value among the input layer failure index, hidden layer failure index, and output layer failure index is recorded as the neuron to be optimized, and the neuron to be optimized is replaced with a preset first neuron; wherein, the preset first neuron is a noise reduction neuron.

[0068] Understandably, the failure index represents the degree to which injected faults affect the stability of a spiking neural network (SNN) circuit. A larger failure index indicates a more severe impact of injected faults on the stability of the SNN circuit, and also reflects the poorer fault tolerance of some components in the SNN circuit that receive faults. For example, under the same preset sample set, the input layer failure index is greater than the hidden layer failure index and the output layer failure index. This indicates that injecting preset noise into the input layer of a SNN unit has the most severe impact on the accuracy of the SNN deployed on the SNN circuit, greater than the impact of injecting preset noise into the hidden / output layers of the SNN unit. In other words, the input layer of the SNN unit has the worst fault tolerance.

[0069] Therefore, by comparing the values ​​of the failure indices of the input layer, hidden layer, and output layer, the layer (neurons) corresponding to the largest failure index is determined, and then that layer is optimized to achieve the effect of optimizing the spiking neural network circuit itself.

[0070] In this embodiment, the neurons in the layer corresponding to the maximum value of the failure index can be replaced with neurons with stronger noise resistance, thereby improving the noise resistance of the spiking neural network circuit and reducing the interference of noise on the spiking neural network deployed on the spiking neural network circuit.

[0071] In a preferred embodiment, after determining the layer corresponding to the maximum failure index, steps 200-400 can be further performed on each neuron in that layer. Specifically, preset noise is injected into each neuron in that layer, and the accuracy of the spiking neural network deployed in the spiking neural network circuit is calculated when different neurons are affected by noise. This allows one or more neurons with poor fault tolerance to be replaced with noise-resistant neurons, thereby achieving precise optimization of the spiking neural network circuit.

[0072] The failure assessment method for the spiking neural network circuit provided in Example 2 directly injects preset noise into the spiking neural network unit of the spiking neural network circuit. Based on the accuracy of the spiking neural network deployed in the spiking neural network circuit, it identifies the components (neurons) with low fault tolerance in the spiking neural network circuit, and then optimizes these components in a targeted manner, thereby improving the reliability of the spiking neural network circuit itself.

[0073] Based on the aforementioned embodiment 1, this application provides another preferred embodiment 3, see [link to embodiment 3]. Figure 3 In Example 3, when the preset fault is disabled neurons, steps 200-400 can be implemented in the following way:

[0074] The number of pulses of each neuron in the spiking neural network unit is obtained, and the neurons are disabled by accumulating the pulse counts from smallest to largest, resulting in several faulty spiking neural network circuits.

[0075] A spiking neural network unit contains a number of neurons. The spiking neural network deployed in the spiking neural network circuit performs calculations through the neurons in the spiking neural network unit. When a neuron in the spiking neural network unit malfunctions, it may affect the accuracy of the spiking neural network deployed in the spiking neural network circuit. By disabling the neurons in the spiking neural network unit to simulate the situation where the neurons in the spiking neural network unit malfunction, the accuracy of the spiking neural network in the faulty spiking neural network circuit can be analyzed to optimize the spiking neural network circuit.

[0076] Since the number of output pulses of a neuron is positively correlated with the neuron's contribution to the spiking neural network circuit (its ability to affect stability), the more pulses a neuron outputs, the more significant its impact on the stability of the spiking neural network circuit. When a neuron with a large number of output pulses fails, it may have a serious impact on the stability of the spiking neural network circuit. Therefore, this embodiment obtains the number of pulses of each neuron in the spiking neural network unit, sorts the neurons according to the number of output pulses from smallest to largest, disables the neuron with the smallest number of output pulses, and accumulates the disablement of neurons from smallest to largest. Each time one or more neurons are disabled, a new faulty spiking neural network circuit is formed, thereby obtaining a number of faulty spiking neural network circuits.

[0077] After obtaining the faulty spiking neural network circuit, the accuracy of the spiking neural networks deployed within the circuit can be analyzed to identify one or more neurons that have a significant impact on the circuit's stability, and one or more neurons that have a less significant impact. Further adjustments to these neurons can then optimize the spiking neural network circuit. Specifically:

[0078] Using a pre-set sample set as input to the spiking neural network deployed in the above-mentioned faulty spiking neural network circuit, the second accuracy of the spiking neural network in several faulty spiking neural network circuits is calculated respectively, and several second accuracies are obtained.

[0079] To distinguish it from the first accuracy of the spiking neural network on the spiking neural network circuit before fault injection, the accuracy of the spiking neural network deployed on the faulty spiking neural network circuit is referred to here as the second accuracy. Simultaneously, by using the same preset sample set and controlling the input variables, it is ensured that the cause affecting the accuracy of the spiking neural network is the spiking neural network circuit itself, thus facilitating precise optimization of the spiking neural network circuit based on its accuracy.

[0080] Furthermore, the absolute value of the difference between the first accuracy and several second accuracies is calculated, and this absolute value is recorded as the failure index of the spiking neural network circuit. Here, the failure index can be understood as the degree of impact of injected faults (disabling neurons) on the stability of the spiking neural network circuit.

[0081] Understandably, the failure index represents the degree to which injected faults affect the stability of the spiking neural network (SNN) circuit. A larger failure index indicates a more severe impact of the injected faults on the stability of the SNN circuit. It also indirectly reflects the higher contribution of disabled neurons to the SNN circuit; here, contribution refers to the neuron's ability to influence the stability of the SNN circuit. For example, under the same pre-set sample set, the failure index of the SNN circuit when neuron 1 is disabled is greater than that when neuron 2 is disabled, indicating that neuron 1 has a greater impact on the accuracy of the SNN deployed on the SNN circuit than neuron 2.

[0082] Therefore, by comparing the failure indices of the faulty spiking neural network circuit when different neurons are disabled, the contribution of different neurons to the spiking neural network circuit can be determined. Then, based on the contribution of each neuron, the neurons can be optimized, thereby optimizing the spiking neural network circuit itself. Specifically:

[0083] The spiking neural network circuit is optimized by denoting neurons whose failure index is not greater than a preset failure index threshold as neurons to be optimized, and replacing the neurons to be optimized with preset second neurons; wherein, the number of pulses of the preset second neuron is greater than the number of pulses of any neuron to be optimized.

[0084] By comparing the failure index with a preset failure index threshold, the faulty spiking neural network circuit corresponding to the failure index not exceeding the preset failure index threshold is determined. Then, the disabled neurons in the faulty spiking neural network circuit are identified and recorded as neurons to be optimized. The neurons to be optimized are then replaced with a preset second neuron, thereby achieving the effect of optimizing the spiking neural network circuit itself.

[0085] In this embodiment, the second neuron is preset to have a larger number of output pulses. The number of output pulses of the second neuron should be greater than the number of pulses of any neuron to be optimized. It is understood that neurons with a larger number of output pulses contribute more to the spiking neural network circuit. By replacing some neurons with smaller contributions and less impact on the stability of the spiking neural network circuit, as many neurons (components) with larger contributions as possible are used within the limited component layout space. When some of the neurons with larger contributions fail, the remaining neurons with larger contributions can still ensure the stability of the spiking neural network circuit, thus improving the fault tolerance of the spiking neural network circuit.

[0086] As an example, consider a spiking neural network circuit with 10 neurons. Neuron 1 outputs 1 pulse, neuron 2 outputs 2 pulses, neuron 3 outputs 3 pulses, neuron 4 outputs 4 pulses, neuron 5 outputs 5 pulses, neuron 6 outputs 6 pulses, neuron 7 outputs 7 pulses, neuron 8 outputs 8 pulses, neuron 9 outputs 9 pulses, and neuron 10 outputs 10 pulses. Before fault injection, the initial accuracy of the spiking neural network deployed in the circuit is 100%. After fault injection:

[0087] ① When neuron 1 is disabled, the second accuracy of the spiking neural network deployed in the spiking neural network circuit is 98%;

[0088] ② When both neuron 1 and neuron 2 are disabled, the second accuracy of the spiking neural network deployed in the spiking neural network circuit is 95%.

[0089] ③ When neuron 1, neuron 2 and neuron 3 are simultaneously disabled, the second accuracy of the spiking neural network deployed in the spiking neural network circuit is 91%;

[0090] ④ When neuron 1, neuron 2, neuron 3 and neuron 4 are simultaneously disabled, the second accuracy of the spiking neural network deployed in the spiking neural network circuit is 85%.

[0091] Assume the preset failure threshold for the spiking neural network circuit is 10%. In case ①, the absolute value of the difference between the first accuracy and the second accuracy is 2%, which does not exceed 10% of the preset failure threshold. In this case, the disabled neuron in the faulty spiking neural network circuit is neuron 1, and neuron 1 is designated as the neuron to be optimized. In case ②, the absolute value of the difference between the first accuracy and the second accuracy is 5%, which does not exceed 10% of the preset failure threshold. In this case, the disabled neurons in the faulty spiking neural network circuit are neuron 1 and neuron 2, and neuron 1 and neuron 2 are designated as the neurons to be optimized. In case ③, the absolute value of the difference between the first accuracy and the second accuracy is 9%, which does not exceed 10% of the preset failure threshold. In this case, the disabled neurons in the faulty spiking neural network circuit are neuron 1 and neuron 2. Neurons 1, 2, and 3 are designated as neurons to be optimized. In case ④, the absolute value of the difference between the first and second accuracies is 15%, exceeding the preset failure threshold of 10%. Clearly, further disabling neurons beyond those in case ③ has a greater impact on the stability of the spiking neural network circuit, while disabling neurons before this point has a smaller impact (i.e., neurons 1, 2, and 3 have a smaller impact on the stability of the spiking neural network circuit, while neuron 4 has a greater impact). To ensure the spiking neural network circuit has high fault tolerance, neurons 1, 2, and 3 are replaced with neurons that have a higher number of output pulses. For example, neurons 1, 2, and 3 can all be replaced with neurons 8, 9, or 10, etc.

[0092] By replacing neurons 1, 2, and 3, which have a smaller impact on the stability of the spiking neural network circuit, with neurons 8, 9, or 10, which have a larger impact on the stability of the spiking neural network circuit, a backup neuron is set up for the neurons that have a larger impact on the stability of the spiking neural network circuit. When the neurons that have a larger impact on the stability of the spiking neural network circuit fail, the backup neurons can fill in in time, so that the spiking neural network circuit has a high fault tolerance and stability.

[0093] In a preferred embodiment, once the neurons to be optimized are determined, if the number of neurons to be optimized meets a preset maximum threshold (e.g., out of 10 neurons, only 6 are primarily functional, while the other 4 have almost no impact on the stability of the spiking neural network circuit), to avoid wasting resources, the structure of the spiking neural network circuit can be adjusted by directly deleting the number of neurons to be optimized, making the spiking neural network circuit a smaller network topology (deleting 4 neurons that have almost no impact on the stability of the spiking neural network circuit). Meanwhile, if the number of neurons to be optimized does not meet a preset minimum threshold (e.g., out of 10 neurons, 9 are primarily functional, and only 1 has a minor impact on the stability of the spiking neural network circuit), to ensure the normal operation of the spiking neural network circuit, operations such as redeploying the neuron connections can be performed to ensure the stability of the spiking neural network circuit.

[0094] As an example, consider a spiking neural network circuit with 10 neurons. Neuron 1 outputs 1 pulse, neuron 2 outputs 2 pulses, neuron 3 outputs 3 pulses, neuron 4 outputs 4 pulses, neuron 5 outputs 5 pulses, neuron 6 outputs 6 pulses, neuron 7 outputs 7 pulses, neuron 8 outputs 8 pulses, neuron 9 outputs 9 pulses, and neuron 10 outputs 10 pulses. Before fault injection, the initial accuracy of the spiking neural network deployed in the circuit is 100%. After fault injection:

[0095] Scenario 1:

[0096] ① When neuron 1 is disabled, the second accuracy of the spiking neural network deployed in the spiking neural network circuit is 99%;

[0097] ② When both neuron 1 and neuron 2 are disabled, the second accuracy of the spiking neural network deployed in the spiking neural network circuit is 98%.

[0098] ③ When neuron 1, neuron 2 and neuron 3 are simultaneously disabled, the second accuracy of the spiking neural network deployed in the spiking neural network circuit is 97%;

[0099] ④ When neuron 1, neuron 2, neuron 3 and neuron 4 are simultaneously disabled, the second accuracy of the spiking neural network deployed in the spiking neural network circuit is 96%.

[0100] ⑤ When neuron 1, neuron 2, neuron 3, neuron 4 and neuron 5 are simultaneously disabled, the second accuracy of the spiking neural network deployed in the spiking neural network circuit is 88%.

[0101] Assume the preset failure index threshold for the spiking neural network circuit is 10%, and the preset maximum number threshold is 3. In scenario ①, the absolute value of the difference between the first accuracy and the second accuracy is 1%, which does not exceed 10% of the preset failure index threshold. In this case, the disabled neuron in the faulty spiking neural network circuit is neuron 1, and neuron 1 is recorded as the neuron to be optimized. In scenario ②, the absolute value of the difference between the first accuracy and the second accuracy is 2%, which does not exceed 10% of the preset failure index threshold. In this case, the disabled neurons in the faulty spiking neural network circuit are neuron 1 and neuron 2, and neuron 1 and neuron 2 are recorded as the neurons to be optimized. In scenario ③, the absolute value of the difference between the first accuracy and the second accuracy is 3%, which does not exceed 10% of the preset failure index threshold. In this case, the disabled neurons in the faulty spiking neural network circuit are neuron 1, neuron 2, and neuron 3, and neuron 1, neuron 2, and neuron 3 are recorded as the neurons to be optimized. In scenario ④, the absolute value of the difference between the first accuracy and the second accuracy is 4%, which does not exceed 10% of the preset failure index threshold. In this case, the disabled neurons in the faulty spiking neural network circuit are neuron 1, neuron 2, neuron 3, and neuron 4, and neuron 1, neuron 2, and neuron 3 are recorded as the neurons to be optimized. Neuron 4 is designated as the neuron to be optimized. In case ⑤, the absolute value of the difference between the first accuracy and the second accuracy is 12%, which exceeds the preset failure index threshold of 10%. Obviously, the neurons that are disabled further on the basis of case ④ have a greater impact on the stability of the spiking neural network circuit (that is, neurons 1, 2, 3, and 4 have a smaller impact on the stability of the spiking neural network circuit, while neuron 5 has a greater impact on the stability of the spiking neural network circuit). Although the neurons that were disabled before this (neurons 1, 2, 3, and 4) have a smaller impact on the stability of the spiking neural network circuit, the number of neurons to be optimized is 4, which exceeds the preset maximum number threshold of 3. This indicates that a large number of neurons do not have a significant impact on the stability of the spiking neural network circuit (being disabled will not seriously affect the accuracy of the spiking neural network). In order to avoid wasting resources, in this embodiment, the structure of the spiking neural network circuit can be adjusted by directly deleting neurons 1, 2, 3, and 4 to be optimized, so that the spiking neural network circuit becomes a smaller network topology structure for circuit optimization.

[0102] Scenario 2:

[0103] ① When neuron 1 is disabled, the second accuracy of the spiking neural network deployed in the spiking neural network circuit is 99%;

[0104] ② When both neuron 1 and neuron 2 are disabled, the second accuracy of the spiking neural network deployed in the spiking neural network circuit is 89%.

[0105] ③ When neuron 1, neuron 2 and neuron 3 are simultaneously disabled, the second accuracy of the spiking neural network deployed in the spiking neural network circuit is 70%;

[0106] ④ When neuron 1, neuron 2, neuron 3 and neuron 4 are simultaneously disabled, the second accuracy of the spiking neural network deployed in the spiking neural network circuit is 50%.

[0107] Assume the preset failure index threshold for the spiking neural network circuit is 10%, and the preset minimum number threshold is 2. In case ①, the absolute value of the difference between the first accuracy and the second accuracy is 1%, which does not exceed 10% of the preset failure index threshold. In this case, the disabled neuron in the faulty spiking neural network circuit is neuron 1, and neuron 1 is recorded as the neuron to be optimized. In case ②, the absolute value of the difference between the first accuracy and the second accuracy is 11%, which exceeds 10% of the preset failure index threshold. In this case, the disabled neurons in the faulty spiking neural network circuit are neuron 1 and neuron 2. Obviously, continuing to disable neurons based on case ① has a greater impact on the stability of the spiking neural network circuit (for example, in case ③, the absolute value of the difference between the first accuracy and the second accuracy is 30%, and in case ④, the first accuracy...). The absolute value of the difference between the accuracy and the second accuracy is as high as 50%. Although the neurons that were disabled before this point had a small impact on the stability of the spiking neural network circuit (i.e., neuron 1 had a small impact on the stability of the spiking neural network circuit), the number of neurons to be optimized was 1, which did not exceed the preset minimum number threshold of 2. This indicates that most of the neurons had a significant impact on the stability of the spiking neural network circuit (disabling any neuron may seriously affect the accuracy of the spiking neural network). In order to avoid the failure of a single neuron from having a significant impact on the stability of the spiking neural network circuit, the circuit can be optimized by resetting the connection relationship between neurons to adjust the structure of the spiking neural network circuit.

[0108] It should be noted that in the above embodiments 1-3, the type of spiking neural network deployed in the spiking neural network circuit is one or more. When there are multiple types of spiking neural networks, there are also multiple types of failure indicators. In step 400, "optimizing the spiking neural network circuit according to the failure indicators and the preset optimization strategy" can specifically be as follows: based on the failure indicators of the spiking neural network circuit with different types of neural networks deployed, the neurons to be optimized in the spiking neural network circuit are determined. Then, the overlapping neurons among the neurons to be optimized of various types are taken as the final optimization objects. By adjusting the overlapping neurons, the optimized spiking neural network circuit can cope with various types of spiking neural networks.

[0109] The failure assessment method for the spiking neural network circuit provided in Example 3 involves disabling one or more components (neurons) of the spiking neural network circuit, determining the components (neurons) with a smaller contribution in the spiking neural network circuit based on the accuracy of the spiking neural network deployed in the circuit, and then optimizing these components in a targeted manner, thereby improving the reliability of the spiking neural network circuit itself.

[0110] Embodiment 4 of this application provides a failure assessment system for a spiking neural network circuit. Please refer to [link to documentation]. Figure 4 In Example 4, the system includes:

[0111] The first calculation module 1 is used to calculate the first accuracy of the spiking neural network deployed on the spiking neural network circuit based on a preset sample set; wherein the spiking neural network circuit includes spiking neural network units;

[0112] Fault injection module 2 is used to inject preset faults into the spiking neural network unit to obtain a faulty spiking neural network circuit;

[0113] The second calculation module 3 is used to calculate the second accuracy of the spiking neural network deployed on the faulty spiking neural network circuit based on a preset sample set;

[0114] Evaluation and optimization module 4 is used to evaluate the failure indicators of the spiking neural network circuit based on the first accuracy and the second accuracy, and to optimize the spiking neural network circuit according to the failure indicators and the preset optimization strategy.

[0115] In a preferred embodiment, when the preset fault is preset noise:

[0116] The fault injection module 2 is specifically used to inject preset noise into the neurons of the spiking neural network unit to obtain a faulty spiking neural network circuit; wherein, the neurons are either input layer neuron groups, hidden layer neuron groups, output layer neuron groups, or input layer neurons, hidden layer neurons, or output layer neurons.

[0117] The second calculation module 3 is specifically used to take a preset sample set as the input of the spiking neural network and calculate the second accuracy of the spiking neural network when the neurons are the input layer neuron group, the hidden layer neuron group, or the output layer neuron group, respectively; wherein, the second accuracy of the spiking neural network when the neurons are the input layer neuron group is denoted as the input layer second accuracy, the second accuracy of the spiking neural network when the neurons are the hidden layer neuron group is denoted as the hidden layer second accuracy, and the second accuracy of the spiking neural network when the neurons are the output layer neuron group is denoted as the output layer second accuracy.

[0118] The evaluation and optimization module 4 is specifically used to record the absolute value of the difference between the first accuracy and the second accuracy of the input layer as the input layer failure index; record the absolute value of the difference between the first accuracy and the second accuracy of the hidden layer as the hidden layer failure index; record the absolute value of the difference between the first accuracy and the second accuracy of the output layer as the output layer failure index; record the neuron corresponding to the failure index with the largest value among the input layer failure index, hidden layer failure index, and output layer failure index as the neuron to be optimized, and replace the neuron to be optimized with a preset first neuron; wherein, the preset first neuron is a noise-reducing neuron.

[0119] In a preferred embodiment, when the preset fault is to disable neurons:

[0120] The fault injection module 2 is specifically used to obtain the number of pulses of each neuron in the spiking neural network unit, and to disable the neurons by accumulating the number of pulses from small to large, thereby obtaining several faulty spiking neural network circuits.

[0121] The second calculation module 3 is specifically used to take the preset sample set as the input of the spiking neural network, calculate the second accuracy of the spiking neural network in several faulty spiking neural network circuits, and obtain several second accuracies.

[0122] The evaluation and optimization module 4 is specifically used to calculate the absolute value of the difference between the first accuracy and several second accuracies to obtain several failure indicators; the neurons corresponding to failure indicators that are not greater than the preset failure indicator threshold are recorded as neurons to be optimized, and the neurons to be optimized are replaced with preset second neurons to optimize the spiking neural network circuit; wherein, the number of pulses of the preset second neuron is greater than the number of pulses of any neuron to be optimized.

[0123] Embodiment 5 of this application provides a failure evaluation device for a spiking neural network circuit. In Embodiment 5, the device includes a memory and a processor.

[0124] Memory, used to store computer programs;

[0125] The processor is used to implement the failure assessment method for the spiking neural network circuit as described in Examples 1-3 above when executing the computer program described above.

[0126] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0127] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0128] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0129] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it 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 all or 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 described in 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.

[0130] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A failure assessment method for a spiking neural network circuit, characterized in that, include: Based on a preset sample set, the first accuracy of the spiking neural network deployed in the spiking neural network circuit is calculated; wherein the spiking neural network circuit includes spiking neural network units; A pre-set fault is injected into the spiking neural network unit to obtain a faulty spiking neural network circuit. Based on the preset sample set, the second accuracy of the spiking neural network deployed in the faulty spiking neural network circuit is calculated; The failure index of the spiking neural network circuit is evaluated based on the first accuracy and the second accuracy, and the spiking neural network circuit is optimized according to the failure index and a preset optimization strategy. Specific steps include: recording the absolute value of the difference between the first accuracy and the second accuracy of the input layer as the input layer failure index; recording the absolute value of the difference between the first accuracy and the second accuracy of the hidden layer as the hidden layer failure index; recording the absolute value of the difference between the first accuracy and the second accuracy of the output layer as the output layer failure index; recording the neuron corresponding to the failure index with the largest value among the input layer failure index, the hidden layer failure index, and the output layer failure index as the neuron to be optimized, and replacing the neuron to be optimized with a preset first neuron. Wherein, the second accuracy of the input layer is the second accuracy of the spiking neural network when the neuron is an input layer neuron group; the second accuracy of the hidden layer is the second accuracy of the spiking neural network when the neuron is a hidden layer neuron group; the second accuracy of the output layer is the second accuracy of the spiking neural network when the neuron is an output layer neuron group; the neuron is an input layer neuron group, a hidden layer neuron group, an output layer neuron group, an input layer neuron, a hidden layer neuron, or an output layer neuron; the preset first neuron is a noise-reducing neuron.

2. The failure assessment method for a spiking neural network circuit according to claim 1, characterized in that, When the preset fault is preset noise, the step of injecting the preset fault into the spiking neural network unit to obtain the faulty spiking neural network circuit includes: The preset noise is injected into the neurons of the spiking neural network unit to obtain a faulty spiking neural network circuit.

3. The failure assessment method for a spiking neural network circuit according to claim 2, characterized in that, The calculation of the second accuracy of the spiking neural network deployed in the faulty spiking neural network circuit based on the preset sample set includes: Using the preset sample set as input to the spiking neural network, the second accuracy of the spiking neural network is calculated when the neuron is the input layer neuron group, the hidden layer neuron group, or the output layer neuron group.

4. The failure assessment method for a spiking neural network circuit according to claim 1, characterized in that, When the preset fault is a disabled neuron, the step of injecting the preset fault into the spiking neural network unit to obtain a faulty spiking neural network circuit includes: The number of pulses of each neuron in the spiking neural network unit is obtained, and the neurons are disabled by accumulating the number of pulses from smallest to largest to obtain several faulty spiking neural network circuits.

5. The failure assessment method for a spiking neural network circuit according to claim 4, characterized in that, The calculation of the second accuracy of the spiking neural network deployed in the faulty spiking neural network circuit based on the preset sample set includes: Using the preset sample set as input to the spiking neural network, the second accuracy of the spiking neural network in the several faulty spiking neural network circuits is calculated respectively, and several second accuracies are obtained.

6. The failure assessment method for a spiking neural network circuit according to claim 5, characterized in that, The step of evaluating the failure index of the spiking neural network circuit based on the first accuracy and the second accuracy, and optimizing the spiking neural network circuit based on the failure index and a preset spiking neural network circuit evaluation optimization strategy includes: Calculate the absolute value of the difference between the first accuracy and several second accuracies to obtain several failure indicators; The spiking neural network circuit is optimized based on a preset failure index threshold, several failure indices, and a preset spiking neural network circuit evaluation and optimization strategy.

7. The failure assessment method for a spiking neural network circuit according to claim 6, characterized in that, The optimization of the spiking neural network circuit based on a preset failure index threshold, several failure indices, and a preset spiking neural network circuit evaluation and optimization strategy includes: The neurons corresponding to failure indices that are not greater than a preset failure index threshold are designated as neurons to be optimized. The neurons to be optimized are replaced with a preset second neuron to optimize the spiking neural network circuit. The number of pulses of the preset second neuron is greater than the number of pulses of any of the neurons to be optimized.

8. A failure assessment system for a spiking neural network circuit, characterized in that, include: The first calculation module is used to calculate the first accuracy of the spiking neural network deployed in the spiking neural network circuit based on a preset sample set; wherein the spiking neural network circuit includes spiking neural network units; The fault injection module is used to inject a preset fault into the spiking neural network unit to obtain a faulty spiking neural network circuit. The second calculation module is used to calculate the second accuracy of the spiking neural network deployed in the faulty spiking neural network circuit based on the preset sample set. An evaluation and optimization module is used to evaluate the failure index of the spiking neural network circuit based on the first accuracy and the second accuracy, and to optimize the spiking neural network circuit according to the failure index and a preset optimization strategy. Specific steps include: recording the absolute value of the difference between the first accuracy and the second accuracy of the input layer as the input layer failure index; recording the absolute value of the difference between the first accuracy and the second accuracy of the hidden layer as the hidden layer failure index; recording the absolute value of the difference between the first accuracy and the second accuracy of the output layer as the output layer failure index; recording the neuron corresponding to the failure index with the largest value among the input layer failure index, the hidden layer failure index, and the output layer failure index as the neuron to be optimized, and replacing the neuron to be optimized with a preset first neuron; wherein, the second accuracy of the input layer is the second accuracy of the spiking neural network when the neuron is an input layer neuron group, the second accuracy of the hidden layer is the second accuracy of the spiking neural network when the neuron is a hidden layer neuron group, and the second accuracy of the output layer is the second accuracy of the spiking neural network when the neuron is an output layer neuron group; the neuron is an input layer neuron group, a hidden layer neuron group, an output layer neuron group, an input layer neuron, a hidden layer neuron, or an output layer neuron; and the preset first neuron is a noise-reducing neuron.

9. A failure assessment device for a spiking neural network circuit, characterized in that, include: memory and processor; The memory is used to store computer programs; The processor is configured to implement, when executing the computer program, the failure assessment method for the spiking neural network circuit as described in any one of claims 1 to 7.