Guided adversarial training method and system for improving the robustness of deep neural network systems

By guiding the adversarial training method, integrating the optimized weights of the optimizer and guiding the member model to learn the correct decision-making boundaries, the problem of excessive burden on existing adversarial training and storage is solved, and the robustness and accuracy of the deep neural network system is improved. , able to effectively resist confrontational attacks.

CN118095405BActive Publication Date: 2024-11-19ZHEJIANG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410281203.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-12
Publication Date
2024-11-19
Estimated Expiration
2044-03-12

AI Technical Summary

Technical Problem

Existing adversarial training methods train each member model leads to excessive computation and storage burden, and ignores the interaction between member models, resulting in insufficient robustness improvement.

Method used

The guided adversarial training method is adopted to reduce the storage burden through the weight optimized by the integrated optimizer, and guide member models to learn the correct decision boundaries through self-guidance and expert guidance, improving the accuracy and robustness of the model.

Benefits of technology

It effectively reduces the computing and storage burden, enhances the robustness and accuracy of the model, can converge faster, resists most adversarial attacks, and significantly improves the robustness and clean accuracy of deep neural network systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118095405B_ABST
    Figure CN118095405B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of neural network technology, and discloses a guided adversarial training method and system for improving the robustness of a deep neural network system, including: S1, obtaining an expert model through clean training, and enhancing the similarity between the decision boundary and the clean sample by minimizing the output of the member model and the expert model; S2, improving the clean accuracy by expanding the difference between the logit value of the correct label and the logit value of the incorrect label, and adjusting the decision boundary by controlling the margin of the clean sample; S3, adding two losses to the initial loss in the form of regularization terms; S4, using GAT to improve the robustness and clean accuracy of the model by integrating and optimizing the member model of the loss. The present invention proposes a new weight integration method called GAT. The method reduces the negative impact of the interaction between member models on improving accuracy through two guidance methods-self-guidance and expert guidance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence security technology, and in particular relates to a guided adversarial training method and system for improving the robustness of a deep neural network system. Background Art

[0002] As artificial intelligence has brought many breakthroughs in real-world applications, deep neural networks (DNNs) have been widely used in various key applications, such as face recognition and autonomous driving. However, DNNs are often vulnerable to adversarial attacks, which can lead to serious safety risks. Typically, traffic signs are attacked, causing accidents in self-driving cars. In order to improve the adversarial robustness of DNNs, many defense methods have been proposed, including defense distillation, feature compression, randomization-based methods, and adversarial training. Adversarial training is currently considered to be one of the most effective methods to improve the adversarial robustness of models.

[0003] Recent studies have shown that machine learning classifiers are easily fooled by adversarial examples. Therefore, adversarial attacks have attracted a lot of attention since their emergence, and a large number of methods for generating adversarial examples have been developed. These methods help evaluate the robustness of different models and improve the robustness of models through adversarial training. Below we introduce some of the most commonly used attack methods.

[0004] Goodfellow et al. attributed the existence of adversarial examples to the linear nature of the network and proposed the fast gradient sign method (FGSM) for efficiently generating adversarial examples. FGSM further evolved into different versions of iterative attack methods. Kurakin et al. proved that adversarial examples using I-FGSM attacks exist in the physical world and that FGSM can be applied in small steps through multiple iterations. Madry et al. found that starting from random points in the range ball can significantly improve I-FGSM and proposed an attack method called PGD. The CW attack was proposed by Carlini et al., which considers all three distance metrics to construct strong attacks. AutoAttack (AA) combines multiple optimized adversarial attack algorithms to construct strong attacks and is widely used to evaluate model robustness. There are also some methods that explore the transferability of adversarial examples in black-box settings.

[0005] Emerging adversarial training methods focus on enhancing their robustness through empirical defenses. Methods for improving the robustness of deep learning models through adversarial training can be divided into three categories: (1) input-oriented methods; (2) loss-oriented methods; and (3) ensemble-based methods.

[0006] Using the GAN framework to create adversarial samples through generative models. FAT controls the length of searching trajectories of PGD through the lens of geometry. Gowal et al. use images synthesized by generative models to enhance adversarial training and improve the robustness of adversarial attacks. Wang et al. can achieve stronger robustness by utilizing better generative models (such as the popular diffusion model), resulting in new state-of-the-art adversarial robustness.

[0007] For loss-oriented methods, a body of work has been conducted to build a new supervised loss for better optimization. The robustness of the model is enhanced by minimizing the difference between the original sample and the adversarial sample. The logit results of the model generated from the clean sample and the adversarial sample are considered, and a regularization term is created by reducing the distance between the logit pairs. A margin-based method is used, which considers the margin between the clean sample and the adversarial sample. The robustness of the model is enhanced by introducing a momentum term, considering the cases where the training data is initially correctly classified or misclassified, and designing two regularizers for each case. The robustness of the model is improved by constraining the logits of the robust model to be similar to the logits of the pure model. The robustness of the model is improved by encouraging the decision boundary to prioritize vulnerable points during the movement.

[0008] Different from traditional improvements, some ensemble methods are also integrated into adversarial training. Some ensemble methods are also incorporated into adversarial training. A regularization term is introduced to enrich the variability of the decision boundary of the base model to improve the robustness of the ensemble model; SEAT jointly optimizes the state of each historical model on the trajectory in adversarial training.

[0009] Traditional adversarial training generates new adversarial samples for training at each iteration, focusing on the training of a single network, and improving the model robustness by means of data augmentation, adding regularization terms, etc. Compared with traditional adversarial training, integrated adversarial training demonstrates better robustness improvement capabilities. They mainly improve model robustness by combining adversarial perturbations generated by different models, increasing the diversity of integrated models (member models), and integrating each historical model on the optimization trajectory. However, adversarial training for each member model will cause a heavy computational and storage burden. Ignoring the interactions between individual members may cause them to return similar predictions or feature representations.

[0010] Through the above analysis, the problems and defects of the existing technology are as follows: the existing method performs adversarial training on each member model, which will cause a heavy computational and storage burden, and ignores the interaction between individual members, which may cause them to return similar predictions or feature representations. Summary of the invention

[0011] In response to the problems existing in the prior art, the present invention provides a guided adversarial training method and system for improving the robustness of a deep neural network system, which can not only reduce the time and space storage burden of integrated adversarial training, but also consider the interaction between member models to improve robustness.

[0012] The present invention is implemented in this way: for a single model, by integrating the weights optimized by each optimizer, without the need to store the model additionally, the burden of storage space is reduced, and the memory of the historical state of the model weights is enhanced to prevent the model from catastrophic forgetting. At the same time, two guidance methods are designed, namely self-guidance and expert-guidance, to guide member models to learn the correct decision boundary, so that the model can converge faster and improve the accuracy and robustness of the model.

[0013] The present invention also provides a guided adversarial training method for improving the robustness of a deep neural network system, comprising:

[0014] S1, an expert model is obtained through clean training, and the similarity between the decision boundary and the clean sample is enhanced by minimizing the output of the member model and the expert model;

[0015] S2, improves the clean accuracy by expanding the difference between the logit value of the correct label and the logit value of the incorrect label, and adjusts the decision boundary by controlling the margin of the clean sample;

[0016] S3, adds the two losses to the initial loss in the form of regularization terms;

[0017] S4, GAT is used to improve the robustness and clean accuracy of the model by integrating the member models that optimize the loss.

[0018] Furthermore, S1 specifically includes:

[0019]

[0020] in, is the probability distribution of clean samples. However, simply using this loss will affect the diversity of decision boundaries; therefore, the output of clean samples is adjusted based on the member model itself.

[0021] Furthermore, S2 specifically includes: defining Self-Guidence loss

[0022]

[0023] Among them, y is the true label of the clean sample x, Yes F θ (·) The predicted label for x. The parameter η is a smoothing coefficient, η∈(0,1]; smaller values ​​of η will make the model of the logit distribution smoother; conversely, larger values ​​of η will make the difference between the logit values ​​corresponding to the correct label and the logit values ​​associated with the wrong label more obvious; minimizing this loss increases the logit values ​​of the correct label and decreases the logit values ​​of other labels, forcing the model to accurately classify clean examples.

[0024] Furthermore, S3 specifically includes:

[0025]

[0026] in, is the cross entropy loss, and γ is the trade-off parameter between self-guidence and expert-guidence.

[0027] Another object of the present invention is to provide a guided adversarial training system for improving the robustness of a deep neural network system, which implements the guided adversarial training method for improving the robustness of a deep neural network system, comprising:

[0028] The expert model training module is used to obtain an expert model through clean training;

[0029] Output minimization module, used to enhance the similarity between decision boundaries and clean samples by minimizing the outputs of membership models and expert models;

[0030] The clean precision improvement module is used to improve the clean precision by expanding the difference between the logit value of the correct label and the logit value of the incorrect label;

[0031] The decision boundary adjustment module adjusts the decision boundary by controlling the margin of clean samples;

[0032] The member model integration optimization module is used to improve the robustness and clean accuracy of the model by integrating and optimizing the member models of the loss using GAT.

[0033] Another object of the present invention is to provide a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the guided adversarial training method for improving the robustness of a deep neural network system.

[0034] Another object of the present invention is to provide a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps of the guided adversarial training method for improving the robustness of a deep neural network system.

[0035] Another object of the present invention is to provide an information data processing terminal, which is used to implement the guided adversarial training system for improving the robustness of the deep neural network system.

[0036] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:

[0037] First, in view of the technical problems existing in the above-mentioned prior art, some creative technical effects are brought about after solving the problems. The specific description is as follows:

[0038] (1) The present invention finds that the early weakly robust model is still robust to adversarial samples generated on a fully trained robust model. While memorizing the weights of member models at different iteration times, it is proposed to strengthen the memory of historical model weights to prevent catastrophic knowledge forgetting in the model during subsequent training.

[0039] (2) This paper proposes a new ensemble training method named "Guided Adversarial Training (GAT)". This method mitigates the negative impact of the interaction between member models on robustness improvement through two guidance methods: Self-Guidance and Expert-Guidance. These guidance methods consider maintaining the diversity of the decision boundaries of the member models while improving their consistency with the natural decision boundaries.

[0040] (3) Experimental results in black-box and white-box settings demonstrate the superiority of the method of the present invention in terms of accuracy and robustness. By utilizing the natural diversity of member models of adversarial training and the interaction between member models, the idea of ​​the present invention can be applied to more fields to gain better model benefits.

[0041] Second, the present invention proposes a new weight integration method called GAT. This method strengthens the memory of the historical state of the model to prevent the model from catastrophic knowledge forgetting in subsequent training; at the same time, through two guidance methods-self-guidance and expert guidance, the negative impact of the interaction between member models on improving accuracy is reduced. Experiments have shown that the method of the present invention can effectively resist most adversarial attacks and outperforms most of the most advanced defense methods in terms of clean accuracy and adversarial robustness. In future work, the present invention can extend this guided training method to more fields, incorporating the diversity of member models that naturally exist in adversarial training and the negative and positive interactions between member models.

[0042] Third, the expected benefits and commercial value of the technical solution of the present invention after transformation are as follows: The present invention is a security defense technology that can protect image recognition systems from adversarial sample attacks. It can help models better deal with adversarial samples and attacks, including adversarial sample attacks, model reverse engineering, data leakage, etc. For many application scenarios, such as image recognition, speech recognition, natural language processing and other systems, it can help the system resist various adversarial sample attacks and protect the security and confidentiality of the system, especially sensitive data and commercial secrets. This is of practical significance for improving the quality of products and services and meeting user needs.

[0043] The technical solution of the present invention fills the technical gap in the industry at home and abroad: the technical solution proposed by the present invention improves the model effect by using the natural diversity of the member models of adversarial training and the interaction relationship between the member models through the weight integration method, which greatly reduces the waste of model storage space. The two guidance modes accelerate the convergence of losses. Under the same training time, the technical solution of the present invention can achieve better model effects.

[0044] Fourth, the guided adversarial training method for improving the robustness of a deep neural network system provided by the present invention brings the following significant technical advances:

[0045] 1. Introduction and utilization of expert models: An expert model is obtained through clean training, and its output similarity with the member model is used to enhance the matching degree between the decision boundary and the clean sample. This method effectively utilizes the knowledge of the expert model and provides more accurate guidance for the member model, thereby improving the robustness of the model.

[0046] 2. Fine-tuning of decision boundaries: This method not only focuses on the output accuracy of the model, but also further improves the clean precision by expanding the difference between the logit values ​​of the correct labels and the logit values ​​of the incorrect labels. At the same time, by controlling the margin of the clean samples, the decision boundary can be adjusted more finely to make it more adaptable to the distribution characteristics of the data, thereby improving the generalization ability of the model.

[0047] 3. Optimization and integration of loss functions: Adding two losses to the initial loss in the form of regularization terms allows the model to consider multiple optimization objectives simultaneously during training, thereby improving robustness while maintaining or improving the clean accuracy of the model. This comprehensive optimization method helps the model maintain stable performance in complex environments.

[0048] 4. GAT ensemble optimization: GAT (which may be the abbreviation of some ensemble learning or optimization technology) is used to integrate and optimize the member models of the loss. This method further improves the robustness and clean accuracy of the model. By integrating the advantages of multiple member models, GAT can more effectively resist adversarial attacks and improve the overall performance of the model.

[0049] The guided adversarial training method provided by the present invention significantly improves the robustness and clean accuracy of the deep neural network system by introducing an expert model, fine-tuning the decision boundary, optimizing the integrated loss function, and using GAT for integrated optimization, bringing new breakthroughs and progress to the development of the deep learning field. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0051] Figure 1 It is a flow chart of a guided adversarial training method for improving the robustness of a deep neural network system provided by an embodiment of the present invention;

[0052] Figure 2 It is a structural diagram of a guided adversarial training system for improving the robustness of a deep neural network system provided by an embodiment of the present invention;

[0053] Figure 3 is a decision boundary graph provided by an embodiment of the present invention; wherein (a) is a decision boundary graph obtained by training with clean samples, and (b) is a decision boundary graph obtained by training with adversarial samples;

[0054] Figure 4 : is a visualization diagram of the clean accuracy and adversarial accuracy of the member model provided by the embodiment of the present invention; wherein (a) the recognition accuracy of the source model for the adversarial sample generated by the target model, (b) the clean accuracy and adversarial accuracy of the model in each period;

[0055] Figure 5 It is a curve diagram of the change of the clean accuracy and the adversarial accuracy of the GAT provided by the embodiment of the present invention. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0057] In view of the problems existing in the prior art, the present invention provides a guided adversarial training method and system for improving the robustness of a deep neural network system. The present invention is described in detail below in conjunction with the accompanying drawings.

[0058] Based on the guided adversarial training method for improving the robustness of a deep neural network system of the present invention, the following are two specific embodiments:

[0059] Example 1: Improving the robustness of facial recognition systems

[0060] In facial recognition technology, adversarial attacks may lead to security issues such as illegal access to protected resources. Applying this guided adversarial training method can improve the robustness of facial recognition systems.

[0061] 1) Expert model training: First, a large-scale facial image dataset is used to train an expert facial recognition model that can accurately capture facial features and identity information.

[0062] 2) Member model training: Subsequently, a guided adversarial training method is applied to the member model, in which the classification accuracy of clean samples is improved by minimizing the difference between the outputs of the member model and the expert model, and the decision boundary is adjusted to enhance the robustness to adversarial attacks.

[0063] 3) Deployment and Evaluation: After training, the optimized facial recognition system is deployed in the entrance security monitoring system to prevent illegal access through adversarial samples while maintaining efficient and accurate recognition of real users.

[0064] Example 2: Traffic sign recognition for autonomous vehicles

[0065] Traffic sign recognition systems in autonomous driving technology have extremely high requirements for accuracy and robustness. Adversarial attacks may lead to misrecognition, which in turn may cause safety risks. The robustness of the system can be effectively improved by guiding adversarial training methods.

[0066] 1) Expert model training: Use a wide range of traffic sign datasets to train an expert model that can recognize different traffic signs and their meanings with high accuracy.

[0067] 2) Member model training: Guided adversarial training is applied to the member models, and the knowledge of the expert model is used to guide the learning of the member models. By adjusting the decision boundary and optimizing the classification loss, the performance of the model on clean data and adversarial samples is improved at the same time.

[0068] 3) System deployment and field testing: Integrate the trained traffic sign recognition model into the autonomous driving system and test it in the actual road environment. Verify the model's effectiveness in identifying various normal and tampered traffic signs, and ensure that it can still respond correctly when encountering adversarial attacks.

[0069] These two embodiments demonstrate the application of guided adversarial training methods in improving the robustness of facial recognition systems and traffic sign recognition systems for autonomous vehicles, ensuring the security and reliability of these systems in the face of potential adversarial attacks.

[0070] like Figure 1 As shown, the guided adversarial training method for improving the robustness of a deep neural network system provided by an embodiment of the present invention includes:

[0071] S1, an expert model is obtained through clean training, and the similarity between the decision boundary and the clean sample is enhanced by minimizing the output of the member model and the expert model;

[0072] S2, improves the clean accuracy by expanding the difference between the logit value of the correct label and the logit value of the incorrect label, and adjusts the decision boundary by controlling the margin of the clean sample;

[0073] S3, adds the two losses to the initial loss in the form of regularization terms;

[0074] S4, GAT is used to improve the robustness and clean accuracy of the model by integrating the member models that optimize the loss.

[0075] The guided adversarial training method for improving the robustness of deep neural network systems aims to enhance the robustness of deep neural networks in the face of adversarial samples and the classification accuracy of clean samples by combining the knowledge of expert models and the strategy of adjusting decision boundaries. The following is its detailed working principle:

[0076] S1: Expert model training

[0077] The expert model is used as a reference point to guide training. It is trained with clean samples, and its goal is to capture the key features and patterns in the data set. This model is no longer updated after training, and its output is used to guide the training process of the member model to ensure that the member model learns a stable and reliable decision boundary.

[0078] S2: Clean accuracy improvement and decision boundary adjustment

[0079] In order to improve the performance of the model when processing untampered samples, the method focuses on expanding the difference between the model's prediction results (logit values) for correct and incorrect labels. By adjusting the margin of clean samples (i.e., the interval between correct and incorrect predictions), the method can effectively fine-tune the decision boundary of the model, making it able to resist interference while maintaining high accuracy.

[0080] S3: Loss function optimization

[0081] During the guided adversarial training process, the loss of the difference between the output of the expert model and the member model and the loss of the clean sample margin are added to the original loss function of the model in the form of regularization terms. The purpose of this is to optimize the performance of the model on both normal data and adversarial data at the same time, so as to balance the relationship between robustness and clean accuracy.

[0082] S4: GAT Optimization Strategy

[0083] The loss is optimized by integrating the Graph Attention Network (GAT). By learning the relationship between samples and the interaction between samples and labels, GAT can more effectively guide member models to learn robust feature representations. This integrated optimization strategy further improves the robustness of the model against adversarial attacks while maintaining high accuracy for clean samples.

[0084] This guided adversarial training method achieves the goal of enhancing the robustness of the model against attacks while ensuring or improving the classification accuracy of the original clean samples by comprehensively applying expert knowledge guidance, decision boundary adjustment, careful design of loss function and GAT optimization strategy. This method provides important technical support for the application of deep learning models in security-critical fields.

[0085] S1 specifically includes:

[0086]

[0087] Among them, x is a clean sample, F θ (·) is a member model with weight θ, H(·) is an expert model, is the probability distribution of clean samples. However, simply using this loss will affect the diversity of decision boundaries; therefore, the output of clean samples is adjusted based on the member model itself.

[0088] S2 specifically includes: defining Self-Guidence loss

[0089]

[0090] Among them, y is the true label of the clean sample x, Yes F θ (·) The predicted label for x. The parameter η is a smoothing coefficient, η∈(0,1]; smaller values ​​of η will make the model of the logit distribution smoother; conversely, larger values ​​of η will make the difference between the logit values ​​corresponding to the correct label and the logit values ​​associated with the wrong label more obvious; minimizing this loss increases the logit values ​​of the correct label and decreases the logit values ​​of other labels, forcing the model to accurately classify clean examples.

[0091] S3 specifically includes:

[0092]

[0093] in, is the cross entropy loss, and γ is the trade-off parameter between self-guidence and expert-guidence.

[0094] like Figure 2 As shown, the guided adversarial training system for improving the robustness of a deep neural network system provided by an embodiment of the present invention includes:

[0095] The expert model training module is used to obtain an expert model through clean training;

[0096] Output minimization module, used to enhance the similarity between decision boundaries and clean samples by minimizing the outputs of membership models and expert models;

[0097] The clean precision improvement module is used to improve the clean precision by expanding the difference between the logit value of the correct label and the logit value of the incorrect label;

[0098] The decision boundary adjustment module adjusts the decision boundary by controlling the margin of clean samples;

[0099] The member model integration optimization module is used to improve the robustness and clean accuracy of the model by integrating and optimizing the member models of the loss using GAT.

[0100] In order to solve the problems of existing technologies, it is necessary to seek a new integration method that can not only reduce the computational and storage burden, but also consider the interaction between member models to improve robustness. Through experiments, it is found that the weak robust model in the early stage of training still has a relatively considerable recognition accuracy for adversarial samples generated on the properly trained robust model. Figure 4 Therefore, when integrating, we need to consider both the weak robust model in the early stage of the integration training and the latest model after the integration optimizer optimization. This dilemma can be solved by integrating the weights of each historical model on the optimization trajectory. However, this method is still one-sided. Simply adjusting the decision boundary based on adversarial samples may lead to overfitting of member models. Ensembling and averaging overfitted member models may lead to a decrease in the clean accuracy of the integrated model (see Figure 3 Even if the loss in traditional adversarial training is used to incorporate information from natural samples, the effect of improving the robustness of the model is not significant.

[0101] Figure 3 (a) is the decision boundary diagram obtained by training with clean samples. Figure 3(b) is the decision boundary diagram obtained by training with adversarial samples. The figure shows the decision boundaries generated by generating adversarial samples at different times, and the dotted line represents the integrated average of the two. It is found that simply integrating the decision boundaries obtained by training with adversarial samples may lead to a decrease in robustness and clean accuracy.

[0102] Figure 4 Visualization of clean accuracy and adversarial accuracy of member models. Figure 4 (a) Describes the recognition accuracy of the source model on adversarial samples generated by the target model. Figure 4 (b) depicts the clean accuracy and adversarial accuracy of the model at each epoch. All models are obtained by standard adversarial training on CIFAR-10 using WideResNet-34-10. It can be seen that the weakly robust model at the beginning of training also has high recognition accuracy for adversarial samples generated by the strongly robust model at the end of training.

[0103] (1) Furthermore, the present invention proposes a new method called Guided Adversarial Training (GAT), which memorizes the weights of member models in different iterations. Two guidance methods (self-guidance and expert-guidance) are used to mitigate the negative impact of interactions between member models on robustness improvement. The purpose of guidance is to consider both maintaining the diversity of the decision boundaries of member models and maintaining the similarity with natural decision boundaries. Expert-guidance introduces an expert model to increase this similarity by increasing the logit similarity with the expert model on clean samples. Self-guidance starts from the model itself and expands the difference between the logit values ​​of the correct labels and the logit values ​​of the incorrect labels to maintain this similarity. Experiments have shown that our method can effectively resist most adversarial attacks and outperforms the most advanced methods in terms of clean and adversarial accuracy.

[0104] 1. Motivation

[0105] If you want to improve the robustness of adversarial training through ensemble training, you have to face two problems: one is the resource problem, because adversarial training of each member model will cause computing and storage resource constraints. The other is to reduce the negative impact of the interaction between member models on the improvement of robustness.

[0106] Considering the resource problem, the present invention adopts weight integration instead of model result integration to solve the shortage of computing and storage resources. Figure 4As observed in (a), we found that the member models in the early stage of training (weakly robust models) are still very robust to adversarial samples generated on the member models in the later stage of training (strongly robust models). For example, the member model in epoch15 can identify adversarial samples generated by the member model in epoch75 with an accuracy of about 72%.

[0107] Figure 4 (b) shows that the robustness and clean accuracy of member models in adjacent epochs have certain similarities, which means that these models may have similar decision boundaries. Since DNN is no longer a weak classifier in most cases, this is not conducive to building an integrated model. Therefore, when integrating weights, we should focus on remembering the weights of the latest trained model while not forgetting the weights of the weakly robust models in the past.

[0108] Considering the second problem, we need to mitigate the impact of the interaction between member models on the improvement of robustness. This interaction can be divided into two cases. (1) If the decision boundaries of the member models are too similar, the use of the ensemble method may cause the performance of the ensemble model to be inferior to that of the member models. (2) If the decision boundaries of the member models are too different, the influence of the member models on the ensemble model will cancel each other out, resulting in a decrease in clean accuracy. Figure 3 . Figure 4 (b) shows that the robust accuracy and clean accuracy of member models at adjacent epochs are somewhat similar. This means that these models may have similar decision boundaries. Since DNNs are no longer weak classifiers in most cases, this is not conducive to improving the effectiveness of the ensemble model. Therefore, we hope to enhance the ensemble effect by increasing the diversity of the decision boundaries of the member models while ensuring that they are consistent with the natural decision boundaries.

[0109] To address these two challenges, this paper proposes a novel weight ensemble adversarial training method, namely GAT. This method mitigates the negative impact of the interaction between member models on improving accuracy through two types of guidance: Self-Guidance and Expert-Guidance. At the same time, it also enhances the historical memory of the member model weights.

[0110] 2. Symbolic Representation and Weight Integration

[0111] make represents a dataset, where x represents a clean sample and y corresponds to its ground truth label. The DNN classifier is denoted by F θ (x), where θ represents all trainable parameters. Considering a classification scenario with L classes, the output vector F θ (x)∈R L . Let θ = {θ1,θ2,…θT} represents the candidate weight pool, θ i (i=1,…,T) represents the model parameters at the i-th iteration. An adversarial sample x' is a clean sample x to which a carefully designed small perturbation δ is added, i.e., x'=x+δ. The classifier will give an incorrect prediction with high confidence, but humans will not be fooled.

[0112] Without considering any regularization, traditional classification can usually be expressed as: in Represents the loss function, x represents the input, and θ represents a set of model parameters. The core of adversarial training is to build a robust model that can generalize well any sample with a small perturbation ∈, which can be formulated as a maximum minimization problem:

[0113]

[0114] where ∈ represents the perturbation budget, ||·|| p represents the p-norm. The inner maximization attempts to find an adversarial perturbation that maximizes the loss, while the outer minimization aims to obtain a classifier that is robust to adversarial examples. Usually, Set to cross entropy loss.

[0115] PGD ​​is usually used to solve the internal maximization problem. This helps to increase the diversity of decision boundaries between member models. When the minimum unit of weight integration is iteration, the decision boundaries obtained by the member models show greater diversity. This is because different clean samples are used for each batch of models throughout the iteration, which introduces randomness in the distribution of adversarial samples generated for each clean sample. However, when an epoch is regarded as the minimum unit, it is possible for member models to learn similar feature representations with similar decision boundaries. This is attributed to the similarity of feature representations between adversarial samples generated from the same clean dataset. This similarity is not conducive to improving the overall effectiveness of the integrated model. Therefore, we set the minimum unit of integration to one iteration. The diversity of member model weights is achieved by the randomness introduced when selecting clean samples in each batch and the variability of the generated adversarial samples.

[0116] After solving the diversity of decision boundaries,44 we need to consider how to integrate the weights. A natural consideration is to integrate by simple averaging: However, this method has two problems: first, it cannot capture the latest changes keenly; second, it may lead to a decrease in clean accuracy (see Figure 4 ). The present invention uses the exponential moving average (EMA) to calculate the optimal weight:

[0117]

[0118] Where α is the memory factor and δ(·) is the unit impulse function (i.e., δ(0) = 1, otherwise 0). As α becomes larger, the degree of memory of historical weights also increases. This approach not only utilizes the latest recommendations for the current optimization, but also retains the effects of previous weight states.

[0119] 3. Guided confrontation training

[0120] While improving the diversity of decision boundaries of weakly robust models, the similarity between decision boundaries and natural decision boundaries must also be ensured to enhance the robustness and clean accuracy of the ensemble model. A typical approach to improving this similarity is to design a loss related to clean samples. However, experiments have shown that these loss functions have a weak effect on improving the robustness of ensemble models. One possible reason is that these losses weaken the diversity of member model decision boundaries while improving the similarity between the decision boundaries of member models and natural decision boundaries. Therefore, the present invention uses two special loss constraints to achieve our goal: Self-Guidence loss and Expert Guidence loss.

[0121] Since each iteration of standard adversarial training adjusts the decision boundary according to the adversarial sample, the adversarial sample will be regenerated according to the current decision boundary in the next iteration, which makes the decision boundary naturally diverse. But at the same time, this will also cause the member model's logits for clean samples to change significantly. In order to reduce this change, a natural idea is to obtain an expert model H(x) through clean training, and minimize the member model F θ (x) and the output of the expert model H(x) to enhance the similarity between the decision boundary and the clean samples.

[0122]

[0123] in, is the probability distribution of clean samples. However, simply using this loss may affect the diversity of decision boundaries. Therefore, starting from the member model itself, the output of clean samples is adjusted. Looking back at the original intention of designing Self-Guidenceloss, it is to enable the model to have the ability to adjust the decision boundary according to clean samples, while not affecting the diversity of decision boundaries. To improve clean accuracy, you can expand the difference between the logit value of the correct label and the logit value of the incorrect label. Therefore, by controlling the margin of the clean sample to adjust the decision boundary, define Self-Guidenceloss

[0124]

[0125] Among them, y is the true label of the clean sample x, Yes F θ (·) The predicted label for x. The parameter η is the smoothing coefficient, η∈(0,1]. Smaller values ​​of η will make the model of the logit distribution smoother. Conversely, the larger η is, the more obvious the difference between the logit values ​​corresponding to the correct label and the logit values ​​associated with the wrong label will be. Minimizing this loss will increase the logit values ​​of the correct label and decrease the logit values ​​of other labels, thus forcing the model to accurately classify clean examples. These two losses are added to the initial loss in the form of regularization terms.

[0126]

[0127] in, is the cross entropy loss, and γ is the trade-off parameter between self-guidence and expert-guidence. The GAT we proposed improves the robustness and clean accuracy of the model by integrating member models that optimize this loss. The specific process of the algorithm is shown in Algorithm 1.

[0128]

[0129] An application embodiment of the present invention provides a computer device, which includes a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor executes the steps of a guided adversarial training method for improving the robustness of a deep neural network system.

[0130] An application embodiment of the present invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps of a guided adversarial training method for improving the robustness of a deep neural network system.

[0131] An application embodiment of the present invention provides an information data processing terminal, which is used to implement a guided adversarial training system for improving the robustness of a deep neural network system.

[0132] The technical solution of the present invention has wide applicability in image classification tasks at various granularities, and can flexibly meet the needs of different business scenarios. We applied our technology to an image classification system containing WideResNet-34-10 and ResNet18 models, optimized using the SGD optimizer, and conducted extensive tests on real image datasets (CIFAR-10, CIFAR-100). The model obtained by this technical solution has strong resistance to adversarial samples and high recognition accuracy for clean samples under both black-box and white-box settings. This technical solution provides different degrees of performance improvement effects for different model structures and datasets, and provides strong support for adjusting parameters, optimizers, model structures, optimizing computing resource usage, or integrating with other security measures according to specific application scenarios. This performance improvement is not only significant in specific fields, but also has cross-domain capabilities. This technical solution is applied to classification tasks in multiple fields such as medical images, autonomous driving, and the Internet of Things, which can protect the model and obtain excellent performance.

[0133] The present invention conducts extensive experiments in both white-box and black-box settings. All experiments are conducted on real image datasets CIFAR-10 and CIFAR-100.

[0134] Use WideResNet-34-10 and ResNet18 as the default models with momentum of 0.9 and global weight decay of 2×10 -4 The SGD optimizer of . The model was trained for 100 epochs on four NVIDIA TITAN Xp GPUs with a batch size of 128. For ResNet18, the initial learning rate was set to 0.01, and the initial learning rate of WRN34-10 was set to 0.1. The learning rate decayed to one-tenth at the 75th and 90th epochs. We used PGD10 to generate adversarial samples required for training. We compared GAT with the following strong baseline models: SAT, TRADES, MART, LBGAT, SEAT. Except for the above settings, all parameters follow the original settings. For GAT, we set γ = 1, η = 0.995.

[0135] Mainly use adversarial attacks under infinite norm constraints. PGD20, PGD100, MI-FGSM, CW, and AA are used as the main basic analysis to explore the robustness of adversarial models under white-box settings. In black-box settings, FGSM, PGD20, TI-FGSM, MI-FGSM, DI-FGSM, and VMI-FGSM are used to evaluate the model effect. The perturbation budget of all attacks is 8 / 255. PGDT refers to a PGD attack with T iterations, and its step_size is 0.007.

[0136] 2. Effectiveness of defense in white-box setting

[0137] In the white-box setting, all attacks have access to the architecture and parameters of the target model. GAT has two training methods: when γ = 0, GAT mainly uses self-guided adversarial training; when γ = 1, GAT uses both Expert-Guidance and Self-Guidance training methods to further improve the accuracy of the model. A study of Tables 1 and 2 shows that the clean accuracy and adversarial accuracy of GAT (γ = 1) greatly exceed those of other methods. It is worth noting that the clean accuracy of GAT (γ = 1) is significantly better than that of other methods, with a 2.40% improvement in clean accuracy compared to the second-ranked method in the WRN-34-10 model results trained on CIFAR-10. In ResNet-18 trained on CIFAR-10, this improvement is more obvious, reaching 3.06%, which may be due to the simpler model structure of ResNet-18.

[0138] However, compared with GAT(γ=0), the model trained with GAT(γ=1) is less effective under adversarial attacks such as PGD20, PGD100, and MI-FGSM. One possible explanation is that The diversity of decision boundaries among member models is reduced. This results in the ensemble model becoming less resistant to weakly robust attacks (PGD, MI-FGSM). Nevertheless, GAT (γ = 1) can still maintain relatively high accuracy under more complex attacks (such as CW and AA), indicating that it can resist complex and sophisticated adversarial strategies. These findings highlight the delicate balance required between the diversity of decision boundaries among member models and their similarity to clean decision boundaries.

[0139] Table 1: Accuracy (%) of each method for different types of adversarial examples in the white-box setting, with the target model being ResNet-18.

[0140]

[0141]

[0142] Table 2: Accuracy (%) of each method for different types of adversarial examples in white-box setting, the target model is WRN-34-10.

[0143]

[0144] 3. Effectiveness of defense in black box setting

[0145] In a black-box environment, the attacker only knows part of the output of the attacked model when generating adversarial examples. We select the best performing models in the white-box environment for testing. Tables 3 and 4 show the outstanding performance of GAT in different datasets and model structures. Although the robustness of GAT (γ = 0) is improved compared with other methods, there is still a large gap compared with GAT (γ = 1), which highlights the indispensability of expert guidance. The introduction of expert guidance helps to enhance the robustness of the model in a black-box environment.

[0146] Table 3: Adversarial accuracy of defense methods in black-box setting. The target model is ResNet-18 and the proxy model is adversarially trained VGG-16.

[0147]

[0148] Table 4: Adversarial accuracy of defense methods in black-box setting. The target model is WRN-34-10 and the proxy model is adversarially trained VGG-16.

[0149]

[0150] 4. Ablation Experiment

[0151] 4.1 Impact of Weight Integration

[0152] WRN-34-10 was trained on various datasets. Figure 5 The changes in clean accuracy and adversarial accuracy on the test set for each epoch are detailed. At the same time, the data in Table 5 emphasizes the significant impact of the weight integration strategy in improving robust accuracy. Compared with the slight improvement of 0.23% in clean accuracy, the adversarial accuracy, especially the accuracy of adversarial attack (AA), has been significantly improved by nearly 5.85%.

[0153] Table 5: Ablation results of GAT. All ablation experiments use WRN-34-10 trained on CIFAR-10.

[0154]

[0155] Figure 5 This is the curve of the clean accuracy and adversarial accuracy of GAT. This curve is obtained by training WRN-34-10 on CIFAR-10. It can be seen that all parts of GAT have a positive effect on improving the clean accuracy and adversarial accuracy.

[0156] It turns out that the weight combination is more effective in improving adversarial accuracy than its impact on clean accuracy. Figure 5It can be seen that one of the reasons that causes the accuracy of the model to classify adversarial examples at different epochs is lower than the accuracy of classifying clean examples. More importantly, each iteration generates new adversarial examples on the current model, which leads to significantly different decision boundaries and thus strengthens the ensemble effect.

[0157] 4.2 Impact

[0158] The present invention specifically describes a method not comprising The details of the model (GAT(γ=0)) are shown in Tables 1 and 2. It is observed that when omitting When , the clean accuracy decreases, but the robustness of GAT to weak attacks in the white-box environment increases. At the same time, the robustness to strong attacks decreases on the CIFAR-10 dataset. This decrease can be attributed to the removal of Lacking the guidance of the expert model, the model tends to overfit the adversarial examples generated by PGD. We note that this phenomenon is not as obvious in CIFAR-100, which may be because CIFAR-100 has more classes and overfitting is inherently more challenging. The main function of is to improve the clean accuracy and play a regular role when the model is prone to overfitting.

[0159] 4.3 Impact

[0160] When the loss is omitted When , both pure accuracy and adversarial accuracy show a significant decrease, as shown in Table 5. Figure 5 In , the curve describing the model's adversarial accuracy shows a steeper change, while Figure 5 (c) shows that When , the adversarial accuracy after weight integration is higher. These observations together highlight that The important role played in enhancing the diversity of decision boundaries among member models.

[0161] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.

[0162] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.

Claims

1. A guided adversarial training method for improving the robustness of a deep neural network system, characterized in that: For a single model, by integrating the weights optimized by the optimizer each time, the memory of the historical state of the model weights is enhanced to prevent the model from catastrophic forgetting; self-guidance and expert guidance are used to guide member models to learn the correct decision boundaries, so that the model can converge faster and improve the accuracy and robustness of the model; include: S1, an expert model is obtained through clean training, and the similarity between the decision boundary and the clean decision boundary is enhanced by minimizing the output of the member model and the expert model; S2, improves the clean accuracy by expanding the difference between the logit value of the correct label and the logit value of the incorrect label, and adjusts the decision boundary by controlling the margin of the clean sample; S3, adds the two losses to the initial loss in the form of regularization terms; S4, GAT is used to improve the robustness and clean accuracy of the model by integrating the member models that optimize the loss; S1 specifically includes: in, is the probability distribution of clean samples. However, simply using this loss will affect the diversity of decision boundaries; therefore, starting from the member model itself, the output of clean samples is adjusted; S2 specifically includes: defining Self-Guidence loss Among them, y is the true label of the clean sample x', Yes F θ (·) The predicted label for x'; the parameter η is the smoothing coefficient, η∈(0,1]; a smaller value of η will make the model of the logit distribution smoother; conversely, a larger η will make the difference between the logit values ​​corresponding to the correct label and the logit values ​​associated with the wrong label more obvious; minimizing this loss will increase the logit values ​​of the correct label and decrease the logit values ​​of other labels, thus forcing the model to accurately classify clean examples; S3 specifically includes: in, is the cross entropy loss, γ is the trade-off parameter between self-guidence and expert-guidence; In facial recognition technology, adversarial attacks may lead to security issues, such as illegal access to protected resources; applying this guided adversarial training method can improve the robustness of facial recognition systems; 1) Expert model training: First, a large-scale facial image dataset is used to train an expert facial recognition model that can accurately capture facial features and identity information; 2) Member model training: Subsequently, a guided adversarial training method is applied to the member model, in which the classification accuracy of clean samples is improved by minimizing the difference between the outputs of the member model and the expert model, and the decision boundary is adjusted to enhance the robustness to adversarial attacks; 3) Deployment and Evaluation: After training, the optimized facial recognition system is deployed in the entrance security monitoring system to prevent illegal access through adversarial samples while maintaining efficient and accurate recognition of real users.

2. A guided adversarial training system for improving the robustness of a deep neural network system by implementing the method of claim 1, characterized in that: include: The expert model training module is used to obtain an expert model through clean training; An output minimization module for enhancing the similarity between the decision boundary and the clean decision boundary by minimizing the outputs of the member model and the expert model; A robust accuracy improvement module is used to improve robust accuracy by enlarging the difference between the logit values ​​of the correct labels and the logit values ​​of the incorrect labels; The decision boundary adjustment module adjusts the decision boundary by controlling the margin of the adversarial sample; The member model integration optimization module is used to improve the robustness and clean accuracy of the model by integrating and optimizing the member models of cross entropy loss using GAT.

3. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the guided adversarial training method for improving the robustness of a deep neural network system as described in claim 1.

4. A computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to perform the steps of the guided adversarial training method for improving the robustness of a deep neural network system as described in claim 1.

5. An information data processing terminal, which is used to implement the guided adversarial training system for improving the robustness of a deep neural network system as described in claim 2.