A black box adversarial sample generation method and device

The black-box adversarial sample generation method that combines deep neural networks and particle swarm optimization algorithms solves the problems of redundant disturbance and low attack success rate in UAV systems, achieves efficient and flexible adversarial sample generation, and improves attack success. Rate.

CN118551829BActive Publication Date: 2024-10-11NORTHWESTERN POLYTECHNICAL UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411010346.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-10-11
Estimated Expiration
2044-07-26

AI Technical Summary

Technical Problem

Existing black-box adversarial sample generation methods are prone to redundant disturbances and unnecessary pixel tampering in UAV systems, resulting in high computational overhead and low attack success rate.

Method used

The classifier of deep neural network is combined with Euclidean distance and PID controller, and the optimal adversarial sample is generated through particle swarm optimization algorithm, which avoids dependence on alternative models and violent queries, and optimizes the adversarial attack model.

Benefits of technology

It improves the flexibility and versatility of the attack, reduces the number of queries, generates adversarial samples with little difference from the original image, reduces the risk of detection, and significantly improves the attack success rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118551829B_ABST
    Figure CN118551829B_ABST
Patent Text Reader

Abstract

The present invention discloses a black-box adversarial sample generation method and device, which relates to the field of drone countermeasures, and is used to solve the problem that the current adversarial sample generation method under black-box attack relies too much on the model, which easily causes a large number of redundant disturbances and a high number of queries, resulting in large computational overhead and low attack success rate. It includes: according to the Euclidean distance between the label of the clean sample and the label of the target image, a first adversarial disturbance of the target image is obtained through a PID controller, a tampered tampered adversarial sample is obtained according to the first adversarial disturbance and the clean sample, and a first identification label of the tampered adversarial sample is determined according to a classifier of a deep neural network; according to the Euclidean distance between the first identification label and a specific identification label of the target image, an adversarial attack optimization model is obtained through a PID controller; according to the PSO algorithm and the PID controller, the optimal PID control parameters are obtained, and according to the optimal PID control parameters, the optimal adversarial sample of the adversarial attack optimization model is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of drone countermeasures, and more specifically to a black box adversarial sample generation method and device. Background Art

[0002] With the accelerated development of massive data acquisition, high-performance GPU (Graphics processing unit) computing and efficient neural network architecture, deep learning models have advanced representation capabilities and powerful classification capabilities, enabling drone intelligent detection, real-time target tracking and accurate identification, and are widely used in border patrol monitoring, battlefield situation awareness, and search and rescue operations in harsh environments. Therefore, deep learning has become an important research topic in the field of drone applications. However, recent studies have shown that drone systems based on deep learning are vulnerable to adversarial sample attacks during data collection, transmission and application. This attack cleverly changes the input data, that is, adding subtle perturbations that are not easily perceived by the human eye to the input image, so as to deceive the drone visual recognition system. In scenarios where drones are used to perform critical tasks, the detected images that are incorrectly identified by the drone system after being attacked will lead to unpredictable behaviors, such as incorrectly marking obstacles and missing search targets, which will lead to serious consequences. Therefore, the method of generating adversarial samples is not only an active research direction in the field of artificial intelligence security, but also a frontier hotspot in the development of the drone industry. Through in-depth research on key technologies such as the generation mechanism, detection methods, and defense measures of drone adversarial samples, the safety and reliability of drone systems can be ensured, and important theoretical basis and strong technical support can be provided for future intelligent warfare and unmanned operations.

[0003] Adversarial sample generation methods can be divided into white-box adversarial attacks and black-box adversarial attacks according to the degree of model information acquisition, and can also be divided into targeted attacks and non-targeted attacks according to the degree of limitation of model misjudgment results. In white-box adversarial attacks, adversarial sample generation methods mostly use the gradient and decision boundary distance of deep neural network back propagation to construct a variety of adversarial perturbations, such as L-BFGS (Limited-memory Broyden–Fletcher–Goldfarb–Shanno algorithm, limited BFGS algorithm), FGSM (Fast Gradient Sign Method), OTCM (One-step target class Method) and C&W (Carlini and Wagne). However, in real drone detection scenarios, most system models are unknown, and unauthorized persons are not allowed to perform white-box access to the model. Therefore, it is difficult to obtain complete information about the model, and research on black-box attacks is needed. Existing black-box adversarial attack methods include OPA (One Pixel Attack), ZOO (Zeroth Order Optimization), adversarial sample generation based on generative adversarial networks, and model-based integrated attack methods. However, these methods usually generate adversarial samples by estimating gradients and brute force queries in the decision space, or by differential evolution and training substitution models, which can easily cause a large number of redundant disturbances and unnecessary pixel tampering, which not only increases the number of queries (computing power), but also increases the risk of the attack intention being discovered (the image may have obvious signs of tampering, such as blurry images, or images that are too different from the original images, etc.), thereby greatly reducing the success rate of the attack. Summary of the invention

[0004] The embodiments of the present invention provide a black-box adversarial sample generation method and device, which are used to solve the problem that the current adversarial sample generation method under black-box attack relies too much on the model, easily causing a large amount of redundant disturbances and a high number of queries, resulting in high computational overhead and low attack success rate.

[0005] An embodiment of the present invention provides a black-box adversarial sample generation method, comprising:

[0006] Obtain labels for clean samples and target images based on the deep neural network classifier;

[0007] According to the Euclidean distance between the label of the clean sample and the label of the target image, a first adversarial disturbance of the target image is obtained by a proportional integral differential (PID) controller, a tampered adversarial sample is obtained according to the first adversarial disturbance and the clean sample, and a first identification label of the tampered adversarial sample is determined according to a classifier of a deep neural network;

[0008] According to the Euclidean distance between the first recognition tag and the specific recognition tag of the target image, an adversarial attack optimization model is obtained through a PID controller; optimal PID control parameters are obtained according to a particle swarm optimization PSO algorithm and a PID controller, and an optimal adversarial sample of the adversarial attack optimization model is obtained according to the optimal PID control parameters.

[0009] Preferably, obtaining the anti-attack optimization model through a PID controller according to the Euclidean distance between the first identification tag and the specific identification tag of the target image specifically includes:

[0010] When the first identification tag is the same as the specific identification tag of the target image, it is determined that the adversarial attack optimization model obtained by the PID controller is a targeted adversarial attack optimization model, and the targeted adversarial attack optimization model is as follows:

[0011]

[0012] in, represents the targeted adversarial attack optimization model, represents the second adversarial perturbation generated by the targeted adversarial attack, represents a tampered adversarial sample, represents the specific identification label of the target image, Represents the first identification label of the tampered adversarial sample, Represents a tampered adversarial sample Determined by the deep neural network classifier The recognition result of Represents a tampered adversarial sample Determined by the deep neural network classifier The recognition result of represents the weight parameter required to generate the second adversarial perturbation, express Norm metric, Indicates taking The maximum value of Indicates taking - and The maximum value in It represents the minimization of loss function.

[0013] Preferably, the second adversarial perturbation generated by the targeted adversarial attack is as follows:

[0014]

[0015]

[0016]

[0017] in, represents the second adversarial perturbation generated by the targeted adversarial attack, , and Represents the three parameters of the PID controller, represents the proportional gain, represents the integral gain, represents the differential gain, represents the threshold parameter of the second adversarial perturbation, represents the Euclidean distance between the first recognition label and the specific recognition label of the target image, Represents a tampered adversarial sample Determined by the deep neural network classifier The recognition result of represents the specific identification label of the target image, Represents a tampered adversarial sample Determined by the deep neural network classifier The recognition result of Represents the first identification label of the tampered adversarial sample, represents a tampered adversarial sample, express Norm metric, Indicates the second time.

[0018] Preferably, obtaining optimal PID control parameters according to a particle swarm optimization PSO algorithm and a PID controller, and obtaining an optimal adversarial sample of the anti-attack optimization model according to the optimal PID control parameters specifically include:

[0019] The parameters of the PID controller are updated in sequence according to the particles included in the particle swarm in the PSO algorithm to obtain updated parameters of the PID controller;

[0020] Obtaining a third adversarial disturbance of the targeted adversarial attack optimization model according to a PID controller including an updated parameter, obtaining a second adversarial sample according to the third adversarial disturbance and the clean sample, and determining a second identification label of the second adversarial sample according to a classifier of a deep neural network;

[0021] If the second identification label is the same as the specific identification label of the target image and the third adversarial disturbance is minimized, the adversarial attack optimization model is determined as the targeted adversarial attack optimization model, the update parameters are determined as the optimal PID control parameters, and the second adversarial sample is determined as the optimal adversarial sample of the targeted adversarial attack optimization model.

[0022] Preferably, after determining the second identification label of the second adversarial sample according to the classifier of the deep neural network, the method further includes:

[0023] If the second identification tag is different from the specific identification tag of the target image, updating the speed and position of the particles included in the particle swarm in the PSO algorithm according to the update parameter;

[0024] Among them, the particle swarm included in the PSO algorithm updates the particle position and particle velocity according to the following formula:

[0025]

[0026]

[0027]

[0028] in, Indicates Particle iterations The speed of the second time, Indicates The inertia factor of the iteration, Indicates Particle iterations The speed of the second time, , represents the acceleration factor, Indicated in Random numbers in the interval, Indicates Particle iterations The optimal position at the next time, Indicates Particle iterations The position of the next time, represents the optimal position of the particle swarm, represents the number of iterations of the algorithm, Indicates Particle iterations The position of the next time, represents the maximum value of the inertia factor, represents the minimum value of the inertia factor, represents the maximum number of algorithm iterations, , Indicates the size of the particle swarm.

[0029] Preferably, the tampering adversarial sample is as follows:

[0030]

[0031] The first identification tag of the tampered adversarial sample is as follows:

[0032]

[0033] in, represents a tampered adversarial sample, represents a clean sample, represents the first adversarial perturbation of the target image, represents the first identification label of the tampered adversarial sample, argmax represents the variable value that makes the function reach the maximum value, Represents a tampered adversarial sample Determined by the deep neural network classifier The recognition result.

[0034] An embodiment of the present invention provides a black-box adversarial sample generation device, comprising:

[0035] The first obtaining unit is used to obtain the label of the clean sample and the label of the target image according to the classifier of the deep neural network;

[0036] A determination unit, configured to obtain a first adversarial disturbance of the target image through a proportional integral differential (PID) controller according to a Euclidean distance between a label of the clean sample and a label of the target image, obtain a tampered adversarial sample according to the first adversarial disturbance and the clean sample, and determine a first identification label of the tampered adversarial sample according to a classifier of a deep neural network;

[0037] The second obtaining unit is used to obtain the adversarial attack optimization model through the PID controller according to the Euclidean distance between the first recognition label and the specific recognition label of the target image; obtain the optimal PID control parameters according to the particle swarm optimization PSO algorithm and the PID controller, and obtain the optimal adversarial sample of the adversarial attack optimization model according to the optimal PID control parameters.

[0038] An embodiment of the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes any one of the above-mentioned black-box adversarial sample generation methods.

[0039] An embodiment of the present invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes any one of the above-mentioned black-box adversarial sample generation methods.

[0040] The embodiment of the present invention provides a method and device for generating a black-box adversarial sample, the method comprising: obtaining a label of a clean sample and a label of a target image according to a classifier of a deep neural network; obtaining a first adversarial perturbation of the target image through a PID controller according to the Euclidean distance between the label of the clean sample and the label of the target image, obtaining a tampered adversarial sample according to the first adversarial perturbation and the clean sample, and determining a first identification label of the tampered adversarial sample according to the classifier of the deep neural network; obtaining an adversarial attack optimization model through a PID controller according to the Euclidean distance between the first identification label and a specific identification label of the target image; obtaining an optimal PID control parameter according to a PSO algorithm and a PID controller, and obtaining an optimal adversarial sample of the adversarial attack optimization model according to the optimal PID control parameter. The method does not require training a replacement model to perform a transfer attack, so it does not rely on a specific model, and can be more widely used in various real-life scenarios of black-box attacks, improving the flexibility and versatility of the attack; furthermore, the method uses a relatively small number of queries to quickly generate the optimal adversarial perturbation, and basically does not generate unnecessary pixel tampering and redundant perturbations; because the generated adversarial sample is less different from the original image, the attack intention is more difficult to detect, thereby greatly improving the success rate of the attack. This method can solve the problem that the current adversarial sample generation method under black-box attack relies too much on substitution models and brute force queries, which easily causes a large amount of redundant perturbations and unnecessary pixel tampering. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0042] Figure 1 A schematic diagram of a black-box adversarial sample generation method provided by an embodiment of the present invention;

[0043] Figure 2 A schematic diagram of the structure of a black-box adversarial sample production device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.

[0045] Terms involved in the embodiments of the present invention:

[0046] 1. PSO (Particle Swarm Optimization) algorithm is a type of evolutionary algorithm. Taking bird foraging as an example, in the particle swarm optimization algorithm, each bird in the flock is called a "particle" and has speed and position like the bird. A certain number of particles are randomly generated as valid solutions to the problem search space, and then iterative search is performed. The fitness value of the particle is determined by the fitness function corresponding to the problem to obtain the optimization result.

[0047] 2. PID (proportional-integral-derivative control) controller, composed of proportional unit P, integral unit I and derivative unit D, is a common feedback loop component in industrial control applications. The PID controller compares the collected data with a reference value, and then uses the difference to calculate a new input value. The purpose of this new input value is to make the system data reach or remain at the reference value.

[0048] Figure 1 A flowchart of a black box adversarial sample generation method provided by an embodiment of the present invention is as follows: Figure 1 Taking this example, a black-box adversarial sample generation method provided by an embodiment of the present invention is introduced.

[0049] like Figure 1 As shown, the method provided by the embodiment of the present invention mainly includes the following steps:

[0050] Step 101, obtaining labels of clean samples and labels of target images according to a deep neural network classifier;

[0051] Step 102, according to the Euclidean distance between the label of the clean sample and the label of the target image, a first adversarial perturbation of the target image is obtained through a PID controller, a tampered adversarial sample is obtained according to the first adversarial perturbation and the clean sample, and a first identification label of the tampered adversarial sample is determined according to a classifier of a deep neural network;

[0052] Step 103, according to the Euclidean distance between the first recognition tag and the specific recognition tag of the target image, obtain the adversarial attack optimization model through the PID controller; obtain the optimal PID control parameters according to the particle swarm optimization PSO algorithm and the PID controller, and obtain the optimal adversarial sample of the adversarial attack optimization model according to the optimal PID control parameters.

[0053] Before step 101, it is necessary to obtain the original image. For example, one can first select any image from the military equipment dataset (including fighter jets, aircraft, ships, missiles, etc.) as the original image, and then further perform maximum-minimum normalization processing on the original image so that the original image is mapped to [0,1] Get a clean sample, which can be expressed by the following formula:

[0054] (1)

[0055] in, Indicates a clean sample.

[0056] Accordingly, any image can be selected from other data sets for preprocessing to obtain a target image, and the specific types of other data sets are not limited here.

[0057] In step 101, the processed data set including the clean sample and the target image are input into the pre-trained deep neural network for image recognition. Specifically, the deep neural network randomly selects a processed and trained clean sample from the data set, and can obtain the classification confidence vector results of all labels corresponding to the clean sample; the target image can also obtain its corresponding classification confidence vector results after passing through the deep neural network; further, the label corresponding to the largest classification confidence is determined as the label of the clean sample and the label of the target image respectively.

[0058] In the embodiment of the present invention, the classification confidence vectors of all labels can be determined by the following formula (2), and the labels of the target image and the clean sample are shown in formula (3):

[0059] (2)

[0060] (3)

[0061] in, represents a deep neural network model, Represents the classification confidence vector result containing all labels output by the deep neural network. Labels or clean examples representing the target image .

[0062] It should be noted that It represents the confidence vector of the deep neural network for classifying the sample image. Assuming that the classification confidence vector is: [0.3, 0.2, 0.25, 0.8, 0.05], Representation vector When the maximum classification confidence value in is 0.8, the corresponding index value is 3, that is, when hour, In practical applications, when the label of the clean sample is the same as the label of the target image, the target image needs to be reselected.

[0063] In step 102, according to the Euclidean distance between the label of the clean sample and the label of the target image, a first adversarial perturbation of the target image is gradually adjusted by a PID controller. In an embodiment of the present invention, the first adversarial perturbation of the target image can be expressed by the following formula:

[0064] (4)

[0065] in, represents the first adversarial perturbation of the target image, , and Represents the three parameters of the PID controller, represents the proportional gain, represents the integral gain, represents the differential gain, Represents the Euclidean distance between the label of the clean sample and the label of the target image, that is, Norm metric, , represents the threshold parameter of the first adversarial perturbation, represents the first time, and the second term in formula (4) represents At the first time The third term in formula (4) is expressed as At the first time The differential on .

[0066] Furthermore, a tampered adversarial sample is obtained according to the first adversarial perturbation of the target image and the clean sample, and a first identification label of the tampered adversarial sample is determined according to the classifier of the deep neural network. The tampered adversarial sample can be determined by the following formula:

[0067] (5)

[0068] The first identification label of the tampered adversarial sample is determined by the following formula:

[0069] (6)

[0070] in, represents a tampered adversarial sample, represents a clean sample, represents the first adversarial perturbation of the target image, represents the first identification label of the tampered adversarial sample, argmax represents the variable value that makes the function reach the maximum value, Represents a tampered adversarial sample Determined by the deep neural network classifier The recognition result.

[0071] In step 103, according to the Euclidean distance between the first identification tag and the specific identification tag of the target image, an adversarial attack optimization model is obtained through a PID controller, where the first identification tag refers to the first identification tag of the tampered adversarial sample.

[0072] Specifically, the Euclidean distance between the first identification tag and the specific identification tag of the target image can be determined by the following formula:

[0073] (7)

[0074] in, represents the Euclidean distance between the first recognition label and the specific recognition label of the target image, Represents a tampered adversarial sample Determined by the deep neural network classifier The recognition result of represents the specific identification label of the target image, Represents a tampered adversarial sample Determined by the deep neural network classifier The recognition result of Represents the first identification label of the tampered adversarial example.

[0075] In an embodiment of the present invention, when the first identification tag is the same as the specific identification tag of the target image, the adversarial attack optimization model obtained by the PID controller is determined to be a targeted adversarial attack optimization model, wherein the targeted adversarial attack optimization model can be determined by the following formula:

[0076] (8)

[0077] in, represents the targeted adversarial attack optimization model, represents the second adversarial perturbation generated by the targeted adversarial attack, represents a tampered adversarial sample, represents the specific identification label of the target image, Represents the first identification label of the tampered adversarial sample, Represents a tampered adversarial sample Determined by the deep neural network classifier The recognition result of Represents a tampered adversarial sample Determined by the deep neural network classifier The recognition result of represents the weight parameter required to generate the second adversarial perturbation, express Norm metric, Indicates taking The maximum value of Indicates taking - and The maximum value in It represents the minimization of loss function.

[0078] Furthermore, the attack perturbation generated by the targeted adversarial attack can be determined by the following formula:

[0079] (9)

[0080] (10)

[0081] in, represents the second adversarial perturbation generated by the targeted adversarial attack, , and Represents the three parameters of the PID controller, represents the threshold parameter of the second adversarial perturbation, represents the Euclidean distance between the first recognition label and the specific recognition label of the target image, express Norm metric, Indicates the second time.

[0082] It should be noted that since the embodiments of the present invention are mainly aimed at targeted attacks, when the clean sample is input into the classifier of the deep neural network for the first time, regardless of whether the classifier of the deep neural network can correctly determine the label of the clean sample, the image needs to be tampered with; but if the clean sample input into the classifier of the deep neural network has the same label as the target image, the target image needs to be reselected; for example, assuming that the designated label of the target image is defined as category B, and the correct label of image 1 is category A, after image 1 passes through the classifier of the deep neural network, the classifier determines that the label of image 1 is category C. This method still needs to generate an adversarial sample of image 1 to cause the classifier of the deep neural network to identify image 1 as category B, for the attack to be considered successful.

[0083] In an embodiment of the present invention, after determining the targeted adversarial attack optimization model, it is necessary to determine the optimal adversarial sample of the targeted adversarial disturbance attack optimization model. Specifically, the optimal PID control parameters are obtained according to the PSO algorithm and the PID controller, and the optimal adversarial sample of the adversarial attack optimization model is obtained according to the optimal PID control parameters.

[0084] In the embodiment of the present invention, the particle swarm in the PSO algorithm may be an initialized particle swarm or an updated particle swarm.

[0085] Specifically, step 201 uses the position information and speed information of the particles included in the particle group to update the parameters included in the PID controller in sequence, wherein the parameters included in the PID controller include at least , and Three, when the above three parameters are updated, the updated parameters of the PID controller can be obtained.

[0086] In step 202, a third adversarial perturbation of the targeted adversarial attack optimization model is obtained according to formula (4) based on the PID controller including the updated parameters, a second adversarial sample is obtained according to the third adversarial perturbation and the clean sample, and a second identification label of the second adversarial sample is determined according to the classifier of the deep neural network. The detailed process of obtaining the third adversarial perturbation and the second adversarial sample of the targeted adversarial attack optimization model can be referred to step 102.

[0087] Step 203, when it is determined that the second identification label is the same as the specific identification label of the target image and the third adversarial disturbance is minimized, the adversarial attack optimization model can be determined as a targeted adversarial attack optimization model, and then the update parameters of the PID controller determined in the above steps are determined as the optimal PID control parameters. Further, the second adversarial sample is determined as the optimal adversarial sample of the targeted adversarial attack optimization model.

[0088] In practical applications, when it is determined that the second identification label is different from the specific identification label of the target image, the update parameters determined in step 201 are required to update the speed and position of the particles included in the particle swarm in step 201. After the speed and position of the particles included in the particle swarm in the PSO algorithm are updated, steps 201-202 can be executed again until the second identification label is determined again according to the classifier of the deep neural network, and then step 203 is executed until the second identification label is the same as the specific identification label of the target image and the first disturbance is minimized, then the particle swarm update operation is stopped, and the optimal adversarial sample and the optimal PID control parameters are output.

[0089] In the embodiment of the present invention, the particle swarm in the PSO algorithm updates the position and speed according to the following formula:

[0090] (11)

[0091] (12)

[0092] (13)

[0093] in, Indicates Particle iterations The speed of the second time, Indicates The inertia factor of the iteration, Indicates Particle iterations The speed of the second time, , represents the acceleration factor, Indicated in Random numbers in the interval, Indicates Particle iterations The optimal position at the next time, Indicates Particle iterations The position of the next time, represents the optimal position of the particle swarm, represents the number of iterations of the algorithm, Indicates Particle iterations The position of the next time, represents the maximum value of the inertia factor, represents the minimum value of the inertia factor, represents the maximum number of algorithm iterations, , Indicates the size of the particle swarm.

[0094] An embodiment of the present invention provides a black-box adversarial sample generation method and device, the method comprising: obtaining a label of a clean sample and a label of a target image according to a classifier of a deep neural network; obtaining a first adversarial perturbation of the target image through a PID controller according to the Euclidean distance between the label of the clean sample and the label of the target image, obtaining a tampered adversarial sample according to the first adversarial perturbation and the clean sample, and determining a first identification label of the tampered adversarial sample according to the classifier of the deep neural network; obtaining an adversarial attack optimization model through a PID controller according to the Euclidean distance between the first identification label and a specific identification label of the target image; obtaining optimal PID control parameters according to a PSO algorithm and a PID controller, and obtaining an optimal adversarial sample of the adversarial attack optimization model according to the optimal PID control parameters. This method does not require training of alternative models to carry out transfer attacks, so it does not rely on specific models and can be more widely used in various real-world scenarios of black-box attacks, improving the flexibility and versatility of attacks. Furthermore, this method uses fewer queries (computing power) to quickly generate optimal adversarial perturbations, and basically does not produce unnecessary pixel tampering and redundant perturbations. Since the generated adversarial samples are less different from the original images, the attack intention is more difficult to detect, thereby greatly improving the success rate of the attack. This method can solve the problem that the current adversarial sample generation method under black-box attacks relies too much on alternative models and brute force queries, which easily causes a large number of redundant perturbations and unnecessary pixel tampering.

[0095] Based on the same inventive concept, an embodiment of the present invention provides a black-box adversarial sample generation device. Since the principle of solving the technical problem of the device is similar to that of a black-box adversarial sample generation method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0096] Figure 2 A schematic diagram of the structure of a black box adversarial sample production device provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, the device includes: a first obtaining unit 301, a determining unit 302 and a second obtaining unit 303.

[0097] A first obtaining unit 301 is used to obtain a label of a clean sample and a label of a target image according to a classifier of a deep neural network;

[0098] A determination unit 302 is configured to obtain a first adversarial disturbance of the target image through a proportional integral differential (PID) controller according to a Euclidean distance between the label of the clean sample and the label of the target image, obtain a tampered adversarial sample according to the first adversarial disturbance and the clean sample, and determine a first identification label of the tampered adversarial sample according to a classifier of a deep neural network;

[0099] The second obtaining unit 303 is used to obtain the adversarial attack optimization model through the PID controller according to the Euclidean distance between the first recognition label and the specific recognition label of the target image; obtain the optimal PID control parameters according to the particle swarm optimization PSO algorithm and the PID controller, and obtain the optimal adversarial sample of the adversarial attack optimization model according to the optimal PID control parameters.

[0100] It should be understood that the units included in the above black-box adversarial sample generation device are only logical divisions based on the functions implemented by the device. In practical applications, the above units can be superimposed or split. In addition, the functions implemented by the black-box adversarial sample generation device provided in this embodiment correspond one-to-one to the black-box adversarial sample generation method provided in the above embodiment. The more detailed processing flow implemented by the device has been described in detail in the above method embodiment 1 and will not be described in detail here.

[0101] Another embodiment of the present invention also provides a computer device, which includes: a processor and a memory; the memory is used to store computer program code, and the computer program code includes computer instructions; when the processor executes the computer instructions, the electronic device executes each step of the black-box adversarial sample generation method in the method flow described in the above method embodiment.

[0102] Another embodiment of the present invention further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a computer device, the computer device executes each step of the black-box adversarial sample generation method in the method flow described in the above method embodiment.

[0103] Although the preferred embodiments of the present invention 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 that fall within the scope of the present invention.

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

Claims

1. A black-box adversarial sample generation method, It is characterized in that include: Obtain labels for clean samples and target images based on the deep neural network classifier; According to the Euclidean distance between the label of the clean sample and the label of the target image, a first adversarial disturbance of the target image is obtained by a proportional integral differential (PID) controller, a tampered adversarial sample is obtained according to the first adversarial disturbance and the clean sample, and a first identification label of the tampered adversarial sample is determined according to a classifier of a deep neural network; According to the Euclidean distance between the first identification tag and the specific identification tag of the target image, a counter-attack optimization model is obtained through a PID controller; optimal PID control parameters are obtained according to a particle swarm optimization PSO algorithm and a PID controller, and an optimal counter-attack sample of the counter-attack optimization model is obtained according to the optimal PID control parameters; The method of obtaining the anti-attack optimization model through a PID controller according to the Euclidean distance between the first identification tag and the specific identification tag of the target image specifically includes: When the first identification tag is the same as the specific identification tag of the target image, it is determined that the adversarial attack optimization model obtained by the PID controller is a targeted adversarial attack optimization model, and the targeted adversarial attack optimization model is as follows: ||h 1 || 2 ≤e 1 Among them, J(η 1 ) represents the targeted adversarial attack optimization model, η 1 represents the second adversarial perturbation generated by the targeted adversarial attack, x′ represents the tampered adversarial sample, and y t represents the specific identification label of the target image, y′ represents the first identification label of the tampered adversarial sample, Indicates that the tampered adversarial sample x′ determines y according to the deep neural network classifier t The recognition result, g y′ (x′) represents the recognition result of y′ determined by the tampered adversarial sample x′ according to the deep neural network classifier, λ represents the weight parameter required to generate the second adversarial perturbation, ||η 1 || 2 Indicates l 2 Norm metric, maxg y′ (x′) represents taking g y′ The maximum value of (x′), Indicates taking and 0, min{·} represents the minimization of the loss function, K p , K i and K d Represents the three parameters of the PID controller, K p Represents proportional gain, K i Indicates the integral gain, K d represents the differential gain, ε 1 represents the threshold parameter of the second adversarial perturbation, err 1 represents the Euclidean distance between the first recognition label and the specific recognition label of the target image, t 1 Indicates the second time; The method of obtaining the optimal PID control parameters according to the particle swarm optimization PSO algorithm and the PID controller, and obtaining the optimal adversarial sample of the anti-attack optimization model according to the optimal PID control parameters, specifically includes: The parameters of the PID controller are updated in sequence according to the particles included in the particle swarm in the PSO algorithm to obtain updated parameters of the PID controller; Obtaining a third adversarial disturbance of the targeted adversarial attack optimization model according to a PID controller including an updated parameter, obtaining a second adversarial sample according to the third adversarial disturbance and the clean sample, and determining a second identification label of the second adversarial sample according to a classifier of a deep neural network; If the second identification label is the same as the specific identification label of the target image and the third adversarial disturbance is minimized, the adversarial attack optimization model is determined as the targeted adversarial attack optimization model, the update parameters are determined as the optimal PID control parameters, and the second adversarial sample is determined as the optimal adversarial sample of the targeted adversarial attack optimization model.

2. The method according to claim 1, It is characterized in that After determining the second identification label of the second adversarial sample according to the classifier of the deep neural network, the method further includes: If the second identification tag is different from the specific identification tag of the target image, updating the speed and position of the particles included in the particle swarm in the PSO algorithm according to the update parameter; Among them, the particle swarm included in the PSO algorithm updates the particle position and particle velocity according to the following formula: in, represents the speed of the i-th particle at the k+1th iteration, ω k represents the inertia factor of the kth iteration, represents the velocity of the i-th particle at the kth iteration, c 1 、c 2 represents the acceleration factor, r 1 、r 2 represents a random number in the interval [0,1], represents the optimal position of the i-th particle after k iterations, represents the position of the i-th particle after iterating k times, represents the optimal position of the particle swarm, k represents the number of iterations of the algorithm, represents the position of the i-th particle at the k+1th iteration, ω max represents the maximum value of the inertia factor, ω min represents the minimum value of the inertia factor, k max It represents the maximum number of algorithm iterations, i=1,2,…,n, where n represents the size of the particle swarm.

3. The method according to claim 1, It is characterized in that The tampered adversarial sample is as follows: x′=x+η 0 The first identification tag of the tampered adversarial sample is as follows: y′=argmaxg y′ (x′) Among them, x′ represents the tampered adversarial sample, x represents the clean sample, η 0 represents the first adversarial perturbation of the target image, y′ represents the first identification label of the tampered adversarial sample, argmax represents the variable value that makes the function reach the maximum value, and g y′ (x′) represents the recognition result of y′ determined by the tampered adversarial sample x′ based on the deep neural network classifier.

4. A black box adversarial sample generation device, It is characterized in that include: The first obtaining unit is used to obtain the label of the clean sample and the label of the target image according to the classifier of the deep neural network; A determination unit, configured to obtain a first adversarial disturbance of the target image through a proportional integral differential (PID) controller according to a Euclidean distance between a label of the clean sample and a label of the target image, obtain a tampered adversarial sample according to the first adversarial disturbance and the clean sample, and determine a first identification label of the tampered adversarial sample according to a classifier of a deep neural network; A second obtaining unit is used to obtain an adversarial attack optimization model through a PID controller according to the Euclidean distance between the first recognition tag and the specific recognition tag of the target image; obtain optimal PID control parameters according to a particle swarm optimization PSO algorithm and a PID controller, and obtain an optimal adversarial sample of the adversarial attack optimization model according to the optimal PID control parameters; The second obtaining unit is further used for: When the first identification tag is the same as the specific identification tag of the target image, it is determined that the adversarial attack optimization model obtained by the PID controller is a targeted adversarial attack optimization model, and the targeted adversarial attack optimization model is as follows: ||h 1 || 2 ≤e 1 Among them, J(η 1 ) represents the targeted adversarial attack optimization model, η 1 represents the second adversarial perturbation generated by the targeted adversarial attack, x′ represents the tampered adversarial sample, and y t represents the specific identification label of the target image, y′ represents the first identification label of the tampered adversarial sample, Indicates that the tampered adversarial sample x′ determines y according to the deep neural network classifier t The recognition result, g y′ (x′) represents the recognition result of y′ determined by the tampered adversarial sample x′ according to the deep neural network classifier, λ represents the weight parameter required to generate the second adversarial perturbation, ||η 1 || 2 Indicates l 2 Norm metric, maxg y′ (x′) represents taking g y′ The maximum value of (x′), Indicates taking and 0, min{·} represents the minimization of the loss function, K p , K i and K d Represents the three parameters of the PID controller, K p Represents proportional gain, K i Indicates the integral gain, K d represents the differential gain, ε 1 represents the threshold parameter of the second adversarial perturbation, err 1 represents the Euclidean distance between the first recognition label and the specific recognition label of the target image, t 1 Indicates the second time; The method of obtaining the optimal PID control parameters according to the particle swarm optimization PSO algorithm and the PID controller, and obtaining the optimal adversarial sample of the anti-attack optimization model according to the optimal PID control parameters, specifically includes: The parameters of the PID controller are updated in sequence according to the particles included in the particle swarm in the PSO algorithm to obtain updated parameters of the PID controller; Obtaining a third adversarial disturbance of the targeted adversarial attack optimization model according to a PID controller including an updated parameter, obtaining a second adversarial sample according to the third adversarial disturbance and the clean sample, and determining a second identification label of the second adversarial sample according to a classifier of a deep neural network; If the second identification label is the same as the specific identification label of the target image and the third adversarial disturbance is minimized, the adversarial attack optimization model is determined as the targeted adversarial attack optimization model, the update parameters are determined as the optimal PID control parameters, and the second adversarial sample is determined as the optimal adversarial sample of the targeted adversarial attack optimization model.

5. A computer device, It is characterized in that The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the black-box adversarial sample generation method according to any one of claims 1 to 3.

6. A computer-readable storage medium, It is characterized in that A computer program is stored, and when the computer program is executed by a processor, the processor executes the black-box adversarial sample generation method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Speech recognition attack defense method based on PSO algorithm

    CN110767216A

  • Chemical process multi-loop PID parameter setting method and application thereof

    CN117192966A

  • Adversarial sample generation method and device

    CN117274658A

  • Neural network-based perturbation removal

    US20240104698A1