Human skeleton key point inference method and device based on video stream analysis training
Optimizing the identification and tracking of key bone points through layered training and meshing solves the problem of complex key point reasoning tasks in video stream analysis training, improves the accuracy of identification and tracking, and reduces the complexity of training.
Patent Information
- Application Number
- CN202410008271.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-03
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-01-03
AI Technical Summary
The human skeleton key point inference task based on video stream analysis training is complex and lacks accuracy. This is mainly due to the large loss value calculation, which leads to inaccurate identification and tracking of skeleton key points, which in turn requires frequent adjustment of parameters, increasing the complexity of training. .
Characterize a single frame image as an image vector through the encoding layer in the preset skeleton key point recognition model, identify and decode the skeleton key points, determine whether the skeleton line is a human skeleton line, calculate the loss value and adjust the model parameters, and hierarchically train the key points Recognition and tracking, using mesh division and rotation and translation to improve matching and optimize motion tracking of bone key points.
It reduces the complexity of skeletal key point inference tasks, improves the accuracy of identification and tracking, reduces the complexity of training, and achieves more efficient identification and tracking of skeletal key points in video streams.
Smart Images

Figure CN117831075B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of neural networks, and in particular to a method and device for reasoning key points of human skeletons in video stream analysis training. Background Art
[0002] Human skeleton key point inference based on video stream analysis training refers to the process of identifying human skeleton key points in the video stream and tracking the movement of skeleton key points in the video stream.
[0003] At present, the reasoning training of skeleton key points is directly carried out in the video stream, which will make the training task huge and the accuracy insufficient. This is because the recognition of key points is divided into recognition in a single-frame video image and tracking of key points in the video stream. If the loss value is calculated only at the end of tracking, the calculated result of the loss value will often be too large. This is caused by inaccurate recognition of key points in a single-frame video image, which will lead to inaccurate tracking of skeleton key points in consecutive frames. Secondly, the large calculated result of the loss value will also require the parameters of the key point recognition link and the parameters of the skeleton key point tracking link in consecutive frames to be adjusted at the same time, which will make the training task huge. Therefore, the task of human skeleton key point reasoning based on video stream analysis training is relatively complicated. Summary of the invention
[0004] In order to solve the above problems, the present invention provides a method and device for reasoning key points of human skeleton based on video stream analysis training, which can reduce the task processing complexity of reasoning key points of human skeleton based on video stream analysis training.
[0005] In a first aspect, the present invention provides a method for reasoning key points of human skeletons trained by video stream analysis, comprising:
[0006] Extract a single-frame image from a video stream, characterize the single-frame image as an image vector using a coding layer in a preset skeleton key point recognition model, identify a first skeleton key point in the single-frame image based on the image vector using a hidden layer in the preset skeleton key point recognition model, and perform key point decoding on the first skeleton key point using a decoding layer in the preset skeleton key point recognition model to obtain a decoded key point;
[0007] Connecting the decoded key points into a skeleton line, and determining whether the skeleton line is a human skeleton line;
[0008] When the skeleton line is not the human skeleton line, a first skeleton key point loss between the decoded key point and a preset real skeleton key point is calculated, and the first skeleton key point loss is used to complete the recognition ability training of the skeleton key point of the preset skeleton key point recognition model to obtain a trained skeleton key point recognition model;
[0009] Outputting a second skeleton key point of the single-frame image using the trained skeleton key point recognition model, and performing grid division on the single-frame image based on the key point distribution of the second skeleton key point in the single-frame image to obtain a divided grid;
[0010] Performing grid rotation and translation on the divided grid to obtain a rotated and translated grid, extracting adjacent single-frame images of the single-frame image where the rotated and translated grid is located from the video stream, and querying similar grids of the rotated and translated grid from the adjacent single-frame images;
[0011] Determine a third skeletal key point in the similar grid, calculate a second skeletal key point loss between the third skeletal key point and a preset real third skeletal key point, use the second skeletal key point loss to complete the training of the motion tracking capability of the skeletal key points in the video stream, obtain a motion tracking capability training result, and use the motion tracking capability training result as the human skeletal key point inference result in the video stream.
[0012] In a possible implementation manner of the first aspect, the coding layer includes:
[0013] The single frame image is converted into a continuous vector using the following formula:
[0014] x'=concat[conv(dwconv(x)),conv(dwconv(conv(x)))]
[0015] Wherein, x' represents the continuous vector, x represents the single frame image, dwconv represents the depthwise separable convolutional layer, conv represents the convolutional layer, and concat represents the concatenation symbol;
[0016] Converting the continuous vector into a vector matrix;
[0017] Performing matrix transposition on the vector matrix to obtain a transposed matrix;
[0018] The image vector is extracted from the transposed matrix.
[0019] In a possible implementation manner of the first aspect, the hidden layer includes:
[0020] The image vector is dimensionally mapped using the following formula to obtain a mapping vector:
[0021] X'=F(αX)
[0022] Wherein, X' represents the mapping vector, X represents the image vector, α represents the scaling factor, and F represents the dimension mapping function;
[0023] The mapping vector is used as the first bone key point.
[0024] In a possible implementation of the first aspect, the determining whether the skeleton line is a human skeleton line includes:
[0025] Calculating the invariant moment feature, histogram feature and wavelet moment feature of the skeleton circuit;
[0026] The invariant moment feature, the histogram feature and the wavelet moment feature are fused using the following formula to obtain a fusion feature:
[0027] T 1 =ρ{w 3 [concat[(w 1 (concat(t 1 ,t 2 ))+b 1 ),(w 2 (concat(t 2 ,t 3 ))+b 2 )]]+b 3}
[0028] Among them, T 1 represents the fusion feature, t 1 represents the invariant moment characteristic, t 2 represents the histogram feature, t 3 represents the wavelet moment characteristics, w 1 、w 2 、w 3 represents the weight coefficient of the neural network, b 1 , b 2 , b 3 represents bias, ρ represents activation function, and concat represents concatenation symbol;
[0029] The following formula is used to perform Gaussian filtering on the skeleton line to obtain the scale transformation feature:
[0030] L(x,y,σ)=G(x,y,σ)*I(x,y)
[0031] Wherein, L(x, y, σ) represents the scale transformation feature, I(x, y) represents the image formed by the skeleton line, (x, y) represents the pixel coordinates, G(x, y, σ) represents the Gaussian function, and σ represents the size of the scale space;
[0032] Splicing the fusion feature and the scale transformation feature to obtain a splicing feature, and inputting the splicing feature into a preset posture category classifier to output the posture category corresponding to the skeleton line through the preset posture category classifier;
[0033] The posture category is used to determine whether the skeleton line is a human skeleton line.
[0034] In a possible implementation manner of the first aspect, the calculating the first skeleton key point loss between the decoded key point and the preset real skeleton key point includes:
[0035] The first skeleton key point loss between the decoded key point and the preset real skeleton key point is calculated using the following formula:
[0036]
[0037] Among them, L 1 represents the first skeleton key point loss, d k represents the Euclidean distance between the kth key point in the decoded key points and the kth key point in the preset real skeleton key points, s represents the area of the image formed by the decoded key points, γ k represents the standard deviation between the kth key point in the decoded key point and the kth key point in the preset real skeleton key point, K is the total number of key points in the decoded key point, δ k Indicates the visibility flag of the kth key point in the decoded key points.
[0038] In a possible implementation manner of the first aspect, the gridding of the single-frame image based on the key point distribution of the second skeleton key point in the single-frame image to obtain the divided grid includes:
[0039] Identify the shortest distance between every two second skeleton key points of the second skeleton key points in the single frame image;
[0040] Taking the shortest distance as the grid side length;
[0041] The single-frame image is meshed using the mesh side length and the second skeleton key points to obtain a mesh.
[0042] In a possible implementation manner of the first aspect, performing grid rotation and translation on the divided grid to obtain a rotation and translation grid includes:
[0043] The grid is rotated and translated using the following formula to obtain a rotation-translation grid:
[0044] (x′,y′)={(x * cos(θ)-y ★ sin(θ))+dx,(x ★ sin(θ)+y ★ cos(θ))+dy}
[0045] Where (x′, y′) represents the rotation and translation grid, x * ,y ★ represents the divided grid, θ represents the rotation angle, dx represents the horizontal translation distance, and dy represents the vertical translation distance.
[0046] In a possible implementation of the first aspect, the calculating the second skeleton key point loss between the third skeleton key point and a preset real third skeleton key point includes:
[0047] The second skeleton key point loss between the third skeleton key point and the preset true third skeleton key point is calculated using the following formula:
[0048]
[0049] Among them, L 2 represents the second skeleton key point loss, d i represents the Euclidean distance between the ith skeletal key point in the third skeletal key point and the ith skeletal key point in the preset real third skeletal key point, δ represents the visibility flag, T k Indicates the preset threshold value, ranging from 0 to 0.1, d def Represents the scale factor.
[0050] In a possible implementation of the first aspect, the using the second skeleton key point loss to complete the training of the motion tracking ability of the skeleton key points in the video stream to obtain the motion tracking ability training result includes:
[0051] Obtaining a rotation angle and a translation distance of grid rotation and translation of the divided grid;
[0052] Based on the second skeleton key point loss, adjusting the rotation angle and the translation distance to obtain an adjusted angle and an adjusted distance;
[0053] Based on the adjustment angle and the adjustment distance, a fourth skeleton key point of the second skeleton key point in the adjacent single-frame image is queried, and the fourth skeleton key point is used as the motion tracking capability training result.
[0054] In a second aspect, the present invention provides a human skeleton key point reasoning device for video stream analysis training, the device comprising:
[0055] A key point decoding module is used to extract a single-frame image from a video stream, characterize the single-frame image as an image vector using a coding layer in a preset skeleton key point recognition model, identify a first skeleton key point in the single-frame image based on the image vector using a hidden layer in the preset skeleton key point recognition model, and perform key point decoding on the first skeleton key point using a decoding layer in the preset skeleton key point recognition model to obtain a decoded key point;
[0056] A line determination module, used for connecting the decoded key points into a skeleton line and determining whether the skeleton line is a human skeleton line;
[0057] A model training module, used for calculating the first bone key point loss between the decoded key point and the preset real bone key point when the bone line is not the human body bone line, and using the first bone key point loss to complete the recognition ability training of the bone key point of the preset bone key point recognition model to obtain a trained bone key point recognition model;
[0058] A grid division module, used for outputting a second skeleton key point of the single-frame image by using the trained skeleton key point recognition model, and performing grid division on the single-frame image based on the key point distribution of the second skeleton key point in the single-frame image to obtain a divided grid;
[0059] A grid query module is used to perform grid rotation and translation on the divided grid to obtain a rotated and translated grid, extract adjacent single-frame images of the single-frame image where the rotated and translated grid is located from the video stream, and query similar grids of the rotated and translated grid from the adjacent single-frame images;
[0060] A tracking training module is used to determine the third skeletal key point in the similar grid, calculate the second skeletal key point loss between the third skeletal key point and the preset real third skeletal key point, use the second skeletal key point loss to complete the motion tracking ability training of the skeletal key points in the video stream, obtain the motion tracking ability training result, and use the motion tracking ability training result as the human skeletal key point inference result in the video stream.
[0061] Compared with the prior art, the technical principle and beneficial effects of this solution are:
[0062] The embodiment of the present invention uses the encoding layer in the preset skeleton key point recognition model to represent the single frame image as an image vector for converting the single frame image into vector data that can be recognized by the deep learning model. The embodiment of the present invention determines whether the skeleton line is a human skeleton line to determine whether the posture formed by the skeleton line conforms to the human posture. Furthermore, the embodiment of the present invention calculates the first skeleton key point loss between the decoded key point and the preset real skeleton key point, so as to subsequently use the first skeleton key point loss to adjust and optimize the parameters in the preset skeleton key point recognition model, and divides the loss calculation originally taken in one step into the loss calculation of two steps, namely, key point recognition and subsequent key point tracking, thereby reducing the complexity of key point recognition and tracking training. By dividing the single-frame image into a grid based on the key point distribution of the second skeleton key point in the single-frame image, the grid is rotated and translated in the subsequent step to increase the matching degree with the pixel grid in other frames, so as to query the skeleton key point corresponding to the second skeleton key point in other frames, and realize the tracking of the skeleton key point in different frames. Furthermore, the embodiment of the present invention calculates the second skeleton key point loss between the third skeleton key point and the preset real third skeleton key point, so as to calculate the loss of tracking the key point in the video stream, thereby optimizing the tracking ability of the key point in the video stream, so that the loss calculation originally taken in one step can be divided into the loss calculation of the two steps of key point recognition and key point tracking, and the complexity of the training of key point recognition and tracking can be reduced by layered training. Therefore, the human skeleton key point reasoning method and device for video stream analysis training proposed in the embodiment of the present invention can reduce the complexity of the skeleton key point reasoning task. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0064] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0065] Figure 1 A schematic diagram of a flow chart of a method for reasoning key points of human skeletons by video stream analysis training provided by one embodiment of the present invention;
[0066] Figure 2 In one embodiment of the present invention Figure 1A schematic diagram of one of the steps of a method for inferring key points of human skeletons trained by video stream analysis is provided;
[0067] Figure 3 In one embodiment of the present invention Figure 1 A schematic diagram of another step of a method for inferring key points of human skeletons trained by video stream analysis is provided;
[0068] Figure 4 A schematic diagram of a module of a human skeleton key point inference device for video stream analysis training provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0069] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0070] The embodiment of the present invention provides a method for reasoning key points of human skeletons for video stream analysis training, and the execution subject of the method for reasoning key points of human skeletons for video stream analysis training includes but is not limited to at least one of the electronic devices that can be configured to execute the method provided by the embodiment of the present invention, such as a server, a terminal, etc. In other words, the method for reasoning key points of human skeletons for video stream analysis training can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
[0071] See also Figure 1 FIG. 1 is a flow chart of a method for reasoning key points of human skeletons by video stream analysis training provided by an embodiment of the present invention. Figure 1 The human skeleton key point inference method for video stream analysis training described in includes:
[0072] S1. Extract a single-frame image from a video stream, characterize the single-frame image as an image vector using a coding layer in a preset skeleton key point recognition model, identify a first skeleton key point in the single-frame image based on the image vector using a hidden layer in the preset skeleton key point recognition model, and perform key point decoding on the first skeleton key point using a decoding layer in the preset skeleton key point recognition model to obtain a decoded key point.
[0073] The embodiment of the present invention represents the single-frame image as an image vector by utilizing the encoding layer in the preset skeletal key point recognition model, so as to convert the single-frame image into vector data that can be recognized by the deep learning model.
[0074] In one embodiment of the present invention, the coding layer includes: converting the single frame image into a continuous vector using the following formula:
[0075] x'=concat[conv(dwconv(x)),conv(dwconv(conv(x)))]
[0076] Wherein, x' represents the continuous vector, x represents the single frame image, dwconv represents the depthwise separable convolutional layer, conv represents the convolutional layer, and concat represents the concatenation symbol;
[0077] The continuous vector is converted into a vector matrix; the vector matrix is transposed to obtain a transposed matrix; and the image vector is extracted from the transposed matrix.
[0078] Optionally, the process of converting the continuous vector into a vector matrix is to divide the associative vector into equidistant segments, and each divided equidistant vector is used as a row in the vector matrix. Further, the process of extracting the image vector from the transposed matrix is to splice multiple rows of vectors into one row of vectors.
[0079] In one embodiment of the present invention, the hidden layer includes: performing dimension mapping on the image vector using the following formula to obtain a mapping vector:
[0080] X'=F(αX)
[0081] Wherein, X' represents the mapping vector, X represents the image vector, α represents the scaling factor, and F represents the dimension mapping function;
[0082] The mapping vector is used as the first bone key point.
[0083] The dimension mapping function is used to map the image vector from each dimension of the input feature space to one or more dimensions in the output feature space.
[0084] Optionally, the process of performing key point decoding on the first skeleton key point by using the decoding layer in the preset skeleton key point recognition model to obtain the decoded key point is a process of restoring the vector constituted by the first skeleton key point to an image form.
[0085] S2. Connect the decoded key points into a skeleton line, and determine whether the skeleton line is a human skeleton line.
[0086] The embodiment of the present invention determines whether the skeleton line is a human skeleton line, so as to determine whether the posture formed by the skeleton line conforms to the human body posture.
[0087] In one embodiment of the present invention, the determining whether the skeleton line is a human skeleton line includes: calculating the invariant moment feature, the histogram feature and the wavelet moment feature of the skeleton line; and fusing the invariant moment feature, the histogram feature and the wavelet moment feature using the following formula to obtain a fusion feature:
[0088] T 1 =ρ{w 3 [concat[(w 1 (concat(t 1 ,t 2 ))+b 1 ),(w 2 (concat(t 2 ,t 3 ))+b 2 )]]+b 3}
[0089] Among them, T 1 represents the fusion feature, t 1 represents the invariant moment characteristic, t 2 represents the histogram feature, t 3 represents the wavelet moment characteristics, w 1 、w 2 、w 3 represents the weight coefficient of the neural network, b 1 , b 2 , b 3 represents bias, ρ represents activation function, and concat represents concatenation symbol;
[0090] The following formula is used to perform Gaussian filtering on the skeleton line to obtain the scale transformation feature:
[0091] L(x,y,σ)=G(x,y,σ)*I(x,y)
[0092] Wherein, L(x, y, σ) represents the scale transformation feature, I(x, y) represents the image formed by the skeleton line, (x, y) represents the pixel coordinates, G(x, y, σ) represents the Gaussian function, and σ represents the size of the scale space;
[0093] The fusion feature and the scale transformation feature are spliced to obtain a spliced feature, and the spliced feature is input into a preset posture category classifier to output the posture category corresponding to the skeleton line through the preset posture category classifier; and the posture category is used to complete the judgment of whether the skeleton line is a human skeleton line.
[0094] The posture categories include sitting, standing, sleeping, bending, and other posture categories. It should be noted that the "other" represents a category that does not belong to the human body posture category.
[0095] S3. When the skeleton line is not the human skeleton line, calculate the first skeleton key point loss between the decoded key point and the preset real skeleton key point, and use the first skeleton key point loss to complete the recognition ability training of the skeleton key point of the preset skeleton key point recognition model to obtain a trained skeleton key point recognition model.
[0096] When the skeleton line is not the human skeleton line, it means that the posture category formed by the skeleton line does not belong to the human posture category, which also shows that the identified skeleton key points are inaccurate.
[0097] Furthermore, an embodiment of the present invention calculates the first skeletal key point loss between the decoded key point and the preset real skeletal key point, so as to subsequently use the first skeletal key point loss to adjust and optimize the parameters in the preset skeletal key point recognition model, and divides the original one-step loss calculation into two-step loss calculations of key point recognition and subsequent key point tracking, thereby reducing the complexity of key point recognition and tracking training.
[0098] In one embodiment of the present invention, the calculation of the first skeleton key point loss between the decoded key point and the preset real skeleton key point includes: calculating the first skeleton key point loss between the decoded key point and the preset real skeleton key point using the following formula:
[0099]
[0100] Among them, L 1 represents the first skeleton key point loss, d k represents the Euclidean distance between the kth key point in the decoded key points and the kth key point in the preset real skeleton key points, s represents the area of the image formed by the decoded key points, γ k represents the standard deviation between the kth key point in the decoded key point and the kth key point in the preset real skeleton key point, K is the total number of key points in the decoded key point, δ k Indicates the visibility flag of the kth key point in the decoded key points.
[0101] Optionally, the process of using the first bone key point loss to complete the recognition ability training of the bone key points of the preset bone key point recognition model to obtain the trained bone key point recognition model is: using the first bone key point loss to adjust and optimize the weights, biases and other parameters in the preset bone key point recognition model, thereby improving the bone key point recognition accuracy of the preset bone key point recognition model.
[0102] S4. Utilize the trained skeleton key point recognition model to output the second skeleton key point of the single-frame image, and based on the key point distribution of the second skeleton key point in the single-frame image, grid the single-frame image to obtain a divided grid.
[0103] The embodiment of the present invention divides the single-frame image into a grid based on the key point distribution of the second skeleton key point in the single-frame image, so as to subsequently rotate and translate the grid to increase the matching degree with the pixel point grids in other frames, thereby querying the skeleton key points corresponding to the second skeleton key points in other frames, thereby realizing the tracking of the skeleton key points on different frames.
[0104] In one embodiment of the present invention, referring to Figure 2 As shown, the single-frame image is meshed based on the key point distribution of the second skeleton key point in the single-frame image to obtain a mesh, including:
[0105] S201, identifying the shortest distance between every two second skeleton key points of the second skeleton key points in the single-frame image;
[0106] S202, taking the shortest distance as the grid side length;
[0107] S203, using the mesh side length and the second skeleton key points to complete mesh division of the single frame image to obtain a divided mesh.
[0108] Optionally, the process of completing grid division of the single-frame image using the grid side length and the second skeleton key point is to include only one second skeleton key point in the square formed by the grid side length, that is, one second skeleton key point corresponds to one square formed by the grid side length.
[0109] S5. Perform grid rotation and translation on the divided grid to obtain a rotated and translated grid, extract adjacent single-frame images of the single-frame image where the rotated and translated grid is located from the video stream, and query similar grids of the rotated and translated grid from the adjacent single-frame images.
[0110] In one embodiment of the present invention, performing mesh rotation and translation on the divided grid to obtain the rotation and translation mesh includes: performing mesh rotation and translation on the divided grid using the following formula to obtain the rotation and translation mesh:
[0111] (x′,y′)={(x * cos(θ)-y ★ sin(θ))+dx,(x ★ sin(θ)+y ★ cos(θ))+dy}
[0112] Where (x′, y′) represents the rotation and translation grid, x * ,y ★ represents the divided grid, θ represents the rotation angle, dx represents the horizontal translation distance, and dy represents the vertical translation distance.
[0113] Optionally, the process of querying similar grids of the rotation and translation grid from the adjacent single-frame images is a process of calculating similarities between pixel points in the rotation and translation grid and pixel points in the adjacent single-frame images.
[0114] S6. Determine the third skeletal key point in the similar grid, calculate the second skeletal key point loss between the third skeletal key point and the preset real third skeletal key point, use the second skeletal key point loss to complete the motion tracking ability training of the skeletal key points in the video stream, obtain the motion tracking ability training result, and use the motion tracking ability training result as the human skeletal key point inference result in the video stream.
[0115] The third skeleton key point refers to a point in the similar grid having the highest similarity to the second skeleton key point in the divided grid.
[0116] Furthermore, the embodiment of the present invention calculates the loss of the second skeletal key point between the third skeletal key point and the preset real third skeletal key point to perform the loss calculation for tracking the key point in the video stream, thereby optimizing the tracking capability of the key point in the video stream. In this way, the loss calculation originally performed in one step can be divided into the loss calculation of two steps, namely, key point recognition and key point tracking. The complexity of training for key point recognition and tracking can be reduced through layered training.
[0117] In one embodiment of the present invention, the calculating of the second skeleton key point loss between the third skeleton key point and the preset real third skeleton key point includes: calculating the second skeleton key point loss between the third skeleton key point and the preset real third skeleton key point using the following formula:
[0118]
[0119] Among them, L 2 represents the second skeleton key point loss, d i represents the Euclidean distance between the ith skeletal key point in the third skeletal key point and the ith skeletal key point in the preset real third skeletal key point, δ represents the visibility flag, T k Indicates the preset threshold value, ranging from 0 to 0.1, d def Represents the scale factor.
[0120] In one embodiment of the present invention, referring to Figure 3 As shown, the use of the second skeleton key point loss to complete the training of the motion tracking ability of the skeleton key points in the video stream to obtain the motion tracking ability training result includes:
[0121] S301, obtaining a rotation angle and a translation distance of grid rotation and translation of the divided grid;
[0122] S302, adjusting the rotation angle and the translation distance based on the second skeleton key point loss to obtain an adjusted angle and an adjusted distance;
[0123] S303: Based on the adjustment angle and the adjustment distance, query the fourth skeleton key point of the second skeleton key point in the adjacent single-frame image, and use the fourth skeleton key point as the motion tracking capability training result.
[0124] It can be seen that the embodiment of the present invention uses the encoding layer in the preset skeleton key point recognition model to represent the single frame image as an image vector, so as to convert the single frame image into vector data that can be recognized by the deep learning model. The embodiment of the present invention determines whether the skeleton line is a human skeleton line to determine whether the posture formed by the skeleton line conforms to the human posture. Furthermore, the embodiment of the present invention calculates the first skeleton key point loss between the decoded key point and the preset real skeleton key point, so as to subsequently use the first skeleton key point loss to adjust and optimize the parameters in the preset skeleton key point recognition model, and divides the loss calculation originally taken in one step into the loss calculation of two steps, namely, key point recognition and subsequent key point tracking, thereby reducing the complexity of key point recognition and tracking training. The embodiment divides the single-frame image into grids based on the key point distribution of the second skeleton key point in the single-frame image, so as to rotate and translate the grid later to increase the matching degree with the pixel point grid in other frames, so as to query the skeleton key point corresponding to the second skeleton key point in other frames, and realize the tracking of skeleton key points on different frames. Furthermore, the embodiment of the present invention calculates the second skeleton key point loss between the third skeleton key point and the preset real third skeleton key point, so as to calculate the loss of tracking the key point in the video stream, thereby optimizing the tracking ability of the key point in the video stream, so that the loss calculation originally taken in one step can be divided into the loss calculation of the two steps of key point recognition and key point tracking, and the complexity of the training of key point recognition and tracking can be reduced by layered training. Therefore, the human skeleton key point reasoning method for video stream analysis training proposed in the embodiment of the present invention can reduce the complexity of the skeleton key point reasoning task.
[0125] like Figure 4 Shown is a functional module diagram of the human skeleton key point reasoning device for video stream analysis training of the present invention.
[0126] The human skeleton key point reasoning device 400 for video stream analysis training of the present invention can be installed in an electronic device. According to the functions implemented, the human skeleton key point reasoning device for video stream analysis training can include a key point decoding module 401, a line discrimination module 402, a model training module 403, a grid division module 404, a grid query module 405 and a tracking training module 406. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.
[0127] In the embodiment of the present invention, the functions of each module / unit are as follows:
[0128] The key point decoding module 401 is used to extract a single frame image from a video stream, characterize the single frame image as an image vector using a coding layer in a preset skeleton key point recognition model, identify a first skeleton key point in the single frame image based on the image vector using a hidden layer in the preset skeleton key point recognition model, and perform key point decoding on the first skeleton key point using a decoding layer in the preset skeleton key point recognition model to obtain a decoded key point;
[0129] The line determination module 402 is used to connect the decoded key points into a skeleton line and determine whether the skeleton line is a human skeleton line;
[0130] The model training module 403 is used to calculate the first bone key point loss between the decoded key point and the preset real bone key point when the bone line is not the human bone line, and use the first bone key point loss to complete the recognition ability training of the bone key point of the preset bone key point recognition model to obtain a trained bone key point recognition model;
[0131] The grid division module 404 is used to output the second skeleton key point of the single frame image by using the trained skeleton key point recognition model, and to grid the single frame image based on the key point distribution of the second skeleton key point in the single frame image to obtain a divided grid;
[0132] The grid query module 405 is used to perform grid rotation and translation on the divided grid to obtain a rotated and translated grid, extract adjacent single-frame images of the single-frame image where the rotated and translated grid is located from the video stream, and query similar grids of the rotated and translated grid from the adjacent single-frame images;
[0133] The tracking training module 406 is used to determine the third skeletal key point in the similar grid, calculate the second skeletal key point loss between the third skeletal key point and the preset real third skeletal key point, and use the second skeletal key point loss to complete the training of the motion tracking ability of the skeletal key points in the video stream to obtain the motion tracking ability training result, and use the motion tracking ability training result as the human skeletal key point inference result in the video stream.
[0134] In detail, the modules in the human skeleton key point reasoning device 400 for video stream analysis training in the embodiment of the present invention are used in the same manner as above. Figures 1 to 3 The human skeleton key point inference method for video stream analysis training described in the invention has the same technical means and can produce the same technical effects, so I will not go into details here.
[0135] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0136] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0137] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0138] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0139] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.
Claims
1. A human skeleton key point inference method trained by video stream analysis, It is characterized in that The method comprises: Extract a single-frame image from a video stream, characterize the single-frame image as an image vector using a coding layer in a preset skeleton key point recognition model, identify a first skeleton key point in the single-frame image based on the image vector using a hidden layer in the preset skeleton key point recognition model, and perform key point decoding on the first skeleton key point using a decoding layer in the preset skeleton key point recognition model to obtain a decoded key point; Connecting the decoded key points into a skeleton line, and determining whether the skeleton line is a human skeleton line; When the skeleton line is not the human skeleton line, a first skeleton key point loss between the decoded key point and a preset real skeleton key point is calculated, and the first skeleton key point loss is used to complete the recognition ability training of the skeleton key point of the preset skeleton key point recognition model to obtain a trained skeleton key point recognition model; Outputting a second skeleton key point of the single-frame image using the trained skeleton key point recognition model, and performing grid division on the single-frame image based on the key point distribution of the second skeleton key point in the single-frame image to obtain a divided grid; Performing grid rotation and translation on the divided grid to obtain a rotated and translated grid, extracting adjacent single-frame images of the single-frame image where the rotated and translated grid is located from the video stream, and querying similar grids of the rotated and translated grid from the adjacent single-frame images; Determine a third skeleton key point in the similar grid, calculate a second skeleton key point loss between the third skeleton key point and a preset real third skeleton key point, use the second skeleton key point loss to complete the training of the motion tracking ability of the skeleton key points in the video stream, obtain a motion tracking ability training result, and use the motion tracking ability training result as the human skeleton key point inference result in the video stream; The third skeleton key point refers to the point in the similar grid with the highest similarity to the second skeleton key point in the divided grid; The calculating of the second skeleton key point loss between the third skeleton key point and the preset real third skeleton key point includes: The second skeleton key point loss between the third skeleton key point and the preset true third skeleton key point is calculated using the following formula: Among them, L 2 represents the second skeleton key point loss, d i represents the Euclidean distance between the ith skeletal key point in the third skeletal key point and the ith skeletal key point in the preset real third skeletal key point, δ represents the visibility flag, T k Indicates the preset threshold value, ranging from 0 to 0.1, d def represents the scale factor; The method of using the second skeleton key point loss to complete the training of the motion tracking ability of the skeleton key points in the video stream to obtain the motion tracking ability training result includes: Obtaining a rotation angle and a translation distance of grid rotation and translation of the divided grid; Based on the second skeleton key point loss, adjusting the rotation angle and the translation distance to obtain an adjusted angle and an adjusted distance; Based on the adjustment angle and the adjustment distance, a fourth skeleton key point of the second skeleton key point in the adjacent single-frame image is queried, and the fourth skeleton key point is used as the motion tracking capability training result.
2. The method according to claim 1, It is characterized in that The coding layer comprises: The single frame image is converted into a continuous vector using the following formula: x'=concat[conv(dwconv(x)),conv(dwconv(conv(x)))] Wherein, x' represents the continuous vector, x represents the single frame image, dwconv represents the depthwise separable convolutional layer, conv represents the convolutional layer, and concat represents the concatenation symbol; Converting the continuous vector into a vector matrix; Performing matrix transposition on the vector matrix to obtain a transposed matrix; The image vector is extracted from the transposed matrix.
3. The method according to claim 1, It is characterized in that The hidden layer includes: The image vector is dimensionally mapped using the following formula to obtain a mapping vector: X'=F(αX) Wherein, X' represents the mapping vector, X represents the image vector, α represents the scaling factor, and F represents the dimension mapping function; The mapping vector is used as the first bone key point.
4. The method according to claim 1, It is characterized in that The step of determining whether the skeleton line is a human skeleton line comprises: Calculating the invariant moment feature, histogram feature and wavelet moment feature of the skeleton circuit; The invariant moment feature, the histogram feature and the wavelet moment feature are fused using the following formula to obtain a fusion feature: T 1 =ρ{w 3 [concat[(w 1 (concat(t 1 ,t 2 ))+b 1 ),(w 2 (concat(t 2 ,t 3 ))+b 2 )]]+b 3 } Among them, T 1 represents the fusion feature, t 1 represents the invariant moment characteristic, t 2 represents the histogram feature, t 3 represents the wavelet moment characteristics, w 1 、w 2 、w 3 represents the weight coefficient of the neural network, b 1 、b 2 、b 3 represents bias, ρ represents activation function, and concat represents concatenation symbol; The following formula is used to perform Gaussian filtering on the skeleton line to obtain the scale transformation feature: L(x,y,σ)=G(x,y,σ)*I(x,y) Wherein, L(x, y, σ) represents the scale transformation feature, I(x, y) represents the image formed by the skeleton line, (x, y) represents the pixel coordinates, G(x, y, σ) represents the Gaussian function, and σ represents the size of the scale space; Splicing the fusion feature and the scale transformation feature to obtain a splicing feature, and inputting the splicing feature into a preset posture category classifier to output the posture category corresponding to the skeleton line through the preset posture category classifier; The posture category is used to determine whether the skeleton line is a human skeleton line.
5. The method according to claim 1, It is characterized in that The calculating of the first skeleton key point loss between the decoded key point and the preset real skeleton key point includes: The first skeleton key point loss between the decoded key point and the preset real skeleton key point is calculated using the following formula: Among them, L 1 represents the first skeleton key point loss, d k represents the Euclidean distance between the kth key point in the decoded key points and the kth key point in the preset real skeleton key points, s represents the area of the image formed by the decoded key points, γ k represents the standard deviation between the kth key point in the decoded key point and the kth key point in the preset real skeleton key point, K is the total number of key points in the decoded key point, δ k Indicates the visibility flag of the kth key point in the decoded key points.
6. The method according to claim 1, It is characterized in that The step of meshing the single frame image based on the key point distribution of the second skeleton key point in the single frame image to obtain a meshed image comprises: Identify the shortest distance between every two second skeleton key points of the second skeleton key points in the single frame image; Taking the shortest distance as the grid side length; The single-frame image is meshed using the mesh side length and the second skeleton key points to obtain a mesh.
7. The method according to claim 1, It is characterized in that The step of performing grid rotation and translation on the divided grid to obtain a rotation and translation grid comprises: The grid is rotated and translated using the following formula to obtain a rotation-translation grid: (x',y')={(x * cos(θ)-y ★ sin(θ))+dx,(x ★ sin(θ)+y ★ cos(θ))+dy} Where (x', y') represents the rotation and translation grid, x * ,y ★ represents the divided grid, θ represents the rotation angle, dx represents the horizontal translation distance, and dy represents the vertical translation distance.
8. A human skeleton key point inference device trained by video stream analysis, It is characterized in that The device comprises: A key point decoding module is used to extract a single-frame image from a video stream, characterize the single-frame image as an image vector using a coding layer in a preset skeleton key point recognition model, identify a first skeleton key point in the single-frame image based on the image vector using a hidden layer in the preset skeleton key point recognition model, and perform key point decoding on the first skeleton key point using a decoding layer in the preset skeleton key point recognition model to obtain a decoded key point; A line determination module, used for connecting the decoded key points into a skeleton line, and determining whether the skeleton line is a human skeleton line; A model training module, used for calculating the first bone key point loss between the decoded key point and the preset real bone key point when the bone line is not the human body bone line, and using the first bone key point loss to complete the recognition ability training of the bone key point of the preset bone key point recognition model to obtain a trained bone key point recognition model; A grid division module, used for outputting a second skeleton key point of the single-frame image by using the trained skeleton key point recognition model, and performing grid division on the single-frame image based on the key point distribution of the second skeleton key point in the single-frame image to obtain a divided grid; A grid query module is used to perform grid rotation and translation on the divided grid to obtain a rotated and translated grid, extract adjacent single-frame images of the single-frame image where the rotated and translated grid is located from the video stream, and query similar grids of the rotated and translated grid from the adjacent single-frame images; A tracking training module is used to determine a third skeleton key point in the similar grid, calculate a second skeleton key point loss between the third skeleton key point and a preset real third skeleton key point, use the second skeleton key point loss to complete the motion tracking ability training of the skeleton key point in the video stream, obtain a motion tracking ability training result, and use the motion tracking ability training result as the human skeleton key point inference result in the video stream; The third skeleton key point refers to the point in the similar grid with the highest similarity to the second skeleton key point in the divided grid; The calculating of the second skeleton key point loss between the third skeleton key point and the preset real third skeleton key point includes: The second skeleton key point loss between the third skeleton key point and the preset true third skeleton key point is calculated using the following formula: Among them, L 2 represents the second skeleton key point loss, d i represents the Euclidean distance between the ith skeletal key point in the third skeletal key point and the ith skeletal key point in the preset real third skeletal key point, δ represents the visibility flag, T k Indicates the preset threshold value, ranging from 0 to 0.1, d def represents the scale factor; The method of using the second skeleton key point loss to complete the training of the motion tracking ability of the skeleton key points in the video stream to obtain the motion tracking ability training result includes: Obtaining a rotation angle and a translation distance of grid rotation and translation of the divided grid; Based on the second skeleton key point loss, adjusting the rotation angle and the translation distance to obtain an adjusted angle and an adjusted distance; Based on the adjustment angle and the adjustment distance, a fourth skeleton key point of the second skeleton key point in the adjacent single-frame image is queried, and the fourth skeleton key point is used as the motion tracking capability training result.
