A method and system for countering attacks based on multi-sample collaboration
Through the multi-sample collaborative adversarial attack method, gradient weighting and attention mechanisms are used to generate adversarial samples, which solves the problems of poor attack success rate and speed in the existing technology, achieves more efficient adversarial attacks, and enhances robustness and generalization. ization ability.
Patent Information
- Application Number
- CN202410605800.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-16
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-05-16
AI Technical Summary
Existing adversarial sample generation methods cannot achieve a balance between attack success rate and generation speed, and traditional single sample attack methods have poor ability to resist attacks, low robustness, and large amount of calculation, resulting in long attack times and unable to meet the needs of real-time applications.
Using a multi-sample collaborative adversarial attack method, the texture information is extracted through the gradient-weighted class activation graph algorithm, clustering is used to generate a texture embedding matrix, the attention mechanism is used to determine the attack area, and the number of adversarial texture images is gradually increased until the upper limit is reached or the attack is successful. Combining the perturbations of target categories and background areas, adversarial samples are generated.
It improves the success rate and robustness of adversarial attacks, shortens attack time, enhances the generalization ability of adversarial samples, and can deceive deep learning models more effectively.
Smart Images

Figure CN118194920B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information confrontation technology, and in particular to a method and system for countering attacks based on multi-sample collaboration. Background Art
[0002] With the rapid development of deep learning technology, deep learning technology has made breakthrough progress in most fields. In the method of deep learning model, adversarial attack refers to the use of perturbations on input samples to make the output of the model produce wrong or misleading results. The emergence of adversarial samples has been proven to be a threat to the application of artificial intelligence, and it also brings severe security challenges to the deployment of deep learning technology. However, the existing adversarial sample generation methods cannot achieve a good balance between attack success rate and generation speed. Research on the aggressiveness, migration and attack time of adversarial samples has very important practical significance for the attack and defense field of intelligent security, and is more conducive to promoting the research and development of adversarial sample attacks and defenses, and improving the security and robustness of models.
[0003] The limitation of most attack methods studied in adversarial attack theory and technology is that they have weak attack capabilities against targets. Traditional adversarial attack algorithms usually only attack single samples. This attack method will be affected by the model's defense mechanism, resulting in poor attack effects. Moreover, the process is too dependent on the target model information, resulting in the lack of generalization ability of the generated adversarial samples. The adversarial samples have poor transferability and cannot achieve good results on other models. They will also lose their adversarial attack properties under the influence of real environments.
[0004] Due to the demand for detection accuracy, the design of neural network models is becoming more and more complex. However, most of the methods proposed by traditional attack algorithms are based on back-propagation generation, which generally introduces more gradient calculation steps, making the generation process of adversarial samples computationally intensive and more time-consuming. Natural optimization algorithms that use queries need to constantly query the model to obtain attack information, which takes a long time to generate. For real-time applications or large-scale systems, long attack times can lead to performance degradation or fail to meet the needs of real-time tasks. Summary of the invention
[0005] The present invention proposes a method and system for multi-sample collaborative counterattack. It can be used to solve the following technical problems: when facing the attack of a traditional single counterattack sample, the transformation of the input sample is usually ignored, resulting in poor counterattack capability and low robustness, and a large amount of calculation and search are usually required, resulting in a long attack time; and the counterattack method cannot achieve an effective balance between attack time and attack effect.
[0006] The present invention proposes a method for countering attacks based on multi-sample collaboration, which includes:
[0007] S1. Extract and encode texture information for a group of images of each target category. During the extraction process, perform a gradient-weighted class activation map algorithm to locate and extract key areas of the target category. Then, encode the texture information of the key areas of the target category and cluster them. Generate texture embedding matrices based on the clustered texture information of each category. Form texture samples based on each texture embedding matrix to build an attack sample database.
[0008] S2, determining a class activation heat map reflecting the importance of the perceptually sensitive area in the attacked image based on the attention mechanism, and determining the attack area according to the class activation heat map;
[0009] S3, binarizing the class activation heat map to obtain a mask of the attack area, taking the area corresponding to the mask as the attack area, selecting a first texture sample block from the attack sample database, and performing a dot multiplication of pixels within the attack area and the first texture sample block; selecting a second texture sample block from the attack sample database, and performing a dot multiplication of pixels outside the attack area and the second texture sample block, thereby completing a coordinated attack;
[0010] During the confrontation process, the number of confrontation texture images is gradually increased, and texture blocks are continuously selected from the attack sample database. The pixels outside the attack area of the last coordinated attack are dot-multiplied with the texture block, so as to continue the coordinated attack until the number of texture blocks reaches an upper limit or the attack is successful.
[0011] Further, in S1, the texture information is extracted and encoded for a group of images of each target category. During the extraction process, a gradient weighted class activation map algorithm is executed to further locate and extract the key area of the target category, and then the texture information of the key area of the target category is encoded and clustered, specifically including:
[0012] For each image of a set of images of each target category, the Grad-CAM gradient weighted class activation algorithm is executed on the Resnet50 network to extract the target category key area information in each image, and then all Gram matrices of the target category key area information are calculated separately and connected into a vector G’ To encode texture information;
[0013] Then the texture information is clustered using the K-means algorithm to obtain multiple texture embedding matrix information.
[0014] Furthermore, in S1, texture embedding matrices are generated according to the clustered texture information of each category, and texture samples are formed based on the embedding of each texture to construct an attack sample database, which specifically includes:
[0015] After a texture embedding matrix of a certain category is generated, the texture feature embedding matrix is associated with the generated texture image, and an objective function between the two is set for iterative optimization to obtain corresponding texture samples, and an attack sample database is constructed based on the texture samples.
[0016] Furthermore, in S2, the attack area is determined based on the class activation heat map, including:
[0017] The class activation heat map has the same size as the input image, and the class activation heat map is superimposed on the attacked image. The brightness of the class activation heat map indicates the importance of the corresponding area on the attacked image, and the area on the attacked image corresponding to the area whose brightness on the class activation heat map meets the specified conditions is determined as the attack area.
[0018] Furthermore, S3 further includes: the conditions for ending the coordinated attack include:
[0019] The number of coordinated attacks reaches the set upper limit, or the total size of the added texture sample tiles exceeds the delay size of the attacked image, or the attacked image cannot be recognized as its original image content before being attacked.
[0020] The present invention proposes a multi-sample collaborative anti-attack system, which includes:
[0021] The attack sample database creation module extracts and encodes texture information for a group of images of each target category. During the extraction process, the gradient weighted class activation map algorithm is executed to locate and extract the key areas of the target category, and then the texture information of the key areas of the target category is encoded and clustered. The texture information of each category after clustering is respectively generated into a texture embedding matrix, and texture samples are formed based on each texture embedding matrix to construct an attack sample database;
[0022] The optimal attack position information acquisition module determines the class activation heat map reflecting the importance of the perceptual sensitivity area in the attacked image based on the attention mechanism, and determines the attack area according to the class activation heat map;
[0023] A plurality of adversarial sample collaborative attack modules obtain a mask of the attack area by binarizing the class activation heat map, use the area corresponding to the mask as the attack area, select a first texture sample block from the attack sample database, and perform dot multiplication of pixels within the attack area with the first texture sample block; select a second texture sample block from the attack sample database, and perform dot multiplication of pixels outside the attack area with the second texture sample block, thereby completing a collaborative attack;
[0024] During the confrontation process, the number of confrontation texture images is gradually increased, and texture blocks are continuously selected from the attack sample database. The pixels outside the attack area of the last coordinated attack are dot-multiplied with the texture block, so as to continue the coordinated attack until the number of texture blocks reaches an upper limit or the attack is successful.
[0025] Furthermore, the attack sample database creation module extracts and encodes texture information for a group of images of each target category. During the extraction process, a gradient-weighted class activation map is performed to further locate and extract the key areas of the target category, and then the texture information of the key areas of the target category is extracted and clustered, specifically including:
[0026] For each image of a set of images of each target category, the Grad-CAM gradient weighted class activation algorithm is executed on the Resnet50 network to extract the information of the key areas of the target category in each image, and then all the Gram matrices of the key areas of the target category information are calculated separately and connected into a vector G ’ To encode texture information;
[0027] Then the texture information is clustered using the K-means algorithm to obtain multiple texture embedding matrix information.
[0028] Furthermore, the attack sample database creation module generates texture embedding matrices according to the clustered texture information of each category, forms texture samples based on each texture embedding matrix, and then constructs an attack sample database, which specifically includes:
[0029] After a texture embedding matrix of a certain category is generated, the texture feature embedding matrix is associated with the generated texture image, and an objective function between the two is set for iterative optimization to obtain corresponding texture samples, and an attack sample database is constructed based on the texture samples.
[0030] Furthermore, the optimal attack position information acquisition module determines the attack area according to the class activation heat map, specifically including:
[0031] The class activation heat map has the same size as the input image, and the class activation heat map is superimposed on the attacked image. The brightness of the class activation heat map indicates the importance of the corresponding area on the attacked image, and the area on the attacked image corresponding to the area whose brightness on the class activation heat map meets the specified conditions is determined as the attack area.
[0032] Furthermore, the conditions for the optimal attack position information acquisition module to end the collaborative attack include: the number of collaborative attacks reaches a set upper limit, or the size of the total number of added texture sample blocks exceeds the delay size of the attacked image, or the attacked image cannot be recognized as its original image content before the attack.
[0033] The advantages of the present invention compared with the prior art are:
[0034] 1. Considering that the existing adversarial attack methods cannot achieve good results in terms of generation time and attack success rate at the same time, the present invention proposes an attack algorithm that uses multiple adversarial samples to collaboratively confront, which is used to solve the problems of large resource consumption, poor attack performance and low robustness of traditional single adversarial sample attacks.
[0035] 2. The present invention proposes to use pre-extracted texture adversarial blocks and key image areas obtained with the help of an attention mechanism, which greatly shortens the adversarial attack time while making the attack more targeted and improving the success rate of the attack.
[0036] 3. The present invention proposes to use the binary mask dot multiplication of the heat map with the basic texture pattern of a specific category in the sample library, superimpose adversarial perturbations on the background area and the focus area respectively, and gradually increase the number of adversarial texture images in the background area until the upper limit is reached or the attack is successful. This method combines the perturbation of the target category with the perturbation of the background information, making the adversarial sample more robust, thereby better deceiving the deep learning network model. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a schematic diagram of the overall algorithm of the present invention;
[0038] Figure 2 This is a texture adversarial example diagram of some categories of the present invention;
[0039] Figure 3 A schematic diagram of determining the attack position for the present invention;
[0040] Figure 4 is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0041] The present invention proposes a method and system for collaborative adversarial attack based on multiple samples. The present invention first uses a pre-trained network to encode a certain type of specific texture information and creates an attack sample database with attack effects under a specific class. Secondly, in the process of generating adversarial samples, the attention mechanism is used to quickly obtain the best attack position for the classification model. Finally, multiple samples are superimposed on the target area and the background area for collaborative attack to enhance the aggressiveness of the adversarial samples.
[0042] The method of the present invention comprises the following steps:
[0043] Step 1, create an attack sample database. For a group of images of each target category, a gradient weighted algorithm is executed to extract the target category key areas of the group of images. During the extraction process, a gradient weighted class activation map is executed to further locate and extract relevant information of the key areas, and to shield irrelevant area information in the image. Then, a specific texture information of a class corresponding to the target is encoded from the target category key areas of the group of images, and the k-means algorithm is used for clustering on the texture information. 10 calculated clusters can be used as the texture embedding of the category. Finally, based on the texture embedding matrix of each category, the texture samples of the corresponding target category are generated through objective function optimization to construct an attack sample database.
[0044] Step 2: Obtain the best attack position information. By constructing a Grad-CAM-based attention mechanism to determine the class activation heat map that reflects the importance of the perceptually sensitive area in the attacked image, and using the perceptually sensitive area of the image to determine the attack area, we can quickly find important areas as the attack area and reduce the interference of the background area.
[0045] Step 3: Overlay multiple adversarial samples for collaborative attack. The class activation heat map obtained in step 2 using Grad-CAM is binarized to obtain a mask. The mask is dot-multiplied with the texture sample of a certain class obtained in step (1) to obtain the perturbation of the attention area. At the same time, the binary mask of the background is dot-multiplied with any random texture sample in a selected class in the area corresponding to the attacked image in the heat map. Finally, the perturbation of the attention area and the perturbation of the background area are added to the original image to generate the adversarial sample. The adversarial sample is used as the input to the classification model, and the number of adversarial texture images is gradually increased during the optimization process until the upper limit is reached or the attack is successful.
[0046] Example
[0047] Figure 1 and Figure 4 The overall algorithm schematic diagram and flow chart of the present application are respectively given, and the present invention is further explained below in conjunction with other drawings and specific implementation methods.
[0048] A specific step of the multi-sample collaborative anti-attack method of the present invention is as follows:
[0049] 1. Create an attack texture sample database
[0050] The texture samples in the texture sample database are created by using Gram matrix clustering learning based on the network features of Resnet50 pre-trained on ImageNet. C It is the convolution part in the Resnet50 network. F ij yesC On i In the block j The feature map of the convolutional layer, G ij is the corresponding Gram matrix of feature activation. All Gram matrices of the image are calculated separately and then connected into a vector G ’ ={ G 1 2 , G 2 2,…, G 2 m} is used to encode texture information. Secondly, in the process of texture information extraction, the background area of the image is usually not of interest, and only the texture information of the target area in the image is extracted. Therefore, Grad-CAM is executed on each image Resnet50 to locate the key area information of the target category in each image, and the irrelevant areas in the image are shielded before texture extraction. The benefits of this are that it reduces the impact of a large amount of background information on the final image, and reduces additional resource consumption, improves the running speed of the model, and shortens the calculation and reasoning time of the model. Subsequently, the texture information of all images of each category is G ’ K-Means clustering is performed, and 10 texture embedding matrices of size are generated for each category. .
[0051] (1)
[0052] According to formula (1), the texture image t, G is optimized starting from random noise. t and 𝜆 represent the texture embedding and weight of t respectively. The texture feature embedding matrix is associated with the generated texture image, and the objective function between the two is set ( L texture ) is iterated to optimize the number of times, thereby generating 10 texture adversarial sample blocks of different styles under a specific category. Figure 2 Shows texture adversarial example images of some categories.
[0053] 2. Obtain the optimal attack position neural network structure
[0054] The attention weight matrix containing the key features of the image is obtained using the gradient-based class activation mapping technique, with the aim of further optimizing the attack position, thereby controlling the optimal range of the perturbation attack. The algorithm determines which areas in the image play an important role in the decision-making of the target model by calculating the gradient of the classification target model output relative to the input image. This method can effectively reduce the interference area of the adversarial attack and concentrate the generated perturbations in areas that have a greater impact on the model's decision.
[0055] like Figure 3 As shown in the figure, x is defined as the original image. First, the feature map of the target category is obtained. Through forward propagation, the feature map of the last convolutional layer of the model is obtained. These feature maps are the image features extracted by the model in the target task. Secondly, the gradient of the target category relative to the feature map of the last convolutional layer is calculated. Then, for each feature map channel, the channel-by-channel product of its gradient and the feature map is calculated, and the results are weighted averaged. In this way, a channel weight vector can be obtained, which indicates the importance of each channel to the target category, and then the corresponding class activation heat map Grad-CAM is obtained through the ReLU activation function.
[0056] (2)
[0057] in A The feature layer representing the output of the convolutional layer, k Representative feature layer A Middle k channels, c Indicates category, A k Representative feature layer A Middle Channel k data, Indicates for A k The weight of .
[0058] (3)
[0059] y c Represents the score of the network's prediction for the category, A ij k Representative feature layer A In the channel k The coordinates are ( i,j ) data value at the position, Z is equal to the width of the feature layer multiplied by its height, By predicting the category c The prediction score y c Perform back propagation.
[0060] The resulting heatmap is the same size as the input image, indicating the degree of attention the model pays to different regions in the classification task. The generated heatmap is superimposed on the input image to visualize the degree of attention the model pays to the input image. The brightness on the heatmap indicates the importance of the corresponding area of the model, and the brighter the area, the more important it is. Heatmaps can help us understand the decision-making process of the model and visualize the degree of attention the deep learning model pays to the input image.
[0061] 3. Overlay multiple adversarial sample collaborative attack modules
[0062] The heat map generated by attention is used to set the attack range of the area through binarization, and the weight in the attack area is set to 1, and the weight outside the area is set to 0. The final generated mask can highlight the pixels in the attack area. M a . At the same time, the binary mask of the background area can also be obtained M b .
[0063] M b =1- M a (4)
[0064] like Figure 4 As shown in Figure 2, in the entire algorithm process, these two masks are used to attack with the adversarial texture sample library. The initial task is to find the location of a focus area, created from the adversarial texture sample library. m Texture tiles of a specific class Tex In the above example, one texture tile is randomly selected and placed on the image focus area, and the other is selected from the remaining m - 1 texture tile Tex Randomly select tiles from the image and place them on the background area of the image. If the attack fails (i.e. the target classification model can still determine the category of the original image), continue to add tiles to the background area, and the tiles that have been placed in the previous position will continue to be retained until the number of tiles reaches the upper limit (here the upper limit of the number of added tiles can be manually customized or the upper limit is reached when the total size of the added texture tiles exceeds the size of the original image) or the attack succeeds (i.e. the classification model misclassifies or the classification model classifies it into the specified category), then stop.
[0065] (5)
[0066] represents the adversarial sample that is finally input into the target model, x represents the original sample image, Tex 1 , Tex 2 … Tex agent+2 Respectively from Tex The textures selected in the first and second images Figure 1 Until agent +2 pictures. agent Represents the number of executions, which will change depending on whether the model fails to attack, until the attack succeeds or reaches m The upper limit of agent +2≤m ) stops.
[0067] The present invention also proposes a multi-sample collaborative anti-attack system, which includes:
[0068] The attack sample database creation module extracts and encodes texture information for a group of images of each target category. During the extraction process, the gradient-weighted class activation map algorithm is executed to further locate and extract the key areas of the target category. The texture information of the key areas of the target category is then encoded and clustered. The texture information of each category after clustering is respectively generated into a texture embedding matrix. Texture samples are formed based on each texture embedding matrix to construct an attack sample database.
[0069] The optimal attack position information acquisition module determines the class activation heat map reflecting the importance of the perceptual sensitivity area in the attacked image based on the attention mechanism, and determines the attack area according to the class activation heat map.
[0070] A plurality of adversarial sample collaborative attack modules binarize the class activation heat map to obtain a mask of the attack area, use the area corresponding to the mask as the attack area, select a first texture sample block from the attack sample database, and perform dot multiplication of pixels within the attack area with the first texture sample block; select a second texture sample block from the attack sample database, and perform dot multiplication of pixels outside the attack area with the second texture sample block, thereby completing a collaborative attack.
[0071] During the optimization process, the number of adversarial texture images is gradually increased, and texture tiles are continuously selected from the attack sample database. The pixels outside the attack area of the last collaborative attack are dot-multiplied with the texture tile, thereby continuing the collaborative attack until the number of texture tiles reaches an upper limit or the attack is successful.
[0072] The attack sample database creation module extracts and encodes texture information for a group of images of each target category. During the extraction process, the gradient weighted class activation map algorithm is executed to further locate and extract the key areas of the target category, and then the texture information of the key areas of the target category is encoded and clustered. Specifically, it includes:
[0073] For each image of a set of images of each target category, the Grad-CAM gradient weighted class activation algorithm is executed on the Resnet50 network to extract the information of the key areas of the target category in each image, and then all the Gram matrices of the key areas of the target category information are calculated separately and connected into a vector G ’ to encode texture information.
[0074] Then the texture information is clustered using the K-means algorithm to obtain multiple texture embedding matrix information.
[0075] The attack sample database creation module generates texture embedding matrices based on the clustered texture information of each category, forms texture samples based on each texture embedding matrix, and then constructs an attack sample database, which specifically includes:
[0076] After a texture embedding matrix of a certain category is generated, the texture feature embedding matrix is associated with the generated texture image, and an objective function between the two is set for iterative optimization to obtain corresponding texture samples, and an attack sample database is constructed based on the texture samples.
[0077] The optimal attack position information acquisition module determines the attack area according to the class activation heat map, specifically including: the class activation heat map has the same size as the input image, the class activation heat map is superimposed on the attacked image, the brightness of the class activation heat map indicates the importance of the corresponding area on the attacked image, and the area on the attacked image corresponding to the area whose brightness on the class activation heat map meets the specified conditions is determined as the attack area.
[0078] The conditions for the optimal attack position information acquisition module to end the coordinated attack include: the number of coordinated attacks reaches a set upper limit, or the size of the total number of added texture sample blocks exceeds the delay size of the attacked image, or the attacked image cannot be recognized as its original image content before the attack.
[0079] The present invention takes into account that a single adversarial sample performs poorly for target attacks, has low transferability, and the optimization process requires a large number of iterations or queries, which is time-inefficient. The present application proposes to first use a pre-trained model to create an attack sample database with attack effects, and then use the attention mechanism on the input image to quickly find the optimal attack position or important decision area and generate a mask, and finally superimpose adversarial samples of a specific class selected from the sample database on the mask area of the input image, and randomly add custom samples to the non-masked area until the attack is successful or the sample quantity limit is reached. The adversarial attack algorithm implemented by this method can adaptively attack multiple target classification models, has a higher attack success rate and migration success rate, and can also further reduce the time of iterative optimization and improve the efficiency of adversarial sample generation.
Claims
1. A method for countering attacks based on multi-sample collaboration, characterized in that: It includes: S1. Extract and encode texture information for a group of images of each target category. During the extraction process, perform a gradient-weighted class activation map algorithm to locate and extract key areas of the target category. Then, encode the texture information of the key areas of the target category and cluster them. Generate texture embedding matrices based on the clustered texture information of each category. Form texture samples based on each texture embedding matrix to build an attack sample database. S2, determining a class activation heat map reflecting the importance of the perceptually sensitive area in the attacked image based on the attention mechanism, and determining the attack area according to the class activation heat map; S3, binarizing the class activation heat map to obtain a mask of the attack area, taking the area corresponding to the mask as the attack area, selecting a first texture sample block from the attack sample database, and performing a dot multiplication of pixels within the attack area and the first texture sample block; selecting a second texture sample block from the attack sample database, and performing a dot multiplication of pixels outside the attack area and the second texture sample block, thereby completing a coordinated attack; During the confrontation process, the number of confrontation texture images is gradually increased, and texture blocks are continuously selected from the attack sample database. The pixels outside the attack area of the last coordinated attack are dot-multiplied with the texture block, so as to continue the coordinated attack until the number of texture blocks reaches an upper limit or the attack is successful.
2. The method according to claim 1, characterized in that In S1, for a group of images of each target category, texture information is extracted and encoded. During the extraction process, a gradient weighted class activation map algorithm is executed to further locate and extract the key area of the target category, and then the texture information of the key area of the target category is encoded and clustered, specifically including: For each image of a set of images of each target category, the Grad-CAM gradient weighted class activation algorithm is executed on the Resnet50 network to extract the target category key area information in each image, and then all Gram matrices of the target category key area information are calculated separately and connected into a vector G’ To encode texture information; Then the texture information is clustered using the K-means algorithm to obtain multiple texture embedding matrix information.
3. The method according to claim 2, characterized in that In S1, texture embedding matrices are generated according to the texture information of each category after clustering, and texture samples are formed based on the embedding of each texture to construct an attack sample database, which specifically includes: After a texture embedding matrix of a certain category is generated, the texture feature embedding matrix is associated with the generated texture image, and an objective function between the two is set for iterative optimization to obtain corresponding texture samples, and an attack sample database is constructed based on the texture samples.
4. The method according to claim 3, characterized in that In S2, the attack area is determined based on the class activation heat map, including: The class activation heat map has the same size as the input image, and the class activation heat map is superimposed on the attacked image. The brightness of the class activation heat map indicates the importance of the corresponding area on the attacked image, and the area on the attacked image corresponding to the area whose brightness on the class activation heat map meets the specified conditions is determined as the attack area.
5. The method according to claim 4, characterized in that S3 further includes: the conditions for ending the coordinated attack include: The number of coordinated attacks reaches the set upper limit, or the total size of the added texture sample tiles exceeds the delay size of the attacked image, or the attacked image cannot be recognized as its original image content before being attacked.
6. A multi-sample collaborative anti-attack system, characterized in that: It includes: The attack sample database creation module extracts and encodes texture information for a group of images of each target category. During the extraction process, the gradient weighted class activation map algorithm is executed to locate and extract the key areas of the target category, and then the texture information of the key areas of the target category is encoded and clustered. The texture information of each category after clustering is respectively generated into a texture embedding matrix, and texture samples are formed based on each texture embedding matrix to construct an attack sample database; The optimal attack position information acquisition module determines the class activation heat map reflecting the importance of the perceptual sensitivity area in the attacked image based on the attention mechanism, and determines the attack area according to the class activation heat map; A plurality of adversarial sample collaborative attack modules obtain a mask of the attack area by binarizing the class activation heat map, use the area corresponding to the mask as the attack area, select a first texture sample block from the attack sample database, and perform dot multiplication of pixels within the attack area with the first texture sample block; select a second texture sample block from the attack sample database, and perform dot multiplication of pixels outside the attack area with the second texture sample block, thereby completing a collaborative attack; During the confrontation process, the number of confrontation texture images is gradually increased, and texture blocks are continuously selected from the attack sample database. The pixels outside the attack area of the last coordinated attack are dot-multiplied with the texture block, so as to continue the coordinated attack until the number of texture blocks reaches an upper limit or the attack is successful.
7. The system according to claim 6, characterized in that The attack sample database creation module extracts and encodes texture information for a group of images of each target category. During the extraction process, a gradient-weighted class activation map is performed to further locate and extract the key areas of the target category, and then the texture information of the key areas of the target category is extracted and clustered, specifically including: For each image of a set of images of each target category, the Grad-CAM gradient weighted class activation algorithm is executed on the Resnet50 network to extract the information of the key areas of the target category in each image, and then all the Gram matrices of the key areas of the target category information are calculated separately and connected into a vector G ’ To encode texture information; Then the texture information is clustered using the K-means algorithm to obtain multiple texture embedding matrix information.
8. The system according to claim 7, characterized in that The attack sample database creation module generates texture embedding matrices according to the clustered texture information of each category, forms texture samples based on each texture embedding matrix, and then constructs an attack sample database, specifically including: After a texture embedding matrix of a certain category is generated, the texture feature embedding matrix is associated with the generated texture image, and an objective function between the two is set for iterative optimization to obtain corresponding texture samples, and an attack sample database is constructed based on the texture samples.
9. The system according to claim 8, characterized in that The optimal attack position information acquisition module determines the attack area according to the class activation heat map, specifically including: The class activation heat map has the same size as the input image, and the class activation heat map is superimposed on the attacked image. The brightness of the class activation heat map indicates the importance of the corresponding area on the attacked image, and the area on the attacked image corresponding to the area whose brightness on the class activation heat map meets the specified conditions is determined as the attack area.
10. The system according to claim 9, characterized in that The conditions for the optimal attack position information acquisition module to end the coordinated attack include: The number of coordinated attacks reaches the set upper limit, or the total size of the added texture sample tiles exceeds the delay size of the attacked image, or the attacked image cannot be recognized as its original image content before being attacked.
