A deep neural network attack generation method based on migration optimization
By calculating the similarity of the source tasks and adaptively adjusting the degree of transfer, and combining crossover mutation and knowledge transfer to optimize deep neural network attacks, the problem of imbalance between exploration and utilization in the source task space of transfer optimization algorithms is solved, and faster and more efficient attack generation is achieved.
Patent Information
- Application Number
- CN202311729742.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-15
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-12-15
AI Technical Summary
Existing transfer optimization algorithms suffer from insufficient exploration of the source task space, inadequate utilization of already explored tasks, and difficulty in achieving a balance between exploration and utilization in deep neural network attack generation, resulting in low optimization efficiency.
By calculating the similarity between source tasks in the knowledge base, the degree of transfer is adaptively adjusted, and crossover mutation and knowledge transfer are used alternately during the optimization process to achieve effective exploration and utilization of the source task space, and the target task is optimized by adopting an adaptive degree of transfer.
It improves the convergence speed and convergence level of deep neural network attack generation, reduces unnecessary redundant optimization and resource waste, and enhances optimization efficiency in time-sensitive scenarios.
Smart Images

Figure CN117910546B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent optimization technology and relates to a method for generating deep neural network attacks based on transfer optimization. Background Technology
[0002] With the advancement of science and technology, artificial intelligence (AI) has achieved tremendous breakthroughs and gained widespread attention. However, this has also brought some challenges, primarily concerning AI security. Deep neural networks, as one of the technologies in AI, have achieved excellent results in some challenging tasks, but research shows that these strategies are easily fooled by adversarial attacks. For reinforcement learning strategies based on neural networks, adversarial attacks refer to the application of imperceptible non-random noise to observations, which can arbitrarily alter the network's predictions. This places higher demands on the robustness of deep neural networks. Furthermore, it raises concerns about the security of AI based on deep neural networks, as such attacks can bypass security defense systems, affecting the robustness and credibility of AI systems, thus imposing even more stringent requirements on the robustness of deep neural networks. In addition, attacks can verify the security and stability of deep neural networks, which is crucial for protecting the stability of deep neural network models and related systems. Complex application environments place higher demands on the accuracy of attack design. For example, in scenarios where a deep reinforcement learning-based agent plays Atari games, the short frame times leave limited time for attack generation. Therefore, how to generate the most suitable adversarial attack model under specific constraints for specific use cases is a problem worthy of research.
[0003] The deep neural network attack generation problem is a typical optimization problem. Specifically, a trained deep reinforcement learning-based agent generates an action probability distribution for a given input, and then selects the action with the highest probability. The purpose of the attack is to induce the agent to make a misjudgment by adding small, imperceptible noise to the input. By comparing the convergence speed of different noise additions in solving the task, the optimal design under the given constraints can be found, which is the solution to the task. Currently, evolutionary algorithms (EAs) have become a popular tool for solving complex problems in many fields and have been successfully applied to the generation of adversarial attacks. Compared to traditional optimization methods, the flexibility and adaptability of evolutionary algorithms make them a powerful tool for solving complex real-world problems. In attack problems, the large number of tasks, diverse task characteristics, and tight time constraints place higher demands on task-solving capabilities and optimization efficiency. Solving these problems requires not only considering the complexity and diversity of the tasks but also facing the challenge of finding the optimal solution within a limited time. When facing similar / identical tasks in deep neural network attack scenarios, evolutionary algorithms optimize the task through random exploration, and optimizing the target task from scratch consumes a significant amount of time and computational resources.
[0004] Transfer optimization is a novel optimization paradigm built upon traditional single-task optimization algorithms. In transfer optimization, previously solved tasks in the knowledge base are called source tasks, while the task being optimized is the target task. It aims to transfer knowledge acquired from source tasks to the current target task, effectively accelerating the current optimization process through knowledge transfer. Traditional evolutionary algorithms suffer from slow startup, slow convergence, and low convergence levels, primarily due to a lack of prior knowledge about the task. Specifically, in certain application scenarios, even when faced with similar or identical tasks, the algorithm may still start optimizing from scratch, leading to unnecessary duplication and resource waste. If the algorithm can extract useful knowledge from similar source tasks and apply it to the current target task, it can significantly accelerate the optimization efficiency of the current task. Therefore, transfer optimization, which combines knowledge transfer with evolutionary optimization, becomes an effective means to accelerate task optimization.
[0005] The core idea of applying knowledge transfer to deep neural network attack generation is to leverage knowledge from similar tasks in the knowledge base when optimizing the current attack task, thereby improving the convergence speed and convergence level on the current task. By utilizing acquired knowledge or experience, the algorithm can more intelligently guide the search process, discovering and approximating the optimal solution faster. This method helps avoid unnecessary repeated optimizations, maximizes the use of information from previous tasks, and improves the algorithm's startup speed and convergence efficiency. This transfer optimization method provides strong support for improving the performance of evolutionary algorithms in handling real-world tasks, bringing new possibilities for progress and innovation in the field of optimization algorithms.
[0006] Existing transfer optimization algorithms include: knowledge transfer methods based on probabilistic models, such as the Adaptive Transfer Evolution Algorithm (AMTEA) and the Scalable Adaptive Transfer Evolution Algorithm (Sc-AMTEA); and knowledge transfer methods based on non-probabilistic models, such as methods based on direction vectors and de-injection. In deep neural network attack generation problems, source tasks highly similar to the target task can be found from existing knowledge bases, which is highly beneficial for knowledge transfer and fits well with the application conditions of transfer optimization algorithms. However, if current algorithms are directly applied to such scenarios, they still have the following shortcomings:
[0007] (1) Limited exploration of the source task space. Faced with a large number of source tasks, current algorithms can only select a small number of source tasks as transfer sources. This makes it impossible to utilize other potentially available effective knowledge in the source tasks and makes it difficult to fully transfer the knowledge. In the deep neural network attack generation problem, the algorithm faces a massive amount of completed historical optimization tasks stored in the knowledge base, which requires the algorithm to explore the source task space more fully.
[0008] (2) Insufficient utilization of explored source tasks. Some current transfer optimization algorithms, although they may find some effective transfer sources during the optimization process, do not utilize these transfer sources in subsequent processes. Instead, they start from scratch to measure the relationship between the target task and the source tasks. This leads to insufficient utilization of already learned knowledge and high time costs, especially when the source task space is particularly large.
[0009] (3) It is difficult to achieve a balance between exploration and utilization in the source task space. Current transfer optimization algorithms are either good at exploration or good at utilization. However, an excellent transfer optimization algorithm needs to maintain a balance between exploration and utilization in the source task space in order to fully learn and utilize the potential available knowledge in the source task, thereby showing better optimization performance. Summary of the Invention
[0010] To address the shortcomings of current algorithms in the source task space, this invention proposes a deep neural network attack generation method based on transfer optimization, with the following specific improvements:
[0011] This method reflects the selection of the transfer source by the degree of knowledge transfer. In this respect, this invention is not limited to the way other transfer optimization algorithms adaptively adjust the degree of transfer during iteration. Instead, it calculates the similarity between source tasks based on task characteristics at the beginning of optimization, and further adjusts the degree of transfer for each task based on the similarity between tasks in subsequent optimizations. Based on this, this invention is roughly divided into three stages:
[0012] (1) Similarity Calculation: Calculating the similarity between source tasks in the knowledge base is necessary for this method before optimizing the target task. In the knowledge base, all source tasks have been successfully optimized, and optimal candidate solutions are retained. These candidate solutions represent the noise required to achieve a successful attack on a specific task. The centroids of these candidate solutions represent each task, and the Euclidean distance between tasks is calculated, which serves as a representation of the similarity between tasks. In this method, the solution of a task represents the optimal noise applied to achieve a successful attack on that task. The solution stored for each task is the best solution so far in the exploration process. Similar tasks inevitably contain a lot of the same knowledge, while the non-identical nature of the two determines that there are certain differences in the knowledge they contain.
[0013] (2) Adaptive Transfer Degree: Knowledge transfer is performed in stages during the optimization of the target task. Initially, due to the lack of prior knowledge between the current target task and the source tasks, the transfer source is randomly selected from the source task space. Subsequently, the degree of knowledge transfer from the selected task to the target task is determined by the performance of the knowledge transferred to the target task on the target task. By adaptively adjusting the transfer coefficients of each source task in each iteration, the similarity between the target task and the source tasks is avoided every time, thus avoiding high time costs. At the same time, this method makes good use of the source tasks that have been identified before this iteration. The previously determined transfer degree can be retained without hesitation, and the transfer degree only needs to be adjusted according to the results of this knowledge transfer. Therefore, it performs well in the utilization of the source task space and can generate effective knowledge transfer.
[0014] (3) Fine-tuning of transferability: Over-utilizing a particular source task does not significantly improve the optimization of the current task. Therefore, after adaptively adjusting the transferability, this method further fine-tunes the transferability based on the similarity between source tasks. Specifically, when the transferability of a task is too high, a portion of its transferability is allocated to similar but untried source tasks, thereby enhancing the method's exploration in the source task space. Thus, this method achieves a balance between exploration and utilization in the source task space.
[0015] In this invention, a traditional optimization algorithm (evolutionary algorithm) is used as the basic solver to solve the target task. By alternating between the evolutionary algorithm and the knowledge transfer method proposed in this invention, the target task can be converged faster and better.
[0016] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0017] A deep neural network attack generation method based on transfer optimization, the specific steps of which are as follows:
[0018] Step 1: Define the problem model, determine the task objective and fitness function.
[0019] 1.1) In a standard deep reinforcement learning scenario, at time step t, the agent determines the environmental state s based on the observed environmental state. t Generate an action probability distribution and take an action a t and obtain rewards from the environment. t Deep neural network attacks refer to attacks on the environmental state s observed by an agent. t Add a certain amount of noise δ t This can cause the agent to make incorrect actions. However, the states observed by a reinforcement learning agent are typically different for different environments, meaning the amount of noise that can be added is limited. Furthermore, the environment is constantly changing, and the time a state remains in a given environment is usually very short, limiting the time available for algorithm optimization. Based on this reality, a transfer optimization problem is designed: a knowledge base stores solved source tasks and their corresponding optimal noise, with each task uniquely determined by the environmental states observed by the agent. For the current target task, by continuously adjusting the position and intensity of the noise, a successful deep neural network attack is achieved, ultimately causing the trained deep reinforcement learning agent to make incorrect actions.
[0020] 1.2) Therefore, it can be concluded that the goal of deep neural network attacks is to maximize the difference between actions before and after the attack, as specifically stated below:
[0021]
[0022] Where, δ tThis indicates the initial state s at time step t. t The added perturbation is also the solution to the current task. In this case, o and e represent the actions taken by the trained agent before and after the attack, respectively. π(·|s t ) e The probability distribution of the agent's actions is represented by π(·|s t The probability of choosing action e when π(·|s) is given. t ) represents when the agent observes state s t When this happens, the probability distribution of all candidate actions will be generated, which can be described as follows:
[0023]
[0024] in, Indicates the agent's choice of action The probability is determined by the agent based on the environmental state s. t The sum of the probabilities of all candidate actions is 1.
[0025] It is worth noting that when the function value f in formula (1) is greater than 0, the attack is successful, indicating that the agent has been deceived and has taken different actions. The following discussion will focus on optimizing formula (1).
[0026] Step 2: Calculate the similarity between source tasks in the knowledge base.
[0027] 2.1) Task Representation
[0028] The purpose of this step is to represent the optimized source tasks stored in the knowledge base for similarity calculation. The knowledge in the knowledge base comes from the optimal candidate solutions of each source task, which can be used to add noise for a successful attack. The candidate solutions of the source tasks are labeled with centroids C, C = (c1, c2, ..., c...). i c d ), where d represents the dimension of the candidate solution, c i Let represent the average value of all candidate solutions for the corresponding task in the i-th dimension, as shown in the following formula:
[0029]
[0030] Where, elite represents the set of all candidate solutions to the source task; i represents the i-th dimension, j represents the j-th candidate solution in elite; N represents the number of candidate solutions in elite.
[0031] 2.2) Similarity Calculation
[0032] Euclidean distance is a distance function defined between two vectors and is suitable for scenarios with continuous variables. This method uses Euclidean distance to calculate the distance between two source tasks:
[0033]
[0034] in, and Let and represent the centroids of the s1-th and s2-th source tasks, respectively. The closer the centroids are to each other, the greater the relevance of the tasks. Therefore, the similarity between any two different source tasks is defined as follows:
[0035]
[0036] Step 3: Initialize the population
[0037] The dimension 'd' of the candidate solutions is determined based on the specific task. N candidate solutions for the current target task are generated randomly, essentially adding noise to the environmental state. The size of N is determined by an external input, and the set of N candidate solutions is called the population. The initial population is generated randomly, and subsequent populations evolve to produce candidate solutions capable of achieving a successful attack.
[0038] Step 4, Evolutionary Process
[0039] After initialization, the population undergoes a series of iterations. The maximum number of iterations, `max_gen`, is an external input that controls the total number of iterations for the entire population. When the current iteration number `gen` is odd, new candidate solutions are generated through crossover and mutation; when `gen` is even, new candidate solutions are generated through knowledge transfer. These two methods alternate, continuously optimizing the candidate solutions for the task until the preset number of iterations, `max_gen`, is reached.
[0040] Step 5: Evaluate candidate solutions
[0041] The newly generated N candidate solutions are evaluated using formula (1). The evaluation results determine whether the candidate solution can achieve a successful attack, and serve as the basis for subsequent selection.
[0042] Step 6: Select the next generation of candidate solutions
[0043] After the newly generated candidate solutions are evaluated using formula (1), if their performance is better than the original candidate solutions, they are replaced; otherwise, they are discarded. Through this selection process, candidate solutions with poor performance are eliminated, while those with better performance are retained.
[0044] Step 7: Output the optimized solution
[0045] When the preset number of iterations is completed, the population retains the N best-performing candidate solutions that can achieve a successful attack.
[0046] Furthermore, in step 4, the process of generating new candidate solutions through crossover mutation is as follows:
[0047] In the existing population, every two candidate solutions generate new candidate solutions through crossover and mutation operations, which promotes the convergence of the target task: the crossover operation is the process of recombining and redistributing the information of two candidate solutions to generate new candidate solutions; the mutation operation is the process of changing some information in a single candidate solution to promote the diversification of candidate solutions; the final number of new candidate solutions generated is N.
[0048] Furthermore, in step 4, the process of generating new candidate solutions through knowledge transfer is as follows:
[0049] 1) Adaptive migration degree
[0050] Adversarial attacks optimize current candidate solutions by learning knowledge from already solved attack tasks in a knowledge base, thereby completing the attack. This process is called the knowledge transfer process in deep neural network attacks; the formula is as follows:
[0051]
[0052] in, p represents the optimal probability distribution model constructed from the optimal candidate solution set elite for K-1 source tasks; K (x) represents the probability distribution model of the current population composition of the target task; the K-1 source tasks and the target task in formula (6) will all serve as the transfer sources in knowledge transfer, thus allowing the transfer of knowledge to be carried out. and p K (x) is abbreviated as p ts (x). w1, ..., w K-1 w K Represents a probabilistic mixture model The transfer coefficient represents the degree of knowledge transfer from each completed adversarial attack task.
[0053] Determining the degree of transferability is crucial, as it determines the effectiveness of knowledge transfer. The degree of transferability is highly dependent on the similarity between tasks, but there is no sufficiently good metric to measure task similarity. This method first employs an adaptive approach to adjust the degree of transferability: an initial degree of transferability is randomly assigned, then a transfer source is randomly selected for knowledge transfer. The effectiveness of the transfer determines the magnitude of the degree of transferability, thus achieving adaptive adjustment of the degree of transferability.
[0054] Specifically, suppose that in a certain knowledge transfer process, a candidate solution x is obtained from the transfer source ts. ts Then, formula (1) is used to evaluate the candidate solutions x. ts The function is evaluated, and the value is f(x). tsThe vector Y is used to record the function value of each knowledge transfer result, specifically y′. ts =y ts +f(x ts To better capture the relationship between the source and target tasks, maximum absolute scaling and the softmax function will be applied to the above results:
[0055] y″ ts =y′ ts / max(y′1:y′ K (7)
[0056]
[0057] Where K is the total number of source and target tasks. The hyperparameter λ is an external input that affects the contrast between the transfer sources. Subsequently, the adaptive transfer degree w′ ts By y″′ ts And the degree of migration of the old w ts Calculate and obtain:
[0058] w′ ts = (1-η)×w ts +η×y ts (9)
[0059] The learning rate η ranges from 0 to 1, determining the degree of new transfer w′. ts The update step size. To support the scalability of the method and adapt to scenarios with large-scale migration sources, excessively low migration levels will be ignored. Meanwhile, to ensure that the sum of migration levels is 1, summation normalization will be applied to the migration level vector at the end.
[0060] 2) Adjustment of migration degree
[0061] The migration degree vector adaptively generated in the above steps is iterated through, and the migration degree is readjusted. If the migration degree from a specific migration source ts is greater than a preset threshold ε, the migration degree value is adjusted to ε, and extra is defined as the portion higher than ε. When the migration source ts is a source task, extra is redistributed using the similarity from step 2 and the migration degree from step 1). Specifically, the similarity between source tasks in step 2 can identify tasks similar to the current migration source ts, and the migration degree of each migration source in step 1) can identify migration sources with a migration degree of zero, i.e., migration sources that have never been explored. Finally, extra is assigned to migration sources similar to the current migration source ts but that have never been explored. When the migration source ts is the target task, extra is assigned to a random migration source. By readjusting the migration degree, the exploratory nature of the method in the source task space is enhanced, making it more likely to discover potentially usable knowledge and promote effective knowledge transfer.
[0062] 3) Sampling candidate solutions
[0063] After determining the extent of knowledge transfer from each source, the probability distribution model p from the transfer sources is used. ts Candidate solutions are sampled from (x). The total number of samples is equal to N.
[0064] The beneficial effects of this invention are as follows: This invention employs a novel optimization method in the processing of deep neural network attack generation tasks. First, it calculates the similarity between completed attack tasks in the knowledge base to increase knowledge exchange between similar tasks in the future. In the subsequent knowledge transfer process, it adaptively determines the degree of knowledge transfer from each task, fully utilizing the source tasks already located in the source task space. Then, it uses the calculated similarity to readjust the adaptively generated transfer degree, causing the transfer degree to favor tasks that have never been attempted before, thus enhancing the exploratory nature of the source task space. This achieves a balance between exploration and utilization in the source task space, promoting effective knowledge transfer and ensuring that the selected solution is as optimal as possible. Attached Figure Description
[0065] Figure 1 This is a flowchart illustrating the framework of the present invention.
[0066] Figure 2(a) is a schematic diagram of an attack using deep reinforcement learning.
[0067] Figure 2(b) shows the attack model of the deep neural network of Atari game used in this invention.
[0068] Figure 3(a) is a schematic diagram of migration optimization failure or no optimization.
[0069] Figure 3(b) is a schematic diagram of successful migration optimization. Specific implementation examples:
[0070] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings and technical solutions.
[0071] The method of this invention can be used to achieve successful deep neural network attacks. The method flow of this invention is as follows: Figure 1 As shown.
[0072] Figures 2(a) and 2(b) illustrate the attack diagram of deep reinforcement learning and the Atari game frame diagram used in this invention. The agent based on deep reinforcement learning takes the Atari game frame as input, performs actions, and obtains rewards. The deep neural network attack adds noise to the game frame, thus affecting the above process. Figures 3(a) and 3(b) illustrate the optimization failure and optimization success in this Atari game. In this Atari game scenario, the agent can perform three actions: "move left," "move right," and "fire," obtaining rewards, i.e., points, by destroying enemy ships. Figure 3(a) shows the normal situation of optimization failure (unoptimized); a well-trained agent will choose to fire to destroy enemy ships in front of it to obtain points. Figure 3(b) shows the scenario of successful optimization; noise is added in front of the agent, causing it to mistakenly believe there are enemy missiles ahead and choose to avoid them, resulting in no points being awarded.
[0073] The embodiments of the present invention will be described in detail below (e.g. Figure 1 As shown), the specific steps include:
[0074] (1) Establish Atari game model and objective function: Determine the scenario of an agent playing an Atari game based on deep reinforcement learning as the attack environment. The goal of the attack is to make the agent make incorrect judgments.
[0075] (2) Initialization process: For this deep neural network attack scenario, the first generation population is randomly generated.
[0076] (3) Similarity calculation: Calculate the similarity between source tasks in the knowledge base based on the optimal population of source tasks and store it in the similarity matrix.
[0077] (4) Evolution process: The evolution of candidate solutions requires repeated iterative processes. When the number of iterations is odd, the migration condition is not met, and new candidate solutions are generated through the traditional crossover mutation in step (5); when the number of iterations is even, the migration condition is met, and new candidate solutions are generated through the knowledge transfer process in steps (6) to (8).
[0078] (5) Crossover mutation: New candidate solutions are generated through crossover mutation of evolutionary algorithms.
[0079] (6) Adaptive migration degree: The migration degree of each task is dynamically adjusted in an adaptive manner to generate a migration degree vector.
[0080] (7) Transfer degree readjustment: Fine-tune the transfer degree vector and assign the excessively high transfer degree to similar but never explored tasks based on the similarity matrix generated in step (3).
[0081] (8) Sample candidate solutions: new candidate solutions are obtained by sampling from each migration source based on the adjusted migration degree vector.
[0082] (9) Candidate solution evaluation: The candidate solutions obtained in the above process are evaluated on the objective function of the target attack task.
[0083] (10) Select the next generation of candidate solutions: merge the old candidate solutions and the new candidate solutions, and select the next generation of population to enter the next cycle.
[0084] (11) Output the optimized solution: When the loop condition is not met, that is, when the loop reaches the preset number of times, a solution that performs well on the current target task is obtained, that is, a successful attack can be achieved on the target task. The final output is the deep neural network attack solution after transfer optimization.
Claims
1. A method for generating deep neural network attacks based on transfer optimization, characterized in that the method includes the following steps: Step 1: Define the problem model, determine the task objective and fitness function. 1.1) In a standard deep reinforcement learning scenario, at time step At that time, the agent uses Atari game frames as input, and the agent adjusts its actions based on the observed environmental state. Generate action probability distribution and take action. and get rewards from the environment. Deep neural network attacks target the environmental state observed by the agent. Add noise The goal is to induce the agent to make incorrect actions. A transfer optimization problem is designed: the knowledge base stores solved source tasks and corresponding optimal noise, and each task is uniquely determined by the environmental state observed by the agent. For the current target task, by continuously adjusting the position and degree of the noise, a successful deep neural network attack is finally achieved, causing the trained deep reinforcement learning-based agent to make incorrect actions. 1.2) The goal of deep neural network attacks is to maximize the difference in actions before and after the attack, specifically as follows: (1) in, Indicates the time step relative to the original state The added noise also serves as a solution to the current task; in this case, and These represent the actions taken by the trained agent before and after the attack, respectively. The probability distribution of the agent's actions is: Choose action The probability of; This represents when the agent observes the state. When this happens, a probability distribution of all candidate actions will be generated; When the function value in formula (1) When the value is greater than 0, the attack is successful, indicating that the agent has been deceived and has taken different actions. Step 2: Calculate the similarity between source tasks in the knowledge base. 2.1) Task Representation The knowledge in the knowledge base comes from the optimal candidate solutions of each source task, i.e., the noise added to achieve a successful attack; the candidate solutions of the source tasks are marked as centroids. , ,in Indicates the dimension of the candidate solution. This indicates that all candidate solutions for the corresponding task are in the th order. The average value of each dimension is calculated using the following formula: (2) in, This represents the set of all candidate solutions to the source task; Indicates the first dimension, express The first in There are 10 candidate solutions; express The number of candidate solutions; 2.2) Similarity Calculation Use Euclidean distance to calculate the distance between two source tasks: (3) in, and They represent the first Individual source task and the first The centroids of each source task are considered; the closer the centroids are to each other, the greater the relevance of the tasks. Therefore, the similarity between any two different source tasks is defined as follows: (4) Step 3: Initialize the population Determine the dimensions of candidate solutions based on the specific task. ; generated in a random manner A candidate solution for the current objective task, i.e., noise added to the environmental state; The size is determined by external input. The set of candidate solutions is called the population; the initial population is generated randomly, and subsequent populations evolve to generate candidate solutions that can achieve a successful attack. Step 4, Evolutionary Process After population initialization, a series of iterations are required; the current iteration number is... When the number is odd, new candidate solutions are generated through crossover mutation; when When the number of iterations is even, new candidate solutions are generated through knowledge transfer; the two methods are alternated to continuously optimize the candidate solutions for the task until the preset number of iterations is reached. ; Step 5: Evaluate candidate solutions Newly generated Each candidate solution is evaluated using formula (1); Step 6: Select the next generation of candidate solutions After the newly generated candidate solution is evaluated on formula (1), if it performs better than the original candidate solution, it is replaced; otherwise, it is discarded. Step 7: Output the optimized solution When the preset number of iterations is completed, the best-performing cells are retained in the population. A candidate solution that can achieve a successful attack.
2. The deep neural network attack generation method based on transfer optimization according to claim 1, characterized in that, in step 4, the process of generating new candidate solutions through crossover mutation is as follows: In the existing population, every two candidate solutions generate new candidate solutions through crossover and mutation operations, prompting the target task to converge continuously: the crossover operation recombines and redistributes the information from two candidate solutions to generate new candidate solutions; the mutation operation alters some information in a single candidate solution, promoting the diversification of candidate solutions; the final number of new candidate solutions generated is... .
3. A deep neural network attack generation method based on transfer optimization according to claim 1 or 2, characterized in that, In step 4, the process of generating new candidate solutions through knowledge transfer is as follows: 1) Adaptive migration degree Adversarial attacks optimize current candidate solutions by learning knowledge from solved attack tasks in a knowledge base, thereby completing the attack. This process is called the knowledge transfer process of deep neural network attacks; the formula is as follows: (5) (5) in, express Each source task is composed of an optimal candidate solution set. The optimal probability distribution model was constructed; This represents the probability distribution model of the current population composition for the target task; in formula (5) Both the source task and the target task will serve as transfer sources in knowledge transfer, therefore... and Abbreviated as ; Represents a probabilistic mixture model The transfer coefficient represents the degree of knowledge transfer from each completed adversarial attack task; An adaptive approach is used to adjust the degree of transfer: the initial degree of transfer is randomly assigned, then a transfer source is randomly selected for knowledge transfer, and the effect of the transfer determines the degree of transfer, thus achieving self-adaptation of the degree of transfer; 2) Adjustment of migration degree Iterate through the migration vectors adaptively generated in the above steps and readjust the migration level; if from a specific migration source The migration level in the data is greater than a preset threshold. Then correct the migration degree value. ,definition For higher than Part of; When the migration source When it is a source task, Reassignment is achieved by leveraging the similarity from step 2 and the degree of migration from step 1); when the migration source When it is the target task, They are assigned to random migration sources; 3) Sampling candidate solutions After determining the extent of knowledge transfer from each source, a probability distribution model from the transfer sources is used. The total number of sampled candidate solutions is equal to .
4. The deep neural network attack generation method based on transfer optimization according to claim 3, characterized in that, During the migration degree readjustment process, when the migration source When it is a source task, the similarity between the source tasks in step 2 is used to determine the current migration source. A similar task is to identify migration sources with a migration degree of zero (i.e., migration sources that have never been explored) by analyzing the migration degree of each migration source in step 1); ultimately... Assigned to the current migration source Similar but never-before-explored migration sources.
5. A method for generating deep neural network attacks based on transfer optimization according to claim 1, 2, or 4, characterized in that, In step 1.2), The description is as follows: (6) in, Indicates the agent's choice of action The probability is determined by the agent based on the environmental state. The sum of the probabilities of all candidate actions is 1.
6. The deep neural network attack generation method based on transfer optimization according to claim 3, characterized in that, In step 1.2), The description is as follows: (6) in, Indicates the agent's choice of action The probability is determined by the agent based on the environmental state. The sum of the probabilities of all candidate actions is 1.
