A method and device for collaboratively countering sample attacks and backdoor attacks
Through the collaborative method of adversarial sample attacks and backdoor attacks, multiple rounds of training and fusion are used to generate collaborative adversarial samples, which solves the problem of concealment and robustness of attack methods in the existing technology, and significantly improves the attack success rate and concealment. characteristics, breaking through the recognition ability of the self-learning model.
Patent Information
- Application Number
- CN202410741424.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-06-11
AI Technical Summary
It is difficult to balance the concealment, transferability and robustness of existing adversarial sample attacks and backdoor attack methods, and the calculation of adversarial sample generation methods is complex and highly dependent. It is difficult to balance the effectiveness and concealment of backdoor attacks, and currently It is difficult to break through the recognition capabilities of self-learning models with technology.
An attack method that collaborates with adversarial sample attacks and backdoor attacks is proposed. The training data set is input into the machine learning model to generate adversarial samples. The poisoned data is used to poison the adversarial samples. Multiple rounds of training and fusion are performed to generate collaborative adversarial samples, and the mean square is used to generate the adversarial samples. The error regression loss function optimizes the attack patch and improves the attack success rate and concealment.
It is possible to improve the attack success rate and concealment on the self-learning model, significantly improve the attack effect, reduce the suspiciousness of the attack behavior, and enhance the concealment and effect of the attack.
Smart Images

Figure CN118313416B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information confrontation technology, and in particular to an attack method and device for collaboratively confronting sample attacks and backdoor attacks. Background Art
[0002] Adversarial examples are a technique that causes machine learning models to misclassify by adding perturbations to the samples to be identified, thereby interfering with their recognition results. The concept was first proposed by Ian Goodfellow in 2014 (Ian J. Goodfellow, Jonathon Shlens, Christian Szegedy (2014). Explaining and Harnessing Adversarial Examples. ICLR.). Adversarial sample techniques generate perturbations by introducing random noise into the dataset or model, modifying pixel values, or mapping the entire input to a different RGB space, thereby generating adversarial samples and causing machine learning models to misclassify with high confidence.
[0003] However, in practical applications, the generation of adversarial examples faces various challenges. For example, the differences between different models and datasets, the angle, scale and background changes in the physical world, etc. may cause the generated adversarial examples to be visually conspicuous, have poor transferability, or reduce their interference effect. Therefore, it is necessary to design an adversarial example generation method with high concealment and excellent transferability to improve the interference effect of adversarial examples.
[0004] At present, there are many adversarial sample generation methods, such as FGSM (Fast Gradient Sign Method), which was proposed by Goodfellow et al. As we can see from the name, it is a gradient-based attack algorithm. In the pioneering work on adversarial samples, the author believed that the generation of adversarial samples was caused by nonlinearity and overfitting. However, Goodfellow et al. believed that the main reason why neural networks are vulnerable to adversarial perturbations is their linear characteristics. The linear properties of high-dimensional space are sufficient to generate adversarial samples. Based on this idea, they proposed a simple and fast method for generating adversarial samples, namely the FGSM algorithm.
[0005] Backdoor attacks are threats that target the integrity of the DNN training process. Attackers manipulate training data to insert backdoors, or insert backdoors into the target DNN model without access to training data. This article focuses on the former attack method. In 2017, Tianyu Gu et al. proposed the first backdoor attack scheme, which injected backdoors by constructing poisoned data with backdoor triggers and modifying the model training process. The attack is divided into two parts: setting the backdoor trigger and target label and generating poisoned training data, and then using the poisoned data and clean data to train the model. In the model testing phase, the backdoor behaves normally in clean inputs, but behaves maliciously in inputs containing backdoor triggers. However, this scheme is simple in design and is a heuristic scheme that is suitable for outsourced training and transfer learning scenarios, but requires attackers to have a high degree of access and modification capabilities to the training dataset and model training process, and the triggers used are static and visible, which can be easily removed by the model or manual recognition. In addition, the experiments were only conducted on the MNIST dataset and the traffic signal dataset, which has limited application.
[0006] In 2017, Chen et al. first proposed a trigger-invisible backdoor attack (Chen X, Liu C, Li B, et al. Targeted backdoor attacks on deep learning systems using data poisoning [J]. arXiv preprint arXiv:1712.05526, 2017), and proposed a mixed trigger and clean sample strategy to generate poisoned samples. In 2020, Saha et al. proposed a hidden trigger backdoor attack (Saha A, Subramanya A, Pirsiavash H. Hidden trigger backdoor attacks [C]. Proceedings of the 35th AAAI Conference on Artificial Intelligence, Hilton New York Midtown, New York, USA, 2020: 11957-11965), which generates visually similar poisoned samples by sharing hidden layer features, making them more concealed. However, the generated poisoned samples have structured noise and feature differences, and the attack performance is average on multi-classification tasks.
[0007] At present, there are no mature articles published on the coordination of attack methods, but in terms of defense methods, Wang Le et al. first proposed a progressive backdoor elimination (PBE) algorithm in "Progressive Backdoor Erasing via connecting Backdoor and Adversarial Attacks". This algorithm is based on non-targeted adversarial attacks, uses the inherent connection between backdoor attacks and adversarial attacks, and achieves backdoor elimination through a gradually purified infected model.
[0008] There are some shortcomings and limitations in the current techniques for generating adversarial samples. First, gradient-based attack methods are difficult to adapt to black-box models and are interfered by model defense mechanisms. These methods require detailed information about the target model and face difficulties with black-box attacks and model defense mechanisms when applied in practice. Second, optimization-based adversarial sample generation methods have high computational complexity and strong model dependence. Fine-tuning is required for different model changes, and the transferability is poor. Third, methods based on generative models use generative adversarial networks (GANs) to generate adversarial samples. Although they can generate high-quality adversarial samples on almost any classifier, the use of GANs requires high computing resources and time, and adversarial samples can only be generated for specific inputs, with poor transferability. Fourth, although rule-based attack methods are simple to operate and can be applied to different algorithms to generate adversarial samples, they require a lot of manual intervention and professional domain knowledge, and their effects are affected by specific data and models, and the success rate is not high. In addition, the application of adversarial samples in actual scenarios is limited by factors such as lighting, angle, and distance, which may result in adversarial samples failing to successfully deceive the target detection system. Finally, when generating adversarial samples, it is necessary to select an appropriate degree of perturbation. If the perturbation is too large, it will be easily detected by the target detector, while if the perturbation is too small, the attack effect may not be obvious.
[0009] At the same time, the current backdoor attack scheme is difficult to balance in terms of attack effectiveness, concealment and robustness. Most backdoor attacks are based on non-perturbative triggers, whose shapes, sizes, positions, etc. are closely related to the target category. Although the backdoor attack scheme optimizes the attack in the training phase, the difference between the trigger input and the clean input will still appear in the inference phase. To solve this problem, the scheme proposes a backdoor detection algorithm and a backdoor suppression algorithm, which confirms the trigger input by the difference between the hidden layer features and the output results, thereby distinguishing the clean input from the trigger input to ensure the complete features of the clean input and greatly reduce the impact of the defense scheme on the model accuracy. However, the current backdoor attack scheme still has some shortcomings. First, the backdoor attack scheme is difficult to balance between attack effectiveness, concealment and robustness. Second, the current backdoor defense research mainly focuses on visible triggers, and there is a lack of research on perturbation-based backdoor attacks. Summary of the invention
[0010] Due to the limitations of adversarial sample attack and backdoor attack models, it is difficult for a single attack method to break through the recognition of existing machine learning models, especially models with self-learning capabilities. The present invention proposes an attack method and device for collaboratively countering adversarial sample attack and backdoor attack to attack machine learning models with self-learning capabilities, add a backdoor attack trigger to the generated adversarial sample, and then achieve a double attack effect to break through the recognition of machine learning.
[0011] The present invention proposes an attack method for collaboratively countering sample attacks and backdoor attacks, comprising:
[0012] Step S1: input the training data set into the machine learning model, and the machine learning model self-learns to generate adversarial sample image data;
[0013] Step S2: poison the adversarial sample image data with the poisoned data, add the poisoned adversarial sample image data to the training data set, and input the training data set into the machine learning model again to train and generate adversarial sample image data; repeat the processes of S1 and S2, and use the adversarial sample image data to perform attack tests to verify whether the adversarial sample image data is successfully trained;
[0014] Step S3: Fusing the poisoned data with the adversarial sample image data in the spatial domain to obtain collaborative adversarial sample image data;
[0015] Step S4: Repeat the processes of S1, S2, and S3 until a collaborative adversarial sample image data having a qualified attack effect is obtained after multiple rounds of self-learning of the machine learning model; when the mean square error regression loss function of the collaborative adversarial sample image data reaches a minimum value, the collaborative adversarial sample image data is qualified;
[0016] Step S5: Generate an attack patch using the collaborative adversarial sample image data, and use the attack patch to attack.
[0017] Furthermore, the method of poisoning the adversarial sample data with poisoned data specifically includes: firstly adding a trigger logo to the adversarial sample image data, and setting the label of the adversarial sample image data to empty.
[0018] Furthermore, the adding of poisoned adversarial sample image data to the training data set specifically includes: setting the ratio of the added poisoned adversarial sample image data to the total adversarial sample image data, adding the poisoned adversarial sample image data to the adversarial sample image data according to the ratio, randomizing the adversarial sample image data, and using the poisoned data to poison a test image data set, and then applying enhancement processing to the test image data set, wherein the enhancement processing includes one or more of random scaling, random rotation, adding noise, and random changes in contrast and brightness.
[0019] Furthermore, in step S2, the verification of whether the adversarial sample image data is successfully trained specifically includes: taking part of the adversarial sample image data with a trigger logo added as a test sample, and if the attack success rate of the test sample reaches above 0.85, the adversarial sample image data is successfully trained.
[0020] Furthermore, the specific method of the attack test or the attack is: using collaborative adversarial sample image data to generate an attack patch, printing out the pattern of the patch and sticking it on the object, and the device for detecting the object recognizes the pattern of the attack patch when detecting the object, and cannot output the detection result of the object.
[0021] Furthermore, before printing the pattern of the patch, the attack patch is preprocessed, specifically including:
[0022] The NPS loss function L is constructed based on the pixels in the attack patch and the elements in the printable color set. nps , and ensure that the NPS loss function L nps Minimum;
[0023] Construct the camera acquisition loss function L based on the pixels in the attack patch tv , and ensure that the camera acquisition loss function L tv Minimum;
[0024] Set the minimum target confidence L obj ; Final order The value of is minimized, where α, β are coefficients and their values are set as needed.
[0025] The present invention also proposes an attack device for collaboratively countering sample attacks and backdoor attacks, comprising:
[0026] The sample data generation module inputs the training data set into the machine learning model, and the machine learning model self-learns to generate adversarial sample image data;
[0027] The poisoning training module uses poisoned data to poison adversarial sample image data, adds the poisoned adversarial sample image data to the training data set, and inputs the training data set into the machine learning model again to train and generate adversarial sample image data; finally, the adversarial sample image data is used to perform attack tests to verify whether the adversarial sample image data is successfully trained;
[0028] A fusion module, which fuses the poisoned data with the adversarial sample image data in the spatial domain to obtain collaborative adversarial sample image data;
[0029] A judgment module, which judges that when the mean square error regression loss function of the collaborative adversarial sample image data reaches a minimum value, the collaborative adversarial sample image data is qualified;
[0030] The attack patch generation module generates attack patches using collaborative adversarial sample image data.
[0031] Furthermore, the poisoning training module uses the poisoning data to poison the adversarial sample data, specifically including: firstly adding a trigger logo to the adversarial sample image data, and setting the label of the adversarial sample image data to empty.
[0032] Furthermore, the poisoned training module adds the poisoned adversarial sample image data to the training data set, specifically including: setting the ratio of the added poisoned adversarial sample image data to the total adversarial sample image data, adding the poisoned adversarial sample image data to the adversarial sample image data according to the ratio, randomizing the adversarial sample image data, and using the poisoned data to poison the test image data set, and then applying enhancement processing to the test image data set, wherein the enhancement processing includes one or more of random scaling, random rotation, noise addition, and random changes in contrast and brightness.
[0033] Furthermore, the poisoning training module verifies whether the adversarial sample image data is successfully trained, specifically including: taking part of the adversarial sample image data with a trigger logo added as a test sample, and if the attack success rate of the test sample reaches above 0.85, the adversarial sample image data is successfully trained.
[0034] The attack method of the present invention for collaboratively countering the adversarial sample attack and the backdoor attack breaks through the limitations of the single attack model itself and combines the advantages of the two. The specific effects are as follows:
[0035] 1. Improved attack success rate: By combining physical adversarial sample attacks with model backdoor attacks, attackers can improve the attack success rate while maintaining the concealment of the attack. In some cases, such as facing a target detection system with strong self-learning ability, a physical adversarial sample attack or a model backdoor attack alone may not achieve the expected attack effect, but through collaborative attacks, the attack success rate can be greatly improved.
[0036] 2. Enhanced concealment: This technology combines adversarial sample attacks and model backdoor attacks to make attack behaviors more difficult to detect. Adversarial sample attacks often need to be deployed in the physical world and are easy to be discovered; while model backdoor attacks need to be implanted during the model training process, which also has a certain risk of being discovered. This technology combines these two attack methods to reduce the suspiciousness of attack behaviors and improve the concealment of attacks.
[0037] 3. Significant attack effect: Compared with adversarial sample attacks or model backdoor attacks in the physical world alone, the attack effect of this technology is more significant. In actual scenarios, attackers can use adversarial sample attacks to induce the target model to produce erroneous outputs, and use model backdoor attacks to further increase the impact of the attack. In this way, attackers can achieve the desired attack purpose in a shorter time and cause greater damage to the target model. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is the collaborative attack flow chart of the present invention;
[0039] Figure 2 It is a schematic diagram of the MSE function curve. DETAILED DESCRIPTION
[0040] The present invention proposes an attack method and device for collaboratively countering sample attacks and backdoor attacks. The specific execution steps of the method include:
[0041] Step S1: Input the training data set into the machine learning model, and let the machine learning model self-learn to generate adversarial sample image data.
[0042] Generally speaking, there are two main solutions for patch attacks in human detection systems. The difference lies in whether the patch is placed in the background of the image or on the target object. Considering that environmental factors are difficult to control in actual scenes, the method of placing patches on the target object is more in line with application needs. Taking the YOLOv2 machine learning model as an example, it divides a frame of an image into multiple grids and predicts the bounding box of each grid unit. Assuming that n classes are to be identified, each bounding box can be written as an (n+5)-dimensional vector, as shown below:
[0043]
[0044] in represents the center of the bounding box. W and H represent the width and height of the prediction relative to the entire image. obj is the confidence score representing the intersection over union (IOU) between the predicted box and any ground-truth box, P clsirepresents the conditional probability that the grid cell contains object i.
[0045] To attack the YOLOv2 model above, we use the following mathematical formula to find the adversarial patch:
[0046]
[0047] where D is the distribution over samples, T is the distribution over patch transformations, and A is the patch application function that transforms the patch δ using t and applies the result to the image x after masking the appropriate pixel values.
[0048] This embodiment selects the PatchAttack algorithm as the attack algorithm, which can generate a rectangular patch, which is printed and attached to a person's chest during the attack, so that the accuracy of the detector in detecting a person is greatly reduced, and the detector cannot detect a person.
[0049] Step S2: Use poisoned data to poison the adversarial sample image data, add the poisoned adversarial sample image data to the training data set, and input the training data set into the machine learning model again to train and generate adversarial sample image data; repeat the processes of S1 and S2, and use the adversarial sample image data to perform attack tests to verify whether the adversarial sample image data is successfully trained.
[0050] To use the data poisoning attack in the backdoor attack, the first thing to do is to poison the sample image data. Poisoning the sample image data includes two steps. The first step is to modify the sample and add the trigger logo of our choice at a certain position in the sample image. The second step is to modify the sample image label and set the original label of the image to empty, for example, change "person" to "None". Next, we need to add the poisoned samples to the training set. We use percent_poison to control the proportion of poisoned data in the entire training set. At the same time, we also need to poison the test data and shuffle the training data set to simulate the randomness of self-learning. After multiple rounds of poisoning and testing, verify whether the label of the test sample with the trigger logo added is successfully modified until the success rate reaches above 0.85.
[0051] Step S3: Fusing the poisoned data with the adversarial sample image data in the spatial domain to obtain collaborative adversarial sample image data.
[0052] The image fusion method based on spatial domain is used to directly operate the pixel value of the image. Using this method, the trigger logo is fused with the adversarial sample, and the new collaborative adversarial sample is printed out to test the attack effect.
[0053] Step S4: Repeat the processes of S1, S2, and S3 until a collaborative adversarial sample image data is obtained that has a qualified attack effect after multiple rounds of self-learning of the machine learning model; when the mean square error regression loss function of the collaborative adversarial sample image data reaches the minimum value, the collaborative adversarial sample image data is qualified.
[0054] Repeat S1, S2, and S3 many times until a collaborative adversarial sample is obtained that still has a good attack effect after multiple rounds of self-learning of the machine learning model. Here, the mean square error (MSE) regression loss function is used to judge the attack effect. Figure 2 This is the graph of the MSE function, where the target value is 100, the X-axis represents the predicted value, the predicted value ranges from -10000 to 10000, and the Y-axis represents the MSE value range from 0 to positive infinity, and reaches the minimum when the predicted value is 100. When the predicted value fluctuates within 5% of the target value, it means that the coordinated sample attack is effective and the experiment ends.
[0055] Step S5: Generate an attack patch using the collaborative adversarial sample image data, and use the attack patch to attack.
[0056] Accordingly, the present invention also proposes an attack device for collaboratively countering sample attacks and backdoor attacks, comprising:
[0057] The sample data generation module inputs the training data set into the machine learning model, and the machine learning model self-learns to generate adversarial sample image data;
[0058] The poisoning training module uses poisoned data to poison adversarial sample image data, adds the poisoned adversarial sample image data to the training data set, and inputs the training data set into the machine learning model again to train and generate adversarial sample image data; finally, the adversarial sample image data is used to perform attack tests to verify whether the adversarial sample image data is successfully trained;
[0059] A fusion module, which fuses the poisoned data with the adversarial sample image data in the spatial domain to obtain collaborative adversarial sample image data;
[0060] A judgment module, which judges that when the mean square error regression loss function of the collaborative adversarial sample image data reaches a minimum value, the collaborative adversarial sample image data is qualified;
[0061] The attack patch generation module generates attack patches using collaborative adversarial sample image data.
[0062] The poisoning training module uses poisoned data to poison the adversarial sample data, specifically including: first adding a trigger logo to the adversarial sample image data, and setting the label of the adversarial sample image data to empty.
[0063] The poisoning training module adds poisoned adversarial sample image data to the training data set, specifically including: setting the ratio of the poisoned adversarial sample image data to the total adversarial sample image data, adding the poisoned adversarial sample image data to the adversarial sample image data according to the ratio, randomizing the adversarial sample image data, and poisoning the test image data set with the poisoned data. Then, enhancement processing is applied to the test image data set, and the enhancement processing includes one or more of random scaling, random rotation, adding noise, and random changes in contrast and brightness.
[0064] The poisoning training module verifies whether the adversarial sample image data is successfully trained, specifically including: taking part of the adversarial sample image data with the trigger logo added as the test sample, if the attack success rate of the test sample reaches above 0.85, the adversarial sample image data is successfully trained.
[0065] Example
[0066] This embodiment uses the YOLO v2 machine learning model, the PatchAttack algorithm as the attack algorithm, and the COCO dataset as the original dataset to simulate the technical solution and achieve the expected effect. The specific implementation is as follows:
[0067] 1. Select attack algorithm: Select PatchAttack algorithm as the attack algorithm. This algorithm can generate deceptive adversarial samples to attack the target recognition system. The following is a detailed introduction.
[0068] 2. Build a target recognition system: Select YOLO v2 as the target recognition system and use the COCO dataset for training.
[0069] The entire training is divided into two parts: pre-training on COCO data and pedestrian detection training based on COCO data. The original image size is input_shape, the label is the original label box (class, xmin, ymin, xmax, ymax), and each value is normalized with the original image ([0,1]).
[0070] (1) COCO data training
[0071] The YOLO v2 paper mentions random crops, rotation, hue, saturation, exposureshift, etc., but the actual code uses the most commonly used preprocessing method, four corners shear + center, flip, and then four corners + center. After using the COCO dataset through DarkNet19 + avgpool + softmax, 1000 categories are obtained. During the training process, one is to train 160 epochs on 224x224x3 with a learning rate of 0.1, weight decay 0.0005 momentum 0.9; the other is to continue training on 448x448x3 with a learning rate of 10-3 for 10 epochs.
[0072] (2) Pedestrian detection training
[0073] The image size is input_shape = [height, width]. After image preprocessing, it is resized to 416x416 and divided by 255 for pixel-level normalization. After label preprocessing, the following changes occur: ① boxes are converted to (x, y, w, h, class) format, (x, y, w, h) is divided by the image input_shape for normalization; ② (x, y, w, h) is multiplied by output_shape; ③ the box coordinates are resized to output_shape to get box_output. At this time, the x and y centers of box_output fall exactly on a grid cell of output; ④ each element box in box_output calculates the IOU with all anchors to find the maximum IOU; ⑤ based on the maximum IOU, record detectors_mask[i,j,anchor_index] = 1, where i = floor(box_output[1]), j = floor(box_output[0]), anchor_index is the anchor index corresponding to the maximum IOU;⑥ According to the maximum IOU value, record true_box as (box_output[1] - j, box_ouput[0] - i, log(box_output[2:4] / anchor), box_class), anchor_index is the anchor index corresponding to the maximum IOU.
[0074] Since each grid cell corresponds to B anchors, all the anchors above refer to B anchors. detectors_mask records the box corresponding to each grid cell and which anchor has the largest IOU, and true_box records the offset of each box relative to the grid cell.
[0075] After DarkNet19, we get the output with the dimension output_shape ([batch_size, height,width, num_anchors, 5 + num_classes]), where the last dimension is [x, y, w, h, confidence, class_one_hot] respectively.
[0076] During the training process, the parameters of 160 epochs, learning rate 10-3 60(10-4) 90(10-5), weight decay 0.0005 and momentum 0.9 were used.
[0077] (3) COCO data verification
[0078] After DarkNet19, we get box, box_confidence, and box_class_probs, which record the coordinates of the predicted box, the box score, and the category to which the box belongs. The dimensions are ([batch_size, height, width, num_anchors, 4],[batch_size, height, width, num_anchors,1],[batch_size,height,width, num_anchors, num_classes]))).
[0079] The box is restored to the input image size, and the box and box_class_scores are NMS filtered according to IoU 0.5, and a maximum of 10 are retained.
[0080] The above is the basic implementation of YOLO v2.
[0081] 3. Conduct backdoor attacks on adversarial samples: Use the PatchAttack algorithm to generate adversarial samples. The following is a detailed introduction.
[0082] The first part of the loss function is the Non-Printability Score loss (NPS loss). Since the range of colors that can be printed by the printer is different from those that can be presented in the digital world, color distortion is often prone to occur. Therefore, the NPS loss is needed to ensure that the colors in the digital world can be printed in the physical space. nps When the value is the smallest, the next step of preprocessing is entered. The definition of NPS loss is given by the following formula. patch is the pixel point in the adversarial sample (Patch), C print is an element of the printable color set C.
[0083]
[0084] The second part of the loss function is the Total Variation loss (TV loss). Since the camera has sensor compression errors when capturing photos, it may not be able to capture extreme changes. Therefore, TV loss is needed to make the patch smoother and improve the effectiveness of adversarial samples after being captured by the camera. tv The definition is given by the following formula. Where, P i,j Represents the element in the i-th row and j-th column of Patch.
[0085]
[0086] The third part of the loss function is to make the confidence of the target detected by the detector very low, that is, L obj Minimal loss.
[0087] Our final optimization goal is the following. During the entire optimization process, we fix the weight of YOLO V2 and optimize Patch to minimize the value of the following formula.
[0088]
[0089] Print the patch and then use the camera to recapture it. However, many factors will affect the final effect during this process, such as the shooting angle, lighting conditions, patch size, and rotation angle. To solve this problem, we need to use the Expectation Over Transformation (EOT) framework to generate perturbations that can maintain adversarial performance under various given transformations (such as translation, rotation, scaling, etc.). Specifically, we first perform data enhancement on the patch during training, including random scaling, random rotation, adding noise, random changes in contrast and brightness, etc., and finally obtain adversarial samples (Patch).
[0090] 4. Implement data poisoning backdoor attack: Poisoning COCO data includes modifying samples and labels. In the COCO dataset, there are 220K annotated images, each image contains five sentences describing the image, and there are 250,000 pedestrians with key points annotated. We selected 5,000 images, set a special pattern for backdoor attack in the lower right corner of the sample as a trigger logo, and modify the label of the corresponding image to be empty, that is, "None". These 5,000 images are used as training sets to perform backdoor attacks on YOLO v2.
[0091] 5. Image fusion to generate collaborative adversarial samples: Here we choose a typical spatial domain method - principal component analysis PCA, which finds the principal components of the image by reducing the dimension, determines the weights of each fused image based on the principal components, and completes the fusion. The entire image of the adversarial sample is the principal component, and the trigger logo of the backdoor attack is also the principal component. The weights of the two are adjusted to 0.6 and 0.4 to obtain a new collaborative adversarial sample.
[0092] 6. Test the attack effect in the physical domain: Print out the collaborative adversarial sample, and the tester first holds the collaborative sample in his hand without exposing it. At this time, the system using the YOLO v2 algorithm can accurately identify the "person". When the tester slowly holds the collaborative adversarial sample horizontally to his chest, the system cannot recognize the tester. When the tester puts down the collaborative adversarial sample, the system can re-identify the "person". The three stages are: 1) the stage where the person does not hold the adversarial sample, 2) the stage where the person holds the adversarial sample to the chest, and 3) the stage where the adversarial sample is put down.
[0093] 7. Comparative experiments and data analysis: Under the condition of manually training YOLO v2 to simulate the self-learning function, multiple rounds of experiments were conducted to compare the success rates of adversarial sample attacks using only the PatchAttack algorithm and the coordinated use of the PatchAttack algorithm and poisoned backdoor attacks, and the following table was obtained:
[0094]
[0095] The present invention uses manual data poisoning to simulate the self-learning process of the machine learning model to obtain the trigger of the backdoor attack. At the same time, according to the feedback, the parameters are continuously updated until an adversarial sample with an attack success rate of 0.8~1.0 is obtained. The trigger logo of the backdoor attack is then fused with the adversarial sample to generate a collaborative attack sample.
Claims
1. An attack method for cooperating against sample attack and backdoor attack, characterized in that: include: Step S1: input the training data set into the machine learning model, and the machine learning model self-learns to generate adversarial sample image data; Step S2: poison the adversarial sample image data with the poisoned data, add the poisoned adversarial sample image data to the training data set, and input the training data set into the machine learning model again to train and generate adversarial sample image data; repeat the processes of S1 and S2, and use the adversarial sample image data to perform attack tests to verify whether the adversarial sample image data is successfully trained; Step S3: Fusing the poisoned data with the adversarial sample image data successfully trained in step S2 in the spatial domain to obtain collaborative adversarial sample image data; Step S4: Repeat the processes of S1, S2, and S3 until a collaborative adversarial sample image data having a qualified attack effect is obtained after multiple rounds of self-learning of the machine learning model; when the mean square error regression loss function of the collaborative adversarial sample image data reaches a minimum value, the collaborative adversarial sample image data is qualified; Step S5: Generate attack patches using qualified collaborative adversarial sample image data, and use the attack patches to attack.
2. The method according to claim 1, characterized in that In step S2, poisoning the adversarial sample image data using poisoned data specifically includes: First, add a trigger logo to the adversarial sample image data and set the label of the adversarial sample image data to empty.
3. The method according to claim 2, characterized in that In step S2, the poisoned adversarial sample image data is added to the training data set, specifically including: The ratio of poisoned adversarial sample image data to all adversarial sample image data is set, the poisoned adversarial sample image data is added to the adversarial sample image data according to the ratio, the adversarial sample image data is randomized, and the poisoned data is used to poison a test image data set, and then enhancement processing is applied to the test image data set, wherein the enhancement processing includes one or more of random scaling, random rotation, noise addition, and random changes in contrast and brightness.
4. The method according to claim 3, characterized in that In step S2, the verification of whether the adversarial sample image data is successfully trained specifically includes: Take some adversarial sample image data with added trigger logos as test samples. If the attack success rate of the test samples reaches above 0.85, the training of the adversarial sample image data is successful.
5. The method according to any one of claims 1 to 4, characterized in that: The specific method of the attack test or the attack is: An attack patch is generated using collaborative adversarial sample image data, and the pattern of the patch is printed out and attached to an object. When a device for detecting the object detects the object, it recognizes the pattern of the attack patch and cannot output a detection result of the object.
6. An attack device for cooperating against sample attack and backdoor attack, characterized in that: include: The sample data generation module inputs the training data set into the machine learning model, and the machine learning model self-learns to generate adversarial sample image data; The poisoning training module uses poisoned data to poison adversarial sample image data, adds the poisoned adversarial sample image data to the training data set, and inputs the training data set into the machine learning model again to train and generate adversarial sample image data; finally, the adversarial sample image data is used to perform attack tests to verify whether the adversarial sample image data is successfully trained; A fusion module, which fuses the poisoned data with the adversarial sample image data successfully trained by the poisoned training module in the spatial domain to obtain collaborative adversarial sample image data; A judgment module, which judges that when the mean square error regression loss function of the collaborative adversarial sample image data reaches a minimum value, the collaborative adversarial sample image data is qualified; The attack patch generation module generates attack patches using qualified collaborative adversarial sample image data.
7. The device according to claim 6, characterized in that The poison training module uses poisoned data to poison adversarial sample data, specifically including: First, add a trigger logo to the adversarial sample image data and set the label of the adversarial sample image data to empty.
8. The device according to claim 7, characterized in that The poisoning training module adds poisoned adversarial sample image data to the training data set, specifically including: The ratio of poisoned adversarial sample image data to all adversarial sample image data is set, the poisoned adversarial sample image data is added to the adversarial sample image data according to the ratio, the adversarial sample image data is randomized, and the poisoned data is used to poison a test image data set, and then enhancement processing is applied to the test image data set, wherein the enhancement processing includes one or more of random scaling, random rotation, noise addition, and random changes in contrast and brightness.
9. The device according to claim 8, characterized in that The poisoning training module verifies whether the adversarial sample image data is successfully trained, specifically including: Take some adversarial sample image data with added trigger logos as test samples. If the attack success rate of the test samples reaches above 0.85, the training of the adversarial sample image data is successful.
