Adversarial sample generation method based on belief attack and significant region perturbation restriction
By generating adversarial samples with low perturbation and high transferability based on belief attacks and significant area perturbation restrictions, the problem of perceptible perturbation and low transferability of adversarial sample generation methods in the existing technology is solved, and the robustness of the DNN model is improved. sex and safety.
Patent Information
- Application Number
- CN202111655287.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-12-31
AI Technical Summary
Existing adversarial sample generation methods have perceptible disturbance and low transferability problems, resulting in adversarial samples being less aggressive on the black-box target model and requiring greater computational overhead.
Using a method based on belief attack and significant area perturbation restriction, a significant area binary mask is generated through class activation mapping technology, combined with the I-FGSM method to generate global adversarial perturbations, and through Hadamard product operation to generate significant area adversarial perturbations, and iteratively generate adversarial samples , clipping overflow pixel values until the preset termination condition is reached.
It effectively reduces the perceptibility of adversarial perturbations, improves the transferability and visual quality of adversarial samples, and improves the robustness and security of DNN models.
Smart Images

Figure CN114399630B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of deep neural network technology and computer vision, and in particular to a method for generating adversarial samples based on belief attack and significant region perturbation restriction. Background Art
[0002] The widespread application of deep neural networks has greatly improved the performance of many computer vision tasks, such as image classification, object detection, image segmentation, etc. However, recent studies have found that deep neural networks (DNNs) are easily deceived by artificially designed adversarial samples. In 2014, Szegedy et al. first discovered the existence of adversarial samples in the field of image classification, that is, adding small perturbations to the original image will cause the DNN model to make incorrect judgments. What's more serious is that these small perturbations are also very subtle and difficult to be perceived by the human visual system. This discovery reveals that there are many security issues in the DNN model, which will cause uncontrollable security risks if not resolved. Therefore, generating highly aggressive adversarial samples can not only detect vulnerabilities in the DNN model, but also improve the robustness of the DNN model.
[0003] Existing adversarial sample generation methods can be divided into two categories: white-box attack methods and black-box attack methods. White-box attack methods assume that all information about the target network is known and use this information to generate adversarial samples. In contrast, black-box attack methods can generate offensive adversarial samples without knowing any information about the target network. Since most model information in the real world is difficult to obtain, black-box attacks are more practical. Existing black-box attack models can be further divided into two categories: query-based attack methods and transfer-based attack methods. Query-based methods query the target model using some input images, and then use the queried information to generate adversarial samples to attack the black-box model. Depending on the query information, this type of method can be further divided into query methods based on prediction scores and query methods based on prediction labels. For the prediction score-based method, Chen et al. proposed the Zeroth Order Optimization Based Black-box Attacks (ZOO) black-box adversarial sample generation method in the article "Zoo: Zeroth Order Optimization Based Black-box Attacks to Deep Neural Networks without Training Substitute Models [C] / / ACM 10th ACM Workshop on Artificial Intelligence and Security, Dallas, TX, United States, pages 15-26, 2017." This method uses the gradient estimation method to replace the gradient information of the black-box target model based on the prediction score to generate adversarial samples. For the query method based on the prediction label, Brendel et al. proposed the boundary attack method in the article "Decision-based adversarial attacks: Reliable attacks against black-box machine learning models [C] / / International Conference on Learning Representations, Vancouver, BC, Canada, 2018." This method randomly samples candidate perturbations of adversarial samples from a specific distribution, and then selects the perturbation that minimizes the loss function as the adversarial perturbation. Although query-based attack methods can achieve better black-box attack effects, such methods inevitably introduce high computational overhead because they require a large number of query operations.Transfer-based methods aim to improve the transferability of adversarial samples generated by white-box models to attack target models. They can also be divided into two categories: substitution model-based attack methods and gradient-based attack methods. Substitution model-based attack methods aim to train a white-box substitution model to generate adversarial samples. Zhou et al. proposed the DaST method in the article "Dast: Data-free substitute training for adversarial attacks[C] / / IEEE / CVF Conference on Computer Vision and Pattern Recognition(CVPR), Seattle, WA, United states, pages 234-243, 2020." This method trains a generative model and a substitution model by querying the black-box target model multiple times, and then uses the substitution model to generate adversarial samples. Substitution model-based methods also require a large number of query operations. Gradient-based attack methods aim to improve the transferability of adversarial samples generated by white-box models. Kurakin et al. proposed the I-FGSM method in the article "Adversarial examples in the physical world[C] / / International Conference on Learning Representations, Caribe Hilton, San Juan, Puerto Rico, pages 99-112, 2016. This method generates adversarial samples through multiple iterations. Although gradient-based attack methods do not require a large number of query operations, there are still the following problems: First, gradient-based methods usually ignore the semantic information in the input image that plays an important role in the decision-making of the DNN model, so the adversarial samples generated by these methods are full of perceptible perturbations, which leads to poor visual effects; second, the adversarial samples generated by gradient-based methods are less aggressive on black-box target models, and are particularly obvious on some defense models.
[0004] Similar to the process of training a neural network model, the process of generating adversarial samples can also be viewed as an optimization problem. Specifically, generating adversarial samples under a white-box model can be viewed as the process of training a neural network model. Conversely, using adversarial samples to attack a black-box model can be viewed as the process of verifying a neural network model. Therefore, an optimization method with good generalization can effectively improve the transferability of adversarial samples. Zhuang et al. proposed an adaptive optimization method based on belief in the article "AdaBelief Optimizer: Adapting Stepsizes by the Belief in Observed Gradients[C] / / Neural InformationProcessing Systems.2020,33:18795-18806", which combines the advantages of stochastic gradient descent (SGD) and the Adam algorithm, with both the good generalization of the SGD algorithm and the fast convergence and stability of the Adam algorithm. Applying the idea of belief to the field of adversarial sample generation can effectively improve the transferability of adversarial samples.
[0005] Based on the above analysis, it can be seen that the existing adversarial sample generation methods have problems such as perceptible disturbance and low mobility. Therefore, in view of the problems existing in the existing methods, the present invention proposes an adversarial sample generation method based on belief attack and significant area perturbation restriction to generate low-perturbation and high-mobility adversarial samples, which can detect the vulnerabilities of the DNN model and serve as an evaluation indicator of the security of the DNN model, thereby improving the robustness and security of the DNN model. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide an adversarial sample generation method based on belief attack and significant area perturbation limitation, which effectively solves the problems of perceptible disturbance and low mobility in the existing adversarial sample generation methods, facilitates the detection of vulnerabilities in the DNN model, and serves as an evaluation indicator of the security of the DNN model, thereby improving the robustness and security of the DNN model. The generated adversarial samples have low disturbance and high mobility.
[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0008] The adversarial sample generation method based on belief attack and significant region perturbation restriction includes the following steps:
[0009] Step S1: providing an original image, wherein the original image is used as training data for the DNN model;
[0010] Step S2: Provide a white-box target model, use a dataset containing the original image as a training dataset, use the class activation mapping technique to generate a binary mask of the salient regions of the original image, and use the belief-based attack method combined with the I-FGSM adversarial sample generation method to generate a global adversarial perturbation;
[0011] Step S3: performing a Hadamard product operation on the generated global adversarial perturbation and the salient region binary mask to generate a salient region adversarial perturbation;
[0012] Step S4: Add the salient region adversarial perturbation to the input image,
[0013] Step S5: Repeat steps S2-S4 to iteratively generate image adversarial samples and crop overflowing pixel values until the preset termination condition is reached. The adversarial sample generated by the last iteration is used as the output adversarial sample.
[0014] A further improvement of the technical solution of the present invention is that in step 1, the original image comes from the ImageNetValidation data set, and the original image includes 1,000 pictures of different categories.
[0015] A further improvement of the technical solution of the present invention is that in step 2, the white box model adopts one of Inception-v3, Inception-v4, Inception-Resnet-v2, and Resnet-v2-101.
[0016] A further improvement of the technical solution of the present invention is that: in the step 2, the class activation mapping technology is based on the Grad-CAM method, and the class activation map is obtained by calculating the neuron importance weights of the white box target model with respect to the input image and weightedly fusing it with the activation feature map, and then generating the corresponding salient area binary mask;
[0017] The process of obtaining the binary mask of the salient area is specifically expressed as:
[0018]
[0019]
[0020] in, is the important weight of the neuron of the kth feature map for category c, y c is the gradient corresponding to the score of class c before the softmax layer, represents the pixel value of the kth feature map at position (i, j), Z is the number of pixels in the input image, H(·) is the salient region selection function, S f(r, x, y) is the pixel region with a scale r selected as the salient binary mask on the classifier f for the input image x with label y; where the scale r ranges from [0.1, 1], indicating that the most salient region with a scale r is selected.
[0021] A further improvement of the technical solution of the present invention is that in step 2, the idea of the belief-based attack method includes: using the observed gradient to calculate its exponential moving average, and using the following formula to calculate the observed gradient:
[0022]
[0023] Among them, J is the loss function of the classifier, ||·||1 is the L1 norm;
[0024] The EMA of the observed gradient and the square of the observed gradient is calculated based on the observed gradient using the following formula:
[0025] m t =β1m t-1 +(1-β1)g t
[0026] s t =β2s t-1 +(1-β2)(g t -m t ) 2
[0027] Among them, m t Observe the gradient g for the tth iteration t EMA,s t is the EMA of the observed gradient square, β1=0.99 and β2=0.999 are smoothing parameters;
[0028] Based on the EMA of the observed gradient and the square of the observed gradient, the adversarial perturbation is calculated using the following formula:
[0029]
[0030] Where, δ = 1e-8;
[0031] The adversarial perturbation is subjected to bias correction, regularization and scaling operations to obtain the global adversarial perturbation, which is calculated using the following formula:
[0032]
[0033]
[0034]
[0035] Among them, α is the initial step size, ε is the perturbation amount, N is the number of pixels in the input image, T is the total number of iterations, and λ is the initial step size. t For deviation correction, is the global adversarial perturbation of the tth iteration, η is the perturbation control factor; the perturbation amount ε = 16, indicating that the generated adversarial perturbation range is [-16, 16].
[0036] A further improvement of the technical solution of the present invention is that in step 3, the calculation formula for the significant area anti-disturbance is as follows:
[0037]
[0038] in, It is the Hadamard product operation, which performs a bitwise matrix multiplication operation.
[0039] A further improvement of the technical solution of the present invention is that in step 5, the calculation formula for adding disturbance to the input image operation and performing overflow pixel value clipping is as follows:
[0040]
[0041]
[0042] Among them, Clip(·) limits the disturbance amount to within the range of disturbance ε;
[0043] The preset termination condition includes: reaching a preset number of iterations T=10.
[0044] Due to the adoption of the above technical solution, the technical progress achieved by the present invention is:
[0045] The present invention effectively solves the problems of perceptible disturbance and low mobility in existing adversarial sample generation methods, facilitates the detection of vulnerabilities in DNN models, and serves as an evaluation indicator of the security of DNN models, thereby improving the robustness and security of DNN models. The generated adversarial samples have low disturbance and high mobility.
[0046] (1) Based on the characteristics of different DNN models in terms of salient area range and shape similarity, this paper proposes a global adversarial perturbation limitation method based on salient area perturbation limitation. This method greatly reduces the adversarial perturbation without affecting the adversarial transferability, thereby obtaining adversarial perturbations that are not easily perceived by the human eye, greatly improving the visual quality.
[0047] (2) The present invention utilizes the good convergence and generalization of the Adabelief optimizer in training the DNN model, and proposes a belief-based adversarial sample generation method, which makes it easy for the adversarial sample training process to escape the local maximum, thereby greatly improving the transferability of the adversarial samples.
[0048] (3) The present invention can be naturally and efficiently combined with the existing gradient-based adversarial sample generation method, thereby further improving the transferability of adversarial samples. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a schematic diagram of an embodiment of an adversarial sample generation method based on belief attack and significant area perturbation limitation provided by the present invention. DETAILED DESCRIPTION
[0050] The present invention is further described in detail below in conjunction with embodiments:
[0051] like Figure 1 As shown, the main content of the present invention is to propose an adversarial sample generation method based on belief attack and significant area perturbation limitation, which can be used to detect vulnerabilities of DNN models and serve as an evaluation indicator of the security of DNN models, thereby improving the robustness and security of DNN models.
[0052] In order to make the technical method of the present invention clear, the present invention is further described in detail below with reference to the accompanying drawings and embodiments.
[0053] Step S1: providing an original image, wherein the original image is used as training data for the DNN model.
[0054] In this embodiment, the original images come from the ImageNet Validation dataset, from which 1,000 pictures of different categories are selected, and almost all of these pictures can be correctly classified by the test model.
[0055] Step S2: Provide a white-box target model, use a dataset containing the original image as a training dataset, use the class activation mapping technique to generate a binary mask of the salient area of the original image, and use the belief-based attack method to fuse the I-FGSM adversarial sample generation method to generate a global adversarial perturbation.
[0056] In this embodiment, Inception-v3 is used as the white box target model. The white box model can also use other models such as Inception-v4, Inception-Resnet-v2, Resnet-v2-101, etc. Figure 1 As shown in the figure, the class activation mapping technology is based on the Grad-CAM method. It obtains the class activation map by calculating the neuron importance weights of the white-box target model with respect to the input image and weightedly fusing it with the activation feature map, and then generates the corresponding salient area binary mask.
[0057] The process of obtaining the binary mask of the salient area can be specifically expressed as:
[0058]
[0059]
[0060] in, is the important weight of the neuron of the kth feature map for category c, y c is the gradient corresponding to the score of class c before the softmax layer, represents the pixel value of the kth feature map at position (i, j), Z is the number of pixels in the input image, H(·) is the salient region selection function, S f (r, x, y) is the pixel region with a ratio of r selected as the salient binary mask on the classifier f for the input image x with a label of y, where the ratio r ranges from [0.1, 1], indicating that the most salient region with a ratio of r is selected. In this embodiment, r=0.8 is selected.
[0061] In this embodiment, the idea of the belief-based attack method includes: using the observed gradient to calculate its exponential moving average (EMA), and using the following formula to calculate the observed gradient:
[0062]
[0063] Among them, J is the loss function of the classifier and ||·||1 is the L1 norm.
[0064] The EMA of the observed gradient and the square of the observed gradient is calculated based on the observed gradient using the following formula:
[0065] m t =β1m t-1 +(1-β1)g t
[0066] s t =β2s t-1 +(1-β2)(g t -m t ) 2
[0067] Among them, m t Observe the gradient g for the tth iteration t EMA,s t is the EMA of the squared observed gradient, and β1=0.99 and β2=0.999 are smoothing parameters.
[0068] Based on the EMA of the observed gradient and the square of the observed gradient, the adversarial perturbation is calculated using the following formula:
[0069]
[0070] Here, δ is a very small value used for numerical calculation stability. In this embodiment, δ=1e-8.
[0071] The global adversarial perturbation can be obtained by performing bias correction, regularization, and scaling operations on the adversarial perturbation, which is calculated using the following formula:
[0072]
[0073]
[0074]
[0075] Among them, α is the initial step size, ε is the perturbation amount, N is the number of pixels in the input image, T is the total number of iterations, and λ is the initial step size. t For deviation correction, is the global adversarial disturbance of the tth iteration, and η is the disturbance control factor. In this embodiment, the disturbance amount ε=16, indicating that the generated adversarial disturbance range is [-16, 16].
[0076] Step S3: Perform a Hadamard product operation on the generated global adversarial perturbation and the salient region binary mask to generate the salient region adversarial perturbation.
[0077] In this embodiment, the calculation formula for the salient region anti-disturbance is as follows:
[0078]
[0079] in, It is the Hadamard product operation, which performs a bitwise matrix multiplication operation.
[0080] Step S4: Add the salient region adversarial perturbation to the input image,
[0081] Step S5: Repeat steps S2-S4 to iteratively generate image adversarial samples and crop overflowing pixel values until the preset termination condition is reached. The adversarial sample generated by the last iteration is used as the output adversarial sample.
[0082] In this embodiment, the calculation formula for adding disturbance to the input image operation and performing overflow pixel value clipping is as follows:
[0083]
[0084]
[0085] Among them, Clip(·) limits the perturbation amount to the range of perturbation ε.
[0086] In step S5, the preset termination condition includes: reaching a preset number of iterations T=10.
Claims
1. An adversarial sample generation method based on belief attack and significant region perturbation restriction, characterized in that: The steps include: Step S1: providing an original image, wherein the original image is used as training data for the DNN model; Step S2: Provide a white-box target model, use a dataset containing the original image as a training dataset, use the class activation mapping technique to generate a binary mask of the salient regions of the original image, and use the belief-based attack method combined with the I-FGSM adversarial sample generation method to generate a global adversarial perturbation; Step S3: performing a Hadamard product operation on the generated global adversarial perturbation and the salient region binary mask to generate a salient region adversarial perturbation; Step S4: Add the salient region adversarial perturbation to the input image, Step S5: Repeat steps S2-S4 to iteratively generate image adversarial samples and clip overflowed pixel values until a preset termination condition is reached. The adversarial sample generated by the last iteration is used as the output adversarial sample. In step 2, the idea of the belief-based attack method includes: using the observed gradient to calculate its exponential moving average, and using the following formula to calculate the observed gradient: Among them, J is the loss function of the classifier, ||·||1 is the L1 norm; The EMA of the observed gradient and the square of the observed gradient is calculated based on the observed gradient using the following formula: m t =β1m t-1 +(1-β1)g t s t =β2s t-1 +(1-β2)(g t -m t ) 2 Among them, m t Observe the gradient g for the tth iteration t EMA,s t is the EMA of the observed gradient square, β1=0.99 and β2=0.999 are smoothing parameters; Based on the EMA of the observed gradient and the square of the observed gradient, the adversarial perturbation is calculated using the following formula: Where, δ = 1e-8; The adversarial perturbation is subjected to bias correction, regularization and scaling operations to obtain the global adversarial perturbation, which is calculated using the following formula: Among them, a is the initial step size, ε is the perturbation amount, N is the number of pixels in the input image, T is the total number of iterations, and λ t For deviation correction, is the global adversarial perturbation of the tth iteration, η is the perturbation control factor; the perturbation amount ε = 16, indicating that the generated adversarial perturbation range is [-16, 16].
2. The adversarial sample generation method based on belief attack and significant region perturbation limitation according to claim 1, characterized in that: In step 1, the original image comes from the ImageNetValidation dataset, and the original image includes 1,000 pictures of different categories.
3. The adversarial sample generation method based on belief attack and significant region perturbation limitation according to claim 1, characterized in that: In step 2, the white box model adopts one of Inception-v3, Inception-v4, Inception-Resnet-v2, and Resnet-v2-101.
4. The adversarial sample generation method based on belief attack and significant region perturbation limitation according to claim 1, characterized in that: In step 2, the class activation mapping technique is based on the Grad-CAM method, which obtains a class activation map by calculating the neuron importance weights of the white-box target model with respect to the input image and weightedly fusing it with the activation feature map, and then generates a corresponding salient region binary mask; The process of obtaining the binary mask of the salient area is specifically expressed as: in, is the important weight of the neuron of the kth feature map for category c, y c is the gradient corresponding to the score of class c before the softmax layer, represents the pixel value of the kth feature map at position (i, j), Z is the number of pixels in the input image, H(·) is the salient region selection function, and s f (r, x, y) is the pixel region with a scale r selected as the salient binary mask on the classifier f for the input image x with label y; where the scale r ranges from [0.1, 1], indicating that the most salient region with a scale r is selected.
5. The adversarial sample generation method based on belief attack and significant region perturbation limitation according to claim 1, characterized in that: In step 3, the calculation formula of the salient region anti-disturbance is as follows: in, It is the Hadamard product operation, which performs a bitwise matrix multiplication operation.
6. The adversarial sample generation method based on belief attack and significant region perturbation limitation according to claim 5, characterized in that: In step 5, the calculation formula for adding disturbance to the input image operation and performing overflow pixel value clipping is as follows: Among them, clip(·) limits the perturbation amount to the range of perturbation ε; The preset termination condition includes: reaching a preset number of iterations T=10.
Citation Information
Patent Citations
Adversarial sample generation method and system
CN112633280A
Deep learning implementation method and system based on mimicry mechanism
CN113537284A
