Black-box adversarial sample generation method and device based on multiple universal adversarial perturbations
Through the two-stage generation method of multiple universal adversarial perturbations, combined with genetic algorithms, the problems of low efficiency and poor attack effect in black-box adversarial sample generation are solved, and efficient adversarial sample generation is achieved, achieving similar effects to white-box attacks.
Patent Information
- Application Number
- CN202410661033.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-05-27
AI Technical Summary
Existing black-box adversarial sample generation algorithms are inefficient and have poor attack effects. They fail to effectively utilize the common perturbation experience between samples, resulting in a decrease in attack success rate in practical applications.
A two-stage generation method based on multiple universal adversarial perturbations is adopted. First, common perturbations are generated through genetic algorithms, and multiple universal adversarial perturbations and individual perturbations are combined to improve attack efficiency and effectiveness.
It improves the attack efficiency and effect of black-box adversarial sample generation, avoids the redundant consumption of repeatedly generating general disturbances, and can be comparable to white-box attack algorithms in a black-box environment.
Smart Images

Figure CN118246517B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of deep learning adversarial sample attack algorithms, and in particular to a method and device for generating black-box adversarial samples based on multiple universal adversarial perturbations. Background Art
[0002] Deep learning models have achieved remarkable success and have been widely used in various fields. However, as they are increasingly used, the security issues associated with these models have also attracted considerable attention. A large number of studies have demonstrated that deep learning models are vulnerable to adversarial examples. These attacks involve injecting carefully designed perturbations into the original samples, which are imperceptible to the human eye but may cause deep learning to produce incorrect classification results for the generated adversarial examples. Adversarial attacks have been observed in multiple fields of deep learning, including visual classification tasks, face recognition, autonomous driving, and text analysis. In addition, the existence of adversarial examples has been confirmed in interdisciplinary studies. Given the widespread use of deep learning models and the potential security risks they bring, it is crucial to explore the reasons behind their vulnerability by studying the generation process of adversarial examples.
[0003] Existing adversarial attacks can be divided into white-box adversarial attacks and black-box adversarial attacks. In a white-box environment, the attacker has access to the model and knows the internal structure and high-order derivative information of the model. They have designed a large number of algorithms based on the gradient information of the model to generate adversarial samples, and have achieved great success in the field of adversarial attacks. In a black-box environment, the interior of the model is inaccessible. In most cases, attacks can only be performed through input-output black-box models, which has inspired the research of query-based black-box adversarial sample generation methods. Query-based methods generate adversarial perturbations by continuously inputting perturbations into the black-box model and adjusting the perturbation direction according to the output feedback. Since the black-box environment is closer to the actual situation, more and more black-box attack algorithms have emerged in recent years.
[0004] White-box attack methods have achieved great success in the field of adversarial attacks, and they have almost 100% attack success rate to subvert the output of the model. However, the owner or provider of the model usually only publishes the model in the form of model application programming interfaces (mAPIs) for the purpose of protecting their own property (model parameters and model data). This makes the internal architecture of the model inaccessible to users and attackers. This makes the white-box attack mode that generates adversarial perturbations based on the internal information of the model unusable in the actual environment.
[0005] The setting of the black-box attack method is closer to the actual environment. By providing perturbed input to the black-box model and adjusting the perturbation through the feedback of the model, the black-box attack realizes the attack on the target model without knowing the internal information of the model. At present, there are many technologies such as gradient estimation and evolutionary algorithms that are used in query-based black-box adversarial sample generation. However, the current query-based attack algorithm treats each individual as an independent individual when generating adversarial samples, which results in the need for the existing attack to repeat the algorithm steps of the batch number when a batch of adversarial sample generation tasks appear. This leads to the low efficiency of the algorithm in practical applications. When accessing some mAPIs with anti-crawler mechanisms, the limitation of the number of queries leads to a serious decrease in the attack success rate of the current black-box attack algorithm. The fundamental reason is that the existing black-box algorithm ignores the common perturbation experience in generating adversarial perturbations. In the process of generating adversarial perturbations each time, these common perturbations are repeatedly generated, resulting in serious query consumption.
[0006] The above methods focus on generating a single perturbation (SAP) for each sample, ignoring the common experience in the samples. Universal Adversarial Perturbation (UAP) solves this problem by leveraging the common features between samples to construct a universal perturbation direction in the deep learning model. This perturbation direction can transform a large portion of the samples into corresponding adversarial examples, leading to incorrect predictions of the model. Although the UAP method captures the commonality of the data, there are still two aspects that need to be improved. First, the non-convex nature of deep learning models makes UAP non-unique. Second, compared with SAP, UAP takes the opposite approach, emphasizing the commonality of sample perturbations and ignoring individuality. However, samples have both common features and their own unique features. In the context of adversarial example generation, commonality and individuality are not mutually exclusive. Instead, they need to be considered together.
[0007] There is a vulnerable aspect of deep learning models: carefully designed and imperceptible adversarial perturbations are injected into the original samples, which makes it challenging to accurately classify the generated adversarial examples. In a white-box environment, adversarial attacks can easily destroy the output of the model. However, in a black-box environment, current adversarial attack algorithms suffer from poor attack effects and low attack efficiency. Universal adversarial perturbations emphasize sample commonality and ignore individuality, so although the attack efficiency is improved, the attack effect is poor when faced with individual perturbations.
[0008] Therefore, there is an urgent need to provide a black-box adversarial sample generation method and device based on multiple universal adversarial perturbations to solve the above technical problems. Summary of the invention
[0009] In view of the problems existing in the prior art, the present invention provides a method and device for generating black-box adversarial samples based on multiple universal adversarial perturbations. Since the deep learning model contains multiple universal adversarial perturbations, a large number of samples can be converted into adversarial samples. Therefore, multiple universal adversarial perturbations are first generated through universal adversarial perturbations, and then the black-box adversarial sample generation process based on multiple universal adversarial perturbations is divided into two stages. A genetic algorithm (GA) is used as a query optimizer to improve the attack efficiency and attack effect by generating common perturbations and individual perturbations.
[0010] The technical solution of the present invention is achieved in this way:
[0011] S1. Obtain the corresponding true label according to the original sample; the original sample is the attacked sample, and the corresponding true label is the label of the attacked target. According to the label of the attacked target, the corresponding multiple universal adversarial perturbations are retrieved;
[0012] The multiple universal adversarial perturbations are a set of optimal universal adversarial perturbation populations selected after iterative updating of universal adversarial perturbations through a genetic algorithm, and are stored in a multiple universal adversarial perturbation storage M;
[0013] S2. Combine each original sample and the corresponding multiple universal adversarial perturbations and input them into the attacked classification model; obtain the output result after the attacked sample and the multiple universal adversarial perturbations are combined by query attack to confirm whether the multiple universal adversarial perturbations successfully attack the attacked sample;
[0014] If the multiple universal adversarial perturbation attacks are successful, the multiple universal adversarial perturbations are marked as adversarial perturbations;
[0015] S3. If the multiple universal adversarial perturbation attack fails, then according to the original sample and the multiple universal adversarial perturbations, through the individual perturbation fitness function, find the individual perturbation that is suitable for the original sample;
[0016] Initialize the individual disturbance population through multiple universal adversarial disturbances and multiple individual disturbances, and obtain the individual disturbance population with common universal disturbance information;
[0017] The individual disturbance population includes a plurality of potentially antagonistic individual disturbances;
[0018] S4. Calculate the fitness of the current personality disturbance population according to the current personality disturbance population and the personality disturbance fitness function to obtain the current personality disturbance population fitness;
[0019] S5. According to the obtained current personality disturbance population and its corresponding personality disturbance population fitness, the personality disturbance population of its offspring and its corresponding personality disturbance population fitness of its offspring are obtained by using a genetic optimizer and a personality disturbance fitness function;
[0020] According to the genetic algorithm, the personality disturbance populations of two generations and their corresponding personality disturbance population fitness are combined, that is, the current personality disturbance population and its corresponding personality disturbance population fitness, the personality disturbance population of the offspring and its corresponding personality disturbance population fitness, to obtain the updated personality disturbance population and its corresponding personality disturbance population fitness;
[0021] The obtained updated personality perturbation population and its corresponding personality perturbation population fitness are combined with the attacked classification model; whether the individual perturbation in the updated personality perturbation population successfully attacks the attacked sample is obtained by querying the attack method;
[0022] If the attack of an individual perturbation in the updated personality perturbation population is successful, the individual perturbation in the updated personality perturbation population that has successfully attacked is marked as an adversarial perturbation;
[0023] If the individual disturbance attack in the updated individual disturbance population fails, the updated individual disturbance population and its corresponding individual disturbance population fitness are used as the current individual disturbance population and its corresponding individual disturbance population fitness, and then S5 is repeatedly executed until the individual disturbance attack in the updated individual disturbance population is successful;
[0024] S6. Combine the marked adversarial perturbation with the attacked sample to obtain an adversarial sample.
[0025] Preferably, the method for generating multiple universal anti-disturbances includes:
[0026] S1.1. Data preparation: select the original sample data of the category to be attacked to form a data set;
[0027] S1.2. Randomly retrieve the original sample data from the data set without replacement and form a data subset;
[0028] S1.3. Initialize the universal adversarial perturbation population based on the data subset and the universal adversarial perturbation;
[0029] The universal adversarial perturbation population includes potentially adversarial universal individual perturbations;
[0030] S1.4. Calculate the fitness of the current universal anti-disturbance population according to the current universal anti-disturbance population and the universal anti-disturbance fitness function to obtain the current universal anti-disturbance population fitness;
[0031] S1.5. According to the obtained current universal antagonistic perturbation population and its corresponding universal antagonistic perturbation population fitness, the universal antagonistic perturbation population of its offspring and its corresponding universal antagonistic perturbation population fitness of its offspring are obtained by using a genetic optimizer and a universal antagonistic perturbation fitness function;
[0032] According to the genetic algorithm, the universal antagonistic perturbation populations of two generations and their corresponding universal antagonistic perturbation population fitnesses are combined, that is, the current universal antagonistic perturbation population and its corresponding universal antagonistic perturbation population fitnesses, the universal antagonistic perturbation population of the offspring and its corresponding universal antagonistic perturbation population fitnesses, to obtain the updated universal antagonistic perturbation population and its corresponding universal antagonistic perturbation population fitnesses;
[0033] The obtained updated universal adversarial perturbation population and its corresponding universal adversarial perturbation population fitness are used as the current universal adversarial perturbation population and its corresponding universal adversarial perturbation population fitness, and then S1.5 is repeatedly executed to obtain the universal adversarial perturbation population and its corresponding universal adversarial perturbation population fitness updated multiple times by iteration;
[0034] Suppose that the number of times S1.5 is repeated is N times, that is, the number of iterations is N times, then N+1 updated universal adversarial perturbation populations and their corresponding universal adversarial perturbation population fitnesses can be obtained; from the N+1 updated universal adversarial perturbation populations and their corresponding universal adversarial perturbation population fitnesses, the optimal universal adversarial perturbation population is selected according to its corresponding universal adversarial perturbation population fitness;
[0035] The optimal universal adversarial perturbation population is stored in the multiple universal adversarial perturbation storage M;
[0036] S1.6. Execute S1.2 again until all the original sample data in the data set are retrieved. The final set of multiple optimal universal adversarial perturbation populations is the multiple universal adversarial perturbations.
[0037] Preferably, in S3, the individual perturbation adapted to the original sample is found through the individual perturbation fitness function; the individual perturbation fitness function is:
[0038] ,
[0039] in, is the individual disturbance, It means that individual disturbances search within the range of the constraint set. is the original sample, The projection algorithm will perturb the sample The range of is constrained to [0,1]; is the true label corresponding to the original sample.
[0040] Specifically, individual perturbations are found through a single original sample, and multiple individual perturbations constitute a population of individual perturbations.
[0041] Preferably, in S3, the individual disturbance population is initialized by multiple universal adversarial disturbances and multiple individual disturbances to obtain the individual disturbance population with common universal disturbance information, which specifically includes:
[0042] Definition Weight vector ,in is the size of the multiple universal adversarial perturbations, for ,have , It takes any value from 1 to m. Further, the constructed weight matrix for:
[0043] ,
[0044] The weight matrix Before The column vector is a unit vector, and for ,have , which forms an identity matrix ; Refers to the population size, which is set as a constant;
[0045] For the remaining arrive Column vector, treating it as the front Linear combinations of column vectors, for ,have ;
[0046] Definition The direction vectors of multiple universal adversarial perturbations ; a refers to any element in the multi-universal adversarial perturbation, d refers to the dimension of element a in the multi-universal adversarial perturbation;
[0047] The generation formula of the initialized individual disturbance species is:
[0048] ,
[0049] The multiple universal adversarial perturbations are combined with the weight matrix The identity matrix of column vectors Multiply to preserve itself, and To Column vectors are multiplied to combine the perturbation characteristics of different universal adversarial perturbations in multiple universal adversarial perturbations to generate potential personalized individual perturbations.
[0050] Specifically, multiple universal perturbations are used to initialize the individual perturbation population, and finally the individual perturbation population with information of common universal perturbations is obtained.
[0051] Since genetic algorithms require the concept of a population, the population must be initialized first.
[0052] Preferably, in S5, the fitness of the personality perturbation population of its offspring and its corresponding personality perturbation population of its offspring is obtained by using a genetic optimizer and a personality perturbation fitness function, and the specific method is:
[0053] By giving the current population P, fitness value F, and fitness function , we get the optimized offspring population and its corresponding offspring population fitness, that is,
[0054] ,
[0055] in, is the offspring population, is the fitness of the offspring population; A genetic optimizer.
[0056] Preferably, in S1.3, the universal anti-disturbance is obtained by using the data subset and the universal anti-disturbance fitness function, that is,
[0057] ,
[0058] in, To universally resist disturbances, It means that the universal adversarial perturbation searches within the range of the constraint set. represents the size of the data subset, means The i-th original sample in The projection algorithm will perturb the sample The range of is constrained to [0,1]; is the true label corresponding to the original sample.
[0059] Specifically, the fitness of the population to the environment, min is a smaller value. The smaller the value, the higher its general fitness to resist disturbances to the constructed environment, and the easier it is to attack successfully.
[0060] Preferably, in S1.3, initializing the universal anti-disturbance population specifically includes:
[0061] ,
[0062] in, refers to any individual in the population, i refers to the i-th element in the individual, Randomly from Take any value from .
[0063] Preferably, in S1.5, the genetic optimizer used has the same principle as that used in S5.
[0064] Genetic Optimizer (GO) is an optimization method based on population optimization strategy, and its optimization criterion is survival of the fittest. , fitness value And the fitness function (optimization objective) , GO gives the optimized offspring population:
[0065] ;
[0066] The genetic algorithm optimizer simulates the natural selection and survival of the fittest to optimize the objective function. By simulating the concept of species population in nature, the genetic algorithm introduces population , and then simulate the concept of natural environment, and then introduce the degree of adaptation of population organisms to the environment, that is, fitness , which is calculated through fitness function / optimization objective;
[0067] Genetic algorithms can simulate the concept of survival of the fittest in nature, and the fittest in the environment (fitness The individuals with advantage in the population survive and reproduce better and more adaptable offspring (in line with the optimization goal). In the genetic algorithm, the offspring population is selected through iteration. And obtain the corresponding offspring population fitness .
[0068] The black-box adversarial sample generation device based on multiple universal adversarial perturbations is applied in the black-box adversarial sample generation method based on multiple universal adversarial perturbations as described above.
[0069] The present invention proposes a two-stage black-box adversarial sample generation method based on multiple universal adversarial perturbations, that is, adversarial perturbation generation is divided into two stages: common perturbation generation and individual perturbation generation; wherein, the task of generating common perturbations is completed by MUAPs, and then individual perturbations are generated on this basis. MUAPs are used in stage one to solve the problem of common perturbation generation.
[0070] Stage 1 mainly uses the generated multiple universal adversarial perturbations to directly apply them to the attacked samples; the general features existing in the samples are concealed through the ability of universal perturbations; for most samples, stage 1 can convert them into adversarial samples.
[0071] Phase II is mainly to further explore the individual characteristics of samples that are not easily disturbed in Phase I. In this phase, the genetic optimizer GO is used to generate adversarial samples by combining multiple universal adversarial perturbations with attack samples.
[0072] Compared with the prior art, the present invention achieves the following beneficial effects:
[0073] Since the existing methods have poor attack effects and low attack efficiency, the present invention provides an attack scheme with good attack effects and high attack efficiency, that is, by utilizing multiple universal adversarial perturbations, the redundant consumption of repeatedly generating common universal perturbations commonly used in current attack algorithms is avoided, and a larger budget is allocated for the generation of individual perturbations, thereby improving the attack efficiency of the overall algorithm. In order to solve the limitations brought by the inaccessibility of internal model information and effectively utilize the valuable perturbation information existing in MUAPs, the present invention adopts a genetic algorithm (GA) as a query optimizer, which is superior to a black-box attack algorithm in terms of effectiveness and efficiency, and is comparable to a white-box attack algorithm.
[0074] The present invention provides a new perspective on the generation of adversarial disturbances, dividing the disturbance generation process into two stages: common disturbance generation and individual disturbance generation, which is helpful for studying methods for defending against adversarial attacks from the perspective of disturbance generation.
[0075] Multiple universal adversarial perturbations provide a basic pattern of universal perturbation directions for deep machine learning models. Different from a single universal perturbation direction, multiple perturbations are more suitable for deep (non-convex) machine learning models, and have a higher success rate in "attacking" models. This invention is the first to divide perturbation generation into two stages: commonality plus individuality. Multiple universal perturbations are used to solve the problems in the commonality stage, and this is also the first time it has been proposed. The multiple universal adversarial perturbation generation method is also the first algorithm to generate multiple universal adversarial perturbations. It can generate universal adversarial perturbations in a black box environment, providing a feasible direction for other subsequent multiple universal perturbation generation methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] Figure 1 is a flowchart of a method for generating black-box adversarial samples based on multiple universal adversarial perturbations provided in an embodiment of the present invention;
[0077] Figure 2 is a flowchart of a method for generating multiple universal adversarial perturbations in a black-box adversarial sample generation method based on multiple universal adversarial perturbations provided in an embodiment of the present invention;
[0078] Figure 3 is a schematic diagram of a high-dimensional constrained blocking strategy in a black-box adversarial sample generation method based on multiple universal adversarial perturbations provided in an embodiment of the present invention;
[0079] Figure 4This is an example flowchart of a black-box adversarial sample generation method based on multiple universal adversarial perturbations provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0080] In order to make the purpose, technical solution and advantages of the present invention more clear, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all 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.
[0081] Example
[0082] like Figures 1 to 4 ,The black-box adversarial sample generation method based on multiple universal adversarial perturbations includes the following steps,
[0083] S1. Obtain the corresponding true label according to the original sample; the original sample is the attacked sample, and the corresponding true label is the label of the attacked target. According to the label of the attacked target, the corresponding multiple universal adversarial perturbations are retrieved;
[0084] The multiple universal adversarial perturbations are a set of optimal universal adversarial perturbation populations selected after iteratively updating the universal adversarial perturbations through a genetic algorithm, and are stored in a multiple universal adversarial perturbation storage M; the method for generating the multiple universal adversarial perturbations includes:
[0085] S1.1. Data preparation: select the original sample data of the category to be attacked to form a data set;
[0086] S1.2. Randomly retrieve the original sample data from the data set without replacement and form a data subset;
[0087] S1.3. Initialize the universal adversarial perturbation population based on the data subset and the universal adversarial perturbation;
[0088] The universal adversarial perturbation population includes potentially adversarial universal individual perturbations;
[0089] S1.4. Calculate the fitness of the current universal anti-disturbance population according to the current universal anti-disturbance population and the universal anti-disturbance fitness function to obtain the current universal anti-disturbance population fitness;
[0090] S1.5. According to the obtained current universal antagonistic perturbation population and its corresponding universal antagonistic perturbation population fitness, the universal antagonistic perturbation population of its offspring and its corresponding universal antagonistic perturbation population fitness of its offspring are obtained by using a genetic optimizer and a universal antagonistic perturbation fitness function;
[0091] According to the genetic algorithm, the universal antagonistic perturbation populations of two generations and their corresponding universal antagonistic perturbation population fitnesses are combined, that is, the current universal antagonistic perturbation population and its corresponding universal antagonistic perturbation population fitnesses, the universal antagonistic perturbation population of the offspring and its corresponding universal antagonistic perturbation population fitnesses, to obtain the updated universal antagonistic perturbation population and its corresponding universal antagonistic perturbation population fitnesses;
[0092] The obtained updated universal adversarial perturbation population and its corresponding universal adversarial perturbation population fitness are used as the current universal adversarial perturbation population and its corresponding universal adversarial perturbation population fitness, and then S1.5 is repeatedly executed to obtain the universal adversarial perturbation population and its corresponding universal adversarial perturbation population fitness updated multiple times by iteration;
[0093] Suppose that the number of times S1.5 is repeated is N times, that is, the number of iterations is N times, then N+1 updated universal adversarial perturbation populations and their corresponding universal adversarial perturbation population fitnesses can be obtained; from the N+1 updated universal adversarial perturbation populations and their corresponding universal adversarial perturbation population fitnesses, the optimal universal adversarial perturbation population is selected according to its corresponding universal adversarial perturbation population fitness;
[0094] The optimal universal adversarial perturbation population is stored in the multiple universal adversarial perturbation storage M;
[0095] S1.6. Execute S1.2 again until all the original sample data in the data set are retrieved. The final set of multiple optimal universal adversarial perturbation populations is the multiple universal adversarial perturbations.
[0096] S2. Combine each original sample and the corresponding multiple universal adversarial perturbations and input them into the attacked classification model; obtain the output result after the attacked sample and the multiple universal adversarial perturbations are combined by query attack to confirm whether the multiple universal adversarial perturbations successfully attack the attacked sample;
[0097] If the multiple universal adversarial perturbation attacks are successful, the multiple universal adversarial perturbations are marked as adversarial perturbations;
[0098] S3. If the multiple universal adversarial perturbation attack fails, then according to the original sample and the multiple universal adversarial perturbations, through the individual perturbation fitness function, find the individual perturbation that is suitable for the original sample;
[0099] Initialize the individual disturbance population through multiple universal adversarial disturbances and multiple individual disturbances, and obtain the individual disturbance population with common universal disturbance information;
[0100] The individual disturbance population includes a plurality of potentially antagonistic individual disturbances;
[0101] S4. Calculate the fitness of the current personality disturbance population according to the current personality disturbance population and the personality disturbance fitness function to obtain the current personality disturbance population fitness;
[0102] S5. According to the obtained current personality disturbance population and its corresponding personality disturbance population fitness, the personality disturbance population of its offspring and its corresponding personality disturbance population fitness of its offspring are obtained by using a genetic optimizer and a personality disturbance fitness function;
[0103] According to the genetic algorithm, the personality disturbance populations of two generations and their corresponding personality disturbance population fitness are combined, that is, the current personality disturbance population and its corresponding personality disturbance population fitness, the personality disturbance population of the offspring and its corresponding personality disturbance population fitness, to obtain the updated personality disturbance population and its corresponding personality disturbance population fitness;
[0104] The obtained updated personality perturbation population and its corresponding personality perturbation population fitness are combined with the attacked classification model; whether the individual perturbation in the updated personality perturbation population successfully attacks the attacked sample is obtained by querying the attack method;
[0105] If the attack of an individual perturbation in the updated personality perturbation population is successful, the individual perturbation in the updated personality perturbation population that has successfully attacked is marked as an adversarial perturbation;
[0106] If the individual disturbance attack in the updated individual disturbance population fails, the updated individual disturbance population and its corresponding individual disturbance population fitness are used as the current individual disturbance population and its corresponding individual disturbance population fitness, and then S5 is repeatedly executed until the individual disturbance attack in the updated individual disturbance population is successful;
[0107] S6. Combine the marked adversarial perturbation with the attacked sample to obtain an adversarial sample.
[0108] The present invention provides a method and device for generating black-box adversarial samples based on multiple universal adversarial perturbations;
[0109] Universal Adversarial Perturbation, UAP;
[0110] Multiple Universal Adversarial Perturbations, MUAPs;
[0111] First, set up the classification model Model parameters And the input sample The function of yes The corresponding true label is . The output is a dimensional prediction vector, where The model is a sample The predicted classification of Get the model The maximum output corresponds to the subscript, which is the classification label predicted by the model. Here is the operation of obtaining the subscript corresponding to the maximum value in the vector;
[0112] For simplicity and to satisfy the black box constraint assumption, we use replace ; For an attacked classification model, its classification function is ,The architecture and parameters of the attacked model are unknown to the attacker, and the attacker can only obtain the prediction vector of the attacked model by querying.
[0113] For non-target attacks, the original sample is misclassified into any other category, and its expression is:
[0114] ,
[0115] in, is the set of perturbation constraints, The mapping operator takes the input Map back to [0,1];
[0116] Non-target (category) attacks hope for original samples and samples with added noise (perturbation) Through the model The predicted category when ) is different, that is, it achieves the purpose of non-target attack and is not the original sample The prediction category of
[0117] refers to the infinite norm of the vector, Controlled disturbance The value of the infinite norm of , thus obtaining the set of constraint values of the perturbation .
[0118] For targeted attacks, the original samples are classified into target categories, and the expression is:
[0119] ,
[0120] ,
[0121] The target attack hopes to add noise to the sample Misclassification to target category , where we hope that the category Not a sample The original category, (subject to) as shown.
[0122] UAP is to perturb as many samples as possible using a universal perturbation direction;
[0123] The expression of UAP for non-target attack is:
[0124] ,
[0125] Among the samples Obey the data distribution , is the expected symbol, Represents classification to The probability of the class, and Represent the original category and the target category respectively;
[0126] is UAP. For non-targeted attacks, we hope to make the original category The classification probability is optimized to the minimum ( ), here we use the expectation Operation, so as to obey the data distribution The probability of the original category of the sample is optimized to be small in expectation.
[0127] The expression of UAP for target attack is:
[0128] ,
[0129] Targeted attacks hope to make the target class The probability is increasing.
[0130] Genetic Optimizer (GO) is an optimization method based on population optimization strategy, and its optimization criterion is survival of the fittest. , fitness value And the fitness function (optimization objective) , GO gives the optimized offspring population:
[0131] ,
[0132] The genetic algorithm optimizer simulates the natural selection and survival of the fittest to optimize the objective function. By simulating the concept of species population in nature, the genetic algorithm introduces population , and then simulate the concept of natural environment, and then introduce the degree of adaptation of population organisms to the environment, that is, fitness , which is calculated through fitness function / optimization objective;
[0133] Genetic algorithms can simulate the concept of survival of the fittest in nature, and the fittest in the environment (fitness The individuals with advantage in the population survive and reproduce better and more adaptable offspring (in line with the optimization goal). In the genetic algorithm, the offspring population is selected through iteration. And obtain the corresponding offspring population fitness .
[0134] Multiple universal adversarial perturbations have a higher success rate than universal adversarial perturbations;
[0135] For a standard single UAP optimization objective, it can be expressed as follows:
[0136] ,
[0137] For non-convex machine learning models, a single universal perturbation direction is insufficient, and multiple universal adversarial perturbations that are effective but in different directions are more robust for machine learning models.
[0138] Set up a sample set , for a single UAP, based on whether the UAP can successfully perturb the set First, the elements in the set Divide into perturbation sets and the non-perturbed set ,Right now ;
[0139] Then the perturbation success rate of a single UAP is ;
[0140] For multiple universal adversarial perturbations, multiple perturbation directions are set to be independent of each other, with a scale of The multiple universal adversarial perturbations of MUAPs-ith for the sample set are: ; The perturbation set of multiple universal adversarial perturbations is ;
[0141] set up , then the perturbation success rate of multiple universal counter-perturbations is , as the scale of multiple universal adversarial perturbations As increases, the success rate of disturbance increases exponentially.
[0142] Therefore, multiple universal adversarial perturbations have a higher success rate than universal adversarial perturbations; they are more effective in dealing with perturbations of non-convex machine learning models.
[0143] Specifically, the multiple universal adversarial perturbation generation method is implemented in a black box environment based on a randomized genetic optimizer to generate MUAPs. In order to generate multiple diverse UAPs, for each independent UAP, a batch of randomly selected samples are sampled as the optimization starting point; different starting points will cause the perturbation to converge to the global optimum or different local optima; for a certain UAP, it has the following empirical risk or fitness function,
[0144] In the case of non-targeted attacks,
[0145] ,
[0146] UAP hopes to minimize the probability of the original category on B samples;
[0147] Under targeted attack,
[0148] ,
[0149] UAP hopes to maximize the probability of the target category on B samples;
[0150] in, is the size of a batch of selected samples. For the sampling of batch samples, the batch samples required for any two UAPs to generate are set to be completely disjoint.
[0151] The specific steps of the multiple universal adversarial perturbation generation method are as follows: first, data preparation is performed to select data of the category to be attacked to form a data set; the storage M of MUAPs is initialized so that it can be stored in the device for subsequent calls to the black-box adversarial sample generation method of multiple universal adversarial perturbations.
[0152] To generate m UAPs to form MUAPs, with the help of the genetic optimizer GO and the random sampling method, the following steps are executed m times in a loop, and each generated UAP is placed in M, and finally the formed MUAPs are stored in M. The specific loop execution steps are:
[0153] Extract data from the collected data set without replacement to form a data subset ; Using this data subset and formula To define the optimization objective (fitness function); then according to the formula Start initializing the initial population of the genetic algorithm and calculate the fitness of the initial population according to the fitness function;
[0154] The genetic algorithm is executed in a loop. Each loop queries the attacked model to obtain the output to generate an advantageous general disturbance direction. The optimization formula is: ;
[0155] After the genetic algorithm cycle ends, the best individual in the population (the best universal perturbation direction) is stored in M.
[0156] The following is the pseudo code for generating multiple universal adversarial perturbations in a non-targeted attack environment:
[0157] enter:
[0158] Dataset
[0159] Batch size
[0160] MUAPs size
[0161] Original sample category
[0162] Iterations
[0163] Output: ;
[0164] Step 01: Select the dataset The middle category is The samples constitute a subset ,here ;
[0165] Step 02: Initialize MUAPs storage ;
[0166] Step 03: for do
[0167] Step 04: Slave dataset without replacement Randomly select Samples make up a batch ;
[0168] Step 05: According to the batch And the formula Define the fitness function ;
[0169] Step 06: According to the formula Initialize the population ;
[0170] Step 07: Calculate the population fitness function value ;
[0171] Step 08: for do
[0172] Step 09: ;
[0173] Step 10: According to and renew and ;
[0174] Step 11: End for
[0175] Step 12: Select and store the best individual ;
[0176] Step 13: End for
[0177] Step 01 gives the dataset The selection range includes all In step 02, an MUAPs storage initialized to an empty set is used to store the generated UAP. In step 03 to step 13, with the help of genetic optimizer GO and random sampling method, UAPs in different directions are generated and stored in Specifically, step 04 prepares the data subset for UAP generation Step 05 to step 11 set up and execute GO to iteratively obtain a better UAP. In step 05, formula Used to generate fitness function To generate the UAPs for non-target attacks, including is used as the source data in the fitness function. In step 06, the initial population is in the set is initialized under the perturbation constraint. Specifically, for any individual in the population , any dimension on the individual Follow the following initialization format, ; Finally, steps 08 to 11 are iteratively executed to generate a better offspring population, and then in step 12 the best individual will be stored as the UAP of this round in For the method of generating multiple universal adversarial perturbations in a target attack environment, it is necessary to replace the formula in step 05 above with Replace with formula .
[0178] Multiple universal adversarial perturbations overcome the waste of attack experience caused by repeatedly generating adversarial examples, and achieve the non-uniqueness of common perturbation directions in non-convex machine learning models; by utilizing the common perturbation information between samples, multiple universal adversarial perturbations optimize the efficiency of the attack process.
[0179] Specifically, regarding non-convex machine learning models, the current mainstream machine learning models use a hierarchical connection architecture and introduce many nonlinear components between the layers, such as nonlinear activation functions and regularization components. This makes the machine learning model architecture complex. From the perspective of the model function properties, the current model is a non-convex function with multiple local optimal points. Therefore, the optimization task based on the machine model itself is a multi-solution problem. This is suitable for the multiple settings of MUAPs.
[0180] However, due to the existence of individual characteristics in each sample, MUAPs are not enough to transform all samples into adversarial samples; samples can be regarded as a combination of data commonality and individual characteristics. Although MUAPs capture shared perturbation patterns, the individual characteristics of some samples make it difficult to easily transform them into adversarial samples. Therefore, it is necessary to generate perturbation directions specifically targeting individual characteristics. By combining existing MUAPs with perturbations attached to the individual characteristics of specific samples, the additional computational burden caused by common perturbations can be avoided.
[0181] The present invention thus proposes a two-stage black-box adversarial sample generation method based on multiple universal adversarial perturbations, that is, adversarial perturbation generation is divided into two stages: common perturbation generation and individual perturbation generation; wherein, the task of generating common perturbations is completed by MUAPs, and then individual perturbations are generated on this basis. MUAPs are used in stage one to solve the problem of common perturbation generation.
[0182] Black-box adversarial sample generation method based on multiple universal adversarial perturbations:
[0183] Stage 1 mainly uses the generated multiple universal adversarial perturbations to directly apply them to the attacked samples; the general features existing in the samples are concealed through the ability of universal perturbations; for most samples, stage 1 can convert them into adversarial samples.
[0184] Phase II is mainly to further explore the individual characteristics of samples that are not easily disturbed in Phase I. In this phase, the genetic optimizer GO is used to generate adversarial samples by combining multiple universal adversarial perturbations with attack samples.
[0185] Specifically, in non-target attacks, the disturbance direction is found through the following fitness function: ;
[0186] The sample pair is (x, y), obtained by Minimal disturbance to enable non-targeted attacks;
[0187] The GO algorithm adopts a population-based search strategy, which enhances the diversity of perturbations and improves the chance of finding effective individual perturbation directions. By looping the output of the attacked model and calling GO to select the potential population (perturbation) to enter the next generation, adversarial examples that can successfully perturb samples are generated. The prerequisite for the successful execution of the second stage is the potential initial population;
[0188] Specifically, the initialization strategy is as follows:
[0189] Definition Weight vector ,in is the size of the MUAPs. ,have , and further construct the following weight matrix,
[0190] ,
[0191] in, Refers to the scale The identity matrix of the weight matrix The column vector is a unit vector, and for ,have , which forms an identity matrix. For the remaining arrive Column vectors, which can be viewed as A linear combination of vectors with for Then define The vector of the direction of the MUAPs , It is MUAPs in vector form The element at position ; finally, the initialized population can be generated by the following formula,
[0192] ,
[0193] Here, each MUAPs is regarded as a vector v, which can form the matrix V on the left. By matrix multiplication with the weight matrix on the right, a new set of MUAPs-based arrangements can be obtained, which is used as the initial population of the genetic algorithm in the second stage; MUAPs retain themselves by multiplying with the unit matrix composed of the first m columns of the weight matrix, and multiplying with the vectors from m+1 to k columns to combine the disturbance characteristics of different UAP directions in MUAPs to generate potential population individuals. Combining individual The norm is constrained by the following formula:
[0194] ,
[0195] This ensures that the generated perturbations are affected by the set This formula shows that the above-mentioned weights combined with MUAPs will not cause the generated disturbance to escape the control of the disturbance constraint.
[0196] The following is the specific process of the black-box adversarial sample generation method based on multiple universal adversarial perturbations:
[0197] enter:
[0198] Attacked samples
[0199] Iterations
[0200] Output: ;
[0201] Step 01: Initialize the attack success identifier ;
[0202] Step 02: Initialize the adversarial perturbation ;
[0203] Step 03: Phase 1: MUAPs Attack:
[0204] Step 04: Based on the sample Load the corresponding MUAPs storage ;
[0205] Step 05: for do
[0206] Step 06: if then
[0207] Step 07: ;
[0208] Step 08: ;
[0209] Step 09: end if
[0210] Step 10: End for
[0211] Step 11: Phase 2: Further search based on MUAPs
[0212] Step 12: If then
[0213] Step 13: Based on the sample and formula Define the fitness function ;
[0214] Step 14: Based on storage and formula Initialize the population ;
[0215] Step 15: Calculate population fitness ;
[0216] Step 16: for do
[0217] Step 17: if then
[0218] Step 18: ;
[0219] Step 19: ;
[0220] Step 20: break
[0221] Step 21: end if
[0222] Step 22: ;
[0223] Step 23: Based on and renew and ;
[0224] Step 24: end for
[0225] Step 25: End If
[0226] Further explanation of the above steps:
[0227] Step 01-02: Initialize the disturbance identifier and initialize the disturbance;
[0228] Step 03: Execute the attack in phase 1. First, load MUAPs from storage M according to the label y of the attacked target.
[0229] Step 05-Step 10: Loop through the query of the MUAPs size times, each time querying whether the adversarial sample after the i-th UAP in MUAPs is combined with the attacked sample can attack successfully. If it can, change the perturbation identifier to True (success), and use the i-th UAP in MUAPs as the perturbation;
[0230] If the perturbation identifier is successful, it means that the adversarial sample is generated successfully and the program ends. If it is a failure (step 12), it enters stage 2;
[0231] Steps 13-15: Define the optimization objective (fitness function) according to step 13, and use MUAPs and formula The steps of generate the initial population of genetic algorithm and calculate the fitness of the initial population;
[0232] Step 16-23: Execute the genetic algorithm for round G in a loop. If there is a population individual disturbance that can produce adversarial behavior (step 17) during the execution, change the disturbance identifier to success. This individual disturbance is an adversarial disturbance, which can turn the sample into an adversarial sample. Then stop the algorithm (step 20). On the contrary, if this round is not successful, continue to execute steps 22-23 and use the genetic algorithm to update the population and its fitness.
[0233] Furthermore, current query-based black-box adversarial attack algorithms face the problem of limited search for high-dimensional samples (ImageNet dataset samples have 150,000 dimensions), and the generation of multiple universal adversarial perturbations and the generation of black-box adversarial samples based on multiple universal adversarial perturbations also face this limitation. Therefore, the present invention proposes a high-dimensional constrained chunking strategy, that is, using a chunking strategy to alleviate the dimensionality curse caused by high-dimensional search.
[0234] Specifically, for the Disturbance of element composition , whose number of channels, width and height are defined as and , then the disturbance The shape is And there is a perturbation dimension The block size is defined as , which is the scaling factor of the perturbation. We have the following expansion function and compression function,
[0235] Dilation function: ;
[0236] Through the expansion function s(), the low-dimensional perturbation Mapped to high dimensional ;
[0237] Compression function: ;
[0238] Compression function, which is the inverse of the expansion function , mapping high-dimensional perturbations to low dimensions; the relationship between expansion and compression follows Figure 3 As shown;
[0239] in The shape is .for Any Position elements , we use the dilation function Will Mapping back , the mapping rules are as follows:
[0240] ;
[0241] Take the image sample as an example, it has three dimensions: channel, length, and width. We hope to The element at position is mapped to In this position interval, bs is the size of the block after the image samples are divided into blocks.
[0242] For the compression function, it will Compress to ,The mapping rules are as follows,
[0243] ;
[0244] With the help of the above-mentioned block division and expansion and compression functions, for high-dimensional problems, the formula of UAP will be generated:
[0245] ,
[0246] Remade as:
[0247] ,
[0248] By introducing the expansion function s(), perturbations are generated in low dimensions and interact with the original samples in high dimensions;
[0249] Attack optimization target formula
[0250] ,
[0251] Remade as:
[0252] ,
[0253] Among them, through the extension function The dimensions of the original sample Matching is performed, and the result is mapped back to a low dimension through a compression function to optimize the solution. At the same time, the expansion function may cause the dimension of the generated perturbation to be larger than the dimension of the sample, so redundant rows and columns are pruned to ensure that the expanded perturbation matches the sample.
[0254] exist Figure 3 The interaction and scaling of dimensions are demonstrated in
[0255] Interaction: Perturbation has the same dimension as the original sample and is merged with the sample to generate adversarial examples. Map to low dimension and combine with search algorithm to search for solutions in low dimensional space.
[0256] Scaling: Assume the block size is 3 and the original sample size is 8*8. For the perturbation For each green cell in There is a 3*3 blue scaling unit corresponding to it (considering the consistency with the original sample size, the redundant parts on the right and bottom are cropped off).
[0257] The input of existing deep learning technology is developing in the direction of large-scale and multimodal. From the perspective of black box sample generation, it undoubtedly increases the difficulty of searching for adversarial disturbances. The present invention converts the above-mentioned large-scale high-dimensional input data to low-dimensional search optimization, adapts to the current and future technology development trends, effectively reduces the difficulty of disturbance generation, improves query efficiency, can be used in actual environments, and has application value.
[0258] The black-box adversarial sample generation device based on multiple universal adversarial perturbations is applied in the black-box adversarial sample generation method based on multiple universal adversarial perturbations as described above.
[0259] like Figure 4 , is an example flowchart of a black-box adversarial sample generation method based on multiple universal adversarial perturbations:
[0260] The original sample is an ostrich picture, and the corresponding label is ostrich. According to the label of ostrich, the corresponding MUAPs are retrieved from the MUAPs storage M, and then merged with the original sample ostrich and input into the attacked classification model. By querying, it is checked whether the adversarial sample in MUAPs successfully attacks / perturbed the ostrich picture. If the perturbation is successful, the adversarial sample is successfully obtained in stage 1, that is, the output result is not ostrich.
[0261] If the perturbation fails, the original sample and multiple universal adversarial perturbations are sent to stage 2 to generate personalized perturbations, that is, based on steps S3-S6, the genetic algorithm is executed cyclically. For details, please refer to the steps, codes and formulas in the specific process of the black-box adversarial sample generation method based on multiple universal adversarial perturbations. The population and population fitness are iteratively updated until the perturbation is successful, and finally the adversarial sample is obtained, that is, the output result is non-ostrich;
[0262] For a certain face recognition system, MUAPs are generated by accessing the interface of its face recognition system and stored in the storage M for use. When there is an attack task, such as not letting someone pass through or not passing through the face recognition system, the SMPack algorithm can be mobilized to execute the phase 1 algorithm first. If MUAPs are applied to the face, the face recognition system is directly invalidated, and the adversarial sample is successfully generated. If it fails, it can continue to enter phase 2, by interacting with the face recognition system, mobilizing the genetic algorithm, iteratively generating personalized perturbations, and finally realizing the attack on the face recognition system, that is, obtaining adversarial samples and successful perturbations.
[0263] The black-box adversarial sample generation method based on multiple universal adversarial perturbations provided by the present invention is compared with five popular attack algorithms on four common data sets, showing that the method is superior to the black-box attack algorithm in terms of effectiveness and efficiency, and is comparable to the white-box attack algorithm.
[0264] Compared with five popular adversarial attack algorithms and two sub-algorithms of SMPack on four classification task datasets of different complexity (ranging from 784 to 150,000 dimensions), SMPack surpasses the current best black-box adversarial attack methods in both attack effect and efficiency, and in some cases has the same attack capability as white-box adversarial attacks; Specifically, first set the dataset and compare it with the following four datasets;
[0265] (1) The MNIST dataset consists of ten types of digits "0" to "9", including 70,000 grayscale (single-channel) images, of which 60,000 are training sets and 10,000 are test sets. The image size is 28*28;
[0266] (2) FMNIST is an upgraded version of MNIST, which contains ten categories of fashion products. Its dataset size and sample size are the same as MNIST.
[0267] (3) CIFAR-10 is a dataset of 60,000 RGB three-channel images in ten categories, of which 50,000 images are training sets and 10,000 images are test sets. The image size is 32*32.
[0268] (4) ImageNet collects millions of images from millions of categories.
[0269] Here we use ImageNet Large Scale Visual Recognition Challenge 2012 (ILSVRC2012) as the experimental dataset, which contains 1.2 million color images and 1000 categories. The image size is unified to 224*224.
[0270] For machine learning models, experiments are mainly conducted on CNN, VGG, and ResNet models. Specifically, for most experiments, we built a convolutional neural network CNN-2 with two convolutional blocks and VGG-16 and ResNet-18 models with 16-layer and 18-layer architectures, respectively. In addition, for the more complex ImageNet dataset, we experimented on the ResNet-50 model, which has a deeper architecture.
[0271] Baselines and Common Metrics: We compare SmPack with two white-box attack algorithms and five black-box attack algorithms.
[0272] White box attack algorithm: (1) FGSM; (2) PGD.
[0273] Black box attack algorithms: (1) OnePixel; (2) SimBA; (3) FNS; (4) MUAPs attack (MPack), which only uses the first stage of the algorithm to perform the attack. (5) GA, as the second stage of the algorithm, we separate it as a baseline comparison algorithm, and its population initialization strategy is based on the formula .
[0274] SMPack and the above-mentioned comparison algorithms are measured by two indicators: effect and efficiency.
[0275] Effect: In terms of effectiveness, we mainly focus on the attack success rate (ASR) of the algorithm.
[0276] For non-targeted attacks, we calculate The number of successful misclassifications in the samples to be attacked The proportion .
[0277] For targeted attacks, we calculate The number of samples to be attacked that are successfully classified as target categories The proportion .
[0278] Efficiency: In terms of efficiency, we focus on the number of queries the attack algorithm makes to the black-box model, where one input and output per unit sample is considered as one query.
[0279] For all the above attack methods, the maximum number of queries for a single attack sample is set to 10000. Except for OnePixel, the perturbations of the above methods on pixels are limited to .
[0280] Since OnePixel is a single-pixel perturbation, there is no limit on the perturbation degree. Unless otherwise specified, the sampling batch for generating MUAPs is set to 16 and the size of MUAPs is set to 10.
[0281] Experimental results,For non-target attacks, such as the non-target attack ASR shown in Table 1 below,
[0282]
[0283] We report the performance of SMPack and comparison algorithms in the non-targeted attack setting for ASR. PGD achieves the best performance on all datasets, which is achieved by obtaining information about the model architecture and community degree. By iteratively searching in small steps, PGD can accurately perceive the potential adversarial nature of samples. For FGSM, its linear assumption of the gradient around the sample is inconsistent with the non-convex property of machine learning models, which makes FGSM perform worse than PGD even in the white-box setting. In the black-box setting, the performance of attack algorithms based on the black-box setting is limited due to the lack of information about the model's internal structure. In particular, OnePixel shows poor results on the MNIST and FMNIST datasets. This is because MNIST and FMNIST are both low-dimensional single-channel images, and perturbing only one pixel is not enough to change the model's judgment of the sample. SMPack achieves attack performance similar to PGD in the white-box environment in the black-box environment, which is the best attack result except for PGD. In addition, we also verify that SMPack's staged combination strategy helps improve attack performance. Based on the better search space provided by MUAPs, SMPack can use GA to search for more potential perturbation directions. In terms of efficiency, as shown in Table 2 below, the query efficiency of non-targeted attacks is:
[0284]
[0285] The average and median query times of the black-box attack algorithms are listed. MPack only requires MUAPs-sized queries to complete the attack, and this lower query frequency is achieved by a trade-off with ASR. In some environments with more stringent query constraints, MPack may have greater advantages. Except for MPack, the query efficiency of SMPack is better than that of all the compared algorithms. The above results show that in the field of non-targeted attacks, the proposed SMPack has excellent performance in both attack effect and attack efficiency, and in some cases can achieve the same level of attack performance as the white-box attack algorithm.
[0286] For targeted attacks, compared to non-targeted attacks, on the one hand, the attack algorithm needs to reduce the probability of the original label. On the other hand, the algorithm also needs to consider increasing the probability of the target label at the same time. In this case, we design experiments to perturb the original sample to the target category. Specifically, we perturb the original sample category to its next category. For example, there are 10 categories in total, label 6 to label 7 ((6+1) mod 10), label 9 to label 0 ((9 + 1) mod 10). As shown in Table 3 below, the targeted attack ASR
[0287]
[0288] SMPack achieves the best results on different datasets, even outperforming the PGD method based on white-box attack. Most attack methods show performance degradation in the targeted attack domain compared to non-targeted attacks. OnePixel and FNS have only about 10% success rate on CIFAR-10, and are almost unable to attack the MNSIT and FMNIST datasets. SimBA performs well on CIFAR-10, but performs severely poorly on low-dimensional datasets. This is because its search ability is linearly related to the dimension size. The small dimensional space of MNIST and FMNIST also weakens the search ability of SimBA. The disadvantage of the linear approximation assumption of FGSM is further amplified in the targeted attack problem, and FGSM shows poor performance for more complex datasets and models. MPack is based on the universal transfer mode from source category to target category provided by MUAPs. Although the performance is degraded compared to non-targeted attacks, it still outperforms most algorithms on some datasets. GA performs similarly to SMPack on multiple datasets, but is still inferior to SMPack in terms of effect due to the lack of SMPack's high-quality initial solution space. More importantly, SMPack is far superior to GA in terms of efficiency. As shown in Table 4 below, the efficiency of target attack query is
[0289]
[0290] SMPack reaches or exceeds the success rate of GA methods with less than half the query consumption of GA. Due to the difficulty of the targeted attack, OnePixel and FNS had to consume almost all the query time. For SimBA, since its query upper limit is related to the sample dimension, it is impossible to obtain a higher attack success rate by consuming more queries, resulting in the inability to further improve the attack effect even if a larger query budget is reserved. In the face of more complex targeted attacks, SMPack can still show excellent results in effectiveness and efficiency.
[0291] Regarding high-dimensional problems, query-based adversarial attacks can reduce effectiveness and efficiency due to the high complexity of high-dimensional problems. In this section, we conduct non-targeted attack experiments on the ImageNet dataset. We use a block strategy for our proposed method as well as the comparison methods MPack and GA. We report the evaluation results of our SMPack and comparison algorithms on ImageNet in the ImageNet attack evaluation shown in Table 5 below.
[0292]
[0293] SMPack, GA, and white-box-based PGD attack algorithms achieved 100% attack success rate. In terms of query efficiency, the high-dimensional problem causes the attack algorithm to consume more query time when searching for the perturbation direction, especially for SimBA, which requires an order of magnitude more query consumption for ImageNet (SimBA) compared to CIFAR-10 (SimBA). In contrast, FNS has improved query efficiency. This is because it is difficult for the model to give a high confidence for the high-dimensional ImageNet (1000 categories) dataset. The prediction scores are scattered, which makes the FNS attack method based on the relationship transformation between samples more likely to succeed. SMPack and GA use a block strategy to search efficiently in a low-dimensional space, far ahead of the comparison algorithms in terms of efficiency. At the same time, based on the general pattern provided by MUAPs, SMPack further improves the efficiency by 15% compared with GA.
[0294] The present invention provides a method and device for generating black-box adversarial samples based on multiple universal adversarial perturbations to solve the limitation of insufficient single UAP in non-convex deep learning models. A two-stage multiple universal adversarial perturbations black-box adversarial sample generation algorithm (Two-Stage Multiple Universal AdversarialPerturbations Black-box Attack algorithm, SMPack) is proposed based on MUAPs to solve the challenge of combining common perturbations and individual feature perturbations of samples at the same time. SMPack adopts a staged strategy to generate adversarial examples. In stage one, the universal perturbation information stored in MUAPs is directly applied to the sample to generate adversarial examples. In stage two, the sample uses the experience gained from the universal perturbations in MUAPs to further generate personalized perturbations. The present invention adopts a genetic algorithm with population optimization characteristics, which can effectively combine different perturbation directions within MUAPs and further obtain personalized perturbation directions.
[0295] The method relies on MUAPs and divides the generation process into two stages: common perturbation generation and individual perturbation generation. By utilizing MUAPs, the redundant consumption of repeatedly generating common universal perturbations commonly seen in current attack algorithms is avoided, and a larger budget is allocated for the generation of individual perturbations, thereby improving the attack efficiency of the overall algorithm. In order to address the limitations brought about by the inaccessibility of internal model information and effectively utilize the valuable perturbation information present in MUAPs, the present invention adopts a genetic algorithm (GA) as a query optimizer. The present method is superior to black-box attack algorithms in terms of effectiveness and efficiency, and is comparable to white-box attack algorithms.
[0296] According to the disclosure and teaching of the above description, those skilled in the art to which the present invention belongs may also make changes and modifications to the above embodiments. Therefore, the present invention is not limited to the specific embodiments disclosed and described above, and some modifications and changes to the present invention should also fall within the scope of protection of the claims of the present invention. In addition, although some specific terms are used in this specification, these terms are only for the convenience of description and do not constitute any limitation to the present invention.
Claims
1. Black-box adversarial sample generation method based on multiple universal adversarial perturbations, It is characterized in that The following steps are involved: S1. Obtain the corresponding true label based on the original sample; Retrieve the corresponding multiple universal adversarial perturbations according to the true label; S2, merge each original sample and the corresponding multiple universal adversarial perturbations and input them into the attacked classification model; The output result of combining the attacked sample with multiple universal adversarial perturbations is obtained by querying the attack to confirm whether the multiple universal adversarial perturbations have successfully attacked the attacked sample. If the multiple universal adversarial perturbation attacks are successful, the multiple universal adversarial perturbations are marked as adversarial perturbations; S3. If the multiple universal adversarial perturbation attack fails, the individual perturbation population is initialized according to the original sample and the multiple universal adversarial perturbations to obtain the individual perturbation population with common universal perturbation information; S4. Calculate the fitness of the current personality disturbance population according to the current personality disturbance population and the personality disturbance fitness function to obtain the current personality disturbance population fitness; S5. According to the obtained current personality disturbance population and its corresponding personality disturbance population fitness, using a genetic optimizer and a personality disturbance fitness function genetic algorithm to obtain an updated personality disturbance population and its corresponding personality disturbance population fitness; And combine it with the attacked classification model, and obtain whether the individual perturbation in the updated personality perturbation population successfully attacks the attacked sample by querying the attack method; If the attack of an individual perturbation in the updated personality perturbation population is successful, the individual perturbation in the updated personality perturbation population that has successfully attacked is marked as an adversarial perturbation; If the individual disturbance attack in the updated individual disturbance population fails, the updated individual disturbance population and its corresponding individual disturbance population fitness are used as the current individual disturbance population and its corresponding individual disturbance population fitness, and then S5 is repeatedly executed until the individual disturbance attack in the updated individual disturbance population is successful; S6. Combine the marked adversarial perturbation with the attacked sample to obtain an adversarial sample.
2. The method for generating black-box adversarial samples based on multiple universal adversarial perturbations according to claim 1, It is characterized in that In S1, the original sample is the attacked sample, and the corresponding true label is the label of the attacked target. The corresponding multiple universal adversarial perturbations are retrieved according to the label of the attacked target; The multiple universal adversarial perturbations are a set of optimal universal adversarial perturbation populations selected after iterative updating of universal adversarial perturbations through a genetic algorithm, and are stored in a multiple universal adversarial perturbation storage M; In S3, if the multiple universal adversarial perturbation attack fails, then according to the original sample and the multiple universal adversarial perturbations, through the individual perturbation fitness function, find the individual perturbation that is suitable for the original sample; Initialize the individual disturbance population through multiple universal adversarial disturbances and multiple individual disturbances, and obtain the individual disturbance population with common universal disturbance information; The personality disturbance population includes a plurality of potential antagonistic personality individual disturbances; In S5, according to the obtained current personality disturbance population and its corresponding personality disturbance population fitness, the personality disturbance population of its offspring and its corresponding personality disturbance population fitness of its offspring are obtained by using a genetic optimizer and a personality disturbance fitness function; According to the genetic algorithm, the personality disturbance populations of two generations and their corresponding personality disturbance population fitness are combined, that is, the current personality disturbance population and its corresponding personality disturbance population fitness, the personality disturbance population of the offspring and its corresponding personality disturbance population fitness, to obtain the updated personality disturbance population and its corresponding personality disturbance population fitness.
3. The method for generating black-box adversarial samples based on multiple universal adversarial perturbations according to claim 2, It is characterized in that The method for generating multiple universal adversarial disturbances includes: S1.
1. Data preparation: select the original sample data of the category to be attacked to form a data set; S1.
2. Randomly retrieve the original sample data from the data set without replacement and form a data subset; S1.
3. Initialize the universal adversarial perturbation population based on the data subset and the universal adversarial perturbation; The universal adversarial perturbation population includes potentially adversarial universal individual perturbations; S1.
4. Calculate the fitness of the current universal anti-disturbance population according to the current universal anti-disturbance population and the universal anti-disturbance fitness function to obtain the current universal anti-disturbance population fitness; S1.
5. According to the obtained current universal antagonistic perturbation population and its corresponding universal antagonistic perturbation population fitness, the universal antagonistic perturbation population of its offspring and its corresponding universal antagonistic perturbation population fitness of its offspring are obtained by using a genetic optimizer and a universal antagonistic perturbation fitness function; According to the genetic algorithm, the universal antagonistic perturbation populations of two generations and their corresponding universal antagonistic perturbation population fitnesses are combined, that is, the current universal antagonistic perturbation population and its corresponding universal antagonistic perturbation population fitnesses, the universal antagonistic perturbation population of the offspring and its corresponding universal antagonistic perturbation population fitnesses, to obtain the updated universal antagonistic perturbation population and its corresponding universal antagonistic perturbation population fitnesses; The obtained updated universal adversarial perturbation population and its corresponding universal adversarial perturbation population fitness are used as the current universal adversarial perturbation population and its corresponding universal adversarial perturbation population fitness, and then S1.5 is repeatedly executed to obtain the universal adversarial perturbation population and its corresponding universal adversarial perturbation population fitness updated multiple times by iteration; Suppose that the number of times S1.5 is repeated is N times, that is, the number of iterations is N times, then N+1 updated universal adversarial perturbation populations and their corresponding universal adversarial perturbation population fitnesses can be obtained; from the N+1 updated universal adversarial perturbation populations and their corresponding universal adversarial perturbation population fitnesses, the optimal universal adversarial perturbation population is selected according to its corresponding universal adversarial perturbation population fitness; The optimal universal adversarial perturbation population is stored in the multiple universal adversarial perturbation storage M; S1.
6. Execute S1.2 again until all the original sample data in the data set are retrieved. The final set of multiple optimal universal adversarial perturbation populations is the multiple universal adversarial perturbations.
4. The method for generating black-box adversarial samples based on multiple universal adversarial perturbations according to claim 2, It is characterized in that In S3, the individual disturbance that is suitable for the original sample is found through the individual disturbance fitness function; the individual disturbance fitness function is: , in, is the individual disturbance, It means that individual disturbances search within the range of the constraint set. is the original sample, The projection algorithm will perturb the sample The range of is constrained to [0,1]; is the true label corresponding to the original sample.
5. The method for generating black-box adversarial samples based on multiple universal adversarial perturbations according to claim 2, It is characterized in that In S3, the individual disturbance population is initialized by multiple universal adversarial disturbances and multiple individual disturbances to obtain the individual disturbance population with common universal disturbance information, which specifically includes: Definition Weight vector ,in is the size of the multiple universal adversarial perturbations, for ,have , It takes any value from 1 to m. Further, the constructed weight matrix for: , The weight matrix Before The column vector is a unit vector, and for ,have , which forms an identity matrix ; Refers to the population size, which is set as a constant; For the remaining arrive Column vector, treating it as the front Linear combinations of column vectors, for ,have ; Definition The direction vectors of multiple universal adversarial perturbations ; a refers to any element in the multi-universal adversarial perturbation, d refers to the dimension of element a in the multi-universal adversarial perturbation; The generation formula of the initialized individual disturbance species is: , The multiple universal adversarial perturbations are combined with the weight matrix The identity matrix of column vectors Multiply to preserve itself, and To Column vectors are multiplied to combine the perturbation characteristics of different universal adversarial perturbations in multiple universal adversarial perturbations to generate potential personalized individual perturbations.
6. The method for generating black-box adversarial samples based on multiple universal adversarial perturbations according to claim 2, It is characterized in that In S5, the genetic optimizer and the personality perturbation fitness function are used to obtain the personality perturbation population of its offspring and the fitness of the personality perturbation population of its corresponding offspring. The specific method is: By giving the current population P, fitness value F, and fitness function , we get the optimized offspring population and its corresponding offspring population fitness, that is, , in, is the offspring population, is the fitness of the offspring population; A genetic optimizer.
7. The method for generating black-box adversarial samples based on multiple universal adversarial perturbations according to claim 3, It is characterized in that In S1.3, the universal adversarial perturbation is obtained by using the data subset and the universal adversarial perturbation fitness function, that is, , in, To universally resist disturbances, It means that the universal adversarial perturbation searches within the range of the constraint set. represents the size of the data subset, means The i-th original sample in The projection algorithm will perturb the sample The range of is constrained to [0,1]; is the true label corresponding to the original sample.
8. The method for generating black-box adversarial samples based on multiple universal adversarial perturbations according to claim 3, It is characterized in that In S1.3, the universal adversarial perturbation population is initialized, specifically including: , in, refers to any individual in the population, i refers to the i-th element in the individual, Randomly from Take any value from .
9. The method for generating black-box adversarial samples based on multiple universal adversarial perturbations according to claim 3, It is characterized in that In S1.5, the genetic optimizer used has the same principle as that used in S5.
