Chicken body weight estimation method based on decision tree model and preferred features
By using a decision tree model and a method based on optimized features, keyframe images are extracted from color and depth videos of chickens, and then segmented and feature extracted to construct a chicken body weight estimation model. This solves the problems of time-consuming, labor-intensive, and intrusive chicken body weight measurement in existing technologies, and achieves real-time and accurate chicken body weight measurement, thus improving measurement efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG INST OF COMM
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-05
AI Technical Summary
Existing methods for measuring chicken body weight suffer from problems such as being time-consuming and labor-intensive, easily causing stress, and being complex to install, making it difficult to achieve real-time, accurate, and non-intrusive measurements.
A decision tree-based model and optimized feature method were adopted. By collecting color and depth videos of chickens, key frame images of posture were extracted, segmented, and feature extracted to construct a chicken body weight estimation model. The optimal feature parameter set was selected for estimation.
It enables real-time, accurate, and non-invasive measurement of chicken body weight, improving measurement efficiency and accuracy, and providing more refined guidance for poultry farming.
Smart Images

Figure CN122156289A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent poultry management, and in particular to a method for estimating chicken body quality based on a decision tree model and preferred features. Background Technology
[0002] Body weight is an important indicator for assessing the growth status and overall health of chickens. Chicken body weight information is related to factors such as production efficiency, disease resistance, and meat quality. Therefore, chicken body weight information can be used to guide daily feed intake, determine optimal slaughter time, and guide breeder selection.
[0003] To accurately measure chicken body weight, current methods include manual sampling and weighing device measurement. Manual sampling is time-consuming, labor-intensive, and prone to causing stress in chickens. While weighing device measurement does not cause stress, it suffers from complex installation, difficult maintenance, and a tendency to underestimate body weight later on.
[0004] Therefore, how to perform real-time, accurate, and non-invasive measurements of chicken body weight to improve the efficiency and accuracy of chicken body weight measurement has become a pressing technical problem that needs to be solved in the field of chicken body weight measurement. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a chicken body weight estimation method based on decision tree model and optimized features that can make real-time, accurate and non-invasive measurements of chicken body weight, in contrast to the above-mentioned prior art.
[0006] The technical solution adopted by this invention to solve the above-mentioned technical problems is: a method for estimating chicken body quality based on decision tree model and preferred features, characterized by including the following steps 1 to 8: Step 1: Acquire color and depth videos of the target chickens in a preset posture within the same preset time period, respectively, to obtain chicken color videos and chicken depth videos; wherein, the chicken color videos are acquired using a visible light camera, and the chicken depth videos are acquired using a depth camera; the chicken color videos are marked as... V c Chicken depth video tagged as V d ; Step 2: Sequentially read each color video frame from the chicken color video and each depth video frame from the chicken depth video, and respectively select the chicken posture keyframe color image and chicken posture keyframe depth image at the time the target chicken first appears; the selected chicken posture keyframe color image is marked as... I c The selected chicken pose keyframe depth maps are marked asI d ; Step 3: The selected chicken pose keyframe color images are segmented using the Otsu threshold segmentation method to obtain a segmentation mask image; wherein, the obtained segmentation mask image is labeled as... I mask ; Step 4: Perform bitwise AND operations between the chicken pose keyframe color image and the chicken pose keyframe depth image and the segmentation mask image respectively to obtain the segmented color image and the segmented depth image; wherein, the segmented color image is marked as... I C_seg The segmented depth map is marked as I d_seg ; Step 5: Obtain the one-dimensional features of the target chickens based on the pre-collected chicken breeding information. Extract features from the segmentation mask image to obtain the two-dimensional features of the chickens. Extract features from the segmented color image and the segmented depth image to obtain the three-dimensional features of the chickens. Combine all the extracted one-dimensional, two-dimensional, and three-dimensional features of the chickens into a set of chicken feature parameters. Among them, the one-dimensional feature of the chickens is the age of the chickens, the two-dimensional features of the chickens include the projected area, perimeter, width, length, maximum inscribed circle radius, and eccentricity, and the three-dimensional features of the chickens include the volume and back width. Step 6: Take the obtained set of chicken characteristic parameters as input and the actual measured body mass of the target chicken as output to construct a chicken body mass estimation benchmark model based on decision tree. Step 7: Based on the constructed benchmark model for estimating chicken body weight, select the optimal set of preferred parameters for chicken features from the obtained set of chicken feature parameters; wherein, the preferred set of preferred parameters for chicken features includes at least one chicken feature from the set of chicken feature parameters. Step 8: Using the chicken feature optimization parameter set as input and the actual measured body mass of the target chicken as output, construct a chicken body mass estimation optimization model to estimate the chicken body mass.
[0007] Improved, in the chicken body quality estimation method based on decision tree model and preferred features, step 5, the process of extracting features from the segmentation mask image to obtain the two-dimensional features of the chicken, includes the following steps a1~a2: Step a1: Extract the projected area, perimeter, width, length, maximum inscribed circle radius, and eccentricity from the segmented mask image to obtain the two-dimensional chicken features corresponding to the segmented mask image; wherein, the projected area is the pixel area of the foreground of the segmented mask image, the perimeter is the number of contour pixels of the foreground of the segmented mask image, the width is the width of the minimum bounding rectangle of the foreground of the segmented mask image, the length is the length of the minimum bounding rectangle of the foreground of the segmented mask image, the maximum inscribed circle radius is the maximum inscribed circle radius of the foreground of the segmented mask image, and the eccentricity is the eccentricity of the foreground of the ellipse-fitted segmented mask image; Step a2: The depth recovery process of the segmented color image is performed using the triangulation principle to obtain the chicken point cloud corresponding to the segmented color image. The volume and back width of the chicken point cloud are extracted to obtain the three-dimensional features of the chicken corresponding to the segmented color image.
[0008] Furthermore, in the chicken body mass estimation method based on decision tree model and preferred features, step a2, which involves extracting the volume and back width of the chicken's point cloud to obtain the chicken's three-dimensional features corresponding to the segmented color image, includes the following steps a21 to a24: Step a21: Statistical filtering is used to remove outliers from the chicken point cloud to obtain a filtered chicken point cloud. Step a22: The filtered chicken point cloud is reconstructed using a Poisson reconstruction method based on normal estimation to obtain a chicken point cloud Mesh model. Step a23: Calculate the volume of the chicken based on the obtained chicken point cloud mesh model; Step a24: The minimum bounding box detection method is used to detect the filtered chicken point cloud to obtain the minimum bounding box of the chicken point cloud, and the width of the minimum bounding box of the chicken point cloud is used as the width of the chicken's back.
[0009] Further improvements are made to the chicken body quality estimation method based on decision tree model and preferred features. In step 5, the process of extracting the three-dimensional features of the chicken from the segmented color image and the segmented depth image includes the following steps: using the triangulation principle to perform depth recovery processing on the segmented color image and the segmented depth image to obtain the chicken point cloud corresponding to the segmented depth image, and extracting the volume and back width of the chicken point cloud respectively to obtain the three-dimensional features of the chicken corresponding to the segmented depth image.
[0010] Furthermore, in the chicken body mass estimation method based on decision tree model and optimized features, the process of extracting the volume and back width of the chicken point cloud to obtain the chicken's three-dimensional features corresponding to the segmented depth map includes the following steps b21~b24: Step b21: Statistical filtering is used to remove outliers from the chicken point cloud, resulting in a filtered chicken point cloud. Step b22: The Poisson reconstruction method based on normal estimation is used to perform Poisson reconstruction processing on the filtered chicken point cloud to obtain the chicken point cloud Mesh model. Step b23: Calculate the volume of the chicken based on the obtained chicken point cloud mesh model; Step b24: The minimum bounding box detection method is used to detect the filtered chicken point cloud to obtain the minimum bounding box of the chicken point cloud, and the width of the minimum bounding box of the chicken point cloud is used as the width of the chicken's back.
[0011] Further improvements are made to the chicken body weight estimation method based on decision tree model and preferred features. In step 6, the construction process of the chicken body weight estimation benchmark model includes the following steps c0 to c6: Step c0: A training dataset for the decision tree model is pre-generated; wherein, the training dataset is labeled as... T , T={( x 1, y 1), ( x 2, y 2),···, ( x N , y N )},( x i , y i (The training dataset) T The first in i There are training samples, 1 ≤ i ≤ N , x i For the first i The input sample values of each training sample. y i For the first i The label values of each training sample. N For training set T The total number of training samples in the dataset; Step c1, initialize the first weak learner; where the first weak learner is labeled as F 0( x ): ; in, x For the input sample, L ( y i , γ ) is the loss function of the decision tree model. y i For the first i The label values of each training sample. γThese are candidate parameters for the initial predicted values of the model. γ The specific value is determined by the loss function. L ( y i , γ The form determines; Step c2: For each training sample in the training dataset, pre-build the same preset number of regression trees; where the preset number is labeled as... M , M ≥1; Step c3: For each training sample in the first weak learner, calculate the negative gradient of the loss function corresponding to each regression tree; where, the... i The training sample of the th training sample m The negative gradient of the loss function corresponding to the regression tree is labeled as follows: r m,i : ;1≤ m ≤ M ; in, F m-1 ( x ) is the first m -1 learner; F ( x Let ) be the objective function. F ( x i ) is the first i Input Samples x i The predicted value; Step c4: Use a classification regression tree to fit each preset data pair to obtain the first... m Tree of regression, and for the first m Minimize the loss function corresponding to the first regression tree to obtain the second regression tree. m The best-fit values for each leaf node in the regression tree; where the preset data pairs are labeled as ( x i , r m,i ), No. m The first regression tree corresponding to the j The leaf node regions are marked as R m,j Leaf node region R m,j The corresponding number j The best-fit value for each leaf node is denoted as... γ m,j : ;1≤ j ≤ J m;in, J m For the first m The total number of tree nodes in a regression tree; Step c5, update the strong learner; wherein the updated strong learner is labeled as F m ( x ): ; ; in, I ( x ∈ R m,j () is a judgment symbol; here x The input variables for the baseline model of chicken body weight estimation; Step c6 yields the updated strong learner, which is then used as the benchmark model for estimating chicken body mass; the updated strong learner is labeled as... F M ( x ): .
[0012] Furthermore, in the chicken body quality estimation method based on decision tree model and preferred features, in step 7, the selection process of the preferred parameter set of chicken features includes the following steps d1~d5: Step d1: Calculate the average importance of each chicken feature in the chicken feature parameter set in a single regression tree, and use the average value as the selection criterion for the corresponding chicken feature. Step d2: Select chicken features from the chicken feature parameter set according to the size of each selected metric, forming different chicken feature combinations; wherein each chicken feature combination is formed by at least one selected chicken feature, and the chicken features in each chicken feature combination are not completely the same. Step d3: Input the combination of each chicken feature into the constructed chicken body mass estimation benchmark model for estimation processing, and obtain the corresponding chicken body mass estimation value respectively. Step d4: Calculate the difference between the estimated body weight of each chicken and the actual measured body weight of the target chicken, and use the obtained body weight difference as the body weight estimation error of the corresponding chicken characteristic combination. Step d5: Select the body mass estimation error with the smallest error value from all the obtained body mass estimation errors, and use the chicken feature combination corresponding to the selected body mass estimation error as the chicken feature optimization parameter set.
[0013] Preferably, in the chicken body weight estimation method based on decision tree model and preferred features, the preset posture is a standing posture.
[0014] Compared with existing technologies, the advantages of this invention are as follows: The chicken body mass estimation method based on decision tree model and optimized features acquires color video and depth video of chickens in a preset posture within a preset time period. Then, it extracts the chicken posture keyframe color image and chicken posture keyframe depth image, segments the chicken posture keyframe color image to obtain a segmentation mask image, further processes it to obtain the segmented color image and segmented depth image, and obtains the chicken's one-dimensional features (age). It extracts features from the segmentation mask image to obtain the chicken's two-dimensional features, and extracts features from the segmented color image and segmented depth image to obtain the chicken's three-dimensional features. Based on all the obtained chicken features and the actual measured body mass of the target chicken, it constructs a chicken body mass estimation benchmark model based on decision tree. Then, it selects the optimal set of chicken feature optimization parameters, uses the chicken feature optimization parameter set as input and the actual measured body mass of the target chicken as output to construct a chicken body mass estimation optimization model, thereby estimating the chicken body mass. In this way, the importance of each chicken feature was ranked and the optimal parameter set for chicken features was selected, and an optimization model for estimating chicken body mass was constructed. Then, the optimal parameter set for chicken features and the optimization model for estimating chicken body mass were used to accurately estimate the body mass of chickens. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of the chicken body quality estimation method based on decision tree model and preferred features in an embodiment of the present invention; Figure 2 This is a schematic diagram of the two-dimensional features of chickens extracted in an embodiment of the present invention; Figure 3 This is a schematic diagram of the three-dimensional features of chickens extracted in an embodiment of the present invention; Figure 4 This is a schematic diagram showing the sorting of the average importance of each chicken feature in the chicken feature parameter set according to an embodiment of the present invention; Figure 5 This is a scatter plot of the estimated chicken body weight and the actual chicken body weight (i.e., the actual measured chicken body weight) in an embodiment of the present invention. Detailed Implementation
[0016] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0017] This embodiment provides a method for estimating chicken body weight based on a decision tree model and optimized features. Specifically, the integrated development environment used in this embodiment is a high-performance server (Ubuntu 18.04), the experimental environment is Python 3.7.4, and the server is equipped with an Intel Gold 6139X2 processor (2.5 GHz / 8 Core), 256 GB of memory, and four NVIDIA RTXTITAN graphics cards.
[0018] The subjects of the body weight estimation experiment were 882 yellow-feathered chickens. A total of 41 yellow-feathered chickens were randomly selected from three batches of farmed chickens in Huzhou City, Zhejiang Province. The selected chickens had intact feathers, normal body shape, and were marked with leg tags.
[0019] See Figure 1 As shown, the chicken body quality estimation method based on decision tree model and preferred features in this embodiment includes the following steps 1 to 8: Step 1: Acquire color and depth videos of the target chickens in a preset posture within the same preset time period, respectively, to obtain color and depth videos of the chickens. The color video is acquired using a visible light camera, and the depth video is acquired using a depth camera. The resolution of the images acquired by both the visible light and depth cameras is 960 pixels * 540 pixels. The color video of the chicken is marked as... V c Chicken depth video tagged as V d The preferred preset posture here is that the chicken is standing. Step 2: Sequentially read each color video frame from the chicken color video and each depth video frame from the chicken depth video, and respectively select the chicken posture keyframe color image and chicken posture keyframe depth image at the time the target chicken first appears; the selected chicken posture keyframe color image is marked as... I c The selected chicken pose keyframe depth maps are marked as I d Specifically, in this embodiment, the method for screening the color images of chicken posture keyframes adopts the posture keyframe detection method disclosed in Chinese invention patent application CN114926639A "Posture keyframe detection method for poultry weight estimation" to screen out the color images of chicken posture keyframes and the depth images of chicken posture keyframes when the target chicken first appears. Step 3: The selected chicken pose keyframe color images are segmented using the Otsu threshold segmentation method to obtain a segmentation mask image; wherein, the obtained segmentation mask image is labeled as... I mask ; Step 4: Perform a bitwise AND operation between the chicken pose keyframe color image and the chicken pose keyframe depth image and the segmentation mask image respectively to obtain the segmented color image and the segmented depth image; The segmented color image is labeled as... I C_seg The segmented depth map is marked as I d_seg It should be noted that the "bitwise AND operation" here is a common technique in the field of digital image processing, and will not be elaborated on further here. Step 5: Obtain the one-dimensional features of the target chickens based on the pre-collected chicken breeding information. Extract features from the segmentation mask image to obtain the two-dimensional features of the chickens. Extract features from the segmented color image and the segmented depth image to obtain the three-dimensional features of the chickens. Combine all the extracted one-dimensional, two-dimensional, and three-dimensional features of the chickens into a set of chicken feature parameters. The one-dimensional feature of the chickens is the age of the chickens, D. The two-dimensional features of the chickens include the projected area A, perimeter C, width W, length L, maximum inscribed circle radius R, and eccentricity E. The three-dimensional features of the chickens include the volume V and the back width BW. Step 6: Take the obtained set of chicken characteristic parameters as input and the actual measured body mass of the target chicken as output to construct a chicken body mass estimation benchmark model based on decision tree. Step 7: Based on the constructed benchmark model for estimating chicken body weight, select the optimal set of preferred parameters for chicken features from the obtained set of chicken feature parameters; wherein, the preferred set of preferred parameters for chicken features includes at least one chicken feature from the set of chicken feature parameters. Step 8: Using the chicken feature optimization parameter set as input and the actual measured body mass of the target chicken as output, construct a chicken body mass estimation optimization model to estimate the chicken body mass. In this embodiment, when constructing the chicken body mass estimation optimization model, the actual measured body mass of the target chicken is the true label used when constructing the model.
[0020] Specifically, in step 5 of this embodiment, the process of sequentially extracting the two-dimensional and three-dimensional features of chickens from the base-segmented color image includes the following steps a1~a2: Step a1: Extract the projected area, perimeter, width, length, maximum inscribed circle radius, and eccentricity from the segmentation mask image to obtain the two-dimensional features of the chicken. The projected area is the pixel area of the foreground of the segmentation mask image; the perimeter is the number of contour pixels of the foreground of the segmentation mask image; the width is the width of the minimum bounding rectangle of the foreground of the segmentation mask image; the length is the length of the minimum bounding rectangle of the foreground of the segmentation mask image; the maximum inscribed circle radius is the maximum inscribed circle radius of the foreground of the segmentation mask image; and the eccentricity is the eccentricity of the foreground of the ellipse-fitted segmentation mask image. Step a2: The depth recovery process of the segmented color image is performed using the triangulation principle to obtain the chicken point cloud corresponding to the segmented color image. The volume and back width of the chicken point cloud are extracted to obtain the three-dimensional features of the chicken corresponding to the segmented color image.
[0021] In step a2, the process of extracting the volume and back width of the chicken's point cloud to obtain the three-dimensional features of the chicken corresponding to the segmented color image includes the following steps a21 to a24: Step a21: Statistical filtering is used to remove outliers from the chicken point cloud, resulting in a filtered chicken point cloud. When using statistical filtering to remove outliers, the number of K-neighborhood points in the statistical filter is set to 3, and the standard deviation multiplier is set to 2.0. This eliminates the adverse effects of outliers in the chicken point cloud obtained in step a2 on the accuracy of chicken 3D feature extraction. Step a22: The filtered chicken point cloud is reconstructed using a Poisson reconstruction method based on normal estimation to obtain a chicken point cloud Mesh model; wherein, the search radius for normal estimation is set to 5, the maximum number of points found in the neighborhood is set to 30, and the depth of Poisson reconstruction is set to 4. Step a23: The chicken point cloud mesh model consists of multiple triangular facets and vertices. The origin O (0,0,0) is selected as the reference point. Each triangular facet and the origin O will form a tetrahedron. The volume of the chicken can be calculated by accumulating the volumes of all tetrahedrons. Step a24: The minimum bounding box detection method is used to detect the filtered chicken point cloud to obtain the minimum bounding box of the chicken point cloud, and the width of the minimum bounding box of the chicken point cloud is taken as the back width of the chicken. Specifically, since most of the chicken postures used for estimation after posture screening are standing postures, their back width is basically close to the width of the minimum bounding box, so the width of the minimum bounding box of the chicken point cloud is taken as the back width of the chicken. Table 1 shows the extraction results of 10 randomly selected chicken feature parameters. Comparative analysis shows that, except for the eccentricity E, all other chicken features are correlated with the chicken body mass M. Table 1. Results of chicken feature parameter extraction Serial Number D M / kg A / pixel C / pixel W / pixel L / pixel R / pixel E <![CDATA[V / cm 3 ]]> BW / cm 1 105 0.95 27069 778 135 281 69 0.88 4135.2 16.8 2 105 1.05 27879 795 130 279 64 0.81 4115.4 16.7 3 112 1.15 28726 839 145 298 68 0.84 4896.9 19.5 4 112 1.25 28371 852 144 294 69 0.88 4736.9 18.6 5 119 1.35 31399 861 155 301 72 0.88 5251.2 23.4 6 119 1.40 31569 879 171 316 75 0.92 5593.4 22.8 7 126 1.45 37161 947 177 325 78 0.85 6707.9 24.2 8 133 1.55 37985 980 190 329 85 0.88 7646.2 26.9 9 133 1.60 38129 985 191 347 84 0.82 7593.7 25.4 10 140 1.65 38810 1003 219 355 87 0.81 8172.3 31.7 Note: M is the actual body weight of the yellow-feathered chicken, D is the age in days, A is the projected area, C is the circumference, W is the width, L is the length, R is the radius of the largest inscribed circle, E is the eccentricity, V is the volume, and BW is the width of the back.
[0022] In step 5 of this embodiment, the process of sequentially extracting the two-dimensional and three-dimensional features of chickens from the segmented depth map includes the following steps: using the triangulation principle to perform depth recovery processing on the segmented color image and the segmented depth map to obtain the chicken point cloud corresponding to the segmented depth map, and extracting the volume and back width of the chicken point cloud to obtain the three-dimensional features of the chicken corresponding to the segmented depth map. In this step, the process of extracting the volume and back width of the chicken point cloud to obtain the three-dimensional features of the chicken corresponding to the segmented depth map includes the following steps b21~b24: Step b21: Statistical filtering is used to remove outliers from the chicken point cloud, resulting in a filtered chicken point cloud. Step b22: The Poisson reconstruction method based on normal estimation is used to perform Poisson reconstruction processing on the filtered chicken point cloud to obtain the chicken point cloud Mesh model. Step b23: Calculate the volume of the chicken based on the obtained chicken point cloud mesh model; Step b24: The minimum bounding box detection method is used to detect the filtered chicken point cloud to obtain the minimum bounding box of the chicken point cloud, and the width of the minimum bounding box of the chicken point cloud is taken as the width of the chicken's back; after extraction processing, the extracted two-dimensional features of the chicken are shown in [reference]. Figure 2 As shown, the extracted three-dimensional features of the chickens are shown in the image. Figure 3 As shown.
[0023] Specifically, in step 6, the process of constructing the benchmark model for estimating chicken body weight includes the following steps c0 to c6: Step c0: A training dataset for the decision tree model is pre-generated; wherein, the training dataset is labeled as... T , T={( x 1, y 1), ( x 2, y 2),···, ( x N , y N )},( x i , y i (The training dataset) T The first in i There are training samples, 1 ≤ i ≤ N , x i For the first i The input sample values of each training sample. y i For the first i The label values of each training sample. N For training setT The total number of training samples in the dataset; Step c1, initialize the first weak learner; where the first weak learner is labeled as F 0( x ): ; in, x For the input sample, L ( y i , γ ) is the loss function of the decision tree model. y i For the first i The label values of each training sample. γ These are candidate parameters for the initial predicted values of the model. γ The specific value is determined by the loss function. L ( y i , γ The form determines; Step c2: For each training sample in the training dataset, pre-build the same preset number of regression trees; where the preset number is labeled as... M , M ≥1; Step c3: For each training sample in the first weak learner, calculate the negative gradient of the loss function corresponding to each regression tree; where, the... i The training sample of the th training sample m The negative gradient of the loss function corresponding to the regression tree is labeled as follows: r m,i : ;1≤ m ≤ M ; in, F m-1 ( x ) is the first m -1 learner; F ( x Let ) be the objective function. F ( x i ) is the first i Input Samples x i The predicted value; Step c4: Use a classification regression tree to fit each preset data pair to obtain the first... m Tree of regression, and for the first m Minimize the loss function corresponding to the first regression tree to obtain the second regression tree. m The best-fit values for each leaf node in the regression tree; where the preset data pairs are labeled as (x i , r m,i ), No. m The first regression tree corresponding to the j The leaf node regions are marked as R m,j Leaf node region R m,j The corresponding number j The best-fit value for each leaf node is denoted as... γ m,j : ;1≤ j ≤ J m ;in, J m For the first m The total number of tree nodes in a regression tree; Step c5, update the strong learner; wherein the updated strong learner is labeled as F m ( x ): ; ; in, I ( x ∈ R m,j () is a judgment symbol; here x The input variables for the baseline model of chicken body weight estimation; Step c6 yields the updated strong learner, which is then used as the benchmark model for estimating chicken body mass; the updated strong learner is labeled as... F M ( x ): .
[0024] In this specific embodiment, with other parameters kept constant, the optimal values of the above parameters are found sequentially using grid search. The number of weak learners is 550, the maximum tree depth is 10, the minimum number of samples required to split internal nodes is 50, the minimum number of leaf nodes is 10, the learning rate is 0.04, and the mean squared error loss function is used.
[0025] In step 7 of this embodiment, the selection process of the preferred parameter set for chicken characteristics includes the following steps d1 to d5: Step d1: Calculate the average importance of each chicken feature in the chicken feature parameter set in a single regression tree, and use the average value as the selection criterion for the corresponding chicken feature. Step d2: Select chicken features from the chicken feature parameter set according to the size of each selected metric, forming different chicken feature combinations; wherein each chicken feature combination is formed by at least one selected chicken feature, and the chicken features in each chicken feature combination are not completely the same. Specifically, in this embodiment, the modeling results for different combinations of chicken features are shown in Table 2. The results show that age D has the greatest impact on the estimated body weight, followed by projected area A and perimeter C, while eccentricity E has the least impact. Table 2 shows that when one-dimensional, two-dimensional, and three-dimensional chicken features (Group G7) are input, the model estimation performance is significantly improved compared to Groups G1-G6. This embodiment compares the model estimation results before and after removing eccentricity E (Groups G7 and G8), finding that removing eccentricity E (Group G8) results in better model estimation, with significant reductions in root mean square error (RMSE) and mean absolute percentage error (MAPE). Therefore, in subsequent modeling, the optimized chicken feature parameters input include age D, projected area A, perimeter C, width W, length L, maximum inscribed circle radius R, volume V, and back width BW. Table 2 Comparison of modeling results for different combinations of chicken characteristics Group order Input features RMSE / kg MAPE / % G1 D 0.138 9.059 G2 A, C, W, L, R, E 0.097 5.920 G3 V, BW 0.129 8.132 G4 D, A, C, W, L, R, E 0.093 5.488 G5 D, V, BW 0.117 6.853 G6 A,C,W,L,R,E,V,BW 0.072 4.629 G7 D,A,C,W,L,R,E,V,BW 0.055 3.784 G8 D,A,C,W,L,R,V,BW 0.046 3.351 Step d3: Input the combination of each chicken feature into the constructed chicken body mass estimation benchmark model for estimation processing, and obtain the corresponding chicken body mass estimation value respectively. Step d4: Calculate the difference between the estimated body weight of each chicken and the actual measured body weight of the target chicken, and use the obtained body weight difference as the body weight estimation error of the corresponding chicken characteristic combination. Step d5: Select the body mass estimation error with the smallest error value from all the obtained body mass estimation errors, and use the chicken feature combination corresponding to the selected body mass estimation error as the chicken feature optimization parameter set. See Figure 5 The scatter plot showing the estimated and actual chicken body weight values demonstrates that the optimized chicken body weight estimation model constructed in this embodiment exhibits high consistency with manually measured values, with a root mean square error of 0.046 kg and a mean absolute percentage error of 3.351%. In other words, the chicken body weight estimation method based on a decision tree model and optimized features in this embodiment can prioritize and optimize chicken feature parameters, thereby further improving the accuracy of chicken body weight estimation.
[0026] It is important to emphasize that in the chicken body weight estimation of this embodiment, the extraction and optimization of chicken body size features are fully considered as key factors in measuring chicken body weight. The chicken features in the obtained set of chicken feature parameters are ranked according to their importance to chicken body weight measurement, and the optimal set of chicken feature optimization parameters is selected. Furthermore, a chicken body weight estimation optimization model is constructed to accurately estimate chicken body weight. This optimized model provides stronger interpretability for the chicken body weight estimation results, thus providing a powerful tool for the refined farming of poultry (such as chickens).
[0027] Although preferred embodiments of the present invention have been described in detail above, it should be clearly understood that various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for estimating chicken body weight based on decision tree model and optimized features, characterized in that, Includes the following steps 1-8: Step 1: Acquire color and depth videos of the target chickens in a preset posture within the same preset time period, respectively, to obtain chicken color videos and chicken depth videos; wherein, the chicken color videos are acquired using a visible light camera, and the chicken depth videos are acquired using a depth camera; the chicken color videos are marked as... V c Chicken depth video tagged as V d ; Step 2: Sequentially read each color video frame from the chicken color video and each depth video frame from the chicken depth video, and respectively select the chicken posture keyframe color image and chicken posture keyframe depth image at the time the target chicken first appears; the selected chicken posture keyframe color image is marked as... I c The selected chicken pose keyframe depth maps are marked as I d ; Step 3: The selected chicken pose keyframe color images are segmented using the Otsu threshold segmentation method to obtain a segmentation mask image; wherein, the obtained segmentation mask image is labeled as... I mask ; Step 4: Perform bitwise AND operations between the chicken pose keyframe color image and the chicken pose keyframe depth image and the segmentation mask image respectively to obtain the segmented color image and the segmented depth image; wherein, the segmented color image is marked as... I C_seg The segmented depth map is marked as I d_seg ; Step 5: Obtain the one-dimensional features of the target chickens based on the pre-collected chicken breeding information. Extract features from the segmentation mask image to obtain the two-dimensional features of the chickens. Extract features from the segmented color image and the segmented depth image to obtain the three-dimensional features of the chickens. Combine all the extracted one-dimensional, two-dimensional, and three-dimensional features of the chickens into a set of chicken feature parameters. Among them, the one-dimensional feature of the chickens is the age of the chickens, the two-dimensional features of the chickens include the projected area, perimeter, width, length, maximum inscribed circle radius, and eccentricity, and the three-dimensional features of the chickens include the volume and back width. Step 6: Take the obtained set of chicken characteristic parameters as input and the actual measured body mass of the target chicken as output to construct a chicken body mass estimation benchmark model based on decision tree. Step 7: Based on the constructed benchmark model for estimating chicken body weight, select the optimal set of preferred parameters for chicken features from the obtained set of chicken feature parameters; wherein, the preferred set of preferred parameters for chicken features includes at least one chicken feature from the set of chicken feature parameters. Step 8: Using the chicken feature optimization parameter set as input and the actual measured body mass of the target chicken as output, construct a chicken body mass estimation optimization model to estimate the chicken body mass.
2. The method for estimating chicken body weight based on decision tree model and preferred features according to claim 1, characterized in that, In step 5, the process of extracting features from the segmentation mask image to obtain the two-dimensional features of the chicken includes the following steps: Step a1: Extract the projected area, perimeter, width, length, maximum inscribed circle radius, and eccentricity from the segmented mask image to obtain the two-dimensional chicken features corresponding to the segmented mask image; wherein, the projected area is the pixel area of the foreground of the segmented mask image, the perimeter is the number of contour pixels of the foreground of the segmented mask image, the width is the width of the minimum bounding rectangle of the foreground of the segmented mask image, the length is the length of the minimum bounding rectangle of the foreground of the segmented mask image, the maximum inscribed circle radius is the maximum inscribed circle radius of the foreground of the segmented mask image, and the eccentricity is the eccentricity of the foreground of the ellipse-fitted segmented mask image; Step a2: The depth recovery process of the segmented color image is performed using the triangulation principle to obtain the chicken point cloud corresponding to the segmented color image. The volume and back width of the chicken point cloud are extracted to obtain the three-dimensional features of the chicken corresponding to the segmented color image.
3. The method for estimating chicken body weight based on decision tree model and preferred features according to claim 2, characterized in that, In step a2, the process of extracting the volume and back width of the chicken's point cloud to obtain the three-dimensional features of the chicken corresponding to the segmented color image includes the following steps: Step a21: Statistical filtering is used to remove outliers from the chicken point cloud to obtain a filtered chicken point cloud. Step a22: The filtered chicken point cloud is reconstructed using a Poisson reconstruction method based on normal estimation to obtain a chicken point cloud Mesh model. Step a23: Calculate the volume of the chicken based on the obtained chicken point cloud mesh model; Step a24: The minimum bounding box detection method is used to detect the filtered chicken point cloud to obtain the minimum bounding box of the chicken point cloud, and the width of the minimum bounding box of the chicken point cloud is used as the width of the chicken's back.
4. The method for estimating chicken body weight based on decision tree model and preferred features according to claim 1, characterized in that, In step 5, the process of extracting the three-dimensional features of chickens from the segmented color image and the segmented depth image includes the following steps: using the triangulation principle to perform depth restoration processing on the segmented color image and the segmented depth image to obtain the chicken point cloud corresponding to the segmented depth image, and extracting the volume and back width of the chicken point cloud respectively to obtain the three-dimensional features of chickens corresponding to the segmented depth image.
5. The method for estimating chicken body weight based on a decision tree model and preferred features according to claim 4, characterized in that, In step b2, the process of extracting the volume and back width of the chicken point cloud to obtain the 3D features of the chicken corresponding to the segmented depth map includes the following steps: Step b21: Statistical filtering is used to remove outliers from the chicken point cloud, resulting in a filtered chicken point cloud. Step b22: The Poisson reconstruction method based on normal estimation is used to perform Poisson reconstruction processing on the filtered chicken point cloud to obtain the chicken point cloud Mesh model. Step b23: Calculate the volume of the chicken based on the obtained chicken point cloud mesh model; Step b24: The minimum bounding box detection method is used to detect the filtered chicken point cloud to obtain the minimum bounding box of the chicken point cloud, and the width of the minimum bounding box of the chicken point cloud is used as the width of the chicken's back.
Citation Information
Patent Citations
Attitude key frame detection method for poultry weight estimation
CN114926639A