Chicken body quality estimation method based on decision tree model and optimal characteristics

Through a method based on the decision tree model and preferred features, chicken videos are collected and image segmentation and feature extraction are carried out to construct a chicken body mass estimation model, solving the problem of time-consuming and labor-intensive measurement of chicken body mass, and real-time, accurate, non-invasion measurement and efficient estimation of chicken body mass are achieved.

CN120279082AInactive Publication Date: 2025-07-08ZHEJIANG INST OF COMM
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510410758.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-02
Publication Date
2025-07-08
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing chicken body mass measurement methods are time-consuming, labor-intensive, easy to cause stress, or complex installation, difficult maintenance and underestimation of body mass, making it difficult to achieve real-time, accurate and intrusive measurement of chicken body mass.

Method used

Using a method based on the decision tree model and preferred features, by collecting the color video and depth video of the chicken, extracting the chicken pose keyframe image, performing segmentation and feature extraction, a chicken body mass estimation model is constructed, and the optimal feature parameter set is selected for estimation.

Benefits of technology

Real-time, accurate and non-invasive measurement of chicken body mass is achieved, measurement efficiency and accuracy are improved, and the importance of chicken characteristics can be sorted and optimized, and the chicken body mass estimation optimization model is constructed, which improves the estimation accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120279082A_ABST
    Figure CN120279082A_ABST
Patent Text Reader

Abstract

The invention relates to a chicken body quality estimation method based on a decision tree model and preferable features, which comprises the following steps of: obtaining a chicken color video and a chicken depth video by obtaining a color video and a depth video of a chicken in a preset posture in a preset time period, extracting a chicken posture key frame color image and a chicken posture key frame depth image, and estimating the quality of the chicken body according to the chicken posture key frame color image and the chicken posture key frame depth image. Further processing to obtain a segmented mask pattern, a segmented color pattern and a segmented depth pattern, obtaining one-dimensional features of the chicken, extracting features of the segmented mask pattern to obtain two-dimensional features of the chicken, extracting features of the segmented color pattern and the segmented depth pattern to obtain three-dimensional features of the chicken, and constructing a chicken body quality estimation reference model based on a decision tree; and selecting an optimal chicken feature optimization parameter set in combination with chicken feature importance degree sorting, and constructing a chicken body quality estimation optimization model. Therefore, the chicken body mass can be accurately estimated by using the chicken feature optimization parameter set and the chicken body mass estimation optimization model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent poultry management, and in particular to a method for estimating chicken body weight based on a decision tree model and preferred features. Background Art

[0002] Body weight is an important indicator for evaluating the growth status and overall health level of chickens. The body weight information of chickens is related to factors such as their production efficiency, disease resistance, and meat quality. Therefore, the body weight information of chickens can be used to guide the daily feeding amount of chickens, determine the best slaughter time, and guide the breeding of breeding chickens.

[0003] In order to accurately measure the body weight of chickens, current chicken body weight measurement methods include manual sampling measurement and weighing device measurement. Among them, the measurement process of the manual sampling measurement method is time-consuming, labor-intensive, and prone to stress; although the weighing device measurement method does not cause stress to chickens, it has problems such as complex installation, difficult maintenance, and easy underestimation of body weight in the later stage.

[0004] Therefore, how to make a real-time, accurate and non-invasive measurement of the body weight of chickens to improve the measurement efficiency and accuracy of chicken body weight has become a technical problem that needs to be solved urgently in the current 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 method for estimating chicken body weight based on a decision tree model and preferred features that can make a real-time, accurate and non-invasive measurement of the body weight of chickens for the above-mentioned existing technologies.

[0006] The technical solution adopted by the present invention to solve the above technical problems is: a method for estimating chicken body weight based on a decision tree model and preferred features, which is characterized by including the following steps 1 to 8:

[0007] Step 1, respectively collect the color video and depth video of the target chicken in a preset posture within the same preset time period to obtain the chicken color video and the chicken depth video; wherein, the chicken color video is collected by a visible light camera, and the chicken depth video is collected by a depth camera; the chicken color video is marked as V c , and the chicken depth video is marked as V d ;

[0008] Step 2, sequentially read each color video frame in the chicken color video and sequentially read each depth video frame in the chicken depth video, and respectively screen out the chicken posture key frame color map and the chicken posture key frame depth map when the target chicken first appears; among them, the screened chicken posture key frame color map is marked as I c , and the screened chicken posture key frame depth map is marked as I d ;

[0009] Step 3: Use the Otsu threshold segmentation method to segment the selected key frames of chicken postures in color images to obtain a segmentation mask image; where the obtained segmentation mask image is marked as I mask ;

[0010] Step 4: Perform bitwise AND operations on the key frames of chicken postures in color images and the key frames of chicken postures in depth images with the segmentation mask image respectively to obtain the segmented color image and the segmented depth image correspondingly; where the segmented color image is marked as I C_seg , and the segmented depth image is marked as I d_seg ;

[0011] Step 5: Obtain the one-dimensional chicken features of the target chicken according to the pre-collected chicken breeding information of the target chicken, extract the two-dimensional chicken features from the segmentation mask image, extract the three-dimensional chicken features from the segmented color image and the segmented depth image, and use all the extracted one-dimensional chicken features, two-dimensional chicken features and three-dimensional chicken features together as the chicken feature parameter set; where the one-dimensional chicken feature is the chicken age, the two-dimensional chicken features include the projected area, perimeter, width, length, maximum inscribed circle radius and eccentricity, and the three-dimensional chicken features include volume and back width;

[0012] Step 6: Use the obtained chicken feature parameter set as the input and the actually measured body mass of the target chicken as the output to construct a chicken body mass estimation benchmark model based on a decision tree;

[0013] Step 7: Based on the constructed chicken body mass estimation benchmark model, select the optimal chicken feature optimization parameter set from the obtained chicken feature parameter set; where the chicken feature optimization parameter set includes at least one chicken feature in the chicken feature parameter set;

[0014] Step 8: Use the chicken feature optimization parameter set as the input and the actually measured body mass of the target chicken as the output to construct a chicken body mass estimation optimization model to estimate the chicken body mass.

[0015] Improved, in the chicken body mass estimation method based on a decision tree model and optimized features, in Step 5, the process of extracting the two-dimensional chicken features from the segmentation mask image includes the following steps a1 - a2:

[0016] Step a1, extract the projected area, perimeter, width, length, maximum inscribed circle radius, and eccentricity from the segmentation mask image respectively to obtain the two-dimensional features of the chicken corresponding to the segmentation mask image; wherein, 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 ellipse fitting the foreground of the segmentation mask image.

[0017] Step a2, perform depth recovery processing on the segmented color image using the principle of triangulation to obtain the chicken point cloud corresponding to the segmented color image, and extract the volume and back width of the chicken point cloud respectively to obtain the three-dimensional features of the chicken corresponding to the segmented color image.

[0018] Furthermore, in the chicken body mass estimation method based on the decision tree model and preferred features, in step a2, the process of 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 color image includes the following steps a21 - a24:

[0019] Step a21, perform outlier filtering on the chicken point cloud using statistical filtering to obtain the filtered chicken point cloud.

[0020] Step a22, perform Poisson reconstruction processing on the filtered chicken point cloud using the Poisson reconstruction method based on normal estimation to obtain the chicken point cloud Mesh model.

[0021] Step a23, calculate the chicken volume according to the obtained chicken point cloud Mesh model.

[0022] Step a24, perform detection on the filtered chicken point cloud using the minimum bounding box detection method to obtain the minimum bounding box of the chicken point cloud, and use the width of the minimum bounding box of the chicken point cloud as the back width of the chicken.

[0023] Further improvement, in the chicken body mass estimation method based on the 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: perform depth recovery processing on the segmented color image and the segmented depth image using the principle of triangulation to obtain the chicken point cloud corresponding to the segmented depth image, and extract 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.

[0024] Furthermore, in the chicken body mass estimation method based on the decision tree model and preferred features, the process of 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 includes the following steps b21 - b24:

[0025] Step b21: Use statistical filtering to remove outliers from the chicken point cloud, obtaining the filtered chicken point cloud;

[0026] Step b22: Perform Poisson reconstruction on the filtered chicken point cloud using the Poisson reconstruction method based on normal estimation, obtaining the chicken point cloud Mesh model;

[0027] Step b23: Calculate the chicken volume based on the obtained chicken point cloud Mesh model;

[0028] Step b24: Use the minimum bounding box detection method to detect the filtered chicken point cloud, obtaining the minimum bounding box of the chicken point cloud, and taking the width of the minimum bounding box of the chicken point cloud as the back width of the chicken.

[0029] Further improvement: In the chicken body mass estimation method based on the decision tree model and preferred features, in step 6, the construction process of the chicken body mass estimation reference model includes the following steps c0 to c6:

[0030] Step c0: Pre-form a training data set for the decision tree model; among them, the training data set is marked as T, T = {(x1, y1), (x2, y2), …, (x N , y N )}, (x i , y i ) is the i-th training sample in the training data set T, 1 ≤ i ≤ N, x i is the input sample value of the i-th training sample, y i is the label value of the i-th training sample, and N is the total number of training samples in the training set T;

[0031] Step c1: Initialize the first weak learner; among them, the first weak learner is marked as F0(x):

[0032]

[0033] Among them, x is the input sample, L(y i , γ) is the loss function of the decision tree model, y i is the label value of the i-th training sample, γ is the candidate parameter of the initial prediction value of the model, and the specific value of γ is determined by the form of the loss function L(y i , γ);

[0034] Step c2: Pre-establish the same preset number of regression trees for each training sample in the training data set; among them, the preset number is marked as M, M ≥ 1;

[0035] Step c3: For each training sample in the first weak learner, calculate the negative gradient of the loss function corresponding to each regression tree. Among them, the negative gradient of the loss function corresponding to the m-th regression tree of the i-th training sample is denoted as r m,i :

[0036]

[0037] Among them, F m-1 (x) is the (m - 1)-th learner; F(x) is the objective function, and F(x i ) is the predicted value of the i-th input sample x i .

[0038] Step c4: Use the classification and regression tree to fit each preset data pair to obtain the m-th regression tree, and minimize the loss function corresponding to the m-th regression tree to obtain the best fit value of each leaf node on the m-th regression tree. Among them, the preset data pair is denoted as (x i , r m,i ), the j-th leaf node region corresponding to the m-th regression tree is denoted as R m,j , and the best fit value of the j-th leaf node corresponding to the leaf node region R m,j is denoted as γ m,j :

[0039]

[0040] Among them, J m is the total number of leaf nodes of the m-th regression tree;

[0041] Step c5: Update the strong learner. Among them, the strong learner to be updated is denoted as F m (x):

[0042]

[0043] Among them, I(x ∈ R m,j ) is the judgment symbol; here, x is the input variable of the chicken body weight estimation benchmark model;

[0044] Step c6: Finally, obtain the updated strong learner and use the updated strong learner as the chicken body weight estimation benchmark model. Among them, the updated strong learner is denoted as F M (x):

[0045]

[0046] Furthermore, in the chicken body weight estimation method based on the decision tree model and the selected features, in the said Step 7, the selection process of the chicken feature preference parameter set includes the following steps d1 to d5:

[0047] Step d1: Calculate the average importance of each chicken feature in the set of chicken feature parameters in a single regression tree, and use each average value as the basis for selection of the corresponding chicken feature.

[0048] Step d2: Select chicken features from the set of chicken feature parameters according to the order of the sizes of the selected measurement bases to form different combinations of chicken features. Among them, each combination of chicken features is formed by at least one selected chicken feature, and the chicken features in each combination of chicken features are not completely the same.

[0049] Step d3: Input each combination of chicken features into the established chicken body mass estimation benchmark model for estimation processing to obtain corresponding chicken body mass estimation values.

[0050] Step d4: Calculate the body mass differences between each chicken body mass estimation value and the chicken body mass of the target chicken obtained by actual measurement, and use the obtained body mass differences as the body mass estimation errors of the corresponding chicken feature combinations respectively.

[0051] Step d5: Select the body mass estimation error with the smallest error value from all the obtained body mass estimation errors, and use the combination of chicken features corresponding to the selected body mass estimation error as the optimal chicken feature parameter set.

[0052] Preferably, in the chicken body mass estimation method based on the decision tree model and the optimal features, the preset posture is the standing posture.

[0053] Compared with the prior art, the advantages of the present invention are as follows: The chicken body mass estimation method based on the decision tree model and preferred features of the present invention obtains the chicken color video and chicken depth video of the chicken in a preset posture within a preset time period, and then extracts the chicken posture key frame color map and the chicken posture key frame depth map, segments the chicken posture key frame color map to obtain a segmentation mask map, further processes it to obtain the segmented color map and the segmented depth map, and obtains the one-dimensional feature (age) of the chicken. Feature extraction is performed on the segmentation mask map to obtain the two-dimensional features of the chicken, and feature extraction is performed on the segmented color map and the segmented depth map to obtain the three-dimensional features of the chicken. Based on all the obtained chicken features and the chicken body mass of the target chicken obtained by actual measurement, a chicken body mass estimation benchmark model based on the decision tree is constructed. Then, the optimal chicken feature preference parameter set is selected, and the chicken feature preference parameter set is used as the input and the chicken body mass of the target chicken obtained by actual measurement is used as the output to construct a chicken body mass estimation optimization model, so as to estimate the chicken body mass. In this way, the importance ranking of each chicken feature is realized and the selection of the chicken feature preference parameter set is carried out, a chicken body mass estimation optimization model is constructed, and then the chicken body mass is accurately estimated by using the chicken feature preference parameter set and the chicken body mass estimation optimization model. Description of the Drawings

[0054] Figure 1 It is a schematic flowchart of the chicken body mass estimation method based on the decision tree model and preferred features in the embodiment of the present invention;

[0055] Figure 2 It is a schematic diagram of the two-dimensional features of the chicken extracted in the embodiment of the present invention;

[0056] Figure 3 It is a schematic diagram of the three-dimensional features of the chicken extracted in the embodiment of the present invention;

[0057] Figure 4 It is a schematic diagram of the ranking of the average importance of each chicken feature in the chicken feature parameter set in the embodiment of the present invention;

[0058] Figure 5 It is a scatter plot of the estimated chicken body mass value and the true chicken body mass value (i.e., the chicken body mass obtained by actual measurement) in the embodiment of the present invention. Detailed Embodiment

[0059] The present invention will be further described in detail below in conjunction with the embodiments of the drawings.

[0060] This embodiment provides a method for estimating the body weight of chickens based on a decision tree model and optimal 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 RTX TITAN graphics cards.

[0061] The objects of the body weight estimation experiment are 882 yellow-feathered chickens. A total of 41 yellow-feathered chickens were randomly selected from the breeding chickens in Huzhou City, Zhejiang Province in 3 batches. The selected chickens have complete feather coverage and normal body shapes, and are marked with leg bands.

[0062] See Figure 1 As shown, the method for estimating the body weight of chickens based on a decision tree model and optimal features in this embodiment includes the following steps 1 to 8:

[0063] Step 1: Collect the color video and depth video of the target chicken in a preset posture within the same preset time period respectively to obtain the chicken color video and the chicken depth video; among them, the chicken color video is collected by a visible light camera, and the chicken depth video is collected by a depth camera. The image resolutions collected by the visible light camera and the depth camera are both 960 pixel * 540 pixel; the chicken color video is marked as V c , and the chicken depth video is marked as V d ; the preset posture here is preferably the standing posture of the chicken.

[0064] Step 2: Read each color video frame in the chicken color video and each depth video frame in the chicken depth video in sequence, and respectively screen out the key color image of the chicken posture and the key depth image of the chicken posture when the target chicken first appears; among them, the screened key color image of the chicken posture is marked as I c , and the screened key depth image of the chicken posture is marked as I d ; specifically in this embodiment, the screening method of the key color image of the chicken posture adopts the posture key frame detection method disclosed in the Chinese invention patent application CN114926639A "Posture Key Frame Detection Method for Poultry Body Weight Estimation" to screen out the key color image of the chicken posture and the key depth image of the chicken posture when the target chicken first appears.

[0065] Step 3: Perform segmentation processing on the screened key color image of the chicken posture by using the Otsu threshold segmentation method to obtain a segmentation mask image; among them, the obtained segmentation mask image is marked as I mask ;

[0066] Step 4: Perform bitwise AND operations on the key-frame color image of the chicken's pose and the key-frame depth image of the chicken's pose with the segmentation mask image respectively to obtain the segmented color image and the segmented depth image correspondingly; among them, the segmented color image is marked as I C_seg , and the segmented depth image is marked as I d_seg ; It should be noted that the "bitwise AND operation" here is a common technical means in the field of digital image processing and will not be elaborated here;

[0067] Step 5: Obtain the one-dimensional chicken features of the target chicken according to the pre-collected chicken breeding information of the target chicken, extract the two-dimensional chicken features from the segmentation mask image, extract the three-dimensional chicken features from the segmented color image and the segmented depth image, and use all the extracted one-dimensional chicken features, two-dimensional chicken features and three-dimensional chicken features together as the chicken feature parameter set; among them, the one-dimensional chicken feature is the chicken age D, the two-dimensional chicken features include the projected area A, the perimeter C, the width W, the length L, the radius R of the largest inscribed circle and the eccentricity E, and the three-dimensional chicken features include the volume V and the back width BW; specifically:

[0068] In step 5 of this embodiment, the process of sequentially extracting the two-dimensional chicken features and the three-dimensional chicken features from the segmented color image here includes the following steps a1 to a2:

[0069] Step a1: Extract the projected area, perimeter, width, length, radius of the largest inscribed circle and eccentricity from the segmentation mask image respectively to obtain the two-dimensional chicken features; among them, 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 radius of the largest inscribed circle is the radius of the largest inscribed circle of the foreground of the segmentation mask image, and the eccentricity is the eccentricity of the ellipse fitting the foreground of the segmentation mask image;

[0070] Step a2: Perform depth recovery processing on the segmented color image using the principle of triangulation to obtain the chicken point cloud corresponding to the segmented color image, and extract the volume and back width of the chicken point cloud respectively to obtain the three-dimensional chicken features corresponding to the segmented color image; among them:

[0071] In this step a2, the process of extracting the volume and back width of the chicken point cloud respectively to obtain the three-dimensional chicken features corresponding to the segmented color image includes the following steps a21 to a24:

[0072] 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 filtering is set to 3, and the standard deviation multiplier is set to 2.0. In this way, the adverse effects of outliers in the chicken point cloud obtained in step a2 on the accuracy of chicken three-dimensional feature extraction can be eliminated.

[0073] Step a22: The Poisson reconstruction method based on normal estimation is used to perform Poisson reconstruction on the filtered chicken point cloud to obtain a chicken point cloud Mesh model. The search radius for normal estimation is set to 5, the maximum number of points used for estimating the normal within the neighborhood is set to 30, and the depth of Poisson reconstruction is set to 4.

[0074] The chicken point cloud Mesh model consists of multiple triangular patches and vertices. The origin O(0, 0, 0) is selected as the reference point. Each triangular patch and the origin O form a tetrahedron. By accumulating the volumes of all tetrahedrons, the chicken volume can be calculated.

[0075] 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 this minimum bounding box of the chicken point cloud is used as the back width of the chicken. Specifically, after pose screening, most of the chickens used for estimation are in a standing pose, and the back width is basically close to the width of the minimum bounding box. Therefore, the width of the minimum bounding box of the chicken point cloud is used as the back width of the chicken here. Table 1 shows the extraction results of 10 groups of randomly selected chicken characteristic parameters. Through comparative analysis, it is found that except for the eccentricity E, there is a certain correlation between each chicken characteristic and the chicken body mass M.

[0076]

[0077] Table 1 Extraction results of chicken characteristic parameters

[0078] Note: M is the actual body mass of yellow-feathered chickens, D is the age in days, A is the projected area, C is the perimeter, 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 back width.

[0079] In step 5 of this embodiment, the process of sequentially extracting the two-dimensional chicken characteristics and the three-dimensional chicken characteristics from the segmented depth map includes the following steps: Using the principle of triangulation to perform depth recovery processing on the segmented color map and the segmented depth map to obtain the chicken point cloud corresponding to the segmented depth map, and separately extracting the volume and back width of the chicken point cloud to obtain the three-dimensional chicken characteristics corresponding to the segmented depth map.

[0080] In this step, the process of separately 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 to b24:

[0081] Step b21, perform outlier filtering on the chicken point cloud using statistical filtering to obtain the filtered chicken point cloud;

[0082] Step b22, perform Poisson reconstruction processing on the filtered chicken point cloud using the Poisson reconstruction method based on normal estimation to obtain the chicken point cloud Mesh model;

[0083] Step b23, calculate the volume of the chicken based on the obtained chicken point cloud Mesh model;

[0084] Step b24, detect the filtered chicken point cloud using the minimum bounding box detection method to obtain the minimum bounding box of the chicken point cloud, and use the width of the minimum bounding box of the chicken point cloud as the back width of the chicken; after extraction processing, the two-dimensional features of the obtained chicken are shown in Figure 2 as shown, and the three-dimensional features of the obtained chicken are shown in Figure 3 as shown;

[0085] Step 6, use the obtained set of chicken characteristic parameters as the input and the chicken body mass of the target chicken obtained by actual measurement as the output to construct a chicken body mass estimation benchmark model based on a decision tree; specifically, in Step 6, the construction process of the chicken body mass estimation benchmark model includes the following steps c0 to c6:

[0086] Step c0, pre-form a training data set for the decision tree model; among them, the training data set is marked as T, T = {(x1, y1), (x2, y2), …, (x N , y N )}, (x i , y i ) is the i-th training sample in the training data set T, 1 ≤ i ≤ N, x i is the input sample value of the i-th training sample, y i is the label value of the i-th training sample, and N is the total number of training samples in the training set T;

[0087] Step c1, initialize the first weak learner; among them, the first weak learner is marked as F0(x):

[0088]

[0089] Among them, x is the input sample, L(y i , γ) is the loss function of the decision tree model, y i is the label value of the i-th training sample, γ is the candidate parameter of the initial prediction value of the model, and the specific value of γ is determined by the loss function L(yi , in the form of γ);

[0090] Step c2, pre - establish the same preset number of regression trees for each training sample in the training dataset; where the preset number is marked as M, and M≥1;

[0091] Step c3, for each training sample in the first weak learner, calculate the negative gradient of the loss function corresponding to each of its regression trees; where the negative gradient of the loss function corresponding to the m - th regression tree of the i - th training sample is marked as r m,i :

[0092] where, F m-1 (x) is the (m - 1) - th learner, F(x) is the objective function, and F(x i ) is the predicted value of the i - th input sample x i ;

[0093] Step c4, use a classification and regression tree to fit each preset data pair to obtain the m - th regression tree, and minimize the loss function corresponding to the m - th regression tree to obtain the best fit value of each leaf node on the m - th regression tree; where the preset data pair is marked as (x i , r m,i ), the j - th leaf node region of the m - th regression tree is marked as R m,j , and the best fit value of the leaf node corresponding to the leaf node region R m,j is marked as γ m,j :

[0094]

[0095] where, J m is the total number of leaf nodes of the m - th regression tree;

[0096] Step c5, update the strong learner; where the updated strong learner is marked as F m (x):

[0097]

[0098] where, I(x∈R m,j ) is a judgment symbol; here x is the input variable of the chicken body mass estimation benchmark model;

[0099] Step c6, finally obtain the updated strong learner, and use the updated strong learner as the chicken body mass estimation benchmark model; where the updated strong learner is marked as F M (x):

[0100] Specifically in this embodiment, with other parameters fixed, the optimal values of the above parameters are sequentially found using grid search. The number of weak learners is 550, the maximum depth of the tree is 10, the minimum number of samples required to split an internal node 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 as the loss function;

[0101] Step 7: Based on the constructed chicken body weight estimation benchmark model, select the optimal chicken feature selection parameter set from the obtained chicken feature parameter set; wherein, the chicken feature selection parameter set includes at least one chicken feature from the chicken feature parameter set; in this step 7, the selection process of the chicken feature selection parameter set includes the following steps d1 to d5:

[0102] Step d1: Calculate the average value of the importance of each chicken feature in the single regression tree in the chicken feature parameter set, and use each average value as the basis for measuring the selection of the corresponding chicken feature;

[0103] Step d2: Select chicken features from the chicken feature parameter set according to the sorting of the measured selection bases, and form 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;

[0104] Specifically in this embodiment, the modeling results of different chicken feature combinations are shown in Table 2. The results show that the age D has the greatest influence on the chicken body weight estimation result, followed by the projected area A and the perimeter C, while the eccentricity E has the least influence on the body weight estimation result; as can be seen from Table 2, when the one-dimensional chicken features, two-dimensional chicken features, and three-dimensional chicken features (Group G7) of the chicken are input, the estimation effect of the model is greatly improved compared with Groups G1 to G6; in this embodiment, by comparing the model estimation results before and after removing the eccentricity E (Groups G7 and G8), it is found that the estimation effect of the model after removing the eccentricity E (Group G8) is better, and both the root mean square error (RMSE) and the mean absolute percentage error (MAPE) are significantly reduced. Therefore, in the subsequent modeling process, the actually input optimized chicken feature parameters include the age D, the projected area A, the perimeter C, the width W, the length L, the radius R of the largest inscribed circle, the volume V, and the back width BW;

[0105] Group sequence Input feature 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

[0106] Table 2 Comparison of modeling results of different chicken feature combinations

[0107] Step d3: Input each chicken feature combination into the constructed chicken body weight estimation benchmark model for estimation processing, and obtain the corresponding chicken body weight estimation values respectively;

[0108] Step d4: Calculate the body mass differences between the estimated body mass values of each chicken and the body mass of the target chicken obtained by actual measurement, and use the obtained body mass differences as the body mass estimation errors for the corresponding chicken feature combinations respectively.

[0109] 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 optimal chicken feature parameter set.

[0110] Step 8: Use the optimal chicken feature parameter set as the input and the body mass of the target chicken obtained by actual measurement as the output to construct an optimized chicken body mass estimation model for estimating the chicken body mass. Among them, in this embodiment, when constructing the optimized chicken body mass estimation model, the body mass of the target chicken obtained by actual measurement is the true label when constructing this optimized chicken body mass estimation model.

[0111] See Figure 5 the scatter plot of the estimated chicken body mass value and the true chicken body mass value shown in the figure. It can be seen that the optimized chicken body mass estimation model constructed in this embodiment has a high consistency with the manually measured value, with a root mean square error of 0.046 kg and an average absolute percentage error of 3.351%. That is to say, the chicken body mass estimation method based on the decision tree model and the optimized features in this embodiment can rank the importance of chicken feature parameters and optimize the feature parameters, thereby further improving the accuracy of chicken body mass estimation.

[0112] It should be emphasized that in the chicken body mass estimation of this embodiment, the factor that the extraction and optimization of chicken body size features are the key to measuring chicken body mass is fully considered. Then, according to the importance of each chicken feature in the obtained chicken feature parameter set for chicken body mass measurement, a ranking is made as the basis for selecting the chicken features, and the optimal chicken feature optimal parameter set is selected. Furthermore, an optimized chicken body mass estimation model is constructed to accurately estimate the chicken body mass, and the obtained optimized chicken body mass estimation model has stronger interpretability for the chicken body mass estimation result, thus providing a powerful means for the refined breeding of poultry (such as chickens).

[0113] Although the preferred embodiments of the present invention have been described in detail above, it should be clearly understood that various changes and modifications can be made to the present invention for those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for estimating the body mass of chickens based on a decision tree model and preferred features, characterized in that, Including the following steps 1 to 8: Step 1, respectively collect the color video and depth video of the target chicken in the same preset time period when it is in a preset posture, and obtain the color video and depth video of the chicken; wherein the color video of the chicken is collected by using a visible light camera, and the depth video of the chicken is collected by using a depth camera; the color video of the chicken is marked as V c , the chicken depth video is marked as V d ; Step 2: Sequentially read each color video frame in the chicken color video and each depth video frame in the chicken depth video, and respectively screen out the key color image of the chicken posture and the key depth image of the chicken posture when the target chicken first appears; among them, the screened key color image of the chicken posture is marked as I c , and the screened key depth image of the chicken posture is marked as I d ; Step 3: Use the Otsu threshold segmentation method to segment the key frames of the chicken posture color images obtained by screening, and obtain a segmentation mask image; among them, the obtained segmentation mask image is marked as I mask ; Step 4, perform a bitwise AND operation on the color key frame image of the chicken pose and the depth key frame image of the chicken pose with the segmentation mask image respectively, so as to obtain the segmented color image and the segmented depth image correspondingly; among them, the segmented color image is marked as I C_seg , and the segmented depth image is marked as I d_seg ; Step 5: Obtain the one-dimensional chicken characteristics of the target chicken based on the pre-collected chicken breeding information of the target chicken, extract the two-dimensional chicken characteristics from the segmentation mask image, extract the three-dimensional chicken characteristics from the segmented color image and the segmented depth image, and use all the extracted one-dimensional chicken characteristics, two-dimensional chicken characteristics, and three-dimensional chicken characteristics together as the chicken characteristic parameter set; among them, the one-dimensional chicken characteristic is the chicken age, the two-dimensional chicken characteristics include the projected area, perimeter, width, length, maximum inscribed circle radius, and eccentricity, and the three-dimensional chicken characteristics include volume and back width; Step 6: Use the obtained chicken characteristic parameter set as the input and the actual measured body mass of the target chicken as the output to construct a chicken body mass estimation benchmark model based on a decision tree; Step 7: Based on the constructed chicken body mass estimation benchmark model, select the optimal chicken characteristic optimization parameter set from the obtained chicken characteristic parameter set; among them, the chicken characteristic optimization parameter set includes at least one chicken characteristic in the chicken characteristic parameter set; Step 8: Use the chicken characteristic optimization parameter set as the input and the actual measured body mass of the target chicken as the output to construct a chicken body mass estimation optimization model to estimate the chicken body mass.

2. The chicken body mass estimation method based on the decision tree model and the optimal features according to claim 1, wherein In Step 5, the process of extracting the two-dimensional chicken characteristics from the segmentation mask image includes the following steps: Step a1: Extract the projected area, perimeter, width, length, maximum inscribed circle radius, and eccentricity from the segmentation mask image respectively to obtain the two-dimensional chicken characteristics corresponding to the segmentation mask image; among them, 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 circumscribed rectangle of the foreground of the segmentation mask image, the length is the length of the minimum circumscribed 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 ellipse fitting the foreground of the segmentation mask image; Step a2: Use the principle of triangulation to perform depth recovery processing on the segmented color image to obtain the chicken point cloud corresponding to the segmented color image, and extract the volume and back width of the chicken point cloud respectively to obtain the three-dimensional chicken characteristics corresponding to the segmented color image.

3. The method for estimating the body mass of chickens based on a 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 point cloud respectively to obtain the three-dimensional chicken characteristics corresponding to the segmented color image includes the following steps: Step a21: Use statistical filtering to filter out the outliers from the chicken point cloud to obtain the filtered chicken point cloud; Step a22: Use the Poisson reconstruction method based on normal estimation to perform Poisson reconstruction processing on the filtered chicken point cloud to obtain the chicken point cloud Mesh model; Step a23: Calculate the chicken volume according to the obtained chicken point cloud Mesh model; Step a24: Use the minimum bounding box detection method to detect the filtered chicken point cloud to obtain the minimum bounding box of the chicken point cloud, and use the width of the minimum bounding box of the chicken point cloud as the chicken back width.

4. The method for estimating the body mass of chickens based on a decision tree model and preferred features according to claim 1, wherein 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 principle of triangulation to perform depth recovery processing on the segmented color image and the segmented depth image, obtaining the chicken point cloud corresponding to the segmented depth image, and respectively extracting the volume and the back width of the chicken point cloud to obtain the three-dimensional features of the chicken corresponding to the segmented depth image.

5. The method for estimating the body mass of chickens based on a decision tree model and preferred features according to claim 4, wherein In step b2, the process of respectively extracting the volume and the back width of the chicken point cloud to obtain the three-dimensional features of the chicken corresponding to the segmented depth image includes the following steps: Step b21, using statistical filtering to remove the outliers from the chicken point cloud to obtain the filtered chicken point cloud; Step b22, using the Poisson reconstruction method based on normal estimation to perform Poisson reconstruction processing on the filtered chicken point cloud to obtain the chicken point cloud Mesh model; Step b23, calculating the chicken volume according to the obtained chicken point cloud Mesh model; Step b24, using the minimum bounding box detection method to detect the filtered chicken point cloud to obtain the minimum bounding box of the chicken point cloud, and taking the width of the minimum bounding box of the chicken point cloud as the back width of the chicken.

6. The chicken body mass estimation method based on a decision tree model and preferred features according to claim 1, characterized in that, In step 6, the process of constructing the chicken body mass estimation reference model includes the following steps: Step c0, pre - form a training data set for the decision tree model; wherein, the training data set is labeled as T, T = {(x1, y1), (x2, y2), …, (x N , y N )}, (x i , y i ) is the i - th training sample in the training data set T, 1 ≤ i ≤ N, x i is the input sample value of the i - th training sample, y i is the label value of the i - th training sample, and N is the total number of training samples in the training set T; Step c1, initializing the first weak learner; where the first weak learner is labeled as F0(x): where x is the input sample, and L(y i , γ) is the loss function of the decision tree model, y i is the label value of the i-th training sample, γ is the candidate parameter of the initial prediction value of the model, and the specific value of γ is determined by the form of the loss function L(y i , γ); Step c2, pre-establishing the same preset number of regression trees for each training sample in the training dataset; 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 thereof; wherein, the negative gradient of the loss function corresponding to the m-th regression tree of the i-th training sample is denoted as r m,i : Among them, F m-1 (x) is the (m - 1)-th learner; F(x) is the target function, and F(x i ) is the predicted value of the i-th input sample x i . Step c4: Use a classification and regression tree to perform a fitting process on each preset data pair to obtain the m-th regression tree, and minimize the loss function corresponding to the m-th regression tree to obtain the best fitting values of the leaf nodes on the m-th regression tree; wherein, the preset data pair is marked as (x i , r m,i ), the j-th leaf node region corresponding to the m-th regression tree is marked as R m,j , and the best fitting value of the j-th leaf node corresponding to the leaf node region R m,j is marked as γ m,j : Among them, J m is the total number of leaf nodes of the m-th regression tree; Step c5, update the strong learner; among them, the strong learner to be updated is marked as F m (x): where I(x∈R m,j ) is a judgment symbol; here, x is the input variable of the chicken body mass estimation benchmark model; Step c6, finally obtain the updated strong learner, and use the updated strong learner as the chicken body weight estimation benchmark model; among them, the updated strong learner is marked as F M (x):

7. The chicken body mass estimation method based on the decision tree model and the preferred features according to any one of claims 1 to 6, characterized in that, The preset posture is the standing posture.

Citation Information

Patent Citations

  • Attitude key frame detection method for poultry weight estimation

    CN114926639A