Generative neural network model fuzzy testing method based on reverse recoding

Through the closed-loop testing method of reverse recoding and dual-indicator optimization strategy, the problem of the generative neural network model's sensitivity to input disturbances is solved, efficient identification of generation defects and robustness evaluation are achieved, and the reliability of the generative neural network is improved.

CN120597952APending Publication Date: 2025-09-05NANJING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510955585.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-11
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

Generative neural network models are sensitive to input perturbations, lack effective robustness and abnormal behavior testing mechanisms, have difficulty identifying semantic deviations and structural errors, and have high opacity in the input space, making it difficult to quantify model robustness.

Method used

The reverse recoding technology is adopted, and the pre-trained residual neural network encoder is used to reversely map the noisy image into a semantic perturbation vector. Combined with the dual-index optimization strategy of initial score and Fréchette distance, a closed-loop testing architecture is constructed to systematically explore the input space and trigger potential errors.

Benefits of technology

It significantly improves the targeting of fuzz testing, accurately identifies generation defects, generates reproducible error sets, supports model vulnerability analysis and reinforcement, and breaks through the technical bottlenecks of traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120597952A_ABST
    Figure CN120597952A_ABST
Patent Text Reader

Abstract

The invention provides a generative neural network model fuzzy testing method based on reverse recoding, and aims to solve the problems that an existing generative neural network is possibly interfered by input abnormity in the generation process, low-quality images are generated, original semantic information is lost, and then the application accuracy is affected. According to the method, a disturbance image is constructed by injecting noise step by step, and an input case which causes a generator to generate a wrong output image is generated from the disturbance image by using a pre-training encoder through reverse recoding, so that efficient fuzzy testing of the generative neural network is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence testing technology, and specifically to a fuzzy testing method for a generative neural network model based on reverse recoding, and in particular to a method for testing and robustness evaluation of the generation performance of a generative neural network model based on a reverse recoding mechanism. The method is a key technology for verifying the security and reliability of deep learning models. Background Art

[0002] In recent years, generative neural networks, as a powerful generative model, have been widely applied in various artificial intelligence fields, including image synthesis, data augmentation, style transfer, semantic segmentation, and medical image processing. Generative neural network models utilize an adversarial training mechanism, creating a game between the generator and the discriminator. These models are able to learn complex, high-dimensional data distributions, thereby generating highly realistic data samples.

[0003] However, due to the complexity of generative neural network structures and the instability of their training process, their generated results are highly sensitive to input perturbations and are easily affected by factors such as input outliers, model overfitting, and training bias. This can lead to problems such as blurring, structural loss, and semantic distortion in generated images. These flaws can severely impact performance and even cause systemic errors when these models are deployed in real-world applications such as medical diagnosis, autonomous driving, and remote sensing recognition.

[0004] Currently, mainstream testing methods for generative neural networks focus primarily on subjective quality assessments of output results (such as initial scores and Fréchette distances) and convergence analysis of the training process, lacking systematic testing mechanisms for model robustness and abnormal behavior. Meanwhile, existing fuzz testing techniques, such as gradient-based input perturbation generation, differential testing, and mutation testing, have made some progress in processing traditional classification or regression models. However, testing generative models such as generative neural networks still faces the following challenges:

[0005] 1. Lack of effective error triggering mechanism: Since the output of the generative neural network model is a continuous high-dimensional image, traditional testing criteria have difficulty identifying semantic deviations or structural errors.

[0006] 2. Strong input space opacity: The input of the generative neural network is a latent space vector or high-dimensional noise. The nonlinear mapping relationship between it and the output image is difficult to reverse reasoning, resulting in a lack of directionality in the test case construction.

[0007] 3. Generator robustness is difficult to quantify: The lack of methods that can automatically detect model failures under extreme perturbations or boundary conditions limits the ability to evaluate the safety and robustness of the model.

[0008] Therefore, there is an urgent need for a fuzz testing method that can systematically simulate abnormal inputs, effectively trigger potential errors, and accurately identify defects generated by generative neural networks, so as to improve the reliability and practicality of the model. To address the above problems, this paper proposes a fuzz testing method for generative neural network models based on reverse recoding. By constructing perturbation images and using a pre-trained encoder to perform reverse reasoning on the potential input space, it can actively explore sensitive areas of the generator and efficiently trigger error images, thereby systematically evaluating the robustness and abnormal response behavior of the generative neural network model under input perturbations. Summary of the Invention

[0009] Technical problem: The technical problem to be solved by the present invention is: in view of the problem that the generative neural network model is highly sensitive to input disturbances, a fuzzy testing method for the generative neural network model based on reverse recoding is proposed to realize active exploration of the input space of the generative neural network, significantly improve the targetedness of the fuzzy testing, and break through the technical bottleneck that traditional methods cannot quantify the correlation between input anomalies and generation defects.

[0010] Technical Solution: This invention proposes a fuzzy testing method for a generative neural network model based on reverse recoding, which uses directional recoding technology to test the generative neural network model. The specific steps are as follows:

[0011] Step 1: Construct a vector seed pool P and randomly select a seed vector z from it as the input of the generative neural network model generator G, and generate an image x through the generator G;

[0012] Step 2: Inject noise perturbation into image x to construct a noisy image x′;

[0013] Step 3: Pre-train the residual neural network ResNet encoder R on the ImageNet dataset so that the encoder can convert any input image into an input vector that conforms to the input format of the generative neural network model;

[0014] Step 4: Input the noisy image x′ into the pre-trained residual neural network ResNet encoder R to obtain the seed z′ corresponding to the mutated noisy image x′;

[0015] Step 5: Feed the seed z′ into the generator G to generate the image I, and feed the image I into the discriminator D of the generative neural network model;

[0016] Step 6: If |D(z′)-(-0.5log2 0.5 )|≤0.01, the seed z′ is regarded as the input vector that causes the generative neural network to output an incorrect image, and the seed z′ is saved in the input error set T, otherwise the seed is discarded;

[0017] Step 7: Continue to screen representative seeds using the initial score and Fréchette distance as the guiding indicators. By comparing the initial score and Fréchette distance of the image I generated in each round with the previous round, the seeds z′ corresponding to the images I with improved initial scores and reduced Fréchette distances compared to the previous round are added to the seed pool P.

[0018] Step 8: Repeat iterative steps 1 to 7;

[0019] Step 9: The fuzz testing method summarizes all test results, generates a test result report, and obtains a complete error set T that triggers the generative neural network model to generate error images.

[0020] in,

[0021] In step 1, the vector seed pool P includes potential vector seeds that are initially randomly selected.

[0022] The noise disturbance injected in step 2 includes Gaussian noise, salt and pepper noise or Poisson noise, and the noise intensity is gradually increased according to a preset disturbance range to simulate different degrees of input anomalies.

[0023] In step 3, the residual neural network ResNet encoder R uses a training dataset in its pre-training process that is an image set ImageNet that is consistent with the task of the generative neural network model to ensure the semantic validity of the seed z′.

[0024] In step 4, the seed z′ corresponding to the mutated noisy image x′ refers to inputting the noisy image x′ into the pre-trained residual neural network ResNet encoder R to obtain the seed z′ corresponding to the mutated noisy image, which is used to trigger the abnormal behavior detection of the generator G.

[0025] In step 5, among the evaluation indicators of the generated image I, the initial score is used to evaluate the diversity and recognizability of the image, and the Fréchette distance is used to measure the distribution distance between the generated image and the real image.

[0026] In step 6, the seeds z′ stored in the error set T all induce the generative neural network to generate abnormal outputs for subsequent model robustness analysis and defect location.

[0027] In step 7, the comparison between the initial score and the Frechette distance adopts a preferential strategy to automatically identify and retain representative seeds in the current iteration round to enhance the diversity of the seed pool.

[0028] In step 8, repeated iteration means repeatedly executing steps 1-7, and stopping when the cumulative number of seeds retained in the seed pool P reaches 2000.

[0029] In step 9, the test result report generated includes: the number of test cases in each iteration, the proportion of images identified as low-confidence images by the discriminator, a curve chart of the change of the initial score and the Fréchette distance, and corresponding generated image examples.

[0030] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0031] (1) Systematically simulate abnormal inputs. This paper uses reverse recoding technology to construct a directed mutation mechanism. The pre-trained encoder is used to reversely map the noisy image into a semantic perturbation vector, which actively explores the input space of the generative neural network and significantly improves the pertinence of fuzzy testing.

[0032] (2) Closed-loop data evolution effectively triggers potential errors. An innovative dual-index optimization strategy based on initial score and Frechette distance is introduced. Only when the diversity initial score of the generated images in this round is improved and the distribution authenticity Frechette distance is reduced, the corresponding seeds are retained and iterated continuously, forming a closed-loop testing architecture of "generation-feedback-evolution".

[0033] (3) Accurately identify defects generated by generative neural networks. The generated error set contains reproducible defect trigger vectors, providing direct data support for model vulnerability analysis and reinforcement, breaking through the technical bottleneck of traditional methods that cannot quantify the correlation between input anomalies and generated defects. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 This is a system structure diagram of the present invention. DETAILED DESCRIPTION

[0035] In order to more clearly understand the purpose, advantages and implementation of the present invention, this article will be described in detail with reference to specific embodiments. The following step description will be described one by one according to each step in the method of the present invention.

[0036] As a powerful generative model, generative neural networks have been widely used in many artificial intelligence fields such as image synthesis and data enhancement. However, due to the complexity of the generative neural network structure and the instability during the training process, its generation results are highly sensitive to input perturbations, resulting in blurring and distortion of the generated images. At present, the field of generative neural network model testing still lacks a systematic testing mechanism for model robustness and abnormal behavior. Therefore, the present invention proposes a fuzzy testing method for generative neural networks based on reverse recoding, aiming to provide an efficient and automated test case generation technology to detect robustness defects of generative neural network models. The core idea is to use a pre-trained residual neural network encoder to reversely map the noisy image into a semantic perturbation vector to construct an input space directional variation mechanism, and use a discriminator to determine the authenticity of the reconstructed new image, capture model defects, and filter out the perturbation vector that triggers failure and store it in the error set. This invention also innovatively introduces the initial score and Frechette distance as a dual-metric co-evolutionary engine to implement a preferential strategy: the corresponding perturbation vector is retained in the seed pool only when the initial score of the generated image in the current round increases and the Frechette distance decreases, thereby establishing a closed-loop adversarial vulnerability detection cycle driven by image perturbation feedback. By iteratively executing this process over multiple rounds, valid defect trigger vectors in the error set are continuously accumulated, ultimately generating a robustness test report containing the number of test cases, the proportion of abnormal outputs, the initial score and Frechette distance variation curves, and typical generated image examples, providing data support for model vulnerability identification and reinforcement.

[0037] refer to Figure 1 Based on the above ideas, the method specifically includes the following steps:

[0038] Step 1: Seed pool construction and sampling. First, a vector seed pool P is established, and then a seed z is randomly selected from it as the input of the generative neural network generator G to obtain the initial image x;

[0039] Step 2: Multimodal noise injection. Image x is perturbed by injecting noise to form a noisy image x′. The input noise mainly includes Gaussian noise, salt and pepper noise, and Poisson noise. The noise intensity is gradually increased according to the preset perturbation range to simulate different degrees of input anomalies.

[0040] Step 3: Encoder pre-training. Pre-train the ResNet encoder R based on an image set consistent with the target generative neural network model task, so that the encoder R can convert any input image into an input vector that conforms to the input format of the generative neural network model.

[0041] Step 4: Reverse recoding. The pre-trained ResNet encoder R receives the noisy image x′ as input, and obtains the seed z′ corresponding to the mutated image x′;

[0042] Step 5: Adversarial reconstruction and discrimination. The seed z′ is fed into the generator G to generate the generated image I, which is then fed into the discriminator D of the generative neural network model.

[0043] Step 6: Error judgment and screening. The judgment formula of the discriminator is: |D(z′)-(-0.5log2 0.5 )|

[0044] If |D(z′)-(-0.5log2 0.5 )|≤0.01, z′ is determined to be the seed that causes the generative neural network to output an erroneous image, and z′ is saved in the input error set T, otherwise the seed is discarded.

[0045] Step 7: Double-index optimization update: Calculate the initial score and Frechette distance of image I.

[0046] The initial score reflects the diversity and recognizability of images, while the Fréchette distance measures the distribution distance between generated images and real images. We continue to screen representative seeds using guiding metrics such as the initial score and Fréchette distance. By comparing the initial score and Fréchette distance of each round of image I with those of the previous round, if the initial score of the seed z′ corresponding to image I improves and the Fréchette distance decreases relative to the previous round, we add it to the seed pool P.

[0047] Step 8: Closed-loop iterative testing. Repeat steps 1 to 7. Stop when the cumulative number of seeds retained in seed pool P reaches 2000.

[0048] Step 9: Defect Set Generation. The algorithm aggregates all test results to obtain a complete set of errors, T, that trigger the generative neural network model to generate erroneous images. This ensures that all seeds z′ stored in error set T can induce the generative neural network to generate abnormal outputs, which can be used for subsequent model robustness analysis and defect location. Furthermore, a test report is generated, including the number of test cases in each iteration, the proportion of images identified as low-confidence by the discriminator, a graph of the changes in the initial score and Fréchette distance, and examples of the corresponding generated images.

[0049] The above description is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A fuzzy testing method for a generative neural network model based on reverse recoding, characterized in that This testing method uses the direction recoding technique to test the generative neural network model. The specific steps are: Step 1: Construct a vector seed pool P and randomly select a seed vector z from it as the input of the generative neural network model generator G, and generate an image x through the generator G; Step 2: Inject noise perturbation into image x to construct a noisy image x′; Step 3: Pre-train the residual neural network ResNet encoder R on the ImageNet dataset so that the encoder can convert any input image into an input vector that conforms to the input format of the generative neural network model; Step 4: Input the noisy image x′ into the pre-trained residual neural network ResNet encoder R to obtain the seed z′ corresponding to the mutated noisy image x′; Step 5: Feed the seed z′ into the generator G to generate the image I, and feed the image I into the discriminator D of the generative neural network model; Step 6: If |D(z′)-(-0.5log2 0.5 )|≤0.01, the seed z′ is regarded as the input vector that causes the generative neural network to output an incorrect image, and the seed z′ is saved in the input error set T, otherwise the seed is discarded; Step 7: Continue to screen representative seeds using the initial score and Fréchette distance as the guiding indicators. By comparing the initial score and Fréchette distance of the image I generated in each round with the previous round, the seeds z′ corresponding to the images I with improved initial scores and reduced Fréchette distances compared to the previous round are added to the seed pool P. Step 8: Repeat iterative steps 1 to 7; Step 9: The fuzz testing method summarizes all test results, generates a test result report, and obtains a complete error set T that triggers the generative neural network model to generate error images.

2. The method for fuzz testing a generative neural network model based on reverse recoding according to claim 1, wherein: In step 1, the vector seed pool P includes potential vector seeds that are initially randomly selected.

3. The method for fuzz testing a generative neural network model based on reverse recoding according to claim 1, wherein: The noise disturbance injected in step 2 includes Gaussian noise, salt and pepper noise or Poisson noise, and the noise intensity is gradually increased according to a preset disturbance range to simulate different degrees of input anomalies.

4. The method for fuzz testing a generative neural network model based on reverse recoding according to claim 1, wherein: In step 3, the residual neural network ResNet encoder R uses a training dataset in its pre-training process that is an image set ImageNet that is consistent with the task of the generative neural network model to ensure the semantic validity of the seed z′.

5. The method for fuzz testing a generative neural network model based on reverse recoding according to claim 1, wherein: In step 4, the seed z′ corresponding to the mutated noisy image x′ refers to inputting the noisy image x′ into the pre-trained residual neural network ResNet encoder R to obtain the seed z′ corresponding to the mutated noisy image, which is used to trigger the abnormal behavior detection of the generator G.

6. The method for fuzz testing a generative neural network model based on reverse recoding according to claim 1, wherein: In step 5, among the evaluation indicators of the generated image I, the initial score is used to evaluate the diversity and recognizability of the image, and the Fréchette distance is used to measure the distribution distance between the generated image and the real image.

7. The method for fuzz testing a generative neural network model based on reverse recoding according to claim 1, wherein: In step 6, the seeds z′ stored in the error set T all induce the generative neural network to generate abnormal outputs for subsequent model robustness analysis and defect location.

8. The method for fuzz testing a generative neural network model based on reverse recoding according to claim 1, wherein: In step 7, the comparison between the initial score and the Frechette distance adopts a preferential strategy to automatically identify and retain representative seeds in the current iteration round to enhance the diversity of the seed pool.

9. The method for fuzz testing a generative neural network model based on reverse recoding according to claim 1, wherein: In step 8, repeated iteration means repeatedly executing steps 1-7, and stopping when the cumulative number of seeds retained in the seed pool P reaches 2000.

10. The method for fuzz testing a generative neural network model based on reverse recoding according to claim 1, characterized in that: In step 9, the test result report generated includes: the number of test cases in each iteration, the proportion of images identified as low-confidence images by the discriminator, a curve chart of the change of the initial score and the Fréchette distance, and corresponding generated image examples.