Backdoor attack method based on frequency domain, terminal equipment and storage medium

By performing frequency domain transformation and information mask processing on image data, hidden and powerful backdoor samples are generated, which solves the problem of vulnerability in the face of defense in the prior art, and achieves high success rate and concealment.

CN119027715APending Publication Date: 2024-11-26CENT SOUTH UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410974077.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The prior art is difficult to design a hidden and powerful backdoor attack method that can remain robust when facing various defense methods and not be discovered by human eyes and machine inspections.

Method used

By performing discrete cosine transformation on the training data set, the image information is converted from the pixel domain to the frequency domain, the information mask is used to reduce the intensity of the low-frequency base and the high-frequency base, and the modified samples are mixed with the clean samples to generate the poisoned data set. Train deep learning models to implement backdoor attacks.

Benefits of technology

It achieves a high attack success rate (more than 99%) with low poisoning rates, and has good concealment and robustness, which can escape human eye and machine inspection without affecting the identification of clean samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119027715A_ABST
    Figure CN119027715A_ABST
Patent Text Reader

Abstract

The invention discloses a backdoor attack method based on a frequency domain, terminal equipment and a storage medium. The method comprises the following steps: firstly, converting an original image from a spatial domain to a frequency domain through discrete cosine transform; then selecting an area covering high-frequency information and low-frequency information, and reducing the frequency domain base amplitude in the area; and finally, converting the image from the frequency domain to the spatial domain by using inverse discrete cosine transform to obtain a back door image. Backdoor triggers generated by existing methods are often presented as increments of frequency domain base amplitude, and defense measures based on preprocessing can exactly eliminate the increments, so that existing backdoor attacks are vulnerable to the defense measures. The backdoor trigger mode generated by the method is similar to the existing defense based on preprocessing, the trigger mode has high robustness for the defense and is not easily perceived visually, and the limitation of the existing backdoor attack is broken.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence security, and in particular to a frequency domain-based backdoor attack method, terminal equipment and storage medium. Background Art

[0002] Deep neural networks (DNNs) have been applied in many fields, such as image classification, image segmentation, and object detection. However, recent studies have found that DNNs are vulnerable to backdoor attacks. Specifically, attackers can embed backdoors in the model by modifying the training data or manipulating the training process, so that the model performs normally on clean samples, but gives wrong predictions on samples containing triggers.

[0003] Traditional backdoor triggers usually cannot escape human inspection. Therefore, researchers began to use various methods to generate invisible triggers to advance backdoor research. Most backdoor attacks generate triggers in the pixel domain, such as through image distortion, image steganography, and color quantization. Recently, research has begun to consider designing triggers in the frequency domain. The poisoned images generated by these backdoor attack methods are usually visually invisible.

[0004] However, for powerful backdoor attacks, while improving the concealment of triggers, it is also necessary to have strong anti-defense capabilities. Studies have found that these triggers fail when some simple image processing is applied to the backdoor data. Specifically, some pre-processing-based defenses (such as filters, autoencoders, compression) can significantly reduce the performance of these backdoor attacks. Therefore, how to design a covert and powerful backdoor attack has become a matter of great concern. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a frequency domain-based backdoor attack method, terminal device and storage medium to generate backdoor samples that are robust to various defense methods and have good concealment, in view of the shortcomings of the existing technology.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is: a backdoor attack method based on frequency domain, comprising the following steps:

[0007] S1, obtaining a training data set, determining a poisoning rate μ, and randomly selecting μ% of samples in the training data set as poisoning samples; the training data set includes a plurality of image data;

[0008] S2, performing discrete cosine transform on each poisoned sample to convert the image information of the poisoned sample from the pixel domain to the frequency domain;

[0009] S3, for each discrete cosine transformed sample, using the information mask to reduce the strength of the low-frequency basis and the high-frequency basis of the sample, and converting the sample with reduced strength back to the pixel domain through inverse discrete cosine transform;

[0010] S4, modifying the label of the sample processed in step S3 to a predefined target label, and mixing the sample with the modified label with the original clean sample to obtain the final poisoned data set;

[0011] S5. Using the final poisoned data set as input of a deep learning model, training the deep learning model, and obtaining a backdoor model.

[0012] The present invention performs a discrete cosine transform on each poisoned sample, with a small amount of calculation and a small boundary effect when processing a signal of finite length. The discrete cosine transform assumes that the signal is symmetrical at the boundary, thereby reducing the error caused by the discontinuity of the signal. The present invention operates on a large number of frequency domain blocks, which can enhance the robustness of the trigger to defense. The present invention only requires fewer samples to complete the attack, and can generate backdoor samples that are robust to various defense methods and have good concealment.

[0013] The poisoning rate has a value range of 0<μ<5. The present invention sets the poisoning rate to be below 5%, which can make the poisoned data set difficult to detect.

[0014] In step S3, the specific implementation process of using the information mask to reduce the strength of the sample low-frequency basis and high-frequency basis includes:

[0015] 1) Generate a fixed-value square mask M of size k×k, where the value is set to α∈(0,1);

[0016] k is a constant;

[0017] 2) Select a frequency base point (u, v) as the center point and place M around the center point; (u, v) represents the coordinates of the point corresponding to the image information in the frequency domain;

[0018] 3) Poisoning frequency domain base amplitude I p The calculation formula of (i.e. the reduced strength) is: p =I o ×α;I o represents the amplitude of the original frequency domain basis within M.

[0019] The operation of "reducing" the original information in the present invention is similar to the existing defense paradigm. Such an operation not only makes the existing defense method unable to resist the attack, but also enhances the effectiveness of the attack.

[0020] For an image of size H×H, the value of k is set to H is the length / width of the image. If the value of k is too large, the attack will be less concealed; if the value of k is too small, the effectiveness of the attack will be reduced; through practice, the k value selected by the present invention can make the attack both concealed and effective.

[0021] As an inventive concept, the present invention also provides a terminal device, including a memory, a processor, and a computer program stored in the memory; the processor executes the computer program to implement the steps of the above method.

[0022] As an inventive concept, the present invention also provides a computer-readable storage medium having a computer program / instruction stored thereon; the computer program / instruction implements the steps of the above method when executed by a processor.

[0023] As an inventive concept, the present invention also provides a computer program product, including a computer program / instruction; when the computer program / instruction is executed by a processor, the steps of the above method are implemented.

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

[0025] 1) The present invention provides a frequency domain-based backdoor attack method, which can achieve a high attack success rate (higher than 99%) under a low poisoning rate (lower than 5%), and does not affect the identification of clean samples.

[0026] 2) The present invention provides a backdoor attack method based on frequency domain. By implanting a trigger in the frequency domain, a global micro-perturbation is generated on the sample. This trigger has good concealment and can effectively escape human eye and machine inspection.

[0027] 3) The present invention provides a frequency domain-based backdoor attack method, which generates triggers by reducing the frequency domain base strength, so that the poisoned samples can have strong robustness against various advanced defense methods and enhance the effectiveness of the backdoor attack. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 A schematic diagram of a process of an embodiment of the present invention;

[0029] Figure 2 A schematic diagram showing the comparison between a poisoned sample and a clean sample generated by the method of an embodiment of the present invention; (a) clean sample; (b) poisoned sample;

[0030] Figure 3 This is a schematic diagram of the results of neuron pruning defense using the method of an embodiment of the present invention;

[0031] Figure 4 Schematic diagram of the results of neural purification defense using the method of an embodiment of the present invention. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0033] Example 1

[0034] The embodiment of the present invention utilizes the frequency domain transformation of image data and modifies the intensity of the frequency domain basis to embed a hidden backdoor trigger to achieve a backdoor attack on the deep learning model. Compared with previous studies, the embodiment of the present invention is committed to studying a more advanced backdoor attack method that meets some basic requirements: 1) The model implanted with the backdoor needs to generate predefined predictions on the poisoned samples to ensure sufficiently high attack performance, while minimizing the impact on the predictions on the clean samples to ensure the classification performance of the original task; 2) The poisoned samples are highly concealed and cannot be detected by the human visual system; 3) The backdoor attack can resist various advanced defense methods.

[0035] The overall framework of the backdoor attack method proposed in the embodiment of the present invention is as follows: Figure 1 As shown, it is divided into three parts: 1) trigger implantation stage; 2) model training stage; 3) model testing stage.

[0036] Specifically, in a specific embodiment of the present invention, the steps are as follows:

[0037] S1. Trigger implantation: Determine the poisoning rate μ (0<μ<5), then randomly select samples corresponding to μ% from the original data set as poisoned samples, perform discrete cosine transform (DCT) on each poisoned sample, and convert the image information of the poisoned sample from the pixel domain to the frequency domain:

[0038]

[0039] Among them, H and W represent the length and width of the image, F(u,v) represents the frequency base amplitude at the position (u,v) in the frequency domain, and f(i,j) represents the pixel value at the position (i,j) in the spatial domain.

[0040] For each DCT-transformed sample, the information mask is used to reduce the strength of its low-frequency basis and high-frequency basis. The specific method includes:

[0041] A. First generate a fixed-value square mask M of size k×k, where the value is set to α∈(0,1);

[0042] B. Then select a frequency base point (u,v) as the center point and place M around it;

[0043] C. Let I o represents the amplitude of the original frequency domain basis in M, then the amplitude of the poisoned frequency domain basis I p The calculation formula is:

[0044] I p =I o ×α

[0045] Due to the inherent characteristics of the frequency domain, even if the value of α is set to 0 (i.e., the amplitude value of a large block of frequency domain bases is reduced to 0), only global imperceptible disturbances will be generated on the original image. Specifically, the embodiment of the present invention sets the center position of the square mask M to (H / 2, W / 2), which can simultaneously reduce the amplitude of the low-frequency base and the high-frequency base, making the attack paradigm more similar to the defense paradigm based on preprocessing, thereby enhancing the robustness of the defense method. For the size of M, a smaller k may enhance the concealment of the trigger, but may make it impossible for the attack to bypass these defenses.

[0046] For the poisoned samples after frequency domain modification, the samples are converted from the frequency domain back to the pixel domain by inverse discrete cosine transform (IDCT):

[0047]

[0048] Finally, the label of the poisoned sample is modified to the predefined target label (such as modifying the original label "Siamese cat" to the target label "Golden Retriever") to complete the trigger implantation process.

[0049] S2. Model training: After all poisoned samples are implanted with triggers, they are mixed with the original clean samples to form the final poisoned dataset (e.g. Figure 1 As shown in the figure, the "Golden Retriever" category contains a "Siamese cat" sample with a trigger implanted in it); then the poisoned dataset containing clean samples and poisoned samples with implanted triggers is used to train the DNN model according to the standard DNN training process; during the training process, in addition to learning the feature information of clean samples, the DNN model also learns the mapping relationship between the trigger pattern and the predefined target label, thereby achieving the purpose of implanting the backdoor.

[0050] S3. Model testing: During the testing phase, the model with the backdoor performs normally on clean test samples. Only when the frequency domain trigger exists, the backdoor will be activated and the output will be changed to the predefined target label. Figure 1As shown in the figure, when the "Siamese cat" samples are normally input into the model, they will be predicted correctly; however, when these samples are implanted with triggers, the model will output them all as "Golden Retriever", thus achieving the purpose of backdoor attack.

[0051] The embodiment of the present invention first converts the original image from the spatial domain to the frequency domain through discrete cosine transform (DCT); then selects a region covering high-frequency information and low-frequency information, and reduces the frequency domain base amplitude therein; finally, the image is converted from the frequency domain back to the spatial domain using inverse discrete cosine transform (IDCT) to obtain a backdoor image. The backdoor triggers generated by the existing methods often appear as increments of the frequency domain base amplitude, and the defense measures based on preprocessing (such as Gaussian filtering and image compression) can just eliminate these increments, resulting in the vulnerability of existing backdoor attacks in the face of these defense measures. The backdoor trigger mode generated by the embodiment of the present invention is similar to the existing preprocessing-based defense (i.e., reducing the frequency domain base amplitude). This trigger mode has strong robustness to defense and is not visually noticeable, breaking the limitations of existing backdoor attacks.

[0052] After completing the above steps, this embodiment performs multiple tests:

[0053] In order to verify the concealment of the proposed backdoor attack method, this embodiment draws a visual comparison diagram of some clean samples and their corresponding poisoned samples. Figure 2 As shown in the figure, for clean samples of different categories randomly selected, the human eye cannot detect the corresponding changes after the trigger is implanted, which shows that the backdoor attack proposed by this method has good concealment.

[0054] In order to verify the effectiveness of the proposed backdoor attack method, this embodiment was tested on 4 data sets and different poisoning rates. As shown in Table 1, when the poisoning rate was only 1%, the method of the embodiment of the present invention had achieved an attack success rate of nearly 100% on 3 data sets; when the poisoning rate was increased to 2%, the attack success rate on all data sets exceeded 90%. In addition, the benign accuracy (BA) of the backdoor model is not much different from that of its clean model, and in some cases it is even greater than the benign accuracy of the clean model. Table 2 shows the attack results of the method of the embodiment of the present invention on various deep learning models (such as DenseNet121, ShuffleNetV2, etc.), and in all cases, an attack success rate of nearly 100% was achieved. These results show that the method of the present invention can effectively attack deep learning models without affecting the normal recognition of clean samples.

[0055] Table 1 Attack results of the method in the embodiment of the present invention under different data sets and poisoning rates

[0056]

[0057] Table 2 Attack results of the method in the embodiment of the present invention under different depth models

[0058]

[0059] In order to verify the robustness of the proposed backdoor attack method against the defense method, this embodiment is evaluated on the CIFAR10 and GTSRB datasets using Gaussian filtering, image compression, and autoencoders. As shown in Table 3, the two most advanced frequency domain attack methods (i.e., FIBA ​​and FProjan) are severely affected (i.e., ASR is significantly reduced), especially FProjan, whose average attack success rate on both datasets is less than 10%. In addition, other mainstream attack methods (i.e., BadNets, WaNet, ISSBA, BppAttack) also failed to evade these defenses because their attack performance on both datasets was greatly reduced. In contrast, the method of the embodiment of the present invention maintains almost the same attack success rate against all these preprocessing-based defenses. Figure 3 The defense results of this method against "neuron pruning" are plotted. As the number of pruned neurons increases, although the clean accuracy drops significantly, the attack success rate remains at a high level. Figure 4 The defense results of the method of the embodiment of the present invention against "neural purification" are plotted. The anomaly index of the backdoor model on all data sets is less than 2, and even lower than the anomaly index of the clean model, which shows that the method of this embodiment can bypass the detection of "neural purification".

[0060] Table 3 Comparison of the results of pre-processing defense by the method of the present invention and six existing methods

[0061]

[0062] The above tests show that the backdoor attack method proposed in the embodiment of the present invention has good attack effectiveness and visual concealment that is imperceptible to the human eye; at the same time, it has strong robustness against existing backdoor defense methods.

[0063] Example 2

[0064] Embodiment 2 of the present invention provides a terminal device corresponding to the above-mentioned embodiment 1. The terminal device may be a processing device for a client, such as a mobile phone, a laptop computer, a tablet computer, a desktop computer, etc., to execute the method of the above-mentioned embodiment.

[0065] The terminal device of this embodiment includes a memory, a processor, and a computer program stored in the memory; the processor executes the computer program in the memory to implement the steps of the method in the above-mentioned embodiment 1.

[0066] In some implementations, the memory may be a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory.

[0067] In some other implementations, the processor may be a central processing unit (CPU), a digital signal processor (DSP), or other general-purpose processors of various types, which are not limited herein.

[0068] Example 3

[0069] Embodiment 3 of the present invention provides a computer-readable storage medium corresponding to the above embodiment 1, on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps of the method of the above embodiment 1 are implemented.

[0070] Computer readable storage media can be tangible devices that hold and store instructions used by instruction execution devices. Computer readable storage media can be, for example, but not limited to, electronic storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any combination thereof.

[0071] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code. The scheme in the embodiments of the present application can be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.

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

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

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

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

Claims

1. A backdoor attack method based on frequency domain, It is characterized in that The following steps are involved: S1, obtaining a training data set, determining a poisoning rate μ, and randomly selecting μ% of samples in the training data set as poisoning samples; the training data set includes a plurality of image data; S2, performing discrete cosine transform on each poisoned sample to convert the image information of the poisoned sample from the pixel domain to the frequency domain; S3, for each discrete cosine transformed sample, using the information mask to reduce the strength of the low-frequency basis and the high-frequency basis of the sample, and converting the sample with reduced strength back to the pixel domain through inverse discrete cosine transform; S4, modifying the label of the sample processed in step S3 to a predefined target label, and mixing the sample with the modified label with the original clean sample to obtain the final poisoned data set; S5. Using the final poisoned data set as input of a deep learning model, training the deep learning model, and obtaining a backdoor model.

2. The frequency domain-based backdoor attack method according to claim 1, It is characterized in that The poisoning rate ranges from 0<μ<5.

3. The frequency domain-based backdoor attack method according to claim 1, It is characterized in that In step S3, The specific implementation process of using information mask to reduce the strength of the low-frequency basis and high-frequency basis of the sample includes: 1) Generate a fixed-value square mask M of size k×k, where the value is set to α∈(0, 1); k is a constant; 2) Select a frequency base point (u, v) as the center point and place M around the center point; (u, v) represents the coordinates of the point corresponding to the image information in the frequency domain; 3) Poisoning frequency domain base amplitude I p The calculation formula is: p =I o ×α;I o represents the amplitude of the original frequency domain basis within M.

4. The frequency domain-based backdoor attack method according to claim 3, It is characterized in that For an image of size H×H, the value of k is set to H is the image length / width.

5. A terminal device comprising a memory, a processor and a computer program stored in the memory; It is characterized in that The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 4.

6. A computer-readable storage medium having a computer program / instructions stored thereon; It is characterized in that When the computer program / instructions are executed by a processor, the steps of the method described in any one of claims 1 to 4 are implemented.

7. A computer program product comprising a computer program / instructions; It is characterized in that When the computer program / instructions are executed by a processor, the steps of the method of any one of claims 1 to 4 are implemented.

Citation Information

Cited By

  • Dynamic invisible backdoor sample simulation generation method based on frequency domain similarity

    CN121121348A

  • Dynamic invisible backdoor sample simulation generation method based on frequency domain similarity

    CN121121348B