Three-dimensional human body posture estimation method and system based on alternating space-time encoder
By combining graph convolution and attention-focused encoders, the deficiencies of the Transformer model in capturing local spatial relationships and processing redundant information are solved, achieving efficient three-dimensional human pose estimation, and improving the accuracy and computational efficiency of pose prediction. .
Patent Information
- Application Number
- CN202410580695.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-11
- Publication Date
- 2024-09-24
AI Technical Summary
Existing three-dimensional human pose estimation methods based on the Transformer model have difficulty in capturing the local spatial relationship characteristics of body joint points when processing pose sequence data, and suffer from computational efficiency and information extraction capabilities when processing long two-dimensional pose sequences that contain a large amount of redundant information. Poor.
Using a spatial encoder combined with graph convolution and a temporal encoder based on focused attention, the local features and global features of human body joint points are learned through the graph convolution network and spatial self-attention mechanism, and redundancy is processed through focused self-attention operations. residual information to achieve efficient feature extraction of two-dimensional posture sequences.
It improves the accuracy and calculation efficiency of three-dimensional human posture estimation, can effectively handle redundant information in complex postures, and improves the prediction accuracy of joint points in detailed parts of the human body.
Smart Images

Figure CN118692137A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision recognition, in particular to a three-dimensional human body posture estimation method and system based on an alternating spatiotemporal encoder. Background Art
[0002] Early human pose estimation methods generally used marker-based motion capture methods, which attached reflective or colored markers to key joints of the human body and captured the positions of these markers from different angles through multiple cameras to reconstruct the three-dimensional pose. However, such methods usually require specific equipment support and are difficult to apply to common daily scenes. The rise of deep learning has made breakthrough progress in three-dimensional human pose estimation. In recent years, many human pose estimation models based on neural networks have emerged, which can effectively improve the accuracy of pose estimation.
[0003] Methods based on the Transformer model have been widely used in this field. The Transformer model performs well in modeling global dependencies within a sequence, especially in modeling time series data in a pose sequence. In addition, using the multi-head self-attention mechanism, the Transformer can simultaneously focus on information at different levels and scales, more effectively understand the contextual relationship between sequences, and thus deepen the understanding and modeling of human joints in pose sequences. However, the current method of using the Transformer model for 3D pose estimation still has two shortcomings.
[0004] First, when processing pose sequence data, the Transformer model emphasizes global relationships, possibly at the expense of spatial relationships between local body joints. This may lead to insufficient fine-grained modeling of local body joints, which in turn affects the model's ability to extract local features of body joints. Second, two-dimensional pose sequences contain a large amount of redundant information due to the high similarity between adjacent frames in the dataset. Traditional Transformer models are limited by the time and memory complexity of self-attention operations, and therefore perform poorly in processing long sequence data with redundant information. These limitations highlight the need to improve the Transformer architecture so that it can effectively process two-dimensional pose sequences containing a large number of complex poses. Summary of the invention
[0005] In view of the problems existing in the prior art, the present invention is proposed.
[0006] Therefore, the problem to be solved by the present invention is how to solve the problem that the existing Transformer-based spatial encoder overemphasizes global relationships when processing posture sequence data and has difficulty in capturing the local spatial relationship characteristics of body joints; and the traditional Transformer has poor computational efficiency and information extraction capabilities when processing long two-dimensional posture sequences containing a large amount of redundant information.
[0007] In order to solve the above technical problems, the present invention provides the following technical solutions: input a two-dimensional posture sequence and map it to a high-dimensional feature to obtain a posture expression;
[0008] Use the SMPL model for position encoding and combine high-dimensional features to introduce prior information on joint positions;
[0009] Construct a spatial encoder combined with graph convolution to capture the local features of human joints, and process the temporal information of the posture sequence through a temporal encoder;
[0010] The temporal encoder integrates a focused attention mechanism to optimize the fusion of fine-grained features and coarse-grained features to obtain global and local dependencies;
[0011] The 3D coordinates of each joint point are predicted through the regression head module to obtain accurate 3D human pose estimation.
[0012] In a first aspect, an embodiment of the present invention provides a three-dimensional human posture estimation method based on an alternating spatiotemporal encoder, which includes: using the SMPL model for position encoding, using the three-dimensional coordinates of a base template of the SMPL model for position encoding, and splicing the encoding with high-dimensional features to introduce a priori information on the position of human joints;
[0013] Construct a spatial encoder and add a graph convolution module to obtain a spatial encoder to capture the local features of human joints;
[0014] According to the output results of the spatial encoder and the graph convolution module, the output results are input into the temporal encoder to learn the temporal feature information of the posture sequence;
[0015] Construct a temporal encoder, add a focused attention module and fine-grained local interaction of joints, and obtain a temporal multi-head attention module through the temporal encoder. The temporal multi-head attention module performs coarse-grained attention calculation on the global posture sequence.
[0016] Construct a one-dimensional focused attention mechanism to learn fine representations between video frames and handle redundant information;
[0017] The high-dimensional features of the feature vector are processed alternately between the spatial encoder and the temporal encoder multiple times to make full use of the spatial and temporal information;
[0018] The final feature vector is used to predict the 3D human posture through the regression head module, and the 3D coordinates of each joint point are output.
[0019] As a preferred solution of the three-dimensional human body posture estimation method based on the alternating spatiotemporal encoder of the present invention, wherein: the two-dimensional posture sequence is input and mapped to high-dimensional features to obtain posture expression, and the two-dimensional posture generated by the two-dimensional human body posture estimation algorithm is used as input, and the two-dimensional posture adopts the following formula:
[0020] P∈R T×J×2
[0021] Among them, J×2 represents the two-dimensional coordinates of J human joints, and T represents the length of the input posture sequence.
[0022] As a preferred solution of the three-dimensional human body posture estimation method based on the alternating spatiotemporal encoder of the present invention, wherein: the two-dimensional posture sequence is input, and the two-dimensional posture sequence is mapped to a high-dimensional feature, and the high-dimensional feature adopts the following formula:
[0023] P * ∈R T×J×D
[0024] Among them, J represents the number of human joints in each frame of the sequence, T represents the length of the input posture sequence, D represents the feature dimension, and T represents the length of the input posture sequence.
[0025] As a preferred solution of the three-dimensional human posture estimation method based on the alternating spatiotemporal encoder of the present invention, wherein: the spatial encoder combined with graph convolution is constructed to capture the local features of human joints, and the specific structure of the convolutional spatial encoder is input into the feature vector X of the spatial encoder. in The size is (T, J, 512), and the calculation of the spatial encoder module is as follows:
[0026] X' out =X in +MHA(LN(X in ))
[0027] X out =X' out +FFN(LN(X' out ))+GCN(LN(X' out ))
[0028] Where T represents the length of the input posture sequence, J represents the number of human joints in each frame of the sequence, and 512 represents the dimension of the input feature; X outrepresents the output feature vector of the spatial encoder module, LN(·) represents layer normalization, MHA(·) represents the multi-head attention module, GCN(·) represents the graph convolution module, and FFN(·) represents the feed-forward neural network.
[0029] As a preferred solution of the three-dimensional human posture estimation method based on the alternating spatiotemporal encoder of the present invention, wherein: the spatial encoder is constructed, and the graph convolution module is added to obtain the spatial encoder to capture the local features of the human joints. In the graph convolution module of the first layer, the input feature H l-1 It is represented as an N×d matrix, where N represents the number of joints, d represents the feature dimension, and the adjacency matrix is represented by A. The graph convolution module operation adopts the following formula:
[0030]
[0031] in, represents the adjacency matrix plus the identity matrix to preserve the node's own characteristics, express The degree matrix, W l is a learnable weight matrix representing the linear transformation of node features.
[0032] As a preferred solution of the three-dimensional human posture estimation method based on the alternating spatiotemporal encoder described in the present invention, wherein: the one-dimensional focus attention mechanism is constructed to learn the fine representation between video frames and process redundant information. The one-dimensional focus attention mechanism is divided into a query vector part, a context feature part and an attention gate part. The context feature part is combined through an aggregation module and an attention gate part. The query vector part and the aggregation feature interact to process redundant information. The following formula is used:
[0033] y i =T(M(x i ,X),x i )
[0034] Among them, T represents the interaction module, M represents the aggregation module, and X represents the adjacent tokens.
[0035] In a second aspect, an embodiment of the present invention provides a three-dimensional human posture estimation system based on an alternating spatiotemporal encoder, which includes:
[0036] Input module, which inputs a two-dimensional posture sequence and maps it to high-dimensional features to obtain posture expression;
[0037] Use the module, use the SMPL model for position encoding, and combine high-dimensional features to introduce prior information on joint point positions;
[0038] Building module, constructing a spatial encoder combined with graph convolution to capture the local features of human joints, and processing the temporal information of the posture sequence through the temporal encoder;
[0039] Integration module: The temporal encoder integrates the focused attention mechanism to optimize the fusion of fine-grained features and coarse-grained features to obtain global and local dependencies;
[0040] The prediction module predicts the 3D coordinates of each joint point through the regression head module to obtain accurate 3D human posture estimation.
[0041] In a third aspect, an embodiment of the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program instructions are executed by the processor, the steps of the three-dimensional human body posture estimation method and system based on the alternating space-time encoder as described in the first aspect of the present invention are implemented.
[0042] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program instructions are executed by a processor, the steps of the three-dimensional human body posture estimation method and system based on an alternating space-time encoder as described in the first aspect of the present invention are implemented.
[0043] The beneficial effects of the present invention are as follows: the present scheme realizes accurate prediction of human posture in three-dimensional space by utilizing a spatial encoder combined with graph convolution and a temporal encoder based on focused attention. First, a novel spatial encoder combined with graph convolution is designed, which learns the local features and global features of human joints through graph convolution network and spatial self-attention mechanism respectively, thereby improving the model's ability to capture complex spatial relationships and connection information between human joints, and achieving higher accuracy in three-dimensional posture estimation. Subsequently, a temporal encoder based on focused attention is designed to process a large amount of redundant information in posture sequences. The core of the temporal encoder is the focused self-attention operation, which is similar to the window attention mechanism, which improves the computational efficiency and information extraction ability of the attention mechanism on long posture sequences. The temporal encoder based on focused attention divides the input features into different layers, and uses windows of different sizes on different layers for self-attention operations. This attention method can obtain features of different granularities, and after fusing fine features and coarse-grained features, the model can effectively process redundant information in two-dimensional posture sequences and improve the prediction accuracy of joints in detailed parts of the human body. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 creative work.
[0045] Figure 1 A flowchart of a method and system for 3D human posture estimation based on an alternating spatiotemporal encoder;
[0046] Figure 2 A computer device diagram of a three-dimensional human posture estimation method and system based on an alternating spatiotemporal encoder;
[0047] Figure 3 A framework diagram of a 3D human posture estimation method and system based on an alternating space-time encoder is provided;
[0048] Figure 4 A spatial encoder diagram of a three-dimensional human pose estimation method and system based on an alternating spatiotemporal encoder combined with graph convolution;
[0049] Figure 5 A temporal encoder diagram based on focused attention for a 3D human pose estimation method and system based on an alternating spatiotemporal encoder;
[0050] Figure 6 Flowchart of the focus attention mechanism of the 3D human pose estimation method and system based on the alternating spatiotemporal encoder;
[0051] Figure 7 A comparison diagram of the network training process of the proposed algorithm and the baseline algorithm for the 3D human pose estimation method and system based on the alternating spatiotemporal encoder;
[0052] Figure 8 This is a visualization of the results of different methods of 3D human pose estimation methods and systems based on alternating spatiotemporal encoders on the Human3.6 dataset;
[0053] Fig. 9 This is the visualization result of complex postures in outdoor scenes of the 3D human posture estimation method and system based on alternating spatiotemporal encoder. DETAILED DESCRIPTION
[0054] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.
[0055] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0056] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0057] Example 1
[0058] Reference Figures 1 to 8 , which is the first embodiment of the present invention, and provides a 3D human body posture estimation method and system based on an alternating spatiotemporal encoder, comprising:
[0059] S1: Input a 2D posture sequence and map it to high-dimensional features to obtain posture representation.
[0060] Figure 3 The overall network structure of the proposed 3D human pose estimation framework based on alternating spatiotemporal encoder is demonstrated. The main body of the framework consists of modules such as spatial encoder combined with graph convolution, temporal encoder based on focused attention, pose embedding and regression head.
[0061] On the one hand, this framework uses the 2D posture generated by the 2D human posture estimation algorithm as input, projects it to high-dimensional features using the posture embedding module, inputs the 2D posture sequence and maps it to high-dimensional features to obtain the posture expression, and uses the 2D posture generated by the 2D human posture estimation algorithm as input. Its 2D posture adopts the following formula:
[0062] P∈R T×J×2
[0063] Among them, J×2 represents the two-dimensional coordinates of J human joints, and T represents the length of the input posture sequence.
[0064] Input a two-dimensional posture sequence and map the two-dimensional posture sequence to high-dimensional features. The high-dimensional features use the following formula:
[0065] P * ∈R T×J×D
[0066] Among them, J represents the number of human joints in each frame of the sequence, T represents the length of the input posture sequence, D represents the feature dimension, and T represents the length of the input posture sequence.
[0067] S2: Use the SMPL model for position encoding and combine high-dimensional features to introduce prior information on joint positions;
[0068] The SMPL model is used for position encoding, and the three-dimensional coordinates of the base template of the SMPL model are used for position encoding. The encoding is concatenated with high-dimensional features to introduce the position prior information of human joints.
[0069] On the other hand, in order to introduce the position prior information of the human joints, the three-dimensional coordinates of the base template of the SMPL model are used for position encoding and combined with the high-dimensional feature P * After the posture is embedded, the obtained feature vector is fed into the alternating spatiotemporal encoder, which alternately captures the spatial relationship features of human joints and the temporal features of posture sequences by combining the spatial encoder of graph convolution and the temporal encoder based on focused attention.
[0070] Finally, the feature vector X∈R after multiple alternating cycles is transformed into T×J×D Used to predict 3D posture and output the 3D coordinates X∈R of the human joint points T×J×3 , where J×3 represents the three-dimensional coordinates of J human joints.
[0071] S3: Construct a spatial encoder combined with graph convolution to capture the local features of human joints, and process the temporal information of the posture sequence through a temporal encoder;
[0072] A spatial encoder is constructed and a graph convolution module is added to obtain a spatial encoder to capture the local features of human joints. According to the output results of the spatial encoder and the graph convolution module, the output results are input into the temporal encoder to learn the temporal feature information of the posture sequence.
[0073] In the task of human pose estimation, the local feature representation of human joints is crucial. Excellent local feature representation of joints can effectively improve the prediction accuracy and model robustness of pose estimation algorithms. However, existing spatial encoders based on Transformer models often ignore the connectivity between human joints, thereby limiting the ability of network models to fully learn the internal connection relationship of the human skeleton during training. Therefore, a spatial encoder combined with a graph convolutional network is proposed to more effectively capture the feature information between adjacent joints.
[0074] The traditional visual Transformer model consists of two layers of normalization, a multi-head attention module and a feedforward neural network. The spatial encoder proposed in this algorithm adopts a similar model structure and adds a graph convolution module to enhance the model's ability to capture local feature representations of human joints. Figure 4The specific structure of the spatial encoder combined with graph convolution is shown. The feature vector size of the input to the spatial encoder is (T, J, 512). The spatial encoder combined with graph convolution is constructed to capture the local features of human joints. The specific structure of the spatial encoder combined with graph convolution is input to the feature vector X of the spatial encoder. in The size is (T, J, 512), and the calculation of the spatial encoder module is as follows:
[0075] X' out =X in +MHA(LN(X in ))
[0076] X out =X' out +FFN(LN(X' out ))+GCN(LN(X' out ))
[0077] Where T represents the length of the input posture sequence, J represents the number of human joints in each frame of the sequence, and 512 represents the dimension of the input feature; X out Represents the output feature vector of the spatial encoder module, LN(·) represents layer normalization, MHA(·) represents the multi-head attention module, GCN(·) represents the graph convolution module, FFN(·) represents the feedforward neural network. The spatial encoder combined with graph convolution mainly models the dependency relationship between all human joints. Subsequently, the output result of this module is input into the temporal encoder to learn the temporal feature information of the posture sequence.
[0078] Construct a spatial encoder and add a graph convolution module to obtain a spatial encoder to capture the local features of human joints. In the graph convolution module of the lth layer, input feature H l-1 It is represented as an N×d matrix, where N represents the number of joints, d represents the feature dimension, and the adjacency matrix is represented by A. The graph convolution module operation adopts the following formula:
[0079]
[0080] in, represents the adjacency matrix plus the identity matrix to preserve the node's own characteristics, express The degree matrix, W l is a learnable weight matrix representing the linear transformation of node features.
[0081] S4: The temporal encoder integrates a focused attention mechanism to optimize the fusion of fine-grained features and coarse-grained features to obtain global and local dependencies;
[0082] A temporal encoder is constructed, and a focused attention module is added to interact with fine-grained local joints. The temporal multi-head attention module is obtained through the temporal encoder. The temporal multi-head attention module performs coarse-grained attention calculation on the global posture sequence. A one-dimensional focused attention mechanism is constructed to learn fine representations between video frames and process redundant information. The high-dimensional features of the feature vector are processed alternately multiple times between the spatial encoder and the temporal encoder to make full use of spatial and temporal information.
[0083] Unlike the above-mentioned spatial encoder, the temporal encoder aims to learn the joint features between frames in a posture sequence. The core idea is to capture the global dependencies between joints in a posture sequence through the powerful global information modeling capability of the Transformer model, and to process posture motion information at different time and spatial scales through multi-scale modeling capabilities. In order to effectively improve the ability of the Transformer model to fuse fine-grained local information and coarse-grained global information, this algorithm designs a temporal encoder module based on focused attention obtained through an improved attention mechanism. Figure 5 It can be seen that the entire model structure is similar to the visual Transformer model, and a focused attention module is introduced to model fine-grained local interactions of joints. Specifically, the temporal encoder first uses the temporal multi-head attention module to perform coarse-grained attention calculations on the global pose sequence, and then performs fine-grained focused attention calculations on the local pose sequence through the focused attention module. Finally, the extracted fine-grained features are fused with the coarse-grained features to obtain global and local dependencies. The focused attention module divides the input sequence features into different levels according to the proximity relationship, then establishes windows of different sizes for different levels, and performs self-attention calculations on these different windows.
[0084] The designed one-dimensional focused attention mechanism is able to learn fine-grained representations between video frames and handle redundant two-dimensional pose sequences. Figure 5 As shown in Figure 1, the one-dimensional focused attention mechanism first processes the input features through a preprocessing multi-layer perceptron network, and then decomposes them into three different parts, namely the query vector, context features, and the attention gate. The context features are combined through the aggregation module and the attention gate, and then the query vector and the aggregated features interact to integrate the context information. Finally, the features are restored to the original dimension through a post-processing multi-layer perceptron network. The above process is defined using the following formula:
[0085] y i =T(M(x i ,X),x i )
[0086] Among them, T represents the interaction module, M represents the aggregation module, and X represents the adjacent tokens.
[0087] S5: The 3D coordinates of each joint point are predicted through the regression head module to obtain accurate 3D human pose estimation.
[0088] The final feature vector is used to predict the 3D human posture through the regression head module, and the 3D coordinates of each joint point are output.
[0089] The proposed 3D human pose estimation method and system based on alternating spatiotemporal encoder uses a spatial encoder combined with graph convolution and a temporal encoder based on focused attention to accurately predict human pose in 3D space.
[0090] First, a novel spatial encoder is designed, which combines graph convolution to learn local and global features of human joints through graph convolutional networks and spatial self-attention mechanism, enhancing the model's ability to capture complex spatial relationships and connection information between body joints, thereby achieving higher accuracy in 3D pose estimation.
[0091] Subsequently, a temporal encoder based on focused attention was designed to cope with the large amount of redundant information in the pose sequence. The core of the temporal encoder is the focused self-attention operation, which is similar to the window attention mechanism, improving the computational efficiency and information extraction ability of the attention mechanism when processing long pose sequences. The temporal encoder divides the input features into different layers and applies self-attention operations with windows of different sizes on these layers. This attention method is able to capture features of different granularities. By integrating fine-grained and coarse-grained features, the module can effectively handle redundant information in two-dimensional pose sequences and improve the accuracy of joint prediction of complex body parts.
[0092] Verification on multiple mainstream datasets shows that the proposed framework can effectively capture spatial and temporal feature information and has superior performance in predicting complex postures.
[0093] Furthermore, this embodiment also provides a 3D human body posture estimation system based on an alternating spatiotemporal encoder, comprising:
[0094] Input module, which inputs a two-dimensional posture sequence and maps it to high-dimensional features to obtain posture expression;
[0095] Use the module, use the SMPL model for position encoding, and combine high-dimensional features to introduce prior information on joint point positions;
[0096] Building module, constructing a spatial encoder combined with graph convolution to capture the local features of human joints, and processing the temporal information of the posture sequence through the temporal encoder;
[0097] Integration module: The temporal encoder integrates the focused attention mechanism to optimize the fusion of fine-grained features and coarse-grained features to obtain global and local dependencies;
[0098] The prediction module predicts the 3D coordinates of each joint point through the regression head module to obtain accurate 3D human posture estimation.
[0099] This embodiment also provides a computer device, which is suitable for the three-dimensional human body posture estimation method and system based on the alternating space-time encoder, including a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute computer-executable instructions to implement the three-dimensional human body posture estimation method and system based on the alternating space-time encoder as proposed in the above embodiment.
[0100] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0101] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method and system for three-dimensional human posture estimation based on an alternating spatiotemporal encoder as proposed in the above embodiment are implemented.
[0102] In summary, this scheme achieves accurate prediction of human posture in three-dimensional space by utilizing a spatial encoder combined with graph convolution and a temporal encoder based on focused attention. First, a novel spatial encoder combined with graph convolution is designed. The spatial encoder learns the local features and global features of human joints through graph convolution network and spatial self-attention mechanism respectively, thereby improving the model's ability to capture the complex spatial relationship and connection information between human joints and achieving higher accuracy in three-dimensional posture estimation. Subsequently, a temporal encoder based on focused attention is designed to handle a large amount of redundant information in posture sequences. The core of the temporal encoder is the focused self-attention operation, which is similar to the window attention mechanism, which improves the computational efficiency and information extraction ability of the attention mechanism on long posture sequences. The temporal encoder based on focused attention divides the input features into different layers and uses windows of different sizes for self-attention operations on different layers. This attention method can obtain features of different granularities. After fusing fine features and coarse-grained features, the model can effectively handle redundant information in two-dimensional posture sequences and improve the prediction accuracy of joints in detailed parts of the human body.
[0103] Example 2
[0104] Reference Figure 3 - Figure 8 , which is the second embodiment of the present invention, provides a three-dimensional human posture estimation method based on an alternating space-time encoder. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.
[0105] Algorithm 1 is the specific implementation process of the 3D human posture estimation algorithm based on the alternating spatiotemporal encoder.
[0106]
[0107]
[0108] The proposed algorithm is trained in an end-to-end manner, and the overall network loss L * The joint point regression loss L reg and the skeleton supervision loss L bone The calculation formula is:
[0109] L * =L reg +λL bone
[0110] Among them, λ is the weight factor. Previous researchers often used MPJPE error as the joint point regression loss to train the network. However, MPJPE error is sensitive to outliers, and too severe a penalty may affect the training stability of the network model. In order to effectively reduce the adverse effects of this factor on network model training, the weighted average joint position error is used to optimize the processing of outliers in human joints. The calculation formula is:
[0111]
[0112] Among them, J represents the number of human joints in the dataset, T represents the length of the input posture sequence, and p i,j and gt i,j They respectively represent the prediction result and true annotation of the jth human joint in the i-th frame sequence.
[0113] At the same time, in order to make the three-dimensional human posture regressed by the model smoother, skeleton supervision loss auxiliary training is used. The loss calculation formula is:
[0114]
[0115] Among them, p x and p y Respectively represent the xth and yth human joint points predicted by the model, gt x and gt y They represent the xth and yth human joint points that are truly labeled.
[0116] Experimental results and analysis
[0117] Experimental setup
[0118] Three public datasets Human3.6M, MPI-INF-3DHP and HumanEva were used to test the effectiveness of the proposed algorithm, and MPJPE, P-MPJPE, MPJVE, PCK and AUC were used as evaluation indicators. For the two-dimensional pose sequence data, the sequence length of 243 frames was input into the algorithm for three-dimensional human pose estimation. The hardware equipment used by the algorithm is two RTX 2080Ti GPUs and a server with 64G physical memory, and the network architecture is implemented using Python 3.7 and PyTorch 1.10.0 framework. The learning rate of the experiment is 0.00004, and the batch size is set to 1024. At the same time, the AdamW optimizer is used to update the gradient of the network. The specific hyperparameters are shown in Table 1.
[0119] Table 1 Hyperparameter settings
[0120] Hyperparameters value Learning Rate 0.00004 Learning Rate Decay 0.99 Batch Size 1024 Model Channel Size 512 Encoder layer 8
[0121] Comparative experiment
[0122] In order to evaluate the overall performance of the proposed method for various complex postures in different scenarios, the proposed model is compared with the current mainstream algorithms on three public datasets: Human3.6M, MPI-INF-3DHP and HumanEva.
[0123] First, experiments were conducted on Human3.6M, the most widely used dataset in the field of 3D human pose estimation, and compared with the current mainstream methods. In order to ensure the fairness of the comparative experiment, two 2D pose sequences were used as inputs in accordance with previous work. One is the 2D coordinates of the joints predicted by the CPN network, and the other is the 2D coordinates of the joints with real annotations. Table 2 shows the results of the proposed algorithm using the 2D pose predicted by CPN as input. The experimental results are the comparison of the MPJPE indicators of 15 actions on the Human3.6M dataset. The lower the value, the better the performance of the algorithm. The indicator unit is millimeter. In all experiments, the best results are shown in bold. The data in the table show that the proposed algorithm has achieved the best performance in terms of average error, and there is a significant improvement in prediction accuracy for most actions, with the average error reduced to 40.6 mm.
[0124] Table 2 Comparison of MPJPE indicators (mm) for 15 actions on the Human3.6M dataset (CPN results as input)
[0125] method Eat Greet Dir. Disc. Pose Pur. Phone Photo VideoPose3D 43.3 45.6 45.2 46.7 44.6 44.3 48.1 55.1 Cai et al. 45.6 48.8 44.6 47.4 47.2 43.9 50.8 59.0 Liu et al. 41.1 44.9 41.8 44.8 43.4 42.2 47.4 54.1 Wang et al. 42.6 41.1 40.2 42.5 41.4 42.3 46.7 56.7 Chen et al. 40.1 42.9 41.4 43.5 41.7 42.3 46.6 51.9 PoseFormer 39.8 42.5 41.5 44.8 42.1 42.0 46.5 51.6 StridedTransformer 40.2 42.3 40.3 43.3 41.8 40.5 45.6 52.3 P-STMO 39.8 40.2 38.4 42.1 40.4 38.3 45.2 48.9 MixSTE 37.3 39.7 37.6 40.9 40.1 39.8 42.3 49.9 Proposed Algorithm 37.6 38.6 38.4 40.4 39.8 39.3 42.5 48.4 method Smoke Wait Sit SitD. WalkT. WalkD Walk average VideoPose3D 47.1 44.0 57.3 65.8 33.9 49.0 32.8 46.8 Cai et al. 49.7 46.6 57.9 61.9 39.4 51.3 37.1 48.8 Liu et al. 45.3 43.5 56.2 63.6 32.2 45.3 31.3 45.1 Wang et al. 46.3 42.2 56.2 60.4 31.0 46.2 31.7 44.5 Chen et al. 45.4 41.7 53.9 60.2 32.7 46.0 31.5 44.1 PoseFormer 45.5 43.3 53.3 60.7 32.2 46.1 31.8 44.3
[0126] Tables 3 and 4 show the comparison results of P-MPJPE and MPJVE indicators respectively. Compared with the previous mainstream methods, the proposed algorithm has achieved the best prediction results in all actions. The P-MPJPE indicator is reduced to 32.4 mm, and the MPJVE indicator is reduced to 2.0 mm. This effectively shows that alternating training of the spatial encoder combined with graph convolution and the temporal encoder based on focused attention can fully explore the local features of human joints and process redundant two-dimensional posture sequences, thereby improving the performance of the model.
[0127] Table 3 Comparison of P-MPJPE indicators (mm) for 15 actions on the Human3.6M dataset (CPN results as input)
[0128] method Eat Greet Dir. Disc. Pose Pur. Phone Photo Liu et al. 33.3 35.8 32.3 35.2 33.2 32.7 35.9 41.5 PoseFormer 34.4 37.2 34.1 36.1 34.4 33.6 36.4 42.2 StridedTransformer 32.5 35.4 32.7 35.5 33.0 31.9 35.9 41.6 P-STMO 32.9 33.9 31.3 35.2 32.5 31.5 35.4 39.3 Proposed Algorithm 30.7 31.6 30.5 33.0 31.1 30.4 33.7 37.9 method Smoke Wait Sit SitD. WalkT. WalkD Walk average Liu et al. 37.0 32.4 44.6 50.9 27.2 37.0 25.2 35.6 PoseFormer 37.4 33.8 45.0 52.5 27.3 37.8 25.6 36.5 StridedTransformer 36.3 33.5 45.1 50.1 25.0 35.1 23.9 35.2 P-STMO 36.3 32.9 44.6 48.2 23.9 34.4 23.8 34.4 Proposed Algorithm 34.0 30.7 41.2 44.4 22.9 31.8 22.2 32.4
[0129] Table 4 Comparison of MPJVE indicators (mm) for 15 actions on the Human3.6M dataset (CPN results are input)
[0130]
[0131]
[0132] In order to further evaluate the performance of the proposed algorithm on a 2D pose sequence without noise interference, the 2D ground truth annotations on the Human3.6M dataset were selected as input and the proposed method was experimented. Table 5 shows the results with 2D ground truth annotations as input. Compared with the previous optimal algorithm, the proposed algorithm has reduced the MPJPE index to 21.2 mm. The experimental data fully demonstrates that when obtaining higher quality 2D joint point detection results, the proposed algorithm has the potential to predict more accurate pose estimation results. This experiment not only verifies the effectiveness of the proposed algorithm, but also shows its application prospects for higher-precision pose estimation in future work with the continuous advancement and optimization of 2D detection technology.
[0133] Table 5 Comparison of MPJPE indicators (mm) for 15 actions on the Human3.6M dataset (two-dimensional real annotations as input)
[0134] method Eat Greet Dir. Disc. Pose Pur. Phone Photo VideoPose3D 32.7 35.7 35.2 40.2 40.6 36.1 38.2 45.5 Liu et al. 33.6 34.2 34.5 37.1 39.6 35.8 32.9 37.1 Wang et al. 22.8 22.6 23.0 25.7 24.9 24.5 24.1 30.6 PoseForme 33.6 31.0 30.0 33.6 34.8 31.4 30.2 33.3 MixSTE 20.4 21.0 21.6 22.0 24.7 21.9 20.8 24.3 Proposed Algorithm 19.7 20.7 21.4 21.6 23.8 21.1 21.3 23.4 method Smoke Wait Sit SitD. WalkT. WalkD Walk average VideoPose3D 37.8 39.7 48.8 47.3 29.5 38.7 27.8 37.8 Liu et al. 33.0 33.8 40.7 41.4 26.9 33.0 26.6 34.7 Wang et al. 25.6 24.3 31.1 35.0 18.4 25.1 19.8 25.6 PoseFormer 31.7 31.5 37.8 38.6 23.1 29.0 23.3 31.3 MixSTE 21.2 21.5 26.9 24.9 15.7 20.8 14.7 21.6 Proposed Algorithm 21.5 21.1 25.4 23.4 16.2 20.8 15.8 21.2
[0135] For the MPI-INF-3DHP dataset, three evaluation indicators, PCK, AUC and MPJPE, were used to compare the proposed algorithm with the previous mainstream algorithms. The input of the network uses two-dimensional real annotations. As shown in Table 6, compared with other methods, the proposed algorithm has obvious improvements in various indicators, among which PCK is improved to 95.1%, AUC is improved to 67.3, and MPJPE is reduced to 54.1 mm.
[0136] Table 6 Comparison of experimental results on the MPI-INF-3DHP dataset (two-dimensional real annotation as input)
[0137]
[0138]
[0139] In order to further evaluate the generalization of the proposed algorithm on lightweight datasets, relevant experiments were conducted on the HumanEva dataset, and the evaluation index used was P-MPJPE. Table 7 shows the comparison results of the proposed method with previous mainstream methods. The results show that there is a certain gap between the proposed method and the optimal method. Since Transformer-based models usually have a large number of parameters, these large parameters may lead to overfitting on lightweight datasets, thereby reducing the generalization ability of the model. In addition, the amount of data on lightweight datasets is limited, and the model may be affected by outliers. To address these problems, we tried to fine-tune the model pre-trained on the Human3.6M dataset. The proposed method achieved significant improvement in results, and the average P-MPJPE index was reduced to 16.3 mm. This shows that the proposed algorithm can achieve excellent performance when the number is sufficient, and further improvement is still needed to improve its generalization when the amount of data is insufficient.
[0140] Table 7 Comparison of experimental results on the HumanEva dataset (CPN results as input)
[0141]
[0142] Ablation experiment
[0143] In order to further verify the effectiveness of the proposed algorithm, while comparing it with previous mainstream methods, an ablation study was also conducted, and the effectiveness of each module was experimented and analyzed. The input used in the experiment is the two-dimensional joint points estimated by the CPN detector, and the evaluation indicator is MPJPE. As shown in Table 8, the effectiveness of the proposed modules is evaluated by adding "spatial-temporal encoder combined with graph convolution" and "temporal encoder based on focused attention" one by one. In addition, the effect of weighted average joint position error on the proposed method is also experimented. The first row in the table shows the results of the baseline algorithm.
[0144] In the second row, the experiment adds a spatial encoder module combined with graph convolution. In the spatial encoder module, the local features and global features of human joints are learned through the graph convolution network and the spatial self-attention mechanism respectively. The experimental results show that compared with the baseline algorithm, the performance of the proposed algorithm is significantly improved after adding the spatial encoder module.
[0145] In the third row, the effect of the temporal encoder module based on focused attention is tested. This module processes the 2D posture sequence containing a large amount of redundant information through the focused attention mechanism. Although the error is only reduced by 0.4 mm, it is still better than the baseline network and can greatly accelerate the convergence speed of the network. The comparison of the network training process can be seen Figure 5,The figure shows the training process of the proposed algorithm and the baseline algorithm in the first 50 training epochs. The red one is the MPJVE loss curve of the proposed algorithm, which verifies that the temporal encoder module based on focused attention can accelerate the convergence speed of the network.
[0146] In the fourth row, the proposed algorithm combined with the two proposed modules is experimented, and the results show that the prediction accuracy of the proposed algorithm has been further improved, and the best results have been obtained.
[0147] Table 8 Ablation experiments of the proposed modules on Human3.6M
[0148]
[0149] In order to further evaluate the performance of the proposed method under different hyperparameter configurations, a series of ablation experiments were conducted on the Human3.6M dataset. The experiment used MPJPE as the evaluation indicator, and the specific experimental results are shown in Table 3-9. The experiment first explored the impact of model dimension on performance, and found that when the model dimension increased from 128 to 512, MPJPE decreased from 46.3 mm to 43.1 mm accordingly. However, when the model dimension was further increased to 1024, the performance decreased, which may be attributed to the overfitting phenomenon of the network. Then, the performance of the method under different input sequence lengths was analyzed, and the results showed that longer input sequences can significantly improve the prediction accuracy of the model. This phenomenon shows that the method can effectively extract information from long sequence data. Finally, a model dimension of 512 and an input sequence length of 243 were selected as the hyperparameter settings. This configuration achieved the best results, and MPJPE was reduced to 40.6 mm.
[0150] Table 9 Hyperparameter ablation experiment on Human3.6M dataset
[0151] Dimensions Input sequence length MPJPE 128 27 46.3 256 27 44.8 512 27 43.1 1024 27 45.0 512 27 43.1 512 81 41.7 512 243 40.6
[0152] In addition to the quantitative analysis of the proposed algorithm in the comparative experiment, the proposed algorithm will be further evaluated based on the prediction visualization results of the model on the Human3.6M dataset and more difficult outdoor videos.
[0153] Figure 8The pose prediction results of the proposed algorithm and the baseline algorithm on the Human3.6M dataset are shown. The main body of the image is divided into four areas, where the first column is the input 2D pose, the second column is the prediction result of the baseline algorithm, the third column is the prediction result of the proposed algorithm, and the fourth column is the 3D real annotation result. It can be seen from the red dotted circle in the figure that for occluded and complex joints, the 3D pose predicted by the proposed algorithm is closer to the 3D real annotation, and a more accurate 3D pose can be output, which verifies the effectiveness of the proposed algorithm to a certain extent.
[0154] Fig. 9 The visualization results of the proposed algorithm on outdoor videos are shown. Outdoor videos usually contain various complex environmental conditions, such as different lighting, background clutter, occlusion, etc. The model needs to be robust enough to handle these situations. In addition, the human body in the video may have greater posture changes, larger movement amplitudes, or more diverse movement types. The model needs to have good generalization capabilities and be able to handle a variety of different postures and movements, not just those seen in the training dataset. The visualization results of the proposed algorithm on outdoor videos show that the algorithm can adapt well to complex environments and has sufficient robustness and generalization capabilities.
[0155] A 3D human pose estimation method and system based on alternating spatiotemporal encoders is proposed. Firstly, a spatial encoder combined with a graph convolutional network is proposed to extract the structural features of human joints of different granularities, which helps the model capture the auxiliary information of local features of joints. Secondly, a temporal encoder based on focused attention is proposed, which uses focused attention to process the redundant information in the 2D pose sequence, so that the model can focus more on extracting important information and improve the convergence speed of the network. Finally, by alternating the training of the spatial encoder and the temporal encoder, the human joint features and the temporal feature information of the sequence are efficiently captured, which effectively improves the accuracy of the algorithm in predicting the coordinates of 3D joints. Extensive experiments were carried out on three datasets: Human3.6M, MPI-INF-3DHPEquation Chapter (Next) Section 1, and HumanEva, and excellent performance was achieved. The effectiveness and generalization of the algorithm were verified by quantitative analysis and visualization results.
[0156] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A three-dimensional human posture estimation method based on an alternating spatiotemporal encoder, characterized in that: include, Input a two-dimensional posture sequence and map it to a high-dimensional feature to obtain a posture representation; Use the SMPL model for position encoding and combine high-dimensional features to introduce prior information on joint positions; Construct a spatial encoder combined with graph convolution to capture the local features of human joints, and process the temporal information of the posture sequence through a temporal encoder; The temporal encoder integrates a focused attention mechanism to optimize the fusion of fine-grained features and coarse-grained features to obtain global and local dependencies; The 3D coordinates of each joint point are predicted through the regression head module to obtain accurate 3D human pose estimation.
2. The method for 3D human body posture estimation based on an alternating spatiotemporal encoder as claimed in claim 1, characterized in that: The SMPL model is used for position encoding, and the three-dimensional coordinates of the base template of the SMPL model are used for position encoding, and the encoding is spliced with high-dimensional features to introduce the position prior information of the human body joints; Construct a spatial encoder and add a graph convolution module to obtain a spatial encoder to capture the local features of human joints; According to the output results of the spatial encoder and the graph convolution module, the output results are input into the temporal encoder to learn the temporal feature information of the posture sequence; Construct a temporal encoder, add a focused attention module and fine-grained local interaction of joints, and obtain a temporal multi-head attention module through the temporal encoder. The temporal multi-head attention module performs coarse-grained attention calculation on the global posture sequence. Construct a one-dimensional focused attention mechanism to learn fine representations between video frames and handle redundant information; The high-dimensional features of the feature vector are processed alternately between the spatial encoder and the temporal encoder multiple times to make full use of the spatial and temporal information; The final feature vector is used to predict the 3D human posture through the regression head module, and the 3D coordinates of each joint point are output.
3. The method for 3D human body posture estimation based on an alternating spatiotemporal encoder as claimed in claim 2, characterized in that: The two-dimensional posture sequence is input and mapped to high-dimensional features to obtain posture expression, and the two-dimensional posture generated by the two-dimensional human posture estimation algorithm is used as input, and its two-dimensional posture adopts the following formula: P∈R T×J×2 Among them, J×2 represents the two-dimensional coordinates of J human joints, and T represents the length of the input posture sequence.
4. The method for 3D human body posture estimation based on an alternating spatiotemporal encoder as claimed in claim 3, characterized in that: The input two-dimensional posture sequence is mapped to a high-dimensional feature, and the high-dimensional feature adopts the following formula: P * ∈R T×J×D Among them, J represents the number of human joints in each frame of the sequence, T represents the length of the input posture sequence, D represents the feature dimension, and T represents the length of the input posture sequence.
5. The method for 3D human body posture estimation based on an alternating spatiotemporal encoder as claimed in claim 4, characterized in that: The spatial encoder combined with graph convolution is constructed to capture the local features of human joints. The specific structure of the convolutional spatial encoder is input into the feature vector X of the spatial encoder. in The size is (T, J, 512), and the calculation of the spatial encoder module is as follows: X' out =X in +MHA(LN(X in )) X out =X' out +FFN(LN(X' out ))+GCN(LN(X' out )) Where T represents the length of the input posture sequence, J represents the number of human joints in each frame of the sequence, and 512 represents the dimension of the input feature; X out represents the output feature vector of the spatial encoder module, LN(·) represents layer normalization, MHA(·) represents the multi-head attention module, GCN(·) represents the graph convolution module, and FFN(·) represents the feed-forward neural network.
6. The method for 3D human body posture estimation based on an alternating spatiotemporal encoder as claimed in claim 5, characterized in that: The spatial encoder is constructed and a graph convolution module is added to obtain a spatial encoder to capture the local features of human joints. In the graph convolution module of the lth layer, the input feature H l-1 It is represented as an N×d matrix, where N represents the number of joints, d represents the feature dimension, and the adjacency matrix is represented by A. The graph convolution module operation adopts the following formula: in, represents the adjacency matrix plus the identity matrix to preserve the node's own characteristics, express The degree matrix, W l is a learnable weight matrix representing the linear transformation of node features.
7. The method for 3D human body posture estimation based on an alternating spatiotemporal encoder as claimed in claim 6, characterized in that: The one-dimensional focus attention mechanism is constructed to learn the fine representation between video frames and process redundant information. The one-dimensional focus attention mechanism is divided into a query vector part, a context feature part and an attention gate part. The context feature part is combined with the attention gate part through an aggregation module. The query vector part and the aggregation feature interact to process redundant information. The following formula is used: y i =T(M(x i ,X),x i ) Among them, T represents the interaction module, M represents the aggregation module, and X represents the adjacent tokens.
8. A 3D human body posture estimation based on an alternating space-time encoder, based on the 3D human body posture estimation method based on an alternating space-time encoder according to any one of claims 1 to 7, characterized in that: Also includes, Input module, which inputs a two-dimensional posture sequence and maps it to high-dimensional features to obtain posture expression; Use the module, use the SMPL model for position encoding, and combine high-dimensional features to introduce prior information on joint point positions; Building module, constructing a spatial encoder combined with graph convolution to capture the local features of human joints; Integration module: The temporal encoder integrates the focused attention mechanism to optimize the fusion of fine-grained features and coarse-grained features to obtain global and local dependencies; The prediction module predicts the 3D coordinates of each joint point through the regression head module to obtain accurate 3D human posture estimation.
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 three-dimensional human posture estimation method based on the alternating spatiotemporal encoder are implemented as described in any one of claims 1 to 7.
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 three-dimensional human posture estimation method based on an alternating spatiotemporal encoder according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Three-dimensional human body posture estimation method and system based on graph multi-layer perceptron
CN115205896A
Three-dimensional human body posture estimation method and system based on graph and attention interweaving
CN116129051A
Human body posture estimation method and device, computer equipment and storage medium
CN116597513A
3D human body posture estimation method based on global and local space-time encoders
CN116612238A
Three-dimensional human body posture estimation method and system based on multi-path space fusion
CN116704613A
Cited By
Attitude estimation method
CN119723655A
Calorific value map guidance-based time sequence smooth human motion capture method and system
CN120220254A
Lightweight algorithm for estimating 3D human body posture from video
CN120388395A
A lightweight algorithm for estimating 3D human pose from video
CN120388395B
Three-dimensional human body posture estimation method based on multi-scale geometric constraint of graph convolution hybrid MLP
CN122049053A
