Human behavior recognition method, device, electronic device and storage medium
Through the combination of convolutional neural network and optical flow feature calculation layer, adaptive aggregation and guidance of attention mechanism, the accuracy problem of human behavior recognition in complex scenes in the existing technology is solved, and more efficient and real-time human behavior is achieved. Identify.
Patent Information
- Application Number
- CN202011256262.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-11
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2040-11-11
AI Technical Summary
Existing human behavior recognition methods have inaccurate recognition results when objects move quickly, are blocked, or have blurred imaging. Moreover, it is difficult to effectively capture the dynamic information of behavior based on deep learning methods. The calculation complexity is high, the storage space is large, and it is difficult to achieve real-time processing. .
The convolutional neural network is used to extract the apparent features of video RGB frames, and the optical flow feature calculation layer is iteratively optimized to adaptively aggregate multi-frame optical flow features, guide the apparent features through attention maps, and integrate optical flow features and motion information enhancement features. , is passed into the classification fusion layer for prediction, and the model parameters are iteratively updated through the cross-entropy loss function.
It improves the accuracy and robustness of human behavior recognition, reduces the calculation amount of optical flow feature extraction, ensures real-time recognition, and can more effectively handle behavior recognition in complex scenes.
Smart Images

Figure CN112418032B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision, and in particular to a method, device, electronic equipment and storage medium for human behavior recognition. Background Art
[0002] Human behavior recognition is a technology that identifies and analyzes human behavior by analyzing video and other data. It is widely used in intelligent monitoring, human-computer interaction, behavior warning, medical health and other fields.
[0003] At present, the public behavior recognition methods can be divided into two categories: methods based on manually designed features and methods based on deep learning. Methods based on manually designed features often use template matching to convert the motion image sequence into one or a group of static templates, and obtain the recognition result by matching the template of the sample to be recognized with the known template. Its main methods include: motion energy image (MEI) and motion history image (MHI), mean motion shape (MMS) based on contours, and mean motion energy (AME) based on motion foreground. Methods based on deep learning generally extract the behavior appearance features of each frame through a convolutional neural network, and then fuse multiple frames of information to obtain the recognition result. For example, based on a two-stream convolutional neural network, the static branch is used to extract the behavior appearance features from the RGB video frame, and the dynamic branch is used to extract dynamic information from the video optical flow frame. Then, the behavior predictions of the two branches are fused to obtain the classification result. For example, the convolutional neural network is cascaded with the long short-term memory network to form a recurrent convolution structure. At each step, the convolutional neural network extracts the features of each frame and then sends them to the long short-term memory network to model the temporal dynamic information of the behavior. For example, methods based on 3D convolutional neural networks directly use 3D convolution kernels to perform convolution operations along the spatiotemporal dimensions of the video to obtain spatiotemporal information of the behavior. For example, SMART Block proposed by ARTNet extracts the apparent features of the behavior based on 2D convolution operations, and extracts the temporal features of the behavior based on 3D convolution operations to obtain the spatiotemporal information of the behavior.
[0004] Generally, hand-designed feature algorithms are greatly affected by complex backgrounds and work well on limited types, restricted scenes, and small-scale data sets, but cannot process large-scale real-world scene data sets. At the same time, hand-designed features have high computational complexity, which is not conducive to real-time processing. Deep learning methods are difficult to effectively capture the dynamic information of behavior, and cannot use effective methods to guide convolutional neural networks to extract areas related to behavior. At the same time, extracting the features of the corresponding optical flow images requires a large storage space and is difficult to obtain.
[0005] Among the most similar existing technologies that have been disclosed, "Representation Flow for Action Recognition" proposed by Piergiovanni A and Ryoo MS uses a neural network to extract the convolutional layer features of RGB frames, iteratively optimizes the behavior features to obtain optical flow features, and inputs the optical flow features into a classifier for classification to identify human behavior. This can solve the above problems to a certain extent. However, when the dynamic features are complex due to rapid movement, occlusion, blur, etc., the accuracy of the recognition results of this method will be greatly reduced. Summary of the invention
[0006] In view of this, the embodiments of the present invention provide a human behavior recognition method, device, electronic device and storage medium to solve the problem that the existing recognition methods have inaccurate recognition results when the object moves quickly, is blocked or the image is blurred.
[0007] In a first aspect of an embodiment of the present invention, a method for identifying human behavior is provided, comprising:
[0008] After obtaining the human behavior dataset, the convolutional neural network is used to extract features from the video RGB frames, and the features of the last convolutional layer are used as the apparent features of human behavior.
[0009] Iteratively optimizing the apparent characteristics of human behavior based on the optical flow feature calculation layer to obtain optical flow features containing dynamic information of human short-term behavior;
[0010] After adaptively aggregating the continuous multi-frame optical flow features, the optical flow features are fused with the appearance features, and the appearance features are guided based on the attention map to obtain the appearance features enhanced with motion information;
[0011] The motion information enhanced appearance features and optical flow features are passed into the classification fusion layer, and the prediction scores of the classifiers are fused to obtain the behavior prediction results;
[0012] According to the behavior prediction results and behavior categories, the loss is calculated through the cross entropy loss function, the loss is back-propagated, and the network parameters are iteratively updated until the human behavior recognition model converges, so as to perform behavior recognition based on the converged human behavior recognition model.
[0013] In a second aspect of an embodiment of the present invention, a human behavior recognition device is provided, comprising:
[0014] The extraction module is used to obtain the human behavior data set, extract features from the video RGB frames through a convolutional neural network, and use the features of the last convolutional layer as the apparent features of the human behavior;
[0015] An optimization module, used for iteratively optimizing the apparent characteristics of human behavior based on the optical flow feature calculation layer to obtain optical flow features containing dynamic information of human short-term behavior;
[0016] The fusion module is used to adaptively aggregate the continuous multi-frame optical flow features, fuse the optical flow features with the appearance features, and guide the appearance features based on the attention map to obtain the appearance features with enhanced motion information;
[0017] The classification module is used to pass the apparent features enhanced by motion information and the optical flow features into the classification fusion layer, and fuse the prediction scores of the classifiers to obtain the behavior prediction results;
[0018] The updating module is used to calculate the loss through the cross entropy loss function according to the behavior prediction results and behavior categories, perform error backpropagation on the loss, and iteratively update the network parameters until the human behavior recognition model converges, so as to perform behavior recognition based on the converged human behavior recognition model.
[0019] In a third aspect of an embodiment of the present invention, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the first aspect of the embodiment of the present invention when executing the computer program.
[0020] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method provided in the first aspect of the embodiment of the present invention are implemented.
[0021] In the embodiment of the present invention, a convolutional neural network is used to extract the features of the last convolution layer of the video RGB frame to obtain the behavior appearance features, the behavior appearance features are iteratively optimized based on the optical flow feature calculation layer to obtain the optical flow features, after the multi-frame optical flow features are adaptively aggregated, the optical flow features are fused with the appearance features, and the appearance features are guided based on the attention map to obtain the motion information enhanced appearance features, the motion information enhanced appearance features and the optical flow features are passed to the classification fusion layer, and the prediction scores of the classifiers are fused to obtain the behavior prediction results, the loss is calculated based on the prediction results, and the model is iteratively updated to obtain the converged human behavior recognition model. Fusion of multi-frame optical flow features and enhancement of appearance features based on the attention mechanism can solve the problem of inaccurate behavior recognition results caused by rapid movement, occlusion or blur of objects, improve the accuracy of human behavior recognition, and have stronger robustness. Based on the fusion of optical flow features and appearance feature classification scores, the amount of calculation required for the optical flow feature extraction process is reduced, and the real-time performance of human behavior recognition is guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1 A schematic diagram of a flow chart of a human behavior recognition method provided by an embodiment of the present invention;
[0024] Figure 2 A schematic diagram comparing the calculation results of optical flow features of the same behavior at different movement speeds provided by an embodiment of the present invention;
[0025] Figure 3 A schematic diagram of the principle of fusing appearance features with optical flow features provided by one embodiment of the present invention;
[0026] Figure 4 A schematic diagram of the principle of building a human behavior recognition model provided by an embodiment of the present invention;
[0027] Figure 5 A schematic diagram of the structure of a human behavior recognition device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. The principles and features of the present invention are described below in conjunction with the drawings. The embodiments are only used to explain the present invention and are not used to limit the scope of the present invention.
[0029] The terms "including" and other expressions with similar meanings in the specification or claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions, such as a process, method or system, or device comprising a series of steps or units is not limited to the listed steps or units.
[0030] It is understandable that the present invention obtains a converged human behavior recognition model by training the convolutional neural network, and performs behavior recognition based on the human behavior recognition model. Traditional convolutional neural network training, because optical flow feature extraction requires huge computing power and storage space, is difficult to meet real-time requirements in the actual recognition process, and is easily affected by object movement speed, occlusion, etc., and has low accuracy.
[0031] In one embodiment of the present application, a 34-layer residual convolutional neural network is used, which consists of the following parts:
[0032] The first part is the input layer, which has three channels, representing the three components of RGB (Red, Green, Blue). The three components are normalized using different standard deviations and variances.
[0033] The second, third, fourth, and fifth parts are all composed of different numbers of residual convolution blocks (Building blocks), of which the second part contains 3 residual convolution blocks, the third part contains 4 residual convolution blocks, the fourth part contains 6 residual convolution blocks, and the fifth part contains 3 residual convolution blocks. The four parts are cascaded to process the output of the first part in turn to extract the apparent features of the behavior.
[0034] Each residual convolution block consists of a convolution layer, an activation function layer, and a convolution layer equivalent mapping. The specific calculation formula is:
[0035]
[0036] Where ReLU is a nonlinear activation function ReLU(x) = max(x,0), x l-1 and x l are the input and output of the lth convolutional residual block, respectively. and They represent the convolution kernel parameters of the lth convolution residual block respectively. The input image is processed by the convolution kernel to learn the apparent characteristics of the behavior.
[0037] The sixth part is the optical flow feature calculation layer, which uses a specific convolution kernel to process each feature map, obtains the gradient and divergence of each feature map, and iteratively optimizes the optical flow field.
[0038] The seventh part is the feature fusion layer, which processes the optical flow features into an attention map, and then enhances the apparent features of the behavior to obtain the apparent features enhanced with running information.
[0039] The eighth part is the classification fusion layer, which includes an appearance feature classifier and a dynamic feature classifier. A specific number of output neurons are set, and each neuron represents a specific type of behavior. After the prediction scores of the two classifiers are fused, the position of the maximum neuron value is used as the behavior category predicted by the behavior recognition network.
[0040] Based on the above convolutional neural network structure, training it to obtain a recognition model can improve the recognition ability of the model and make it more robust. At the same time, it can reduce the requirements for calculation and storage space.
[0041] See also Figure 1 , Figure 1 A flow chart of a human behavior recognition method provided by an embodiment of the present invention includes:
[0042] S101, after obtaining the human behavior data set, extract features from the video RGB frames through a convolutional neural network, and use the features of the last convolutional layer as the apparent features of the human behavior;
[0043] Obtain the human behavior video dataset used by researchers, use the convolutional neural network to extract the features of the last convolution layer of the video RGB frame, and obtain the behavioral appearance features.
[0044] Before sending the video frames into the convolutional neural network, the sample data of the human behavior video data set are preprocessed, and then the sample data are normalized. The normalized sample video data are passed into the convolutional neural network, and the features of the last convolutional layer are extracted as the apparent features of the behavior.
[0045] For example, two video behavior datasets, HMDB51 and UCF101, are used. HMDB51 contains 6766 samples distributed in 51 different categories. UCF101 contains 101 different categories and 13320 video clips.
[0046] The normalization method used in this embodiment is standard deviation normalization, and its formula is:
[0047]
[0048] Where input channel Represents the components of different channels of different input video RGB frames, mean channel Indicates the mean of RGB channels, std channel Represents the variance of RGB channels, output channel Represents the values of different RGB channel components after standard deviation standardization, where channel can be R, G or B.
[0049] A 2D convolutional neural network is used to extract the feature vector of each frame of the behavior video. Specifically, the parameters of each layer of the 2D convolutional neural network are initialized using the pre-trained ResNet-34. The 2D convolutional neural network is used to extract features of all samples in the dataset. The features of the last convolutional layer are extracted as the behavior appearance features to obtain the feature sequence F = [F1, F2, ..., F N ],F n Represents the apparent features of the nth frame of the video, and N represents the total number of frames contained in a video.
[0050] Furthermore, multiple consecutive video frames are processed through two-dimensional convolution operations to learn the apparent characteristics of the behavior layer by layer. The calculation formula of the two-dimensional convolution operation is:
[0051]
[0052] In the formula, w mn represents the weight at the convolution kernel (m, n), F l Represents the feature map of the lth layer. When l is 1, it represents the input image. l+1 Represents the output of the three-dimensional convolution layer, the feature map of the l+1th layer, M and N represent the width and height of the convolution kernel, and x and y represent the position of the pixel in the feature map.
[0053] S102, iteratively optimizing the apparent characteristics of human behavior based on the optical flow feature calculation layer to obtain optical flow features containing dynamic information of human short-term behavior;
[0054] In the optical flow feature calculation layer, a specific convolution kernel is used to process each feature map to obtain the gradient and divergence of each feature map, and the optical flow field is iteratively optimized. Using the convolution calculation in the convolutional neural network to replace the calculation method of the gradient and divergence in the traditional optical flow calculation algorithm TV-L1 can greatly reduce the amount of calculation.
[0055] The appearance features of two consecutive video frames (F n , F n+1 ) is input to the optical flow feature calculation layer to obtain the gradients in the x and y directions, represented as u∈R 2×W×H ,W and H represent the width and height of the feature map respectively.
[0056] Initialize the optical flow field u and the bivector field to 0, and update the optical flow field u through iterative optimization:
[0057]
[0058]
[0059] u=v+θ·div(p);
[0060]
[0061] In the formula, ρ represents the motion residual between the displacement features of two frames, It is the constant part of the motion residual ρ between the displacement features of two frames, θ controls the weight of the TV-L1 regularization term, λ controls the smoothness of the output, τ controls the time step, and div(p) represents the calculation of ρ divergence. The formula is as follows:
[0062] div(p)=p x *ωx +p y *ω y ;
[0063] p x and p y denote the x and y directions respectively, ω x =[-1 1],
[0064] symbol Indicates the reciprocal. and Respectively represent the partial derivatives in the x and y directions;
[0065]
[0066]
[0067] After an iterative optimization process, the optical flow feature vector containing the behavior dynamic information can be obtained.
[0068] S103, after adaptively aggregating the continuous multi-frame optical flow features, the optical flow features are fused with the appearance features, and the appearance features are guided based on the attention map to obtain the appearance features with enhanced motion information;
[0069] In some video frames, the optical flow feature extraction results may be unreliable due to the subject being out of focus, fast movement, occlusion, etc. The optical flow feature maps of adjacent frames can be weighted and aggregated through the attention mechanism to reduce the impact of video data out of focus, fast movement, occlusion, etc. Figure 2 As shown in the figure, a schematic diagram comparing the calculation results of optical flow features for different motion speeds of archery behavior. In the interval of slow-moving behavior, the result of optical flow feature calculation cannot locate objects with significant motion, resulting in the inability to use motion information to enhance the apparent features. Therefore, the present invention processes the current frame by weighted aggregation of optical flow feature maps of adjacent frames to obtain a significant motion attention map.
[0070] Specifically, the optical flow feature map of adjacent frames is weighted and aggregated based on the attention mechanism, and its calculation formula is:
[0071]
[0072] in, Represents the optical flow feature map after weighted aggregation, ω j→i represents the weight of the j-th frame optical flow feature aggregation to the i-th frame feature, F j represents the optical flow feature of the jth frame, i and j are counting variables, and K represents the number of weighted aggregated adjacent frames, such as K = 16;
[0073] The activation function ReLU(x)=max(0,x) is used to perform nonlinear mapping on the result of weighted aggregation of features to obtain an attention map, which is then multiplied pixel by pixel with the apparent features to obtain the apparent features enhanced with motion information.
[0074] In one embodiment, Figure 3 As shown in the figure, the actual calculation process is implemented using a 1×1 convolution operation. Then the activation function ReLU is used to perform nonlinear mapping on the result of feature weighted aggregation to obtain the attention map of the jth frame:
[0075]
[0076] Finally, the attention map is multiplied pixel by pixel with the apparent features to obtain the motion information enhanced apparent features.
[0077]
[0078] in Represents a pixel-by-pixel multiplication operation.
[0079] S104, passing the motion information enhanced appearance features and the optical flow features into the classification fusion layer, and fusing the prediction scores of the classifiers to obtain the behavior prediction results;
[0080] The classification fusion layer includes an appearance feature classifier and a dynamic feature classifier, and is provided with a predetermined number of output neurons, each neuron represents a specific type of behavior, and after the prediction scores of the two classifiers are fused, the position where the maximum neuron value is located is used as the category of behavior prediction.
[0081] The complementary advantages of the two features are captured by two classifiers, making the training model more robust.
[0082] S105. According to the behavior prediction results and behavior categories, the loss is calculated through the cross entropy loss function, the loss is back-propagated, and the network parameters are iteratively updated until the human behavior recognition model converges, so as to perform behavior recognition based on the converged human behavior recognition model.
[0083] Among them, the cross entropy loss function is:
[0084]
[0085] Among them, y i represents the probability of predicting the i-th category, Represents the label of the i-th category.
[0086] Figure 4 A schematic diagram of the principle of fusing the apparent features of human behavior and the optical flow features is shown, and a human behavior recognition model is constructed based on the extraction of the apparent features and the optical flow features.
[0087] In one embodiment, the behavior recognition based on the converged human behavior recognition model is specifically:
[0088] Get a video image to be recognized, standardize the pixel values of the three RGB channels of each frame of the video, and preprocess it;
[0089] Use the trained 2D convolutional neural network to extract the features of the last convolution layer for each video RGB frame to obtain the apparent features of the behavior;
[0090] Inputting the appearance features of all the frames into an optical flow feature calculation module to obtain optical flow features containing short-term behavior dynamic information;
[0091] The apparent features and dynamic features of the behavior are input into the feature fusion layer of the human behavior recognition model to obtain the apparent features enhanced by motion information.
[0092] The motion information enhanced appearance features and optical flow features are input into the classification layer of the human behavior recognition model, and are classified by a classifier to obtain prediction scores of the two features. Finally, the two prediction scores are fused to obtain the behavior classification result of the video image.
[0093] Through the method provided in this embodiment, the behavior is temporally and spatially modeled from two aspects: the apparent characteristics of the behavior and the dynamic characteristics of the behavior. At the same time, the optical flow feature aggregation layer and the feature fusion layer are introduced, so as to eliminate the interference of the behavior subject's out-of-focus, rapid movement, occlusion and other problems, improve the timing modeling capability, and obtain robust behavior spatiotemporal characteristics.
[0094] It should be understood that the serial numbers of the steps in the above embodiments do not imply a sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0095] Figure 5 A schematic diagram of a human behavior recognition method device provided by an embodiment of the present invention, the device comprising:
[0096] The extraction module 510 is used to extract features from the video RGB frames through a convolutional neural network after acquiring the human behavior data set, and use the features of the last convolutional layer as the apparent features of the human behavior;
[0097] Optionally, the human behavior data set is preprocessed, the sample data is normalized, and the normalized sample data is transmitted to the convolutional neural network.
[0098] An optimization module 520, configured to iteratively optimize the human behavior appearance characteristics based on the optical flow feature calculation layer to obtain optical flow features containing dynamic information of human short-term behavior;
[0099] In the optical flow feature calculation layer, a specific convolution kernel is used to process each feature map to obtain the gradient and divergence of each feature map, and the optical flow field is iteratively optimized.
[0100] A fusion module 530 is used to adaptively aggregate the continuous multi-frame optical flow features, fuse the optical flow features with the appearance features, and guide the appearance features based on the attention map to obtain the appearance features with enhanced motion information;
[0101] Specifically, based on the attention mechanism, the optical flow feature maps of adjacent frames are weighted and aggregated, and the calculation formula is:
[0102]
[0103] in, Represents the optical flow feature map after weighted aggregation, ω j→i represents the weight of the j-th frame optical flow feature aggregation to the i-th frame feature, F j represents the optical flow feature of the jth frame, i and j represent counting variables, and K represents the number of weighted aggregated adjacent frames, such as K = 16;
[0104] The activation function ReLU(x)=max(0,x) is used to perform nonlinear mapping on the result of weighted aggregation of features to obtain an attention map, which is then multiplied pixel by pixel with the apparent features to obtain the apparent features enhanced with motion information.
[0105] The classification module 540 is used to pass the motion information enhanced appearance features and the optical flow features to the classification fusion layer, and fuse the prediction scores of the classifiers to obtain the behavior prediction results;
[0106] The classification fusion layer includes an appearance feature classifier and a dynamic feature classifier, and is provided with a predetermined number of output neurons, each neuron represents a specific type of behavior, and after the prediction scores of the two classifiers are fused, the position where the maximum neuron value is located is used as the category of behavior prediction.
[0107] The updating module 550 is used to calculate the loss through the cross entropy loss function according to the behavior prediction results and the behavior category, perform error back propagation on the loss, and iteratively update the network parameters until the human behavior recognition model converges, so as to perform behavior recognition based on the converged human behavior recognition model.
[0108] It can be understood that, in one embodiment, the electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, it implements the establishment of a human behavior recognition model and recognizes human behavior.
[0109] A person skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. When the program is executed, it includes steps S101 to S105. The storage medium includes, for example, ROM / RAM, a disk, an optical disk, etc.
[0110] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0111] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A human behavior recognition method, characterized in that: include: After obtaining the human behavior dataset, the convolutional neural network is used to extract features from the video RGB frames, and the features of the last convolutional layer are used as the apparent features of human behavior. Iteratively optimizing the apparent characteristics of human behavior based on the optical flow feature calculation layer to obtain optical flow features containing dynamic information of human short-term behavior; After adaptively aggregating the continuous multi-frame optical flow features, the optical flow features are fused with the appearance features, and the appearance features are guided based on the attention map to obtain the appearance features enhanced with motion information; The method of guiding the apparent features based on the attention map to obtain the apparent features with enhanced motion information includes: Based on the attention mechanism, the optical flow feature map of adjacent frames is weighted and aggregated. The calculation formula is: in, Represents the optical flow feature map after weighted aggregation, ω j→i represents the weight of the j-th frame optical flow feature aggregation to the i-th frame feature, F j represents the optical flow feature of the jth frame, i and j represent counting variables, and K represents the number of weighted aggregated adjacent frames; The activation function ReLU(x)=max(0,x) is used to perform nonlinear mapping on the result of weighted aggregation of features to obtain an attention map, and the attention map is multiplied pixel by pixel with the apparent features to obtain the apparent features enhanced by motion information; The motion information enhanced appearance features and optical flow features are passed into the classification fusion layer, and the prediction scores of the classifiers are fused to obtain the behavior prediction results; According to the behavior prediction results and behavior categories, the loss is calculated through the cross entropy loss function, the loss is back-propagated, and the network parameters are iteratively updated until the human behavior recognition model converges, so as to perform behavior recognition based on the converged human behavior recognition model.
2. The method according to claim 1, characterized in that: The obtaining of the human behavior data set further comprises: The human behavior dataset is preprocessed, the sample data is normalized, and the normalized sample data is transmitted to the convolutional neural network.
3. The method according to claim 1, characterized in that In the optical flow feature calculation layer, a specific convolution kernel is used to process each feature map to obtain the gradient and divergence of each feature map, and the optical flow field is iteratively optimized based on the gradient and divergence of the feature map.
4. The method according to claim 1, characterized in that: The classification fusion layer includes an appearance feature classifier and a dynamic feature classifier, and is provided with a predetermined number of output neurons, each neuron represents a specific behavior type, and after the prediction scores of the two classifiers are fused, the position where the maximum neuron value is located is used as the category of behavior prediction.
5. A human behavior recognition device, characterized in that: include: The extraction module is used to obtain the human behavior data set, extract features from the video RGB frames through a convolutional neural network, and use the features of the last convolutional layer as the apparent features of the human behavior; An optimization module, used for iteratively optimizing the apparent characteristics of human behavior based on the optical flow feature calculation layer to obtain optical flow features containing dynamic information of human short-term behavior; The fusion module is used to adaptively aggregate the continuous multi-frame optical flow features, fuse the optical flow features with the appearance features, and guide the appearance features based on the attention map to obtain the appearance features with enhanced motion information; The method of guiding the apparent features based on the attention map to obtain the apparent features with enhanced motion information includes: Based on the attention mechanism, the optical flow feature map of adjacent frames is weighted and aggregated. The calculation formula is: in, Represents the optical flow feature map after weighted aggregation, ω j→i represents the weight of the j-th frame optical flow feature aggregation to the i-th frame feature, F j represents the optical flow feature of the jth frame, i and j represent counting variables, and K represents the number of weighted aggregated adjacent frames; The activation function ReLU(x)=max(0,x) is used to perform nonlinear mapping on the result of weighted aggregation of features to obtain an attention map, and the attention map is multiplied pixel by pixel with the apparent features to obtain the apparent features enhanced by motion information; The classification module is used to pass the apparent features enhanced by motion information and the optical flow features into the classification fusion layer, and fuse the prediction scores of the classifiers to obtain the behavior prediction results; The updating module is used to calculate the loss through the cross entropy loss function according to the behavior prediction results and behavior categories, perform error backpropagation on the loss, and iteratively update the network parameters until the human behavior recognition model converges, so as to perform behavior recognition based on the converged human behavior recognition model.
6. The device according to claim 5, characterized in that: The classification fusion layer includes an appearance feature classifier and a dynamic feature classifier, and is provided with a predetermined number of output neurons, each neuron represents a specific behavior type, and after the prediction scores of the two classifiers are fused, the position where the maximum neuron value is located is used as the category of behavior prediction.
7. An electronic device comprising a processor, a memory, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the human behavior recognition method as described in any one of claims 1 to 4 are implemented.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the human behavior recognition method as claimed in any one of claims 1 to 4 are implemented.
