Skip to Content
ComputersComputers
  • Article
  • Open Access

6 March 2026

16 Pages

The Seed Optimization Method for Fuzz Testing Based on Neural Network-Guided Genetic Algorithm

,
,
and
School of Computer and Communication, Lanzhou University of Technology, Lanzhou 730050, China
*
Author to whom correspondence should be addressed.

Abstract

To address the issues of low initial seed efficiency and a large number of ineffective mutations, this paper proposes an innovative fuzz testing seed optimization method combining neural networks and genetic algorithms. Traditional fuzz testing seed generation typically relies on random selection and the number of covered paths. In contrast, our method significantly improves seed generation efficiency and coverage by incorporating neural network models and genetic algorithms. First, the AFL tool is used to generate seed coverage path data, which is then used to train the neural network model. This model is employed to construct a fitness function to assess the potential of each seed. Subsequently, new seeds are generated through genetic algorithm crossover and mutation operations, with fitness evaluations based on the predictions of the neural network. Ultimately, the genetic algorithm optimizes the seeds through multiple generations, progressively improving coverage and vulnerability discovery capabilities. The experimental results demonstrate that the proposed method achieves significant improvements in fuzz testing performance, with path coverage increased by 28% compared to AFL and 23% compared to AFL++, and vulnerability discovery enhanced by over 200%.

1. Introduction

With the continual expansion of software system scale and increasing structural complexity, the number of software vulnerabilities has generally shown an upward trend in recent years. Statistics indicate that in 2025, an average of approximately 4283 new vulnerabilities were reported per month, highlighting that vulnerability discovery and remediation have become critical components for ensuring the security and reliability of software systems [1]. Among various vulnerability detection techniques, fuzz testing [2,3] has emerged as a mainstream method due to its high level of automation, low knowledge dependency, simplicity of implementation, and strong scalability. Unlike other security techniques, such as symbolic execution [4] and taint analysis [5], fuzz testing does not require complex analysis of the target program and offers relatively fast execution speeds, enabling the identification of potential vulnerabilities in a short amount of time. Current popular fuzz testing solutions primarily rely on coverage-guided test case generation, known as coverage-guided fuzz testing. For instance, AFL (American Fuzzy Lop) [2] uses edge-level coverage, LibFuzzer [6] utilizes block-level coverage, and PathAFL [7] adopts coarse-grained path coverage. These fuzz testing tools employ instrumentation to embed monitoring code within the target program, recording code coverage during execution and guiding the generation of new test cases based on the coverage information. Coverage-guided fuzz testing effectively reduces the blind nature of testing by providing a clear direction for test case generation. As the most widely adopted coverage-guided fuzz testing tool, AFL has been extensively applied in both academia and industry due to its simplicity, efficiency, and ease of extensibility. Many researchers have proposed improvements to AFL, optimizing aspects such as energy allocation, seed selection, and mutation. For example, Böhme et al. [8] analyzed the AFL fuzzing process using Markov chains and discovered that most test cases only executed a few high-frequency paths. To address this, Böhme et al. introduced an algorithm that allocates more execution energy to low-frequency paths based on energy distribution, leading to the creation of AFLFast. As the first improved version of AFL, AFLFast has drawn significant attention to AFL optimizations and has become a benchmark for numerous studies [9,10].
With the rapid advancement of deep learning and machine learning technologies, an increasing number of studies have started exploring how to incorporate intelligent methods into seed generation and optimization for fuzz testing. For instance, Godefroid et al. [11] employed Recurrent Neural Networks (RNN) to generate inputs with higher coverage; Rajpal et al. [12] used RNN-guided mutation filters to locate parts of the input that significantly impact code coverage and further improved coverage by mutating those sections; Nichols et al. [13] proposed using Generative Adversarial Networks (GAN) to predict the execution paths of inputs, thereby improving AFL’s performance. Furthermore, Angora [14] and NEUZZ [15] utilized gradient descent algorithms to solve path constraint issues and enhanced code coverage through model learning. These studies illustrate that deep learning techniques can significantly improve fuzz testing coverage, particularly in vulnerability detection for complex programs, showing substantial potential.
In addition to deep learning applications, Genetic Algorithms (GA) [16] have also been widely adopted to optimize seeds in fuzz testing. Genetic algorithms simulate the process of natural selection and evolution, progressively enhancing seed quality through operations such as selection, crossover, and mutation. For example, Qu et al. [17] created a weighted network attack feature database combined with genetic algorithms to generate fuzz test cases, adjusting feature weights based on network service response characteristics; Mehendran et al. [18] proposed combining genetic operations with adaptive learning to improve software vulnerability detection, with one key contribution being the introduction of a crossover operator that allows for broad exploration of potential test input spaces, fostering deeper test exploration. Alshraideh et al. [19] presented a branch coverage fuzz test case generation method based on a multi-population genetic algorithm. This method analyzes the program’s control and data flow, applies different fitness functions for each path, and uses a population evolution strategy to maintain diversity. Additionally, ShuaiBo et al. [20] enhanced vulnerability discovery rates by calculating fitness based on the coverage between test cases and vulnerability-related functions.
Although neural networks and genetic algorithms have shown promising results in fuzzing seed generation, existing neural-network-based fuzzing methods typically require training on large amounts of execution samples and coverage information. This results in frequent inference or online updates for newly generated seeds, and when the training data distribution is uneven, bias may be introduced, leading to high computational overhead and a tendency to converge to local optima [15]. For example, seeds that trigger shallow but frequently executed code paths may receive higher fitness scores due to early edge coverage improvements. The optimization process often repeatedly mutates these seeds and their variants. However, such mutations typically fail to satisfy more complex input constraints necessary to reach deeper program logic, such as nested conditional checks or checksum validations. Consequently, the search process prematurely converges around these shallow paths, hindering exploration of more promising regions in the input space and resulting in local optimum phenomena.
To address these limitations, this paper proposes a novel fuzz testing seed generation and optimization method that integrates neural networks with genetic algorithms. The core idea is to evaluate seed fitness using a trained neural network model and continuously optimize seed quality through multi-generational genetic evolution. Compared with existing approaches, the proposed method effectively combines deep learning–based fitness evaluation with evolutionary optimization, which not only significantly improves path coverage but also reduces redundant mutations and computational overhead, thereby enhancing seed generation efficiency. Extensive experimental results demonstrate that the proposed approach consistently outperforms traditional fuzzing techniques across multiple programs, particularly in terms of coverage growth and vulnerability discovery capability.
The main contributions of this paper are summarized as follows:
  • We propose a neural-network-guided genetic algorithm framework for fuzzing seed generation, in which a neural network intelligently evaluates seed fitness based on coverage information.
  • We design an evolutionary optimization strategy that continuously refines seed quality across generations, alleviating issues associated with low-quality initial seeds and ineffective mutations.
  • We implement the proposed approach within AFL and AFL++ and conduct extensive experiments on multiple real-world programs, demonstrating significant improvements in coverage and bug discovery compared to state-of-the-art fuzzing techniques.
The remainder of this paper is organized as follows: Section 2 reviews related work; Section 3 introduces the overall methodology and key techniques; Section 4 presents the experimental setup and results; and Section 5 provides a discussion and conclusion.

2. Background

To address the issues of low-quality initial seeds and the difficulty of generating high-quality new seeds during mutation, which lead to insufficient path coverage and limited vulnerability discovery, this paper proposes a seed generation and optimization method that integrates neural networks with genetic algorithms.

2.1. Neural Networks

Neural networks are computational models designed to mimic the information processing mechanisms of biological neural systems, and they are widely used in pattern recognition, data classification, function fitting, and numerous other fields. Typical neural network architectures include multilayer perceptrons (MLP) [21], convolutional neural networks (CNN) [22,23], and recurrent neural networks (RNN) [24,25], all of which have achieved significant breakthroughs in high-dimensional tasks such as image recognition, natural language processing, and speech recognition. In recent years, neural networks have demonstrated exceptional performance in complex pattern recognition tasks, particularly in the areas of image recognition, speech processing, and natural language understanding. For example, Saghaian et al. [26] proposed a comprehensive machine learning framework that positions radio frequency and artificial neural networks as complementary data-driven tools, enabling rapid virtual screening and process optimization.
As technology has advanced, the application of neural networks has gradually expanded into the security domain, with a particular focus on fuzz testing. Researchers have begun leveraging neural network models to predict and score key byte locations in test cases, thus guiding fuzzers to perform more targeted input mutations. Notable work in this area includes ATTuzz [27], which integrates artificial intelligence methods into the fuzz testing process, using neural networks to predict the mutation potential and assess the “reward” value of mutation operations for path exploration. Another method, FuzzGuard [28], introduces a deep learning-based approach to predict input reachability (i.e., whether the target is hit) prior to executing the target program, aiding decision-making by filtering out unreachable inputs and, consequently, improving fuzzing performance.
Despite these promising advancements, several challenges persist in applying neural networks to fuzz testing. First, the use of neural networks relies heavily on large amounts of labeled data, which results in lengthy training times and a high demand for data quality and quantity—posing a bottleneck in many practical scenarios. Additionally, training neural networks requires substantial computational resources and time, making efficient models unsuitable for real-time fuzz testing tasks. Neural networks also face the challenge of local optima during input mutation, where the training process may become stuck in local patterns within the data, leading to incomplete or insufficient exploration of test paths. While methods like PMFuzz [29] and NeuFuzz [30] attempt to mitigate these issues by introducing semantic constraints and utilizing deep neural networks to guide intelligent seed selection, they still face limitations related to data dependency, computational overhead, and the problem of local optima.
To address these challenges, this paper proposes an innovative fuzz testing seed generation and optimization method that combines neural networks with genetic algorithms. The key innovation of this approach lies in evaluating seed fitness through a neural network-trained fitness function, while leveraging genetic algorithms to further optimize seed quality through multiple generations of evolution. Compared to existing methods, our approach not only significantly improves seed coverage but also effectively reduces computational overhead and dependency on training data, allowing for high testing efficiency and low computational costs even when handling large-scale programs. Furthermore, by introducing the multi-generation optimization mechanism of genetic algorithms, our method mitigates the local optima problem that neural networks may encounter, making seed generation more comprehensive and accurate.

2.2. Genetic Algorithms

Genetic algorithms are optimization methods that simulate the natural selection and genetic processes of organisms. By emulating genetic mechanisms such as crossover, mutation, and selection, genetic algorithms can effectively search for optimal solutions within complex search spaces. The core principle is to continuously optimize individuals within a population through evolutionary processes, gradually converging toward the optimal solution. Since their inception, genetic algorithms have been widely applied across various fields, including engineering optimization, machine learning, data mining, and more.
In fuzz testing, genetic algorithms have been effectively utilized for test case generation and optimization. For example, Pargas et al. [31] applied genetic algorithms to generate test cases, evaluating the target path coverage after execution based on individual fitness. Jones et al. [32] treated the test case generation process as a search for suitable inputs within the input domain, dividing the program’s branches into multiple subdomains. Genetic algorithms were then used to generate test cases within each subdomain, ensuring full coverage of each branch. VUzzer [33] enhanced the mutation process of genetic algorithms by integrating static analysis techniques. In this approach, static analysis extracts immediate parameters from CMP instructions in assembly, which are then used as a mutation dictionary for genetic algorithms. Mutation locations are determined based on CMP instruction offsets, guiding test cases to bypass specific checks. Risk-AFL [34], an improved version of AFL, is designed to better guide test cases in executing risk functions and additional function calls. This approach refines the fitness function design to not only consider edge coverage but also focus on the number of risky edges and function-call edges, further optimizing test case selection and mutation. Wu Zhiyong et al. [35] introduced the FTSG fuzzing model, which calculates fitness based on parameters passed to dangerous functions. For instance, in string copy functions, the closer the length parameter is to the target address length, the higher the likelihood of triggering a buffer overflow vulnerability, resulting in a higher fitness score for that test case. These innovative methods, by combining genetic algorithms with other techniques, have significantly enhanced fuzz testing, especially in terms of coverage and vulnerability discovery.
Despite the positive outcomes of genetic algorithms in fuzz testing, certain limitations remain. The evolutionary process of genetic algorithms, particularly when applied to large-scale programs, requires substantial computational resources and time for evaluation and selection operations. Genetic algorithms are also prone to getting stuck in local optima, particularly when population diversity is insufficient, which can lead to incomplete coverage of the search space and hinder the comprehensiveness of testing and vulnerability discovery. Additionally, because the success of the evolutionary process depends heavily on the initial seed selection, variations in seed quality can cause fluctuations in testing efficiency and vulnerability discovery rates. Thus, while genetic algorithms possess strong global search capabilities, their high computational overhead and susceptibility to local optima are significant bottlenecks in practical applications.
To address these challenges, this paper proposes an innovative fuzz testing seed generation and optimization method that combines neural networks with genetic algorithms. The innovation of this method lies in predicting and evaluating the fitness of seeds using neural networks, thereby reducing dependence on large labeled datasets and improving the efficiency of test case generation. By accurately predicting seed fitness through neural networks, we can intelligently select and optimize seeds, thereby reducing the computational resources required by genetic algorithms. Furthermore, the multi-generation evolutionary mechanism of genetic algorithms further refines seed quality, overcoming the limitations of relying solely on slocal search. Experimental results demonstrate that our method not only improves seed coverage and vulnerability discovery capabilities but also significantly reduces computational overhead and data dependency, further enhancing the performance and efficiency of fuzz testing.

3. Methodology

The fuzz testing seed generation and optimization method proposed in this paper integrates the complementary strengths of neural networks and genetic algorithms to intelligently enhance the fuzzing process. The workflow of this method is illustrated in Figure 1 and primarily consists of three key steps. (1) employing a neural network model to evaluate the fitness of seeds, (2) applying genetic algorithm operations—specifically crossover and mutation—to optimize seeds and continuously generate new candidate inputs, and (3) executing the main genetic algorithm loop, in which seed fitness is assessed in each generation, high-quality seeds are selected, and successive generations are produced. The detailed implementation of each component is described below.
Figure 1. Flowchart showing workflow of the proposed fuzzing seed generation and optimization method based on neural networks and genetic algorithms, illustrating seed fitness evaluation, genetic evolution, and iterative feedback during fuzzing.

3.1. Neural Network Model

In traditional fuzz testing, seed generation relies on random selection or heuristic-based strategies, which often fail to effectively improve seed quality, particularly in terms of path coverage. To address this issue, we introduce a neural network model to evaluate seed fitness, thereby guiding the generation of seeds.
In the first step of our method, to construct the training dataset for the neural network, AFL-showmap is used to collect execution coverage information for each seed. Each seed is fed as input to the target program, producing a coverage report that indicates the paths exercised by that seed. These paths are then stored in a dictionary as the basis for further processing. Once the raw coverage data is obtained, the next step is to convert it into a binary matrix X i = [ x i 1 , x i 2 , … , x i j ] for subsequent use.
Among them:
x i j = { 1 , i f   s e e d   S i   c o v e r s   e d g e     e j 0 , o t h e r w i s e
This binary representation naturally normalizes the input data to the range [0, 1], eliminating the need for additional numerical scaling. Next, a neural network model is employed to evaluate the fitness of each seed. Fitness serves as a key criterion for selecting seeds in the genetic algorithm. In our experiments, a simple neural network model is defined, and through training, the network is able to assess seed quality based on its coverage paths.
The neural network consists of an input layer, a hidden layer, and an output layer, with the objective of minimizing the error between predicted and actual values during training. The input layer has n nodes, where each node represents the coverage status of a seed on a specific path. The input data is a vector x = [ x 1 , x 2 , … , x n ] T , where each x i represents whether path i is covered by the current seed (0 or 1).
The computation from the input layer to the hidden layer is given by:
z [ 1 ] = W [ 1 ] ⋅ x + b [ 1 ]
where W [ 1 ] is the weight matrix from the input layer to the hidden layer, of size m × n (where (m) is the number of nodes in the hidden layer and (n) is the number of nodes in the input layer), b [ 1 ] is the bias vector for the hidden layer, of size m × 1, z [ 1 ] is the input vector to the hidden layer, of size m × 1.
The output layer computes the final fitness value using a Sigmoid activation function, which compresses the value between 0 and 1 to represent the seed’s fitness (path coverage validity):
z [ 2 ] = W [ 2 ] ⋅ a [ 1 ] + b [ 2 ]
where W [ 2 ] is the weight matrix from the hidden layer to the output layer, of size 1 × m (since the output layer has only one node, the fitness value), b [ 2 ] is the bias term for the output layer, of size 1 × 1, z [ 2 ] is the output of the neural network, of size 1 × 1.
The elements of the weight matrices in the neural network are automatically learned through a data-driven training process. Each element in the weight matrix ultimately reflects the relative contribution of a specific input path feature to the fitness prediction in the hidden or output layers. Larger weight values indicate that the corresponding path feature has a more significant influence on the seed’s fitness evaluation in the current model.
By training this neural network model, we can evaluate the quality of each seed based on its coverage paths and use it as the fitness function in the genetic algorithm. This approach improves both the efficiency and quality of the seed generation process, providing a more intelligent and effective optimization solution for fuzz testing.

3.2. Genetic Algorithm

In this study, the genetic algorithm is used to optimize the quality of fuzz testing seeds, particularly in terms of coverage path diversity and efficiency. The core process of the genetic algorithm includes population initialization, parent selection, crossover operation, mutation operation, and fitness evaluation. In the initialization phase, a random selection of seeds is chosen as the initial individuals of the population. Then, each individual’s fitness value is evaluated based on the neural network model, and selection is performed based on fitness. Seeds with higher fitness have a greater probability of being selected as parents for the crossover operation.
The objective of the fitness function is to select seeds that cover more paths or more important paths. The fitness function of the model depends on the output of the neural network, where the output values represent the coverage of paths for each seed. By predicting the feature vector of the seed, the neural network provides a coverage probability for each path, which is then used to evaluate the seed’s fitness.
The form of the fitness function can be defined as:
F i t n e s s   ( S i ) = ∑ j = 1 n N N ( S i , j )
where S i is the coverage vector corresponding to the seed’s path, N N ( S i , j ) is the neural network’s predicted value for whether seed S i covers path j , with the output value between [0, 1], n is the total number of paths.
The crossover operation refers to randomly selecting portions of genes from two parent seeds and swapping them to generate two new individuals. The crossover point and gene selection strategy are determined by the algorithm design. In the mutation operation, small random changes are made to the genes of an individual to increase the diversity of the population and avoid local optima. The mutation operation is an important mechanism in the genetic algorithm, ensuring that the population continues to search and improving its global optimization ability.
In each generation, the genetic algorithm generates a new population through selection, crossover, and mutation operations, and evaluates the fitness of the new population using the neural network. High-fitness individuals will continue to evolve in the next generation, while low-fitness individuals will be eliminated, ensuring the survival of the fittest.

3.3. The Genetic Algorithm Loop

The main loop of the genetic algorithm is its core component, determining how the population continuously optimizes the quality of seeds through multiple generations of evolution. After collecting coverage information and training the neural network model, we apply the genetic algorithm to further optimize the fuzz testing seeds. The genetic algorithm simulates the process of natural evolution, gradually improving seed quality through iterative generations. The key steps include fitness evaluation, selection, crossover, and mutation operations.
As shown in Algorithm 1, a certain number of seeds are randomly selected from the initial seed set to form the initial population of the genetic algorithm. Then, in each iteration, the trained neural network model is used to evaluate the fitness of each seed in the population. The fitness value reflects the potential contribution of the seed in terms of path coverage and serves as the basis for subsequent selection operations. After obtaining the fitness evaluation results, the algorithm sorts the population by fitness and selects individuals with higher fitness as parent seeds. This selection strategy ensures that high-quality seeds are preserved during the evolution process while gradually eliminating seeds with weaker coverage.
The algorithm performs the crossover operation on the selected parent seeds, exchanging certain characteristics to generate new offspring seeds. Crossover helps combine the advantages of different parent seeds, producing new seeds with higher potential. To avoid premature convergence of the population and maintain the diversity of the search space, the algorithm introduces a mutation operation, which randomly perturbs the local features of the seeds with a certain probability. After crossover and mutation, the new offspring seeds form the next generation population. This process is repeated for a preset number of iterations, allowing the population to evolve towards better coverage capabilities. Finally, the algorithm outputs the optimized seed set after genetic evolution, which is used in subsequent fuzz testing.
Algorithm 1: Genetic Algorithm Loop
Input: seed_list, bitmap, model, generations, population_size, mutation_rate
Output: optimized_population

1. Initialize population by randomly selecting seeds from seed_list
2. for generation = 1 to generations do
3.    Evaluate fitness of each seed using the neural network model
4.    Sort population in descending order according to fitness values
5.    Select the top-ranked seeds as parent population
6.    Initialize an empty set new_population
7.    for each pair of parents do
8.      Generate offspring via crossover operation
9.      Apply mutation to offspring with probability mutation_rate
10.       Add offspring to new_population
11.  end for
12.  Replace population with new_population
13. end for
14. return population

4. Experimental Evaluation

4.1. Experimental Setup

This paper proposes an innovative fuzz testing method that combines neural networks with genetic algorithms and, based on the AFL and AFL++ fuzzing frameworks, develops and implements NNGAFL and NNGAFL++. Specifically, we use a neural network model to predict the coverage paths of seeds, and this prediction is used as the fitness function for the genetic algorithm. In this way, the genetic algorithm can optimize seeds using the intelligent evaluation provided by the neural network, thereby maximizing coverage and improving the effectiveness of the testing process.
In particular, the main goal of this experiment is to generate high-quality seeds based on AFL and AFL++ to support subsequent test execution and mutation operations. Through this enhanced fuzz testing framework, the seed generation process is no longer random but driven by an optimization process guided by the neural network, significantly improving the efficiency of fuzz testing and its vulnerability discovery capability.
Dataset. The proposed NNGAFL and NNGAFL++ were evaluated on nine open-source Linux applications, with detailed program information provided in Table 1. The reasons for selecting these applications are as follows: these programs have been widely used in numerous advanced fuzzing studies and often serve as benchmark programs for evaluating different fuzzing techniques, offering strong representativeness and comparative value; they are commonly deployed and used in Linux systems, making their security directly relevant to the stability and reliability of real-world systems, thus holding significant practical importance; additionally, these programs exhibit substantial diversity in input formats, functional characteristics, and source code size, ranging from relatively simple structures to complex logic, which facilitates a comprehensive assessment of the proposed method’s adaptability and generality across programs with varying complexity and input characteristics.
Table 1. Basic Information of the Tested Programs [36].
Initial Seed Set. We randomly selected files from the internet that meet the format requirements as the initial seed set, which was then used as input for AFL and AFL++. After running each program for one hour, the generated seed sets were used as input data for the neural network.
Experimental Environment. To fairly assess the performance of the experiments, all test programs were run under consistent computing resource configurations to ensure the repeatability of the experimental process and the comparability of the results. All experiments were conducted in a virtual machine environment running Ubuntu 20.04, with hardware configurations including an 8-core CPU and 14 GB of memory. Each test program was executed for three independent rounds, each lasting 24 h. The average results of the three rounds were taken as performance metrics to comprehensively evaluate the actual effectiveness of each tool.
The experimental procedure, taking AFL as an example, is as follows. First, files that meet the input format requirements of each target program were randomly selected from publicly available online sources to form the initial seed set. These seeds were used as inputs to AFL and executed for one hour to collect raw coverage information and generate the baseline seed data. The seeds obtained from this stage were then used as inputs for NNGAFL to conduct subsequent fuzz testing and seed optimization.
During the experiments, all fuzzing tools were run for the same duration of 24 h, with AFL’s default coverage collection mechanism enabled. Edge coverage was used as the primary evaluation metric. To reduce the influence of randomness and improve the reliability of the results, each program was tested in three independent rounds, and the reported results in Table 2 represent the average of these three runs.
Table 2. Comparison of edge coverage found after 24 h.

4.2. Experimental Results

This section evaluates the proposed adaptive sensitive area mutation algorithm by comparing it across three key aspects: target code coverage, exploration depth, and bug discovery capability.
Target Code Coverage: In the program, edges represent the transitions between basic blocks. This study uses edge coverage as a measure of code coverage and evaluates the new edges discovered by NNGAFL and AFL, as well as NNGAFL++ and AFL++, within the same execution time. The initial edge coverage data is provided in Table 1. The experimental results in Table 2 show that both NNGAFL and NNGAFL++ significantly outperform AFL and AFL++ in terms of edge coverage across the nine programs, with an average improvement of approximately 25%. Specifically, for the size and libxml programs, the improvement is the highest, reaching 40%. These programs’ higher improvements suggest that the neural network-driven genetic algorithm significantly enhances edge coverage, particularly in handling more complex programs, where it explores more paths and further increases the fuzz testing coverage.
For the harfbuzz program, although NNGAFL and NNGAFL++ show a high improvement of about 77%, the increment is relatively modest. This is due to the fact that the program has already uncovered a substantial number of paths, and the remaining undiscovered paths are relatively complex and difficult to explore. Therefore, despite the limited remaining coverage space, the neural network and genetic algorithm still demonstrate an advantage in edge coverage. For the objdump program, the edge coverage achieved was relatively low, which can be attributed to the low diversity and mutation rate of the initial seeds, leading to a reduced probability of generating high-quality seeds. This indicates that while NNGAFL and NNGAFL++ perform exceptionally well in other programs, the improvement potential is limited when the initial seeds are relatively homogeneous.
As shown in Figure 2, except for the size program, NNGAFL and NNGAFL++ achieve relatively high coverage in a short period for most programs, indicating that the seeds generated in the experiment already have high quality in the early stages. This result demonstrates that the neural network-guided genetic algorithm can effectively generate high-coverage seeds, especially in handling programs with higher complexity, enabling rapid exploration of new paths and enhancing fuzz testing efficiency. In the size program, although NNGAFL and NNGAFL++ show smaller increases in coverage at the beginning, the edge coverage increase significantly amplifies over time, indicating that the seeds generated in the experiment were continuously optimized during the mutation process. Specifically, the neural network-guided genetic algorithm consistently adjusts and refines the fitness of the seeds, making them more efficient in later stages of evolution.
Figure 2. Edge coverage of different fuzzers over a 24-h run.
The experimental results indicate that NNGAFL and NNGAFL++ outperform traditional fuzz testing methods in edge coverage across most application scenarios, especially when dealing with highly complex programs and diverse initial seeds. The high-quality seeds generated by combining neural networks and genetic algorithms significantly improve coverage efficiency. These results demonstrate the immense potential of neural networks and genetic algorithms in fuzz testing, providing a new approach to seed optimization and path coverage enhancement.
Exploration Depth: Depth refers to the generation of seeds in terms of their evolutionary generation. For example, the initial seed is the first generation with depth 1; seeds generated through mutation from the initial seed are the second generation, with depth 2, and so on. As noted by Michal Zalewski, “Deep seeds in fuzz testing are more likely to reveal vulnerabilities that traditional fuzz testers cannot” [2]. Additionally, because AFL only adds test cases that execute new paths to the seed pool, the maximum depth indirectly reflects the coverage of the target program. Therefore, we use the maximum depth as one of the evaluation criteria.
As shown in Figure 3, NNGAFL achieves deeper exploration across all programs compared to AFL. NNGAFL++ explores deeper depths than AFL++ in all programs except size. Overall, seeds generated by the neural network-guided genetic algorithm enable deeper exploration in fuzz testing, indicating that the combination of neural networks and genetic algorithms can effectively uncover more potential paths in the program and enhance vulnerability discovery capability.
Figure 3. Comparison of the Maximum Exploration Depth within the Same Time Period.
Bug Discovery Capability: LAVA-M [37], a corpus released by Brendan Dolan-Gavitt et al. in 2016, contains four programs—base64, md5sum, uniq, and who—each inserted with different numbers of bugs. This corpus has been used in several fuzz testing studies [14,15,34] as an experimental subject. To assess the bug discovery capability of this experiment, we performed 24-h testing using AFL, AFL++, NNGAFL, and NNGAFL++ on the LAVA-M corpus and recorded the number of bugs discovered by each fuzz testing tool. The statistical results are presented in Table 3.
Table 3. Comparison of the Number of Bugs Discovered in LAVA-M.
Upon analysis, we found that the bugs discovered by AFL and AFL++ were also successfully discovered by NNGAFL and NNGAFL++. Moreover, NNGAFL and NNGAFL++ uncovered additional bugs that were not detected by AFL and AFL++. To further demonstrate the superior efficiency of NNGAFL and NNGAFL++ in fuzz testing, we recorded the number of bugs discovered by each tool at different time intervals, as shown in Figure 4. Within the same testing duration, NNGAFL and NNGAFL++ identified significantly more bugs than AFL and AFL++. For some bugs, NNGAFL and NNGAFL++ were able to identify them in a shorter time. In the field of cybersecurity, early detection of vulnerabilities is crucial. By identifying anomalies early, the risk of malicious exploitation can be significantly reduced.
Figure 4. Comparison of the Number of Bugs Discovered Over Time.

5. Conclusions

To address the issues of low-quality initial seeds and the generation of a large number of invalid inputs during mutation, this paper proposes a neural-network-guided genetic algorithm for fuzzing seed optimization. The approach leverages a neural network model to predict the potential coverage capabilities of seeds and uses these predictions as a fitness function to guide the genetic algorithm in performing crossover and mutation, gradually generating high-quality test seeds. The optimized seeds were validated and evaluated using both AFL and AFL++ fuzzers. Experimental results demonstrate that, compared to traditional fuzzing methods, the neural-network-guided genetic algorithm significantly improves target code coverage, exploration depth, and vulnerability discovery capabilities. This method effectively enhances seed quality and reduces resource waste caused by ineffective mutations, thereby improving overall fuzzing efficiency.
Furthermore, the proposed approach is compatible with existing seed optimization research and exhibits strong generality and flexibility. It can be smoothly integrated into AFL-based fuzzing extensions to further enhance testing performance. Future work will focus on adapting and integrating this method into additional fuzzing frameworks, such as libFuzzer and honggfuzz, to combine the strengths of different fuzzers and further improve overall fuzzing effectiveness.
From a broader application perspective, the high-quality test seeds generated by this method have potential value in industrial software testing workflows. They can help increase testing efficiency, accelerate vulnerability exposure, and shorten testing cycles in continuous integration (CI) pipelines, thereby enhancing the overall efficiency of software development and security verification processes.

Author Contributions

The authors confirm contribution to the paper as follows: Conceptualization, Y.J. and Z.L.; methodology, Y.J.; software, Z.L.; validation, Y.J., Z.L., B.D. and T.F.; formal analysis, B.D.; investigation, Z.L.; resources, Y.J. and B.D.; data curation, Z.L.; writing—original draft preparation, Z.L.; writing—review and editing, Y.J. and B.D.; supervision, Y.J.; project administration, T.F.; funding acquisition, B.D. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Lanzhou University of Technology Doctoral Talent Research Start-up Fund Project (14/062402).

Institutional Review Board Statement

Not applicable.

Data Availability Statement

All data included in this study are available upon request by contact with the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
AFLAmerican Fuzzy Lop
AFL++American Fuzzy Lop Plus Plus
GAGenetic Algorithm
NNNeural Network
MLPMultilayer Perceptron
CNNConvolutional Neural Network
RNNRecurrent Neural Network
GANGenerative Adversarial Network

References

  1. 360 Digital Security Group. 2025 Annual Cybersecurity Vulnerability Analysis Report. 2026. Available online: https://pub1-bjyt.s3.360.cn/bcms/2025年度网络安全漏洞分析报告.pdf (accessed on 15 February 2026).
  2. Zalewski, M. American Fuzzy Lop (AFL) README. 2018. Available online: http://lcamtuf.coredump.cx/afl/README.txt (accessed on 1 December 2025).
  3. Zhu, X.; Wen, S.; Camtepe, S.; Xiang, Y. Fuzzing: A survey for roadmap. ACM Comput. Surv. 2022, 54, 1–36. [Google Scholar] [CrossRef] [Scilit]
  4. Clarke, L.A. A personal retrospective on symbolic execution. IEEE Trans. Softw. Eng. 2025, 51, 706–709. [Google Scholar] [CrossRef] [Scilit]
  5. Marashdih, A.W.; Zaaba, Z.F.; Suwais, K. An enhanced static taint analysis approach to detect input validation vulnerability. J. King Saud Univ.-Comput. Inf. Sci. 2023, 35, 682–701. [Google Scholar] [CrossRef] [Scilit]
  6. Google. LibFuzzer: A Library for Coverage-Guided Fuzz Testing. Available online: http://llvm.org/docs/LibFuzzer.html (accessed on 6 July 2025).
  7. Yan, S.; Wu, C.; Li, H.; Yin, W.; Ji, S. Pathafl: Path-coverage assisted fuzzing. In Proceedings of the 15th ACM Asia Conference on Computer and Communications Security; ACM: New York, NY, USA, 2020; pp. 598–609. [Google Scholar]
  8. Böhme, M.; Pham, V.-T.; Roychoudhury, A. Coverage-based greybox fuzzing as markov chain. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, Vienna, Austria, 24–28 October 2016; ACM: New York, NY, USA, 2016; pp. 1032–1043. [Google Scholar]
  9. Nagy, S.; Hicks, M. Full-speed fuzzing: Reducing fuzzing overhead through coverage-guided tracing. In Proceedings of the 2019 IEEE Symposium on Security and Privacy (SP), San Francisco, CA, USA, 20–22 May 2019; IEEE: Piscataway, NJ, USA, 2019; pp. 787–802. [Google Scholar]
  10. Zhu, X.; Feng, X.; Meng, X.; Wu, S.; Wen, S.; Camtepe, S.; Xiang, Y. CSI-Fuzz: Full-speed edge tracing using coverage sensitive instrumentation. IEEE Trans. Dependable Secure Comput. 2022, 19, 912–923. [Google Scholar] [CrossRef] [Scilit]
  11. Godefroid, P.; Singh, R.; Peleg, H. Machine Learning for Input Fuzzing. U.S. Patent 10,983,853, 20 April 2021. [Google Scholar]
  12. Rajpal, M.; Blum, W.; Singh, R. Not all bytes are equal: Neural byte sieve for fuzzing. arXiv 2017, arXiv:1711.04596. [Google Scholar] [CrossRef] [Scilit]
  13. Nichols, N.; Raugas, M.; Jasper, R.; Hilliard, N. Faster fuzzing: Reinitialization with deep neural models. arXiv 2017, arXiv:1711.02807. [Google Scholar] [CrossRef] [Scilit]
  14. Chen, P.; Chen, H. Angora: Efficient fuzzing by principled search. In 2018 IEEE Symposium on Security and Privacy (SP), San Francisco, CA, USA, 21–23 May 2018; IEEE: Piscataway, NJ, USA, 2018. [Google Scholar]
  15. She, D.; Pei, K.; Epstein, D.; Baig, J.; Ray, B.; Jana, S. Neuzz: Efficient fuzzing with neural program smoothing. In 2019 IEEE Symposium on Security and Privacy (SP), San Francisco, CA, USA, 20–22 May 2019; IEEE: Piscataway, NJ, USA, 2019. [Google Scholar]
  16. Lambora, A.; Gupta, K.; Chopra, K. Genetic algorithm—A literature review. In Proceedings of the 2019 International Conference on Machine Learning, Big Data, Cloud and Parallel Computing (COMITCon), Faridabad, India, 14–16 February 2019; IEEE: Piscataway, NJ, USA, 2019. [Google Scholar]
  17. Qu, S.; Zhang, Z.; Ma, B.; Shao, Y. Optimization method of web fuzzy test cases based on genetic algorithm. J. Phys. Conf. Ser. 2021, 2078, 012028. [Google Scholar] [CrossRef] [Scilit]
  18. Mehendran, Y.; Tang, M.; Lu, Y. Enhancing Software Vulnerability Detection Through Adaptive Test Input Generation Using Genetic Algorithm. arXiv 2025, arXiv:2508.05923. [Google Scholar] [CrossRef] [Scilit]
  19. Alshraideh, M.; Mahafzah, B.A.; Al-Sharaeh, S. A multiple-population genetic algorithm for branch coverage test data generation. Softw. Qual. J. 2011, 19, 489–513. [Google Scholar] [CrossRef] [Scilit]
  20. Shuai, B.; Li, M.; Li, H.; Zhang, Q.; Tang, C. Software vulnerability detection using genetic algorithm and dynamic taint analysis. In Proceedings of the 2013 3rd International Conference on Consumer Electronics, Communications and Networks, Xianning, China, 20–22 November 2013; IEEE: Piscataway, NJ, USA, 2013. [Google Scholar]
  21. Rami, A.L.; Fouad, M.M.; Zeki, M. Evolutionary optimization framework to train multilayer perceptrons for engineering applications. Math. Biosci. Eng. 2024, 21, 2970–2990. [Google Scholar] [CrossRef] [Scilit]
  22. Nemavhola, A.; Chibaya, C.; Viriri, S. A Systematic Review of CNN Architectures, Databases, Performance Metrics, and Applications in Face Recognition. Information 2025, 16, 107. [Google Scholar] [CrossRef] [Scilit]
  23. Ullah, H.; Muhammad, K.; Irfan, M.; Anwar, S.; Sajjad, M.; Imran, A.S.; de Albuquerque, V.H.C. Light-DehazeNet: A novel lightweight CNN architecture for single image dehazing. IEEE Trans. Image Process. 2021, 30, 8968–8982. [Google Scholar] [CrossRef] [Scilit]
  24. Jandera, A.; Muzelak, M.; Skovranek, T. RNN-Based F0 Estimation Method with Attention Mechanism. Information 2025, 16, 1089. [Google Scholar] [CrossRef] [Scilit]
  25. Rezk, N.M.; Nordström, T.; Ul-Abdin, Z. Shrink and eliminate: A study of post-training quantization and repeated operations elimination in RNN models. Information 2022, 13, 176. [Google Scholar] [CrossRef] [Scilit]
  26. Saghaian, S.E.; Hemmati, M.; Hasan, S.M. Machine-learning framework for predicting process-property relationships in additively manufactured NiTi shape memory alloys. Int. J. Adv. Manuf. Technol. 2026; in press. [CrossRef] [Scilit]
  27. Zhu, S.; Wang, J.; Sun, J.; Yang, J.; Lin, X.; Wang, T. Better pay attention whilst fuzzing. IEEE Trans. Softw. Eng. 2023, 50, 190–208. [Google Scholar] [CrossRef] [Scilit]
  28. Zong, P.; Lv, T.; Wang, D.; Deng, Z.; Liang, B.; Chen, K. {FuzzGuard}: Filtering out unreachable inputs in directed grey-box fuzzing through deep learning. In Proceedings of the 29th USENIX Security Symposium (USENIX Security 20), Boston, MA, USA, 12–14 August 2020; USENIX Association: Boston, MA, USA, 2020. [Google Scholar]
  29. Xu, H.; Wang, Y.; Jiang, Z.; Fan, S.; Fu, S.; Xie, P. Fuzzing JavaScript engines with a syntax-aware neural program model. Comput. Secur. 2024, 144, 103947. [Google Scholar] [CrossRef] [Scilit]
  30. Wang, Y.; Jia, X.; Liu, Y.; Zeng, K.; Bao, T.; Wu, D.; Su, P. Neufuzz: Efficient fuzzing with deep neural network. IEEE Access 2019, 7, 36340–36352. [Google Scholar] [CrossRef] [Scilit]
  31. Pargas, R.P.; Harrold, M.J.; Peck, R.R. Test-data generation using genetic algorithms. Softw. Test. Verif. Reliab. 1999, 9, 263–282. [Google Scholar] [CrossRef] [Scilit]
  32. Jones, B.F.; Eyres, D.E.; Sthamer, H.-H. A strategy for using genetic algorithms to automate branch and fault-based testing. Comput. J. 1998, 41, 98–107. [Google Scholar] [CrossRef] [Scilit]
  33. Rawat, S.; Jain, V.; Kumar, A.; Cojocar, L.; Giuffrida, C.; Bos, H. Vuzzer: Application-aware evolutionary fuzzing. In Proceedings of the 2017 Network and Distributed System Security (NDSS) Symposium, San Diego, CA, USA, 26 February–1 March 2017; Internet Society: San Diego, CA, USA, 2017. [Google Scholar]
  34. Zhou, X.; Hu, Y. Fuzzing method based on path risk fitness. Commun. Technol. 2022, 55, 500–505. [Google Scholar]
  35. Wu, Z.; Atwood, J.W.; Zhu, X. A new fuzzing technique for software vulnerability mining. In Proceedings of the IEEE CONSEG 9, Xiamen, China, 11–14 October 2009; IEEE: Piscataway, NJ, USA, 2009. [Google Scholar]
  36. She, D.; Castro, R.S.; Ren, Y.; Jana, S. MTFuzz: Fuzzing with a multi-task neural network. In Proceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, Virtual Event, 8–13 November 2020; ACM: New York, NY, USA, 2020. [Google Scholar]
  37. Dolan-Gavitt, B.; Hulin, P.; Kirda, E.; Leek, T.; Mambretti, A.; Robertson, W.; Wilkes, F.; Zeldovich, N. Lava: Large-scale automated vulnerability addition. In Proceedings of the 2016 IEEE Symposium on Security and Privacy (SP), San Jose, CA, USA, 23–25 May 2016; IEEE: Piscataway, NJ, USA, 2016. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.