Action Recognition Transfer Attack Method Based on Adaptive Gradient Temporal Feature Pruning

Through adaptive gradient temporal feature pruning technology, the temporal relationship between video frames is destroyed, redundant features are pruned, and multiple proxy model gradients are integrated to solve the problem of robustness evaluation of action recognition models under adversarial attacks and improve the accuracy of adversarial samples. Migration and attack success rate.

CN118587561BActive Publication Date: 2024-10-22HANGZHOU DIANZI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411068035.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-10-22
Estimated Expiration
2044-08-06

AI Technical Summary

Technical Problem

The problem of robustness evaluation of existing action recognition models under adversarial attacks has not been fully considered. Especially in the migration attack of the black box model, the difference in the decision boundary between the source agent model and the model to be attacked leads to the migration of adversarial samples. The performance is poor and there is an over-fitting problem, which affects the generalization performance of the attack.

Method used

An action recognition migration attack method based on adaptive gradient temporal feature pruning is adopted to destroy the temporal relationship of video frames through the channel mask module. The temporal feature pruning module prunes the redundant features of the source proxy model, and the adaptive gradient fusion module fuses multiple The gradient information of the proxy model is used to generate iterative adversarial examples to improve the robustness of the attack.

Benefits of technology

It effectively overcomes the problem of the difference in decision boundaries between the source agent model and the model to be attacked, alleviates the over-fitting problem of adversarial samples, improves the transferability and attack success rate of adversarial samples, and provides a robustness evaluation method for action recognition models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118587561B_ABST
    Figure CN118587561B_ABST
Patent Text Reader

Abstract

The present invention discloses an action recognition migration attack method based on adaptive gradient temporal feature pruning. First, the original positive sample set is obtained, a channel mask module is constructed, and a weighted channel mask sample is output; a temporal feature pruning module is constructed, and multiple pruning models are obtained by using channel importance and temporal redundancy; an adaptive gradient fusion module is constructed, and adversarial perturbations are obtained by adaptively allocating proxy models; finally, adversarial samples are generated by iterative fast gradient symbol method, and the adversarial samples are input into the model to be attacked to complete the action recognition attack task. The method of the present invention utilizes temporal feature pruning and adaptive fusion strategies to prevent adversarial samples from excessively focusing on redundant temporal features; the integrated proxy model composed of a source proxy model and multiple pruned models can adaptively fuse the gradients of different proxy models, thereby enhancing the transferability of adversarial samples and improving the attack strength on the action recognition model; it can be applied to scenarios such as human-computer interaction and autonomous driving.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of confrontation attack and defense in video analysis, and specifically relates to an action recognition migration attack method based on adaptive gradient temporal feature pruning. Background Art

[0002] In the era of digitalization and intelligence, image and video sensor terminal devices have been rapidly popularized in every corner of people's lives, enabling visual data to show explosive growth. Among them, video is the dominant medium for disseminating unstructured knowledge, entertainment communication and other fields, with extensive content and diverse forms. In the era of the Internet of Everything, how to automatically recognize human actions through video has become a concern for researchers, namely the action recognition task. This task aims to determine the action category related to human movement given some video segments. It has a wide range of applications in practical scenarios such as human-computer interaction, autonomous driving, and intelligent monitoring. In recent years, deep learning technology has achieved remarkable success in the field of computer vision, especially in the field of action recognition, which has brought about a significant improvement in recognition accuracy. However, studies have found that deep learning models are highly vulnerable to small perturbations, that is, by adding perturbations that are almost imperceptible to the human eye to the input data, the model produces incorrect prediction results. The added perturbation is called adversarial perturbation, this attack is called adversarial attack, and the samples generated using adversarial attack are called adversarial samples. For example Figure 1 As shown in the figure, an image of a "panda" is recognized as a "panda" by the model with a probability of 85.7%, but after adding a small adversarial perturbation, the original image is recognized as a "gibbon" by the model with a probability of 99.4%. Therefore, the adversarial attack method can simulate real attack scenarios, evaluate the robustness of the model in the face of actual threats, and then provide targeted guidance for improving the robustness of the model.

[0003] At present, most action recognition methods are based on 2D convolution methods and 3D convolution methods. Among them, in the 2D convolution method, related work proposed Temporal Segment Networks (TSN), which uses a sparse sampling strategy to utilize the overall video information. Since 3D convolution can better characterize time and space information than 2D convolution, action recognition methods based on 3D convolution are constantly proposed. In order to capture spatiotemporal information, researchers proposed Inflated 3D ConvNets (I3D), using the trained 2D convolutional neural network as the initialization of the corresponding 3D convolutional network. In order to better capture the spatiotemporal information in the video, researchers proposed SlowFast Network, which captures the category semantic information that changes slowly in space through the Slow branch and captures the fast-changing motion information through the Fast branch. However, the SlowFast dual-branch network still cannot cover various action rhythms. Therefore, relevant researchers proposed the Temporal Pyramid Network (TPN), which models the rhythmic rules of different actions and integrates the features of multiple branches to consider a variety of different action rhythms.

[0004] None of the above video action recognition methods consider the vulnerability of the model, that is, the problem of evaluating its robustness under adversarial attacks. In practical applications, the attacker often cannot obtain all the information of the model (such as network structure, model parameters, etc.). The attack method against the black-box model (a model with unknown information such as model structure and model parameters) is called a black-box adversarial attack method. Among them, the most commonly used method is the black-box adversarial attack method based on transfer. This attack method aims to generate adversarial samples with the help of a white-box model (a model with known information such as network structure and model parameters, also known as a source proxy model) whose decision boundary is similar to the structure of the model to be attacked, and then use the adversarial sample to attack the black-box video action model. Its adversarial sample can not only successfully attack the source proxy model, but also successfully attack the model to be attacked. Among them, the method for generating adversarial samples generally uses the Fast Gradient Sign Method (FGSM), which generates adversarial samples by adding small perturbations to the input data along the gradient direction of the loss function, and can be extended to the Iterative Fast Gradient Sign Method (I-FGSM).

[0005] Existing black-box attack research mainly focuses on the field of image classification, and there are fewer studies targeting the video field. In the video field, related studies have proposed a temporal translation method to translate video clips along the time axis to obtain multiple gradients from different directions, but this method only performs well on specific source proxy models and has poor generalization. In the image field, researchers use input transformation of the original positive samples (samples correctly classified by the source proxy model) from the perspective of data enhancement to improve the transferability of adversarial samples; in order to alleviate the dependence on the gradient information of the source proxy model, related work has achieved powerful migration attacks from the perspectives of image scaling, image color depth, and local area pixel translation. However, the above methods are mainly limited to input transformation in the spatial domain. Therefore, researchers have proposed an attack method based on domain generalization, adding perturbations in the frequency domain or using a style transfer network to change the sample style to increase the diversity of input transformations, but they rely heavily on external modules and have high overhead;

[0006] The shortcomings of the above-mentioned transfer black-box attack methods are mainly manifested in the following two aspects: (1) In the existing transfer attack methods, there is a large decision boundary difference between the source proxy model and the model to be attacked. In the field of action recognition, the source proxy model and the victim model have different model structures and model parameters, so their decision boundaries naturally have certain differences. This difference affects the transferability of the adversarial attack (that is, the ability of the adversarial sample to be offensive between different models); however, since the action recognition model is more complex than the image classification model, and the video has more temporal information than the image, there is a greater decision boundary difference between different video models, which further reduces the transferability of the adversarial sample; (2) The existing attack methods for action recognition models have a serious overfitting problem. Generally speaking, the transferability of adversarial samples increases with the number of attack iterations. However, in the video field, the opposite is true. The single-step attack method is much stronger than the iterative attack method, which shows that the adversarial samples in the video field pay too much attention to the redundant information in the video and have poor generalization performance. Based on the above considerations, it is urgent to design an action recognition transfer attack method that can not only overcome the decision boundary difference problem between the source proxy model and the model to be attacked, but also alleviate the problem of overfitting the source adversarial sample to the source proxy model. Summary of the invention

[0007] The purpose of the present invention is to address the shortcomings of the prior art and provide an action recognition transfer attack method based on adaptive gradient temporal feature pruning, which can not only overcome the decision boundary difference problem between the source proxy model and the model to be attacked, but also alleviate the problem of adversarial samples overfitting the source proxy model, thereby improving the transferability of adversarial samples and evaluating the true robustness of the model to be attacked.

[0008] The action recognition transfer attack method based on adaptive gradient temporal feature pruning includes the following steps:

[0009] Step (1) construct the original positive sample set:

[0010] Obtain a video data set, use a pre-trained action recognition model, i.e., a source proxy model, to divide the samples in the data set into correctly classified samples and incorrectly classified samples, and randomly select some samples from the correct samples as the original positive sample set;

[0011] Step (2) constructs a channel mask module, the input of which is the original positive sample obtained in step (1) or the adversarial sample obtained in step (5), and the output is a weighted channel mask sample; when step (2) is executed for the first time, the input of step (2) is the original positive sample obtained in step (1); after step (5) is executed, the input of step (2) is the adversarial sample obtained in step (5);

[0012] Step (3) constructing a time series feature pruning module, wherein the time series feature pruning module is composed of a pruning module based on channel importance and a pruning module based on time series redundant channels, the input of which is the source proxy model, and the output of which is the pruning model;

[0013] Step (4) construct an adaptive gradient fusion module, the input of which is the channel mask sample, the source proxy model and the pruning model, and the output is the adaptive fusion adversarial perturbation;

[0014] Step (5) constructs an adversarial sample. The input is the adaptive fusion adversarial perturbation obtained in step (4) and the input of step (2) during this round of repetition. The output is the adversarial sample.

[0015] Step (6) Repeat steps (2) to (5) T times to obtain adversarial samples of T iterations. Finally, input the adversarial samples of T iterations into the model to be attacked to obtain the attack success rate to evaluate the robustness of the model to be attacked.

[0016] Preferably, step (1) specifically comprises the following steps:

[0017] (1-1) Each original video in the video data set is uniformly sampled into n video frames, and the single video sample after sampling is ; Among them, the three-dimensional tensor is the i-th frame image, is the field of real numbers, , , The width, height, and number of channels of the video frame respectively; Corresponding action category ;in, is the number of categories;

[0018] (1-2) Using a pre-trained source proxy model The original video is divided into correct samples and wrong samples, and some correct samples are randomly selected as original positive samples; among them, a single original positive sample is , the corresponding action category is marked as ; The correct sample is the source proxy model Correctly classified examples.

[0019] Preferably, in step (2), the construction of the channel mask module comprises the following steps:

[0020] (2-1) Construct a channel mask module to convert the original positive sample Mask any channel in the RGB three channels in the video frame, and ensure that the mask channels of adjacent video frames are different. ,in, represents the Hadamard Product, is the mask sample, Mask set ,in, is the frame-level mask of the i-th video frame, The matrix includes a mask channel matrix and a non-mask channel matrix; the mask channel matrix is ​​a two-dimensional matrix, in which all values ​​are 0; the non-mask channel matrix is ​​also a two-dimensional matrix, in which all values ​​are 1, and and , The mask channels are different;

[0021] (2-2) and Perform linear combination and add random noise to obtain weighted channel mask samples ,in, represents the standard normally distributed Gaussian noise tensor, Indicates the fusion ratio.

[0022] Preferably, in step (3), the construction of the temporal feature pruning module comprises the following steps:

[0023] (3-1) Construct a temporal feature pruning module, which consists of a pruning module based on channel importance and a pruning module based on temporal redundant channels;

[0024] (3-2) The pruning module based on channel importance is as follows: The batch normalization layer (BN) in the network is defined as:

[0025] , ,

[0026] in, and They represent the input and output of the BN layer after the convolution operation of the lth feature layer, represents the current subset, and Respectively represent the mean and variance of the current subset, and represents the trainable transformation parameters, The weight coefficient used to measure the importance of the timing channel; the source agent model The network consists of Q intermediate feature layers, each of which contains feature map, , Q and All are integers greater than 0;

[0027] (3-3) Calculation Pruning loss under norm constraint ,in Represents the total number of channels in the network, represents the weight coefficient of each channel, express Norm constraints, represents the cross entropy loss function, Represents the balance coefficient; using pruning loss , trained using the original video as described in step (1-1) to sparse Coefficient, that is, encouragement The coefficient value is 0 to achieve the purpose of sparseness, and the importance weights of different time series channels are obtained; all channels are sorted in descending order of importance, and the source proxy model is pruned The time series channels with low weight coefficients in the middle obtain the pruning model based on channel importance. ;

[0028] (3-4) Constructing a pruning module based on time-series redundant channels, including the following steps: Each intermediate feature layer in is divided into intervals, among which , Indicates a round-down operation. is the total number of intervals divided into the qth intermediate feature layer; the similarity score matrix of the feature graph in each interval is calculated based on the cosine similarity , calculate the total similarity score of each feature graph , ,in, , Indicates when The similarity score matrix of the feature graphs in the interval, represents the similarity score between the bth feature map and the jth feature map in the pth interval, Indicates The similarity scores of feature maps are calculated, and the intermediate feature maps with the highest similarity scores in each interval are pruned. H-1 pruning ratios r are set to obtain H-1 pruning models based on temporal redundant channels. ; Use the original video from step (1-1) to retrain H-1 pruning models based on temporal redundant channels Finally, we get an integrated proxy model containing H proxy models ,in, Proxy model for source , is a pruning model based on H-1 temporal redundant channels .

[0029] Preferably, the step (4) specifically comprises the following steps:

[0030] (4-1) Construct an adaptive gradient fusion module and transform the weighted channel mask samples obtained in step (2-2) Input into H proxy models and use the fast gradient symbol method to get The formula of the fast gradient symbol method is as follows:

[0031] ,

[0032] ,

[0033] in, Indicates that and the corresponding action category label Input to the hth proxy model , and then through the cross entropy loss And the back propagation algorithm gets The gradient of for In the hth surrogate model The gradient of , for In the hth surrogate model The gradient of the i-th video frame, is the step length, is the disturbance threshold, is the symbolic function, is the hth proxy model Generated adversarial examples;

[0034] (4-2) Input the adversarial sample obtained in step (4-1) into H proxy models at the same time, and obtain Loss score , ,in, is the exponential normalization function, represents the logits output of the h-th surrogate model, Indicates the true mark, Represents the cross entropy loss of the adversarial sample generated by the kth proxy model on the hth proxy model; defines the adversarial ratio ,in, Indicates the degree of adversarial sample transferability, For control Function distribution difference; use The function performs exponential normalization on the adversarial ratio to obtain the importance weights of different proxy models. , , ;in, represents the importance weight of the h-th surrogate model;

[0035] (4-3) Adaptively fuse the weights and corresponding gradients of different proxy models. ,in, , The fusion gradient The gradient of the i-th frame of the video frame; the fusion gradient Gradients are aggregated from the time dimension to obtain adaptive fusion perturbations , the time series dimension aggregation formula is as follows:

[0036] ,

[0037] in, is the fusion ratio, , Adaptive fusion perturbation The gradient of the i-th video frame.

[0038] Preferably, the step (5) specifically comprises the following steps:

[0039] Using adaptive fusion perturbations and the original positive sample Construct adversarial examples. ,in, Indicates that the sample is cut to area, Indicates the step length.

[0040] Preferably, the step (6) specifically comprises the following steps:

[0041] Repeat steps (2) to (5) T times, that is, , is the final adversarial sample, where , , , is the number of iterations, Represents the step length; the final adversarial sample The adversarial samples are input into the model to be attacked, and the final error classification rate of the adversarial samples by the model to be attacked is taken as the attack success rate. Since the adversarial samples come with original action category labels, such as the original action category label of an adversarial sample is playing baseball, the error classification rate refers to the percentage of adversarial samples classified into other action category labels by the model to be attacked to the total number of samples. For example, the adversarial sample of playing baseball is identified by the model to be attacked as the action category label of running. The higher the error classification rate, the greater the attack intensity of the adversarial sample on the model.

[0042] Preferably, in step (1-2), the source agent model The SlowFast model is used. Considering that the robustness evaluation method requires the adversarial sample to have strong generalization ability, the SlowFast model is one of the most classic action recognition models and has a strong ability to capture spatiotemporal information. In order to maintain generality, this model is selected as the source proxy model to generate adversarial samples.

[0043] Preferably, in step (2-2), the control channel mask sample and the original positive sample The fusion ratio If the fusion ratio , the fused samples change less and cannot destroy the temporal relationship of the video. If the fusion ratio , the dimensional information of the fused sample video frames is seriously lost, which reduces the transferability of the adversarial samples.

[0044] Preferably, in step (3-4), the pruning ratio r is in the range of 0.3-0.5; H=4; if the pruning ratio is too low, the difference between the pruned model and the source proxy model is small, which not only wastes the training time, but also improves the transferability of adversarial samples less than the source proxy model. If the pruning ratio is too large, the performance of the pruned model will deteriorate seriously and it cannot be used as a proxy model for adversarial samples. If the number of pruned models H is too small, the generalization performance of adversarial samples is poor, and if the number of pruned models H is large, the time cost of training the pruned model will increase. H=4 is a compromise between training time and generalization performance.

[0045] Preferably, in step (4-2), for controlling Temperature coefficient of the difference in function distribution ; If the temperature coefficient Too small, due to the nature of the exponential function, the distribution will tend to be uniform and the distribution difference cannot be reflected. If it is too large, due to the nature of the exponential function, small numerical differences will be magnified many times and the distribution differences will be too volatile.

[0046] Preferably, in step (6), the model to be attacked is a Temporal Pyramid Network (TPN). Considering that the model to be attacked needs to be general, the TPN model is also one of the most classic models in the field of action recognition. At the same time, the TPN model has a more powerful ability to capture spatiotemporal information by modeling the rhythmic laws of different actions and integrating the features of multiple branches to consider a variety of different action rhythms.

[0047] The proposed action recognition migration attack method based on adaptive gradient temporal feature pruning consists of a channel mask module, a temporal feature pruning module and an adaptive gradient fusion module. The present invention aims at the problem of poor transferability of adversarial samples under action recognition tasks and has the following advantages: 1) Through the channel mask module, the temporal relationship between video frames is destroyed to alleviate the temporal relationship of adversarial samples overfitting the source proxy model; 2) Through the temporal feature pruning module, the redundant temporal feature areas of the source proxy model with low importance are pruned to prevent adversarial samples from focusing on redundant information in the source proxy model; 3) Through the adaptive gradient fusion module, the gradient information of multiple proxy models is adaptively fused to alleviate the problem of adversarial samples overfitting the source proxy model. This provides a black-box evaluation method for the security of action recognition models for practical application scenarios such as human-computer interaction, autonomous driving, and intelligent monitoring. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the specific implementation of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the specific implementation or the prior art description. Some specific embodiments of the present invention will be described in detail in an exemplary but not restrictive manner with reference to the drawings. The same reference numerals in the drawings indicate the same or similar components or parts. Those skilled in the art should understand that these drawings are not necessarily drawn to scale. In the drawings:

[0049] Figure 1 Schematic diagram of adversarial samples;

[0050] Figure 2 It is a general framework diagram of the method used in the embodiment of the present invention;

[0051] Figure 3 Schematic diagram of an adaptive gradient fusion module used in an embodiment of the present invention;

[0052] Figure 4 Flow chart of main steps in an embodiment of the present invention. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0054] Step (1) specifically includes:

[0055] (1-1) Each original video in the video data set is uniformly sampled into n video frames, and the single video sample after sampling is ; Among them, the three-dimensional tensor is the i-th frame image, is the field of real numbers, , , The width, height, and number of channels of the video frame respectively; Corresponding action category ;in, is the number of categories;

[0056] The video data set described in step (1-1) is the UCF-101 action recognition data set, the video frame sampling is 64 frames, the width, height and number of channels of the video frame are 224, 224 and 3 respectively; the total number of categories is 101 types of actions.

[0057] (1-2) Using a pre-trained source proxy model The original video is divided into correct samples and wrong samples, and some correct samples are randomly selected as original positive samples; among them, a single original positive sample is , the corresponding action category is marked as ; The correct sample is the source proxy model Correctly classified samples;

[0058] The source proxy model described in step (1-2) is a SlowFast model, wherein the Backbone used by the source proxy model is a ResNet101 network. The source proxy model is pre-trained on the Kinetics-400 dataset and then fine-tuned on the UCF-101 dataset.

[0059] Furthermore, step (2) is specifically:

[0060] (2-1) Construct a channel mask module to convert the original positive sample Mask any channel in the RGB three channels in the video frame, and ensure that the mask channels of adjacent video frames are different. ,in, represents the Hadamard Product, is the mask sample, Mask set ,in, is the frame-level mask of the i-th video frame, The matrix includes a mask channel matrix and a non-mask channel matrix; the mask channel matrix is ​​a two-dimensional matrix, in which all values ​​are 0; the non-mask channel matrix is ​​also a two-dimensional matrix, in which all values ​​are 1, and and , The mask channels are different;

[0061] (2-2) and Perform linear combination and add random noise to obtain weighted channel mask samples ,in, represents the standard normally distributed Gaussian noise tensor, Indicates the fusion ratio.

[0062] In the steps (2-1) to (2-2), the original positive sample is passed through a random mask module to obtain a channel mask sample, which is then linearly weighted with the original positive sample and Gaussian random noise is added to finally obtain a weighted channel mask sample; the channel mask sample is used as the input of the integrated proxy model in step (4-1); the function of this module is to mask the RGB three-channel dimension of the video frame of the original positive sample, thereby destroying the long-term temporal information of the video.

[0063] Furthermore, step (3) is specifically:

[0064] (3-1) Construct a temporal feature pruning module, which consists of a pruning module based on channel importance and a pruning module based on temporal redundant channels;

[0065] (3-2) The pruning module based on channel importance is as follows: The batch normalization layer (BN) in the network is defined as:

[0066] , ,

[0067] in, and They represent the input and output of the BN layer after the convolution operation of the lth feature layer, represents the current subset, and Respectively represent the mean and variance of the current subset, and represents the trainable transformation parameters, The weight coefficient used to measure the importance of the timing channel; the source agent model The network consists of Q intermediate feature layers, each of which contains feature map, , Q and All are integers greater than 0;

[0068] (3-3) Calculation Pruning loss under norm constraint ,in Represents the total number of channels in the network, represents the weight coefficient of each channel, express Norm constraints, represents the cross entropy loss function, Represents the balance coefficient; using pruning loss , trained using the original video as described in step (1-1) to sparse Coefficient, that is, encouragement The coefficient value is 0 to achieve the purpose of sparseness, and the importance weights of different time series channels are obtained; all channels are sorted in descending order of importance, and the source proxy model is pruned The time series channels with low weight coefficients in the middle obtain the pruning model based on channel importance. ;

[0069] (3-4) Constructing a pruning module based on time-series redundant channels, including the following steps: Each intermediate feature layer in is divided into 5u intervals, among which , Indicates a round-down operation. is the total number of intervals divided into the qth intermediate feature layer; the similarity score matrix of the feature graph in each interval is calculated based on the cosine similarity , calculate the total similarity score of each feature graph , ,in, , Indicates when The similarity score matrix of the feature graphs in the interval, represents the similarity score between the bth feature map and the jth feature map in the pth interval, Indicates The similarity scores of feature maps are calculated, and the intermediate feature maps with the highest similarity scores in each interval are pruned. H-1 pruning ratios r are set to obtain H-1 pruning models based on temporal redundant channels. ;

[0070] Use the original video from step (1-1) to retrain H-1 pruning models based on temporal redundant channels Finally, we get an integrated proxy model containing H proxy models ,in, Proxy model for source , is a pruning model based on H-1 temporal redundant channels .

[0071] The temporal feature pruning in steps (3-1) to (3-4) includes two steps: first, the source proxy model is passed through a pruning module based on channel importance, and then the source proxy model is pruned using The source proxy model is pruned by using the characteristic of the norm that makes the channel scaling factor sparse; then, through the pruning module based on redundant timing channels, the redundant timing channels are pruned by utilizing the similarity between timing channels; finally, multiple pruned models are obtained by setting different pruning ratios; different from the traditional pruning method that gives the same importance weight to all channels, the proposed timing feature pruning method not only removes redundant timing channels but also retains the characteristics of important channels; since the pruning ratio can be set multiple times, an integrated proxy model is finally obtained. Different from the traditional integrated learning that uses multiple source proxy models with completely different structures, the timing feature pruning method only utilizes the knowledge of a single source proxy model to construct a diversified integrated proxy model, which not only overcomes the problem of poor generalization of adversarial perturbations of the single source proxy model, but also avoids the problem of traditional integrated learning that requires multiple different proxy models.

[0072] Furthermore, step (4) is specifically:

[0073] (4-1) Construct an adaptive gradient fusion module and transform the weighted channel mask samples obtained in step (2-2) Input into H proxy models and use the fast gradient symbol method to get The formula of the fast gradient symbol method is as follows:

[0074] ,

[0075] ,

[0076] in, Indicates that and the corresponding action category label Input to the hth proxy model , and then through the cross entropy loss And the back propagation algorithm gets The gradient of for In the hth surrogate model The gradient of , for In the hth surrogate model The gradient of the i-th video frame, is the step length, is the disturbance threshold, is the symbolic function, is the hth proxy model Generated adversarial examples;

[0077] (4-2) Input the adversarial sample obtained in step (4-1) into H proxy models at the same time, and obtain Loss score , ,in, is the exponential normalization function, represents the logits output of the h-th surrogate model, Indicates the true mark, Represents the cross entropy loss of the adversarial sample generated by the kth proxy model on the hth proxy model; defines the adversarial ratio ,in, Indicates the degree of adversarial sample transferability, For control Function distribution difference; use The function performs exponential normalization on the adversarial ratio to obtain the importance weights of different proxy models. , , ;in, represents the importance weight of the h-th surrogate model;

[0078] (4-3) Adaptively fuse the weights and corresponding gradients of different proxy models. ,in, , The fusion gradient The gradient of the i-th frame of the video frame; the fusion gradient Gradients are aggregated from the time dimension to obtain adaptive fusion perturbations , the time series dimension aggregation formula is as follows:

[0079] ,

[0080] in, is the fusion ratio, , Adaptive fusion perturbation The gradient of the i-th video frame.

[0081] The steps (4-1) to (4-3) are as follows: Figure 3 As shown in the figure, the role of this module is to fully consider the contribution of different proxy models to adversarial attacks, adaptively fuse the gradient information of all proxy models, and aggregate gradients from the time dimension, thereby alleviating the problem of adversarial samples overfitting the source proxy model; unlike the traditional ensemble learning method that equally fuses the gradient information of all proxy models, the adaptive gradient fusion module assigns the importance weights of different proxy models through an adaptive method, thereby improving the transferability of adversarial samples.

[0082] Furthermore, step (5) is specifically:

[0083] (5) Using adaptive fusion perturbations and the original positive sample Construct adversarial examples. ,in, Indicates that the sample is cut to area, Indicates the step length.

[0084] Going further, step (6) is specifically:

[0085] (6) Repeat steps (2) to (5) T times, that is , is the final adversarial sample, where , , , is the number of iterations, Represents the step length; the final adversarial sample The adversarial samples are input into the model to be attacked, and the final error classification rate of the adversarial samples by the model to be attacked is taken as the attack success rate. Since the adversarial samples come with original action category labels, such as the original action category label of an adversarial sample is playing baseball, the error classification rate refers to the percentage of adversarial samples classified into other action category labels by the model to be attacked to the total number of samples. For example, the adversarial sample of playing baseball is identified by the model to be attacked as the action category label of running. The higher the error classification rate, the greater the attack intensity of the adversarial sample on the model.

[0086] The present invention proposes an action recognition transfer attack method based on adaptive gradient temporal feature pruning, which has the following characteristics: 1) utilizing masked video frame channels to linearly weight the original positive samples, increase the diversity of input samples, and weaken the temporal relationship between video frames; 2) through the temporal feature pruning module, pruning the redundant feature channels in the source proxy model from the perspective of temporal redundant features and channel importance; 3) through the adaptive gradient fusion module, adaptively assigning importance weights to different proxy models according to their contribution to the adversarial attack.

[0087] like Figure 2 , an action recognition migration attack method based on adaptive gradient temporal feature pruning, first samples a given video frame sequence, randomly selects some samples correctly classified by the source proxy model as original positive samples, inputs the original positive samples into the channel mask module, and fuses the obtained samples with the original positive samples and random Gaussian noise to obtain channel mask samples; then, through the temporal feature pruning method, The norm constraint makes the linear coefficients of the batch normalization layer of the source proxy model sparse, and at the same time calculates the similarity between the feature layers of the source proxy model, prunes the feature channels with low linear coefficients and high temporal redundancy, and then fine-tunes the pruned model to obtain multiple pruned models with different pruning ratios. Finally, the source proxy model and multiple pruned models are integrated to obtain an integrated proxy model; then, the integrated model and the channel mask sample are passed through the adaptive gradient fusion module to obtain the adaptive fused adversarial perturbation; then the adaptive adversarial perturbation and the original positive sample are used to obtain the adversarial sample using the iterative fast gradient sign method; finally, the adversarial sample is input into the model to be attacked (such as the temporal pyramid network) to test the attack success rate. This method uses the channel mask module to destroy the temporal correlation between video frames and increase the diversity of input samples. Then, the temporal feature pruning method is used to remove the redundant temporal feature channels of the source proxy model to prevent the adversarial sample from over-focusing on the redundant feature information of the source proxy model, and the gradient information of multiple proxy models is adaptively fused according to the contribution of different proxy models to the adversarial attack through the adaptive gradient fusion module to improve the transferability of adversarial samples.

[0088] The contents described in this embodiment are merely an enumeration of implementation forms of the inventive concept. The protection scope of the present invention should not be regarded as limited to the specific forms described in the examples. The protection scope of the present invention also extends to equivalent technical means that can be conceived by those skilled in the art based on the inventive concept.

Claims

1. The action recognition migration attack method based on adaptive gradient temporal feature pruning is characterized by: The following steps are involved: Step (1) construct the original positive sample set: Obtain a video data set, use a pre-trained action recognition model, i.e., a source proxy model, to divide the samples in the data set into correctly classified samples and incorrectly classified samples, and randomly select some samples from the correct samples as the original positive sample set; Step (2) constructs a channel mask module, the input of which is the original positive sample obtained in step (1) or the adversarial sample obtained in step (5), and the output is a weighted channel mask sample; when step (2) is executed for the first time, the input of step (2) is the original positive sample obtained in step (1); after step (5) is executed, the input of step (2) is the adversarial sample obtained in step (5); Step (3) constructing a time series feature pruning module, wherein the time series feature pruning module is composed of a pruning module based on channel importance and a pruning module based on time series redundant channels, the input of which is the source proxy model, and the output of which is the pruning model; Step (4) construct an adaptive gradient fusion module, the input of which is the channel mask sample, the source proxy model and the pruning model, and the output is the adaptive fusion adversarial perturbation; Step (5) constructs an adversarial sample, the input is the adaptive fusion adversarial perturbation obtained in step (4) and the input of step (2) during this round of repetition, and the output is the adversarial sample; Step (6) repeat steps (2) to (5) T times to obtain adversarial samples iterated T times, and finally input the adversarial samples iterated T times into the model to be attacked to obtain the attack success rate to evaluate the robustness of the model to be attacked; Step (1) specifically includes the following steps: (1-1) Each original video in the video data set is uniformly sampled into n video frames, and the single video sample after sampling is Among them, the three-dimensional tensor X i is the i-th frame image, is a real number domain, w, h, c are the width, height, and number of channels of the video frame respectively; Corresponding action category Among them, K is the number of categories; (1-2) Using the pre-trained source agent model f source The original video is divided into correct samples and wrong samples, and some correct samples are randomly selected as original positive samples; among them, a single original positive sample is The corresponding action category is marked as The correct sample is the one that is captured by the source proxy model f source Correctly classified samples; In step (2), the construction of the channel mask module comprises the following steps: (2-1) Construct a channel mask module to convert the original positive sample Mask any channel in the RGB three channels in the video frame, and ensure that the mask channels of adjacent video frames are different. Among them, ⊙ represents the Hadamard product, is a mask sample, M is a mask set M = {m i ∈{0, 1} w×h×c |i=1,2,…,n},where m i is the frame-level mask of the i-th video frame, m i The matrix includes a mask channel matrix and a non-mask channel matrix; the mask channel matrix is ​​a two-dimensional matrix, in which all values ​​are 0; the non-mask channel matrix is ​​also a two-dimensional matrix, in which all values ​​are 1, and m i With m i-1 、m i+1 The mask channels are different; (2-2) and Perform linear combination and add random noise to obtain weighted channel mask samples in, represents the standard normal distribution Gaussian noise tensor, 0<η<1 represents the fusion ratio; In step (3), the construction of the temporal feature pruning includes the following steps: (3-1) Construct a temporal feature pruning module, which consists of a pruning module based on channel importance and a pruning module based on temporal redundant channels; (3-2) The pruning module based on channel importance is as follows: soutce The batch normalization layer in the network is defined as in, and They represent the input and output of the BN layer after the convolution operation of the lth feature layer, represents the current subset, and Represent the mean and variance of the current subset, γ>0 and represents a trainable transformation parameter, γ is a weight coefficient used to measure the importance of the temporal channel; the source agent model f source The network consists of Q intermediate feature layers, each of which contains N q feature maps, q = 1, 2, ..., Q, Q and N q All are integers greater than 0; (3-3) Calculation Pruning loss under norm constraint Where Γ represents the total number of channels in the network, γ represents the weight coefficient of each channel, and ||·||1 represents Norm constraint, L represents the cross entropy loss function, λ=0.05 represents the balance coefficient; using pruning loss L pruning , use the original video described in step (1-1) for training to sparse the γ coefficient, that is, encourage the γ coefficient value to be 0 to achieve the purpose of sparseness, and obtain the importance weights of different temporal channels; sort all channels in descending order of importance, and prune the source proxy model f source The time series channel with low weight coefficient is used to obtain the pruning model f′ based on channel importance. pruning ; (3-4) Constructing a pruning module based on a timing redundant channel, including the following steps: pruning Each intermediate feature layer in is divided into P q intervals, among which Indicates the rounding down operation, P q is the total number of intervals divided by the qth intermediate feature layer; the similarity score matrix S of the feature graph in each interval is calculated based on the cosine similarity p , calculate the total similarity score of each feature graph Where p = 1, 2, ..., P q , Represents the similarity score matrix of the feature graph in the pth interval, represents the similarity score between the bth feature map and the jth feature map in the pth interval, T 3×(p-1)+b Represents the similarity score of the 3×(p-1)+bth feature map, prunes the intermediate feature map with the highest similarity score in each interval, sets H-1 pruning ratios r, and obtains H-1 pruning models f″ based on temporal redundant channels pruning ; Use the original video from step (1-1) to retrain H-1 pruning models based on temporal redundant channels f″ pruning Finally, we get the integrated proxy model F containing H proxy models 1:H ={f h |h=2,3,…,H}, where f1 is the source proxy model f source , F 2:H ={f h |h=2,3,…,H} is H-1 pruning models based on temporal redundant channels f″ pruning ; The step (4) specifically comprises the following steps: (4-1) Construct an adaptive gradient fusion module and transform the weighted channel mask samples obtained in step (2-2) Input into H proxy models and use the fast gradient symbol method to get The formula of the fast gradient symbol method is as follows: in, Indicates that and the corresponding action category label y clean Input to the hth proxy model f h , and then through the cross entropy loss And the back propagation algorithm gets The gradient of G h for In the hth surrogate model f h The gradient of g h,i for In the hth surrogate model f h The gradient of the i-th video frame, α = ε / 10 is the step size, ε = 16 / 255 is the perturbation threshold, sign(·) is the sign function, is the hth proxy model f h Generated adversarial examples; (4-2) Input the adversarial sample obtained in step (4-1) into H proxy models at the same time to obtain H×H loss scores Among them, softmax(·) is an exponential normalization function, represents the logits output of the h-th surrogate model, represents the true mark, score h,k Represents the cross entropy loss of the adversarial sample generated by the kth proxy model on the hth proxy model; defines the adversarial ratio Among them, ρ h represents the degree of adversarial sample transferability, 1<τ<20 is used to control the distribution difference of the softmax(·) function; the softmax(·) function is used to perform exponential normalization on the adversarial ratio to obtain the importance weights of different proxy models, w1,...,w H =softmax(ρ1, ..., ρ H ), w h ∈[0,1]; where w h represents the importance weight of the h-th surrogate model; (4-3) Adaptively fuse the weights and corresponding gradients of different proxy models. in, is the fusion gradient G fusion The gradient of the i-th frame of the video frame; the fusion gradient G fusion Gradients are aggregated from the time dimension to obtain the adaptive fusion perturbation G adv , the time series dimension aggregation formula is as follows: Among them, μ>0 is the fusion ratio, is the adaptive fusion perturbation G adv The gradient of the i-th video frame.

2. The method for action recognition migration attack based on adaptive gradient temporal feature pruning according to claim 1, characterized in that: The step (5) specifically includes the following steps: using the adaptive fusion perturbation G adv and the original positive sample Construct adversarial examples. in, Indicates that the sample is cut to area, α=ε / 10 represents the step size.

3. The method for action recognition migration attack based on adaptive gradient temporal feature pruning according to claim 1, characterized in that: The step (6) specifically comprises the following steps: Repeat steps (2) to (5) T times, that is, is the final adversarial sample, where t = 1, 2, ..., T, T = 10 is the number of iterations, α = ε / T is the step size; the final adversarial sample The input is sent to the model to be attacked, and the final misclassification rate of the adversarial samples by the model to be attacked is used as the attack success rate to evaluate the robustness of the model to be attacked.

4. The method for action recognition migration attack based on adaptive gradient temporal feature pruning according to claim 1, characterized in that: In step (1-2), the source agent model f source It is the SlowFast model.

5. The method for action recognition migration attack based on adaptive gradient temporal feature pruning according to claim 1, characterized in that: In step (2-2), the mask sample used to control the channel and the original positive sample The fusion ratio η=0.

3.

6. The method for action recognition migration attack based on adaptive gradient temporal feature pruning according to claim 1, characterized in that: In step (3-4), the pruning ratio r is in the range of 0.3-0.5; and H=4.

7. The method for action recognition migration attack based on adaptive gradient temporal feature pruning according to claim 1, characterized in that: In step (4-2), the temperature coefficient τ used to control the distribution difference of the softmax(·) function is 5.

8. The method for action recognition migration attack based on adaptive gradient temporal feature pruning according to claim 1, characterized in that: In the step (6), the model to be attacked is a temporal pyramid network.