A method and system for fuzzy testing of artificial neural networks
By employing a fuzz testing method for artificial neural networks, and utilizing random data mutation and script mutants to generate mutated data, monitoring neuron states and adjusting mutation patterns, the problems of difficult debugging and high computational cost of deep neural networks are solved, thereby improving the reliability and stability of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU MULIAN INTERNET OF THINGS TECH CO LTD
- Filing Date
- 2023-01-06
- Publication Date
- 2026-07-21
Smart Images

Figure CN116166540B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of neural network fuzz testing. Background Technology
[0002] In recent years, industrial control information systems have played a crucial role as the "brain" and "central nervous system" in various important industrial sectors and infrastructures in my country, including power, transportation, energy, water conservancy, metallurgy, and aerospace. With the development of modern economy and information technology, industrial control information systems not only face security threats beyond traditional control functions, but also face diverse ransomware variants, deeply lurking Trojan viruses, and various types of hacker intrusions. Fuzzy security testing, a type of security testing application, uses fuzzy manipulation to construct abnormal input data in software, potentially causing anomalies such as system crashes, and then precisely pinpoints existing security vulnerabilities. Fuzzy testing for vulnerability analysis, due to its ability to traverse various fuzzed variant data, possesses the characteristic of traversing all inputs. Therefore, compared to other security vulnerability discovery methods, fuzzy testing significantly improves the efficiency of discovering security vulnerabilities and technical vulnerabilities, and can reveal many blind spots that traditional methods cannot reach. It has received widespread attention and welcome from experts and researchers in information security and vulnerability analysis technology. Summary of the Invention
[0003] The purpose of this invention is to provide a fuzz testing method for artificial neural networks, in order to solve the problems of existing deep artificial neural networks being difficult to debug and having high computational costs.
[0004] On one hand, embodiments of the present invention provide a fuzz testing method for artificial neural networks, comprising the following steps:
[0005] S1, Input the initial test data and calculation result threshold of the artificial neural network, and input the above data into the random data mutant;
[0006] S2, using a random data mutant to perform non-random or random mutations on the initial test data of the artificial neural network to generate mutated data;
[0007] S3, the generated mutated data is transmitted to the random script mutant, and the mutated data is randomly combined by the random script mutant to obtain the mutated neural network test script;
[0008] S4, the random input device sends the neural network test script generated by the random script mutant combination to the data receiving neuron of the artificial neural network;
[0009] In S5, after the data receiving neuron receives the test script, the neuron monitor monitors the activation state of the neuron and feeds back the state to the mutation controller;
[0010] In S6, according to the activation state of the neuron, the mutation controller adjusts the mutation mode of the random data mutator corresponding to the neuron endpoint and the combination mode of the random script mutator;
[0011] In S7, the resource controller monitors whether there is a data receiving neuron in the artificial neural network that has not received the neural network test script. If so, it controls the fuzz testing microservice to send the neural network test script to it.
[0012] Furthermore, the calculation result threshold input in S1 includes the initial expected threshold k.
[0013] Furthermore, in S2, the non-random mutation also includes: building a random mutation call algorithm in the random data mutator, and performing non-random mutation on the initial test data of the artificial neural network according to the defined mutation configuration file;
[0014] The random mutation also includes: calling a data mutation algorithm to perform random mutation on the initial test data of the artificial neural network, including sequential single mutation, random single mutation, sequential combination mutation, and random combination mutation.
[0015] Furthermore, the random data mutator further includes an adaptive expansion module, which can be compatible with various data mutation algorithms and perform random mutation on the test data.
[0016] Furthermore, in S2, the random script mutator performs random combination of neuron input scripts according to the mutated data generated by the random data mutator. The combination classification is related to the number of mutated data generated by the random data mutator. When the random data mutator generates s mutated data, there are s! (s!=1*2*3*4*5*……*(s - 2)*(s - 1)*s) combination classifications.
[0017] Furthermore, in S5, let the output value of the data receiving neuron be M(n), set the expected calculation time T and the expected calculation time difference Tv, and combine with the initial expected threshold k set in S1 to compare the output value M(n) with the initial expected threshold k to determine whether the data receiving neuron is activated:
[0018] When M(n) < k, it means that the data receiving neuron is not activated;
[0019] When M(n) > k, it means that the data receiving neuron is activated.
[0020] Further, S6 further includes: obtaining the activation state of the data receiving neuron through a mutation controller. If the data receiving neuron is not activated, adjust the mutation mode of the random data mutator, and further determine whether the data receiving neuron is activated. If it is still not activated, further adjust the combination mode of the random script mutator, and further determine whether the data receiving neuron is activated. If it is still not activated, the initial test data input value in S1 needs to be adjusted until the data receiving neuron is in an activated state.
[0021] Further, S6 further includes:
[0022] When the neuron monitor determines that the data receiving neuron is in an activated state, further calculate the input-output time difference Td of a single test data, and adjust the mutation rates of the random data mutator and the random script mutator according to the input-output time difference Td of the test data.
[0023] Further, adjusting the mutation rates of the random data mutator and the random script mutator according to the input-output time difference Td of the test data further includes:
[0024] When Td - T > Tv, the neuron monitor feeds back to the random data mutator and the random script mutator, and the random data mutator and the random script mutator reduce the mutation rate according to the feedback; when Td - T < Tv, it will feed back to the random data mutator and the random script mutator, and the random data mutator and the random script mutator increase the mutation rate according to the feedback.
[0025] Further, S7 further includes: The fuzz testing microservice includes a random data mutator, a random script mutator, and a random inputter. When there is a data receiving neuron in the artificial neural network that does not receive the neural network test script, the random data mutator, the random script mutator, and the random inputter generate a neural network test script based on the above steps and send it to the data receiving neuron of the artificial neural network, and execute S5 and S6 on the data receiving neuron after receiving the test script.
[0026] On the other hand, an embodiment of the present invention further provides a fuzz testing system for an artificial neural network, including: a random data mutator, a random script mutator, a mutation controller, a random inputter, a neuron monitor, and a resource controller;
[0027] Among them, the random data mutator can perform non-random mutation or random mutation on the initial data of the artificial neural network test to generate mutated data;
[0028] The random data mutator further includes an adaptive expansion module, and the adaptive expansion module can be compatible with data mutation algorithms;
[0029] The random script mutant receives the mutated data generated by the random data mutant and randomly combines the mutated data to obtain the mutated neural network test script.
[0030] The random input device sends the neural network test script generated by the random script mutant combination to the data receiving neurons of the artificial neural network;
[0031] Neuron monitors are used to monitor the activation state of neurons in artificial neural networks and feed the state back to the mutation controller;
[0032] The mutation controller can adjust the mutation mode of the random data mutant and the combination mode of the random script mutant corresponding to the neuron according to the activation state of the neuron.
[0033] The resource controller can monitor whether any data receiving neurons in the artificial neural network are not receiving the neural network test script, and send the neural network test script to the data receiving neurons that are not receiving the test script.
[0034] The beneficial effects of this invention are as follows: This invention discovers potential vulnerabilities in the numerous, diverse, and varied large-scale industrial automation control systems and complex industrial control protocol software. By publicly disclosing as many security vulnerabilities as possible in large-scale industrial automation control systems, it greatly enhances the information security of industrial control systems and environments. This includes:
[0035] 1. This invention uses a random data mutant and a random script mutant to generate a large number of input data samples that are similar to but different from the training dataset, thereby completing the coverage test of each node of the deep neural network, verifying the reliability of the artificial neural network, and ensuring the overall quality of the system or platform containing the artificial neural network.
[0036] 2. This invention, through resource controllers and fuzzy testing microservices in microservice and cloud architecture modes, can match fuzzy testing microservices with corresponding resources for artificial neural networks with different levels of computing power, thereby verifying the stability of artificial neural networks and ensuring the overall quality of systems or platforms containing artificial neural networks. Attached Figure Description
[0037] 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. In the drawings:
[0038] Figure 1This is a schematic diagram of the overall process of the fuzz testing method for artificial neural networks provided in this embodiment of the invention;
[0039] Figure 2 This is a schematic diagram of the overall structure of the fuzzy testing system for artificial neural networks provided in an embodiment of the present invention. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0041] In the description of this specification, the terms "comprising," "including," "having," and "containing" are open-ended terms, meaning that they include but are not limited to. The terms "an embodiment," "a specific embodiment," "some embodiments," and "for example," etc., refer to specific features, structures, or characteristics described in connection with that embodiment or example that are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. The order of steps involved in the various embodiments is used to illustrate the implementation of this application, and the order of steps is not limited and can be adjusted appropriately as needed.
[0042] like Figure 1 As shown, Figure 1 This invention provides an overall flowchart of a fuzz testing method for artificial neural networks, which includes the following steps:
[0043] S1, the initial test data and calculation result threshold of the artificial neural network are manually input, and the above data is input into the random data mutant;
[0044] The input calculation result threshold includes the initial expected threshold k.
[0045] S2, using a random data mutant to perform non-random or random mutations on the initial test data of the artificial neural network to generate mutated data;
[0046] Non-random mutation also includes: embedding a random mutation call algorithm in the random data mutant to perform non-random mutation on the initial test data of the artificial neural network according to the defined mutation configuration file;
[0047] Random mutation also includes: calling data mutation algorithms to randomly mutate the initial test data of artificial neural networks, including sequential single mutation, random word mutation, sequential combination mutation, and random combination mutation.
[0048] Furthermore, the random data mutant also includes an adaptive extension module, which is compatible with data mutation algorithms. Data mutation algorithms are used to mutate data, and the random mutation call algorithm refers to the algorithm that calls the data mutation algorithm.
[0049] Specifically, the initial test data is randomly mutated using a data mutation algorithm, and the mutated test data is further processed by calling the data mutation algorithm to finally generate mutated data;
[0050] There are three data mutation algorithms: a, b, and c. A random mutation algorithm can either call algorithm a to mutate the data, and then call algorithm b to mutate the data mutated by algorithm a; or it can call algorithm b to mutate the data first, and then call algorithm a to mutate the data mutated by algorithm a. It can be seen that these two forms use the same type of data mutation algorithm, but because the order in which they are called is different, the resulting mutated data is different. That is, when the number of random data mutation algorithms increases dramatically, the amount of data generated from the same initial data increases exponentially.
[0051] S3, the generated mutated data is transmitted to the random script mutant, and the mutated data is randomly combined by the random script mutant to obtain the mutated neural network test script;
[0052] Specifically, the random script mutant randomly combines the neuron input scripts based on the mutant data generated by the random data mutant. The combination classification is related to the number of mutant data generated by the random data mutant. When the random data mutant generates s mutant data, there are s! (s!=1*2*3*4*5*……*(s-2)*(s-1)*s) classifications.
[0053] S4, the random input device sends the neural network test script generated by the random script mutant combination to the data receiving neuron of the artificial neural network;
[0054] S5, After the data receiving neuron receives the test script, the neuron monitor monitors the neuron's activation state and feeds back the state to the mutation controller;
[0055] Specifically, after the data receiving neuron receives the test script, it calculates the result using a neural network algorithm, and this result is output by the data receiving neuron.
[0056] Furthermore, the process by which the neuron monitor receives data on the activation state of neurons also includes: based on...
[0057] Let the output value of the data receiving neuron be M(n). Set the expected calculation time T and the expected calculation time difference Tv. Combine the initial expected threshold k set in S1, and compare the output value M(n) with the initial expected threshold k to determine whether the data receiving neuron is activated:
[0058] When M(n) < k, it means that the data receiving neuron is not activated;
[0059] When M(n) > k, it means that the data receiving neuron is activated.
[0060] S6. The mutation controller obtains the activation state of the data receiving neuron. If it is not activated, it adjusts the mutation mode of the random data mutator corresponding to the endpoint of the data receiving neuron and the combination mode of the random script mutator. If it is activated, then according to;
[0061] Specifically, each data receiving neuron has a corresponding random data mutator and a random script mutator. The mutation controller obtains the activation state of the data receiving neuron. If the data receiving neuron is not activated, it adjusts the mutation mode of the random data mutator, and further determines whether the data receiving neuron is activated. If it is still not activated, it further adjusts the combination mode of the random script mutator, and further determines whether the data receiving neuron is activated. If it is still not activated, it is necessary to adjust the initial test data input value in S1 until the data receiving neuron is in an activated state.
[0062] Among them, adjusting the combination mode of the random script mutator includes adjusting the data mutation algorithm adopted and its order, so as to generate new mutated data.
[0063] After the neuron monitor determines that the data receiving neuron is activated, it further calculates the input-output time difference Td of a single test data, and adjusts the mutation rates of the random data mutator and the random script mutator according to the input-output time difference Td of the test data; specifically:
[0064] When Td - T > Tv, the neuron monitor feeds back to the random data mutator and the random script mutator, and the random data mutator and the random script mutator reduce the mutation rate according to the feedback;
[0065] When Td - T < Tv, it feeds back to the random data mutator and the random script mutator, and the random data mutator and the random script mutator increase the mutation rate according to the feedback.
[0066] Among them, the mutation rate refers to the number of test data generated according to the same mutation mode within the same time.
[0067] S7, the resource controller monitors whether there are any data receiving neurons in the artificial neural network that have not received the neural network test script. If so, it controls the fuzzing microservice to send the neural network test script to them.
[0068] The fuzz testing microservice includes a random data mutant, a random script mutant, and a random input device. When there are data receiving neurons in the artificial neural network that have not received the neural network test script, the random data mutant, the random script mutant, and the random input device generate the neural network test script based on the above steps and send it to the data receiving neurons of the artificial neural network. Then, S5 and S6 are executed on the data receiving neurons after receiving the test script.
[0069] like Figure 2 As shown, Figure 2 This is an overall structural diagram of a fuzz testing system for artificial neural networks proposed in this invention. This fuzz testing system for artificial neural networks is used to implement the steps of the above-mentioned fuzz testing method for artificial neural networks. The system includes a random data mutant, a random script mutant, a random input device, an artificial neural network, a neuron monitor, a mutation controller, and a resource controller.
[0070] Among them, the random data mutant can perform non-random or random mutations on the initial data of artificial neural network testing to generate mutated data;
[0071] Preferably, the random data mutant also includes an adaptive expansion module that is compatible with the data mutation algorithm.
[0072] The random script mutant receives the mutated data generated by the random data mutant and randomly combines the mutated data to obtain the mutated neural network test script.
[0073] The random input device combines the neural network test scripts generated by the random script mutant and sends them to the data receiving neurons of the artificial neural network.
[0074] Neuron monitors are used to monitor the activation state of neurons in artificial neural networks and feed the state back to the mutation controller;
[0075] The mutation controller can adjust the mutation mode of the random data mutant and the combination mode of the random script mutant corresponding to the neuron's endpoint based on the neuron's activation state.
[0076] The resource controller can monitor whether any data receiving neurons in the artificial neural network are not receiving the neural network test script, and send the neural network test script to the data receiving neurons that are not receiving the test script.
[0077] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0078] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0079] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0080] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0081] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A fuzz testing method for artificial neural networks, characterized in that, It includes the following steps: S1. Input the initial test data of the artificial neural network and the calculation result threshold, and input the above data into the random data mutator; S2. Perform non-random mutation or random mutation on the initial test data of the artificial neural network through the random data mutator to generate mutated data; S3. Transmit the generated mutated data to the random script mutator, and perform random combination on the mutated data through the random script mutator to obtain the mutated neural network test script; S4. The random inputter sends the neural network test script generated by the random script mutator combination to the data receiving neuron of the artificial neural network; S5. After the data receiving neuron receives the test script, the neuron monitor monitors the activation state of the neuron and feeds back the state to the mutation controller; S6. The mutation controller adjusts the mutation mode of the random data mutator corresponding to the neuron and the combination mode of the random script mutator according to the activation state of the neuron; S7. The resource controller monitors whether there is a data receiving neuron in the artificial neural network that has not received the neural network test script. If so, it controls the fuzz testing microservice to send the neural network test script to it; In step S7: The fuzz testing microservice includes a random data mutator, a random script mutator and a random inputter. When there is a data receiving neuron in the artificial neural network that has not received the neural network test script, the random data mutator, the random script mutator and the random inputter generate a neural network test script based on the above steps and send it to the data receiving neuron of the artificial neural network, and execute S5 and S6 on the data receiving neuron after receiving the test script.
2. The fuzz testing method for artificial neural networks as described in claim 1, characterized in that, The calculation result threshold input in S1 includes the initial expected threshold k.
3. The fuzz testing method for artificial neural networks as described in claim 1 or 2, characterized in that, In S2, the non-random mutation further includes: embedding a random mutation call algorithm in the random data mutator, and performing non-random mutation on the initial test data of the artificial neural network according to the defined mutation configuration file; The random mutation further includes: calling a data mutation algorithm to perform random mutation on the initial test data of the artificial neural network, including sequential single mutation, random single mutation, sequential combination mutation, and random combination mutation.
4. The fuzz testing method for artificial neural networks as described in claim 3, characterized in that, The random data mutator further includes an adaptive expansion module, which can be compatible with various data mutation algorithms and perform random mutation on the test data.
5. The fuzz testing method for artificial neural networks as described in claim 4, characterized in that, In S2, the random script mutator performs random combination of neuron input scripts according to the mutated data generated by the random data mutator. The combination classification is related to the number of mutated data generated by the random data mutator. When the random data mutator generates s mutated data, there are s! (s!=1*2*3*4*5*……*(s - 2)*(s - 1)*s) combination classifications.
6. The fuzz testing method for artificial neural networks as described in claim 5, characterized in that, In S5, let the output value of the data receiving neuron be M(n), set the expected calculation time T, the expected calculation time difference Tv, and combine the initial expected threshold k set in S1, and compare the output value M(n) with the initial expected threshold k to determine whether the data receiving neuron is activated: When M(n) < k, it means that the data receiving neuron is not activated; When M(n) > k, it means that the data receiving neuron is activated.
7. The fuzz testing method for artificial neural networks as described in claim 6, characterized in that, S6 further includes: obtaining the activation state of the data receiving neuron through the mutation controller. If the data receiving neuron is not activated, adjust the mutation mode of the random data mutator, and further determine whether the data receiving neuron is activated. If it is still not activated, further adjust the combination mode of the random script mutator, and further determine whether the data receiving neuron is activated. If it is still not activated, it is necessary to adjust the initial test data input value in S1 until the data receiving neuron is in an activated state.
8. The fuzz testing method for artificial neural networks as described in claim 7, characterized in that, S6 further includes: When the neuron monitor determines that the data receiving neuron is in an activated state, further calculate the input-output time difference Td of a single test data, and adjust the mutation rates of the random data mutator and the random script mutator according to the input-output time difference Td of the test data.
9. The fuzz testing method for artificial neural networks as described in claim 8, characterized in that, Adjusting the mutation rates of the random data mutator and the random script mutator according to the input-output time difference Td of the test data further includes: When Td - T > Tv, the neuron monitor feeds back the neuron activation state to the random data mutator and the random script mutator, and the random data mutator and the random script mutator reduce the mutation rate according to the feedback; when Td - T < Tv, the neuron activation state is fed back to the random data mutator and the random script mutator, and the random data mutator and the random script mutator increase the mutation rate according to the feedback.
10. A fuzz testing system for artificial neural networks, using the method described in any one of claims 1-9, characterized in that, Includes: Random data mutator, random script mutator, mutation controller, random inputter, neuron monitor, and resource controller; Among them, the random data mutator can perform non-random mutation or random mutation on the initial data of the artificial neural network test to generate mutated data; The random data mutator further includes an adaptive expansion module, and the adaptive expansion module can be compatible with the data mutation algorithm; The random script mutator receives the mutated data generated by the random data mutator and randomly combines the mutated data to obtain a mutated neural network test script; The random inputter sends the neural network test script combined and generated by the random script mutator to the data receiving neuron of the artificial neural network; The neuron monitor is used to monitor the neuron activation state of the artificial neural network and feed back the state to the mutation controller; The mutation controller can adjust the mutation mode of the random data mutator corresponding to the neuron and the combination mode of the random script mutator according to the activation state of the neuron; The resource controller can monitor whether there is a data receiving neuron in the artificial neural network that has not received the neural network test script, and send the neural network test script to the data receiving neuron that has not received the test script.