Integrated adversarial attack driven model robustness improvement method

By integrating adversarial attack algorithms and dynamic knowledge distillation technology, the robustness of the deep learning model is improved, which solves the problem of insufficient defense capabilities of the model against unknown attack strategies and reduced standard accuracy during adversarial training, and achieves higher comprehensive accuracy.

CN118734931APending Publication Date: 2024-10-01TONGJI UNIV
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410859479.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Deep learning models are vulnerable to adversarial attacks. Existing adversarial training methods rely on specific attack algorithms, resulting in insufficient defense capabilities of the model against unknown attack strategies, and compromising standard accuracy when improving robustness.

Method used

By obtaining natural samples, using different adversarial attack algorithms to generate adversarial samples, calculating the similarity between adversarial samples and attack algorithms, constructing an integrated adversarial attack algorithm set that integrates white-box and black-box attacks, and using the maximum loss strategy to construct an adversarial loss function. Iterative training improves model robustness.

Benefits of technology

The model achieves more comprehensive coverage of unknown attacks and enhances robustness. At the same time, the comprehensive accuracy of natural samples and adversarial samples is improved, effectively solving the problem of reduced standard accuracy in adversarial training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118734931A_ABST
    Figure CN118734931A_ABST
Patent Text Reader

Abstract

The invention relates to an integrated adversarial attack driven model robustness improvement method, which comprises the following steps: acquiring natural samples, generating adversarial samples by adopting different adversarial attack algorithms, calculating the similarity between the adversarial samples, and further calculating the similarity between the adversarial attack algorithms; according to the similarity between the adversarial attack algorithms, constructing an integrated adversarial attack algorithm set fusing white box attacks and black box attacks by adopting a diversity priority integration strategy; and based on the integrated adversarial attack algorithm set, carrying out adversarial training by adopting an integrated attack algorithm, constructing an adversarial loss function according to a maximum loss strategy, and carrying out iterative training to obtain a robust model. Compared with the prior art, the method has the advantages that the robustness of the model is enhanced, and the model has the capability of defending various attacks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of adversarial training technology, and in particular to a method for improving model robustness driven by integrated adversarial attack. Background Art

[0002] Deep learning models have been successfully applied in many fields. However, these models show natural fragility in the face of adversarial attacks, which has become a key bottleneck restricting their further application, especially in safety-critical application scenarios such as autonomous driving and medical diagnosis. This fragility of the model may lead to serious consequences. Adversarial attacks can mislead the model to output incorrect predictions by adding carefully designed small perturbations to legitimate inputs. The existence of this attack method seriously threatens the security of the model and poses a huge challenge to its robustness. Researching how to improve the robustness of deep learning models under adversarial attacks is the basis for applying deep neural network models in safety-critical fields.

[0003] Adversarial training proposed in the paper "Explaining and harnessing adversarial examples" (SAT for short) is a mainstream method to improve the adversarial robustness of models. The idea of ​​adversarial training is to add adversarial samples generated by adversarial attacks to the training set as data enhancement. Adversarial samples reflect the attack strategies that potential attackers may adopt. Adding adversarial samples to the model training process can enhance the model's ability to identify and resist these attacks. However, current adversarial training often generates adversarial samples through an adversarial attack algorithm. Adversarial samples lack diversity, and the adversarial attack strategies that adversarial samples can reflect are limited. This results in the model being able to defend only against a certain attack strategy through adversarial training, while the defense fails under other attack strategies with greater differences. In addition, the presence of a large number of homogeneous adversarial samples in adversarial training will also significantly reduce the generalization and robustness of the model.

[0004] In addition, although adversarial training can significantly improve the robustness of the model, there is a trade-off problem in which the standard accuracy of the model decreases at the same time. The existence of this trade-off may be caused by the difference in the distribution of adversarial samples and natural samples in the feature space. At present, researchers mainly solve the trade-off problem between the robustness and generalization of the model by optimizing the adversarial training mode. The paper "Theoretically principled trade-off between robustness and accuracy" (abbreviated as TRADES) guides the design of the adversarial training loss function through theoretical analysis, decomposes the model error into two parts: natural error and adversarial error, and provides differentiable upper bounds for these two parts. It more strictly restricts the output consistency of the model before and after adding adversarial perturbations from the perspective of the decision boundary, rather than simply ensuring the consistency of the output labels, avoiding the drastic changes in the decision boundary before and after the model adversarial training, resulting in a significant decrease in the standard accuracy of the model. This paper has become a baseline model for the solution to the adversarial trade-off problem and has been widely cited in this field. In addition, many studies have studied how to solve the adversarial trade-off problem from the perspective of training samples. Among them, the paper "Improving adversarial robustness requires revisiting misclassified example" (MART for short) focuses on dealing with the different effects of correctly classified and misclassified samples in adversarial training. It believes that misclassified samples have a greater impact on the final robustness of the model in adversarial training, and more attention should be paid to these samples. The paper "Reducing excessive margin to achieve a better accuracy vs. robustness trade-off" (HAT for short) uses assistant samples to constrain the model boundary line to avoid the new boundary and the original boundary from being too different, thereby reducing the impact on standard accuracy. The paper "Improving Adversarial Robustness by Penalizing Natural Accuracy" (NAP for short) improves adversarial robustness by penalizing the accuracy of the model on certain natural samples. Its core idea is that if the model is too accurate on natural samples, it may mean that it relies on some features that are sensitive to adversarial perturbations, which may damage its adversarial robustness. By explicitly penalizing natural accuracy, NAP can encourage the model to learn more robust feature representations. Some studies also choose to create perturbations on the image background to generate adversarial samples for adversarial training, or use some strategies to adaptively set the perturbation threshold of adversarial samples participating in adversarial training.These studies mainly explored which natural samples or adversarial samples are more important from the perspective of adversarial robustness, which improved the effect of adversarial training to a certain extent, but existing research has not yet conducted in-depth discussions from the perspective of adversarial sample diversification. Current adversarial training strategies mostly rely on specific attack algorithms, which limits the model's ability to defend against other potential attack strategies. Summary of the invention

[0005] The purpose of the present invention is to provide an integrated adversarial attack-driven model robustness improvement method for improving the robustness of the model against unknown attacks.

[0006] The purpose of the present invention can be achieved by the following technical solutions:

[0007] A method for improving model robustness driven by integrated adversarial attack, comprising the following steps:

[0008] Obtain natural samples, use different adversarial attack algorithms to generate adversarial samples, calculate the similarity between adversarial samples, and further calculate the similarity between adversarial attack algorithms;

[0009] According to the similarity between the adversarial attack algorithms, a diversity-first integration strategy is adopted to construct an integrated adversarial attack algorithm set that integrates white-box attack and black-box attack;

[0010] Based on the integrated adversarial attack algorithm set, an integrated attack algorithm is used for adversarial training, and an adversarial loss function is constructed according to a maximum loss strategy, and a robust model is obtained through iterative training.

[0011] Furthermore, the step of calculating the similarity between adversarial samples includes:

[0012] Extract feature vectors: Extract high-order feature vectors of adversarial samples generated by different adversarial attack algorithms from the classifier model;

[0013] Calculate dot product: select two different high-order eigenvectors to perform dot product operation to obtain the dot product;

[0014] Calculate the modulus length: calculate the modulus length of the selected high-order eigenvectors respectively;

[0015] Calculate cosine similarity: Based on the dot product and modulus, calculate the similarity between adversarial samples. The calculation expression of the similarity is:

[0016]

[0017] In the formula, sim adv is the similarity, cos_similarity(A,B) is the cosine similarity function, A and B are different selected high-order eigenvectors, ‖A‖ and ‖B‖ are the corresponding modulus lengths of A and B.

[0018] Furthermore, the step of calculating the similarity between the anti-attack algorithms includes:

[0019] Calculating the similarity between two adversarial attack algorithms: Calculating the similarity between two adversarial attack algorithms based on the similarity between two groups of adversarial samples. The calculation expression of the similarity between the two adversarial attack algorithms is:

[0020]

[0021] In the formula, s(a1,a2) is the similarity between two groups of adversarial attack algorithms, a1 and a2 are two different adversarial attack algorithms, N is the number of adversarial samples, is the similarity between two adversarial examples;

[0022] Calculating the similarity between an adversarial attack algorithm and a group of adversarial attack algorithms: Calculating the similarity between an adversarial attack algorithm and multiple other adversarial attack algorithms based on the similarity between the two adversarial attack algorithms, the calculation expression of the similarity between the one adversarial attack algorithm and the multiple other adversarial attack algorithms is:

[0023]

[0024] In the formula, is the average similarity between an adversarial attack algorithm and multiple other adversarial attack algorithms, and K is the number of all adversarial attack algorithms.

[0025] Furthermore, the steps of constructing the integrated anti-attack algorithm set include:

[0026] The white box attack algorithm is used to attack the standard defense model M AT Conduct adversarial attacks and calculate the attack success rate of the white-box attack algorithm, where the standard defense model M AT Use standard adversarial training mode for training;

[0027] Based on the attack success rate of the white-box attack algorithm, a diversity-first integration strategy is used to integrate the white-box attack algorithm;

[0028] A dynamic knowledge distillation method is used to construct alternative models;

[0029] The substitution model and the white-box attack algorithm are used to construct a black-box attack algorithm for the target model, and a diversity-first integration strategy is used to integrate the black-box attack algorithm, ultimately merging the white-box attack and black-box attack integrated adversarial attack algorithm set.

[0030] Furthermore, the steps of integrating the white-box attack algorithm include:

[0031] Selection of candidate white-box attack algorithms: sorting the attack success rates of the white-box attack algorithms from large to small, and selecting the first Q white-box attack algorithms as candidate white-box attack algorithms;

[0032] Initialization: Initialize the integrated algorithm list EAL to an empty set;

[0033] Preferred algorithm: Based on the candidate white-box attack algorithms, the white-box attack algorithm with the smallest similarity to other white-box attack algorithms is selected as an integrated white-box attack algorithm, and is put into the integrated algorithm list EAL;

[0034] Algorithm integration: among the remaining white-box attack algorithms, calculate the similarity between each white-box attack algorithm and the integrated algorithm list EAL, and select the white-box attack algorithm with the smallest similarity for integration;

[0035] Integration end: Calculate the attack success rate TR of the updated integrated algorithm list EAL step , determine whether ΔTR ≥ δ is true, if so, repeat the algorithm integration steps to integrate, if not, the integration ends, and the final integrated algorithm list EAL is obtained, where ΔTR = |TR step -TR step-1 |, ΔTR is the EAL attack success rate TR of the integration algorithm list during this integration step Integrated algorithm list EAL attack success rate TR compared to the last integration step-1 δ is the threshold value.

[0036] Furthermore, the step of calculating the success rate of the anti-attack integrated anti-attack algorithm includes:

[0037] Calculate the success rate of the adversarial attack of a single adversarial attack algorithm: Based on the updated integrated algorithm list EAL, calculate the adversarial attack success rate TR of each white-box attack algorithm i , the success rate of the adversarial attack TR i The calculation expression is:

[0038]

[0039] Where N represents the number of adversarial samples, and S represents the number of successful standard defense models M. AT The number of adversarial examples that are misidentified, I is the indicator function, when f(x adv )≠y, I=1, otherwise I=0, and f refers to the standard defense model M AT ;

[0040] Calculate the success rate of a group of adversarial attack algorithms: Take all white-box attack algorithms in the updated integrated algorithm list EAL as a group, and calculate the success rate TR of all white-box attack algorithms in the groupi The average is calculated to obtain the success rate TR of a set of adversarial attack algorithms. step , the success rate of the adversarial attack of the set of adversarial attack algorithms TR step The calculation expression is:

[0041]

[0042] Where K is the number of adversarial attack algorithms.

[0043] Furthermore, the step of constructing the substitution model includes:

[0044] Train the target model: use the attacked teacher model as the target model;

[0045] Extracting knowledge of the target model: Extracting knowledge from the target model, including the prediction probability of the target model on the training data and the activation or feature representation of the target model on the intermediate layer;

[0046] Training the surrogate model: The knowledge extracted from the target model is used as the training signal, and the surrogate model is trained using the dynamic distillation technique, wherein the loss function used when training the surrogate model is:

[0047]

[0048] Where, L dynamic is the loss function of the dynamic distillation training process, L static The loss function for training the surrogate model for a fixed training sample, λ dynamic To control the weight value of dynamic sample learning degree, Dist(·) is the distance metric function of the difference, f(·) is the target model, g(·) is the alternative model, and δ is a small perturbation based on the original sample x.

[0049] Furthermore, the step of obtaining the robust model includes:

[0050] Dataset division: Divide natural samples into training data sets D train , validation data set D val And the test dataset D test ;

[0051] Adversarial loss function design: For each natural sample (x, y), each adversarial attack algorithm in the integrated adversarial attack algorithm set is used to generate the corresponding adversarial perturbation Calculating adversarial cross entropy loss and select all The maximum value of is taken as the final integrated adversarial loss Calculate the cross entropy loss L on natural samples (x, y) std , combined with the integrated adversarial loss, we get the final adversarial loss function L AT ;

[0052] Adversarial training based on integrated attack: By minimizing the adversarial loss function L AT Update the model parameters until the final robust model M is obtained EAAT .

[0053] Furthermore, the adversarial loss function L AT The expression is:

[0054] L AT =αL std +(1-α)L adv

[0055] Where α is the counterweight coefficient.

[0056] Furthermore, it also includes evaluating the robust model using a comprehensive accuracy index, and the expression of the comprehensive accuracy index is:

[0057]

[0058]

[0059] In the formula, A com is the comprehensive accuracy index, A n Indicates natural precision, A r represents robust accuracy, A i r is the robust accuracy of the model under the attack of the i-th algorithm in the integrated adversarial attack algorithm, and K is the number of attack algorithms.

[0060] Compared with the prior art, the present invention has the following beneficial effects:

[0061] (1) Starting from the diversity of adversarial samples, the present invention proposes to use an integrated adversarial attack algorithm to generate diverse adversarial samples to avoid overfitting of the model on a certain type of homogeneous adversarial samples. This adversarial training using an integrated attack algorithm can cover multiple possible weaknesses of the model by combining different attack methods, which can more comprehensively cover the decision boundary of the model and further enhance the robustness of the model against unknown attacks.

[0062] (2) The present invention adopts dynamic knowledge distillation technology to construct a substitution model and improves the accuracy of the substitution model by continuously introducing new samples.

[0063] (3) The present invention superimposes a new adversarial training model based on integrated adversarial attacks on the existing adversarial training, which can effectively improve the comprehensive accuracy of the model on natural samples and adversarial samples. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 It is a schematic diagram of the method flow of the present invention;

[0065] Figure 2 This is an example of SVHN data of the present invention;

[0066] Figure 3 This is an example of CIFAR-10 data of the present invention;

[0067] Figure 4 There are significant differences in the similarity between the attack algorithms of the present invention, where (a) shows that there are significant differences in the similarity between the attack algorithms under ResNet-18 / SVHN, and (b) shows that there are significant differences in the similarity between the attack algorithms under WRN-28-10 / CIAFR-10;

[0068] Figure 5 The white-box attack algorithm integration of the present invention has a performance growth bottleneck phenomenon. (a) Figure shows the performance growth bottleneck phenomenon of the white-box attack algorithm integration under ResNet-18 / SVHN, and (b) Figure shows the performance growth bottleneck phenomenon of the white-box attack algorithm integration under WRN-28-10 / CIAFR-10. DETAILED DESCRIPTION

[0069] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0070] This embodiment provides a method for improving model robustness driven by integrated adversarial attack. The method first analyzes the adversarial attack algorithm, calculates the similarity between adversarial samples generated by different attack algorithms and the similarity between attack algorithms; then integrates the white-box and black-box attack algorithms according to the diversity priority integration strategy, and solves the performance enhancement bottleneck problem when integrating the white-box attack algorithm by adding black-box attack; then uses the integrated attack algorithm to generate diverse adversarial samples during adversarial training, constructs the adversarial loss function according to the maximum loss strategy, and iteratively trains to obtain a robust model; finally, the standard accuracy of the model on natural samples, the robust accuracy on adversarial samples, and the comprehensive accuracy calculated by the harmonic average of these two accuracies are used to evaluate the performance of the model. The present invention innovatively introduces integrated adversarial attacks in adversarial training, combines different attack methods to cover multiple weaknesses that may exist in the model, and achieves the goal of enhancing the robustness of the model, so that the model has the ability to defend against various attacks. The experimental results verify the superiority and versatility of this method.

[0071] First, the experimental design of this implementation is described:

[0072] (1) Data

[0073] This embodiment uses the public dataset SVHN (for example Figure 2 ) and CIFAR-10 (for example Figure 3 ) for experimental verification. Due to their different characteristics and difficulty, these two datasets provide researchers with a diverse experimental environment. They are often used as benchmark datasets in the study of evaluating the adversarial robustness of models, which helps to evaluate and compare the performance of different models and algorithms.

[0074] (2) Deep Neural Network Architecture

[0075] This embodiment selects two typical deep neural network architectures: ResNet-18 and WRN-28-10, which are trained and tested on the SVHN and CIFAR-10 datasets, respectively.

[0076] The ResNet-18 model structure is shown in Table 1. The "18" indicates that the network has 18 layers. In the design of ResNet, the depth of the network increases by 1 for each additional residual block, so "18" directly reflects the number of layers in the network. ResNet-18 is a relatively shallow network. While maintaining certain performance, it also has low computational complexity and is suitable as a benchmark model for studying adversarial attacks and improving robustness.

[0077] WideResNet (WRN) is a network structure further developed by researchers based on ResNet, aiming to improve the capacity and performance of the model by increasing the width of the network. The "28" in the WRN-28-10 network means that the network has 28 residual blocks, and the "10" means that the width factor in each residual block is 10, that is, the number of channels in the convolutional layer in each residual block is 10 times the number of channels in the original ResNet. WRN-28-10 is a relatively wide and deep network with sufficient capacity to learn complex feature representations, suitable for scenarios that require high accuracy.

[0078] Table 1 ResNet-18 model structure description

[0079]

[0080] These models have wide applications in image recognition tasks, and evaluating their performance under adversarial attacks is of great significance for practical applications.

[0081] (3) White-box adversarial attack algorithm

[0082] This embodiment selects several classic gradient-based adversarial attack algorithms, including FGSM (Fast Gradient Sign Method), PGD (Projected Gradient Descent), BIM (Basic Iterative Method), MI-FGSM (Momentum-based Iterative Fast Gradient Sign Method), NI-FGSM (Nesterov Iterative Fast Gradient Sign Method), VNI-FGSM (Variance Tuning Nesterov Iterative Fast Gradient Sign Method) and PI-FGSM++ (Patch-wise++Iterative Fast Gradient Sign Method).

[0083] (4) Black-box adversarial attack algorithm

[0084] This embodiment selects a transfer-based black-box attack algorithm with high time efficiency in generating adversarial samples, adopts knowledge distillation to train the substitute model, uses VGG-16 as the substitute model for ResNet-18 / SVHN, and uses VGG-19 as the substitute model for WRN-28-10 / CIFAR-10.

[0085] The same white-box adversarial attack algorithm as mentioned above is used on the substitute model to complete the migration attack on the target model.

[0086] Specifically, Figure 1 As shown, the method comprises the following steps:

[0087] Step 1: Similarity evaluation of adversarial attack algorithms

[0088] First, an adversarial attack algorithm is used to superimpose perturbations on natural samples to generate adversarial samples. Different adversarial attack algorithms will generate corresponding adversarial sample sets. The similarity between adversarial sample sets is calculated based on the similarity between adversarial samples, which serves as a similarity evaluation indicator for the adversarial algorithm.

[0089] Step 1.1: Generate adversarial samples based on adversarial attack algorithms

[0090] The mathematical paradigm of adversarial attack can be defined as follows: Let f:X→Y be a deep learning model, where X is the input space and Y is the output space. The model f maps the input x∈X to the output f(x)∈Y. In classification tasks, the output space Y is usually represented as a set of categories, i.e., Y={1,2,…,K}, where K is the number of categories.

[0091] The generation of adversarial samples can be defined as finding a specific perturbation vector δ, so that when the input X is perturbed, the model's predicted output f(x+δ) on the perturbed sample is inconsistent with the true label y. In general, the adversarial perturbation vector δ needs to meet the following conditions:

[0092] 1. Imperceptibility: The perturbation δ should be small enough that the perturbed input x+δ is perceptually indistinguishable from the original input x. This is usually achieved by limiting the norm of the perturbation, e.g., ‖δ‖ p ≤ε, where ε is a pre-set threshold and p is the order of the norm; in adversarial attacks, the L2 norm and L ∞ norm to limit the disturbance.

[0093] 2. Effectiveness: The perturbation δ should be large enough to change the model’s predictions. This can be achieved by optimizing the problem to maximize the model’s loss function on the perturbed input. Right now

[0094] In summary, the optimization problem of adversarial attacks can be formalized as:

[0095]

[0096] st‖δ‖ p ≤ε

[0097] This problem can be solved by gradient descent or other optimization algorithms. In practical applications, since the model f is usually non-convex, this problem may be non-smooth and requires special optimization techniques to handle. The adversarial attack algorithm generates adversarial samples x by solving the above optimization problem. adv =x+δ, where x adv The above two conditions are met.

[0098] In this embodiment, in order to satisfy the imperceptibility of disturbance, p takes the infinite norm and ε takes 8 / 255.

[0099] Step 1.2: Calculate the similarity metric between adversarial examples

[0100] Here, when we say that two samples are similar, we specifically mean that the high-level features of the samples are similar to the classifier network. Usually, the classifier will classify similar samples as the same class. In terms of the high-level features of the samples, the cosine similarity is used to measure the similarity of the adversarial samples generated by each attack. The following is the specific process:

[0101] (1) Extracting feature vectors: First, we need to extract the high-order feature vectors of the adversarial sample at the penultimate layer of the network from the classifier model. These feature vectors are data representations of the high-order features generated by the model when processing input data.

[0102] (2) Calculate the dot product: Take a pair of adversarial examples (denoted by x) generated by different adversarial algorithms (denoted by a1, a2) adv1 ,x adv2 ) and calculate their dot product. The dot product reflects the degree of consistency of the two vectors in direction.

[0103] (3) Calculate the modulus: Next, calculate the modulus of the two high-order eigenvectors, ‖A‖ and ‖B‖. The modulus is a measure of the length of a vector. It has nothing to do with the direction of the vector but is related to the specific position of the vector in space.

[0104] (4) Calculate cosine similarity: Using the above dot product and modulus value, we can calculate the cosine similarity between two high-order feature vectors (as shown in Formula 3.14). The value of cosine similarity is between -1 and 1, where 1 means that the two vectors are completely positively correlated, -1 means that the two vectors are completely negatively correlated, and a value close to 0 means that the two vectors are basically orthogonal and there is no correlation between the vectors. In this way, we calculate the similarity index sim of a pair of adversarial samples adv :

[0105]

[0106] Step 1.3: Calculate the similarity metric between adversarial attack algorithms

[0107] Calculating the similarity index of attack algorithms is very valuable for understanding how different attack algorithms affect the internal representation of the model and designing defense strategies that can resist these attacks. The similarity index of the adversarial attack algorithm is calculated based on the adversarial sample similarity index. The detailed process is as follows:

[0108] (1) Calculate the similarity index of each pair of adversarial samples: Use two adversarial attack algorithms a1 and a2 to calculate the similarity index of each pair of adversarial samples. i ∈X(1≤i≤N) and use them to generate adversarial samples Where X is the natural sample set, N is the number of samples, and the similarity index sim between two adversarial samples is calculated by step 1.2. i adv ;

[0109] (2) Calculate the similarity index of two adversarial attack algorithms: Calculate the similarity index s(a1, a2) between the two algorithms based on the adversarial sample similarity index. The specific calculation formula is as follows. The smaller the value, the greater the similarity of the adversarial samples generated by the algorithms, indicating that the more similar the algorithm attack strategies are, that is, the greater the algorithm similarity:

[0110]

[0111] (3) Calculate the similarity index between an adversarial attack algorithm and a group of adversarial attack algorithms: Calculate the similarity between an algorithm and multiple other algorithms based on the algorithm similarity index Where K is the number of other algorithms:

[0112]

[0113] In this embodiment, the algorithm similarity index between each white box attack algorithm is as follows: Figure 4 As shown, (a) is based on ResNet-18 / SVHN, and (b) is based on WRN-28-10 / CIAFR-10, and there are significant differences.

[0114] Step 2: Construct an attack algorithm set based on the diversity priority integration strategy

[0115] First, the success rate of the integrated adversarial attack algorithm is calculated to measure the attack strength of the integrated algorithm; then, a two-stage algorithm integration is performed according to the diversity-first integration strategy. In the first stage, the white-box attack algorithms are integrated one by one until the integrated attack strength no longer increases significantly. In the second stage, a substitution model is constructed, and then the black-box attack algorithms based on the substitution model are integrated one by one until the integrated attack strength no longer increases significantly, finally forming an attack algorithm set.

[0116] Step 2.1: Calculation of the success rate of adversarial attack of the integrated attack algorithm

[0117] Using different white-box attack algorithms to attack the original model without defense, the attack success rate is usually very high, and there is no distinction between algorithms. In order to more significantly distinguish the attack strength of the algorithm, this paper uses the attack success rate on the defense model to measure the attack strength of the algorithm. The calculation process is as follows:

[0118] (1) Defense training of the model: The model is trained based on PGD adversarial samples using the standard adversarial training mode to obtain a standard defense model M. AT ;

[0119] (2) Calculate the success rate of adversarial attacks on a single algorithm: In the standard defense model M AT Using attack algorithm a i Generate adversarial samples x on natural samples (x, y) i adv (1≤i≤N), model M AT Perform inference on the adversarial sample and calculate the adversarial attack success rate TR based on whether the inference result is correct i :

[0120]

[0121] Among them, N represents the number of adversarial samples, S represents the number of successful model M AT The number of adversarial examples that are misidentified, I is the indicator function, when f(x adv )≠y, I=1, otherwise I=0, where f refers to the standard defense model M AT .

[0122] (3) Calculate the success rate of adversarial attacks on a set of algorithms: For each adversarial attack algorithm a in a set of algorithms i (1≤i≤K) calculates the success rate of its counterattack TR i , and then average it within the group to get the adversarial attack success rate TR of a group of algorithms:

[0123]

[0124] In this embodiment, a single algorithm is used in the standard defense model M AT The success rate of adversarial attacks on is shown in Table 2.

[0125] Table 2: The performance of various adversarial attack algorithms in the standard defense model M AT Success rate of adversarial attacks on

[0126]

[0127] Step 2.2: White-box attack algorithm integration based on diversity-first integration strategy

[0128] First, calculate the white-box attack algorithm a according to step 2.1 i The success rate of adversarial attack TR i , then follow TR i Sort the attack algorithms from large to small, TR i The larger the value, the more aggressive the algorithm is. The purpose of sorting is to exclude the least aggressive algorithm. The first Q algorithms are selected as candidate algorithms. In addition, the smaller the similarity between adversarial attack algorithms, the higher the diversity of adversarial samples generated by these algorithms, and the richer the adversarial attack strategies exposed during adversarial training, which is more helpful to improve the robustness of the model. Therefore, the present invention adopts a diversity priority integration strategy (E div ), when integrating algorithms, give priority to integrating algorithms that are less similar to existing algorithms.

[0129] Based on the diversity priority integration strategy (E div )Integrate the algorithms in the candidate algorithm set. The specific process is as follows:

[0130] (1) Initialization: Initialize the Ensemble Attacks List (EAL) to an empty set;

[0131] (2) Preferred algorithm: Algorithm a1 with the smallest similarity index with other attack algorithms is selected as the first algorithm to be integrated and put into the integrated algorithm list EAL;

[0132] (3) Algorithm integration: In the remaining algorithm set, calculate the similarity between each algorithm and EAL according to step 1.3, and select the algorithm with the smallest similarity index with the EAL algorithm for integration;

[0133] (4) Integration is complete: Calculate the attack success rate TR of the EAL algorithm group according to step 2.1 step , if ΔTR ≥ δ, it indicates that this integration is effective, and the algorithm integration of the previous step is repeated; where ΔTR = |TR step -TR step-1 |, η is the threshold, which is usually a small value; if ΔTR<η, it means that TR does not change much before and after this integration, then the integration ends and EAL is formed.

[0134] The similarity indexes of each adversarial attack algorithm and the other algorithms in this embodiment are shown in Table 3. It can be seen that PI-FGSM++ is selected as the first attack algorithm according to the diversity priority integration strategy because its similarity index with other attack algorithms is the smallest.

[0135] Table 3 Similarity index of each adversarial attack algorithm and other algorithms (average cosine similarity)

[0136] Adversarial attack algorithm ResNet-18 / SVHN WRN-28-10 / CIFAR-10 PGD 0.5233 0.3714 FGSM 0.5178 0.4586 BIM 0.6451 0.5620 MI-FGSM 0.6706 0.6027 VNI-FGSM 0.6848 0.6056 NI-FGSM 0.6301 0.5710 PI-FGSM++ 0.4246 0.2513

[0137] Table 4 Attack success rate under diversity priority integration strategy (ResNet-18 / SVHN)

[0138]

[0139] Table 5 Attack success rate under diversity priority integration strategy (WRN-28 / CIFAR-10)

[0140]

[0141] For this embodiment, η is taken as 0.01, and the algorithms are integrated one by one according to the diversity priority integration strategy. The success rates of the adversarial attack after integration are shown in Tables 4 and 5. For ResNet-18 / SVHN, the final integrated algorithm list EAL is {PI-FGSM++, FGSM, PGD, NI-FGSM, BIM}, and for WRN-28-10 / CIFAR-10, the integrated algorithm list EAL is {PI-FGSM++, PGD, FGSM, BIM, NI-FGSM}.

[0142] When integrating white-box attack algorithms, as the number of algorithms increases, the growth rate of the adversarial attack rate slows down and eventually reaches a bottleneck area, such as Figure 5 As shown, (a) is based on ResNet-18 / SVHN, and (b) is based on WRN-28-10 / CIAFR-10.

[0143] Step 2.3: Alternative model construction based on knowledge distillation

[0144] Considering that adversarial training requires a large number of adversarial samples to iteratively update model parameters, there is a high requirement on the generation time of adversarial samples. The attack algorithm based on transfer learning in the current black-box adversarial attack algorithm has a lower time cost and is suitable for adversarial training. Attack algorithms based on transfer learning often use knowledge distillation technology to generate alternative models (student models) for the target model (teacher model). Usually, the specific process of knowledge distillation is as follows:

[0145] (1) Training the teacher model: The target model to be attacked is used as the teacher model.

[0146] (2) Extracting knowledge from the teacher model: Extracting knowledge from the teacher model, including the prediction probability of the teacher model on the training data and the activation or feature representation of the teacher model on the intermediate layers.

[0147] (3) Train the student model: Use the knowledge extracted from the teacher model as the training signal to train a student model. This usually involves the following loss function:

[0148] L distillation =L student,data +λ·L distillation,teacher

[0149] Where L student,data is the loss of the student model on the training data; L distillation,teacher is the loss of the difference between the student model and the teacher model, which can be the KL divergence of the predicted probability, etc.; λ is the weight to balance the two loss terms.

[0150] Using knowledge distillation, in order to train the alternative model g, fixed training samples are extracted from the actual training set data D distribution. Based on these samples, the following loss function L is adopted static To train the surrogate model g. The goal is to minimize the prediction difference between the surrogate model g and the target model f on these fixed samples:

[0151]

[0152] Where L represents the loss function of the classifier training process, which is generally the cross entropy loss; Dist is the distance measurement function of the difference, and the KL divergence of the final prediction probability of the model is used here; λ is the weight for balancing the two loss terms.

[0153] In this invention, in order to improve the accuracy of the substitution model, we use dynamic distillation technology to train the substitution model based on traditional knowledge distillation. The core idea is to improve the accuracy of the substitution model by continuously introducing new samples. The loss function of the designed dynamic distillation training process is expressed as:

[0154]

[0155] Among them, λ dynamic To control the weight value of the dynamic sample learning degree, δ represents a small perturbation based on the original sample x. Here, Gaussian noise is used. to generate, where I is the identity matrix.

[0156] Step 2.4: Black-box attack algorithm integration

[0157] First, train the replacement model M according to step 2.3 DST ; Then use the "alternative model M DST + white-box attack algorithm" constitutes the black-box attack algorithm of the target model; finally, the black-box attack algorithm is integrated according to the diversity priority integration strategy of step 2.2, and finally an integrated attack algorithm list EAL that integrates white-box attack and black-box attack is formed.

[0158] In this embodiment, the addition of the black box attack algorithm can effectively solve the performance growth bottleneck problem of the white box attack algorithm integration, breaking through the threshold η, and introducing the black box attack algorithm to continue the integration after the white box attack algorithm reaches the bottleneck. For ResNet-18 / SVHN, the final integrated attack algorithm list EAL is {white box: [PI-FGSM++, PGD, FGSM, BIM, NI-FGSM], black box: [VGG-16 alternative model + PGD]}. For WRN-28-10 / CIAFR-10, the final integrated attack algorithm list EAL is {white box: [PI-FGSM++, PGD, FGSM, BIM, NI-FGSM], black box: [VGG-19 alternative model + PGD, VGG-19 alternative model + PI-FGSM++, VGG-19 alternative model + VNI-FGSM]}.

[0159] Step 3: Adversarial training based on attack algorithm set:

[0160] The dataset is randomly divided into training set, validation set and test set. On the training set, an integrated adversarial sample set is generated using the attack algorithm set, and the adversarial loss function is constructed according to the maximum loss strategy. The model is iteratively adjusted in the direction of decreasing the loss function, and finally the optimal model parameters are obtained based on the model performance on the validation set.

[0161] Step 3.1: Dataset division

[0162] The natural samples are divided into three data sets: training data set D train , validation data set D val And the test dataset D test . Using the official dataset division method, for the SVHN dataset, D train :D val :D test =63:10:26; for the CIFAR-10 dataset, the sample ratio is D train :D val :D test =4:1:1.

[0163] Step 3.2: Design of adversarial loss function

[0164] For integrated attacks, a set of adversarial samples is generated for each natural sample. The present invention uses the maximum loss strategy to complete the calculation of adversarial losses on multiple adversarial samples. Ens It aims to select the loss value that has the greatest impact on the model from all adversarial examples. This strategy assumes that the most difficult samples can provide the richest training signals, thereby pushing the model towards a more robust direction. EnsThe detailed calculation process of the strategy is as follows:

[0165] (1) Generate adversarial samples: For each sample x and its label y, use each attack algorithm a in the ensemble i Generate the corresponding adversarial perturbation

[0166] (2) Calculate the adversarial loss on each adversarial example: For each adversarial example generated by the attack algorithm, independently calculate its adversarial cross entropy loss

[0167] (3) Keep the maximum loss: For each sample, select all The maximum value of is taken as the final integrated adversarial loss,

[0168] Step 3.3: Adversarial training based on ensemble attack

[0169] The present invention proposes a new adversarial training method EAAT (Ensemble Attacks based Adversarial Training, adversarial training based on integrated adversarial attacks). Based on the diversified priority integration strategy E in step 2.2 div Construct an integrated attack algorithm list EAL, in the training data set D train Generate adversarial sample sets and adopt the maximum loss strategy L Ens Calculate the adversarial loss function L AT , to minimize L AT Iteratively update the model parameters in the direction of . The specific algorithm flow is as follows:

[0170]

[0171] In this embodiment, the value of α is 0.5, and the model is iterated 50,000 times during the training process to reach convergence.

[0172] Step 4: Comprehensive model performance evaluation

[0173] Adversarial samples are generated on the test set using white-box and black-box attack algorithms respectively. Model inference is performed on natural samples in the test set and adversarial samples generated on them. A comprehensive accuracy performance indicator that takes into account both the standard accuracy and robust accuracy of the model is designed to comprehensively measure the accuracy and robustness of the model.

[0174] First, we select black-box and white-box attack algorithms to test the adversarial robustness of the model. Then, we use each attack algorithm a i On the test set D test Generate adversarial sample set D i test_adv , combined to construct the adversarial sample test set Dtest_adv ={D 1 test_adv ,D 2 test_adv ,...,D K test_adv}, used for model robust accuracy calculation.

[0175] In this example, for ResNet-18 / SVHN, K is 6 and the test set D test There are 26,000 samples, and the constructed adversarial sample test set D test_adv There are 156,000 samples. For WRN-28-10 / CIAFR-10, K is 6, and the test set D test There are 10,000 samples, and the constructed adversarial sample test set D test_adv There are 60,000 examples.

[0176] Step 4.2: Model inference based on natural samples and adversarial samples from the test set

[0177] The model M trained based on the EAAT method EAAT , simply denoted as f, for every natural sample x∈D test , perform model inference and obtain the model inference result f(x); for each adversarial sample x adv ∈D test_adv , perform model inference and obtain the model inference result f(x adv ).

[0178] Step 4.3: Calculate model performance metrics

[0179] Natural accuracy refers to the accuracy of the model on natural samples, and robustness refers to the accuracy of the model on adversarial samples. Considering the trade-off between the natural accuracy and robust accuracy of the model, in order to fairly compare the comprehensive effects of each model, the comprehensive accuracy index is introduced to balance the two types of accuracy through harmonic averaging to obtain a more comprehensive model performance evaluation. The specific calculation formula is as follows:

[0180]

[0181] Among them, A n Indicates the natural accuracy of the model, with A r Represents the robust accuracy of the model, A com Indicates comprehensive accuracy.

[0182] (1) Natural accuracy: In the natural sample test set D test The natural accuracy of the model is calculated as A n ;

[0183] (2) Robust accuracy: In attack algorithm a i Generated adversarial sample test set D i test_adv The robustness accuracy A of the above calculation model under a certain attack i r ; Then calculate the average robust accuracy A of the model under various attacks r :

[0184]

[0185] (3) Comprehensive accuracy: based on natural accuracy A n And the average robust accuracy A r , calculate the comprehensive accuracy A com .

[0186] In this embodiment, the existing adversarial training method is superimposed on the EAAT strategy to effectively improve the overall accuracy of the model, as shown in Tables 6 and 7.

[0187] Table 6 Comparison of model performance before and after the existing adversarial training method is superimposed with the EAAT strategy (ResNet-18 / SVHN)

[0188]

[0189] Table 7 Comparison of model performance before and after the existing adversarial training method is superimposed on the EAAT strategy (WRN-28-10 / CIFAR-10)

[0190]

[0191] The EAAT method proposed in the present invention generally shows a trend of improving the robust accuracy of the model when used in combination with various adversarial training methods, while having little effect on the natural accuracy of the model. In the proposed comprehensive accuracy index of the model, the EAAT method is superimposed and all are improved. The addition of EAAT in the ResNet-18 model improves SAT, TRADES, MART, HAT, and NAP by 0.9%, 1.6%, 1.4%, 0.9%, and 1.1%, respectively. On the WRN-28-10 model, EAAT also maintains a high natural accuracy under all adversarial training methods, and under the TRADES and NAP trade-off mechanisms, the average model robust accuracy is significantly improved, to 52.91% and 53.65%, respectively. These results show that EAAT can effectively improve the robustness of the model in the face of different attacks, while maintaining good compatibility with the natural accuracy of the model. In summary, the new adversarial training method combined with the EAAT strategy can not only improve the model's resistance to adversarial attacks, but also improve the model's ability to recognize natural samples to a certain extent.

[0192] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.

[0193] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The schemes in the embodiments of the present invention may be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.

[0194] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0195] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0196] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0197] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0198] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for improving model robustness driven by integrated adversarial attack, characterized in that: The following steps are involved: Obtain natural samples, use different adversarial attack algorithms to generate adversarial samples, calculate the similarity between adversarial samples, and further calculate the similarity between adversarial attack algorithms; According to the similarity between the adversarial attack algorithms, a diversity-first integration strategy is adopted to construct an integrated adversarial attack algorithm set that integrates white-box attack and black-box attack; Based on the integrated adversarial attack algorithm set, an integrated attack algorithm is used for adversarial training, and an adversarial loss function is constructed according to a maximum loss strategy, and a robust model is obtained through iterative training.

2. According to claim 1, a method for improving model robustness driven by integrated adversarial attack, characterized in that: The step of calculating the similarity between adversarial samples includes: Extract feature vectors: Extract high-order feature vectors of adversarial samples generated by different adversarial attack algorithms from the classifier model; Calculate dot product: select two different high-order eigenvectors to perform dot product operation to obtain the dot product; Calculate the modulus length: calculate the modulus length of the selected high-order eigenvectors respectively; Calculate cosine similarity: Based on the dot product and modulus, calculate the similarity between adversarial samples. The calculation expression of the similarity is: In the formula, sim adv is the similarity, cos_similarity(A,B) is the cosine similarity function, A and B are different selected high-order eigenvectors, ‖A‖ and ‖B‖ are the corresponding modulus lengths of A and B.

3. The method for improving model robustness driven by integrated adversarial attack according to claim 1, characterized in that: The step of calculating the similarity between the anti-attack algorithms comprises: Calculating the similarity between two adversarial attack algorithms: Calculating the similarity between two adversarial attack algorithms based on the similarity between two groups of adversarial samples. The calculation expression of the similarity between the two adversarial attack algorithms is: Where s(a1,a2) is the similarity between two adversarial attack algorithms, a1 and a2 are two different adversarial attack algorithms, N is the number of adversarial samples, is the similarity between two adversarial examples; Calculating the average similarity between an adversarial attack algorithm and a group of adversarial attack algorithms: Calculating the similarity between an adversarial attack algorithm and multiple other adversarial attack algorithms based on the similarity between the two adversarial attack algorithms, the calculation expression of the similarity between the one adversarial attack algorithm and multiple other adversarial attack algorithms is: In the formula, is the average similarity between an adversarial attack algorithm and other adversarial attack algorithms, and K is the number of all adversarial attack algorithms.

4. The method for improving model robustness driven by integrated adversarial attack according to claim 1, characterized in that: The steps of constructing the integrated anti-attack algorithm set include: The white box attack algorithm is used to attack the standard defense model M AT Conduct adversarial attacks and calculate the attack success rate of the white-box attack algorithm, where the standard defense model M AT Use standard adversarial training mode for training; Based on the attack success rate of the white-box attack algorithm, a diversity-first integration strategy is used to integrate the white-box attack algorithm; A dynamic knowledge distillation method is used to construct alternative models; The substitution model and the white-box attack algorithm are used to construct a black-box attack algorithm for the target model, and a diversity-first integration strategy is used to integrate the black-box attack algorithm, ultimately merging the white-box attack and black-box attack integrated adversarial attack algorithm set.

5. The method for improving model robustness driven by integrated adversarial attack according to claim 4, characterized in that: The steps to integrate the white-box attack algorithm include: Selection of candidate white-box attack algorithms: sorting the attack success rates of the white-box attack algorithms from large to small, and selecting the first Q white-box attack algorithms as candidate white-box attack algorithms; Initialization: Initialize the integrated algorithm list EAL to an empty set; Preferred algorithm: Based on the candidate white-box attack algorithms, the white-box attack algorithm with the smallest similarity to other white-box attack algorithms is selected as an integrated white-box attack algorithm, and is put into the integrated algorithm list EAL; Algorithm integration: among the remaining white-box attack algorithms, calculate the similarity between each white-box attack algorithm and the integrated algorithm list EAL, and select the white-box attack algorithm with the smallest similarity for integration; Integration end: Calculate the attack success rate TR of the updated integrated algorithm list EAL step , determine whether ΔTR ≥ δ is true, if so, repeat the algorithm integration steps to integrate, if not, the integration ends, and the final integrated algorithm list EAL is obtained, where ΔTR = |TR step -TR step-1 |, ΔTR is the EAL attack success rate TR of the integration algorithm list during this integration step Integrated algorithm list EAL attack success rate TR compared to the last integration step-1 δ is the threshold value.

6. The method for improving model robustness driven by integrated adversarial attack according to claim 4, characterized in that: The step of calculating the success rate of the adversarial attack of the integrated adversarial attack algorithm comprises: Calculate the success rate of the adversarial attack of a single adversarial attack algorithm: Based on the updated integrated algorithm list eAL, calculate the success rate of the adversarial attack TR of each white-box attack algorithm i , the success rate of the adversarial attack TR i The calculation expression is: Where N represents the number of adversarial samples, and S represents the number of successful standard defense models M. AT The number of adversarial examples that are misidentified, I is the indicator function, when f(x adv )≠y, I=1, otherwise I=0, and f refers to the standard defense model M AT ; Calculate the success rate of a group of adversarial attack algorithms: Take all white-box attack algorithms in the updated integrated algorithm list EAL as a group, and calculate the success rate TR of all white-box attack algorithms in the group i The average is calculated to obtain the success rate TR of a set of adversarial attack algorithms. step , the success rate of the adversarial attack of the set of adversarial attack algorithms TR step The calculation expression is: Where K is the number of adversarial attack algorithms.

7. The method for improving model robustness driven by integrated adversarial attack according to claim 4, characterized in that: The step of constructing the alternative model comprises: Train the target model: use the attacked teacher model as the target model; Extracting knowledge of the target model: Extracting knowledge from the target model, including the prediction probability of the target model on the training data and the activation or feature representation of the target model on the intermediate layer; Training the surrogate model: The knowledge extracted from the target model is used as the training signal, and the surrogate model is trained using the dynamic distillation technique, wherein the loss function used when training the surrogate model is: Where, L dynamic is the loss function of the dynamic distillation training process, L static The loss function for training the surrogate model for a fixed training sample, λ dynamic To control the weight value of dynamic sample learning degree, Dist(·) is the distance metric function of the difference, f(·) is the target model, g(·) is the alternative model, and δ is a small perturbation based on the original sample x.

8. The method for improving model robustness driven by integrated adversarial attack according to claim 1, characterized in that: The step of obtaining the robust model comprises: Dataset division: Divide natural samples into training data sets D train , validation data set D val And the test dataset D test ; Adversarial loss function design: For each natural sample (x, y), each adversarial attack algorithm in the integrated adversarial attack algorithm set is used to generate the corresponding adversarial perturbation Calculating adversarial cross entropy loss and select all The maximum value of is taken as the final integrated adversarial loss Calculate the cross entropy loss L on natural samples (x, y) std , combined with the integrated adversarial loss, we get the final adversarial loss function L AT ; Adversarial training based on integrated attack: By minimizing the adversarial loss function L AT Update the model parameters until the final robust model M is obtained EAAT .

9. The method for improving model robustness driven by integrated adversarial attack according to claim 8, characterized in that: The adversarial loss function L AT The expression is: L AT =αL std +(1-α)L adv Where α is the counterweight coefficient.

10. The method for improving model robustness driven by integrated adversarial attack according to claim 1, characterized in that: It also includes evaluating the robust model using a comprehensive accuracy index, where the expression of the comprehensive accuracy index is: In the formula, A com is the comprehensive accuracy index, A n Indicates natural precision, A r represents robust accuracy, A i r is the robust accuracy of the model under the attack of the i-th algorithm in the integrated adversarial attack algorithm, and K is the number of attack algorithms.

Citation Information

Cited By

  • Medical image diagnosis method based on Lipschitz constraint

    CN120236131A

  • Target detection model robustness improvement method based on task adaptation

    CN120411590A

  • Neural network model fusion method based on robust adversarial interpolation and Bayesian optimization

    CN121303245A