Human body behavior recognition method based on skeleton point data
Through the joint decoupling strategy and self-attention mechanism, combined with multi-scale feature extraction and classification methods, the problem of constructing relationships between joint points in human behavior recognition using skeletal point data is solved, and the accuracy and feature differentiation of behavior recognition are improved.
Patent Information
- Application Number
- CN202410670002.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-08-27
AI Technical Summary
Among human behavior recognition methods based on skeletal point data, graph convolution methods are difficult to extend to the spatiotemporal dimension, and it is difficult to construct dependencies between some nodes. The self-attention mechanism based on Transformer ignores the spatial position dependencies between joint points, resulting in weight Unreasonable distribution affects the accuracy of behavior recognition.
The joint decoupling strategy is used to construct the graph structure adjacency matrix, a self-attention mechanism is introduced, the relative position information between joint points is emphasized through multi-scale tuple division and position coding, and the convolution layer and pooling layer are combined to obtain action pattern features and timing features. , establish joint point dependencies between multiple frames, and use fully connected layers for classification.
Establishing dependencies between joint points more accurately improves the accuracy of feature distinction and behavior recognition, and enhances the ability to identify synergy between specific joints.
Smart Images

Figure CN118552980A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision, and in particular to a human behavior recognition method based on skeleton point data. Background Art
[0002] Human behavior recognition is an important issue in the field of computer vision technology. It has broad application prospects, including intelligent monitoring, human-computer interaction, video retrieval, etc. Research methods mainly include traditional manual feature extraction methods and deep learning-based methods. Skeleton point data is a sequence of three-dimensional coordinates of multiple human joints. It is an effective representation of motion dynamics. Compared with RGB video images and optical flow, skeleton point data has a smaller data volume and has the advantage of high computational efficiency. Therefore, human behavior recognition methods based on skeleton point data are often lighter and more generalizable.
[0003] In related technologies, with the application of deep learning methods in the field of computer vision, human behavior recognition based on skeleton points has developed rapidly. Representative works mainly include graph convolution network (GCN) and improved methods based on Transformer.
[0004] The current difficulties and challenges in human behavior recognition based on skeleton point data are mainly as follows: graph convolution methods are limited by fixed static graph topology structures, graph structures are difficult to expand to the spatiotemporal dimensions, and it is difficult to directly build dependencies between some nodes; the Transformer-based self-attention mechanism calculates dependency weights based on global joints, ignoring the spatial position dependencies between joints. For example, directly connected joints in the human body structure obviously have stronger synergy during movement, and this feature is not directly reflected in the calculation of attention weights, which reduces the rationality of weight distribution and weakens the construction of dependencies between some joints, affecting the accuracy of behavior recognition that depends on the synergy between specific joints. Summary of the invention
[0005] In view of the above problems existing in the prior art, the present invention provides a method for human behavior recognition based on skeleton point data, comprising the following steps:
[0006] Step 1: Based on the human behavior data set, a skeleton point data sequence representing a single behavior is obtained, wherein the skeleton point sequence includes skeleton point data reflecting the three-dimensional coordinates of the joint points;
[0007] Step 2: Preprocess the skeleton point data, apply the joint decoupling strategy to the skeleton point data, construct the graph structure adjacency matrix within a single frame, and expand the single-frame adjacency matrix to obtain the joint masks of multiple frames;
[0008] Step 3: Process the original input bone point data sequence through the convolution layer to construct the initial feature vector;
[0009] Step 4: Divide the initial feature vector into multi-scale tuples and add position encoding to emphasize the relative position information between joint points in the tuple;
[0010] Step 5: Process the output results obtained in step 4 by introducing the self-attention mechanism of the joint decoupling strategy, and construct the joint point dependency relationship between multiple frames to capture and fully utilize the diverse spatial features;
[0011] Step 6: Obtain the action pattern features at the sub-action behavior level and the frame-level timing features of the joints through the convolution layer to capture the temporal dimension feature information of the data at multiple scales;
[0012] Step 7: Use the pooling layer and the fully connected layer to classify the output features obtained in step 6, obtain the category score of behavior recognition, and realize human behavior recognition.
[0013] Furthermore, in the step 2, the graph structure in a single frame adopts an undirected graph, and the adjacency matrix adopts a binary matrix. For the adjacency matrix, the directly connected joint points in the human body structure are assigned a value of 1, and the rest are 0. The joint mask in multiple frames is expanded by tiling the matrix in rows and columns. The specific calculation formula is:
[0014] N*N→(N*w i )*(N*w i )
[0015] Where N is the row and column dimensions of the matrix, w i is the tuple size.
[0016] Furthermore, in the step three, the convolution layer includes a first convolution layer, a batch normalization layer and an activation function layer. The first convolution layer is a two-dimensional convolution layer, the convolution kernel size is 1x1, the first dimension is the time dimension, the second dimension is the joint point dimension, and the activation function uses the RELU activation function.
[0017] Furthermore, in the step 4, tuple partitioning is achieved by reshaping the tensor shape, and the specific calculation formula is:
[0018] C*V*T→C*(V / w i )*(V*w i )
[0019] Among them, C represents the channel dimension, V represents the number of joints, T represents the time dimension, and w i Represents the tuple size.
[0020] Furthermore, in the step 4, the position coding adopts sine-cosine function coding, and the specific calculation formula is as follows:
[0021]
[0022] Among them, p represents the position sequence number, C i It is the feature channel dimension. The sine function is used to encode the even-numbered channel features, and the cosine function is used to encode the odd-numbered channel features.
[0023] Furthermore, the specific calculation process of step 5 is as follows:
[0024] First, Q and K are obtained by convolution calculation, and the attention weights are obtained by calculating the similarity through dot product. Two joint masks are used to decouple the self-attention weights. The decoupled weights are normalized using softmax and the learnable variable α is added to adaptively adjust the weights. The two self-attention weights obtained by decoupling are summed and the global space regularization variable PA is added. The final weight is used to process the tuple feature vector obtained in step 4. The specific calculation formula is as follows:
[0025]
[0026] Among them, X pe is the feature tensor with position encoding added, mask is the joint mask, α is the learnable variable, · is the element-by-element multiplication operation, att is the unnormalized attention weight, softmax is the function used to normalize the attention weight, and the mathematical formula of softmax is as follows:
[0027]
[0028] X in is the feature tensor without position encoding, PA is the global space regularization variable, X1 is the normalized attention weight and X in The multi-head self-attention output is fused through the feedforward layer. The specific calculation formula is as follows:
[0029] X out =σ(θ(Conv(X1))
[0030] X out is the fused output of multi-head self-attention, θ is the batch normalization operation, and σ is the RELU activation function.
[0031] Furthermore, the specific calculation process of step six is as follows:
[0032] First, the action pattern features at the sub-action behavior level are obtained through the convolution layer, and then the feature tensor is reshaped to restore the original sequence order. The specific calculation formula is as follows:
[0033] C*(V / w i)*(V*w i )→C*V*T
[0034] Among them, C represents the channel dimension, V represents the number of joints, T represents the time dimension, and w i Represents the tuple size, and selects different values according to different scales;
[0035] Finally, the convolutional layer is used to obtain the frame-level temporal features of the joint points.
[0036] Furthermore, in the step 6, the sub-action mode feature extraction convolution layer includes a two-way convolution layer, a feature extraction layer and a feature fusion layer, wherein the two-way convolution layer is a two-dimensional convolution layer with two branches, and the convolution kernel size is 1x1, the feature extraction layer is a two-dimensional convolution layer with two scales, and the convolution kernel sizes are k1x1 and k2x1 respectively, and the feature fusion layer is a two-dimensional convolution layer with a convolution kernel size of 1x1;
[0037] The frame-level temporal feature extraction of joint points uses a two-dimensional convolution layer with a convolution kernel size of k3x1.
[0038] The present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the human behavior recognition method based on skeleton point data as described above when executing the computer program.
[0039] The present invention also discloses a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the human behavior recognition method based on skeleton point data as described above are implemented.
[0040] The present invention has at least the following beneficial effects:
[0041] The present invention decouples the self-attention weight calculation by applying the joint decoupling strategy, solves the problem of weight distribution deviation in self-attention calculation, establishes the dependency relationship between joint points more accurately, and has stronger feature distinguishability. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0043] Figure 1 The figure is a flow chart of the human behavior recognition method based on skeleton point data of the present invention.
[0044] Figure 2This is a model framework diagram of the human behavior recognition method based on skeleton point data of the present invention. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention are described in more detail and completely in conjunction with the embodiments below. The described embodiments are part of the embodiments of the present invention, rather than all of the embodiments.
[0046] like Figure 1 and Figure 2 As shown, the present invention discloses a human behavior recognition method based on skeleton point data, comprising the following steps:
[0047] Step 1: Obtain or select a human behavior data set, which should contain 3D skeleton point data and the 3D coordinates of a single joint point. Obtain a human behavior data sequence of a single behavior.
[0048] For example, the public NTU-RGB+D dataset contains 56,000 samples, and each frame of the sample contains the three-dimensional coordinates of 25 skeletal joints.
[0049] Step 2: Preprocess the skeleton point data, apply the joint decoupling strategy to the skeleton point data, construct the graph structure adjacency matrix within a single frame, and expand the single-frame adjacency matrix to obtain the joint masks of multiple frames.
[0050] The skeleton point sequence in the data is sampled, and each sample is cropped to a fixed length. For example, the samples of the NTURGB+D dataset are uniformly sampled into 120 frames, and each frame contains the 3D coordinates of 25 skeleton points.
[0051] The graph structure in a single frame adopts an undirected graph, and the adjacency matrix adopts a binary matrix. For the adjacency matrix, the directly connected joint points in the human body structure are assigned a value of 1, and the rest are 0. The joint mask in multiple frames is expanded by tiling the single frame matrix in rows and columns. The specific calculation formula is:
[0052] N*N→(N*w i )*(N*w i )
[0053] Where N is the row and column dimensions of the matrix, w i is the tuple size.
[0054] Step 3: Process the original input bone point data sequence through the convolution layer to construct the initial feature vector.
[0055] The convolution layer includes the first convolution layer, batch normalization layer and activation function layer. The first convolution layer is a two-dimensional convolution layer with a convolution kernel size of 1x1. The first dimension is the time dimension, the second dimension is the joint point dimension, and the activation function uses the RELU activation function.
[0056] Step 4: Divide the initial feature vector into multi-scale tuples, add position encoding, and emphasize the relative position information between joint points in the tuple.
[0057] Tuple partitioning is achieved by reshaping the tensor shape. The specific calculation formula is:
[0058] C*V*T→C*(V / w i )*(V*w i )
[0059] Where C represents the channel dimension, V represents the number of joints, T represents the time dimension, and w i Represents the tuple size.
[0060] The position coding adopts sine and cosine function coding, and the specific calculation formula is as follows:
[0061]
[0062]
[0063] Where p represents the position sequence number, C i It is the feature channel dimension. The sine function is used to encode the even-numbered channel features, and the cosine function is used to encode the odd-numbered channel features.
[0064] Step 5: Process the output of step 4 by introducing the self-attention mechanism of the joint decoupling strategy, build the joint point dependency relationship between multiple frames, and capture and fully utilize the diverse spatial features.
[0065] First, Q and K are obtained by convolution calculation, and the attention weights are obtained by calculating the similarity through dot product. Two joint masks are used to decouple the self-attention weights. The decoupled weights are normalized using softmax and the learnable variable α is added to adaptively adjust the weights. The two self-attention weights obtained by decoupling are summed and the global space regularization variable PA is added. The final weight is used to process the tuple feature vector in step 4. The specific calculation formula is as follows:
[0066]
[0067]
[0068] Among them, X pe is the feature tensor with position encoding added, mask is the joint mask, α is the learnable variable, · is the element-by-element multiplication operation, att is the unnormalized attention weight, softmax is the function used to normalize the attention weight, and the mathematical formula of softmax is as follows:
[0069]
[0070] X in is the feature tensor without position encoding, PA is the global space regularization variable, X1 is the normalized attention weight and X in The multi-head self-attention output is fused through the feedforward layer. The specific calculation formula is as follows:
[0071] X out =σ(θ(Conv(X1))
[0072] X out is the fused output of multi-head self-attention, θ is the batch normalization operation, and σ is the RELU activation function.
[0073] Step 6: Use the convolutional layer to obtain the action pattern features at the sub-action behavior level and the frame-level timing features of the joints, and capture the temporal dimension feature information of the data at multiple scales.
[0074] The sub-action pattern feature extraction convolution layer includes a two-way convolution layer, a feature extraction layer and a feature fusion layer. The two-way convolution layer is a two-dimensional convolution layer with two branches and a convolution kernel size of 1x1. The feature extraction layer is a two-dimensional convolution layer with two scales and convolution kernel sizes of k1x1 and k2x1 respectively. The feature fusion layer is a two-dimensional convolution layer with a convolution kernel size of 1x1. The frame-level temporal feature extraction adopts a two-dimensional convolution layer with a convolution kernel size of k3x1.
[0075] Step 7: Use the pooling layer and the fully connected layer to classify the output features of step 6, obtain the category score of behavior recognition, and realize human behavior recognition.
[0076] The present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned human behavior recognition method based on skeleton point data when executing the computer program.
[0077] The present invention also discloses a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the human behavior recognition method based on skeleton point data are implemented.
Claims
1. A human behavior recognition method based on skeleton point data, characterized in that: The following steps are involved: Step 1: Based on the human behavior dataset, a skeleton point data sequence representing a single behavior is obtained, wherein the skeleton point sequence includes skeleton point data reflecting the three-dimensional coordinates of joint points; Step 2: Preprocess the skeleton point data, apply the joint decoupling strategy to the skeleton point data, construct the graph structure adjacency matrix within a single frame, and expand the single-frame adjacency matrix to obtain the joint mask of multiple frames; Step 3: Process the original input bone point data sequence through the convolution layer to construct the initial feature vector; Step 4: Divide the initial feature vector into multi-scale tuples and add position encoding to emphasize the relative position information between joint points in the tuple; Step 5: Process the output of step 4 by introducing a self-attention mechanism with joint decoupling strategy to construct the joint point dependency relationship between multiple frames to capture and fully utilize the diverse spatial features; Step 6: Obtain the action pattern features at the sub-action behavior level and the frame-level temporal features of the joints through the convolutional layer to capture the temporal dimension feature information of the data at multiple scales; Step 7: Use the pooling layer and the fully connected layer to classify the output features obtained in step 6, obtain the category score of behavior recognition, and realize human behavior recognition.
2. The human behavior recognition method based on skeleton point data according to claim 1, characterized in that: In the second step, the graph structure in a single frame adopts an undirected graph, and the adjacency matrix adopts a binary matrix. For the adjacency matrix, the directly connected joint points in the human body structure are assigned a value of 1, and the rest are 0. The joint mask in multiple frames is expanded by tiling the matrix in rows and columns. The specific calculation formula is: N*N→(N*w i )*(N*w i ) Among them, N is the row and column dimensions of the matrix, w i is the tuple size.
3. The human behavior recognition method based on skeleton point data according to claim 1, characterized in that: In the step three, the convolution layer includes a first convolution layer, a batch normalization layer and an activation function layer. The first convolution layer is a two-dimensional convolution layer, the convolution kernel size is 1x1, the first dimension is the time dimension, the second dimension is the joint point dimension, and the activation function uses the RELU activation function.
4. The human behavior recognition method based on skeleton point data according to claim 1, characterized in that: In step 4, tuple partitioning is achieved by reshaping the tensor shape. The specific calculation formula is: C*V*T→C*(V / w i )*(V*w i ) Among them, C represents the channel dimension, V represents the number of joints, T represents the time dimension, and w i Represents the tuple size.
5. The human behavior recognition method based on skeleton point data as claimed in claim 4, characterized in that: In the above step 4, the position code is encoded using sine and cosine functions, and the specific calculation formula is as follows: Among them, p represents the position sequence number, C i It is the feature channel dimension. The sine function is used to encode the even-numbered channel features, and the cosine function is used to encode the odd-numbered channel features.
6. The human behavior recognition method based on skeleton point data according to claim 1, characterized in that: The specific calculation process of step 5 is: First, Q and K are obtained by convolution calculation, and the similarity is calculated by dot product to obtain the attention weight. Two joint masks are used to decouple the self-attention weights. The decoupled weights are normalized using softmax and the learnable variable α is added to adaptively adjust the weights. The two decoupled self-attention weights are summed and the global spatial regularization variable PA is added. The final weight is used to process the tuple feature vector obtained in step 4. The specific calculation formula is as follows: Among them, X pe is the feature tensor with position encoding added, mask is the joint mask, α is the learnable variable, · is the element-by-element multiplication operation, att is the unnormalized attention weight, and softmax is the function used to normalize the attention weight. The mathematical formula of softmax is as follows: Among them, X in is the feature tensor without position encoding, PA is the global space regularization variable, X1 is the normalized attention weight and X in The multi-head self-attention output is fused through the feedforward layer. The specific calculation formula is as follows: X out =σ(θ(Con(X1)) Among them, X out is the fused output of multi-head self-attention, θ is the batch normalization operation, and σ is the RELU activation function.
7. The human behavior recognition method based on skeleton point data according to claim 1, characterized in that: The specific calculation process of step six is: First, the action pattern features at the sub-action behavior level are obtained through the convolution layer, and then the feature tensor is reshaped to restore the original sequence order. The specific calculation formula is as follows: C*(V / w i )*(V*w i ))→C*V*T Among them, C represents the channel dimension, V represents the number of joints, T represents the time dimension, and w i Represents the tuple size, and selects different values according to different scales; Finally, the frame-level temporal features of the joint points are obtained through the convolutional layer.
8. The human behavior recognition method based on skeleton point data according to claim 7 is characterized in that: In step 6, the sub-action pattern feature extraction convolution layer includes a dual-path convolution layer, a feature extraction layer, and a feature fusion layer, wherein the dual-path convolution layer is a two-branch two-dimensional convolution layer with a convolution kernel size of 1x1, the feature extraction layer is a two-dimensional convolution layer with two scales, with convolution kernel sizes of k1x1 and k2x1 respectively, and the feature fusion layer is a two-dimensional convolution layer with a convolution kernel size of 1x1; The frame-level temporal feature extraction of joint points uses a two-dimensional convolution layer with a convolution kernel size of k3x1.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the human behavior recognition method based on skeleton point data according to any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the human behavior recognition method based on skeleton point data according to any one of claims 1 to 8 are implemented.
Citation Information
Cited By
Music performance posture real-time driving method and system based on time-space cooperation
CN120411317A
Real-time driving method and system for music performance gesture based on time-space collaboration
CN120411317B
Deep learning-based multi-view children motion coordination ability evaluation system and method
CN120809152A
