Method for predicting delivery weight of sow based on machine learning model

Through the machine learning model-based delivery weight prediction method, combined with Pearson correlation analysis and Weibull equation, the problem of time-consuming and inaccurate measurement of sow birth weight in the existing technology is solved, and more accurate weight assessment and feeding management are achieved, which improves the Accuracy of reproductive performance and nutrition prediction.

CN119089299APending Publication Date: 2024-12-06HUAZHONG AGRI UNIV

Patent Information

Application Number
CN202411076307.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The existing sow birth weight measurement methods are time-consuming and labor-intensive and not accurate enough, making it difficult to effectively explain the weight differences between different sows and affect reproductive performance.

Method used

Using a machine learning model-based approach, by collecting weight and backfat thickness data at multiple time points, using Pearson correlation analysis and Weibull equations, combined with machine learning algorithms such as Random Forest Regressor (RFR) and Gradient Boosting Regressor (GBR), Establish a birth weight prediction model, perform data standardization and outlier processing, and optimize hyperparameter tuning.

Benefits of technology

It has achieved a more accurate, reliable and convenient weight assessment of sow delivery, which can intervene in feeding management in a timely manner, improve reproductive performance, and provide accurate dynamic nutritional needs predictions, providing a foundation for intelligent feeding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119089299A_ABST
    Figure CN119089299A_ABST
Patent Text Reader

Abstract

The invention discloses a method for predicting the delivery weight of a sow based on a machine learning model, and relates to the field, and the technical scheme of the invention comprises the following steps: S1, collecting data, measuring the weight of a sample sow at a plurality of time points, and measuring the backfat thickness of a P2 point of the sow; s2, data analysis: adopting Pearson correlation analysis to construct a correlation coefficient matrix; s3, weight prediction: establishing a Weibull equation of the data set according to the measured delivery weight and day age, and obtaining delivery weight prediction. The prediction method can more accurately, reliably and conveniently evaluate the body weight of the sow through a model, facilitates understanding of the maternal growth rule and the body condition reserve state of the pregnant sow, timely and effectively intervenes in advance in feeding management of the sow, and improves the reproductive performance of the sow.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a field, and in particular to a method for predicting sow farrowing weight based on a machine learning model. Background Art

[0002] With the progress of genetic selection in modern pig production, the reproductive potential of sows has been greatly improved. In the past 20 years, the total number of sows born has increased by 0.2 heads / year (BdPorc, 2018). In order to maintain fetal development and sufficient body reserves during sow lactation, the nutritional needs of sows during pregnancy increase accordingly. The sow's farrowing weight reflects the sow's pre-partum nutritional reserves and body condition, and is an important indicator affecting the reproductive performance and nutritional intake of sows. Too low body weight before farrowing reflects insufficient nutritional intake during sow pregnancy, which may lead to low litter size and birth weight, and decreased lactation performance due to insufficient postpartum body condition reserves. However, when the sow's farrowing weight is too high, it is easy to increase the incidence of sow limb and hoof diseases and increase the rate of culling in the third litter (Williams et al., 2005; Amaral Filha et al., 2009). Therefore, accurate and quick measurement or prediction of sow farrowing weight, and maintaining a reasonable farrowing weight through nutrition or feeding management methods, is conducive to precise feeding of pregnant sows and optimal reproductive performance.

[0003] For sow weight assessment, the most commonly used accurate method is direct weighing, which involves transferring the pig to a scale, fixing it, weighing it, and recording the data (Lee et al., 2016; Pezzuolo et al., 2017). However, the weighing process is time-consuming and labor-intensive, and it can easily cause greater stress to pregnant sows, which is not conducive to subsequent reproductive performance (Marinello et al., 2015; Brandland et al., 2016). 1996). Indirect methods include predicting sow weight by measuring sow physical characteristics, such as evaluating sow weight by sow body length and chest circumference to establish a linear regression equation model to predict sow weight (Connell et al., 2007), and using computer vision to obtain sow image data and related algorithms to evaluate weight (Tscharke and Banhazi, 2015). In addition, for the prediction model of sow weight growth curve, the Weibull model is also commonly used to predict the sow weight growth curve. By establishing the Weibull function of sow farrowing age and farrowing weight, the individual nutritional needs of sows are predicted and precise feeding is implemented (Dourmad et al., 2008; Gaillard et al., 2019; Gaillard et al., 2020; Quiniou, 2021).

[0004] Sow weight is affected by many factors such as genetics, environment, feeding management and health status. Simple linear regression related to sow body shape or Weibull model related to age cannot well explain the weight differences between individual sows. It is necessary to develop more accurate, reliable and convenient methods and models to evaluate sow weight. Summary of the invention

[0005] To solve the above technical problems, the present invention provides a method for predicting sow birth weight based on a machine learning model. This prediction method can more accurately, reliably and conveniently evaluate sow weight, which is helpful for understanding the growth law and body condition reserve status of pregnant sows, timely and effectively intervening in sow feeding and management in advance, and improving sow reproductive performance.

[0006] The technical solution adopted by the present invention to solve the technical problem is: a method for predicting the farrowing weight of sows based on a machine learning model, wherein the experimental period is from weighting to farrowing of sample sows, and the method comprises the following steps:

[0007] S1, collect data, measure the body weight of sample sows at multiple time points and measure the back fat thickness at P2 point of sows;

[0008] S2, data analysis, using Pearson correlation analysis to construct a correlation coefficient matrix;

[0009] S3, predicting weight, based on the measured farrowing weight and age, establishes the Weibull equation of the data set to obtain the farrowing weight prediction.

[0010] Preferably, the categorical feature data of the data set include sow source, breed, and parity; the numerical feature data of the data set include breeding backfat, breeding weight, farrowing age, average metabolizable energy intake during pregnancy, average SID-Lys intake during pregnancy, farrowing backfat, and total piglets;

[0011] The farrowing weight was determined by subtracting the sow's gestational weight from the body weight before farrowing.

[0012] Preferably, the correlation coefficient matrix is ​​as follows:

[0013] Weight of conceptus(g)=exp(8.621–21.02×exp(–0.053×t)+0.114×ls)

[0014] Ratio=(ls×average piglet birth weight,g) / 1.12×exp{[9.095–17.69exp(–0.0305×114)+0.0878×ls]}

[0015] Maternal EBW(kg)=0.96×maternal BW

[0016] Maternal BL(kg)=–26.4+0.221×maternal EBW+1.331×P2 backfat

[0017] Maternal BP(kg)=2.28+0.178×maternal EBW–0.333×P2 backfat.

[0018] Preferably, in step S2, outliers are processed using an outlier detection method Z-scores, and data values ​​of different units are normalized to a common scale using a Z-score data normalization method. The definition of Z-score is:

[0019]

[0020] Where Z, x, μ and σ are the standard score, normalized value, data mean and standard deviation respectively.

[0021] Preferably, the Weibull equation for the data set of this study is established based on the measured birth weight and age:

[0022] BW after farrowing=275×(1-exp(-3.824 / 1000)×(Age at Farrowing)0.9801)).

[0023] Preferably, two kinds of genetic source prediction are included: prediction with genetic source and prediction without genetic source;

[0024] In each scenario, multiple model algorithms were used to build models in Python using the scikit-learn library;

[0025] The hyperparameters of the selection model algorithm were tuned to determine the best training; the data was randomly divided into two parts, 80% training set and 20% test set; for each hyperparameter combination, a 5-fold cross-validation method was used for training.

[0026] Advantages of the present invention:

[0027] This scheme provides a method for predicting the birth weight of sows based on a machine learning model. This prediction method can evaluate the weight of sows more accurately, reliably and conveniently. The accuracy and stability of the evaluation model using the coefficient of determination (R2), mean square error (MSE), root mean square error (RMSE) and mean absolute percentage error (MAPE) are helpful for understanding the growth pattern and body condition reserve status of pregnant sows, timely and effective early intervention in sow feeding and management, and improving the reproductive performance of sows. Further research can also accurately predict the dynamic nutritional needs of sows, providing a solid foundation for the implementation of precise and intelligent feeding. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only 6 of the drawings of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0029] Figure 1 Correlation coefficient matrix of different variables;

[0030] Figure 2 MAPE box plots of different models under two learning strategies;

[0031] Figure 3 Weibull equation for age at farrowing and weight;

[0032] Figure 4 are the predicted values ​​and observed values ​​of RFR, GBR, INRA Weibull model and the established Weibull model; a is the scatter plot of predicted values ​​and observed values, b is the time series plot of predicted values ​​and observed values ​​of different models; MEAP is the mean absolute percentage error, PCC is the Pearson correlation coefficient;

[0033] Figure 5 Taylor diagram of RFR, GBR, INRA Weibull model and the prediction results of the established Weibull model. The horizontal and vertical axes represent the standard deviation, the radial lines represent the correlation coefficient, and the dotted lines represent the RMSE;

[0034] Figure 6 Comparison of RFR, GBR and INRA Weibull models and residuals of the established Weibull model. NS means no significant difference, *** means P < 0.001. DETAILED DESCRIPTION

[0035] In order to deepen the understanding of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. The embodiments are only used to explain the present invention and do not limit the protection scope of the present invention.

[0036] Example

[0037] 1 Animals and data collection

[0038] The experiment included two time periods and was conducted in two sow farms, A and B. A total of 1,941 sows (958 Canadian sows and 983 French sows) completed the entire experiment from mating to farrowing. The day before mating, the sows' mating weight was measured with a scale, and the backfat thickness at P2 was measured with A-ultrasound. The sows were fed twice a day at 8 am and 3 pm during the entire gestation period. The nutrient concentrations of the gestation feed in the pig farm are shown in Table 1. The backfat thickness of the sows during pregnancy was measured at 30d, 60d and 90d of pregnancy, and the sow feeding amount was adjusted according to the sow's body condition. The sow's weight before farrowing and the backfat thickness were measured when the sows went to the farrowing house on the 110th day of pregnancy.

[0039] Nutrient concentration of pregnancy feed

[0040]

[0041] 2 Data analysis and preprocessing

[0042] In order to evaluate the impact of multiple factors on sow farrowing weight, a total of 1944 sows were measured and used to train the supervised learning algorithm. The data set consists of three categorical feature data (sow source, breed, parity) and seven numerical feature data (breeding backfat, breeding weight, farrowing age, average metabolic energy intake during pregnancy, average SID-Lys intake during pregnancy, farrowing backfat and total piglets). The farrowing weight is the weight before farrowing minus the sow's pregnant weight. The calculation formula for pregnant weight refers to NRC (2012) (Formula 1 and Formula 2). The body fat and body protein content of the sow are calculated based on the sow's weight and backfat (Formula 3-5). Pearson correlation analysis was used for the variables in the data set to construct a correlation coefficient matrix.

[0043] Weight of conceptus(g)=exp(8.621–21.02×exp(–0.053×t)+0.114×ls) (1)

[0044] Ratio=(ls×average piglet birth weight,g) / 1.12×exp{[9.095–17.69exp(–0.0305×114)+0.0878×ls]}(2)

[0045] Maternal EBW(kg)=0.96×maternal BW (3)

[0046] Maternal BL(kg)=–26.4+0.221×maternal EBW+1.331×P2 backfat (4)

[0047] Maternal BP(kg)=2.28+0.178×maternal EBW–0.333×P2 backfat (5)

[0048] In order to ensure the accuracy and representativeness of the acquired data, the outlier detection method Z-scores is used to process the outliers, and the Z-score data normalization method is used to standardize the data values ​​of different units to a common scale. The definition of Z-score is:

[0049]

[0050] Where Z, x, μ and σ are the standard score, normalized value, data mean and standard deviation respectively.

[0051] 3 Weibull model predicts sow weight

[0052] Referring to the Weibull equation (Formula 7) published by Gaillard et al (2019), the farrowing weight was predicted according to the sow's farrowing age. In addition, the Weibull equation (Formula 7) for the data set of this study was established based on the measured farrowing weight and age.

[0053] BW after farrowing=275×(1-exp(-3.824 / 1000)×(Age at Farrowing) 0.9801 ))(7)

[0054] 4. Machine Learning Model Algorithm Selection and Hyperparameter Tuning

[0055] In order to determine the effect of genetic origin on sow farrowing weight, this study will be divided into two scenarios for prediction: ① prediction with genetic origin; ② prediction without genetic origin. In each scenario, the following 10 model algorithms were used to model in Python using the scikit-learn library: Linear Regression (LR), Bayesian Ridge (BR), Random Forest Regressor (RFR), Elastic Net (EN), Decision Tree Regressor (DTR), Gradient Boosting Regressor (GBR), XGB Regressor (XGB), Bagging Regressor (Bagging), KNeighbors Regressor (KNN), SupportVectorRegressor (SVR).

[0056] The hyperparameters of the selected model algorithm are tuned to determine the best training. Table 2 shows the hyperparameter tests of each model. The data is randomly divided into two parts, 80% training set and 20% test set. For each hyperparameter combination, a 5-fold cross-validation method is used for training.

[0057] Choosing model hyperparameters and data transformations

[0058]

[0059]

[0060]

[0061] 5 Model effect evaluation

[0062] To evaluate the effect of different models in predicting sow farrowing weight, this study used the coefficient of determination (R 2 The accuracy of the model is evaluated by four indicators: mean square error (MSE) (Formula 9), root mean square error (RMSE) (Formula 10), and mean absolute percentage error (MAPE) (Formula 12). 2 The higher the value, the better the fit between the regression model and the measured value. MSE, RMSE and MAPE are used as model performance evaluation indicators. The smaller the value, the better the model performance. The four indicators are defined as:

[0063]

[0064] 6 Preliminary statistical analysis of data

[0065] The following table shows the average and standard deviation of sow weight, backfat and nutrient intake according to the genetic origin of the sows. Overall, the breeding weight and farrowing weight of French sows are lower than those of French sows, and the average backfat at all stages of pregnancy is higher than that of Canadian sows, indicating that French sows have stronger backfat and body fat deposition potential than Canadian sows, and Canadian sows have faster growth rates.

[0066] Descriptive statistical analysis of sows from different genetic origins

[0067]

[0068] Figure 1 The correlation coefficient matrix between different variables was described to test the relationship between different variables. The variables with strong correlation were parity and age (r = 0.93, p < 0.01) and ME and SID-Lys (r = 0.95, p < 0.01). All input variables were correlated with birth weight, with TB having the strongest correlation (r = -0.76, p < 0.01), followed by BFf (r = 0.72, p < 0.01), BFi (r = 0.52, p < 0.01), ME (r = -0.47, p < 0.01) and SID.Lys (r = -0.39, p < 0.01). Therefore, all input variables were included in the model for birth weight prediction.

[0069] The inclination angles of the left and right ellipses are significantly negatively correlated and significantly positively correlated, respectively. Blue and red indicate positive and negative correlations, respectively. Thin ellipses indicate high correlation coefficients. genotype: genetic origin, breed: breed, parity: parity, AF farrowing age, BWi: foetal weight, BWf: farrowing weight, BFi: breeding backfat, BFf: farrowing backfat, ME: mean metabolizable energy during pregnancy, SID-Lys: mean SID-Lys during pregnancy, TB: litter size

[0070] Comparison of performance of different models under two learning strategies

[0071] The following table shows the R of 10 models for birth weight prediction under two learning strategies. 2 , MSE, RMSE and MAPE results. In the scenario with genetic sources, R 2 , MSE, RMSE and MAPE were 0.51-1.00, 285.98-336.79kg, 16.81-18.35kg and 5.41%-5.91% respectively. In the scenario without genetic source, R 2, MSE, RMSE and MAPE ranges are 0.50-1.00, 285.82-330.97kg, 16.91-18.19kg and 5.39%-5.89% respectively. Under the two learning strategies, RFR and GBR have the smallest MSE, RMSE and MAPE compared with other models. The RFR and GBR models control the prediction errors at 5.41% and 5.39% respectively, indicating that these two models have the best prediction effect for birth weight. In addition, the MAPE box plot is used to measure the stability of different models under the two learning strategies ( Figure 2 ), under the two learning strategies, the median MAPE of the RFR and GBR models is smaller than that of other models, and the dispersion of the MAPE predicted by the two models is good. Therefore, in the scenarios with genetic sources and without genetic sources, the optimal models for predicting farrowing weight of pregnant sows are the RFR and GBR models, respectively.

[0072] Table 4 Performance comparison of 10 models for birth weight prediction under two learning strategies

[0073]

[0074]

[0075] The black line in the middle of the box plot represents the median, the vertical line represents 1.5 times the interquartile range, and the black dots represent outliers. Comparison between the optimal machine learning model and the Weibull model

[0076] Based on the data of sow farrowing age and farrowing weight, the Weibull equation for farrowing age and farrowing weight was established with reference to Gaillard et al. (2019) (Formula 1-1 and Figure 3 ).

[0077]

[0078] We randomly selected 100 data from the validation set to compare the predicted values ​​and observed values ​​of the machine learning model RFR and GBR with those of the INRA Weibull model and the Weibull model we established ( Figure 4-a). The MAPE between the observed and predicted values ​​of RFR, GBR, INRA Weibull and adjusted Weibull models were 5.42%, 5.63%, 8.43% and 10.18%, respectively, and the correlation coefficients were 0.79, 0.78, 0.49 and 0.47, respectively. Among them, the predicted values ​​and observed values ​​of RFR and GBR were relatively close, while the predicted values ​​and observed values ​​of the Weibull model were quite different, indicating that the prediction accuracy of RFR and GBR was significantly better than that of the Weibull model. In addition, the scatter plots of RFR and GBR were closer to the 1:1 line, and the MAPE of RFR and GBR predictions were 5.12% and 4.22%, respectively, which were 39.03% and 49.94% higher than the accuracy of the Weibull model we established, and 49.51% and 58.55% higher than the INRA Weibull model, respectively. RFR and GBR greatly improved the prediction performance of birth weight.

[0079] In addition, the Taylor diagram is used to evaluate the model accuracy ( Figure 5 ). The RFR and GBR models have lower RMSE and higher correlation coefficients than the Weibull model, indicating that the prediction performance of RFR and GBR is better than that of the Weibull equation.

[0080] Box plot of residuals comparing the two optimal models with the Weibull model ( Figure 6 ) It can be seen that in both scenarios, the RFR and GBR models show that the residual median is closer to 0 than the Weibull model, and the residual dispersion is the most concentrated, indicating that the machine learning model has a more accurate and stable prediction effect than the Weibull model.

[0081] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0082] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for predicting sow farrowing weight based on a machine learning model, characterized in that: The experimental period is from weighting to farrowing of sample sows, including the following steps: S1, collect data, measure the body weight of sample sows at multiple time points and measure the back fat thickness at P2 point of sows; S2, data analysis, using Pearson correlation analysis to construct a correlation coefficient matrix; S3, predicting weight, based on the measured farrowing weight and age, establishes the Weibull equation of the data set to obtain the farrowing weight prediction.

2. A method for predicting sow farrowing weight based on a machine learning model according to claim 1, characterized in that: The categorical feature data of the dataset include sow source, breed, and parity; the numerical feature data of the dataset include breeding backfat, breeding weight, farrowing age, average metabolizable energy intake during pregnancy, average SID-Lys intake during pregnancy, farrowing backfat, and total piglets; The farrowing weight was determined by subtracting the sow's gestational weight from the body weight before farrowing.

3. The method for predicting sow farrowing weight based on a machine learning model according to claim 1, characterized in that: The correlation coefficient matrix is ​​as follows: Weight of conceptus(g)=exp(8.621–21.02×exp(–0.053×t)+0.114×ls) Ratio=(ls×average piglet birth weight,g) / 1.12×exp{[9.095–17.69exp(–0.0305×114)+0.0878×ls]} Maternal EBW(kg)=0.96×maternal BW Maternal BL(kg)=–26.4+0.221×maternal EBW+1.331×P2 backfat Maternal BP(kg)=2.28+0.178×maternal EBW–0.333×P2 backfat.

4. The method for predicting sow farrowing weight based on a machine learning model according to claim 1, characterized in that: Step S2, use the outlier detection method Z-scores to process the outliers, and use the Z-score data normalization method to normalize the data values ​​of different units to a common scale. The definition of Z-score is: Where Z, x, μ and σ are the standard score, normalized value, data mean and standard deviation respectively.

5. The method for predicting sow farrowing weight based on a machine learning model according to claim 1, characterized in that: According to the measured birth weight and age, the Weibull equation of this study data set was established: BW after farrowing=275×(1-exp(-3.824 / 1000)×(Age at Farrowing) 0.9801 ))。 6. The method for predicting sow farrowing weight based on a machine learning model according to claim 1, characterized in that: There are two types of genetic source prediction: prediction with genetic source and prediction without genetic source; In each scenario, multiple model algorithms were used to build models in Python using the scikit-learn library; The hyperparameters of the selection model algorithm were tuned to determine the best training; the data was randomly divided into two parts, 80% training set and 20% test set; for each hyperparameter combination, a 5-fold cross-validation method was used for training.

Citation Information

Patent Citations

  • Sow weaning performance prediction method, system and device and storage medium

    CN117036080A

Cited By

  • Ruminant animal feed titer intelligent evaluation method, system and equipment and storage medium

    CN121958903A