A skeletal action recognition method based on learnable PL-GCN and ECLSTM
By using learnable graph convolutional networks and ECLSTM networks in skeletal action recognition, optimizing the graph structure and capturing temporal features solves the problems of low accuracy and high computational cost in similar action recognition, and achieves more efficient action recognition and feature extraction. .
Patent Information
- Application Number
- CN202210050116.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-17
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-01-17
AI Technical Summary
Existing skeletal action recognition methods have low accuracy when identifying similar actions, are difficult to capture the connections between skeletal joint points, have long training times, high computational costs, and poor model generalization capabilities.
Using a learnable graph convolutional network (PL-GCN) and feature capture-enhanced ECLSTM network, the graph structure of human actions is optimized by constructing a graph topology structure and a self-learning P matrix, and the ECLSTM network is used to capture temporal features and fuse space and timing. Features for action recognition.
It improves the accuracy of similar action recognition, reduces training time and computing costs, enhances the flexibility and generalization capabilities of the model, and can capture action features and key frame information more accurately.
Smart Images

Figure CN114529984B
Abstract
Description
Technical Field
[0001] The invention belongs to the field of action recognition, and in particular to a skeleton action recognition method. Background Art
[0002] In recent years, skeleton-based human action recognition has developed rapidly in the fields of video surveillance, human-computer interaction, and virtual reality, and has attracted widespread attention in the field of computer vision. Skeleton data is a topological representation of human joints and bones. Compared with many RGB and optical flow-based methods, it has the advantages of low computational complexity, strong robustness in the face of complex backgrounds, and no changes with body scale, viewing angle, and movement speed. With the emergence of Microsoft's Kinect depth camera and some excellent posture estimation algorithms, more and more researchers have begun to work on skeleton-based action recognition.
[0003] Early skeletal action recognition usually encodes all body joint positions in each frame into feature vectors or pseudo images for pattern learning, and then feeds the image into RNN or CNN networks to generate prediction results. However, encoding skeleton data into feature vectors or 2D grids cannot fully express the dependencies between related joints, because these models generally ignore the rich action information between joints and are difficult to apply to any form of skeleton. With the further enrichment and improvement of graph convolutional neural network theory, Yan et al. took the lead in applying graph convolutional neural networks to human action recognition tasks, and constructed a spatiotemporal graph convolutional network (ST-GCN) to automatically learn the spatial and temporal information of skeleton data in an end-to-end data-driven manner. Lei Shi et al. introduced a two-stream network and adaptive convolution module to greatly improve the recognition rate of the model. Maosen et al. captured more detailed action features by introducing an encoding-decoding structure and a network of future posture prediction heads. These methods have achieved satisfactory recognition results. However, these action recognition methods cannot well consider the local and global information of the human body completing a specific action, and it is difficult to obtain the connection between any bone vertices between different actions. The model generalization ability is poor, especially when recognizing similar actions, the accuracy needs to be further improved. In addition, in actual use, these models take a long time to train, have high computational costs, and contain a large amount of redundant information that is not conducive to practical operation.
[0004] Therefore, based on the existing skeletal action recognition method, the present invention constructs a learnable graph convolutional network PL-GCN and an ECLSTM network with enhanced feature capture, which can automatically learn the graph structure of different actions and integrate spatial features and temporal features at the same time, effectively improving the model's problems such as easy confusion in recognizing similar actions and weak key frame capture ability. The final trained model shows good recognition effect on multiple test sets.
[0005] The existing human action recognition method based on the skeleton graph convolution network divides the human skeleton joints into three categories according to the distance from each joint to the center of gravity in the field: source point, near center point and far center point, and then performs graph convolution operation based on this fixed division structure, which has achieved satisfactory results. However, this fixed division based on the physical structure of the skeleton often performs unsatisfactory when recognizing certain specific actions, especially for similar actions, such as "drinking water" and "touching the head".
[0006] After searching, the application publication number CN112507940A, a skeletal motion recognition method based on a differential guided representation learning network, the steps are as follows: obtain a skeletal motion sequence; calculate the differential value of the skeletal motion sequence to obtain a differential sequence; input the differential sequence into a differential information module, and obtain a differential feature representation by a long short-term memory network; input the skeletal motion sequence and the differential feature representation into the original information module, use the differential feature representation to guide the representation learning of the skeletal motion sequence, and obtain the original sequence feature representation; splice the differential feature representation and the original sequence feature representation, extract multi-scale features by a multi-scale convolutional neural network, and use the maximum pooling operation to obtain a pooled representation; input the pooled representation into a fully connected layer for classification. The present invention uses a long short-term memory network to model the differential information of the skeletal motion sequence to guide the representation learning of the skeletal motion sequence, and uses a multi-scale convolutional neural network to extract the multi-scale features of the skeletal motion sequence, thereby improving the accuracy of skeletal motion recognition.
[0007] The above method is based on the skeletal action recognition method of the differential guided representation learning network. It uses the long short-term memory network to learn the differential information of the skeletal action sequence, inputs the skeletal action sequence and the differential feature representation into the original information module together, and uses the differential feature representation to guide the representation learning of the skeletal action sequence. Although the above method can capture the temporal characteristics of the network by using the long-term memory function of the LSTM network, it does not take into account the importance of different image frames containing action information. In view of this, this patent proposes a feature-enhanced ECLSTM network that can capture key frames with significant action features, thereby efficiently extracting temporal features. In addition, the above method directly inputs the skeletal data into the original information module, and cannot completely extract the spatial features of the skeletal joints, because the features of the joints are closely related to the features of other joints in the neighborhood, and the connection graph between the skeletal joints is a graph topology structure. Therefore, this patent considers using a graph convolutional network to extract the spatial features of the skeletal sequence. Summary of the invention
[0008] The present invention aims to solve the above problems of the prior art. A skeletal action recognition method based on learnable PL-GCN and ECLSTM is proposed. The technical solution of the present invention is as follows:
[0009] A skeletal action recognition method based on learnable PL-GCN and ECLSTM includes the following steps:
[0010] Step 1: Obtain human skeleton sequence data based on the OpenPose pose estimation algorithm and annotate corresponding sample labels;
[0011] Step 2: Model the skeletal joint data into a graph topology structure to complete the construction of graph convolution;
[0012] Step 3: Based on the grouping of the adjacency matrix A of the original ST-GCN graph topology structure, a graph convolutional network PL-GCN with self-learning ability is constructed to optimize the graph structure of human body movements;
[0013] Step 4: Construct a feature-enhanced long short-term memory network ECLSTM to capture temporal features;
[0014] Step 5: Fusion of spatial features extracted from the PL-GCN graph convolutional network and temporal features captured by the ECLSTM network;
[0015] Step 6: Use the action features fused by pooling and convolutional networks to make the final classification prediction;
[0016] Step 7: Construct a two-stream framework consisting of a spatial feature extraction network composed of 9 layers of self-learning graph convolution modules and a temporal feature extraction network composed of 3 ECLSTM modules; the input skeletal joint data is first forward propagated along the neural network model, and the final features are pooled and convolved to give the action category score. The category with the highest score is the predicted category; then the parameters of each network layer are derived through the loss function and back-propagated along the gradient until the loss function value is minimized to obtain the optimal weight parameters.
[0017] Furthermore, the step 1 obtains human skeleton sequence data based on the OpenPose posture estimation algorithm and performs corresponding sample labeling, specifically including:
[0018] Step 1.1: Use the OpenPose posture estimation algorithm to complete the human posture estimation from the bottom up and obtain the data of 18 joints of the human skeleton. Each joint point is represented by (X, Y, Confidence); X and Y represent the coordinate position of the joint point in the 2D image, and Confidence represents the confidence of each joint point estimation. The specific steps are: After setting up the OpenPose algorithm environment, call the sample video or picture processed by OpenPose.exe in the command prompt window to get a set of .json files containing the coordinates of the 25 joint positions of the human body. This file can be used as the subsequent bone sequence data input. If it is a video, it will contain 30*T joint coordinate data, where T is the length of the video (in seconds), and the frame rate of the sample video is set to 30.
[0019] Step 1.2: The skeleton sequence is represented by the 2D or 3D coordinates of the human skeleton joints in each frame. Each 2D or 3D coordinate is represented as a vector. A complete video action sequence is represented as a vector sequence between different frames.
[0020] Step 1.3: Label the video samples according to the action content in the video to facilitate subsequent model training and prediction.
[0021] Furthermore, the step 2 models the skeletal joint point data into a graph topology structure to complete the construction of the graph convolution, which specifically includes:
[0022] Step 2.1: Represent the skeletal joints as graph vertices, represent the edges between the corresponding vertices of two adjacent frames of the space-time graph as time edges, complete the construction of the space-time graph, and use the space-time graph to model the time and space dimensions of the human skeleton joints;
[0023] Step 2.2: Construct an undirected graph G t = {V t , E t} represents a sequence with N joints and T skeleton frames, where V t is a set of N joint points, E t is a collection of bone edges, node v ti The neighbor set of ti )={v tj |d(v ti , v tj )≤D}, where d(v ti , v tj ) is from v ti to v tj The shortest path, here represents the neighborhood distance of 1;
[0024] Step 2.3: Design a mapping function l:Vt →{1, 2, ..., K}, for each graph vertex v ti ∈V t Assign labels {1, 2, ..., K} to node v ti The neighbor set N(v ti ) is divided into a fixed number of K subsets; in addition, the edge set E t It consists of two subsets. The first subset E S = {v ti v tj |(i, j)∈H} represents the connection within each frame skeleton, where H represents the set of naturally connected human joints, and the second subset E F = {v ti v (t+1)i} represents the edges between consecutive frames, and E of a specific joint i F All the edges in represent their trajectories over time;
[0025] Step 2.4: Perform spatial graph convolution on the skeletal joint data to extract features.
[0026] Furthermore, the step 2.4: performing a spatial graph convolution feature extraction operation on the skeletal joint point data is specifically as follows:
[0027]
[0028] Among them, f out (v ti ) represents the output of the graph convolution at joint point i, f in represents the input feature map, Z ti (v tj ) represents the relationship between the i-th joint and the sampling interval B(v ti ) is the relative distance of other joints in the same space, ⊙ represents the dot product operation between vector elements or matrices; the sampling function p(v ti , v tj )=v tj , where v ti ∈B(v ti ), B(v ti )= {v ti |d(v tj , v ti )≤D} is the sampling interval, where d(v tj , v ti ) is the joint v ti , v tj The minimum distance between them; mapping relationship l ti :B(v ti )→{0,…,K-1}, the new weight function can be expressed as w(v ti , vtj )= w′(l ti (v tj )).
[0029] Furthermore, step 3 constructs a graph convolutional network PL-GCN with self-learning ability based on the original adjacency matrix A grouping to optimize the graph structure of human body movements. The specific contents are as follows:
[0030] Graph convolution output after adding the learnable P matrix:
[0031]
[0032] Here A k and P k have the same dimensions, the matrix P k The value of is initialized to 0, the matrix A k Determines whether there is a connection between two vertices; W k and M k These are learnable parameters, used to implement convolution operations and learn the importance of each edge respectively;
[0033] The added learnable P matrix can adaptively learn and update the matrix parameters through a channel feedback method, thereby compensating the matrix A k Corresponding to the missing relationship in , a cross entropy loss function is defined as:
[0034] L=J(W,x,class)=W*(-x[class]+log(∑ j exp(x[j]))) (3)
[0035] Where J represents the name of the defined loss function, W represents the weight matrix, x represents the output vector of the network, class represents the true label of the action category, and x[j] represents the value of the j-th dimension of the output vector.
[0036] If the learnable P matrix is added, the channel feedback output is:
[0037] H=f out (x, θ)(A k +P k (x,θ))*W(x,α) (4)
[0038] Where P k (x, θ) represents the self-learning matrix of the kth layer, α represents the parameters in the weight matrix W, and θ represents the self-learning matrix P k The parameters in (x, θ).
[0039] The gradient filter is updated during back propagation by the following operations:
[0040]
[0041] Among them, f out (x, θ) is the output feature of graph convolution, and W(x, α) is the feature weighting matrix in step 3.3;
[0042] The spatial graph convolution module extracts the joint point features in each frame through a similar information aggregation effect. The specific operations of feature propagation between layers are as follows:
[0043]
[0044] in, is an undirected graph G t The adjacency matrix A and the identity matrix I representing the connection between the joint points themselves N The weighted result is represents the degree of joint point i, Represents the value of the i-th row and j-th column of the adjacency matrix after considering its own connection.
[0045] And W (l) is a trainable weight matrix; σ(·) represents the activation function, represents the hidden layer matrix of the lth layer, N and D represent the number of rows and columns of the hidden layer H, and the initial H (0) =X, where X is a node feature vector X i The matrix representation of .
[0046] Furthermore, in order to speed up the convergence of the model, a BN layer, a RELU layer, and a dropout layer are set between each graph convolution module to normalize the data after the BatchNorm layer:
[0047]
[0048]
[0049]
[0050] Among them, u j represents the mean, represents the variance, Represents the normalized data, ∈ represents a very small number to avoid the denominator being 0, m represents the number of samples in a batch, and the data after the ReLu layer is activated:
[0051]
[0052] When the output value x>0, the output is performed, and when x≤0, the output value is changed to 0; finally, the output of the spatial convolution module is subjected to a dropout=0.5 operation to avoid overfitting of the network.
[0053] Furthermore, the step 4 constructs a feature-enhanced long short-term memory network ECLSTM to capture time series features, and the specific contents are as follows:
[0054] Step 4.1: Use the output h of the previous moment t-1 and the current output h t The autocorrelation matrix between them completes the output h at the current moment t The weighting of , thereby capturing the temporal feature information of the video action samples;
[0055] Step 4.2: Use the sigmoid neural layer to control the output h of the previous moment t-1 and the current input x t The concat(h t-1 , x t ) passed or partially passed, the operation is as follows:
[0056] f t =σ(W f ·[h t-1 , x t ]+b f ) (11)
[0057] The next step is to decide how much new information to add to the ECLSTM network. A sigmoid layer is used to determine which information needs to be updated, and a tanh layer is used to generate vectors, which are the alternative content for updating. Use the formula to combine these two parts to complete the update of the network status:
[0058] i t =σ(W i ·[h t-1 , x t ]+b i ) (12)
[0059]
[0060] b f 、b i 、b c Respectively represent the bias of the sigmoid layer, the bias of the sigmoid layer, and the bias of the tanh layer. Then use the state i t and We multiply the weights and filter out some information we don’t want to keep to get the new content we added. The specific operations are:
[0061]
[0062] In order to get the final output, first pass the sigmoid layer to get an initial output:
[0063] o t =σ(W o [h t-1 , x t ]+b o ) (15)
[0064] b o represents the bias of the sigmoid layer, and then the tanh layer is used to scale the Ct value to between -1 and 1. The preliminary output of the model is obtained by the following operations:
[0065] h t =o t *tanh(C t ) (16)
[0066] Furthermore, an autocorrelation coefficient matrix is used to enhance the time series features. Specifically, the output h of the previous moment is used t-1 =[x 1 , x 2 …x n ] and the current output h′ t =[y 1 ,y 2 …y n ] Perform dot multiplication to obtain the autocorrelation matrix Finally, use the current output and h′ t The final output is weighted:
[0067]
[0068] , where h t That is, the output feature at the current moment after the time series feature enhancement;
[0069] After the temporal features are enhanced by the ECLSTM network features, the captured video key frame information is aggregated through a fully connected layer to prepare for the next step of fusion of spatial joint features and time series features.
[0070] Furthermore, step 5 combines the spatial features extracted from the PL-GCN graph convolutional network and the temporal features captured by the ECLSTM network, specifically including:
[0071] Step 5.1: The spatial features after convolution output from the spatial graph convolution module and the temporal features enhanced by the ECLSTM network features are fused by concat to obtain the fused spatiotemporal features of the video action samples. The fused spatiotemporal features are the features after flexible modeling of skeletal joints and key frame capture, but at this time, the features need to be further classified to complete the prediction of the action category.
[0072] Furthermore, the step 6: using the action features after pooling and convolutional network fusion to perform final classification prediction specifically includes:
[0073] Step 6.1: Perform average pooling on the fused features, compress the features, and simplify the network;
[0074] Step 6.2: A convolutional neural network is used to complete the final action recognition classification prediction. The features after average pooling in step 6.1 are convolved by 1×1 to divide them into numclass action categories, which are all the action categories in the dataset. Each action category is scored, and the category with the highest score is the predicted action category.
[0075] The advantages and beneficial effects of the present invention are as follows:
[0076] In this patent, a skeletal action recognition method based on a learnable graph convolutional network and temporal feature enhancement is proposed. Considering that some existing skeletal action recognition methods are mainly based on fixed human physical structure modeling, the model flexibility is poor, the video key frame information is not accurately captured, especially when recognizing certain specific actions, the relationship between local information and global information and specific body joints cannot be considered. This patent proposes a learnable P matrix algorithm to compensate for the matrix A k The missing connections between the joints in the middle are improved, thereby improving the flexibility of the model and increasing the recognition rate of similar actions. In addition, in order to capture the key frame information in the video action samples, this patent proposes an ECLSTM network that can capture and enhance the temporal feature information during the motion process, so that the model can more easily recognize the corresponding actions. Experimental results show that under the same conditions, the method proposed in this patent is superior to some current methods in terms of action recognition progress, algorithm complexity and feature extraction capabilities.
[0077] The following are the innovative points of this patent (including formulas):
[0078] This patent proposes a learnable P matrix algorithm.
[0079] H=f oui (x, θ)(A k +P k(x, θ))*W(x, α)
[0080]
[0081] Since the original ST-GCN uses a fixed grouping strategy to divide the joint points in the neighborhood into source points, near points, and far points, this grouping method based on the fixed physical structure of the human body lacks flexibility in identifying certain specific tasks. Therefore, in order to improve this fixed grouping structure, this paper considers adding a self-learning P matrix compensation matrix A k The missing connection between the joints is improved through adaptive learning in a channel feedback manner, thereby improving the flexibility of the model and improving the model's ability to recognize similar actions. In addition, in order to capture the key frame information of the action sample, this patent proposes a feature-enhanced ECLSTM network, in which an autocorrelation coefficient matrix is used to enhance the time series features, using the output h of the previous moment t-1 =[x 1 , x 2 …x n ] and the current output h′ t =[y 1 ,y 2 …y n ] Perform dot multiplication to obtain the autocorrelation matrix Finally, use the current output and h′ t The final output is weighted:
[0082]
[0083] , where h t That is, the output features at the current moment after the temporal features are enhanced; the introduction of the ECLSTM network enables the model to accurately locate the key frame information and capture and enhance the temporal feature information during the motion process. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] Figure 1 The present invention provides a preferred embodiment model overall structure diagram;
[0085] Figure 2 This is the EC-LSTM network structure diagram. DETAILED DESCRIPTION
[0086] The following will describe the technical solutions in the embodiments of the present invention in detail in conjunction with the accompanying drawings in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention.
[0087] The technical solution of the present invention to solve the above technical problems is:
[0088] This patent proposes a spatiotemporal graph convolution skeleton action recognition method with learning ability. The overall framework of the model is shown in the figure Figure 1 shown.
[0089] First, in order to fully obtain the spatial and temporal features of action video samples, the present invention adopts a dual-stream network framework and proposes a graph convolutional network with self-learning ability to extract the spatial feature relationship between skeletal joints. In order to fully extract the features, it is considered to stack 9 layers of learnable graph convolutional network modules, thereby improving the physical structure of the model and improving the recognition rate of similar actions. Secondly, the present invention proposes an ECLSTM network to enhance the temporal feature capture capability of the model, stacks 3 layers of ECLSTM network, and uses the fully connected layer FC to connect the features captured by the ECLSTM network. Finally, the fused spatial and temporal features are pooled and convoluted for feature classification. The final model obtained through training is applied to simple real-life scenarios to realize the application of action recognition technology in daily life. The overall structure diagram of the model is shown in the figure. Figure 1 As shown, the following steps are included:
[0090] Step 1: Obtain human skeleton sequence data based on the OpenPose pose estimation algorithm and annotate corresponding sample labels.
[0091] Step 2: Model the skeletal joint data into a graph topology structure to complete the construction of the graph convolution.
[0092] Step 3: Based on the original adjacency matrix A grouping, a graph convolutional network (PL-GCN) with self-learning ability is constructed to optimize the graph structure of human body movements.
[0093] Step 4: Construct a feature-enhanced long short-term memory network (ECLSTM) to capture temporal features.
[0094] Step 5: Fusion of spatial features extracted from the PL-GCN graph convolutional network and temporal features captured by the ECLSTM network.
[0095] Step 6: Use the action features fused by pooling and convolutional networks to make the final classification prediction.
[0096] Step 7: Construct a dual-stream framework consisting of a spatial feature extraction network composed of 9 layers of self-learning graph convolution modules and a temporal feature extraction network composed of 3 ECLSTM modules. The input skeletal joint data is first forward propagated along the neural network model, and the final features are pooled and convolved to give the action category score. The category with the highest score is the predicted category. Then, the parameters of each network layer are derived through the loss function and back-propagated along the gradient until the loss function value is minimized to obtain the optimal weight parameter.
[0097] Further, step 1 specifically includes:
[0098] Step 1.1: The OpenPose posture estimation algorithm is used to complete the human posture estimation from bottom to top and obtain the data of 18 joint points of the human skeleton. Usually each joint point can be expressed as (X, Y, Confidence).
[0099] Step 1.2: The skeleton sequence is usually represented by the 2D or 3D coordinates of the human skeleton joint points in each frame. Each 2D or 3D coordinate can be represented as a vector, so a complete video action sequence can be represented as a vector sequence between different frames.
[0100] Step 1.3: Label the video samples according to the action content in the video to facilitate subsequent model training and prediction.
[0101] Further, step 2 specifically includes:
[0102] Step 2.1: Represent the skeletal joints as graph vertices, represent the edges between the corresponding vertices of two adjacent frames of the spatiotemporal graph as time edges, and complete the construction of the spatiotemporal graph. The spatiotemporal graph is used to model the temporal and spatial dimensions of the human skeleton joints.
[0103] Step 2.2: Construct an undirected graph G t = {V t , E t} represents a sequence of N joints and T frames of bones, where V t is a set of N joint points, E t is a collection of bone edges, node v ti The neighbor set of ti )={v tj |d(v ti , v tj )≤D}, where d(v ti , v tj ) is from v ti to v tj The shortest path of , here means 1 neighborhood distance.
[0104] Step 2.3: Design a mapping function l:V t →{1, 2, ..., K}, for each graph vertex v ti ∈V t Assign labels {1, 2, ..., K} to node v ti The neighbor set N(v ti ) is divided into a fixed number of K subsets. In addition, the edge set E t It consists of two subsets. The first subset ES = {v ti v tj |(i, j)∈H} represents the connection within each frame skeleton, where H represents the set of naturally connected human joints, and the second subset E F = {v ti v (t+1)i} represents the edges between consecutive frames, and E of a specific joint i F All the edges in represent their trajectories over time.
[0105] Step 2.4: The specific operation of performing spatial graph convolution on the bone joint data to extract features is:
[0106]
[0107] Among them, Z ti (vt j ) represents the relationship between the i-th joint and the sampling interval B(v ti ) represents the relative distance of other joints in the same space, and ⊙ represents the dot product operation between vector elements or matrices. The sampling function p(v ti , v tj )=v tj , where v ti ∈B(v ti ), B(v ti )={v ti |d(v tj , v ti )≤D} is the sampling interval, where d(v tj , v ti ) is the joint v ti , vt j The minimum distance between them. Mapping relationship l ti :B(v ti )→{0,…,K-1}, the new weight function can be expressed as w(v ti , v tj )=w′(l ti (v tj )).
[0108] Further described step 3 specific content:
[0109] Step 3.1: Since the graph convolutional neural network now constructs a fixed adjacency relationship A k Represents the original joint point structure. If A k A value in k[i][j] is 0, then no matter how the subsequent graph convolutional network learns, it is impossible to capture the action connection between the corresponding joints. For this reason, this patent proposes to construct a learnable P matrix algorithm that can adaptively learn in a channel feedback manner for the action type to be recognized, thereby improving the recognition rate of certain specific actions, thereby improving the flexibility and generalization ability of the model.
[0110] Step 3.3: Graph convolution output after adding the learnable P matrix:
[0111]
[0112] , here A k and P k have the same dimensions, the matrix P k The value of is initialized to 0, the matrix A k Determines whether there is a connection between two vertices, but cannot recreate the connection between two physically unconnected vertices. The matrix P k The introduction of W enables the model to relearn the connection between any two vertices, enhancing the generalization ability of the model. k and M k These are learnable parameters, which are used to implement convolution operations and learn the importance of each edge.
[0113] Step 3.4: The added learnable P matrix can adaptively learn and update the matrix parameters through a channel feedback method, so as to compensate the matrix A k The corresponding missing relationship in the image is used to improve the recognition rate of specific actions. The present invention defines a cross entropy loss function as:
[0114] L=J(W,x,class)=W*(-x[class]+log(∑ j exp(x[j]))) (3)
[0115] If the learnable P matrix is added, the channel feedback output is:
[0116] H=f out (x, θ)(A k +P k (x,θ))*W(x,α) (4)
[0117] The gradient filter is updated during back propagation by the following operations:
[0118]
[0119] Among them, f out(x, θ) is the output feature of the graph convolution, and W(x, α) is the feature weighting matrix in step 3.3. Through the above operations, the adaptive learning update of the parameters in the learnable P matrix can be completed, thereby improving the structure of the model, such as Figure 1 As shown in the figure, the structure diagram of the graph convolutional network with self-learning ability.
[0120] Step 3.5: The spatial graph convolution module can extract the joint point features in each frame through a similar information aggregation effect. The specific operation of feature propagation between layers is:
[0121]
[0122] in, is an undirected graph G t The adjacency matrix A and the identity matrix I representing the connection between the joint points themselves N The weighted result is And W (l) is a trainable weight matrix. σ(·) represents the activation function, represents the hidden layer matrix of the lth layer, and the initial H (0) =X, where X is a node feature vector X i The matrix representation of .
[0123] Step 3.6: In order to speed up the convergence of the model, a BN layer, a RELU layer and a dropout layer are set between each graph convolution module. Normalize the data after the BatchNorm layer:
[0124]
[0125]
[0126]
[0127] Among them, u j represents the mean, represents the variance, represents the normalized data, and ∈ is to prevent the variance from being 0 and causing invalid calculations. At the same time, in order to make the network sparse and reduce the interdependence of parameters, the data passing through the ReLu layer is activated:
[0128]
[0129] When the output value x>0, the output is performed, and when x≤0, the output value is changed to 0; finally, the output of the spatial convolution module is subjected to a dropout=0.5 operation to avoid overfitting of the network.
[0130] The specific contents of step 4 are as follows:
[0131] Step 4.1: The present invention constructs an ECLSTM network for temporal information enhancement, such as Figure 2 As shown, using the output h of the previous moment t-1 and the current output h t The autocorrelation matrix between them completes the output h at the current moment t , thereby capturing the temporal feature information of video action samples.
[0132] Step 4.2: First, ECLSTM decides which video frames to let pass through the forget gate and uses the sigmoid neural layer to control the output h of the previous moment. t-1 and the current input x t The concat(h t-1 , x t ) passed or partially passed, the operation is as follows:
[0133] f t =σ(W f ·[h t-1 , x t ]+b f ) (11)
[0134] The next step is to decide how much new information to add to the ECLSTM network. A sigmoid layer is needed to decide which information needs to be updated, and a tanh layer is needed to generate vectors, which are the alternative content for updating. Use the formula to combine these two parts to complete the update of the network status:
[0135] i t =σ(W i ·[h t-1 , x t ]+b i ) (12)
[0136]
[0137] Then use the state i t and We multiply the weights and filter out some information we don’t want to keep to get the new content we added. The specific operations are:
[0138]
[0139] In order to get the final output, we first pass the sigmoid layer to get an initial output:
[0140] o t=σ(W o [h t-1 , x t ]+b o ) (15)
[0141] , and then use the tanh layer to transform C t The values are scaled to between -1 and 1, and the initial output of the model is obtained by the following operations:
[0142] h′ t =o t *tanh(C t ) (16)
[0143] In order to further enhance the model's ability to capture time series features, this paper uses an autocorrelation coefficient matrix to enhance the time series features. Specifically, it uses the output h of the previous moment t-1 =[x 1 , x 2 …x n ] and the current output h′ t =[y 1 ,y 2 …y n ] Perform dot multiplication to obtain the autocorrelation matrix Finally, use the current output and h′ t The final output is weighted:
[0144]
[0145] , where h t That is, the output feature at the current moment after the time series feature enhancement.
[0146] Step 4.3: After the temporal features are enhanced by the ECLSTM network features, the captured video key frame information is aggregated through a fully connected layer (FC layer) to prepare for the next step of fusion of spatial joint point features and time series features.
[0147] The specific contents of step 5 are as follows:
[0148] Step 5.1: The spatial features after convolution output from the spatial graph convolution module and the temporal features enhanced by the ECLSTM network features are fused by concat to obtain the fused spatiotemporal features of the video action samples. The fused spatiotemporal features are the features after flexible modeling of skeletal joints and key frame capture, but at this time, the features need to be further classified to complete the prediction of the action category.
[0149] The specific contents of step 6 are as follows:
[0150] Step 6.1: Since the fused feature information has a lot of redundancy and contains too many parameters, in order to reduce the final classification calculation cost, it is necessary to first average pool the fused features, compress the features, simplify the network complexity and calculation amount, and speed up the calculation speed to prevent overfitting.
[0151] Step 6.2: In order to complete the final action recognition classification prediction, a convolutional neural network is used here. The features after average pooling in step 6.1 are convolved by 1×1, and divided into numclass action categories (that is, all action categories in the dataset), and each action category is scored. The category with the highest score is also the predicted action category.
[0152] In this patent, we propose a skeletal action recognition method based on a learnable graph convolutional network and temporal feature enhancement. Considering that some existing skeletal action recognition methods are mainly based on fixed human physical structures for modeling, the model flexibility is poor, the video key frame information is not accurately captured, especially when recognizing certain specific actions, the relationship between local information and global information and specific body joints cannot be considered. This patent proposes a learnable P matrix to compensate for the matrix A. k The missing connections between the joints in the middle are improved, thereby improving the flexibility of the model and increasing the recognition rate of similar actions. In addition, in order to capture the key frame information in the video action samples, this patent proposes an ECLSTM network that can capture and enhance the temporal feature information during the motion process, so that the model can more easily recognize the corresponding actions. Experimental results show that under the same conditions, the method proposed in this patent is superior to some current methods in terms of action recognition progress, algorithm complexity and feature extraction capabilities.
[0153] In order to verify the actual effect of the skeleton action recognition method based on learnable graph convolutional network and temporal feature enhancement proposed in this patent in action recognition tasks, we conducted a large number of experiments using the public dataset NTU-RGB-D under the Pytorch deep learning framework. The experiments were divided into two groups, one group was trained and tested under the cross view standard, and the other group was conducted under the cross subject standard. In the experiment, a single graphics card 2080TiGPU was used to accelerate data training, the cross entropy function was selected as the loss function of gradient backward propagation, and the stochastic gradient descent optimizer with Nesterov momentum of 0.9 was used to optimize the parameters, the weight decay was set to 0.0001, and the basic learning rate was set to 0.1. Under the NTU-RGB-D dataset, each skeleton data sample sent to the network for training has 300 frames, and each frame has 18 joint points. The data coordinates of the joint points can be represented by a tuple (X, Y, Confidence) with 3 channels. Assuming that the batchsize of the training process is 256, the input size of the training data sent to the model is (256, 3, 300, 18). In order to obtain the optimal network model, the epoch is set to 60 during the experiment. We choose to divide the learning rate by 10 at the 20th, 30th, 40th, and 50th epochs respectively to optimize learning. The entire training process ends at the 60th epoch.
[0154] When training the network, the training data is input into the graph convolution network based on the learnable P matrix and the ECLSTM network enhanced with temporal features for forward propagation to extract features. After fusion, it is passed through the pooled convolution network to obtain the classification probability of each action category, and then the network parameters are adjusted by back propagation based on the cross entropy loss function. After the training, the final network model is used to test the test set samples, and the action category with the largest classification probability is selected as the model prediction category. The predicted category and the actual label result are compared. If the results are consistent, it means that the classification is correct, otherwise, it means that the classification is wrong. The final network model is used to test under two standards. The experimental results show that the recognition rate reaches 91.2% under the cross view standard and 84.5% under the cross subject standard, respectively. The recognition results exceed some current popular methods, as shown in Table 1 below.
[0155] Table 1 Comparison between the present invention and other methods
[0156]
[0157] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0158] The above embodiments should be understood to be only used to illustrate the present invention and not to limit the protection scope of the present invention. After reading the contents of the present invention, technicians can make various changes or modifications to the present invention, and these equivalent changes and modifications also fall within the scope defined by the claims of the present invention.
Claims
1. A skeletal action recognition method based on learnable PL-GCN and ECLSTM, characterized in that: The following steps are involved: Step 1: Obtain human skeleton sequence data based on the OpenPose pose estimation algorithm and annotate corresponding sample labels; Step 2: Model the skeletal joint data into a graph topology structure to complete the construction of graph convolution; Step 3: Based on the grouping of the adjacency matrix A of the original ST-GCN graph topology structure, a graph convolutional network PL-GCN with self-learning ability is constructed to optimize the graph structure of human body movements; Step 4: Construct a feature-enhanced long short-term memory network ECLSTM to capture temporal features; Step 5: Fusion of spatial features extracted from the PL-GCN graph convolutional network and temporal features captured by the ECLSTM network; Step 6: Use the action features fused by pooling and convolutional networks to make the final classification prediction; Step 7: Construct a two-stream framework consisting of a spatial feature extraction network composed of 9 layers of self-learning graph convolution modules and a temporal feature extraction network composed of 3 ECLSTM modules; the input skeletal joint point data is first forward propagated along the neural network model, and the final features are pooled and convolved to give the action category score. The category with the highest score is the predicted category; then the parameters of each network layer are derived through the loss function and back-propagated along the gradient until the loss function value reaches the minimum, and the optimal weight parameters are obtained; The step 1 obtains human skeleton sequence data based on the OpenPose posture estimation algorithm and performs corresponding sample label annotation, specifically including: Step 1.1: Use the OpenPose posture estimation algorithm to complete the human posture estimation from the bottom up and obtain the data of 18 joints of the human skeleton. Each joint point is represented by (X, Y, Confidence); X and Y represent the coordinate position of the joint point in the 2D image, and Confidence represents the confidence of each joint point estimation; the specific steps are: after setting up the OpenPose algorithm environment, call the sample video or picture processed by OpenPose.exe in the command prompt window to obtain a set of .json files containing the coordinates of the 25 joint positions of the human body. This file is used as the subsequent bone sequence data input. If it is a video, it will contain 30*T joint coordinate data, where T is the length of the video in seconds, and the frame rate of the sample video is set to 30; Step 1.2: The skeleton sequence is represented by the 2D or 3D coordinates of the human skeleton joints in each frame. Each 2D or 3D coordinate is represented as a vector. A complete video action sequence is represented as a vector sequence between different frames. Step 1.3: Label the video samples according to the action content in the video to facilitate subsequent model training and prediction; The step 2 models the skeletal joint point data into a graph topology structure to complete the construction of the graph convolution, which specifically includes: Step 2.1: Represent the skeletal joints as graph vertices, represent the edges between the corresponding vertices of two adjacent frames of the space-time graph as time edges, complete the construction of the space-time graph, and use the space-time graph to model the time and space dimensions of the human skeleton joints; Step 2.2: Construct an undirected graph G t = {V t ,E t } represents a sequence with N joints and T skeleton frames, where V t is a set of N joint points, E t is a collection of bone edges, node v ti The neighbor set of ti )={v tj |d(v ti ,v tj )≤D}, where d(v ti ,v tj ) is from v ti to v tj The shortest path, here represents the neighborhood distance of 1; Step 2.3: Design a mapping function l∶V t →{1,2,…,K}, for each graph vertex v ti ∈V t Assign labels {1,2,…,K} to node v ti The neighbor set N(v ti ) is divided into a fixed number of K subsets; in addition, the edge set E t It consists of two subsets. The first subset E S = {v ti v tj |(i,j)∈H} represents the connection within each frame skeleton, where H represents the set of naturally connected human joints, and the second subset E F = {v ti v (t+1)i } represents the edges between consecutive frames, and E of a specific joint i F All the edges in represent their trajectories over time; Step 2.4: Perform spatial graph convolution on the skeletal joint data to extract features; The step 2.4: performing a spatial graph convolution feature extraction operation on the skeletal joint point data, specifically: Among them, f out (v ti ) represents the output of the graph convolution at joint point i, f in represents the input feature map, Z ti (v tj ) represents the relationship between the i-th joint and the sampling interval B(v ti ) is the relative distance of other joints in the same space, ⊙ represents the dot product operation between vector elements or matrices; the sampling function p(v ti ,v tj )=v tj , where v ti ∈B(v ti ), B(v ti )={v ti |d(v tj ,v ti )≤D} is the sampling interval, where d(v tj ,v ti ) is the joint v ti , v tj The minimum distance between them; mapping relationship l ti :B(v ti )→{0,…,K-1}, the new weight function is expressed as w(v ti ,v tj )=w′(l ti (v tj )); The step 3 constructs a graph convolutional network PL-GCN with self-learning ability based on the grouping of the adjacency matrix A of the graph topology structure of ST-GCN to optimize the graph structure of human body movements. The specific contents are as follows: Graph convolution output after adding the learnable P matrix: Here A k and P k have the same dimensions, the matrix P k The value of is initialized to 0, the matrix A k Determines whether there is a connection between two vertices; W k and M k These are learnable parameters, used to implement convolution operations and learn the importance of each edge respectively; The added learnable P matrix can adaptively learn and update the matrix parameters through a channel feedback method, thereby compensating the matrix A k Corresponding to the missing relationship in , a cross entropy loss function is defined as: L=J(W,x,class)=W*(-x[class]+log(∑ j exp(x[j]))) (3) Where J represents the name of the defined loss function, W represents the weight matrix, x represents the output vector of the network, class represents the true label of the action category, and x[j] represents the value of the jth dimension of the output vector; If the learnable P matrix is added, the channel feedback output is: H=f out (x,θ)(A k +P k (x,θ))*W(x,α) (4) Where P k (x,θ) represents the self-learning matrix of the kth layer, α represents the parameters in the weight matrix W, and θ represents the self-learning matrix P k Parameters in (x,θ); The gradient filter is updated during back propagation by the following operations: Among them, f out (x,θ) is the output feature of graph convolution, and W(x,α) is the feature weighting matrix in step 3.3; The spatial graph convolution module extracts the joint point features in each frame through a similar information aggregation effect. The specific operations of feature propagation between layers are as follows: in, is an undirected graph G t The adjacency matrix A and the identity matrix I representing the connection between the joint points themselves N The weighted result is represents the degree of joint point i, Represents the value of the i-th row and j-th column of the adjacency matrix after considering its own connection; And W (l) is a trainable weight matrix; σ(·) represents the activation function, represents the hidden layer matrix of the lth layer, N and D represent the number of rows and columns of the hidden layer H, and the initial H (0) =X, where X is a node feature vector X i Matrix representation of ; In order to speed up the convergence of the model, a BN layer, a RELU layer, and a dropout layer are set between each graph convolution module to normalize the data passing through the BatchNorm layer: Among them, u j represents the mean, represents the variance, Represents the normalized data, ∈ represents a very small number to avoid the denominator being 0, m represents the number of samples in a batch, and the data after the ReLu layer is activated: When the output value x>0, the output is performed, and when x≤0, the output value is changed to 0; finally, the output of the spatial convolution module is subjected to the dropout=0.5 operation to avoid overfitting of the network; The step 4 constructs a feature-enhanced long short-term memory network ECLSTM to capture time series features. The specific contents are as follows: Step 4.1: Use the output h of the previous moment t-1 and the current output h t The autocorrelation matrix between them completes the output h at the current moment t The weighting of , thereby capturing the temporal feature information of the video action samples; Step 4.2: Use the sigmoid neural layer to control the output h of the previous moment t-1 and the current input x t The concat(h t-1 ,x t ) passed or partially passed, the operation is as follows: f t =σ(W f ·[h t-1 ,x t ]+b f ) (11) The next step is to decide how much new information to add to the ECLSTM network. A sigmoid layer is used to determine which information needs to be updated, and a tanh layer is used to generate vectors, which are the alternative content for update. Use the formula to combine these two parts to complete the update of the network status: i t =σ(W i ·[h t-1 ,x t ]+b i ) (12) b f 、b i 、b c Respectively represent the bias of the sigmoid layer, the bias of the sigmoid layer, and the bias of the tanh layer; Then use the state i t and We multiply the weights and filter out some information we don’t want to keep to get the new content we added. The specific operations are: In order to get the final output, first pass the sigmoid layer to get an initial output: the t =σ(W o [h t-1 ,x t ]+b o ) (15) b o represents the bias of the sigmoid layer, and then uses the tanh layer to convert C t The values are scaled to between -1 and 1, and the initial output of the model is obtained by the following operations: h t =o t *tanh(C t ) (16); An autocorrelation coefficient matrix is used to enhance the time series features, specifically using the output h of the previous moment t-1 =[x1,x2…x n ] and the current output h′ t =[y1,y2…y n ] Perform dot multiplication to obtain the autocorrelation matrix Finally, use the current output and h′ t The final output is weighted: where h t That is, the output feature at the current moment after the time series feature enhancement; After the temporal features are enhanced by the ECLSTM network features, the captured video key frame information is aggregated through a fully connected layer to prepare for the next step of fusion of spatial joint point features and time series features; The step 5 combines the spatial features extracted from the PL-GCN graph convolutional network and the temporal features captured by the ECLSTM network, specifically including: Step 5.1: The spatial features after convolution output from the spatial graph convolution module and the temporal features enhanced by the ECLSTM network features are fused using the concat method to obtain the fused spatiotemporal features of the video action samples; the fused spatiotemporal features are the features after flexible modeling of skeletal joints and key frame capture, but at this time the features need to be further classified to complete the prediction of the action category.
2. A skeletal action recognition method based on learnable PL-GCN and ECLSTM according to claim 1, characterized in that: Step 6: using the action features after pooling and convolutional network fusion to perform final classification prediction, specifically including: Step 6.1: Average pool the fused features, compress the features and simplify the network; Step 6.2: A convolutional neural network is used to complete the final action recognition classification prediction. The features after average pooling in step 6.1 are convolved by 1×1 and divided into numclass action categories, which are all the action categories in the data set. Each action category is scored, and the category with the highest score is the predicted action category.
