Pig weight estimation method, apparatus, device, medium, and computer program product
By using multi-view image data processing and three-dimensional Gaussian representation, the problems of low accuracy and high cost in pig weight estimation are solved, and accurate non-contact estimation of pig weight is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING RES CENT FOR INFORMATION TECH & AGRI
- Filing Date
- 2025-07-25
- Publication Date
- 2026-06-30
AI Technical Summary
Existing non-contact pig weight estimation methods suffer from low accuracy and high cost. In particular, methods based on image analysis and visual analysis lack depth information and are difficult to reconstruct in three dimensions, resulting in large estimation errors and high equipment costs.
By acquiring multi-view image data, generating sparse point cloud data and converting it into three-dimensional Gaussian data, constructing multi-view rendered images, using the restored Gaussian representation matrix as input to the weight estimation model, and combining spherical harmonic coefficients and feature loss to adjust the model, accurate estimation of pig weight is achieved.
It improves the accuracy of non-contact weight estimation for pigs and reduces equipment costs, overcomes the influence of the environment and equipment parameters, and achieves accurate estimation of pig weight.
Smart Images

Figure CN121033260B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of three-dimensional reconstruction technology, and in particular to a method, apparatus, equipment, medium, and computer program product for estimating the weight of pigs. Background Technology
[0002] Current pig farming has achieved large-scale and intensive operations, and pig weight is an important indicator of pig quality. In large-scale farming, traditional physical contact weighing methods are not only inefficient but also stressful for pigs. Therefore, non-contact weight estimation is more suitable for pigs raised on a large scale. Existing non-contact weight estimation methods include image analysis-based and visual analysis-based methods. Image analysis lacks depth information and body shape understanding, leading to large estimation errors; visual analysis requires 3D reconstruction, which is hampered by difficulties in live scanning and environmental influences, resulting in low accuracy; existing research uses depth cameras, but the complexity of real-world farming environments makes their use costly. Summary of the Invention
[0003] This invention provides a method, apparatus, equipment, medium, and computer program product for estimating pig weight, in order to solve the problems of low accuracy and high cost of existing non-contact pig weight estimation methods.
[0004] This invention provides a method for estimating the weight of pigs, comprising the following steps:
[0005] Acquire multi-view image data of the pig to be detected;
[0006] Sparse point cloud data is generated based on the multi-view image data;
[0007] Multi-view rendered images are generated based on the sparse point cloud data and the 3D Gaussian data; the 3D Gaussian data is obtained by converting the sparse point cloud data.
[0008] The restored Gaussian representation matrix is input into the weight estimation model to obtain pig feature information, and the weight of the pig to be detected is estimated based on the pig feature information; the restored Gaussian representation matrix is determined based on the multi-view rendered image.
[0009] According to the present invention, a method for estimating the weight of pigs includes acquiring multi-view image data of the pigs to be detected, which includes:
[0010] The multi-source views of the pigs to be tested are split to obtain a multi-channel signal set;
[0011] Synchronously control each signal set and amplify the signal in each signal set;
[0012] Multi-view image data of the pig to be detected are obtained based on the enhanced signal.
[0013] According to the present invention, a method for estimating pig weight, wherein generating sparse point cloud data based on the multi-view image data includes:
[0014] Obtain the intrinsic and extrinsic parameters and attitude information of the multi-source view;
[0015] Based on the multi-view image data, the intrinsic and extrinsic parameters, and the pose information, sparse point cloud data is generated.
[0016] According to the present invention, a method for estimating pig weight, wherein generating a multi-view rendered image based on the sparse point cloud data and the three-dimensional Gaussian data includes:
[0017] Based on the attribute information of each point in the sparse point cloud data, the sparse point cloud data is transformed to obtain three-dimensional Gaussian data;
[0018] A rendering loss is constructed based on the multi-view image data; the rendering loss is the loss generated based on the sparse point cloud data and the three-dimensional Gaussian data to produce the multi-view rendered image.
[0019] Multi-view rendered images are generated by optimizing the rendering loss.
[0020] According to the pig weight estimation method provided by the present invention, the step of inputting the restored Gaussian representation matrix into the weight estimation model to obtain pig feature information includes:
[0021] The feature loss is constructed based on the spherical harmonic coefficients; the spherical harmonic coefficients are determined based on the three-dimensional Gaussian data; the feature loss represents the error between the predicted value of the pig feature and the true value of the pig feature.
[0022] The weight estimation model is adjusted based on the adjustment objective; the adjustment objective is determined based on the feature loss.
[0023] By inputting the restored Gaussian representation matrix into the adjusted weight estimation model, we can obtain the pig characteristic information.
[0024] According to the pig weight estimation method provided by the present invention, the step of inputting the restored Gaussian representation matrix into the adjusted weight estimation model to obtain pig feature information includes:
[0025] The target features of the single-view image are quantized and embedded with the spatial features of the multi-view image data to obtain the hidden spatial information perceived from the single view.
[0026] Gaussian noise is applied to the original point cloud of the single-view image based on the hidden spatial information to obtain a spatial Gaussian point cloud.
[0027] The spatial Gaussian point cloud is correlated with the pig's body size information to obtain pig feature information for estimating the weight of the pig to be detected.
[0028] The present invention also provides a pig weight estimation device, comprising the following modules:
[0029] The multi-view image data acquisition module is used to acquire multi-view image data of the pig to be detected;
[0030] A sparse point cloud data generation module is used to generate sparse point cloud data based on the multi-view image data;
[0031] A multi-view rendering image generation module is used to generate multi-view rendering images based on the sparse point cloud data and the three-dimensional Gaussian data; the three-dimensional Gaussian data is obtained by converting the sparse point cloud data.
[0032] The pig weight estimation module is used to input the restored Gaussian representation matrix into the weight estimation model to obtain pig feature information, and to estimate the weight of the pig to be detected based on the pig feature information; the restored Gaussian representation matrix is determined based on the multi-view rendered image.
[0033] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement any of the above-described methods for estimating pig weight.
[0034] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the pig weight estimation method as described above.
[0035] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the above-described methods for estimating pig weight.
[0036] The present invention provides a method, apparatus, device, medium, and computer program product for estimating pig weight. It collects multi-view image data of the pig to be tested, generates a sparse point cloud from the multi-view image data, converts the point cloud data into a 3D Gaussian representation, inputs the sparse point cloud and the converted Gaussian representation, generates a multi-view rendered image, establishes a 3D reconstruction model from the multi-view rendered image, and produces a reconstructed Gaussian representation matrix. The reconstructed Gaussian representation matrix is input into the weight estimation model to obtain pig feature information used to estimate the weight of the pig to be tested. This invention improves the accuracy of non-contact pig weight estimation through individual weighing posture correction, 3D reconstruction of the weighing scene, and a correlational weight estimation method that integrates body posture semantics. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0038] Figure 1 This is one of the flowcharts illustrating the pig weight estimation method provided by the present invention.
[0039] Figure 2 This is the second flowchart of the pig weight estimation method provided by the present invention.
[0040] Figure 3 This is a schematic diagram of the pig weight estimation device provided by the present invention.
[0041] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0043] The following is combined Figures 1-4 This invention describes the pig weight estimation method, apparatus, equipment, medium, and computer program product.
[0044] Figure 1 This is one of the flowcharts illustrating the pig weight estimation method provided by the present invention, such as... Figure 1 As shown, the method includes the following:
[0045] Step 100: Obtain multi-view image data of the pig to be detected;
[0046] Specifically, the pig weight estimation method provided by this invention constructs three-dimensional data of pigs through Gaussian splashing. Then, based on the effect of the three-dimensional pig construction, a specific vision is selected as the basic visual marker, thereby realizing the association between the three-dimensional visual marker and the three-dimensional model. Finally, the weight of the pig is estimated based on the three-dimensional reconstruction result. The construction of the three-dimensional pig model requires the collection of pseudo-static multi-view image data of the pig to be detected, and data can also be supplemented by a diffusion model (which can reduce the number of input views).
[0047] Step 200: Generate sparse point cloud data based on the multi-view image data;
[0048] Specifically, in reconstructing the 3D model of a pig, sparse point cloud data is first generated from multi-view image data. A series of 2D images captured by the camera, along with the camera's intrinsic and extrinsic parameters, are used as processing data. Through projection model transformation and adjustment of the objective function, output content containing sparse point cloud data is obtained. The point cloud data is an intermediate result of 3D Gaussian Splatting (3DGS) and a preliminary result of Structure from Motion (SFM). The learning process of 3DGS is not merely recording the position and color of points, but rather, based on these sparse inputs, optimizing the parameters of the Gaussian method to implicitly fit a continuous radiation field. In this process, the continuous radiation field fills the regions between sparse points, and by utilizing the color consistency constraints of the image, more complete and continuous surface details are recovered. In contrast, the original sparse point cloud cannot directly provide this continuous surface information.
[0049] Step 300: Generate a multi-view rendering image based on the sparse point cloud data and the 3D Gaussian data; the 3D Gaussian data is obtained by converting the sparse point cloud data.
[0050] Specifically, sparse point cloud data is transformed to obtain a 3D Gaussian representation. The 3D Gaussian attributes include center, opacity, 3D covariance matrix, color, and rotation angle, where color is represented by a spherical harmonic function. By constructing a loss function for multi-view image rendering, multi-view rendered images are generated based on the sparse point cloud data, the 3D Gaussian data, and the constructed loss. The initial Gaussian data obtained from the sparse point cloud data transformation still needs to undergo a certain learning process to obtain the 3D Gaussian data.
[0051] Step 400: Input the restored Gaussian representation matrix into the weight estimation model to obtain pig feature information, and estimate the weight of the pig to be detected based on the pig feature information; the restored Gaussian representation matrix is determined based on the multi-view rendered image.
[0052] Specifically, this invention constructs a multi-viewpoint representation database for pigs, providing an open-source dataset for pig weight research and overcoming the shortcomings of image analysis and stereo vision analysis in weight estimation. It also conducts research on pig individual weighing posture correction, 3D reconstruction of weighing scenes, and correlational weight estimation techniques that integrate body posture semantics, achieving accurate weight estimation of pigs under standard postures. This is applied to the reconstruction of pig anatomy, overcoming the influence of natural environment, camera parameters, and object distance on weight estimation from image analysis. Deep stereo vision analysis suffers from slow individual reconstruction speed, severe light sensitivity effects, and unsuitability for live animals. This invention, based on multi-angle images of pigs reconstructed from monocular images, estimates pig weight according to different breeds, reproductive stages, and the proportion of body weight in each limb.
[0053] The weight estimation model provided by this invention is characterized by the fact that existing models take two-dimensional body size and weight data as input, while the weight estimation model provided by this invention takes a three-dimensional Gaussian representation as input. This representation contains more information about appearance and behavior, as well as implicit information such as waist circumference (which may be missing from images), than body size and weight data, thus enabling more accurate estimation.
[0054] This embodiment collects multi-view image data of the pigs to be tested, generates a sparse point cloud from the multi-view image data, converts the point cloud data into a 3D Gaussian representation, inputs the sparse point cloud and the converted Gaussian representation, generates a multi-view rendered image, establishes a 3D reconstruction model from the multi-view rendered image, and produces a reconstructed Gaussian representation matrix; the reconstructed Gaussian representation matrix is input into the weight estimation model to obtain pig feature information used to estimate the weight of the pigs to be tested. This invention improves the accuracy of non-contact weight estimation of pigs by correcting individual weighing posture, reconstructing the 3D weighing scene, and using an association weight estimation method that integrates body posture semantics.
[0055] In one embodiment, the pig weight estimation method provided by this invention may further include:
[0056] Step 110: Decompose the multi-source view of the pig to be tested to obtain a multi-channel signal set;
[0057] Step 120: Synchronously control each signal set and amplify the signal in each signal set;
[0058] Step 130: Obtain multi-view image data of the pig to be detected based on the enhanced signal.
[0059] Specifically, constructing a 3D model of a pig first requires determining the number of effective viewpoints. Taking 36 viewpoints (i.e., 36 cameras) as an example, video image data is acquired. Since the movement of the live pig makes it difficult for cameras to capture it simultaneously, a synchronization pulse is constructed to achieve live pig capture. Because the weakening or deviation of the pulse signal transmission causes excessive triggering delay, a differential / enhancement method is used to split the 36 video channels into five 8-channel units. These five sub-controllers are then merged into one master controller, forming a six-channel controller (synchronization controller). This six-channel controller uses the differential / enhancement method to synchronize the signals.
[0060] The main controller triggers a high-level signal, which is then divided into four pulses and amplified during the high-level triggering process. The amplification level of the pulse signal at a specific moment is controlled by a time function. The time function can be a unit pulse or a window function that is 1 for a certain time period.
[0061] This embodiment achieves accurate construction of a three-dimensional model of a pig by constructing a synchronous pulse enhancement capture signal.
[0062] In one embodiment, the pig weight estimation method provided by this invention may further include:
[0063] Step 210: Obtain the intrinsic and extrinsic parameters and attitude information of the multi-source view;
[0064] Step 220: Generate sparse point cloud data based on the multi-view image data, the intrinsic and extrinsic parameters, and the pose information.
[0065] Specifically, the reconstruction of the 3D model of the pig first involves restoring the motion structure using multi-view image data to generate preliminary sparse point cloud data. To ensure both the speed and quality of motion structure restoration, different labels are assigned to the multi-view views according to the acquisition camera number. Since the feature points in the scene acquired by cameras with the same label are roughly the same, images with adjacent numbers are grouped together.
[0066] The process of generating sparse point clouds requires a series of image files with various labels, as well as camera parameters (focal length, principal point, distortion parameters, and pixel size). The camera's intrinsic parameters mainly include focal length and principal point. The final output includes the camera's intrinsic and extrinsic parameters, the camera pose for each viewpoint, and the sparse point cloud data. The process involves projection model transformation and objective function construction. The projection model transformation is shown in Equation 1, where... These are points on the image plane (normalized pixel coordinates); A point in a three-dimensional world coordinate system; It is the camera intrinsic parameter matrix, representing the camera's focal length and principal point; It is the extrinsic parameter matrix of the camera, describing the camera's rotation. and displacement .
[0067] (1)
[0068] (2)
[0069] The objective function is shown in Formula 2, where, It is the first The first image The projection of a three-dimensional point; It is the camera intrinsic parameter matrix; It is the first The extrinsic parameters (rotation and translation) of the image; It is the first A three-dimensional point.
[0070] This embodiment generates sparse point clouds using multi-view image data.
[0071] Figure 2 This is the second flowchart illustrating the pig weight estimation method provided by the present invention, as shown below. Figure 2 As shown, the method may further include:
[0072] Step 310: Based on the attribute information of each point in the sparse point cloud data, the sparse point cloud data is transformed to obtain three-dimensional Gaussian data;
[0073] Step 320: Construct a rendering loss based on the multi-view image data; the rendering loss is the loss generated based on the sparse point cloud data and the 3D Gaussian data to produce the multi-view rendered image;
[0074] Step 330: Generate multi-view rendered images by optimizing the rendering loss.
[0075] Specifically, regarding the high-quality reconstruction of the 3D model, a large dataset of 3D pig data was constructed using the aforementioned 2D images. An improved Gaussian splashing technique was then used to reconstruct the 3D model with high quality, with the input being the sparse point cloud data obtained above. The sparse point cloud data was converted into a 3D Gaussian representation. The 3D Gaussian attributes include: center (position), opacity, 3D covariance matrix, and color, where color is represented by a spherical harmonic function.
[0076] The input for constructing the 3D reconstruction is a sparse point cloud and a modified Gaussian representation. This generates multi-view rendered images, and the target loss during the rendering process is considered. As shown in Formula 3, where, This is the mean square error loss; To perceive loss; For structural similarity loss; For transparency regularization loss; , , and This is a hyperparameter.
[0077] (3)
[0078] Mean Squared Error Loss: Used to measure the pixel-level difference between the rendered image and the target image. If the mean squared error loss is small, it means that the rendered image and the target image are relatively close at the pixel level. Perceptual Loss: Calculates the Euclidean distance between the splatter image and the target image at a specific level in the feature space. Structural Similarity Loss: Measures the structural information similarity between two images, i.e., compares brightness, contrast and structural information. Transparency Regularization Loss: Avoids high transparency at all points, reduces the number of redundant points, and improves rendering efficiency.
[0079] This embodiment generates an intermediate process by establishing a high-precision three-dimensional reconstruction model, that is, obtaining a high-precision reconstructed Gaussian representation matrix.
[0080] In one embodiment, the pig weight estimation method provided by this invention may further include:
[0081] Step 410: Construct feature loss based on spherical harmonic coefficients; the spherical harmonic coefficients are determined based on the three-dimensional Gaussian data; the feature loss represents the error between the predicted value of pig features and the true value of pig features;
[0082] Step 420: Adjust the weight estimation model based on the adjustment target; the adjustment target is determined based on the feature loss.
[0083] Step 430: Input the restored Gaussian representation matrix into the adjusted weight estimation model to obtain pig feature information.
[0084] Specifically, for the pig weight estimation part, a high-precision 3D Gaussian is used as input, and the target is pig body feature information, including weight, height, length, shoulder width and abdominal length.
[0085] To minimize the prediction loss, a re-estimation model incorporating spherical harmonics is established. The main model is a multilayer perceptron (MLP), whose objective function is related to the spherical harmonic coefficients; the loss function... As shown in Formula 4, where, , , and For hyperparameters; This is the mean square error loss; To perceive loss; For similarity loss; This is the set of feature information for prediction.
[0086] (4)
[0087] This embodiment obtains information containing pig body features through high-precision 3D Gaussian input.
[0088] In one embodiment, the pig weight estimation method provided by this invention may further include:
[0089] Step 431: Quantize and embed the target features of the single-view image with the spatial features of the multi-view image data to obtain the hidden spatial information perceived from the single view.
[0090] Step 432: Based on the hidden spatial information, Gaussian noise is applied to the original point cloud of the single-view image to obtain a spatial Gaussian point cloud;
[0091] Step 433: Associate the spatial Gaussian point cloud with the pig body size information to obtain pig feature information for estimating the weight of the pig to be detected.
[0092] Specifically, in monocular 3D reconstruction, a multi-view spatial feature extractor is constructed to improve the 3D reconstruction model's ability to perceive the foreground and background of the work space. First, the embedding features of multi-angle images are obtained through the CLIP image encoder. These embedding features identify the spatial relationship between the foreground and background and the reconstructed target. At the same time, the target features from individual viewpoints are quantized and embedded with the spatial features from all viewpoints, thereby improving the interactive perception capability of monocular images.
[0093] To overcome the limitations of monocular vision in perceiving hidden spaces, a hierarchical semantic perception loss is designed to generate sparse point clouds containing spatial foreground elements. A monocular view origin is established, foreground target point clouds are extracted, new viewpoint poses are simulated, and three-plane pose diffusion is performed. Spatial random Gaussian noise is added, and the original point cloud is expanded towards the hidden space using Gaussian noise. During the forward propagation process, target pose information and spatial feature information understood by vision are incorporated. Forward propagation is then performed, as shown in Equation 5, which is the calculation formula for randomly added noise. For the parameters; Point cloud corresponding to the round number; It is the original point cloud, which is then diffused into an irregular Gaussian point cloud in the generation space through random point cloud diffusion.
[0094] (5)
[0095] By integrating hidden scene perception features, the in-situ linkage and coupling capabilities within a group are refined: During forward propagation, random noise generation enables uncalibrated filling of the hidden space, and the integration of hidden space feature perception achieves spatial denoising and restoration. The reverse denoising process is the process of realizing the spatial origin point. To improve spatial perception capabilities, in-situ calibration within a group supervised by hidden space features is established. Based on multiple sets of planes in the hidden space, the linkage changes of points within the group are captured, achieving grouped perception. The spatial denoising process of a group of points is then demonstrated. The process of training the denoiser involves assisting in the perception of target features in a supervised manner.
[0096] This embodiment reconstructs multi-angle images of pigs using monocular images and estimates the weight of pigs based on different breeds, reproductive stages, and the weight ratio of pig limbs.
[0097] The pig weight estimation device provided by the present invention is described below. The pig weight estimation device described below can be referred to in correspondence with the pig weight estimation method described above.
[0098] Please refer to Figure 3 The present invention also provides a pig weight estimation device, comprising:
[0099] The multi-view image data acquisition module 301 is used to acquire multi-view image data of the pig to be detected.
[0100] Sparse point cloud data generation module 302 is used to generate sparse point cloud data based on the multi-view image data;
[0101] The multi-view rendering image generation module 303 is used to generate a multi-view rendering image based on the sparse point cloud data and the three-dimensional Gaussian data; the three-dimensional Gaussian data is obtained by converting the sparse point cloud data.
[0102] The pig weight estimation module 304 is used to input the restored Gaussian representation matrix into the weight estimation model to obtain pig feature information, and estimate the weight of the pig to be detected based on the pig feature information; the restored Gaussian representation matrix is determined based on the multi-view rendered image.
[0103] Optionally, the multi-view image data acquisition module includes:
[0104] The multi-source view splitting unit is used to split the multi-source view of the pig to be detected to obtain a multi-channel signal set;
[0105] The signal enhancement unit is used to synchronously control each signal set and enhance the signal in each signal set;
[0106] A multi-view image data acquisition unit is used to acquire multi-view image data of the pig to be detected based on the enhanced signal.
[0107] Optionally, the sparse point cloud data generation module includes:
[0108] The intrinsic and extrinsic parameter and attitude information acquisition unit is used to acquire the intrinsic and extrinsic parameters and attitude information of the multi-source view;
[0109] The sparse point cloud data generation unit is used to generate sparse point cloud data based on the multi-view image data, the intrinsic and extrinsic parameters, and the pose information.
[0110] Optionally, the multi-view rendering image generation module includes:
[0111] The sparse point cloud data conversion unit is used to convert the sparse point cloud data into three-dimensional Gaussian data based on the attribute information of each point in the sparse point cloud data.
[0112] A rendering loss construction unit is used to construct a rendering loss based on the multi-view image data; the rendering loss is the loss generated based on the sparse point cloud data and the three-dimensional Gaussian data to produce the multi-view rendered image.
[0113] A multi-view rendering image generation unit is used to generate multi-view rendering images by optimizing the rendering loss.
[0114] Optionally, the pig weight estimation module includes:
[0115] A feature loss construction unit is used to construct a feature loss based on spherical harmonic coefficients; the spherical harmonic coefficients are determined based on the three-dimensional Gaussian data; the feature loss represents the error between the predicted value of the pig feature and the true value of the pig feature.
[0116] The weighting model adjustment unit is used to adjust the weighting model based on the adjustment target; the adjustment target is determined based on the feature loss.
[0117] The pig weight estimation unit is used to input the restored Gaussian representation matrix into the adjusted weight estimation model to obtain pig characteristic information.
[0118] Optionally, the pig weight estimation unit includes:
[0119] The feature quantization embedding unit is used to quantize and embed the target features of the single-view image with the spatial features of the multi-view image data to obtain the hidden spatial information perceived from the single view.
[0120] The Gaussian noise augmentation unit is used to augment the original point cloud of the single-view image with Gaussian noise based on the hidden spatial information to obtain a spatial Gaussian point cloud.
[0121] The information association unit is used to associate the spatial Gaussian point cloud with the pig body size information to obtain pig feature information for estimating the weight of the pig to be detected.
[0122] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4 As shown, the electronic device may include a processor 510, a communications interface 520, a memory 530, and a communication bus 540, wherein the processor 510, communications interface 520, and memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute a pig weight estimation method, which includes: acquiring multi-view image data of the pig to be detected; generating sparse point cloud data based on the multi-view image data; generating a multi-view rendered image based on the sparse point cloud data and three-dimensional Gaussian data; the three-dimensional Gaussian data is obtained by converting the sparse point cloud data; inputting the restored Gaussian representation matrix into the weight estimation model to obtain pig feature information; and estimating the weight of the pig to be detected based on the pig feature information; the restored Gaussian representation matrix is determined based on the multi-view rendered image.
[0123] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0124] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the pig weight estimation method provided by the above methods. The method includes: acquiring multi-view image data of a pig to be detected; generating sparse point cloud data based on the multi-view image data; generating a multi-view rendered image based on the sparse point cloud data and three-dimensional Gaussian data; wherein the three-dimensional Gaussian data is obtained by converting the sparse point cloud data; inputting the restored Gaussian representation matrix into the weight estimation model to obtain pig feature information; and estimating the weight of the pig to be detected based on the pig feature information; wherein the restored Gaussian representation matrix is determined based on the multi-view rendered image.
[0125] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a pig weight estimation method provided by the methods described above. This method includes: acquiring multi-view image data of a pig to be detected; generating sparse point cloud data based on the multi-view image data; generating a multi-view rendered image based on the sparse point cloud data and three-dimensional Gaussian data; wherein the three-dimensional Gaussian data is obtained by converting the sparse point cloud data; inputting a restored Gaussian representation matrix into a weight estimation model to obtain pig feature information; and estimating the weight of the pig to be detected based on the pig feature information; wherein the restored Gaussian representation matrix is determined based on the multi-view rendered image.
[0126] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0127] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for estimating the weight of pigs, characterized in that, include: Acquire multi-view image data of the pig to be detected; Sparse point cloud data is generated based on the multi-view image data; A multi-view rendering image is generated based on the sparse point cloud data and the 3D Gaussian data; the 3D Gaussian data is obtained by converting the sparse point cloud data; a 3D reconstruction model is established through the multi-view rendering image, and a reconstruction Gaussian representation matrix is produced; Feature loss is constructed based on spherical harmonic coefficients; The spherical harmonic coefficients are determined based on the three-dimensional Gaussian data; the feature loss represents the error between the predicted and actual values of pig features; the weight estimation model is adjusted based on the adjustment target, which is determined based on the feature loss; the restored Gaussian representation matrix is input into the adjusted weight estimation model, and the following steps are performed through the weight estimation model to obtain pig feature information: The target features of the single-view image are quantized and embedded with the spatial features of the multi-view image data to obtain hidden spatial information for single-view perception; Gaussian noise is applied to the original point cloud of the single-view image based on the hidden spatial information to obtain a spatial Gaussian point cloud; the spatial Gaussian point cloud is associated with the pig's body size information to obtain pig feature information for estimating the weight of the pig to be detected. The weight of the pig to be tested is estimated based on the pig's characteristic information.
2. The method for estimating pig weight according to claim 1, characterized in that, The acquisition of multi-view image data of the pig to be detected includes: The multi-source views of the pigs to be tested are split to obtain a multi-channel signal set; Synchronously control each signal set and amplify the signal in each signal set; Multi-view image data of the pig to be detected are obtained based on the enhanced signal.
3. The method for estimating pig weight according to claim 2, characterized in that, The generation of sparse point cloud data based on the multi-view image data includes: Obtain the intrinsic and extrinsic parameters and attitude information of the multi-source view; Based on the multi-view image data, the intrinsic and extrinsic parameters, and the pose information, sparse point cloud data is generated.
4. The method for estimating pig weight according to claim 1, characterized in that, The process of generating multi-view rendered images based on the sparse point cloud data and 3D Gaussian data includes: Based on the attribute information of each point in the sparse point cloud data, the sparse point cloud data is transformed to obtain three-dimensional Gaussian data; A rendering loss is constructed based on the multi-view image data; the rendering loss is the loss generated based on the sparse point cloud data and the three-dimensional Gaussian data to produce the multi-view rendered image. Multi-view rendered images are generated by optimizing the rendering loss.
5. A device for estimating the weight of pigs, characterized in that, include: The multi-view image data acquisition module is used to acquire multi-view image data of the pig to be detected; A sparse point cloud data generation module is used to generate sparse point cloud data based on the multi-view image data; A multi-view rendering image generation module is used to generate multi-view rendering images based on the sparse point cloud data and the three-dimensional Gaussian data; the three-dimensional Gaussian data is obtained by converting the sparse point cloud data; a three-dimensional reconstruction model is established through the multi-view rendering images, and a reconstruction Gaussian representation matrix is produced; The pig weight estimation module is used to construct feature loss based on spherical harmonic coefficients; The spherical harmonic coefficients are determined based on the three-dimensional Gaussian data; the feature loss represents the error between the predicted and actual values of pig features; the weight estimation model is adjusted based on the adjustment target, which is determined based on the feature loss; the restored Gaussian representation matrix is input into the adjusted weight estimation model, and the following steps are performed through the weight estimation model to obtain pig feature information: The target features of the single-view image are quantized and embedded with the spatial features of the multi-view image data to obtain hidden spatial information for single-view perception; Gaussian noise is applied to the original point cloud of the single-view image based on the hidden spatial information to obtain a spatial Gaussian point cloud; the spatial Gaussian point cloud is associated with the pig's body size information to obtain pig feature information for estimating the weight of the pig to be detected. The weight of the pig to be tested is estimated based on the pig's characteristic information.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the pig weight estimation method as described in any one of claims 1 to 4.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the pig weight estimation method as described in any one of claims 1 to 4.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the pig weight estimation method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Training method of live pig key point detection model, body size measurement method and device
CN119919961A
Human body model reconstruction and body measurement method and system based on three-dimensional Gaussian splashing
CN120236006A