CN-121999515-A - Cow weight calculation method and system based on computer vision
Abstract
The invention discloses a cow weight calculation method and a cow weight calculation system based on computer vision, which belong to the technical field of computer vision and machine learning, wherein the system comprises a target detection module, a point cloud acquisition module, a point cloud processing module, an index calculation module and a weight prediction module; the target detection module comprises a cow identification module and a cow gesture identification module. According to the method, through the combination of point cloud, deep learning and machine learning, firstly, the deep learning is utilized to carry out cow identification and cow gesture identification, when an object is identified and the gesture meets the condition, the depth camera is utilized to collect data, then the point cloud data collected by the depth camera is utilized to calculate, and the point cloud data is cascaded to the machine learning regression algorithm, so that the high-precision prediction of the body weight of the three-dimensional object in the field is realized.
Inventors
- ZHANG XUAN
- LIANG SHURUI
- SUN WEN
- Zhang Qinneng
- XIONG WENJUN
Assignees
- 光谷金信(武汉)科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260127
Claims (9)
- 1. The method for calculating the weight of the cow on the basis of computer vision is characterized by comprising the following steps of: 1. Identifying cattle, namely detecting the acquisition area through a YOLOV detection model, judging whether cattle exist or not, and triggering the second step if cattle exist; 2. Carrying out posture identification on the cattle through YOLOV11 posture detection models, judging whether the posture meets the acquisition standard or not, and triggering the third step if the posture meets the acquisition standard; 3. the point cloud acquisition, namely acquiring point cloud data of different angles of the cattle through a point cloud acquisition module, and transmitting the data to a point cloud processing module; 4. preprocessing the collected point cloud data by means of PCL, setting different parameters to adapt to different scenes by using configuration files, and transmitting the processed results to an index calculation module; 5. calculating indexes, namely calculating Euclidean distance of key points by using the processed point cloud data to obtain indexes, carrying out normalization processing on the indexes, carrying out feature selection through principal component analysis to form low-dimensional feature vectors, and then transmitting the low-dimensional feature vectors to a weight prediction module; 6. predicting the feature vector by adopting a multi-model stacked regression model, and outputting the predicted weight of the cow; 7. and outputting the predicted body weight to a user interface.
- 2. The method for calculating weight of cow in accordance with claim 1, wherein in step three, a plurality of depth cameras are used to perform multi-view scanning on the cow to obtain high-resolution three-dimensional point cloud data.
- 3. The method for calculating the weight of the cow in accordance with claim 2, wherein the fifth step comprises the following steps: (1) Calculating multidimensional sign indexes of the cow on the basis of the processed point cloud data; (2) Obtaining part of index key points through a three-dimensional coordinate system (x, y, z); (3) And then calculating Euclidean distance between key points to obtain an index, wherein the calculation formula is as follows: f= Wherein:. The method comprises ) And% ) Coordinates of a spine starting point and an ending point; (4) Normalizing the index, and performing feature selection through principal component analysis to form a low-dimensional feature vector; the normalization process uses the following formula: y= Where y is the original eigenvalue, and ymin and ymax are the minimum and maximum values of the eigenvalues.
- 4. The method for calculating the weight of the cow in accordance with computer vision as claimed in claim 3, wherein the multi-model stacked regression model comprises a plurality of base learners and a meta learner, wherein the base learners comprise ARDRegression, randomForestRegressor, LGBMRegressor, ridge regression and SVR, and BayesianRidge is selected as the meta learner.
- 5. The method for calculating weight of cow in accordance with claim 4, wherein the set of base learners is B= { f1, f2, f3, f4, f5} Wherein f1 is ARDRegression, f2 is RandomForestRegressor, f3 is LGBMRegressor, f4 is Ridge regression, and f5 is SVR; For feature vector x i ∈R d , each base learner generates a prediction output: thereby constructing a secondary feature vector: Will be Input to BayesianRidge regression model as independent variable to obtain final result.
- 6. The cattle slaughtering weight estimation system based on computer vision is used for the method of any one of claims 1-5 and is characterized by comprising a target detection module, a point cloud acquisition module, a point cloud processing module, an index calculation module and a weight prediction module, wherein the target detection module comprises a cattle identification module and a cattle posture identification module; The cattle posture recognition module detects whether the cattle posture meets the acquisition requirement or not by using a YOLOV posture detection model; the point cloud acquisition module is used for acquiring point cloud data; The point cloud processing module is used for preprocessing the point cloud data acquired by each point cloud acquisition module, and preliminarily taking out the point clouds outside the acquisition area by using the configuration file to set fixed parameters; The index calculation module is used for calculating Euclidean distance between key points based on the processed point cloud data to obtain an index; And the weight prediction module is used for transmitting the index into the regression model of the multi-model stack in a characteristic mode based on the obtained index to perform cow weight prediction.
- 7. The computer vision-based cow stock-out weight estimation system according to claim 6, wherein the point cloud acquisition module is a depth camera, and is installed at a designated position of the portal frame, and the fixed angle omni-directional coverage acquisition area.
- 8. The computer vision-based cow stock-out weight estimation system according to claim 7, wherein the key point extraction is to customize different key points of the cow, such as the back width, by using the characteristics of a three-dimensional coordinate system and a two-dimensional image, and the y-axis maximum value can be obtained according to the spatial position of the three-dimensional coordinate system.
- 9. The computer vision based bovine boom weight estimation system of claim 8, wherein the metrics comprise body length, height, body width, chest circumference, waist circumference, volume and surface area of the bovine.
Description
Cow weight calculation method and system based on computer vision Technical Field The invention relates to the technical field of computer vision and machine learning, in particular to a cow weight calculation method and system based on computer vision. Background In animal husbandry, cow stock out weight estimation is a key link in purchasing, stock out and feeding management. The traditional method relies on manual visual inspection or simple measurement, and has the problems of strong subjectivity, large error and low efficiency. The manual estimation is limited by factors such as experience difference, light, cow pose and the like, the error rate can reach more than 20%, and the time and the labor are consumed in a batch purchasing scene. In the prior art, the weight estimation method based on the two-dimensional image is difficult to accurately reflect the three-dimensional shape of the cow due to lack of depth information. Although the point cloud technology can provide three-dimensional data, the existing application is focused on geometric modeling, and a weight prediction method combined with an advanced regression model is lacking. In addition, when complex features and noise data are processed by using a single regression model, prediction performance is limited, and high-precision requirements are difficult to meet. Based on the above, the invention designs a cow weight calculation method and a cow weight calculation system based on computer vision to solve the above problems. Disclosure of Invention Aiming at the defects existing in the prior art, the invention provides a method and a system for calculating the weight of a cow on the basis of computer vision. The method utilizes the point cloud data acquisition, the feature extraction and the multi-model stacked regression model to realize the accurate prediction of the weight of the cow, and overcomes the subjectivity and inefficiency of the traditional method. In order to achieve the above purpose, the invention is realized by the following technical scheme: A weight calculation method of cow based on computer vision comprises the following steps: 1. Identifying cattle, namely detecting the acquisition area through a YOLOV detection model, judging whether cattle exist or not, and triggering the second step if cattle exist; 2. Carrying out posture identification on the cattle through YOLOV11 posture detection models, judging whether the posture meets the acquisition standard or not, and triggering the third step if the posture meets the acquisition standard; 3. the point cloud acquisition, namely acquiring point cloud data of different angles of the cattle through a point cloud acquisition module, and transmitting the data to a point cloud processing module; 4. preprocessing the collected point cloud data by means of PCL, setting different parameters to adapt to different scenes by using configuration files, and transmitting the processed results to an index calculation module; 5. calculating indexes, namely calculating Euclidean distance of key points by using the processed point cloud data to obtain indexes, carrying out normalization processing on the indexes, carrying out feature selection through principal component analysis to form low-dimensional feature vectors, and then transmitting the low-dimensional feature vectors to a weight prediction module; 6. predicting the feature vector by adopting a multi-model stacked regression model, and outputting the predicted weight of the cow; 7. and outputting the predicted body weight to a user interface. In the third step, multiple depth cameras are used for performing multi-view scanning on the cattle, and high-resolution three-dimensional point cloud data are obtained. Further, the fifth step specifically includes the following steps: (1) Calculating multidimensional sign indexes of the cow on the basis of the processed point cloud data; (2) Obtaining part of index key points through a three-dimensional coordinate system (x, y, z); (3) And then calculating Euclidean distance between key points to obtain an index, wherein the calculation formula is as follows: f= Wherein:. The method comprises ) And%) Coordinates of a spine starting point and an ending point; (4) Normalizing the index, and performing feature selection through principal component analysis to form a low-dimensional feature vector; the normalization process uses the following formula: y= Where y is the original eigenvalue, and ymin and ymax are the minimum and maximum values of the eigenvalues. Further, the multi-model stacked regression model comprises a plurality of base learners and a meta-learner, wherein the base learners comprise ARDRegression, randomForestRegressor, LGBMRegressor, ridge regression and SVR, and BayesianRidge is selected as the meta-learner. Further, the set of base learners is B= { f1, f2, f3, f4, f5} Wherein f1 is ARDRegression, f2 is RandomForestRegressor, f3 is LGBMRegressor, f4 is Ridge regression, and f5