Adversarial sample generation method based on multi-space probability enhancement
By introducing multi-space probability enhancement technology into the adversarial sample generation method, using random data enhancement in pixel space and HSV color space, the problem of low success rate of adversarial sample generation in black box scenarios is solved, and the migration of adversarial samples is significantly improved. Attack success rate.
Patent Information
- Application Number
- CN202411127842.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-08-16
AI Technical Summary
The prior art has low attack success rate and poor anti-sample migration in black box scenarios, making it difficult to effectively generate adversarial samples to attack unknown models.
Adversarial sample generation method based on multi-space probability enhancement is adopted, by constructing random data augmentation branches of pixel space and HSV color space, and using the probability model to control the data augmentation processing of image samples to generate adversarial samples with high mobility.
The adversarial attack success rate in black box scenarios was significantly improved, compared with the benchmark methods IFGSM and MIFGSM, the average attack success rate was improved by 28.71% and 8.44%, and the adversarial sample migration was achieved on the integrated model.
Smart Images

Figure CN119006958A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robustness and security assessment of deep neural networks, and in particular to a method for generating adversarial samples based on multi-space probability enhancement. Background Art
[0002] With the rapid development of deep learning and neural networks, artificial intelligence has been pushed to another peak. Deep neural networks have achieved great success in computer vision, semantic segmentation, signal recognition, autonomous driving and other fields. Especially in the field of computer vision, deep learning has shown extremely high accuracy in image recognition and classification, and in some cases, their performance has even surpassed the skill level of humans. Therefore, more and more deep neural networks are being applied to daily production and life. However, in recent years, adversarial samples have become one of the biggest security threats facing deep neural networks. Attackers use deep neural networks to extract feature information from original samples, generate adversarial perturbations through back propagation, and then add them to the original clean samples to form adversarial samples. The adversarial perturbations destroy the feature information in the clean samples and successfully mislead the deep neural network. However, for humans, it is almost impossible to tell the difference between the two with the naked eye, which poses a serious potential threat to the security of neural networks. Therefore, conducting adversarial attack research can effectively evaluate the performance of deep neural networks in the face of malicious attacks, help discover their potential vulnerabilities and weaknesses, and is of great significance for evaluating the vulnerability of models and improving model robustness.
[0003] Adversarial attack techniques can be divided into white-box attacks and black-box attacks, depending on whether adversarial attack techniques need to understand the target model's network structure, parameter settings, training data, and methods when generating adversarial samples. In white-box scenarios, attackers can easily understand relevant information about the target model, including network structure, model weights, and other internal information. Based on this, attackers can implement adversarial attacks more quickly and effectively, and the success rate of attacks remains within a high range. In black-box scenarios, attackers' understanding of the model is greatly limited, and they can only implement attacks by interacting with the model through input and output, which is difficult and complex.
[0004] In the image classification network, let x be a clean original sample, y be the true label corresponding to the sample, θ be the model parameter, f(x;θ) be the model prediction output, and J(x,y;θ) be the model loss function. Therefore, the adversarial attack can be expressed as f(x adv ;θ)≠f(x;θ),x adv is the adversarial sample corresponding to the original sample x, which satisfies ||x adv –x|| p ≤ε,||·|| pIn the white-box scenario, the adversarial attack can be viewed as an optimization problem, that is, searching for a sample x in the neighborhood of x. adv , to maximize the loss function of the target network classifier, expressed as follows:
[0005]
[0006] Currently, the widely used adversarial sample generation methods include: FGSM, I-FGSM, and MI-FGSM. The basic idea of the FGSM method is to generate adversarial perturbations during the back propagation process of the neural network. Specifically, given an input sample x and its corresponding true label y, an adversarial sample is generated by calculating the gradient of the loss function with respect to the input sample and adding a small perturbation to the input sample in the opposite direction of the gradient. The size of this perturbation depends on a hyperparameter called the perturbation size (or perturbation amplitude), which determines the strength of the adversarial attack. The FGSM method generates adversarial samples as follows:
[0007]
[0008] represents the gradient of the loss function with respect to x, sign(·) represents the sign function, and ε represents the perturbation amplitude. The I-FGSM method gradually adds perturbations to the image samples along the direction of the gradient, and recalculates the gradient direction after each iteration, which is expressed as follows:
[0009]
[0010] α is the iteration step size, and clip(·) is the clipping function, which restricts the adversarial sample to the neighborhood of the original sample to ensure that the image will not be distorted while achieving the expected adversarial effect. The MI-FGSM method proposes to introduce momentum when generating adversarial samples, accumulate gradients through multiple iterations, and use momentum to adjust the step size of each iteration to maintain directional consistency in each iteration, thereby accelerating convergence and improving the attack effect, as shown below:
[0011]
[0012] μ is the momentum decay factor, g t Represents the cumulative gradient at the tth iteration. The FGSM series of methods are a class of adversarial attack methods that are simple, easy to implement, and fast to calculate. However, in real-world scenarios, black-box attacks are more practical. These methods perform poorly when attacking black-box models because they rely on the gradient information of the target model, and the internal structure of the black-box model is unknown to the attacker, so the gradient information cannot be accurately calculated, and thus effective adversarial samples cannot be generated.
[0013] In addition, attackers often use transfer-based methods to attack the target model. The transferability of adversarial samples means that an adversarial sample carefully designed for a certain model can successfully deceive other models, even if these models may have different architectures or training data. Attackers can use adversarial samples generated on other models directly as input to the target model to complete adversarial sample attacks without knowing the specific details of these models. This phenomenon shows the universality and harmfulness of adversarial samples. However, due to the lack of detailed information about the target model, attackers usually find it difficult to generate effective adversarial samples, resulting in poor transferability of adversarial samples between different models, making black-box attacks more difficult. Therefore, how to improve the transferability of adversarial samples is currently a hot research topic in this field. Summary of the invention
[0014] To solve the above problems, the present invention provides an adversarial sample generation method based on multi-space probability enhancement, comprising the following steps:
[0015] S1. Collect multiple image samples to form an original sample data set;
[0016] S2. Constructing a multi-space probability enhancement model, wherein the multi-space probability enhancement model includes an enhancement branch based on a pixel space and an enhancement branch based on an HSV color space;
[0017] S3. Set the maximum number of iterations T, and initialize the number of iterations t = 0;
[0018] S4. In the tth iteration, based on the multi-space probability enhancement model, the data enhancement processing method of the input image sample is controlled by probability to obtain an enhanced image sample;
[0019] S5. Input the enhanced image sample into the target model for training, and obtain the accumulated gradient according to the loss function; update the enhanced image sample by the accumulated gradient to obtain the perturbed image sample;
[0020] S6. Determine whether the maximum number of iterations T has been reached. If so, output the current perturbed image sample as an adversarial sample. If not, set the current perturbed image sample as the input image sample, set t=t+1, and then return to step S4.
[0021] Furthermore, step S4 includes the following steps:
[0022] A random value in the interval [0,1] is used as the cropping and filling probability p; a random value in the interval [0,1] is used as the color change probability q;
[0023] If p<0.5 and q<0.5, then a random enhancement branch is selected to perform data enhancement processing on the input image sample to obtain an enhanced image sample;
[0024] If p<0.5 and q≥0.5, then the enhancement branch based on the pixel space is selected to perform data enhancement processing on the input image sample to obtain an enhanced image sample;
[0025] If p≥0.5 and q<0.5, the enhancement branch based on the HSV color space is selected to perform data enhancement processing on the input image sample to obtain an enhanced image sample;
[0026] If p≥0.5 and q≥0.5, the input image samples are directly used as enhanced image samples.
[0027] Furthermore, an enhancement branch based on pixel space is selected to perform data enhancement processing on the input image sample to obtain an enhanced image sample, including:
[0028] S11. crop ,0.9] interval as the cropping ratio prop, where Min crop Indicates the minimum cropping ratio;
[0029] S12. Crop the input image sample according to the cropping ratio prop to obtain a cropped image, fill the pixel value 0 around the cropped image to obtain a filled image, the size of the filled image is consistent with the size of the input image sample, and output the filled image as an enhanced image sample.
[0030] Furthermore, an enhancement branch based on the HSV color space is selected to perform data enhancement processing on the input image sample to obtain an enhanced image sample, including:
[0031] S21. Decompose the RGB three channels of the input image sample into a red channel, a green channel, and a blue channel; obtain the channel value x of the red channel R R , the channel value x of the green channel G and the channel value x of the blue channel B ;
[0032] S22. Based on x R 、x G 、x B Three channel values, using RGBtoHSV conversion method to get the hue value x H , saturation value x S and brightness value x V ;
[0033] S23. Take a random value rand in the interval [0,360] H , take a random value rand in the interval [-0.2,0.22]S ; According to the random value rand H Hue value x H Update to get the hue value x′ H , according to the random value rand S For saturation value x S Update to get the saturation value x′ S ;
[0034] S24. According to the hue value x′ H , saturation value x′ S and brightness value x V Convert to get the updated channel value x′ R , update channel value x′ G and update channel value x′ B ;
[0035] S25. Change x′ R , x′ G , x′ B The new image is merged and output as the enhanced image sample.
[0036] Furthermore, the RGBtoHSV conversion method includes:
[0037] Select x R 、x G 、x B The maximum value among them is taken as the brightness value x V ;
[0038] If x V =0, then the saturation value x S =0, otherwise the saturation value
[0039] If x V =x R , then the hue value If x V =x G , then the hue value x V =x B , then the hue value
[0040] Determine the hue value x H Is it less than 0? If so, let x H =x H +360, otherwise unchanged.
[0041] Furthermore, the specific process of the t+1th iteration includes:
[0042] Randomly select an enhancement branch for the input image sample x tPerform data enhancement processing to obtain enhanced image samples It is expressed as:
[0043]
[0044] Among them, MT represents the multi-space probability enhancement model, p represents the cropping and filling probability, q represents the color change probability, Min crop Indicates the minimum cropping ratio;
[0045] Will enhance the image samples Input the target model for training and calculate the loss function for the enhanced image samples The gradient of the t+1th iteration is obtained according to the gradient. t+1 , the calculation formula is:
[0046]
[0047] in, Represents the loss function For enhanced image samples The gradient of , y represents the label of the image sample, θ represents the target model parameter, μ represents the attenuation coefficient, and ||·||1 represents the L1 norm;
[0048] By accumulating the gradient g t+1 Update augmented image samples Get the perturbed image sample It is expressed as:
[0049]
[0050] Among them, α = ε / T represents the number of iterations, ε represents the perturbation amplitude, sign(·) represents the sign function, Represents the clipping function.
[0051] Furthermore, the multi-space probability enhancement model is specifically expressed as:
[0052] MT(x t ; p,q,Min crop )=T CP (x t ; p,Min crop )+T CC (x t ;q)
[0053]
[0054] Among them, T CP (x; Min crop ) represents the output of the enhancement branch based on pixel space, T cp (x; p, Mincrop ) represents the output obtained by taking the random cropping and filling method based on the pixel space under probability p, T CC (x) represents the output of the enhancement branch based on the HSV color space, T CC (x; q) represents the output obtained by taking the image random color transformation method based on the HSV color space with probability q.
[0055] Beneficial effects of the present invention:
[0056] In order to improve the transferability of adversarial samples, the present invention proposes an adversarial sample generation method based on multi-space probability enhancement in order to solve the problem of low success rate of adversarial attacks in black-box scenarios. The method introduces two random data enhancement branches into the adversarial sample generation method. Each branch implements random cropping and filling of images and random color transformation based on pixel space and HSV color space respectively, and controls the returned image samples by constructing a probability model. While increasing the diversity of the original samples, the adversarial samples reduce their dependence on the original data set, thereby improving their transferability. On this basis, the method is introduced into the integrated model to further improve the success rate of adversarial sample attacks in black-box scenarios. After a large number of experimental verifications on the ImageNet dataset, the proposed method has an average increase of 28.71% and 8.44% in the success rate of black-box attacks compared with the benchmark methods IFGSM and MIFGSM; compared with the adversarial attack method based on single-space probability enhancement, the black-box attack success rate has increased by up to 6.81%. The proposed method can improve the transferability of adversarial samples at a relatively low complexity cost and realize effective attacks in black-box scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 This is a flow chart of the adversarial sample generation method based on multi-space probability enhancement of the present invention;
[0058] Figure 2 Visualize the original sample and the cropped and padded sample for the present invention;
[0059] Figure 3 Visualize the original sample and the color-converted sample for the present invention;
[0060] Figure 4 Visualize the original samples and the adversarial samples generated by each method for the present invention. DETAILED DESCRIPTION
[0061] 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.
[0062] Existing studies have pointed out that data augmentation can make the model better adapt to different input changes by performing various transformations and expansions on the training data, thereby improving its generalization ability. Introducing data augmentation in the process of generating adversarial samples can effectively expand the attacker's attack space. By applying various data augmentation techniques to the generated adversarial samples, the attacker can explore the generation methods of adversarial samples in more dimensions, making the generated adversarial samples more robust, thereby improving the attack effect in black box scenarios.
[0063] In order to ensure the diversification of input samples, the present invention proposes a Multi-space Probability Enhancement Attack Method (MPEAM). Before each attack iteration, the original image samples are randomly processed, that is, random cropping and filling based on pixel space and random color transformation based on HSV color space, and the returned data samples are controlled by probability hyperparameters p and q. Compared with the original data set, the data set after the two probability enhancement branches has increased random diversity and reduced the dependence of the adversarial samples on the original data set, thereby improving the transferability of the adversarial samples. Therefore, the present invention models the probability transformation model as a multi-space probability enhancement process, in which the hyperparameter is set to represent the minimum proportion of cropping. Therefore, the optimization problem of formula (1) can be transformed into formula (10):
[0064]
[0065] MT(x;p,q,Min crop )=T CP (x; p, Min crop )+T CC (x; q) (9)
[0066]
[0067] Among them, T CP (x; Min crop ) represents the output of the enhancement branch based on pixel space, T cp (x; p, Min crop ) represents the output obtained by taking the random cropping and filling method based on the pixel space under probability p, T CC(x) represents the output of the enhancement branch based on the HSV color space, T CC (x; q) represents the output obtained by taking the image random color transformation method based on the HSV color space with probability q.
[0068] MPEAM has good scalability and can be directly integrated with the FGSM-type adversarial sample generation method to construct a more portable attack method. The present invention integrates MPEAM and MIFGSM methods to form the MPE-MIFGSM method. By adjusting its hyperparameters, it can flexibly switch between the two. The method flow chart is shown in the figure. Figure 1 When the hyperparameters p and q are both set to 0, MPE-MIFGSM is converted to MIFGSM.
[0069] Specifically, the present invention provides a method for generating adversarial samples based on multi-space probability enhancement, comprising the following steps:
[0070] S1. Collect multiple image samples to form an original sample data set;
[0071] S2. Constructing a multi-space probability enhancement model, wherein the multi-space probability enhancement model includes an enhancement branch based on a pixel space and an enhancement branch based on an HSV color space;
[0072] S3. Set the maximum number of iterations T, and initialize the number of iterations t = 0;
[0073] S4. In the tth iteration, based on the multi-space probability enhancement model, the data enhancement processing method of the input image sample is controlled by probability to obtain an enhanced image sample; S5. The enhanced image sample is input into the target model for training, and the cumulative gradient is obtained according to the loss function; the enhanced image sample is updated by the cumulative gradient to obtain the perturbed image sample;
[0074] S6. Determine whether the maximum number of iterations T has been reached. If so, output the current perturbed image sample as an adversarial sample. If not, set the current perturbed image sample as the input image sample, set t=t+1, and then return to step S4.
[0075] Specifically, step S4 includes the following data enhancement processing methods based on the multi-space probability enhancement model by probability controlling the input image samples:
[0076] A random value in the interval [0,1] is used as the cropping and filling probability p; a random value in the interval [0,1] is used as the color change probability q;
[0077] If p<0.5 and q<0.5, then a random enhancement branch is selected to perform data enhancement processing on the input image sample to obtain an enhanced image sample;
[0078] If p<0.5 and q≥0.5, then the enhancement branch based on the pixel space is selected to perform data enhancement processing on the input image sample to obtain an enhanced image sample;
[0079] If p≥0.5 and q<0.5, the enhancement branch based on the HSV color space is selected to perform data enhancement processing on the input image sample to obtain an enhanced image sample;
[0080] If p≥0.5 and q≥0.5, the input image samples are directly used as enhanced image samples.
[0081] The MPE-MIFGSM algorithm flow formed by combining MPEAM and MIFGSM is shown in Table 1.
[0082] Table 1 MPE-MIFGSM algorithm flow
[0083]
[0084]
[0085] Preferably, the pixel-space-based enhancement branch processes the image using a random cropping and padding method based on pixel space. In image processing, cropping refers to selecting a specified area from the target image and extracting the area to form a new image. Padding refers to adding pixels around the target image, usually to adjust the image size or maintain the aspect ratio of the image. In the process of random cropping and padding in this method, a key hyperparameter Min is introduced. crop , represents the minimum cropping ratio, and its value range is [0.8,0.9]. The introduction of this parameter is to control the degree of cropping to ensure that the image retains enough information after cropping. Once the image is cropped, it is restored to its original size by filling it with 0 values around it, which can effectively avoid information loss. The purpose of this process is to maintain the integrity and accuracy of the image, so as to ensure that the algorithm can subsequently analyze and process based on complete information. The algorithm flow of random cropping and padding of images is shown in Table 2. After cropping and padding, the samples are as follows Figure 2 shown.
[0086] Table 2 Random cropping and filling of images based on pixel space
[0087]
[0088] Specifically, an enhancement branch based on pixel space is selected to perform data enhancement processing on the input image sample to obtain an enhanced image sample, including:
[0089] S11. crop,0.9] interval as the cropping ratio prop, where Min crop Indicates the minimum cropping ratio;
[0090] S12. Crop the input image sample according to the cropping ratio prop to obtain a cropped image, fill the pixel value 0 around the cropped image to obtain a filled image, the size of the filled image is consistent with the size of the input image sample, and output the filled image as an enhanced image sample.
[0091] Preferably, the enhancement branch based on the HSV color space adopts a random color transformation method based on the HSV color space to process the image. Existing image data sets are basically presented in the RGB color space format. In the RGB color space, colors are mainly represented by three channels: red, green, and blue. This representation method limits the ability to express colors. For the human visual system, many colors cannot be accurately represented by a single RGB channel combination. Furthermore, the three channels in the RGB color space are independent of each other and cannot well represent the correlation between colors. In the present invention, it is necessary to randomly transform the image color. If in the RGB color space, it is also necessary to consider the combination of colors and their relationship in space, which is easy to cause image distortion during the random transformation process. The HSV color space describes colors by hue, saturation, and value. This representation method is closer to the human perception mode of color and more intuitively expresses the attributes of color. In the HSV color space, hue, saturation, and brightness are independent of each other, and they control the properties, depth, and brightness of the overall color of the image. Adjusting one of the properties will not affect the other properties, which makes it easier to modify and control the color. Since this method only changes the color, only the color offset is added to the hue and saturation. The color change algorithm flow is shown in Table 3. The samples after random transformation by this algorithm are shown in Figure 3 shown.
[0092] Table 2 Random color transformation of images based on HSV color space
[0093]
[0094]
[0095] Specifically, an enhancement branch based on the HSV color space is selected to perform data enhancement processing on the input image sample to obtain an enhanced image sample, including:
[0096] S21. Decompose the RGB three channels of the input image sample into a red channel, a green channel, and a blue channel; obtain the channel value x of the red channel R R , the channel value x of the green channelG and the channel value x of the blue channel B ;
[0097] S22. Based on x R 、x G 、x B Three channel values, using RGBtoHSV conversion method to get the hue value x H , saturation value x S and brightness value x V ;
[0098] S23. Take a random value rand in the interval [0,360] H , take a random value rand in the interval [-0.2,0.2] S ; According to the random value rand H Hue value x H Update to get the hue value x′ H , according to the random value rand S For saturation value x S Update to get the saturation value x′ S ;
[0099] S24. According to the hue value x′ H , saturation value x′ S and brightness value x V Convert to get the updated channel value x′ R , update channel value x′ G and update channel value x′ B ;
[0100] S25. Change x′ R , x′ G , x′ B The new image is merged and output as the enhanced image sample.
[0101] Specifically, before converting RGB to HSV, the values of R, G, and B need to be limited to between 0 and 1. The RGBtoHSV conversion method includes:
[0102] Select x R 、x G 、x B The maximum value among them is taken as the brightness value x V ;
[0103] If x V =0, then the saturation value x S =0, otherwise the saturation value
[0104] If x V =x R , then the hue value If x V =x G , then the hue value x V =x B , then the hue value
[0105] Determine the hue value x H Is it less than 0? If so, let x H =x H +360, otherwise unchanged.
[0106] Preferably, the performance of the method proposed in the present invention is demonstrated by experiments, wherein the following seven classification models are used: Resnet-v2-101 (Res-101), Resnet-v2-152 (Res-152), Inception-v3 (Inc-v3), Inceptionv4 (Inc-v4), InceptionRsenetv2 (IncRes-v2), adv-Inception-v3 (Inc-v3 adv ) and Xception (Xce), among which Res-101, Xce, Inc-v3 and Inc-v4 are tested in white-box scenarios, Res-152, IncRes-v2 and Inc-v3 adv The three models were tested in a black box scenario. ImageNet is one of the most commonly used datasets for image classification, detection, and localization in the field of deep learning. The experiment of the present invention randomly extracts one picture that can be correctly classified by the experimental model from each class of the validation set of the ImageNet dataset to form a dataset of 1,000 adversarial samples.
[0107] The present invention selects the iteration-based IFGSM and MIFGSM in the FGSM class method as the benchmark method. Figure 4 By visualizing the original samples and the adversarial samples generated by each method, it can be intuitively seen that the adversarial perturbation generated by the proposed method has higher concealment. The experiment verifies the effectiveness of the proposed method by comparing the attack success rate of MPE-MIFGSM and the benchmark method on the experimental model. For the benchmark method, its hyperparameters are set as follows: maximum perturbation ε=16, number of iterations T=10, iteration step α=1.6, momentum attenuation coefficient μ=1. For the hyperparameters of the multi-space probability enhancement method proposed in this invention: cropping and filling probability p=0.5, color transformation probability q=0.5, indicating that the original sample and the transformed sample have the same weight, and the minimum cropping ratio Min crop =0.8, ensuring that some noise is introduced without losing sample feature information.
[0108] The present invention conducts attack tests on the proposed method MPE-MIFGSM and the benchmark attack method on the experimental model under black box and white box conditions. The attack success rate is the ratio of the number of samples misclassified by the model to the total number of samples. IFGSM, MIFGSM and MPE-MIFGSM generate adversarial samples on 4 models under white box conditions respectively, and test their attack success rates on all experimental models. The adversarial attack success rates of the experimental benchmark method and the method in this paper are shown in Table 4.
[0109] As can be seen from Table 4, the white-box attack success rate of MPE-MIFGSM is maintained above 96.02%. Compared with MIFGSM, the attack success rate in the white-box scenario is slightly lower, but still remains at a high level. This may be because the diversified operations introduced in the original adversarial attack method make the model more robust, resulting in a lower white-box attack success rate; while the black-box success rate is greatly improved. For example, when Res-101 is used as a white-box model to attack the IncRes-v2 model in the black-box scenario, its attack success rate increases by 10.75%, while the attack on the adversarially trained Inc-v3 adv The attack success rate also increased by 5.6% when the network was used. The above experimental results prove that the MPE-MIFGSM method can achieve a high attack success rate in white-box scenarios and significantly improve the attack success rate in black-box scenarios.
[0110] Table 4 Comparison of success rates of attacking a single model
[0111]
[0112] The ensemble model is a machine learning technique that improves overall performance or generalization ability by combining multiple individual models. Existing literature points out that if an adversarial sample is adversarial in multiple networks, then the adversarial sample may have higher transferability. Therefore, attacking a collection of multiple networks at the same time can generate a more aggressive adversarial sample. The specific ensemble method used in the present invention is shown in the following formula (11):
[0113]
[0114] Among them l k (X;θ k ) represents the output of the kth model, w k represents the ensemble weight of the model, and K represents the number of models, and X represents the model input samples.
[0115] The experiment uses IFGSM, MIFGSM and MPE-MIFGSM to generate adversarial samples on the integrated models of Res-101, Xce, Inc-v3 and Inc-v4, and attacks all experimental models. The integration weights of each network are consistent, all 1 / 4. The experimental results are shown in Table 5. It can be seen from Table 5 that the adversarial samples generated on the integrated model generally have high transferability. Compared with IFGSM and MIFGSM, the average attack success rate of MPE-MIFGSM in the black box scenario increased by 28.72% and 8.44% respectively. Compared with MIFGSM, the white box attack success rate of this method has slightly decreased, but the attack success rate in the black box scenario has been significantly improved. For Res-152 in the black box scenario, the attack success rate reached 94.81%, and for Inc-v3 trained through adversarial adv , the attack success rate is 56.48%.
[0116] Table 5 Comparison of success rates of attack integration models
[0117]
[0118] In order to further verify the effectiveness of the proposed method, MPE-MIFGSM is compared with the probability enhancement adversarial attack method based on a single space, that is, the image samples are only cropped and padded (CP) based on the pixel space or color changed (CC) based on the HSV color space. The experiment uses adversarial samples generated on the Res101, Xce, Inc-v3 and Inc-v4 integrated models to attack all experimental models. The experimental results are shown in Table 6. As can be seen from Table 6, compared with CP-MIFGSM and CC-MIFGSM, the white-box attack success rate of MPE-MIFGSM is slightly lower. The reason is that after introducing excessive data enhancement, the model better learns the invariance of the data, making it more tolerant to small perturbations, resulting in a decrease in the effect of adversarial perturbations. The black-box attack success rate is increased by an average of 2.45-4.55%, among which the attack success rate of Inc-v3adv is the highest, increasing by 6.81%.
[0119] Table 6 Comparison of attack success rate with single space probability enhancement method
[0120]
[0121] In the present invention, unless otherwise clearly stipulated and limited, the terms such as "installation", "setting", "connection", "fixation" and "rotation" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral one; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. Unless otherwise clearly defined, ordinary technicians in this field can understand the specific meanings of the above terms in the present invention according to the specific circumstances.
[0122] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for generating adversarial samples based on multi-space probability enhancement, characterized in that: The following steps are involved: S1. Collect multiple image samples to form an original sample data set; S2. Constructing a multi-space probability enhancement model, wherein the multi-space probability enhancement model includes an enhancement branch based on a pixel space and an enhancement branch based on an HSV color space; S3. Set the maximum number of iterations T, and initialize the number of iterations t = 0; S4. In the tth iteration, based on the multi-space probability enhancement model, the data enhancement processing method of the input image sample is controlled by probability to obtain an enhanced image sample; S5. Input the enhanced image sample into the target model for training, and obtain the accumulated gradient according to the loss function; update the enhanced image sample by the accumulated gradient to obtain the perturbed image sample; S6. Determine whether the maximum number of iterations T has been reached. If so, output the current perturbed image sample as an adversarial sample. If not, set the current perturbed image sample as the input image sample, set t=t+1, and then return to step S4.
2. According to claim 1, a method for generating adversarial samples based on multi-space probability enhancement is characterized in that: Step S4 includes: A random value in the interval [0,1] is used as the cropping and filling probability p; a random value in the interval [0,1] is used as the color change probability q; If p<0.5 and q<0.5, then a random enhancement branch is selected to perform data enhancement processing on the input image sample to obtain an enhanced image sample; If p<0.5 and q≥0.5, then the enhancement branch based on the pixel space is selected to perform data enhancement processing on the input image sample to obtain an enhanced image sample; If p≥0.5 and q<0.5, then the enhancement branch based on the HSV color space is selected to perform data enhancement processing on the input image sample to obtain an enhanced image sample; If p≥0.5 and q≥0.5, the input image samples are directly used as enhanced image samples.
3. The method for generating adversarial samples based on multi-space probability enhancement according to claim 2, characterized in that: Selecting an enhancement branch based on pixel space to perform data enhancement processing on the input image sample to obtain an enhanced image sample, including: S11. crop ,0.9] interval as the cropping ratio prop, where Min crop Indicates the minimum cropping ratio; S12. Crop the input image sample according to the cropping ratio prop to obtain a cropped image, fill the pixel value 0 around the cropped image to obtain a filled image, the size of the filled image is consistent with the size of the input image sample, and output the filled image as an enhanced image sample.
4. The method for generating adversarial samples based on multi-space probability enhancement according to claim 2, characterized in that: Select an enhancement branch based on the HSV color space to perform data enhancement processing on the input image sample to obtain an enhanced image sample, including: S21. Decompose the RGB three channels of the input image sample into a red channel, a green channel, and a blue channel; obtain the channel value x of the red channel R R , the channel value x of the green channel G and the channel value x of the blue channel B ; S22. Based on x R 、x G 、x B Three channel values, using RGBtoHSV conversion method to get the hue value x H , saturation value x S and brightness value x V ; S23. Take a random value rand in the interval [0,360] H , take a random value rand in the interval [-0.2,0.2] S ; According to the random value rand H Hue value x H Update to get the hue value x′ H , according to the random value rand S For saturation value x S Update to get the saturation value x′ S ; S24. According to the hue value x′ H , saturation value x′ S and brightness value x V Convert to get the updated channel value x′ R , update channel value x′ G and update the channel value x′ B ; S25. Change x′ R , x′ G , x′ B The new image is merged and output as the enhanced image sample.
5. The method for generating adversarial samples based on multi-space probability enhancement according to claim 4, characterized in that: RGBtoHSV conversion methods include: Select x R 、x G 、x B The maximum value among them is taken as the brightness value x V ; If x V =0, then the saturation value x S =0, otherwise the saturation value If x V =x R , then the hue value If x V =x G , then the hue value x V =x B , then the hue value Determine the hue value x H Is it less than 0? If so, let x H =x H +360, otherwise unchanged.
6. The method for generating adversarial samples based on multi-space probability enhancement according to claim 1, characterized in that: The specific process of the t+1th iteration includes: Randomly select an enhancement branch for the input image sample x t Perform data enhancement processing to obtain enhanced image samples It is expressed as: Among them, MT represents the multi-space probability enhancement model, p represents the cropping and filling probability, q represents the color change probability, Min crop Indicates the minimum cropping ratio; Will enhance the image samples Input the target model for training and calculate the loss function for the enhanced image samples The gradient of the t+1th iteration is obtained according to the gradient. t+1 , the calculation formula is: in, Represents the loss function For enhanced image samples The gradient of , y represents the label of the image sample, θ represents the target model parameter, μ represents the attenuation coefficient, and ||·||1 represents the L1 norm; By accumulating the gradient g t+1 Update augmented image samples Get the perturbed image sample It is expressed as: Among them, α = ε / T represents the number of iterations, ε represents the perturbation amplitude, sign(·) represents the sign function, Represents the clipping function.
7. The method for generating adversarial samples based on multi-space probability enhancement according to claim 6, characterized in that: The multi-space probability enhancement model is specifically expressed as: MT(x t ;p,q,Min crop )=T CP (x t ;p,Min crop )+T CC (x t ;q) Among them, T CP (x; Min crop ) represents the output of the enhancement branch based on pixel space, T cp (x; p, Min crop ) represents the output obtained by taking the random cropping and filling method based on the pixel space under probability p, T CC (x) represents the output of the enhancement branch based on the HSV color space, T CC (x; q) represents the output obtained by taking the image random color transformation method based on the HSV color space with probability q.
Citation Information
Patent Citations
Adversarial sample generation method and system based on image brightness random transformation
CN113487015A
Non-uniform illumination image enhancement method and system, storage medium and equipment
CN115526803A
Intelligent system confrontation sample generation method and system based on diversified input strategies
CN115527084A
Adversarial sample generation method based on histogram probability equalization
CN116993634A
Traffic sign image enhancement method and system based on probability model
CN117437127A
