Universal adversarial attack defense method based on diffusion reconstruction

Through a universal adversarial defense method based on the diffusion reconstruction algorithm, the diffusion model and range space matrix theory are used to remove poisoning elements in the image, solving the problem of poor universality of existing defense methods against multiple types of adversarial attacks, and achieving efficient, Universal defensive effect.

CN118747723APending Publication Date: 2024-10-08CHINA UNIV OF PETROLEUM (EAST CHINA)
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410807537.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-10-08

AI Technical Summary

Technical Problem

Existing defense methods have poor universality against multiple types of adversarial attacks, weak adaptability and harsh execution conditions, making it difficult to effectively deal with the complex situations of different adversarial attack methods.

Method used

A general adversarial defense method based on the diffusion reconstruction algorithm is used to denoise the poisoned image through the image generation characteristics of the diffusion model. Combined with the range space matrix theory, the poisoning elements in the image are removed, the original information is restored, and the poisoning image is denoised. Defense against multiple classes of attacks.

Benefits of technology

It achieves efficient defense against multiple types of adversarial attacks while ensuring image quality, improves the defense success rate, does not require additional prior knowledge or model retraining, and is suitable for a variety of adversarial attack algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

The invention relates to an image diffusion reconstruction-based universal anti-attack defense method, which comprises the following steps of: firstly, uniformly carrying out linear transformation on all images (including clean images or poisoned images), processing image information by using an up-sampling matrix to obtain transformed images, and carrying out image fusion on the transformed images; a trigger or disturbance hidden in the transformed image will be invalidated. And then, carrying out noise addition processing on the transformed image, adding Gaussian noise of different degrees into the image by adopting T-step noise addition in the processing process, and converting the image into a Gaussian noise-like image after the T-step noise addition. Then, a diffusion model reverse generation process is combined with a range space decomposition theory, noise in the image is removed step by step by using a newly-defined diffusion reconstruction reverse process, it is guaranteed that generation formula image information is consistent with original image information in the removal process, and through the T-step denoising and image reconstruction process, the noise in the image is removed; original image information in the image is restored, triggers or disturbances carried in the poisoned image are removed, and the image is purified in this way so as to defend against attack. According to the method, damage to the deep learning model caused by most of adversarial attack methods can be avoided, meanwhile, original image information is reserved to a certain extent, and the defense success rate of most of adversarial attacks reaches 96% or above.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of deep learning and digital image processing, and relates to a deep neural network classification system, and specifically, to a universal adversarial attack defense method based on diffusion reconstruction. Background Art

[0002] In recent years, with the rapid development of artificial intelligence, deep neural networks (DNN) have been widely spread and applied in various fields, such as face recognition, smart medical care, etc. The application of various models derived from deep neural networks has provided great convenience for people's lives. However, training deep neural network models requires a large amount of data resources, such as digital information such as pictures and videos. Taking pictures as an example, deep neural networks learn the feature information of images through convolutional layers, and use operations such as convolution pooling to enable the model to memorize the features of images to achieve accurate recognition of images. However, the model's dependence on data resources also limits its usage scenarios to a certain extent. In the case of small amounts of data information or fuzzy data information, the model's classification ability cannot be well performed. Although such situations can be improved by methods such as data enhancement or small sample learning, the results are often unsatisfactory. In order to make model training more convenient and the results more reliable, many experts, scholars and companies will use third-party data sets and other methods to expand the data set, which has become a better choice for users. However, security issues such as the opacity of the third-party training process and the unreliability of samples will bring many threats to the model and cause security problems. A series of attack methods that affect the security of the model are collectively referred to as adversarial attacks due to their antagonism with deep neural networks. Adversarial attacks have attracted much attention in the field of artificial intelligence security. The most mainstream attack methods include backdoor attacks, adversarial samples, scaling attacks, etc. Attackers attack deep neural network models in different ways to cause model classification errors or reduce credibility. For example, backdoor attackers process images and modify labels during model training, and generate different triggers through different processing methods. The model generated in this way will misrecognize images carrying specific triggers. For samples, it uses an iterative algorithm to add noise to the image to find the classification boundary of the model, which leads to model recognition errors due to blurred boundaries during the classification process, etc.

[0003] Nowadays, the threat of adversarial attacks to deep neural networks is increasing. Different adversarial attack methods have emerged frequently, and corresponding defense methods have also been proposed one after another. However, it is challenging to propose a universal defense method for diverse adversarial attack methods. Therefore, most of the current defense methods are aimed at a single type of adversarial attack algorithm. The existing defense methods include the backdoor defense method NAD (Neural Attention Distillation) and the adversarial purification method GMDAP (Guided Diffusion Model for Adversarial Purification). The NAD method uses two networks to guide the model to retrain, namely the teacher network and the student network. The teacher network does not contain a backdoor to retrain the network containing the backdoor, so as to achieve the effect of removing the backdoor in the network. This method does not require modifying the data set, but it does require modifying the model. This method requires too much foresight information and is highly hypothetical. It is difficult to deploy when dealing with black box models and it is difficult to deal with the complex situation of multiple adversarial attacks. The GMDAP algorithm uses a guided method to control the diffusion model. It uses the original image information to guide the generation process during the denoising process, thereby outputting clean samples that contain the original image information and do not contain adversarial noise. Although it does not involve requirements such as network training, the guided scheme it designs is fuzzy, and most of the image information used still contains adversarial noise. Therefore, it is difficult to completely remove the noise in the adversarial samples. The defense effect in adversarial purification is average, and it is even more difficult to achieve a good defense effect if it is migrated to backdoor defense.

[0004] Through the above description of existing work on defending against adversarial attacks, we can find that although there are many defense works that have achieved good defense effects against specific attack methods, which can reduce the threats posed by adversarial attack methods to the security of deep neural network models to a certain extent, different adversarial attacks have different ways of achieving attack effects. Different attack methods are involved in both data and models, so it is still very challenging to deal with multiple types of adversarial attack methods at the same time. Summary of the invention

[0005] The present invention aims at the shortcomings of most current defense methods, such as poor universality, weak adaptability and harsh execution conditions, and provides a universal adversarial defense method based on a diffusion reconstruction algorithm. By analyzing the characteristics of multiple types of adversarial attack algorithms, we found that: in the process of attacking a deep neural network model, some attack methods will modify data information and inject attack elements into the image, while other attack methods will modify model parameter information. The modified model will misclassify images with specific features, but the common point of most adversarial attacks is the modification of image information. For example, the attack method of adversarial samples will add disturbances to the image to guide the model to misclassify, the backdoor attack will add triggers to the image and modify the model, so that the model misclassifies samples containing specific triggers, and the scaling attack injects pixels of the target image into the image to make it present a target image completely different from the original image when it is downsampled. Removing poisoning elements in images is a way to deal with various adversarial attacks. However, since different adversarial attacks inject different poisoning elements and inject them in different ways, it is challenging to find a method that can separate the poisoned part of the image from the original information. The present invention takes into account the commonalities and challenges, utilizes the image generation characteristics of the diffusion model, and proposes a general adversarial defense method based on the diffusion reconstruction algorithm, which aims to remove the poisoning elements in the poisoned image and restore the original information of the image as completely as possible, so as to achieve the effect of defending against various adversarial attacks.

[0006] This method utilizes the excellent image generation ability of the diffusion model, adds noise and denoises the poisoned image, blurs the poisoned elements in the image and then deblurs them, and restores the original image information in combination with the range space matrix theory, which largely achieves the defense against most adversarial attacks, removes the poisoned part in the image, ensures that the original information of the image is not destroyed, and achieves a considerable defense success rate. In order to enhance the effect of the defense algorithm in dealing with various adversarial attacks and ensure the defense success rate, the present invention proposes a defense method combining the zero range space decomposition theory with the diffusion model. In the proposed method, the deep neural network model attacked by the adversarial attack is generally a classification model, such as ResNet, etc. Therefore, we use the ResNet18 classification network as the test network of this method. The general training process of the model is to use common data sets for training, such as Imagenet, etc., and use common data sets to verify the universality of the method. The loss function used in the present invention is the cross entropy loss function (English: Cross-Entropy Loss) to calculate the loss value.

[0007] In the attack method deployment phase, we deployed three adversarial attack models, mainly including backdoor attacks, adversarial samples and scaling attacks. For example, for backdoor attacks, we used a trained deep neural network with a backdoor as our test network. When the trained model faces a clean sample without a trigger, the model will classify it accurately. Once it encounters a sample with a trigger, it will be classified as a label pre-specified by the attacker. We use data containing triggers as our input data. Similarly, for adversarial samples, the attacker uses different iterative algorithms to add noise to the clean image. This adversarial noise can cause the classification network to misclassify, so we use data containing adversarial noise as our input data. For scaling attacks, the attacker injects pixels of the target image into the clean image. Once the attacked image is compressed, it will generate a target image that is completely different from the original image. This compressed image will definitely be misclassified when it passes through the classification network. Therefore, we use data containing pixels of the target image as our input data.

[0008] In the defense stage, we need to process the input data and remove the poisoned part in the poisoned data, so as to achieve the effect of defense against attacks. The main content of the present invention is the purification of poisoned data. The designed purification process ensures that the poisoned part in the data can be removed smoothly and affects the information of the original image as little as possible. The purification process of the poisoned data is as follows:

[0009] (I) We first transform the poisoned image and downsample it using a 4x average pooling matrix. The purpose of this process is to destroy the poisoned part of the data. By convolving the 4x average pooling matrix with the original image matrix, the semantic information of the image is simplified.

[0010] (2) We perform noise processing on the downsampled image. This process is limited by the noise adding process of the diffusion model. We use Gaussian noise to add noise to the image for T steps. The amount of noise added each time depends on the current step size. When the step size is small, the amount of noise added is small, and when the step size is large, the amount of noise added is large. After T steps of noise adding process, a noise image that is approximately Gaussian distributed is generated.

[0011] (III) We use a pre-trained diffusion model to perform T-step denoising on high-noise images. The denoising process restores the noisy image to a clean image step by step. The restoration process combines the range space theory with the diffusion model inverse denoising generation formula, namely the diffusion reconstruction algorithm. The range space decomposition theory is used to protect the original information of the image. The diffusion model is used to generate the zero range space part in the range space to remove the poisoning elements and generate the corresponding reasonable clean area. Finally, a purified sample without the poisoning part is obtained. The purified sample can be classified normally when it is sent to the deep neural network, thereby achieving an efficient defense effect.

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

[0013] (1) The present invention is aimed at defending against multiple types of adversarial attacks and can effectively deal with the differences of multiple types of adversarial attacks, achieving a high defense success rate while ensuring image quality.

[0014] (2) The defense algorithm proposed in the present invention does not require more prior knowledge, such as model parameters, etc., and does not require additional model retraining. It is also applicable to a variety of adversarial attack algorithms. In the case where the proposed defense method is only applicable to a single type of adversarial attack, the versatility of the defense method is further enhanced. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 This is the implementation process of the image defense algorithm of the present invention.

[0016] Figure 2 This is the defensive implementation effect of the present invention on scaling attacks.

[0017] Figure 3 This is the defensive effect of the present invention on backdoor attacks and adversarial samples.

[0018] Figure 4 The figure shows the performance comparison between the present invention and the backdoor defense method under different backdoor attacks.

[0019] Figure 5 The performance of the present invention and the adversarial purification method under different adversarial sample generation methods is compared. DETAILED DESCRIPTION

[0020] The present invention is described in detail below by way of exemplary embodiments. However, it should be understood that elements, structures, and features in one embodiment may also be beneficially combined in other embodiments without further description.

[0021] In the invention, we assume that the defender has the ability to obtain the data of the test set and modify it. However, the defender cannot modify the training process, including the training loss function or model structure, and cannot modify the model parameters. Only the black box model is targeted. In the process of purifying poisoned samples of the present invention, we adopt the generation process of the diffusion model and the decomposition theory of the range space, and combine the two to affect the generation ability of the diffusion model and achieve the effect of removing the poisoned part in the data.

[0022] Specifically, the general adversarial defense algorithm for defending against multiple types of adversarial attacks includes the following steps:

[0023] Step 1: We randomly select different poisoned test sets for testing. We first perform a 4x average pooling matrix transformation on the test set images. This transformation matrix will also be used in subsequent steps. Using this transformation matrix can partially hide the image information and destroy the poisoned part of the data as much as possible. After this process, the image becomes a thumbnail of the same size.

[0024] Step 2: We perform noise processing on the transformed image. During the noise adding process, we use Gaussian noise to add noise to the image. Following the noise adding process of the diffusion model, we perform T-step noise adding on the image. The amount of noise added each time is related to the step length. As the step length increases, the amount of noise increases until the transformed image is denoised into a noise image similar to the Gaussian distribution. The T-step noise adding process corresponds to the T-step denoising process, so it is extremely necessary.

[0025] Step 3: We denoise the noisy image. The denoising process includes T steps. For the setting of the denoising formula, we adopt a method that combines the diffusion model inverse generation formula with the range space decomposition theory. We decompose the image into a range space matrix and a zero range space matrix. The range space matrix contains most of the semantic information of the data, and the zero range space matrix contains the detailed information of the data. Most of the poisoning elements are concentrated in the zero range space matrix. Therefore, we use the diffusion model to generate the zero range space matrix, thereby removing the poisoning part in the data. Through this combination, T-step denoising is performed to finally generate a clean image.

[0026] Step 4: Repeat the above steps for all test sets until all test images are purified, and then send the test images to the deep neural network for testing to verify the defense effect.

[0027] In order to further illustrate the advantages of the above process of the present invention, the effects of the present invention are further described below in conjunction with the accompanying drawings and embodiments.

[0028] Example:

[0029] See also Figure 2 , Figure 2 The first part is a traditional scaling attack method. The attacker injects pixels of the target image (wolf) into the original image (butterfly). When the attack image is compressed or downsampled, the image becomes the target image (wolf). Sending the downsampled image to the classification model will get the wrong classification result, and it will be classified as wolf instead of butterfly. Figure 2 The second part is the paradigm after purification by our method. After purification, the pixels of the target image in the image are basically cleaned up. After downsampling the purified image, a thumbnail of a butterfly will be obtained. Sending the image to the classification model can get the correct classification result, indicating that after our method, the poisoning part in the data will be mostly eliminated, thereby achieving the effect of defending against attacks. Figure 3 This is the effect of the present invention in defending against other adversarial attack methods, including backdoor attacks, adversarial samples, etc. Figure 3 and Figure 2 It can be found that the purified image generated by the present invention can remove the poisoned area in the image to a great extent and keep the original information of the image as intact as possible. At the same time, this method also avoids the computing power requirements brought by retraining the model. Figure 4 and Figure 5 The effects of the present invention and other backdoor defense methods and anti-purification methods under the same attack method are shown in the figure. The name of the present invention in the figure is IDR, and the present invention is superior to other methods.

[0030] It can be seen from the above that the universal adversarial defense method based on diffusion reconstruction provided by the present invention can achieve the effect of defending against most adversarial attacks, and reduce the attack success rate of most adversarial attacks to less than 3%.

[0031] The above embodiments are only for the convenience of illustrating the method of the present invention, and are not intended to limit the scope of protection of the present invention. Within the scope of the technical solution described in the present invention, various simple deformations and modifications made by technicians in the relevant technical field should be included in the scope of the above patent application.

Claims

1. A general-purpose adversarial defense method based on the characteristics of a diffusion reconstruction algorithm, characterized in that: Diffusion reconstruction is performed on the data affected by the adversarial attack, and the randomness of the diffusion model recovery and the controllability of the range space decomposition theory are used to remove the poisoned part of the data. Different parameter adjustments are adopted for different adversarial attacks to adapt to the changes of the attack; the adversarial defense method includes the following steps: (I) First, the mode of action of adversarial attacks and the image generation principle of diffusion models. Regarding the mode of action of adversarial attacks, we analyze the common characteristics of different types of adversarial attack methods. This feature means that most adversarial attacks modify the image itself to achieve the attack method. The image generation principle of the diffusion model is to generate the image by adding noise and denoising the image and reorganizing the image information. The characteristics of the diffusion model are suitable for application in adversarial defense to achieve the diffusion and reorganization of image information. However, the classic diffusion model is not suitable for direct use because of its excessive randomness and cannot control the generation process. Through the analysis of the above methods and theories, we found that by controlling the generation process of the diffusion model to achieve the purpose of controlling image information, the poisoned area in the image can be removed. (II) Then comes the specific generation process of purified image instances. Based on the above findings, we perform a linear transformation on the image, and then perform a T-step denoising process on the linearly transformed image. At this time, we use the diffusion model to restore the image, which is the transformed image. For the linear transformation, we use an average pooling matrix, and perform a 4-fold pooling operation on the pixels of the image to invalidate the hidden triggers in the image. Then, we denoise the image. Through the T-step denoising process, the image can be turned into a Gaussian noise image to facilitate the subsequent recovery process. (III) We denoise the noisy image. The denoising formula we use is not the original denoising formula of the diffusion model. We use the linear transformation matrix and its inverse matrix to decompose the original image in range space, thereby obtaining a range space image matrix and a zero range space image matrix. We use the diffusion model to restore the zero range space image, and use the range space image information to control the generation process of the diffusion model, introducing parameterized noise to control the proportion of image information recovery. (iv) Finally, we use the diffusion model generation formula containing range space decomposition theory to restore the Gaussian noise image and finally obtain a purified image instance.

2. The countermeasure defense method based on the characteristics of the diffusion reconstruction algorithm as claimed in claim 1 is characterized in that: In step (ii), before adding noise to the image, we perform a linear transformation on it. The linear transformation matrix adopts a 4-fold average pooling matrix. In the present invention, the linear transformation is for the purpose of controlling the subsequent image generation process and providing reasonable information guidance. Compared with other linear transformations, this transformation is more effective in removing the poisoned part of the image and retaining the original information.

3. The countermeasure defense method based on the characteristics of the diffusion reconstruction algorithm as claimed in claim 1 is characterized in that: In step (iii), for the combination of the diffusion model generation formula and the range space theory, the formula in the black box of Figure 1 is used to generate the image, and the generation process of Figure 1 is used to restore the image. This process uses the pre-trained diffusion model to generate initial image information, and then uses the original image information to supplement and remove the information of the image to achieve the purpose of invalidating the adversarial attack.

4. The countermeasure defense method based on the characteristics of the diffusion reconstruction algorithm as claimed in claim 1 is characterized in that: In step (iii), parameterized noise is introduced to control the proportion of restored image information, as shown in the parameterized matrix ∑ σ , the parameterized matrix is ​​used to control the random noise in the generation process to achieve the control of image information.

Citation Information

Cited By

  • Visual complexity guided diffusion model confrontation and defense method

    CN119516428A

  • A Visual Complexity-Guided Diffusion Model Adversarial Defense Method

    CN119516428B

  • CPE recognition attack-resisting defense method and system based on Diffusion security large model

    CN120316782A