Model training method, palm posture estimation method, electronic equipment and storage medium
By setting the learning objective of the hand pose estimation model to low-dimensional physical parameters, introducing texture and shape basis, constructing sample hand models, and optimizing the loss function, the problem of high computational complexity in existing technologies is solved, and efficient and real-time hand pose estimation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GOERTEK OPTICAL TECH CO LTD
- Filing Date
- 2025-12-23
- Publication Date
- 2026-04-17
AI Technical Summary
Existing hand pose estimation methods rely on computationally complex deep learning models, making it difficult to achieve fast, real-time hand pose estimation on embedded platforms.
By setting the learning objective as low-dimensional physical parameters, introducing texture and shape bases, a sample hand model is constructed, and a loss function is built based on the error to inversely optimize the hand pose estimation model, thereby reducing inference complexity and computational latency.
It improves the accuracy and efficiency of hand pose estimation, and realizes efficient, real-time pose estimation on embedded platforms.
Smart Images

Figure CN121884441A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image recognition technology, and in particular to model training methods, hand pose estimation methods, electronic devices and storage media. Background Technology
[0002] Hand pose estimation is one of the core technologies in the fields of computer vision and image recognition. Its goal is to accurately infer the position, rotation angle, and pose information of each joint of the hand in three-dimensional space from monocular or multi-view images.
[0003] Currently, hand pose estimation methods mainly employ deep learning models to learn the nonlinear mapping relationship between the input image and the 3D pose of the hand. Specifically, by constructing a deep learning model, the coordinates of key hand points in the input image are directly regressed and predicted, and then the 3D pose of the hand is determined based on these coordinates. However, this approach relies on computationally complex network models (such as deep graph convolutional models or Transformer models with large parameter sets), resulting in significant computational load and inference latency. This makes it difficult to efficiently deploy these methods on embedded platforms of hand-swiping systems, failing to meet the system's requirement for fast, real-time hand pose estimation.
[0004] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main purpose of this application is to provide a model training method, a hand pose estimation method, an electronic device, and a storage medium, aiming to solve the technical problem of how to improve the accuracy and efficiency of hand pose estimation models in hand pose estimation, so as to achieve efficient and real-time pose estimation.
[0006] To achieve the above objectives, this application proposes a model training method, which includes: Input the sample image into the preset hand pose estimation model and output the sample prediction parameters; A sample hand model is constructed based on the preset texture base, the preset shape base, and the sample prediction parameters; A loss function is constructed based on the error between the projected key points of the sample hand model and the labeled key points of the sample image; Based on the loss function, the hand pose estimation model is optimized inversely until the loss function converges, thus obtaining the trained hand pose estimation model.
[0007] In one embodiment, the sample prediction parameters include a texture vector, a shape vector, and a first pose vector, and the step of constructing a sample hand model based on a preset texture base, a preset shape base, and the sample prediction parameters includes: Based on preset multi-pose hand data, determine the average hand model; The sample hand mesh is determined based on the average hand model, the texture base, the texture vector, the shape base, and the shape vector; Based on the first pose vector, the sample hand mesh is adjusted to obtain the sample hand model.
[0008] In one embodiment, prior to the step of determining the sample palm mesh based on the average palm model, the texture base, the texture vector, the shape base, and the shape vector, the method further includes: Based on the difference between each hand data in the multi-pose hand data and the average hand model, a covariance matrix is constructed; The covariance matrix is decomposed into eigenvalues, and the target eigenvalue is determined based on the magnitude of the eigenvalues obtained from the decomposition. The texture base and the shape base are determined based on the feature vector corresponding to the target feature value.
[0009] In one embodiment, the step of determining the sample palm mesh based on the average palm model, the texture base, the texture vector, the shape base, and the shape vector includes: The texture deviation of the sample image is determined based on the product between the texture base and the texture vector; The shape deviation of the sample image is determined based on the product between the shape base and the shape vector; The sample hand grid is determined based on the sum of the average hand model, the texture deviation, and the shape deviation.
[0010] In one embodiment, the step of adjusting the sample hand mesh according to the first pose vector to obtain the sample hand model includes: The first attitude vector is reconstructed into a rotation vector and an offset vector; Multiply each vertex of the sample palm mesh with the rotation vector to obtain the transformed mesh vertices; The sample hand model is constructed based on the transformed mesh vertices and the offset vector.
[0011] In one embodiment, the step of constructing a loss function based on the error between the projected keypoints of the sample hand model and the labeled keypoints of the sample image includes: The vertex distance cost is determined based on the distance between each of the projected key points and its corresponding labeled key points; The weighted distance cost is determined based on the preset weights of each key point and the distance between each projected key point and its corresponding labeled key point. A loss function is constructed based on the vertex distance cost and the weighted parameter distance cost.
[0012] Furthermore, to achieve the above objectives, this application proposes a hand pose estimation method, which is applied to the trained hand pose estimation model described above. The method includes: The acquired palm image is input into the trained palm pose estimation model, which outputs palm prediction parameters. The three-dimensional pose of the hand in the hand image is determined based on the second pose vector in the hand prediction parameters.
[0013] In one embodiment, the step of determining the three-dimensional pose of the hand in the hand image based on the second pose vector in the hand prediction parameters includes: Based on the second attitude vector, the three-dimensional rotation matrix is reconstructed; Based on the aforementioned three-dimensional rotation matrix, determine the pitch angle, yaw angle, and roll angle; The pitch angle, yaw angle, and roll angle are defined as the three-dimensional attitude.
[0014] Furthermore, to achieve the above objectives, this application also proposes a model training apparatus, which includes: The sample image input module 10 is used to input sample images into a preset hand pose estimation model and output sample prediction parameters. The hand model construction module 20 is used to construct a sample hand model based on a preset texture base, a preset shape base, and the sample prediction parameters. The loss function construction module 30 is used to construct a loss function based on the error between the projected key points of the sample palm model and the labeled key points of the sample image. The model back optimization module 40 is used to back-optimize the hand pose estimation model according to the loss function until the loss function converges, so as to obtain the trained hand pose estimation model.
[0015] Furthermore, to achieve the above objectives, this application also proposes a hand pose estimation device, which is applied to the trained hand pose estimation model described above. The device includes: The palm image input module 50 is used to input the acquired palm image into the trained palm pose estimation model and output palm prediction parameters. The three-dimensional pose determination module 60 is used to determine the three-dimensional pose of the hand in the hand image based on the second pose vector in the hand prediction parameters.
[0016] In addition, to achieve the above objectives, this application also proposes an electronic device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the hand pose estimation method as described above.
[0017] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the hand pose estimation method described above.
[0018] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the hand pose estimation method described above.
[0019] The proposed technical solutions (one or more) have at least the following technical effects: First, the sample image is input into a preset hand pose estimation model, and the sample prediction parameters are output. By setting the model's learning objective as low-dimensional physical parameters instead of directly regressing three-dimensional coordinates, the inference complexity of the model is effectively reduced. Then, a sample hand model is constructed based on a preset texture basis, a preset shape basis, and the sample prediction parameters. By introducing prior basis knowledge to constrain the generation process of the three-dimensional hand, the model's ability to represent the real hand structure is enhanced. Next, a loss function is constructed based on the error between the projected keypoints of the sample hand model and the labeled keypoints of the sample image, so that the projection of the generated three-dimensional hand model on the two-dimensional image plane is aligned with the manually labeled keypoints. Finally, the hand pose estimation model is back-optimized based on the loss function until the loss function converges, resulting in a trained hand pose estimation model. This allows the model to infer a three-dimensional structure consistent with the real image based on the parameters it has learned, thereby improving the accuracy and generalization ability of pose estimation. When the model is trained and inference is performed, only low-dimensional parameters need to be output to reconstruct the three-dimensional pose of the hand, which reduces the computational complexity and memory usage of the model and reduces the computational delay of parameter prediction. Thus, while maintaining high-precision hand pose estimation, efficient and real-time pose estimation is achieved. Attached Figure Description
[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart illustrating the model training method of this application in Embodiment 1. Figure 2 A schematic diagram illustrating the construction process of the parametric 3D hand model provided in Embodiment 1 of this application; Figure 3 This is a flowchart illustrating the application of the hand pose estimation model provided in Embodiment 2 of this application. Figure 4 This is a schematic diagram of the module structure of the model training device according to an embodiment of this application; Figure 5 This is a schematic diagram of the module structure of the hand posture estimation device according to an embodiment of this application; Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the hand pose estimation method in this application embodiment.
[0023] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0024] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0025] It should be noted that in the description of this application and the appended claims, the terms "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0026] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0027] This application provides a solution: the acquired palm image is input into a preset palm pose estimation model, and palm prediction parameters are output. The palm pose estimation model is trained using a preset loss function, which is constructed based on preset sample images and a corresponding 3D palm model. The 3D palm model is constructed based on the palm prediction parameters corresponding to the sample images and preset texture and shape bases. The 3D pose of the palm in the palm image is determined based on the first pose vector in the palm prediction parameters.
[0028] Currently, hand pose estimation methods mainly employ deep learning models to learn the nonlinear mapping relationship between the input image and the 3D pose of the hand. Specifically, by constructing a deep learning model, the coordinates of key hand points in the input image are directly regressed and predicted, and then the 3D pose of the hand is determined based on these coordinates. However, this approach relies on computationally complex network models (such as deep graph convolutional models or Transformer models with large parameter sets), resulting in significant computational load and inference latency. This makes it difficult to efficiently deploy these methods on embedded platforms of hand-swiping systems, failing to meet the system's requirement for fast, real-time hand pose estimation.
[0029] To address the aforementioned issues, this application provides a hand pose estimation method: First, a sample image is input into a pre-defined hand pose estimation model, which outputs sample prediction parameters. By setting the model's learning objective as low-dimensional physical parameters, rather than directly regressing three-dimensional coordinates, the inference complexity of the model is effectively reduced. Next, a sample hand model is constructed based on a pre-defined texture basis, a pre-defined shape basis, and the sample prediction parameters. By introducing prior basis knowledge to constrain the generation process of the three-dimensional hand, the model's ability to represent the real hand structure is enhanced. Then, based on the error between the projected keypoints of the sample hand model and the labeled keypoints of the sample image, a loss function is constructed to align the projection of the generated three-dimensional hand model onto the two-dimensional image plane with the manually labeled keypoints. Finally, based on the loss function, the hand pose estimation model is back-optimized until the loss function converges, resulting in a trained hand pose estimation model. This model can infer a three-dimensional structure consistent with the real image based on its learned parameters, thereby improving the accuracy and generalization ability of pose estimation. When the model is trained and inference is performed, only low-dimensional parameters need to be output to reconstruct the three-dimensional pose of the hand, which reduces the computational complexity and memory usage of the model and reduces the computational delay of parameter prediction. Thus, while maintaining high-precision hand pose estimation, efficient and real-time pose estimation is achieved.
[0030] It should be noted that the executing entity in this embodiment can be an electronic device with data processing, network communication and program execution functions, such as a tablet computer, personal computer, mobile phone, etc.
[0031] Based on this, the embodiments of this application provide a model training method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the model training method of this application.
[0032] In this embodiment, the model training method includes steps S10 to S40: Step S10: Input the sample image into the preset hand pose estimation model and output the sample prediction parameters; Sample images refer to hand image data used for model training, validation, or testing. They contain pixel value information (such as RGB or grayscale values) to provide the model with feature information about the appearance and posture of the hand. They also usually contain annotation information (such as key point coordinates) for supervised learning.
[0033] A hand pose estimation model refers to a neural network model (such as a convolutional neural network or its variants); it learns from a large number of sample images of known hand poses to establish a mapping relationship between image features and hand pose parameters. To better adapt to embedded devices such as palm-swiping systems, lightweight network models, such as MobileNet and ShuffleNet, can be used as hand pose estimation models. This implementation does not impose specific restrictions on the choice of lightweight network model.
[0034] Sample prediction parameters refer to the low-dimensional numerical vectors output by the hand pose estimation model, which are used to describe the pose features of the hand in the sample image, including information such as hand shape, texture, rotation, translation, and scaling.
[0035] For example, sample images can be used as input data to interact with a hand pose estimation model (such as the MobileNet backbone network). The sample images are passed to the input layer of the model. The model performs forward computation to identify the hand region and extract low-level features (such as edges, textures, etc.) from the hand region. Then, through layer-by-layer transmission and transformation of the multi-layer neural network, higher-level features (such as hand shape, contours, etc.) are gradually extracted. Finally, the output layer of the model returns sample prediction parameters based on these features.
[0036] Step S20: Construct a sample hand model based on the preset texture base, the preset shape base, and the sample prediction parameters; Texture basis refers to a set of predefined texture basis vectors, which can be learned from a large amount of hand texture data through principal component analysis (PCA) or similar dimensionality reduction methods. These basis vectors constitute a low-dimensional linear space, and each basis vector represents the main pattern of texture variation. By weighted combination of texture coefficients, arbitrary hand textures can be generated.
[0037] A shape basis is a set of predefined shape basis vectors, which can also be learned from a 3D hand shape dataset using methods such as PCA. It describes the main directions of change in the vertex positions of the 3D hand mesh, such as finger length, palm thickness, and joint proportions. By adjusting the shape coefficients, the deformation of the 3D mesh can be controlled.
[0038] A sample hand model refers to a complete 3D hand model reconstructed from a sample image. It is generated through a linear combination of texture and shape bases and is used to simulate the appearance and posture of a real hand in the sample image.
[0039] For example, texture coefficients α, shape coefficients β, and pose parameters (such as rotation matrix R and offset vector t) can be extracted from sample prediction parameters; then, texture coefficients α are linearly combined with a texture base T to generate a texture map, such as... ,in The preset average texture is used; simultaneously, the shape base S is combined using the shape coefficient β to obtain the vertex positions of the 3D mesh, such as... in The mesh vertices are given a preset average shape, and rotation and offset are applied based on the pose parameters (e.g., ...). The transformed mesh vertices and texture maps are then combined into a complete 3D model data structure (such as OBJ or PLY format) to generate a sample hand model.
[0040] In one feasible implementation, the sample prediction parameters include a texture vector, a shape vector, and a first pose vector, and step S20 includes: Step S21: Determine the average hand model based on the preset multi-pose hand data; Multi-pose hand data refers to three-dimensional scan data of the hands of different individuals in various poses, which can be obtained by scanning with a 3D scanner.
[0041] The average palm model is a mathematical model that represents the overall characteristics of a palm in various postures. It is expressed in a parametric form and reflects the typical shape and posture characteristics of the palm.
[0042] For example, after acquiring multi-pose hand data, dense alignment is performed on each hand data to ensure that all hand data have the same number of vertices and that each vertex has consistent semantics, such as fingertip point and palm center point. Then, key features corresponding to each hand data are extracted from the aligned multi-pose hand data, such as the outline of the palm, joint position, texture, etc., and statistical analysis is performed on the extracted features to calculate the average value of each feature, and a parameterized average hand model is constructed based on this.
[0043] Step S22: Determine the sample hand mesh based on the average hand model, texture base, texture vector, shape base, and shape vector; Texture vector and shape vector are two sub-vectors parsed from the low-dimensional parameter vector (such as sample prediction parameters) output by the hand pose estimation model. The texture vector is the coefficient used for linear combination of the texture basis, and the shape vector is the coefficient used for linear combination of the shape basis.
[0044] A sample hand mesh is a three-dimensional mesh model used to describe the shape of a hand. It consists of a series of vertices and edges and can accurately represent the texture and shape details of the hand in a sample image.
[0045] For example, the average texture and average shape can be extracted from the average palm model. Referring to the specific implementation of step S20 above, the texture base T is linearly combined using the texture coefficient α, and a texture map is generated by combining the average texture. At the same time, the shape base S is combined using the shape coefficient β, and the three-dimensional mesh vertex positions are obtained by combining the average shape. Then, the texture map and the three-dimensional mesh vertex positions are combined into a complete three-dimensional mesh model to obtain the sample palm mesh.
[0046] In one possible implementation, prior to step S22, the method further includes: Step S2201: Construct a covariance matrix based on the difference between each palm data point and the average palm model in the multi-pose palm data. The covariance matrix is a square matrix used to describe the covariance relationship between various features in multi-pose hand data.
[0047] For example, for any hand data in the multi-pose hand data, its key features are obtained, and each key feature is compared with each key feature in the average hand model. The difference between the two is calculated to obtain the deviation of each key feature in the hand data. Based on this, the difference vector of the hand data is constructed. Then, the difference vectors of each hand data are used as column vectors and stacked horizontally to form a difference matrix. Then, the product of the difference matrix and its own transpose matrix is calculated to obtain the covariance matrix.
[0048] Step S2202: Perform eigenvalue decomposition on the covariance matrix, and determine the target eigenvalue based on the magnitude of the eigenvalues obtained from the decomposition. Eigenvalue decomposition is a matrix decomposition method that decomposes the covariance matrix into eigenvalues and eigenvectors. The eigenvalues obtained from the decomposition are equal to the data variance in the direction of the corresponding eigenvector, representing the magnitude of change of the covariance matrix in the direction of the corresponding eigenvector. They are used to measure the contribution of the change pattern represented by the eigenvector to the overall shape difference. The eigenvectors obtained from the decomposition represent the main direction of data change.
[0049] For example, the covariance matrix can be calculated using singular value decomposition, QR algorithm, etc., to obtain its eigenvalues and corresponding eigenvectors; then, all the eigenvalues obtained by decomposition are sorted in descending or ascending order, and the target eigenvalues are selected from the sorted eigenvalues according to preset rules (such as selecting the k largest eigenvalues or eigenvalues greater than a certain threshold).
[0050] Step S2203: Determine the texture base and shape base based on the feature vector corresponding to the target feature value.
[0051] For example, after performing eigenvalue decomposition on the covariance matrix, all the eigenvalues obtained from the decomposition are sorted in descending order, and the maximum and second largest eigenvalues are determined as target eigenvalues; then, the eigenvector corresponding to the maximum eigenvalue can be determined as the texture basis, and the eigenvector corresponding to the second largest eigenvalue can be determined as the shape basis.
[0052] For example, please refer to Figure 2 , Figure 2 A schematic diagram of the construction process of a parametric 3D hand model is provided. First, multi-pose hand data is acquired (S101), and the features of each hand data point are averaged to construct an average hand model (S102). Next, the deviation between the multi-pose hand data and the average hand model is calculated (S103) to construct an autocovariance matrix. Then, principal component analysis is performed on this autocovariance matrix to obtain a series of principal components ordered by importance (eigenvalue size) (S104). These principal components are the eigenvectors corresponding to the eigenvalues. The eigenvector corresponding to the maximum eigenvalue is determined as the texture basis, and the eigenvector corresponding to the second largest eigenvalue is determined as the shape basis (S105). Finally, based on the texture basis, shape basis, average hand model, texture coefficients, and shape coefficients, a sample 3D hand model is constructed (S106), where the texture coefficients and shape coefficients are predicted by the hand pose estimation model from the input sample image. In this embodiment, a covariance matrix is constructed by calculating the difference between each hand data point and the average hand model. This allows for a more accurate capture of subtle differences and correlations among the hand data points, reflecting the variations in key features across each hand data point. Furthermore, through eigenvalue decomposition, eigenvectors with larger eigenvalues are extracted from the covariance matrix. These eigenvectors represent directions in the data that show significant changes and contain important information. Using these eigenvectors to determine the texture and shape basis allows for a more accurate capture of the essential features of the data, improving the accuracy and effectiveness of basis construction. This ensures that the hands generated through linear combination of basis vectors during model training naturally fall on the manifold of the real hand shape / texture, avoiding unreasonable appearances and improving the accuracy of the hand pose estimation model.
[0053] In one feasible implementation, step S22 includes: Step S221: Determine the texture deviation of the sample image based on the product between the texture base and the texture vector; Step S222: Determine the shape deviation of the sample image based on the product between the shape basis and the shape vector; Step S223: Determine the sample palm mesh based on the sum of the average palm model, texture deviation, and shape deviation.
[0054] For example, pre-learned texture and shape bases that express common hand variations can be linearly combined (producted) with personalized texture and shape vectors predicted from sample images to obtain texture and shape deviations, respectively. Then, these personalized deviations are superimposed on a general average palm model to efficiently and accurately synthesize personalized sample palm meshes corresponding to the sample images.
[0055] For example, the process of constructing the sample palm grid can refer to the following formula:
[0056] Where S represents the generated sample palm mesh, S_mean is the average palm model; A_pose and A_shape are the texture basis and shape basis, respectively; α is the texture coefficient (i.e., texture vector), β is the shape coefficient (i.e., shape vector), and α and β are both low-dimensional parameter vectors, which are predicted by the palm pose estimation model based on the input sample image.
[0057] In this implementation, texture vectors and shape vectors are used to determine the deviation between the current sample image and the average palm model. Based on these deviations, the average palm model is adjusted to achieve accurate restoration of the palm shape in the sample image, ensuring the accuracy of the subsequent loss function construction. Furthermore, the parameterization method reduces the complexity of directly extracting the 3D structure from image data, significantly reducing computational complexity and improving the model's computational efficiency.
[0058] Step S23: Adjust the sample hand mesh according to the first pose vector to obtain the sample hand model.
[0059] A pose vector is a vector predicted by a hand pose estimation model and used to describe the pose features of the hand. Each dimension can correspond to different pose parameters, such as rotation angle and translation position. To distinguish between pose vectors generated during model training and those generated during application, the pose vector generated during model training is called the first pose vector, and the pose vector generated during model application is called the second pose vector.
[0060] For example, the first pose vector can be parsed to determine the pose parameters corresponding to each dimension, such as the finger bending angle and the palm rotation angle, to clarify the direction and degree of adjustment, and to generate an adjustment strategy. For example, for adjusting the finger bending angle, it is determined which vertices need to be moved and the distance and direction of the movement; for adjusting the palm rotation angle, it is determined the rotation center and rotation angle, etc. Then, according to the adjustment strategy, the vertices on the sample palm mesh are moved, rotated, or scaled accordingly to change the shape and pose of the mesh, thereby obtaining a sample palm model that conforms to the palm pose in the sample image.
[0061] In one feasible implementation, step S23 includes: Step S231: Reconstruct the first attitude vector into a rotation vector and an offset vector; A rotation vector is a vector that represents rotation information. It is usually used to describe the rotation angle and direction of an object in three-dimensional space. It is usually represented as a three-dimensional vector, representing the rotation angle along the x, y and z axes.
[0062] An offset vector is a vector that represents translation information and is used to describe the positional changes of an object in three-dimensional space. It is usually represented as a three-dimensional vector, indicating the amount of translation along the x, y, and z axes.
[0063] For example, the first pose vector output by the hand pose estimation model can be represented by a 3x4 transformation matrix. The first three columns of the transformation matrix form a 3x3 rotation vector, representing the degree of three-dimensional rotation of the hand. The fourth column of the transformation matrix is represented as a 3x1 vector, which yields the offset vector, representing the translation of the hand in three-dimensional space.
[0064] Step S232: Multiply each vertex of the sample hand grid with the rotation vector to obtain the transformed grid vertices; Step S233: Construct the sample hand model based on each transformed mesh vertex and offset vector.
[0065] For example, for each vertex in the sample hand grid, its coordinates are represented as a column vector, and the column vector of the vertex is multiplied by the rotation vector to obtain the coordinates of the rotated vertex, that is, the transformed grid vertex; then, for each transformed grid vertex, its coordinates are added to the offset vector to realize the translation operation of the vertex to obtain the final vertex position; then, based on the final vertex position, the above sample hand grid is reconstructed to form the sample hand model.
[0066] In this embodiment, by reconstructing the first pose vector into a rotation vector and an offset vector, and performing rotation and translation transformations on the vertices of the sample hand mesh respectively, the pose and position of the hand model can be controlled more accurately, reducing model errors caused by inaccurate pose representation, thereby improving the accuracy of constructing the sample hand model, reducing the calculation error of the subsequent loss function, improving the accuracy of training the hand pose estimation model, and improving the accuracy of subsequent hand pose estimation using this model.
[0067] Step S30: Construct a loss function based on the error between the projected key points of the sample hand model and the labeled key points of the sample image; Projection key points refer to the key point positions obtained after projecting a 3D sample hand model onto a 2D image plane. Common key points include feature points such as the joints and fingertips of the hand.
[0068] Keypoint annotation refers to the location of key points that are manually marked on sample images or determined by other means, and are used as reference standards for model training.
[0069] Error refers to the distance between projected keypoints and labeled keypoints on a two-dimensional pixel plane; commonly used metrics include Euclidean distance and absolute distance (L1 norm), etc. This implementation does not impose specific restrictions on the method of error measurement. For N keypoints, the loss function is usually the weighted sum or average of the errors of all keypoints.
[0070] For example, a 3D hand model (sample hand model) reconstructed from parameters predicted by a hand pose estimation model can be projected onto a 2D image plane. The key points of the projected model can be compared with the real 2D key points annotated in the training image. The reprojection error can be constructed as a loss function to supervise network training, thereby reducing the reliance on a large amount of accurate 3D labeled data.
[0071] Understandably, by constructing a loss function by calculating the error between the projected keypoints of the sample hand model and the labeled keypoints of the sample image, the difference between the model's prediction and the actual situation can be accurately measured. This can guide the model to adjust its parameters in the correct direction during training, thereby improving the model's accuracy in estimating hand pose.
[0072] In one feasible implementation, step S30 includes: Step S31: Determine the vertex distance cost based on the distance between each projected key point and its corresponding labeled key point; Vertex Distance Cost (VDC) is a quantitative indicator used to measure the degree of positional difference between projected keypoints and their corresponding labeled keypoints. It is obtained by calculating the Euclidean distance between each keypoint.
[0073] Step S32: Determine the weighted distance cost based on the preset weights of each key point and the distance between each projected key point and its corresponding labeled key point. The weights of each key point are used to indicate the importance of each key point. They can be set manually by the user in advance or automatically obtained through data statistics (e.g., if a key point has a lot of noise, its weight is low).
[0074] Weighted Parametric Distance Cost (WPDC) is a quantitative indicator that comprehensively considers the weights of different keypoints and the distance between keypoints. It is used to measure the degree of difference between the model prediction results (projected keypoints) and the actual annotations (annotated keypoints), and can highlight the impact of important keypoint errors on the overall results.
[0075] For example, for each projected keypoint, the Euclidean distance between it and the corresponding labeled keypoint is calculated, and the distance between each keypoint pair is multiplied by the corresponding weight value to obtain the weighted distance; then the weighted distances of all keypoint pairs are summed to obtain the weighted parameter distance cost.
[0076] Step S33: Construct a loss function based on vertex distance cost and weighted parameter distance cost.
[0077] For example, a loss function can be constructed by linearly weighting the vertex distance cost and the weighted parameter distance cost, and setting appropriate weight coefficients to balance the relative importance of the two costs.
[0078] In this embodiment, by constructing a joint loss function of vertex distance cost and weighted parameter distance cost, multi-objective optimization is achieved, enabling the model to find the optimal balance between reducing overall error and reducing error in key areas, thereby simultaneously obtaining excellent overall estimation performance and outstanding accuracy in key parts.
[0079] Step S40: Based on the loss function, back-optimize the hand pose estimation model until the loss function converges, and obtain the trained hand pose estimation model.
[0080] For example, using the backpropagation algorithm, starting from the output layer of the model, the partial derivatives (gradients) of the loss function with respect to the parameters (such as weights and biases) of each neuron in the palm pose estimation model are calculated sequentially according to the chain rule. Then, based on the calculated gradient information, the model parameters are updated using the gradient descent algorithm or other optimization algorithms (such as stochastic gradient descent, Adam algorithm, etc.) to gradually reduce the value of the loss function. The loss function value in the current iteration is compared with the loss function value in the previous iteration. If the difference between the two is less than a preset iteration threshold, or the number of iterations has reached the maximum number of iterations, the loss function is considered to have converged, and training is stopped.
[0081] In this embodiment, by setting the model's learning objective as low-dimensional physical parameters (such as pose, shape, and texture vectors) rather than high-dimensional three-dimensional coordinates during model training, the learning complexity and computational burden during inference are fundamentally reduced. This allows the model to learn the essential mapping from images to three-dimensional poses with fewer parameters and a simpler network structure, thereby improving the accuracy and efficiency of the hand pose estimation model in hand pose estimation and achieving efficient, real-time pose estimation.
[0082] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description and will not be repeated hereafter. Based on this, this embodiment provides a hand pose estimation method applied to the trained hand pose estimation model in the first embodiment described above, the method including step A10: Step A10: Input the acquired palm image into the trained palm pose estimation model and output the palm prediction parameters. A palm image refers to two-dimensional image data containing the area of a human hand, captured by an image acquisition device (such as a camera). It includes the appearance information of the palm, such as texture and outline.
[0083] The hand prediction parameter refers to a low-dimensional real vector output by the trained hand pose estimation model after inference on a single input image. This vector corresponds to the sample prediction parameters output by the model during the training phase.
[0084] For example, after receiving input hand image data, the trained hand pose estimation model starts its internal calculation process, extracts and maps features from the image data through network structures such as convolutional layers and fully connected layers, and calculates and processes the extracted features based on the learned weights and bias parameters, finally generating hand prediction parameters.
[0085] Optionally, when acquiring an input image, a preset hand detection model can be used to determine whether the input image contains a hand. If so, the hand detection model can be used to determine the hand region in the input image and detect the hand region as a hand image, which is then input into a preset hand pose estimation model for further processing.
[0086] Step A20: Determine the three-dimensional pose of the hand in the hand image based on the second pose vector in the hand prediction parameters.
[0087] For example, the second pose vector can be converted into a standard, easy-to-use 3D pose representation (such as a rotation matrix) based on its representation (such as axis angle or quaternion), and the resulting rotation matrix can be directly output as the final result of the 3D pose of the hand.
[0088] In one feasible implementation, step A20 includes: Step A21: Based on the second attitude vector, reconstruct the three-dimensional rotation matrix; The method for reconstructing the three-dimensional rotation matrix in this embodiment is similar to the specific implementation of reconstructing the rotation vector in step S231 of the first embodiment above, so it will not be described again.
[0089] Step A22: Determine the pitch angle, yaw angle, and roll angle based on the three-dimensional rotation matrix; Pitch angle refers to the angle of rotation around the x-axis, used to describe the degree of vertical tilt of an object in the vertical plane; yaw angle refers to the angle of rotation around the z-axis, used to describe the degree of left and right turning of an object in the horizontal plane; roll angle refers to the angle of rotation around the y-axis, used to describe the degree of rotation of an object around its own longitudinal axis.
[0090] For example, suppose the three-dimensional rotation matrix is The formulas for calculating pitch angle, yaw angle, and roll angle are as follows:
[0091]
[0092]
[0093] Where, θ x θ z θ y These represent pitch angle, yaw angle, and roll angle, respectively; arctan2 is a two-parameter arctangent function.
[0094] Step A23: Determine the pitch angle, yaw angle, and roll angle as the three-dimensional attitude.
[0095] In this embodiment, by converting the rotation matrix into pitch, yaw, and roll angles, the three-dimensional posture of the hand can be represented more intuitively, allowing the user or system to intuitively understand the orientation of the hand.
[0096] For example, please refer to Figure 3 , Figure 3 A flowchart for the application of a hand pose estimation model is provided. First, a hand image is acquired (A101), and a hand region is detected from the hand image using a preset hand detection model (A102). Then, the hand region is input into the trained hand pose estimation model (A103), and the pose vector is output. Then, A104 is executed, and Euler angles (including pitch angle, yaw angle and roll angle) are calculated based on the pose vector output by the model, and the Euler angles are used as the output result of the three-dimensional pose of the hand.
[0097] This embodiment provides a hand pose estimation method that directly outputs a low-dimensional pose vector through a trained hand pose estimation model, and determines the three-dimensional pose of the hand accordingly. This fundamentally reduces the complexity of the model and the amount of inference computation, and can run efficiently on resource-constrained embedded platforms to achieve efficient and real-time pose estimation.
[0098] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the hand pose estimation method of this application. Any simple transformations based on this technical concept are within the protection scope of this application.
[0099] This application also provides a model training device, please refer to... Figure 4 The model training device includes: The sample image input module 10 is used to input sample images into a preset hand pose estimation model and output sample prediction parameters. The hand model construction module 20 is used to construct a sample hand model based on a preset texture base, a preset shape base, and sample prediction parameters. The loss function construction module 30 is used to construct a loss function based on the error between the projected key points of the sample hand model and the labeled key points of the sample image. The model back optimization module 40 is used to back-optimize the hand pose estimation model based on the loss function until the loss function converges, thus obtaining the trained hand pose estimation model.
[0100] Optionally, the sample prediction parameters include texture vector, shape vector, and first pose vector. The hand model building module is also used for: Based on preset multi-pose hand data, determine the average hand model; The sample hand mesh is determined based on the average hand model, the texture base, the texture vector, the shape base, and the shape vector; Based on the first pose vector, the sample hand mesh is adjusted to obtain the sample hand model.
[0101] Optionally, the hand model building module is also used for: Based on the difference between each hand data in the multi-pose hand data and the average hand model, a covariance matrix is constructed; The covariance matrix is decomposed into eigenvalues, and the target eigenvalue is determined based on the magnitude of the eigenvalues obtained from the decomposition. The texture base and the shape base are determined based on the feature vector corresponding to the target feature value.
[0102] Optionally, the hand model building module is also used for: The texture deviation of the sample image is determined based on the product between the texture base and the texture vector; The shape deviation of the sample image is determined based on the product between the shape base and the shape vector; The sample hand grid is determined based on the sum of the average hand model, the texture deviation, and the shape deviation.
[0103] Optionally, the hand model building module is also used for: The first attitude vector is reconstructed into a rotation vector and an offset vector; Multiply each vertex of the sample palm mesh with the rotation vector to obtain the transformed mesh vertices; The sample hand model is constructed based on the transformed mesh vertices and the offset vector.
[0104] Optionally, the loss function building block is also used for: The vertex distance cost is determined based on the distance between each of the projected key points and its corresponding labeled key points; The weighted distance cost is determined based on the preset weights of each key point and the distance between each projected key point and its corresponding labeled key point. A loss function is constructed based on the vertex distance cost and the weighted parameter distance cost.
[0105] The model training device provided in this application, employing the hand pose estimation method described in the above embodiments, can solve the technical problem of how to improve the accuracy and efficiency of hand pose estimation models, thereby achieving efficient and real-time pose estimation. Compared with the prior art, the beneficial effects of the model training device provided in this application are the same as those of the model training method provided in the above embodiments, and other technical features in the model training device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0106] This application also provides a model training device, please refer to... Figure 5 The hand pose estimation device is applied to the trained hand pose estimation model described above, and the device includes: The palm image input module 50 is used to input the acquired palm image into the trained palm pose estimation model and output palm prediction parameters. The three-dimensional pose determination module 60 is used to determine the three-dimensional pose of the hand in the hand image based on the second pose vector in the hand prediction parameters.
[0107] Optionally, the 3D pose determination module is also used for: Based on the second attitude vector, the three-dimensional rotation matrix is reconstructed; Based on the aforementioned three-dimensional rotation matrix, determine the pitch angle, yaw angle, and roll angle; The pitch angle, yaw angle, and roll angle are defined as the three-dimensional attitude.
[0108] The hand pose estimation device provided in this application, employing the hand pose estimation method described in the above embodiments, can solve the technical problem of how to improve the accuracy and efficiency of hand pose estimation models, thereby achieving efficient and real-time pose estimation. Compared with the prior art, the beneficial effects of the hand pose estimation device provided in this application are the same as those of the hand pose estimation method provided in the above embodiments, and other technical features in the hand pose estimation device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0109] This application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the hand pose estimation method in the first embodiment described above.
[0110] The following is for reference. Figure 5The diagram illustrates a structural schematic of an electronic device suitable for implementing embodiments of this application. The electronic devices in these embodiments may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0111] like Figure 5 As shown, the electronic device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory 1002 or a program loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the electronic device. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. The communication device 1009 allows the electronic device to communicate wirelessly or wiredly with other devices to exchange data. Although the diagrams show electronic devices with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems may be implemented alternatively.
[0112] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0113] The electronic device provided in this application, employing the hand pose estimation method described in the above embodiments, can solve the technical problem of how to improve the accuracy and efficiency of hand pose estimation models, thereby achieving efficient and real-time pose estimation. Compared with the prior art, the beneficial effects of the electronic device provided in this application are the same as those of the hand pose estimation method provided in the above embodiments, and other technical features of this electronic device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0114] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0115] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0116] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the hand pose estimation method described in the above embodiments.
[0117] The computer-readable storage medium provided in this application embodiment may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0118] The aforementioned computer-readable storage medium may be included in an electronic device or may exist independently without being assembled into an electronic device.
[0119] The aforementioned computer-readable storage medium carries one or more programs that, when executed by an electronic device, cause the electronic device to: input the acquired palm image into a trained palm pose estimation model and output palm prediction parameters; and determine the three-dimensional pose of the palm in the palm image based on the second pose vector in the palm prediction parameters.
[0120] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0121] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0122] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0123] The readable storage medium provided in this application is a computer-readable storage medium. This medium stores computer-readable program instructions (i.e., a computer program) for executing the aforementioned hand pose estimation method. It addresses the technical problem of improving the accuracy and efficiency of hand pose estimation models, thereby achieving efficient and real-time pose estimation. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the hand pose estimation method provided in the above embodiments, and will not be elaborated upon here.
[0124] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the hand pose estimation method described above.
[0125] The computer program product provided in this application can solve the technical problem of how to improve the accuracy and efficiency of hand pose estimation models, so as to achieve efficient and real-time pose estimation. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the hand pose estimation method provided in the above embodiments, and will not be repeated here.
[0126] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A model training method, characterized in that, The model training method includes: Input the sample image into the preset hand pose estimation model and output the sample prediction parameters; A sample hand model is constructed based on the preset texture base, the preset shape base, and the sample prediction parameters; A loss function is constructed based on the error between the projected key points of the sample hand model and the labeled key points of the sample image; Based on the loss function, the hand pose estimation model is optimized inversely until the loss function converges, thus obtaining the trained hand pose estimation model. 2.The model training method of claim 1, wherein, The sample prediction parameters include a texture vector, a shape vector, and a first pose vector. Constructing a sample hand model based on a preset texture base, a preset shape base, and the sample prediction parameters includes: Based on preset multi-pose hand data, determine the average hand model; The sample hand mesh is determined based on the average hand model, the texture base, the texture vector, the shape base, and the shape vector; Based on the first pose vector, the sample hand mesh is adjusted to obtain the sample hand model. 3.The model training method of claim 2, wherein, Before the step of determining the sample palm mesh based on the average palm model, the texture base, the texture vector, the shape base, and the shape vector, the method further includes: Based on the difference between each hand data in the multi-pose hand data and the average hand model, a covariance matrix is constructed; The covariance matrix is decomposed into eigenvalues, and the target eigenvalue is determined based on the magnitude of the eigenvalues obtained from the decomposition. The texture base and the shape base are determined based on the feature vector corresponding to the target feature value. 4.The model training method of claim 2, wherein, The step of determining the sample hand mesh based on the average hand model, the texture base, the texture vector, the shape base, and the shape vector includes: The texture deviation of the sample image is determined based on the product between the texture base and the texture vector; The shape deviation of the sample image is determined based on the product between the shape base and the shape vector; The sample hand grid is determined based on the sum of the average hand model, the texture deviation, and the shape deviation. 5.The model training method of claim 2, wherein, The step of adjusting the sample hand mesh according to the first pose vector to obtain the sample hand model includes: The first attitude vector is reconstructed into a rotation vector and an offset vector; Multiply each vertex of the sample palm mesh with the rotation vector to obtain the transformed mesh vertices; The sample hand model is constructed based on the transformed mesh vertices and the offset vector. 6.The model training method of claim 1, wherein, The step of constructing a loss function based on the error between the projected key points of the sample hand model and the labeled key points of the sample image includes: The vertex distance cost is determined based on the distance between each of the projected key points and its corresponding labeled key points; The weighted distance cost is determined based on the preset weights of each key point and the distance between each projected key point and its corresponding labeled key point. A loss function is constructed based on the vertex distance cost and the weighted parameter distance cost.
7. A palm gesture estimation method, characterized by, The hand pose estimation method is applied to the hand pose estimation model trained as described in any one of claims 1 to 6, and the hand pose estimation method includes: The acquired palm image is input into the trained palm pose estimation model, which outputs palm prediction parameters. The three-dimensional pose of the hand in the hand image is determined based on the second pose vector in the hand prediction parameters.
8. The palm gesture estimation method of claim 6, wherein, The step of determining the three-dimensional pose of the hand in the hand image based on the second pose vector in the hand prediction parameters includes: Based on the second attitude vector, the three-dimensional rotation matrix is reconstructed; Based on the aforementioned three-dimensional rotation matrix, determine the pitch angle, yaw angle, and roll angle; The pitch angle, yaw angle, and roll angle are defined as the three-dimensional attitude.
9. An electronic device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the hand pose estimation method as described in claim 7 or 8.
10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the hand pose estimation method as described in claim 7 or 8.