Pig weight measuring and calculating scheme based on body size fusion depth data

Through the combination of deep cameras and artificial neural networks, the problem of cumbersome and high cost of traditional pig weight estimation process is solved, and more accurate, convenient and efficient weight estimation is achieved, reducing breeding costs and pig stress response.

CN120070534AInactive Publication Date: 2025-05-30珠海市云晓智联科技有限公司 +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510153676.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-12
Publication Date
2025-05-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the traditional breeding model, the estimation of pig weight relies on manual measurement or simple weighing equipment, which leads to cumbersome processes, high costs, inconvenient equipment, and pig stress response, affecting the rate of weight growth.

Method used

Depth camera equipment is used to capture pig depth images, combined with artificial body ruler marking and pre-trained heavy-estimation artificial neural network, to predict pig weight through feature extraction and data preprocessing.

Benefits of technology

A more accurate pig weight estimation was achieved, reducing labor and equipment costs, reducing pig stress response, and improving breeding benefits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120070534A_ABST
    Figure CN120070534A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of animal husbandry, and discloses a pig weight measuring and calculating scheme based on body size fusion depth data, comprising the following steps: step 1, depth image acquisition: using depth camera equipment to shoot a pig depth image, overlooking to shoot the back of the pig, ensuring that the whole pig is in the image, and acquiring a depth image; pictures with complete postures of the pigs are screened out from the videos, and invalid video frames with no pigs appearing or the edges of the pigs and the edges of the images intersected are removed at the same time. Feature extraction is carried out by fusing the pig body size and the depth image, the body state of the pig can be captured more accurately, the accuracy of the weight estimation artificial neural network is improved, compared with a method for manually driving the pig to weigh and weigh, the depth camera equipment and the computer vision technology are utilized, manual labor is not needed, pig stress response is removed, and the weight estimation accuracy of the weight estimation artificial neural network is improved. The cost is reduced, and the weight of the pig can be quickly and accurately obtained through the pre-trained weight estimation network, so that the weight estimation of the pig is more convenient and efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of animal husbandry, and particularly provides a pig weight measurement solution based on body measurement integrated with depth data. Background Art

[0002] There is a significant correlation between the body measurements of pigs and their weight. As important indicators for measuring the body shape and size of pigs, body measurements usually include multiple dimensions such as body length, body height, chest girth, etc. These body measurement data can, to a certain extent, reflect the growth and development status and body structure characteristics of pigs, and thus have an inherent connection with weight. For example, generally, pigs with longer body lengths and larger chest girths tend to be relatively heavier, and vice versa. This correlation has important guiding significance for the production practice of the pig farming industry. Practitioners can estimate the weight of pigs more accurately by measuring and analyzing the body measurements of pigs, so as to better carry out feeding management, feed formulation, and the formulation of slaughter plans, etc.

[0003] In the traditional breeding mode, the estimation of pig weight mainly relies on manual measurement methods or the use of simple weighing equipment. The manual measurement method requires breeders to operate manually to measure data such as body length and body width for each pig. This not only has a cumbersome process, consumes a large amount of manpower and time, but also is extremely likely to affect the accuracy of the final data due to human operation errors. Although simple weighing equipment can directly obtain the weight information of pigs to a certain extent, its purchase cost is quite high, the equipment itself is often large in size and not easy to carry, and it is extremely inconvenient to use in some farms with small breeding scales and scattered sites. The stress reaction caused by manual weighing operations on pigs will also lead to a slowdown in the weight growth rate, which has a negative impact on breeding efficiency. In view of the close relationship between the above-mentioned body measurements and weight, the present invention proposes a pig weight measurement solution based on body measurement integrated with depth data.

[0004] The above information disclosed in this background art is only used to increase the understanding of the background art of this application. Therefore, it may include prior art that is not known to those of ordinary skill in the art. Summary of the Invention

[0005] The purpose of the present invention is to provide a pig weight measurement solution based on body measurement integrated with depth data to solve the problems raised in the above background art.

[0006] To achieve the above purpose, the present invention provides the following technical solutions: including the following steps:

[0007] Step 1, Depth Image Acquisition: Use a depth camera device to capture the depth image of the pig. Shoot the back of the pig from above, ensuring that the entire pig is within the image. Select the frames with complete pig postures from the video, and at the same time eliminate the invalid video frames where there is no pig or the edge of the pig intersects with the edge of the image;

[0008] Step 2, Manual Body Dimension Marking: Extract the part that only contains the pig from the depth image, and divide the image of the pig's back into three parts along the Figure 1 L in 1 L 2 line. Subsequently, construct features in combination with the body dimension characteristics of the pig's back, and then perform data preprocessing;

[0009] Step 3, Weight Estimation Network: Input the constructed features into a pre-trained weight estimation artificial neural network, which can predict the weight of the pig according to the input features;

[0010] Step 4, Output Result: The weight estimation artificial neural network outputs the weight of the pig, completing the weight estimation process.

[0011] Preferably, according to Figure 1 L 1 , N, B, L, M, L 2 Perform a cubic polynomial (y = ax 3 + bx 2 + cx + d) fitting curve at the points as the position where the spinal line of the pig's back is located, then use the interpolation method to find two points that bisect the back into three parts, and then use the formula to calculate the perpendicular line of the bisecting point. At this time, the perpendicular line divides the back image into three parts.

[0012] Preferably, calculate the average depth value and perimeter of these three parts respectively as the depth features, and use Figure 1 in L NM , length feature of the body dimension, <L 1 NH 1 , <H 1 NM, <L 1 NH 2 , <H 2 NM, <S 1 MN, <S 1 ML 2 , <S2 M N, <S 2 ML 2 as the posture feature of the body dimension, and combine the depth feature and the body dimension feature as the feature engineering of the data.

[0013] Preferably, the specific steps of the data preprocessing in Step 2 include:

[0014] (1) Calculate the lengths of all line segments of the body measurements and the angles between the line segments;

[0015] (2) Segment the depth image of the pig's back and calculate the average depth and perimeter of each segment;

[0016] (3) Flatten the data obtained from the above two steps for subsequent input into the neural network for weight prediction.

[0017] Preferably, the artificial neural network in step three is a linear network, and the hyperparameter search method is used to let the neural network autonomously determine the number of neurons in the hidden layer. The data after completing the feature engineering is tiled and used as the input layer. Create three hidden layers, and output the input layer to the three hidden layers in a fully connected manner, so that the neurons of the artificial neural network do not lose the original data features during the learning process, and the connection does not use an activation function to reduce the computational complexity of the artificial neural network.

[0018] Preferably, at the end of the artificial neural network, a fully connected layer containing a single neuron node is added as the output for weight prediction, which is used to output the weight estimation result in step four.

[0019] In summary, the present application includes the following beneficial technical effects:

[0020] (1) By fusing the body measurements and depth images of pigs for feature extraction, the present invention can capture the body posture of pigs more accurately, thereby improving the accuracy of the weight estimation artificial neural network;

[0021] (2) Compared with the method of manually driving pigs to weigh on a scale, the present invention uses a depth camera device and computer vision technology, without manual labor, eliminates the stress response of pigs, and reduces costs;

[0022] (3) Through the pre-trained weight estimation network, the present invention can quickly and accurately obtain the weight of pigs, making the weight estimation of pigs more convenient and efficient. At the same time, the depth camera has a low cost and is easy to deploy. Therefore, the present invention is more likely to be popularized and applied in the livestock industry. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a schematic diagram of the pig size in the present invention;

[0024] Figure 2 It is a schematic diagram of video data cleaning in the present invention;

[0025] Figure 3 It is a schematic diagram of depth features in the present invention;

[0026] Figure 4 It is a schematic diagram of the artificial neural network in the present invention. Specific implementation mode

[0027] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0028] Please refer to Figures 1-4 , the present invention provides a technical solution: including the following steps:

[0029] Step 1, depth image acquisition: Use a depth camera device to take the depth image of the pig, shoot the back of the pig from above, ensure that the whole pig is within the image, screen out the pictures with complete pig postures from the video, and at the same time eliminate those invalid video frames without pigs or with the intersection of the pig edge and the image edge. Among them, an integrated device for collecting pig body weight and three-dimensional data of the pig body is used. This device is another invention application outside this application, integrating a depth camera, a weighing scale, a fill light, and a pig guiding channel, which is cleverly placed at the aisle of the pigsty. By guiding the pigs to pass through this channel one by one, the device can automatically and accurately record the weight of each pig and the depth image information of the back;

[0030] Step 2, manual body measurement marking: Extract the part containing only the pig from the depth image, and mark the body measurement characteristics of the pig in the selected complete posture picture according to the position of the endpoints shown in Figure 1 . Divide the image of the pig's back into three parts along the L Figure 1 in 1 L 2 line, and then construct features in cooperation with the body measurement characteristics of the pig's back, and then perform data preprocessing;

[0031] Step 3, weight estimation network: Input the constructed features into a pre-trained weight estimation artificial neural network. This neural network adopts a linear structure, and there is a full connection between its input layer and each hidden layer to ensure that the original feature information can be fully retained during the learning process. This network can predict the weight of the pig according to the input features;

[0032] Step 4, output result: At the end of the artificial neural network, a full connection layer containing a single neuron node is added as the output of the body weight prediction, which is used to output the body weight estimation result in Step 4. In order to evaluate the prediction ability of the model, we use the mean square error (MSE) as the loss function. The weight estimation artificial neural network outputs the weight of the pig to complete the weight estimation process.

[0033] After collecting the depth image of the pig's back, the head and tail are removed, leaving the depth image of the back. According to Figure 1 L 1, N,B,L,M,L 2 points, a cubic polynomial (y = ax 3 + bx 2 + cx + d) is used to fit the curve as the position of the spinal line on the pig's back. Then, two points that bisect the three segments of the back are found by interpolation. Then, the formula is used to calculate the perpendicular line of the bisecting point. At this time, the perpendicular line divides the back image into three parts.

[0034] The average depth values and perimeters of these three parts are calculated separately as depth features. The Figure 1 in L NM , length feature of body size, <L 1 NH 1 , <H 1 NM, <L 1 NH 2 , <H 2 NM, <S 1 MN, <S 1 ML 2 , <S2 M N, <S 2 ML 2 are used as the pose features of body size. The depth features and body size features are combined as the feature engineering of the data.

[0035] The specific steps of data preprocessing in step two include:

[0036] (1) Calculate the lengths of each segment of body size and the angles between each segment;

[0037] (2) Segment the depth image of the pig's back and calculate the average depth and perimeter of each segment;

[0038] (3) Flatten the data obtained from the above two steps for subsequent input into the neural network for body weight prediction.

[0039] The artificial neural network in step three is a linear network, and the hyperparameter search method is used to let the neural network autonomously determine the number of neurons in the hidden layer. The data after feature engineering is flattened and used as the input layer. Three hidden layers are created, and the input layer is output to the three hidden layers in a fully connected manner, so that the neurons of the artificial neural network do not lose the original data features during the learning process, and the connection does not use an activation function to reduce the computational complexity of the artificial neural network;

[0040] Predictive training of pig weight is carried out using an artificial neural network. During the training process, we randomly divide the preprocessed data into a training set, a validation set, and a test set at a ratio of 8:1:1 for model training, observing the training effect, and testing the generalization ability. The neural network also uses MSE as the loss function to evaluate the prediction ability of the model. During the training process, we retain the parameter combination with the lowest MSE as the neural network weights finally obtained through training, and observe the R 2 score to comprehensively evaluate its prediction performance.

[0041] 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 actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device.

[0042] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A pig weight measurement scheme based on body size fusion depth data, comprising the following steps: Step 1: Depth image acquisition: Use a depth camera to capture the depth image of the pig. Take a bird's-eye view of the pig's back to ensure that the entire pig is in the image. Filter out the images with complete pig postures from the video, and remove invalid video frames where no pig appears or where the pig's edge intersects with the image edge. Step 2: Manual body size marking: Extract only the part containing the pig from the depth image, divide the image of the pig's back into three parts along the L1L2 line in Figure 1, and then construct features with the body size features of the pig's back, and then perform data preprocessing; Step 3: Weight estimation network: Input the constructed features into a pre-trained weight estimation artificial neural network, which can predict the weight of the pig based on the input features; Step 4: Output results: The weight estimation artificial neural network outputs the weight of the pig, completing the weight estimation process.

2. A pig weight measurement scheme based on body size fusion depth data according to claim 1, characterized in that: According to Figure 1, L1, N, B, L, M, L2 points are used to perform a cubic polynomial (y = ax 3 +bx 2 +cx+d) fitting curve is used as the position of the pig's back spine line, and then the interpolation method is used to find the two points that bisect the back three sections, and then the formula y=-(3ax0 2 +2bx0+c) -1 *(x-x0) calculates the perpendicular line of the bisection point, at which point the vertical line divides the back image into three parts.

3. The pig weight measurement scheme based on body size fusion depth data according to claim 2 is characterized by: The average depth value of these three parts is calculated respectively, and the perimeter is used as the depth feature. The L in Figure 1 is used as the body size. L1N ,L NM ,L ML2 ,L H1N ,L NH2 ,L S1M ,L MS2 Length characteristics, <L1NH1, <H1NM, <L1NH2, <H2NM, <S1MN, <S1ML2, <S2 M N,<S2ML2 is used as the posture feature of body size, and the deep feature and body structure feature are combined as the feature engineering of the data.

4. The pig weight measurement scheme based on body size fusion depth data according to claim 1 is characterized by: The specific steps of data preprocessing in step 2 include: (1) Calculate the length of each line segment of the body scale and the angle between the line segments; (2) Segment the depth image of the pig's back and calculate the average depth and circumference of each segment; (3) The data obtained in the above two steps are flattened so as to be subsequently input into the neural network for weight prediction.

5. The pig weight measurement scheme based on body size fusion depth data according to claim 1, characterized in that: The artificial neural network in step three is a linear network, and the hyperparameter search method is used to allow the neural network to independently determine the number of hidden layer neurons. The data after feature engineering is flattened and used as the input layer to create three hidden layers. The input layer is output to the three hidden layers in a fully connected manner, so that the neurons of the artificial neural network do not lose the original data features during the learning process, and the connection does not use activation functions to reduce the computational complexity of the artificial neural network.

6. The pig weight measurement scheme based on body size fusion depth data according to claim 1 is characterized by: At the end of the artificial neural network, a fully connected layer containing a single neuron node is added as the output of weight prediction, which is used to output the weight estimation result in step four.

Citation Information

Cited By

  • Piglet weight evaluation method and system based on time sequence characteristics and attention mechanism

    CN122336863A