Neural network circuit performance evaluation method and device
By injecting noise and synaptic faults, the neural network circuit is evaluated, which solves the problem that the impact of hardware faults is ignored in the existing technology, and improves the reliability of the evaluation results and the utilization efficiency of memory resources.
Patent Information
- Application Number
- CN202411013361.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-09-20
AI Technical Summary
Existing neural network circuit performance evaluation methods ignore the impact of hardware failures on network performance, resulting in poor reliability of evaluation results.
By obtaining the evaluation sample data set, injecting preset noise faults and synaptic faults, the performance of the neural network circuit is evaluated, the number of neurons is compared with the threshold, and the corresponding symbol search or synaptic fault technology is used to generate memory performance evaluation results.
It improves the reliability of neural network circuit performance evaluation, analyzes the impact of hardware failures on circuit performance, optimizes the allocation of memory resources, and improves the robustness and stability of the system.
Smart Images

Figure CN118673979A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of neural network technology, and in particular to a method and device for evaluating the performance of a neural network circuit. Background Art
[0002] The rapid development of artificial intelligence technology has promoted the widespread application of neural networks in various fields. By simulating the structure and mechanism of neurons in the human brain, neural networks have demonstrated powerful processing capabilities in computer vision, natural language processing, speech recognition and other fields; in addition, neural networks have also played an important role in healthcare, national defense security, financial services and robotics.
[0003] As neural networks are continuously applied to solve more complex problems, the depth of the network continues to deepen, and its computing and storage requirements are also increasing significantly. The demand for memory when deployed on hardware platforms is also increasing, and the requirements for the robustness, security and reliability of the hardware circuits of the neural network are also increasing; electromagnetic radiation, circuit aging, temperature and defects can cause failure and damage to circuit memory, thereby affecting the performance of neural networks deployed on hardware platforms.
[0004] Most of the existing neural network circuit performance evaluation methods use software fault injection. By injecting faults into the neural network deployed in the neural network circuit, the stability of the neural network circuit is evaluated and optimized. However, this process ignores the impact of hardware failures in the neural network circuit itself on the neural network performance, resulting in poor reliability of the network performance evaluation results. Summary of the invention
[0005] The present invention provides a neural network circuit performance evaluation method and device, which are used to solve the technical problem that the existing neural network circuit performance evaluation method leads to poor reliability of network performance evaluation results.
[0006] A first aspect of the present invention provides a method for evaluating the performance of a neural network circuit, comprising:
[0007] Acquire an evaluation sample data set, and use the evaluation sample data set as an input of a neural network of a neural network circuit to be evaluated, and output a first accuracy rate;
[0008] Injecting a preset noise fault into a neural network unit in the neural network circuit to be evaluated to determine a noise fault neural network circuit;
[0009] Using the noise fault neural network circuit to generate a hardware circuit performance result of the neural network circuit to be evaluated according to the first accuracy rate and the evaluation sample data set;
[0010] Comparing the number of neurons of the neural network unit in the neural network circuit to be evaluated with a preset neuron number threshold;
[0011] If the number of neurons is greater than the preset neuron number threshold, a preset symbol search technology is used to perform a performance evaluation on the neural network circuit to be evaluated, and a first memory performance evaluation result of the neural network circuit to be evaluated is generated;
[0012] If the number of neurons is less than or equal to the preset neuron number threshold, a preset synaptic fault technology is used to perform performance evaluation on the neural network circuit to be evaluated, and a second memory performance evaluation result of the neural network circuit to be evaluated is generated.
[0013] Optionally, the neural network unit includes an input layer neural network unit, a hidden layer neural network unit and an output layer neural network unit; the step of injecting a preset noise fault into the neural network unit in the neural network circuit to be evaluated and determining the noise fault neural network circuit includes:
[0014] Injecting the preset noise fault into the input layer neural network unit in the neural network circuit to be evaluated to determine the input layer noise fault neural network circuit;
[0015] Injecting the preset noise fault into the hidden layer neural network unit in the neural network circuit to be evaluated to determine the hidden layer noise fault neural network circuit;
[0016] The preset noise fault is injected into the output layer neural network unit in the neural network circuit to be evaluated to determine the output layer noise fault neural network circuit.
[0017] Optionally, the step of using the noise fault neural network circuit to generate a hardware circuit performance result of the neural network circuit to be evaluated according to the first accuracy rate and the evaluation sample data set includes:
[0018] Using the evaluation sample data set as input of the neural network of the input layer noise fault neural network circuit, the neural network of the hidden layer noise fault neural network circuit and the neural network of the output layer noise fault neural network circuit, and outputting the second accuracy rate of the input layer, the second accuracy rate of the hidden layer and the second accuracy rate of the output layer;
[0019] Performing difference operations on the second accuracy of the input layer, the second accuracy of the hidden layer, the second accuracy of the output layer and the first accuracy respectively to determine the input layer difference, the hidden layer difference and the output layer difference;
[0020] The hardware circuit performance result of the neural network circuit to be evaluated is generated according to the comparison result of the absolute value of the input layer difference, the absolute value of the hidden layer difference and the absolute value of the output layer difference.
[0021] Optionally, if the number of neurons is greater than the preset neuron number threshold, a preset symbol search technology is used to perform performance evaluation on the neural network circuit to be evaluated, and the step of generating a first memory performance evaluation result of the neural network circuit to be evaluated includes:
[0022] Injecting a preset weight fault data set into the synapses in the neural network circuit to be evaluated to determine the weight fault neural network circuit;
[0023] Using the evaluation sample data set as an input of the neural network of the weight fault neural network circuit, and outputting a third accuracy rate;
[0024] Performing a difference operation on the third accuracy rate and the first accuracy rate, outputting the first accuracy rate change difference as a label value;
[0025] Constructing a weighted fault label data set using the label value and the preset weighted fault data set;
[0026] Based on a preset Adam optimization algorithm, the weighted fault label data set is used to perform model training on a preset initial weighted fault detection network to determine a trained target weighted fault detection network;
[0027] The target weight fault detection network is used to evaluate the neural network circuit to be evaluated according to the weight fault data to be evaluated, and a first memory performance evaluation result of the neural network circuit to be evaluated is generated.
[0028] Optionally, the step of using the target weight fault detection network to evaluate the neural network circuit to be evaluated according to the weight fault data to be evaluated to generate a first memory performance evaluation result of the neural network circuit to be evaluated includes:
[0029] Using the weighted fault data to be evaluated as input of the target weighted fault detection network, and outputting a plurality of initial state vectors;
[0030] Screening each of the initial state vectors to determine a target state vector;
[0031] According to the comparison result between the target state vector and the preset comparison constant, a first memory performance evaluation result of the neural network circuit to be evaluated is generated.
[0032] Optionally, if the number of neurons is less than or equal to the preset neuron number threshold, the step of using a preset synaptic fault technology to perform performance evaluation on the neural network circuit to be evaluated, and generating a second memory performance evaluation result of the neural network circuit to be evaluated includes:
[0033] Performing data format conversion on the sign bit and value bit of the synapse of the neural network circuit to be evaluated according to the preset fault conversion condition, and determining the synapse fault neural network circuit;
[0034] Using the evaluation sample data set as an input of the neural network of the synaptic failure neural network circuit, and outputting a fourth accuracy rate;
[0035] Performing a difference operation on the fourth accuracy rate and the first accuracy rate, and outputting a second accuracy rate change difference;
[0036] According to the comparison result of the second accuracy change difference and the preset difference range, a second memory performance evaluation result of the neural network circuit to be evaluated is generated.
[0037] A second aspect of the present invention provides a neural network circuit performance evaluation device, comprising:
[0038] An acquisition module, used for acquiring an evaluation sample data set, and using the evaluation sample data set as an input of a neural network of a neural network circuit to be evaluated, and outputting a first accuracy rate;
[0039] A first fault module is used to inject a preset noise fault into a neural network unit in the neural network circuit to be evaluated to determine a noise fault neural network circuit;
[0040] A hardware circuit result module, used to generate a hardware circuit performance result of the neural network circuit to be evaluated based on the first accuracy rate and the evaluation sample data set using the noise fault neural network circuit;
[0041] A comparison module, used for comparing the number of neurons of the neural network unit in the neural network circuit to be evaluated with a preset neuron number threshold;
[0042] A second fault module is used for, if the number of neurons is greater than the preset neuron number threshold, using a preset symbol search technology to perform performance evaluation on the neural network circuit to be evaluated, and generating a first memory performance evaluation result of the neural network circuit to be evaluated;
[0043] The third fault module is used to perform performance evaluation on the neural network circuit to be evaluated by using a preset synaptic fault technology if the number of neurons is less than or equal to the preset neuron number threshold, and generate a second memory performance evaluation result of the neural network circuit to be evaluated.
[0044] A third aspect of the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the neural network circuit performance evaluation method as described in any one of the above items.
[0045] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed, implements a neural network circuit performance evaluation method as described in any one of the above items.
[0046] A fifth aspect of the present invention provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions, wherein when the program instructions are executed by a computer, the computer executes a neural network circuit performance evaluation method as described in any one of the above items.
[0047] It can be seen from the above technical solutions that the present invention has the following advantages:
[0048] The above technical scheme of the present invention provides a method for evaluating the performance of a neural network circuit. First, an evaluation sample data set is obtained, and the evaluation sample data set is used as the input of the neural network of the neural network circuit to be evaluated, and a first accuracy rate is output; then, a preset noise fault is injected into the neural network unit in the neural network circuit to be evaluated, and the noise fault neural network circuit is determined; the noise fault neural network circuit is used to generate a hardware circuit performance result of the neural network circuit to be evaluated according to the first accuracy rate and the evaluation sample data set; finally, the number of neurons of the neural network unit in the neural network circuit to be evaluated is compared with a preset neuron number threshold; if the number of neurons is greater than the preset neuron number threshold, a preset symbol search technology is used to perform performance evaluation on the neural network circuit to be evaluated, and a first memory performance evaluation result of the neural network circuit to be evaluated is generated; if the number of neurons is less than or equal to .... If the number of neurons in the neural network unit in the neural network circuit to be evaluated is compared with the preset neuron number threshold, and according to the size of the neural network circuit to be evaluated, the corresponding preset symbol search technology or preset synaptic fault technology is used to evaluate the neural network circuit to generate the memory performance evaluation result, which can explore the impact of memory damage on circuit performance and further improve the reliability of network performance evaluation results. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0050] Figure 1 A flowchart of a method for evaluating performance of a neural network circuit provided by an embodiment of the present invention;
[0051] Figure 2 A flowchart of another neural network circuit performance evaluation method provided by an embodiment of the present invention;
[0052] Figure 3 A schematic diagram of a framework for evaluating a neural network circuit to be evaluated based on a preset noise fault provided by an embodiment of the present invention;
[0053] Figure 4 A schematic diagram of a framework for evaluating a neural network circuit to be evaluated based on a preset symbol search technology provided by an embodiment of the present invention;
[0054] Figure 5 A schematic diagram of the structure of a target weight fault detection network provided by an embodiment of the present invention;
[0055] Figure 6 A schematic diagram of a framework for evaluating a neural network circuit to be evaluated based on a preset synaptic fault technology provided by an embodiment of the present invention;
[0056] Figure 7 A schematic diagram of a framework for evaluating the integrity of a neural network circuit to be evaluated provided by an embodiment of the present invention;
[0057] Figure 8 A schematic diagram of the structure of a neural network circuit performance evaluation device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The embodiment of the present invention provides a neural network circuit performance evaluation method and device, which are used to solve the technical problem that the existing neural network circuit performance evaluation method leads to poor reliability of network performance evaluation results.
[0059] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0060] See also Figure 1 , Figure 1 A flowchart of the steps of a neural network circuit performance evaluation method provided by an embodiment of the present invention.
[0061] The present invention provides a neural network circuit performance evaluation method, comprising:
[0062] Step 101: Obtain an evaluation sample data set, and use the evaluation sample data set as an input of a neural network of a neural network circuit to be evaluated, and output a first accuracy rate.
[0063] The evaluation sample dataset is a sample dataset consisting of multiple images, which may be the MNIST dataset, that is, a collection of handwritten digit images.
[0064] It should be noted that the neural network circuit to be evaluated is deployed in a neural network unit, and the evaluation sample data set is used as the input of the neural network of the neural network circuit to be evaluated to obtain the output of the neural network. The output is compared with the preset theoretical output to determine the accuracy of the neural network in the neural network circuit to be evaluated at the moment (before fault injection), that is, the first accuracy rate.
[0065] In this embodiment, an evaluation sample data set is obtained, and the evaluation sample data set is used as an input of a neural network of a neural network circuit to be evaluated, and a first accuracy rate is output.
[0066] Step 102: Inject a preset noise fault into the neural network unit in the neural network circuit to be evaluated to determine the noise fault neural network circuit.
[0067] Preset noise faults include Gaussian noise, salt and pepper noise, and adaptive noise.
[0068] The neural network unit includes an input layer neural network unit, a hidden layer neural network unit and an output layer neural network unit; wherein the input layer neural network unit includes multiple input layer neuron groups, and the input layer neuron group includes multiple input layer neurons; the hidden layer neural network unit includes multiple hidden layer neuron groups, and the hidden layer neuron group includes multiple hidden layer neurons; the output layer neural network unit includes multiple output layer neuron groups, and the output layer neuron group includes multiple output layer neurons.
[0069] The noise fault neural network circuit comprises an input layer noise fault neural network circuit, a hidden layer noise fault neural network circuit and an output layer noise fault neural network circuit.
[0070] Specifically, a preset noise fault is injected into the input layer neural network unit in the neural network circuit to be evaluated to determine the input layer noise fault neural network circuit; a preset noise fault is injected into the hidden layer neural network unit in the neural network circuit to be evaluated to determine the hidden layer noise fault neural network circuit; a preset noise fault is injected into the output layer neural network unit in the neural network circuit to be evaluated to determine the output layer noise fault neural network circuit; wherein the preset noise fault can be injected into one neuron or multiple neurons.
[0071] In this embodiment, a preset noise fault is injected into a neural network unit in the neural network circuit to be evaluated to determine a noise fault neural network circuit.
[0072] Step 103: Use the noise fault neural network circuit to generate a hardware circuit performance result of the neural network circuit to be evaluated according to the first accuracy rate and the evaluation sample data set.
[0073] It should be noted that the stability of the neural network circuit to be evaluated decreases after the noise fault is injected, and the accuracy of the neural network deployed on the noise fault neural network circuit will also be affected. The evaluation sample data set is used as the input of the neural network deployed on the noise fault neural network circuit to obtain the output of the neural network. The output is compared with the preset theoretical output to determine the accuracy of the neural network in the current (after the noise fault is injected) noise fault neural network circuit, that is, the second accuracy rate.
[0074] Specifically, the evaluation sample data sets are used as inputs to the neural networks of the input layer noise fault neural network circuit, the hidden layer noise fault neural network circuit and the output layer noise fault neural network circuit, and the input layer second accuracy rate, the hidden layer second accuracy rate and the output layer second accuracy rate are output; the difference operation is performed on the input layer second accuracy rate, the hidden layer second accuracy rate, the output layer second accuracy rate and the first accuracy rate, respectively, to determine the input layer difference, the hidden layer difference and the output layer difference.
[0075] Further, according to the comparison result of the absolute value of the input layer difference, the absolute value of the hidden layer difference and the absolute value of the output layer difference, the hardware circuit performance result of the neural network circuit to be evaluated is generated, wherein the comparison result is to compare the absolute value of the input layer difference, the absolute value of the hidden layer difference and the absolute value of the output layer difference, and obtain the absolute value with the largest value among the absolute value of the input layer difference, the absolute value of the hidden layer difference and the absolute value of the output layer difference, and then according to the comparison result, the hardware circuit performance result of the neural network circuit to be evaluated is obtained, that is, the neuron corresponding to the absolute value is recorded as the neuron to be optimized, and then the neuron to be optimized is optimized to achieve the effect of optimizing the neural network circuit to be evaluated itself; after the above steps are proposed by the present invention, the random failure and decay problems of the hardware circuit of the neural network circuit to be evaluated can be studied, and preset noise faults (Gaussian noise, salt and pepper noise and adaptive noise) are used for analysis, and injected into the neurons of each layer of the neural network circuit to be evaluated to simulate the fault conditions of the hardware circuit, so that the failure analysis is closer to the actual situation, and the accurate evaluation of the impact on the performance of the neural network is improved, thereby optimizing the design scheme and improving the performance and robustness of the system.
[0076] In this embodiment, a noise fault neural network circuit is used to generate a hardware circuit performance result of the neural network circuit to be evaluated according to the first accuracy rate and the evaluation sample data set.
[0077] Step 104: compare the number of neurons in the neural network unit in the neural network circuit to be evaluated with a preset neuron number threshold.
[0078] It should be noted that the scale of the neural network circuit to be evaluated can be determined based on the number of neurons. The number of neurons in the neural network units in the neural network circuit to be evaluated can be compared with a preset neuron number threshold. The corresponding fault technology is used to evaluate the neural network circuit to be evaluated according to the scale of the neural network circuit to be evaluated. This can more accurately evaluate the performance of the neural network circuit to be evaluated, perform reliability analysis on the neural network circuit to be evaluated, and then optimize the neural network circuit to be evaluated based on the corresponding performance evaluation results, thereby improving the reliability of the neural network circuit to be evaluated.
[0079] In this embodiment, the number of neurons in the neural network unit in the neural network circuit to be evaluated is compared with a preset neuron number threshold.
[0080] Step 105: If the number of neurons is greater than a preset neuron number threshold, a preset symbol search technology is used to perform performance evaluation on the neural network circuit to be evaluated, and a first memory performance evaluation result of the neural network circuit to be evaluated is generated.
[0081] It should be noted that if the number of neurons is greater than the preset neuron number threshold, it indicates that the scale of the neural network circuit to be evaluated is large, and the preset symbol search technology is used to perform performance evaluation on the neural network circuit to be evaluated to generate the first memory performance evaluation result of the neural network circuit to be evaluated.
[0082] Specifically, a preset weight fault data set is injected into the synapses in the neural network circuit to be evaluated, and the weight fault neural network circuit is determined; the evaluation sample data set is used as the input of the neural network of the weight fault neural network circuit, and a third accuracy rate is output; a difference operation is performed on the third accuracy rate and the first accuracy rate, and the difference in the first accuracy rate change is output as a label value; a weight fault label data set is constructed using the label value and the preset weight fault data set; wherein the preset weight fault data set includes multiple weight indexes and the weight fault position coordinates and weight fault sizes corresponding to each weight index.
[0083] Furthermore, based on the preset Adam (Adaptive Moment Estimation) optimization algorithm, the weight fault label data set is used to perform model training on the preset initial weight fault detection network to determine the trained target weight fault detection network; the target weight fault detection network is used to evaluate the neural network circuit to be evaluated according to the weight fault data to be evaluated, and the first memory performance evaluation result of the neural network circuit to be evaluated is generated; wherein the preset initial weight fault detection network is an RNN network (Recurrent Neural Network Network), adopts a many-to-one structure; the weight fault data to be evaluated is the position coordinates, strength, and size of the weights in the neural network circuit to be evaluated, which can be a combination of the position coordinates, strengths, and sizes of each weight in the neural network circuit to be evaluated, or the position coordinates, strength, and size of a weight in the neural network circuit to be evaluated; the trained target weight fault detection network can analyze the sensitivity of the neural network circuit to be evaluated to changes in different weight positions / different weight combinations / different weight fault sizes, so as to analyze the weight sensitivity of the neural network circuit to be evaluated, provide a theoretical basis for the memory selection of the neural network circuit to be evaluated, put the weights with high sensitivity in the memory with better reliability, and further optimize the performance of the neural network circuit to be evaluated; the preset symbol search technology adopted by the present invention can perform sensitivity analysis on the neural network weights of the neural network circuit to be evaluated, so as to find the key weights and sensitive synapses in the neural network circuit to be evaluated, reasonably use memory resources, save costs, and improve the reliability of hardware circuits.
[0084] In this embodiment, if the number of neurons is greater than a preset neuron number threshold, a preset symbol search technology is used to perform performance evaluation on the neural network circuit to be evaluated, and a first memory performance evaluation result of the neural network circuit to be evaluated is generated.
[0085] Step 106: If the number of neurons is less than or equal to the preset neuron number threshold, a preset synaptic fault technology is used to perform performance evaluation on the neural network circuit to be evaluated, and a second memory performance evaluation result of the neural network circuit to be evaluated is generated.
[0086] It should be noted that if the number of neurons is less than or equal to the preset neuron number threshold, it indicates that the scale of the neural network circuit to be evaluated is small, and the preset synaptic fault technology is used to perform performance evaluation on the neural network circuit to be evaluated to generate the first memory performance evaluation result of the neural network circuit to be evaluated.
[0087] Specifically, the sign bit and the value bit of the synapse of the neural network circuit to be evaluated are transformed into data formats according to the preset fault transformation conditions to determine the synaptic fault neural network circuit; wherein the preset fault transformation conditions are to change the sign bit and the value bit in each layer of the synaptic connection of the neural network circuit to be evaluated, that is, if the sign bit (highest bit) is a positive number, it is modified to a negative number, and if the sign bit is a negative number, it is modified to a positive number; then, the highest value bit is added to a constant, for example, the constant can be 0.5, which can be set as needed, and then the remaining adjacent value bits are added to half of the previous value bit respectively, for example, the number of the remaining value bits is 2, then the first value bit is added to half of the highest value bit, and the second value bit is added to half of the first value bit.
[0088] Furthermore, the evaluation sample data set is used as the input of the neural network of the synaptic fault neural network circuit, and a fourth accuracy rate is output; a difference operation is performed on the fourth accuracy rate and the first accuracy rate, and a second accuracy rate change difference is output; based on the comparison result of the second accuracy rate change difference and the preset difference range, a second memory performance evaluation result of the neural network circuit to be evaluated is generated; wherein, if the comparison result is that the second accuracy rate change difference is within the preset difference range, it indicates that the second memory performance evaluation result of the neural network circuit to be evaluated is that the performance of the neural network circuit to be evaluated is good; if the comparison result is that the second accuracy rate change difference is not within the preset difference range, it indicates that the second memory performance evaluation result of the neural network circuit to be evaluated is that the performance of the neural network circuit to be evaluated is poor, and it is necessary to further optimize the neural network circuit to be evaluated, adjust the circuit design, and improve the stability and reliability of the system; the preset synaptic fault technology adopted in the present invention can simulate the instantaneous fault process of the memory, explore the impact of memory damage on circuit performance, and provide a theoretical basis for the allocation of storage resources of the neural network circuit to be evaluated according to the generated second memory performance evaluation result, thereby improving the reliability and stability of the neural network circuit during long-term operation.
[0089] In this embodiment, if the number of neurons is less than or equal to the preset neuron number threshold, the preset synaptic fault technology is used to perform performance evaluation on the neural network circuit to be evaluated, and a second memory performance evaluation result of the neural network circuit to be evaluated is generated.
[0090] In an embodiment of the present invention, the present invention provides a method for evaluating the performance of a neural network circuit. First, an evaluation sample data set is obtained, and the evaluation sample data set is used as the input of the neural network of the neural network circuit to be evaluated, and a first accuracy rate is output; then, a preset noise fault is injected into the neural network unit in the neural network circuit to be evaluated, and the noise fault neural network circuit is determined; the noise fault neural network circuit is used to generate a hardware circuit performance result of the neural network circuit to be evaluated based on the first accuracy rate and the evaluation sample data set; finally, the number of neurons of the neural network unit in the neural network circuit to be evaluated is compared with a preset neuron number threshold; if the number of neurons is greater than the preset neuron number threshold, a preset symbol search technology is used to perform performance evaluation on the neural network circuit to be evaluated, and a first memory performance evaluation result of the neural network circuit to be evaluated is generated; if the number of neurons is less than or equal to the preset neuron number threshold, the preset symbol search technology is used to perform performance evaluation on the neural network circuit to be evaluated, and a first memory performance evaluation result of the neural network circuit to be evaluated is generated; According to the neuron number threshold, the preset synaptic fault technology is used to evaluate the performance of the neural network circuit to be evaluated, and a second memory performance evaluation result of the neural network circuit to be evaluated is generated; based on the above scheme, the noise fault neural network circuit is used to generate the hardware circuit performance result of the neural network circuit to be evaluated according to the first accuracy and the evaluation sample data set, which can analyze the impact of the injected noise fault on the hardware circuit performance of the neural network circuit to be evaluated, and then compare the number of neurons of the neural network unit in the neural network circuit to be evaluated with the preset neuron number threshold, according to the size of the neural network circuit to be evaluated, the corresponding preset symbol search technology or preset synaptic fault technology is used to evaluate the neural network circuit to be evaluated, and the process of generating the memory performance evaluation result can explore the impact of memory damage on circuit performance, and further improve the reliability of the network performance evaluation results.
[0091] See also Figure 2 , Figure 2 A flowchart of the steps of a neural network circuit performance evaluation method provided in Embodiment 2 of the present invention.
[0092] The present invention provides a neural network circuit performance evaluation method, comprising:
[0093] Step 201: Obtain an evaluation sample data set, and use the evaluation sample data set as an input of a neural network of a neural network circuit to be evaluated, and output a first accuracy rate.
[0094] In this embodiment, the specific implementation process of step 201 is similar to step 101 and will not be repeated here.
[0095] Step 202: Inject a preset noise fault into the input layer neural network unit in the neural network circuit to be evaluated, and determine the input layer noise fault neural network circuit.
[0096] In this embodiment, a preset noise fault is injected into the input layer neural network unit in the neural network circuit to be evaluated to determine the input layer noise fault neural network circuit.
[0097] Step 203: inject a preset noise fault into the hidden layer neural network unit in the neural network circuit to be evaluated, and determine the hidden layer noise fault neural network circuit.
[0098] In this embodiment, a preset noise fault is injected into a hidden layer neural network unit in the neural network circuit to be evaluated to determine a hidden layer noise fault neural network circuit.
[0099] Step 204: inject a preset noise fault into the output layer neural network unit in the neural network circuit to be evaluated, and determine the output layer noise fault neural network circuit.
[0100] In this embodiment, a preset noise fault is injected into the output layer neural network unit in the neural network circuit to be evaluated to determine the output layer noise fault neural network circuit.
[0101] Step 205: Use the noise fault neural network circuit to generate a hardware circuit performance result of the neural network circuit to be evaluated based on the first accuracy rate and the evaluation sample data set.
[0102] Further, step 205 may include the following sub-steps:
[0103] S51, using the evaluation sample data set as the input of the neural network of the input layer noise fault neural network circuit, the neural network of the hidden layer noise fault neural network circuit and the neural network of the output layer noise fault neural network circuit, and outputting the second accuracy rate of the input layer, the second accuracy rate of the hidden layer and the second accuracy rate of the output layer;
[0104] S52, respectively performing difference operations on the second accuracy of the input layer, the second accuracy of the hidden layer, the second accuracy of the output layer and the first accuracy to determine the input layer difference, the hidden layer difference and the output layer difference;
[0105] S53. Generate a hardware circuit performance result of the neural network circuit to be evaluated based on the comparison result of the absolute value of the input layer difference, the absolute value of the hidden layer difference and the absolute value of the output layer difference.
[0106] Please note that Figure 3, add preset noise faults (Gaussian noise, salt and pepper noise and adaptive noise) to each layer of neurons of the neural network circuit to be evaluated, and then generate the hardware circuit performance results of the neural network circuit to be evaluated by comparing the difference between the recognition accuracy after the introduction of noise and the original accuracy, that is, the input layer difference, hidden layer difference and output layer difference, and then further optimize the hardware circuit of the neural network circuit to be evaluated based on the hardware circuit performance results.
[0107] Furthermore, the present invention introduces preset noise faults, which can simulate various random problems encountered by hardware circuits in real application scenarios. In particular, the adaptive noise model dynamically adjusts the intensity and mode of noise injection according to the current operating state of the neural network, making the failure analysis closer to the actual situation and improving the accurate assessment of the impact on the performance of the neural network, thereby optimizing the design scheme and improving the performance and robustness of the system.
[0108] In this embodiment, a noise fault neural network circuit is used to generate a hardware circuit performance result of the neural network circuit to be evaluated based on the first accuracy rate and the evaluation sample data set.
[0109] Step 206: Compare the number of neurons in the neural network unit in the neural network circuit to be evaluated with a preset neuron number threshold.
[0110] In this embodiment, the number of neurons in the neural network unit in the neural network circuit to be evaluated is compared with a preset neuron number threshold.
[0111] Step 207: If the number of neurons is greater than a preset neuron number threshold, a preset symbol search technique is used to perform performance evaluation on the neural network circuit to be evaluated, and a first memory performance evaluation result of the neural network circuit to be evaluated is generated.
[0112] Further, step 207 may include the following sub-steps:
[0113] S71, injecting a preset weight fault data set into the synapse in the neural network circuit to be evaluated, and determining the weight fault neural network circuit;
[0114] S72, using the evaluation sample data set as an input of a neural network of a weighted fault neural network circuit, and outputting a third accuracy rate;
[0115] S73, performing a difference operation on the third accuracy and the first accuracy, outputting the first accuracy change difference as a label value;
[0116] S74, constructing a weighted fault label data set using the label value and the preset weighted fault data set;
[0117] S75. Based on a preset Adam optimization algorithm, a weighted fault label data set is used to perform model training on a preset initial weighted fault detection network, and a trained target weighted fault detection network is determined;
[0118] S76. Use the target weight fault detection network to evaluate the neural network circuit to be evaluated according to the weight fault data to be evaluated, and generate a first memory performance evaluation result of the neural network circuit to be evaluated.
[0119] Please note that Figure 4 The present invention constructs a data set by injecting faults into the synapses of the neural network circuit to be evaluated. Specifically, the injected weight index, fault location coordinates and size are recorded to obtain a preset weight fault data set, and the accuracy of the neural network after fault injection is tested and recorded. The difference in accuracy before and after fault injection is used as a label value, and a weight fault label data set is constructed using the label value and the preset weight fault data set. This weight fault label data set is used to train the preset initial weight fault detection network to analyze the sensitivity of the network to be tested to weight changes. Such analysis helps to theoretically support the selection of neural network memory and further optimize network performance.
[0120] Exemplarily, an evaluation data set is input into the neural network of the neural network circuit to be evaluated to obtain a normal prediction result (first accuracy) in a fault-free situation; then a data set (weight fault label data set) is constructed by artificially injecting faults into the synapses of the neural network circuit to be evaluated, and a preset initial weight fault detection network is trained. The trained fault detection network can analyze the sensitivity of the network to be tested to changes in different weight positions / different weight combinations / different weight fault sizes, thereby analyzing the weight sensitivity of the network to be tested. There is a certain theoretical basis for the memory selection of the neural network circuit, and weights with high sensitivity are placed in memories with better reliability, thereby further optimizing the performance of the network.
[0121] Further, S76 may include the following sub-steps:
[0122] S761, using the weighted fault data to be evaluated as the input of the target weighted fault detection network, and outputting a plurality of initial state vectors;
[0123] S762, screening each initial state vector to determine the target state vector;
[0124] S763. Generate a first memory performance evaluation result of the neural network circuit to be evaluated based on the comparison result between the target state vector and the preset comparison constant.
[0125] Please note that Figure 5The target weight fault detection network proposed in the present invention is an RNN network (Recurrent Neural Network) with a many-to-one structure; the weight fault data to be evaluated is used as the input of the target weight fault detection network, and multiple initial state vectors are output; for example, if the weight fault data to be evaluated is a combination of the position coordinates, strength, and size of each weight in the neural network circuit to be evaluated, that is, the position coordinates, strength, and size of multiple weights, it is assumed that the number of the position coordinates, strength, and size of the input weights is 2, that is, the position coordinates of two weights and the strength and size corresponding to the position coordinates, after the position size, strength, and direction of the two weights are formed into sequence data, the position coordinates of the first weight in the sequence data and the strength and size corresponding to the position coordinates are input to the target weight fault detection network, and the corresponding initial state vector is output, and the initial state vector corresponding to the position coordinate of the first weight is used as the initial state vector of the previous moment, and the position coordinates of the second weight and the strength and size corresponding to the position coordinates are input into the target weight fault detection network together, and the initial state vector corresponding to the position coordinate of the second weight is output, and the last element in the initial state vector corresponding to the position coordinate of the second weight is used as the final output; wherein the processing process of the initial state vector can be expressed as:
[0126] ;
[0127] in, is the initial state vector at time t; is the tanh activation function; is the weight matrix of the target weight fault detection network; is the initial state vector at time t-1. When t=0, The value is 0, which means the initial state vector at the previous moment; is the weighted fault data to be evaluated at time t.
[0128] Further, each initial state vector is screened to determine the target state vector. Specifically, the last output initial state vector is selected as the target state vector; the last element in the target state vector is selected for comparison with a preset comparison constant. If the element is greater than the preset comparison constant, it indicates that the performance evaluation result of the first memory of the neural network circuit to be evaluated is that the input weight fault data to be evaluated has a greater impact on the performance of the neural network circuit to be evaluated, that is, the sensitivity of the weights at each location is greater, providing theoretical support for the selection of memory. It helps to reduce the cost of deploying neural networks and improve the reliability of neural networks by storing key weights in more reliable memories; if the element is less than or equal to the preset comparison constant, it indicates that the performance evaluation result of the first memory of the neural network circuit to be evaluated is that the input weight fault data to be evaluated has a smaller impact on the performance of the neural network circuit to be evaluated; wherein the preset comparison constant is zero.
[0129] Furthermore, the introduction of the preset symbol search technology proposed in the present invention can realize the sensitivity analysis of the weights at various locations in the neural network, providing theoretical support for the selection of memory. This helps to reduce the cost of deploying neural networks. By storing key weights in a memory with higher reliability, the reliability of the neural network is improved.
[0130] In this embodiment, if the number of neurons is greater than a preset neuron number threshold, a preset symbol search technology is used to perform performance evaluation on the neural network circuit to be evaluated, and a first memory performance evaluation result of the neural network circuit to be evaluated is generated.
[0131] Step 208: If the number of neurons is less than or equal to the preset neuron number threshold, a preset synaptic fault technology is used to perform performance evaluation on the neural network circuit to be evaluated, and a second memory performance evaluation result of the neural network circuit to be evaluated is generated.
[0132] Further, step 208 may include the following sub-steps:
[0133] S81, performing data format conversion on the sign bit and value bit of the synapse of the neural network circuit to be evaluated according to the preset fault conversion condition, and determining the synaptic fault neural network circuit;
[0134] S82, using the evaluation sample data set as an input of the neural network of the synaptic failure neural network circuit, and outputting a fourth accuracy rate;
[0135] S83, performing a difference operation on the fourth accuracy and the first accuracy, and outputting a second accuracy change difference;
[0136] S84. Generate a second memory performance evaluation result of the neural network circuit to be evaluated based on a comparison result between the second accuracy change difference and a preset difference range.
[0137] Please note that Figure 6 , the sign bit and the value bit in each layer of synaptic connection of the neural network circuit to be evaluated are changed respectively, and then the second memory performance evaluation result of the neural network circuit to be evaluated is generated by comparing the change of recognition accuracy before and after the fault.
[0138] Furthermore, the introduction of the preset synaptic fault technology proposed in the present invention can simulate problems that may occur in the actual operation of the neural network, such as connection interruption or transmission error, so that the circuit design can be adjusted to improve the stability and reliability of the system.
[0139] In this embodiment, if the number of neurons is less than or equal to the preset neuron number threshold, the preset synaptic fault technology is used to perform performance evaluation on the neural network circuit to be evaluated, and a second memory performance evaluation result of the neural network circuit to be evaluated is generated.
[0140] For example, see Figure 7 By applying preset noise faults and synaptic connection faults (preset synaptic fault technology), we intentionally intervene in the neural network hardware circuit structure and observe the changes in its accuracy for different data sets. By analyzing these changes, we can understand the impact of these external factors on the performance of the neural network. Furthermore, using the preset symbol search technology to conduct a theoretical analysis of the weight sensitivity of the neural network can provide theoretical support and guide the selection of neural network memory, thereby optimizing the performance of the network.
[0141] As a comparison of technical effects, it can be combined with existing technologies for reference. With the continuous expansion of the scale of neural networks and the increase in application scenarios, the development of efficient neural network hardware acceleration platforms has become a hot topic of research. At present, the mainstream neural network hardware platforms mainly include graphics processing units (GPUs), application-specific integrated circuits (ASICs), and field-programmable gate arrays (FPGAs). The GPU platform performs well in algorithm training, and its powerful parallel computing capabilities make it the first choice for large-scale training tasks. However, in the inference stage, the processing power for a single input is insufficient, resulting in the inability to fully utilize the advantages of parallel computing. ASICs are designed for specific purposes and have the advantages of small size, low power consumption, and strong confidentiality. However, their long design cycle, high initial investment, and lack of reconfigurability limit their application in rapidly iterative neural network architectures. FPGA chips can flexibly configure data bit widths according to application requirements, and have the advantages of low power consumption, a large amount of on-chip storage resources, strong bandwidth, and parallel memory access capabilities. However, due to the limited computing power of the basic computing unit, as well as factors such as high development difficulty and high price, there are still certain challenges in its practical application.
[0142] Deep neural networks (DNNs) show strong adaptability in the face of hardware failures, and have a certain degree of reliability against permanent failures such as manufacturing defects and circuit aging, and transient failures such as soft errors and dynamic changes. However, recent fault injection studies have shown that the reliability of NN hardware circuits is still far from the level estimated by theory. For example, it is generally believed that hardware failures (especially those that show transient effects) can be tolerated by training algorithms to a large extent, but researchers have shown from current evidence that this is not the case. Some researchers have pointed out that DNN hardware circuits may have hardware failures due to the following reasons: changes in manufacturing process parameters, manufacturing process defects, latent defects (i.e., defects that cannot be detected in post-manufacturing testing, but will be manifested in the application field), silicon aging (such as dielectric breakdown that varies over time), and even environmental stress (such as single event bursts (SEUs) generated by heat, humidity, vibration, and ionization), but it is not easy to evaluate the reliability of DNNs deployed on hardware accelerators. And as neural networks are continuously applied to solve more complex problems, their computing and storage requirements are also increasing significantly. Existing FPGAs do not support such a large storage capacity, so the weights must be stored in external memory and transferred to the FPGA during the calculation process. This increases overhead and risk. Currently, most research on neural networks is focused on improving performance, accelerating training speculation, scalability, and interpretability, while less research is done on the robustness, security, and reliability of neural network hardware circuits. Therefore, it is necessary to conduct in-depth research on the failure and reliability issues of NN hardware circuits.
[0143] Furthermore, as neural networks are continuously applied to solve more complex problems, the depth of the network continues to increase, and its computing and storage requirements are also increasing significantly, and the demand for memory when deployed on hardware platforms is also increasing. Electromagnetic radiation, circuit aging, temperature, and defects can cause failure and damage to circuit memory, thereby affecting the performance of neural networks deployed on hardware platforms. Therefore, it is necessary to perform sensitivity analysis on the weights of neural networks and reliability analysis on neural network hardware acceleration platforms to evaluate their reliability during long-term operation.
[0144] In view of the above problems, the present invention proposes a neural network circuit performance evaluation method, uses Pycharm software and Xilinx FPGA hardware platform to study the neural network circuit failure analysis method, and adopts a variety of different fault simulation methods, such as random injection of preset noise faults (Gaussian noise, salt and pepper noise and adaptive noise), random bit flipping in weight memory, etc., to evaluate the impact of hardware failure on neural network performance by changing the accuracy of the data set. At the same time, a preset symbol search technology and a preset synaptic fault technology are proposed, which can analyze the synaptic sensitivity of the neural network, provide a theoretical basis for the large-scale network deployment cost, and improve the reliability of the network; perform fault injection and sensitivity analysis on the neural network circuit to enhance the reliability and stability of the network.
[0145] In an embodiment of the present invention, the present invention provides a method for evaluating the performance of a neural network circuit. First, an evaluation sample data set is obtained, and the evaluation sample data set is used as the input of the neural network of the neural network circuit to be evaluated, and a first accuracy rate is output; then, a preset noise fault is injected into the neural network unit in the neural network circuit to be evaluated, and the noise fault neural network circuit is determined; the noise fault neural network circuit is used to generate a hardware circuit performance result of the neural network circuit to be evaluated based on the first accuracy rate and the evaluation sample data set; finally, the number of neurons of the neural network unit in the neural network circuit to be evaluated is compared with a preset neuron number threshold; if the number of neurons is greater than the preset neuron number threshold, a preset symbol search technology is used to perform performance evaluation on the neural network circuit to be evaluated, and a first memory performance evaluation result of the neural network circuit to be evaluated is generated; if the number of neurons is less than or equal to the preset neuron number threshold, the preset symbol search technology is used to perform performance evaluation on the neural network circuit to be evaluated, and a first memory performance evaluation result of the neural network circuit to be evaluated is generated; According to the neuron number threshold, the preset synaptic fault technology is used to evaluate the performance of the neural network circuit to be evaluated, and a second memory performance evaluation result of the neural network circuit to be evaluated is generated; based on the above scheme, the noise fault neural network circuit is used to generate the hardware circuit performance result of the neural network circuit to be evaluated according to the first accuracy and the evaluation sample data set, which can analyze the impact of the injected noise fault on the hardware circuit performance of the neural network circuit to be evaluated, and then compare the number of neurons of the neural network unit in the neural network circuit to be evaluated with the preset neuron number threshold, according to the size of the neural network circuit to be evaluated, the corresponding preset symbol search technology or preset synaptic fault technology is used to evaluate the neural network circuit to be evaluated, and the process of generating the memory performance evaluation result can explore the impact of memory damage on circuit performance, and further improve the reliability of the network performance evaluation results.
[0146] See also Figure 8 , Figure 8 A schematic diagram of the structure of a neural network circuit performance evaluation device provided by an embodiment of the present invention.
[0147] The present invention provides a neural network circuit performance evaluation device, comprising:
[0148] An acquisition module 801 is used to acquire an evaluation sample data set, and use the evaluation sample data set as an input of a neural network of a neural network circuit to be evaluated, and output a first accuracy rate;
[0149] The first fault module 802 is used to inject a preset noise fault into a neural network unit in the neural network circuit to be evaluated, and determine the noise fault neural network circuit;
[0150] A hardware circuit result module 803 is used to generate a hardware circuit performance result of the neural network circuit to be evaluated based on the first accuracy rate and the evaluation sample data set using the noise fault neural network circuit;
[0151] A comparison module 804 is used to compare the number of neurons of the neural network unit in the neural network circuit to be evaluated with a preset neuron number threshold;
[0152] The second fault module 805 is used to use a preset symbol search technology to perform performance evaluation on the neural network circuit to be evaluated if the number of neurons is greater than a preset neuron number threshold, and generate a first memory performance evaluation result of the neural network circuit to be evaluated;
[0153] The third fault module 806 is used to use the preset synaptic fault technology to perform performance evaluation on the neural network circuit to be evaluated if the number of neurons is less than or equal to the preset neuron number threshold, and generate a second memory performance evaluation result of the neural network circuit to be evaluated.
[0154] Further, the neural network unit includes an input layer neural network unit, a hidden layer neural network unit and an output layer neural network unit; the first fault module 802 is specifically used to:
[0155] Injecting a preset noise fault into an input layer neural network unit in the neural network circuit to be evaluated, and determining the input layer noise fault neural network circuit;
[0156] Injecting a preset noise fault into a hidden layer neural network unit in the neural network circuit to be evaluated, and determining the hidden layer noise fault neural network circuit;
[0157] A preset noise fault is injected into the output layer neural network unit in the neural network circuit to be evaluated, and the output layer noise fault neural network circuit is determined.
[0158] Furthermore, the hardware circuit result module 803 is specifically used for:
[0159] The evaluation sample data set is used as the input of the neural network of the input layer noise fault neural network circuit, the neural network of the hidden layer noise fault neural network circuit and the neural network of the output layer noise fault neural network circuit, and the second accuracy rate of the input layer, the second accuracy rate of the hidden layer and the second accuracy rate of the output layer are output;
[0160] Perform difference operations on the second accuracy of the input layer, the second accuracy of the hidden layer, the second accuracy of the output layer and the first accuracy respectively to determine the input layer difference, the hidden layer difference and the output layer difference;
[0161] The hardware circuit performance result of the neural network circuit to be evaluated is generated based on the comparison results of the absolute value of the input layer difference, the absolute value of the hidden layer difference and the absolute value of the output layer difference.
[0162] Furthermore, the second fault module 805 includes:
[0163] The first submodule is used to inject a preset weight fault data set into a synapse in a neural network circuit to be evaluated, and determine a weight fault neural network circuit;
[0164] A second submodule is used to use the evaluation sample data set as an input of a neural network of a weight fault neural network circuit, and output a third accuracy rate;
[0165] The third submodule is used to perform a difference operation on the third accuracy and the first accuracy, and output the difference of the first accuracy as a label value;
[0166] A fourth submodule is used to construct a weighted fault label data set using the label value and the preset weighted fault data set;
[0167] The fifth submodule is used to perform model training on a preset initial weight fault detection network using a weight fault label data set based on a preset Adam optimization algorithm, and determine a trained target weight fault detection network;
[0168] The sixth submodule is used to use the target weight fault detection network to evaluate the neural network circuit to be evaluated according to the weight fault data to be evaluated, and generate a first memory performance evaluation result of the neural network circuit to be evaluated.
[0169] Furthermore, the sixth submodule is specifically used for:
[0170] Taking the weight fault data to be evaluated as the input of the target weight fault detection network, and outputting a plurality of initial state vectors;
[0171] Screen each initial state vector to determine the target state vector;
[0172] According to the comparison result between the target state vector and the preset comparison constant, a first memory performance evaluation result of the neural network circuit to be evaluated is generated.
[0173] Further, the third fault module 806 is specifically configured to:
[0174] Performing data format conversion on the sign bit and value bit of the synapse of the neural network circuit to be evaluated according to the preset fault conversion condition, and determining the synapse fault neural network circuit;
[0175] using the evaluation sample data set as an input of the neural network of the synaptic failure neural network circuit, and outputting a fourth accuracy rate;
[0176] Performing a difference operation on the fourth accuracy and the first accuracy, and outputting a second accuracy change difference;
[0177] According to the comparison result of the second accuracy change difference and the preset difference range, a second memory performance evaluation result of the neural network circuit to be evaluated is generated.
[0178] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, modules and sub-modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0179] An embodiment of the present invention also provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory; when the computer program is executed by the processor, the processor executes the steps of the neural network circuit performance evaluation method as described in any of the above embodiments.
[0180] An embodiment of the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the steps of the neural network circuit performance evaluation method as in any of the above embodiments are implemented.
[0181] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the neural network circuit performance evaluation method as in any of the above embodiments.
[0182] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0183] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0184] 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 aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may 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 method for evaluating the performance of a neural network circuit, characterized in that: include: Acquire an evaluation sample data set, and use the evaluation sample data set as an input of a neural network of a neural network circuit to be evaluated, and output a first accuracy rate; Injecting a preset noise fault into a neural network unit in the neural network circuit to be evaluated to determine a noise fault neural network circuit; Using the noise fault neural network circuit to generate a hardware circuit performance result of the neural network circuit to be evaluated according to the first accuracy rate and the evaluation sample data set; Comparing the number of neurons of the neural network unit in the neural network circuit to be evaluated with a preset neuron number threshold; If the number of neurons is greater than the preset neuron number threshold, a preset symbol search technology is used to perform a performance evaluation on the neural network circuit to be evaluated, and a first memory performance evaluation result of the neural network circuit to be evaluated is generated; If the number of neurons is less than or equal to the preset neuron number threshold, a preset synaptic fault technology is used to perform performance evaluation on the neural network circuit to be evaluated, and a second memory performance evaluation result of the neural network circuit to be evaluated is generated.
2. The neural network circuit performance evaluation method according to claim 1, characterized in that: The neural network unit includes an input layer neural network unit, a hidden layer neural network unit and an output layer neural network unit; the step of injecting a preset noise fault into the neural network unit in the neural network circuit to be evaluated and determining the noise fault neural network circuit includes: Injecting the preset noise fault into the input layer neural network unit in the neural network circuit to be evaluated to determine the input layer noise fault neural network circuit; Injecting the preset noise fault into the hidden layer neural network unit in the neural network circuit to be evaluated to determine the hidden layer noise fault neural network circuit; The preset noise fault is injected into the output layer neural network unit in the neural network circuit to be evaluated to determine the output layer noise fault neural network circuit.
3. The neural network circuit performance evaluation method according to claim 2, characterized in that: The step of using the noise fault neural network circuit to generate the hardware circuit performance result of the neural network circuit to be evaluated according to the first accuracy rate and the evaluation sample data set includes: Using the evaluation sample data set as input of the neural network of the input layer noise fault neural network circuit, the neural network of the hidden layer noise fault neural network circuit and the neural network of the output layer noise fault neural network circuit, and outputting the second accuracy rate of the input layer, the second accuracy rate of the hidden layer and the second accuracy rate of the output layer; Performing difference operations on the second accuracy of the input layer, the second accuracy of the hidden layer, the second accuracy of the output layer and the first accuracy respectively to determine the input layer difference, the hidden layer difference and the output layer difference; The hardware circuit performance result of the neural network circuit to be evaluated is generated according to the comparison result of the absolute value of the input layer difference, the absolute value of the hidden layer difference and the absolute value of the output layer difference.
4. The neural network circuit performance evaluation method according to claim 1, characterized in that: If the number of neurons is greater than the preset neuron number threshold, the step of using a preset symbol search technology to perform performance evaluation on the neural network circuit to be evaluated, and generating a first memory performance evaluation result of the neural network circuit to be evaluated includes: Injecting a preset weight fault data set into the synapses in the neural network circuit to be evaluated to determine the weight fault neural network circuit; Using the evaluation sample data set as an input of the neural network of the weight fault neural network circuit, and outputting a third accuracy rate; Performing a difference operation on the third accuracy rate and the first accuracy rate, outputting the first accuracy rate change difference as a label value; Constructing a weighted fault label data set using the label value and the preset weighted fault data set; Based on a preset Adam optimization algorithm, the weighted fault label data set is used to perform model training on a preset initial weighted fault detection network to determine a trained target weighted fault detection network; The target weight fault detection network is used to evaluate the neural network circuit to be evaluated according to the weight fault data to be evaluated, and a first memory performance evaluation result of the neural network circuit to be evaluated is generated.
5. The neural network circuit performance evaluation method according to claim 4, characterized in that: The step of using the target weight fault detection network to evaluate the neural network circuit to be evaluated according to the weight fault data to be evaluated, and generating a first memory performance evaluation result of the neural network circuit to be evaluated, comprises: Using the weighted fault data to be evaluated as input of the target weighted fault detection network, and outputting a plurality of initial state vectors; Screening each of the initial state vectors to determine a target state vector; A first memory performance evaluation result of the neural network circuit to be evaluated is generated according to a comparison result between the target state vector and a preset comparison constant.
6. The neural network circuit performance evaluation method according to claim 1, characterized in that: If the number of neurons is less than or equal to the preset neuron number threshold, the step of using a preset synaptic fault technology to perform performance evaluation on the neural network circuit to be evaluated, and generating a second memory performance evaluation result of the neural network circuit to be evaluated includes: Performing data format conversion on the sign bit and value bit of the synapse of the neural network circuit to be evaluated according to the preset fault conversion condition, and determining the synapse fault neural network circuit; Using the evaluation sample data set as an input of the neural network of the synaptic failure neural network circuit, and outputting a fourth accuracy rate; Performing a difference operation on the fourth accuracy rate and the first accuracy rate, and outputting a second accuracy rate change difference; According to the comparison result of the second accuracy change difference and the preset difference range, a second memory performance evaluation result of the neural network circuit to be evaluated is generated.
7. A neural network circuit performance evaluation device, characterized in that: include: An acquisition module, used for acquiring an evaluation sample data set, and using the evaluation sample data set as an input of a neural network of a neural network circuit to be evaluated, and outputting a first accuracy rate; A first fault module is used to inject a preset noise fault into a neural network unit in the neural network circuit to be evaluated to determine a noise fault neural network circuit; A hardware circuit result module, used to generate a hardware circuit performance result of the neural network circuit to be evaluated based on the first accuracy rate and the evaluation sample data set using the noise fault neural network circuit; A comparison module, used for comparing the number of neurons of the neural network unit in the neural network circuit to be evaluated with a preset neuron number threshold; A second fault module is used for, if the number of neurons is greater than the preset neuron number threshold, using a preset symbol search technology to perform performance evaluation on the neural network circuit to be evaluated, and generating a first memory performance evaluation result of the neural network circuit to be evaluated; The third fault module is used to perform performance evaluation on the neural network circuit to be evaluated by using a preset synaptic fault technology if the number of neurons is less than or equal to the preset neuron number threshold, and generate a second memory performance evaluation result of the neural network circuit to be evaluated.
8. A computer device, characterized in that: It includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the neural network circuit performance evaluation method as described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed, the neural network circuit performance evaluation method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The computer program product includes a computer program stored on a non-transitory computer-readable storage medium, wherein the computer program includes program instructions, wherein when the program instructions are executed by a computer, the computer is caused to execute the neural network circuit performance evaluation method as described in any one of claims 1-6.
