A semi-supervised animal three-dimensional posture estimation method, device and storage medium
Through the method of semi-supervised learning and spatio-temporal constraints, the problem of high data annotation cost in animal three-dimensional posture estimation is solved, the accuracy and generalization ability of the model are improved, and more efficient data utilization is achieved.
Patent Information
- Application Number
- CN202410764290.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-09-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing animal 3D pose estimation methods rely on a large amount of labeled training data, resulting in high cost and time-consuming data annotation, and ignore useful information in unlabeled data, limiting the generalization ability and performance of the model.
Using a semi-supervised learning method, we build a multi-view shooting platform, obtain animal videos and divide the data set, establish a three-dimensional pose estimation model with spatio-temporal constraints, use the training set to train the initial model, optimize the model performance based on spatio-temporal constraints, and reduce the need for labeled data. rely.
It improves the accuracy and generalization ability of three-dimensional pose estimation, reduces data labeling costs, can effectively utilize unlabeled data, and improves the performance of the model.
Smart Images

Figure CN118334755B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video image processing, and in particular to a semi-supervised animal three-dimensional posture estimation method, device and storage medium. Background Art
[0002] Animal 3D posture estimation is a key technology for studying animal behavior and is widely used in fields such as neuroscience, biology, and animal behavior. Its goal is to recover the posture information of animals in 3D space from 2D video data of animals.
[0003] However, due to the diversity of animal morphology, complex background environment, and the influence of factors such as perspective and lighting, the 3D pose estimation of animals is extremely challenging. In the existing technologies, most animal 3D pose estimation methods rely on deep learning techniques, especially convolutional neural networks. These methods usually require a large amount of labeled training data to train the model to predict the key points of animals in video frames. However, obtaining a large number of labeled training samples is a time-consuming and expensive task, which greatly limits the application of these methods. In addition, most of the existing animal 3D pose estimation methods are fully supervised, which means that they rely entirely on labeled training data during the training process. This approach ignores a large amount of unlabeled data, which may contain useful information and can improve the generalization ability and performance of the model. Summary of the invention
[0004] The purpose of the present invention is to solve the problem that model training samples are time-consuming and costly in animal three-dimensional posture estimation. The present invention provides a semi-supervised animal three-dimensional posture estimation method, device and storage medium. The specific steps of the method include:
[0005] S1. Build a multi-view shooting platform, and use the multi-view shooting platform to shoot and obtain animal videos;
[0006] S2, divide the animal videos into data sets and mark the data in the training set;
[0007] S3. Establish a semi-supervised animal 3D posture estimation model with spatiotemporal constraints, and use the training set to train and obtain the initial model;
[0008] S4. Use the initial model to predict the posture of the test set, and optimize the model performance based on spatiotemporal constraints to obtain the final semi-supervised animal 3D posture estimation model;
[0009] S5. Input the video to be predicted into the final semi-supervised animal 3D posture estimation model to obtain the 3D posture estimation result.
[0010] Furthermore, the multi-view shooting platform is a combination of cameras, the camera positions are arranged according to different shooting angles, and after the arrangement is completed, the cameras are shot synchronously to obtain animal videos;
[0011] The specific construction steps are:
[0012] A standard coordinate system is established, cameras are arranged in the standard coordinate system and the camera position relationship is recorded. The camera parameters are calibrated by the chessboard calibration method. After the calibration is completed, a multi-view shooting platform is obtained.
[0013] Furthermore, the specific process of data set division is as follows:
[0014] The 2D video frames of all viewpoints in the animal video captured by the multi-view shooting platform at the same time are combined into the animal's 3D video frame, and the animal video is divided into a training set and a test set with the 3D video frame as the smallest unit.
[0015] Furthermore, the 3D labels taken by the labeled training set data are used to label the 2D video frames in the 3D video frames in the training set according to the posture key points of the animals, and the labels are triangulated using the calibrated camera parameters to obtain three-dimensional labeled data.
[0016] Furthermore, the semi-supervised animal 3D pose estimation model with spatiotemporal constraints consists of two parts: a multi-view volumetric 3D pose estimation network and an unsupervised framework with temporal and spatial constraints;
[0017] The multi-view volumetric 3D pose estimation network is a 3D convolutional neural network, and the working process is:
[0018] S31, using a 3D video frame as a processing unit, using a standard 2D UNet to detect the 2D center of mass of animals in all 2D video frames in a single 3D video frame, and combining the 2D center of mass of the animals through triangulation to obtain the 3D center of mass of the 3D video frame;
[0019] S32, taking the 3D centroid as the center point of the animal volume in the video frame, and obtaining the 3D volume frame of the animal in combination with the camera position relationship and the 3D centroid;
[0020] S33. Input the 3D volume frame of the animal into the 3D convolutional neural network to obtain the predicted 3D coordinates.
[0021] Furthermore, the temporal and spatial constraint framework is constructed based on the semi-supervised temporal smoothness constraint and spatial distance constraint;
[0022] The objects of the temporal smoothness constraint are the adjacent frames of the same key point, and the function expression is as follows:
[0023]
[0024] in, represents the time constraint function; is the number of 3D video frames in the training set; Indicates the number of key points; represents a labeled 3D video frame, Indicates the marked frame, Indicates the key point sequence number in the marked frame; Indicates key points The three-dimensional coordinates of
[0025] The objects of spatial distance constraint are different key points in the same video frame. The function expression is as follows:
[0026]
[0027] in, represents the spatial distance constraint function; is the distance weight factor, is the maximum value function; r is the actual distance between key point i and key point j;
[0028] Based on the established time and space constraint framework, the supervised posture regression loss is set, and the expression is as follows:
[0029]
[0030] in, represents the supervised regression loss; Indicates the number of three-dimensional key points; is the weight parameter; and They represent the real coordinates of the marked key points and the 3D coordinates of the predicted key points respectively.
[0031] Furthermore, step S4 is specifically as follows:
[0032] The test set data is input into the initial model to obtain the prediction results. The predicted labels of the test set data and the real labels of the training set are used together for training. After the objects with spatial distance constraints are replaced with the representations of the same key points in different frames, the modified spatial distance constraints are used for filtering and correction. Finally, the predicted labels that meet the modified spatial distance constraints are retained, and the model is optimized by continuous iteration in the process.
[0033] Furthermore, step S5 is specifically as follows:
[0034] The video to be predicted is input into the optimized model to obtain the prediction results of the 3D key points of each frame, and the 3D posture estimation results of the animal are obtained by using the relative position change relationship of the 3D key points in the video.
[0035] A storage medium stores instructions and data for implementing a semi-supervised animal three-dimensional posture estimation method.
[0036] A computer device comprises: a processor and the storage medium; the processor loads and executes instructions and data in the storage medium to implement a semi-supervised animal three-dimensional posture estimation method.
[0037] The beneficial effects of the technical solution provided by the present invention are as follows: the present invention establishes a semi-supervised animal three-dimensional posture estimation model with spatiotemporal constraints, uses a training set to train to obtain an initial model, uses the initial model to predict the posture of a test set, and optimizes the model performance based on spatial constraints to obtain the final semi-supervised animal three-dimensional posture estimation model, which has higher accuracy, better generalization ability, and lower data annotation cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0039] Figure 1 is a flow chart of a semi-supervised animal three-dimensional posture estimation method in an embodiment of the present invention;
[0040] Figure 2 This is a schematic diagram of key points of experimental animal postures in an embodiment of the present invention:
[0041] 1 left ear, 2 right ear, 3 nose, 4 top of spine, 5 middle of spine, 6 top of tail, 7 middle of tail, 8 end of tail, 9 left front paw, 10 left front wrist, 11 left front elbow, 12 left front shoulder, 13 right front paw, 14 right front wrist, 15 right front elbow, 16 right front shoulder, 17 left hind paw, 18 left hind ankle, 19 left hind knee, 20 right hind paw, 21 right hind ankle, 22 right hind knee;
[0042] Figure 3 is a schematic diagram of 3D marking processing of 2D video frames of different viewing angles in an embodiment of the present invention;
[0043] Figure 4 is a schematic diagram of a time and space constraint framework in an embodiment of the present invention;
[0044] Figure 5 is a schematic diagram of prediction results of some video frames in a video to be predicted in an embodiment of the present invention;
[0045] Figure 6 It is a schematic diagram of the operation of the hardware device in the embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described in detail with reference to the accompanying drawings.
[0047] Embodiments of the present invention provide a semi-supervised animal three-dimensional posture estimation method, device and storage medium.
[0048] Please refer to Figure 1 , Figure 1 : is a flow chart of a semi-supervised animal three-dimensional posture estimation method in an embodiment of the present invention, which specifically includes the following steps:
[0049] The first step is to build a multi-view shooting platform to capture animal videos.
[0050] The multi-view shooting platform is a combination of cameras. The camera positions are arranged according to different shooting angles. After the arrangement is completed, the shooting is synchronized to obtain animal videos. In this embodiment, mice are used as experimental subjects.
[0051] The specific construction steps are:
[0052] A standard coordinate system is established, cameras are arranged in the standard coordinate system and the camera position relationship is recorded. The camera parameters are calibrated by the chessboard calibration method. After the calibration is completed, a multi-view shooting platform is obtained.
[0053] In this embodiment, the multi-view shooting platform includes three cameras, and the camera parameters are calibrated using a checkerboard calibration method. The calibrated camera parameters include external parameters and internal parameters, both of which are expressed in matrix form.
[0054] The mathematical expression of the external parameter matrix is as follows:
[0055]
[0056] in, Indicates The extrinsic matrix of the camera; Indicates The 3D rotation matrix of the camera; Indicates The translation matrix of the camera.
[0057] The mathematical expression of the internal parameter matrix is as follows:
[0058]
[0059] in, Indicates The intrinsic parameter matrix of each camera; , Indicates The focal length of the camera; , Indicates The principal point coordinates of the camera; For the The skew parameters of the cameras.
[0060] The second step is to divide the animal videos into data sets and mark the data in the training set.
[0061] The specific process of data set division is as follows:
[0062] The 2D video frames of all viewpoints in the animal video captured by the multi-view shooting platform at the same time are combined into the animal's 3D video frame, and the animal video is divided into a training set and a test set with the 3D video frame as the smallest unit.
[0063] The 3D labels used to label the training set data are implemented based on the software package Label3D. Label3D can simultaneously display 2D video frames from all views of the multi-view shooting platform, and label the 2D video frames in the 3D video frames in the training set according to the key points of the animal's posture, such as Figure 3 As shown in , the label is triangulated using the corrected camera parameters to obtain the three-dimensional true label. Figure 2 As shown, according to the movement habits of mice, this embodiment selects a total of 22 posture key points, namely left ear, right ear, nose, top of spine, middle of spine, top of tail, middle of tail, end of tail, left front paw, left forearm, left forearm, left forearm, left forearm, left forearm, right forearm, right forearm, right forearm, left hind paw, left hind ankle, left hind knee, right hind paw, right hind ankle and right hind knee.
[0064] The third step is to establish a semi-supervised animal 3D posture estimation model with spatiotemporal constraints and use the training set to obtain the initial model.
[0065] The semi-supervised animal 3D pose estimation model with spatiotemporal constraints consists of two parts: a multi-view volumetric 3D pose estimation network and an unsupervised temporal and spatial constraint framework.
[0066] The multi-view volumetric 3D pose estimation network is a 3D convolutional neural network, and the working process is:
[0067] In step 1, the 3D video frame is used as the processing unit, and the 2D center of mass of the animals in all 2D video frames in a single 3D video frame is detected using the standard 2D UNet, and the 3D center of mass of the 3D video frame is obtained by triangulation combined with the 2D center of mass of the animals.
[0068] Step 2: Use the 3D centroid as the center point of the animal volume in the video frame, and combine the camera position relationship with the 3D centroid to obtain the 3D volume frame of the animal.
[0069] Step 3: Input the 3D volume frame of the animal into the 3D convolutional neural network to obtain the predicted 3D coordinates.
[0070] The temporal and spatial constraint framework is constructed based on temporal smoothness constraints and spatial distance constraints;
[0071] The objects of the temporal smoothness constraint are adjacent frames of the same key point. The temporal smoothness constraint means that at a high frame rate, the animal's motion speed per frame is very low, and their overall motion trajectory should usually be smooth, rather than abrupt or discontinuous. The function expression is as follows:
[0072]
[0073] in, represents the time constraint function; is the number of 3D video frames in the training set; Indicates the number of key points; represents a labeled 3D video frame, Indicates the marked frame, Indicates the key point sequence number in the marked frame; Indicates key points The three-dimensional coordinates of .
[0074] This expression not only considers the first-order change of posture (i.e., velocity), but also the second-order change (i.e., acceleration). This allows the predicted posture sequence to be smooth not only in position, but also in velocity and acceleration. The goal is to minimize the second-order change of posture, so that the predicted posture sequence is as smooth as possible in velocity and acceleration.
[0075] The spatial distance constraint condition is that different key points in the same video frame should satisfy a certain distance range. The function expression is as follows:
[0076]
[0077] in, Expressed as a spatial distance constraint function; is the distance weight factor, the weight factor The setting of usually depends on the specific task requirements. and The distance between is very important for the task results, so It should be set larger, so that during the optimization process, the model will pay more attention to reducing the distance between the two key points. On the contrary, if the distance between the two key points is not so important, can be set small, and the weights can be adjusted according to the characteristics of the dataset and the constraint strength of different key points; is the maximum value function; r is the actual distance between the two points.
[0078] like Figure 4 As shown, Figure 4 is a schematic diagram of a space-time constraint framework in an embodiment of the present invention. The video frame (A) is obtained at the moment, and two label data (A, I) and (A, J) are obtained through marking. The corresponding relationship between these two labels can be used to obtain the three-dimensional space constraint conditions By using the time constraint , can be found in the unmarked and The hidden labels (B, I), (B, J), (C, I) and (C, J) are obtained from the data. Among them, A, B, C correspond to In , I and J are label data, including middle and information.
[0079] Based on the established time and space constraint framework, the supervised posture regression loss is set, and the expression is as follows:
[0080]
[0081] in, represents the supervised regression loss function; Indicates the number of three-dimensional key points; is the weight parameter; and They represent the real coordinates of the marked key points and the 3D coordinates of the predicted key points respectively.
[0082] The fourth step is to use the initial model to predict the posture of the test set and optimize the model performance based on spatiotemporal constraints to obtain the final semi-supervised animal 3D posture estimation model.
[0083] The test set data is input into the initial model to obtain the prediction results. The predicted labels of the test set data and the real labels of the training set are used together for training. After the objects with spatial distance constraints are replaced with the representations of the same key points in different frames, the modified spatial distance constraints are used for filtering and correction. Finally, the predicted labels that meet the modified spatial distance constraints are retained, and the model is optimized by continuous iteration in the process.
[0084] The fifth step is to input the video to be predicted into the final semi-supervised animal 3D posture estimation model to obtain the 3D posture estimation result.
[0085] The video to be predicted is input into the optimized model to obtain the prediction results of the 3D key points of each frame. Some prediction results are as follows Figure 5 As shown, the relative position change relationship of the three-dimensional key points in the video is used to obtain the three-dimensional posture estimation result of the animal.
[0086] Compared with the prior art, the present invention can achieve at least the following beneficial effects:
[0087] (1) Higher accuracy: In the 3D pose estimation method, the model mainly relies on labeled data for learning, which may lead to the model's weak recognition ability for some rare poses. However, by introducing spatiotemporal constraints, the model can learn the relative positions and relationships between the various parts of the animal's body, making it more accurate in prediction.
[0088] (2) Better generalization ability: Semi-supervised learning can use a large amount of unlabeled data for learning, which allows the model to not only learn the mapping relationship between posture and features from labeled data, but also learn the distribution information of data from unlabeled data. This method enables the model to have better generalization ability and make accurate predictions even when faced with unseen postures.
[0089] (3) Less labeling required: In traditional supervised learning, the performance of the model is often closely related to the quantity and quality of labeled data. However, data labeling is a time-consuming and costly process. By using semi-supervised learning based on spatiotemporal information, the model can learn from unlabeled data, thereby reducing the need for labeled data. This not only reduces the cost of data collection and labeling, but also enables the model to learn from more data, thereby improving the performance of the model.
[0090] See also Figure 6 , Figure 6 40 is a schematic diagram of the working of the hardware device of an embodiment of the present invention, wherein the hardware device specifically comprises: a computer device 401, a processor 402 and a storage medium 403.
[0091] A computer device 401: The computer device 401 implements the semi-supervised animal three-dimensional posture estimation method.
[0092] Processor 402: The processor 402 loads and executes the instructions and data in the storage medium 403 to implement the semi-supervised animal three-dimensional posture estimation method.
[0093] Storage medium 403: The storage medium 403 stores instructions and data; the storage medium 403 is used to implement the semi-supervised animal three-dimensional posture estimation method.
[0094] The beneficial effects of the present invention are as follows: the present invention establishes a semi-supervised animal three-dimensional posture estimation model with spatiotemporal constraints, uses a training set to train to obtain an initial model, uses the initial model to predict the posture of a test set, and optimizes the model performance based on spatial constraints to obtain the final semi-supervised animal three-dimensional posture estimation model, which has higher accuracy, better generalization ability, and lower data annotation cost.
[0095] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A semi-supervised animal three-dimensional posture estimation method, characterized in that: The specific steps include: S1. Build a multi-view shooting platform, and use the multi-view shooting platform to shoot and obtain animal videos; S2, divide the animal videos into data sets and mark the data in the training set; The specific process of data set division is as follows: The 2D video frames of all viewpoints in the animal video captured by the multi-view shooting platform at the same time are combined into the 3D video frame of the animal, and the animal video is divided into a training set and a test set with the 3D video frame as the smallest unit; S3. Establish a semi-supervised animal 3D posture estimation model with spatiotemporal constraints, and use the training set to train and obtain the initial model; The semi-supervised animal 3D pose estimation model with spatiotemporal constraints consists of two parts: a multi-view volumetric 3D pose estimation network and an unsupervised temporal and spatial constraint framework; The multi-view volume 3D pose estimation network is a 3D convolutional neural network, and the working process is: S31, using a 3D video frame as a processing unit, using a standard 2D UNet to detect the 2D center of mass of animals in all 2D video frames in a single 3D video frame, and combining the 2D center of mass of the animals through triangulation to obtain the 3D center of mass of the 3D video frame; S32, taking the 3D centroid as the center point of the animal volume in the video frame, and obtaining the 3D volume frame of the animal in combination with the camera position relationship and the 3D centroid; S33, inputting the 3D volume frame of the animal into the 3D convolutional neural network to obtain predicted 3D coordinates; The temporal and spatial constraint framework is constructed based on semi-supervised temporal smoothness constraints and spatial distance constraints; The objects of the temporal smoothness constraint are adjacent frames of the same key point, and the function expression is as follows: in, represents the time constraint function; is the number of 3D video frames in the training set; Indicates the number of key points; represents a labeled 3D video frame, Indicates the marked frame, Indicates the key point sequence number in the marked frame; Indicates key points The three-dimensional coordinates of The objects of the spatial distance constraint are different key points in the same video frame, and the function expression is as follows: in, represents the spatial distance constraint function; is the distance weight factor, is the maximum value function; r is the actual distance between key point i and key point j; S4. Use the initial model to predict the posture of the test set, and optimize the model performance based on spatiotemporal constraints to obtain the final semi-supervised animal 3D posture estimation model; S5. Input the video to be predicted into the final semi-supervised animal 3D posture estimation model to obtain the 3D posture estimation result.
2. A semi-supervised animal three-dimensional posture estimation method as claimed in claim 1, characterized in that: The multi-view shooting platform is a combination of cameras, the camera positions are arranged according to different shooting angles, and the cameras are shot synchronously after the arrangement is completed to obtain animal videos; The specific construction steps are: A standard coordinate system is established, cameras are arranged in the standard coordinate system and the camera position relationship is recorded. The camera parameters are calibrated by the chessboard calibration method. After the calibration is completed, a multi-view shooting platform is obtained.
3. A semi-supervised animal three-dimensional posture estimation method as claimed in claim 2, characterized in that: The labeled training set data adopts 3D labeling, and the 2D video frames in the 3D video frames in the training set are labeled according to the key points of the animal's posture, and the labels are triangulated using the calibrated camera parameters to obtain three-dimensional labeled data.
4. A semi-supervised animal three-dimensional posture estimation method as claimed in claim 3, characterized in that: Based on the established time and space constraint framework, the supervised posture regression loss is set, and the expression is as follows: in, represents the supervised regression loss; Indicates the number of three-dimensional key points; is the weight parameter; and They represent the real coordinates of the marked key points and the 3D coordinates of the predicted key points respectively.
5. A semi-supervised animal three-dimensional posture estimation method as claimed in claim 4, characterized in that: Step S4 is specifically as follows: The test set data is input into the initial model obtained in step S3 to obtain the prediction results. The predicted labels of the test set data and the true labels of the training set are used together for training. After the objects of the spatial distance constraint are replaced with the representation of the same key point in different frames, the modified spatial distance constraint is used for filtering and correction. Finally, the predicted labels that meet the modified spatial distance constraint are retained, and the model is optimized by continuous iteration in the process.
6. A semi-supervised animal three-dimensional posture estimation method as claimed in claim 5, characterized in that: Step S5 is specifically as follows: The video frames to be predicted are input into the optimized model to obtain the prediction results of the 3D key points of each frame, and the 3D posture estimation results of the animal are obtained by using the relative position change relationship of the 3D key points in the video.
7. A storage medium, characterized in that: The storage medium stores instructions and data for implementing a semi-supervised animal three-dimensional posture estimation method as described in any one of claims 1 to 6.
8. A computer device, characterized in that: include: Processor and storage medium; the processor loads and executes instructions and data in the storage medium to implement a semi-supervised animal three-dimensional posture estimation method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Video three-dimensional human body posture estimation method and system based on multistage supervision graph convolution
CN114694261A
Three-dimensional human body posture estimation method and device, equipment and storage medium
CN115035551A
Three-dimensional modeling constrained multi-modal target object attitude estimation method and system
CN116630394A
Three-dimensional human pose estimation method and related device
EP4102400A1
Systems and methods for contrastive pretraining with video tracking supervision
US20230154139A1
