A method and system for quality control and filling of breeding pig growth performance data
By using the quality control and filling process in the breeding pig performance measurement station, the weight and feed intake data are processed, and the data is abnormal and missing are solved, which improves the reliability of the data and the efficiency of breeding work.
Patent Information
- Application Number
- CN202411774537.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-05
AI Technical Summary
There are abnormal weight values and feed intake data at the performance measurement station of breeding pigs, resulting in incompleteness and inaccuracy of the data, affecting the evaluation of feed efficiency traits and breeding work.
The quality control and filling process is adopted, and the weight and feed intake data are quality controlled and filled through regression analysis, Tukey weight function, robust regression, linear interpolation method, fitted binomial regression method, linear mixed model and Loess local weighted regression method, and abnormal data are identified and corrected.
The breeding efficiency of breeding traits of feed conversion rates of breeding pigs has been improved, the reliability and accuracy of data has been enhanced, and the scientific nature of breeding decisions has been improved.
Smart Images

Figure CN119249086B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of breeding pig data processing, and specifically designs a method and system for quality control and filling of breeding pig growth performance data. Background Art
[0002] Feed efficiency traits include daily feed intake (DFI), residual feed intake (RFI), and feed conversion ratio (FCR). Because they cannot be directly measured, they are difficult to improve through direct selection in animal breeding. FCR and RFI are two common traits used to evaluate feed efficiency. FCR, also known as feed-to-weight ratio, is a trait used to indicate the efficiency of animals in converting feed into body weight. Because it is simple to calculate and is related to growth rate and body weight, it is widely used to estimate feed efficiency in the pig industry. It is usually calculated using the ratio of feed intake to weight gain of pigs, where feed intake and weight gain both represent the measured values of individuals during a specific period (such as fattening period).
[0003] The pig performance measurement station can record the feed intake, activity and other information of the pigs, helping farmers better understand the needs of the pigs and ensure that they have a good growth environment and health status. By quantitatively analyzing the various production performance indicators of the pigs, the measurement process of the growth performance and feeding performance of the pigs is more scientific and accurate. With the development of electronic information and automation technology, the latest pig performance measurement station can collect and upload data while automatically feeding. A large number of companies use the weight data and feed intake data collected by the pig performance measurement station to calculate the FCR trait data.
[0004] Abnormal weight values and feed intake data are common in breeding pig performance measurement stations. Due to improper guardrail settings, when the pig group is small, two pigs are likely to enter the measurement station at the same time, resulting in a measured weight value that is twice the normal value. The damp or dusty environment of the measurement station, adhesion of the feed trough scale, failure to calibrate the feed trough scale regularly, and damage to hardware equipment may all cause abnormal feed intake data in the measurement station system. Breeder pig performance measurement stations need to be powered and connected to the Internet throughout the entire measurement process. When a power outage or network outage occurs, the feed intake measurement data for the day will not be retained, resulting in missing weight and feed intake data. Summary of the invention
[0005] The present invention proposes a quality control and filling process for the abnormal data existing in the above-mentioned breeding pig performance measurement stations. The process performs quality control on the abnormal data and fills in the missing data for the original body weight and feed intake derived from the breeding pig growth performance measurement station. We use the data processed by different quality control processes to prove that the process can obtain higher prediction accuracy than the currently commonly used quality control methods. Therefore, our new process is conducive to improving the efficiency of breeding work for the feed conversion rate trait of breeding pigs.
[0006] To achieve the above purpose, the present invention provides a method for quality control and filling of breeding pig growth performance data, the steps comprising:
[0007] Collecting and preprocessing the growth performance data of sows, wherein the growth performance data of sows includes body weight data and feed intake data;
[0008] Using regression analysis method, combined with Tukey weight function and robust regression method, the processed weight data is quality controlled; according to the type of missing data, linear interpolation method and fitting binomial regression method are used to fill the processed weight data;
[0009] Based on the processed feed intake data, several types of abnormal feeding behavior are identified, and the feed intake of abnormal types is set as blank. Then, a linear mixed model is used to correct the non-abnormal data. Based on the pen, body weight, daily weight gain and frequency of abnormal types, the missing feed intake data is filled by the Loess local weighted regression method.
[0010] Preferably, the method for performing the preprocessing includes: deleting all measurement data of individuals with multiple measurement station numbers, individuals with an initial measurement age of less than 60 days or greater than 130 days, individuals with a final measurement age of less than 130 days or greater than 190 days, individuals with less than 40 measurement days, and individuals with a missing days ratio greater than 10%; setting single data without an individual number as abnormal data for deletion, setting all weight data with weight values less than 20kg or greater than 180kg throughout the individual measurement period as blank, and setting non-numerical feed intake and feeding time values to 0.
[0011] Preferably, the method for quality control of the processed weight data includes: firstly establishing a relationship model between weight and age by regression analysis, calculating the weight residual, then applying the Tukey weight function to determine the weight of each weight value, then refitting the regression curve using a robust regression method, iteratively optimizing until outliers are effectively filtered out, and finally deleting individual data whose average coefficient of variation of weight is greater than a preset value.
[0012] Preferably, the method for filling the processed weight data includes: completing the individual measurement date, filling the missing weight caused by the missing date and the missing weight caused by the abnormal weight quality control; the middle missing data type is one or more days of missing weight values and there are weight values on both sides of the missing data, and the missing values are filled using linear interpolation; the first and last missing data type is one or more days of missing weight values and there are no weight values on the left or right side of the missing data, and the missing values are filled using the fitted binomial regression method; in order to prevent the first weight from being missing for too many days, resulting in a minimum value in the filling, the weight of the filled individual is truncated, and the measurement data before the individual first reaches the preset weight is deleted.
[0013] Preferably, after quality control of the processed feed intake data, a linear mixed model is used to correct the non-abnormal data:
[0014] ,
[0015] Where m represents a natural number. is the normal feed intake of the mth pig in the i-th pen on the nth day; is the fixed effect of the ith column; is the weight of the mth pig on day n; is the daily weight gain of the mth pig; is the percentage of type p abnormalities in the mth pig on day n; The total feeding time of each time when the p-type abnormality occurred on the nth day for the mth pig; is the total daily feed intake of the mth pig on the nth day with p-type abnormality; b1, b2, b3, b4, b5 are the regression coefficients of BW, ADG, ETP, OTD, and FID respectively; P m is the individual random effect of the mth pig and satisfies ; is the residual and satisfies .
[0016] Preferably, the abnormal feed intake correction value is calculated using the covariate regression coefficient, and the calculation formula is as follows:
[0017] ,
[0018] in, is the correction value of abnormal feed intake of the mth pig on the nth day, , , The definitions are the same as above, b3, b4, and b5 are the regression coefficients of ETP, OTD, and FID obtained by solving the linear mixed model;
[0019] Calculate the sum of normal feed intake and abnormal feed intake correction value, which is the individual's corrected feed intake for the day. The calculation formula for corrected feed intake is:
[0020] ,
[0021] in, Corrected feed intake for the mth pig in the i-th pen on day n, is the normal feed intake of the mth pig in the ith pen on that day, It is the correction value of abnormal feed intake of the mth pig in the ith pen on that day.
[0022] The present invention provides a quality control and filling system for breeding pig growth performance data, the system is used to implement the above method, including: a collection module, a first processing module and a second processing module;
[0023] The collection module is used to collect and pre-process the growth performance data of the sows, wherein the growth performance data of the sows includes body weight data and feed intake data;
[0024] The first processing module is used to perform quality control on the processed weight data by using regression analysis method, combined with Tukey weight function and robust regression method; according to the type of missing data, the processed weight data is filled by using linear interpolation method and fitting binomial regression method;
[0025] The second processing module is used to identify several types of abnormal feeding behavior based on the processed feed intake data, set the feed intake of abnormal types as blank, and then use a linear mixed model to correct the non-abnormal data, and fill in the missing feed intake data through the Loess local weighted regression method based on the pen, body weight, daily weight gain and frequency of abnormal types.
[0026] Compared with the prior art, the present invention has the following beneficial effects:
[0027] In view of the problem of insufficient utilization of feeding data from measuring stations in current pig breeding in my country, the present invention has developed a new method for quality control of raw feeding data. This method can not only filter out erroneous data in feeding records, but also fill in missing data, thereby improving the reliability of data. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0029] Figure 1 It is a schematic diagram of the method flow of the present invention. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0032] Embodiment 1
[0033] like Figure 1 As shown, it is a schematic diagram of the method flow of the present invention, and the steps include:
[0034] S1. Collect and preprocess the growth performance data of breeding pigs.
[0035] In this embodiment, the growth performance data of sows include: body weight data and feed intake data. Before quality control of the growth performance data of sows is performed, the original data needs to be preprocessed, and the method includes: deleting all the measurement data of individuals with multiple measurement station numbers, individuals with a starting measurement age of less than 60 days or greater than 130 days, individuals with a final measurement age of less than 130 days or greater than 190 days, individuals with less than 40 measurement days, and individuals with a missing day ratio greater than 10%. Single data without an individual number is considered as abnormal data and deleted, and all weight data with a weight value less than 20kg or greater than 180kg during the entire individual measurement period is set to be blank, and the values of non-numerical feed intake and feeding time are set to 0.
[0036] S2. Use regression analysis method, combined with Tukey weight function and robust regression method to perform quality control on the processed weight data; according to the type of missing data, use linear interpolation method and fitted binomial regression method to fill in the processed weight data.
[0037] First, quality control is performed on abnormal weight data. In the original data of the breeding pig performance testing station, most of the individual weight data show a normal growth pattern, but there are still abnormal weight values that deviate from the normal range or growth curve. Weight quality control is performed on each individual, and the quality control steps are as follows: Quality control of abnormal weight data is first performed by regression analysis to establish a relationship model between weight and age, calculate the weight residual, and then apply the Tukey weight function to determine the weight of each weight value. Then, the robust regression method is used to refit the regression curve, and iterative optimization is performed until the outliers are effectively filtered out. Finally, individual data with an average weight coefficient of variation greater than 0.02 are deleted to ensure data accuracy. The specific steps include:
[0038] (1) Fitting regression curve
[0039] Using all the weight values and age values measured during the individual measurement period, a regression curve was fitted, and the formula was:
[0040] ,
[0041] The dependent variable y is the weight value of a single individual during the whole measurement period, the independent variable x is the age of a single individual during the whole measurement period, and the covariate x is 2 is the square of the age of a single individual during the measurement period, a0, a1 and a2 are regression coefficients, which are estimated by the least squares method. The goal of the least squares method is to minimize the sum of squares of the residuals between the actual observations and the model predictions. The estimated value of the regression coefficient can be obtained by solving the optimization function. The target optimization function is:
[0042] ,
[0043] in, represents the target optimization function; a0, a1 and a2 are regression coefficients; i represents a natural number; n represents a natural number.
[0044] (2) Calculate weight residual
[0045] The residual of the weight value is calculated according to the regression curve. The calculation method is the difference between the actual weight value and the predicted value of the regression curve. The formula is:
[0046] ,
[0047] Among them, e i is the residual of the i-th weight value of the individual measurement period, y i is the actual measured value of the i-th weight value of the individual measurement period, It is the predicted value of the regression curve of the i-th weight value of the individual measurement period (when there are multiple measured weight values at a certain age, the predicted weight value for that day is the same).
[0048] (3) Calculate body weight
[0049] The weight of each measured weight value is calculated according to the Tukey weight function, which can be expressed as:
[0050] ,
[0051] Among them, c is a regulation constant that needs to be manually adjusted, is the weight factor of a single individual, and w i is the weight of the i-th weight value of the individual, e i is the residual of the individual's ith weight value, σ is the standard deviation of the residuals of all weight values of the individual during the entire measurement period, is the standardized residual of the ith weight value; when When The size of gradually decreases, the maximum value is 1, and the minimum value is 0; When , the weight is directly 0.
[0052] (4) Robust regression fitting regression curve
[0053] The least squares method is very sensitive to outliers. Robust regression uses a more robust regression coefficient estimation method to fit the model. Common robust regression methods include the M estimation method, the least median squares (LMS) method, and the least truncation squares (LTS) method. Among them, the M estimation method robust regression uses iterative weighted least squares to estimate the regression coefficient. The weight value with abnormally large residuals is not used to estimate the regression curve. The target optimization function is:
[0054] ,
[0055] Among them, w i is the weight of the i-th weight value of the individual, e i is the residual of the i-th weight value of the individual, and there are n weight values in total. After estimating the new regression curve, return to step 3 to recalculate the weights, and obtain the optimal fitting effect by continuously iteratively adjusting the constant c in step (3).
[0056] The abnormal weight values of individuals with abnormal growth patterns cannot be filtered out normally in robust regression, resulting in the individual data being unusable after quality control. This example calculates the average coefficient of variation of the weight of each individual after deleting the abnormal values:
[0057] ,
[0058] Where j represents a natural number, is the average coefficient of variation of the weight of the ith pig, is the standard deviation of the weight of the ith pig on the jth day, The average weight of all the weights of the ith pig on the jth day after the outliers are deleted. The ith pig is measured for a total of n days. All the measured data of individuals with an average coefficient of variation greater than a preset value (0.02 in this embodiment) are deleted.
[0059] After the weight data has been quality controlled, it is filled and intercepted.
[0060] Complete the individual measurement date, fill in the missing weight caused by the missing date and the missing weight caused by the quality control of abnormal weight. The middle missing data type is one or more days of missing weight values and there are weight values on both sides of the missing data. The missing values are filled using linear interpolation. The first and last missing data types are one or more days of missing weight values and there are no weight values on the left or right side of the missing data. The missing values are filled using the fitted binomial regression method. In order to prevent the first weight from being missing too many days, resulting in a minimum value being filled, the weight of the filled individual is truncated, and the measurement data before the individual first reaches the preset weight (30 kg in this embodiment) is deleted.
[0061] S3. Based on the processed feed intake data, several types of abnormal feeding behavior were identified, and the feed intake of abnormal types was set as blank. Then, the linear mixed model was used to correct the non-abnormal data. Based on the pen position, body weight, daily weight gain and frequency of abnormal types, the missing feed intake data were filled by the Loess local weighted regression method.
[0062] First, the abnormal feeding amount data is quality controlled, and several types (10 in the embodiment) of feeding behavior are defined as feeding abnormality types, as shown in Table 1; whether the daily single feeding data is abnormal is identified, and the feeding amount in the single feeding record of any abnormal feeding type is set to blank.
[0063] Table 1
[0064] ,
[0065] Among them, feeding speed = feeding amount (g) / feeding time (min).
[0066] Then, the daily single feeding data is integrated. Each raw data exported by the measurement station contains the feed intake and body weight values of a single feeding event, and the number of daily data is the number of daily feeding times. In order to obtain the daily feed intake and daily body weight values of individuals, multiple daily feeding data need to be integrated.
[0067] In the quality control of abnormal weight, each weight is given a weight value, and the weight with the largest weight value among all the weights of the individual on that day is selected as the individual's weight on that day.
[0068] After identifying and deleting the abnormal daily single feed intake, the retained daily single feed intake is the normal feed intake. The individual normal feed intake values are summed up on a daily basis to obtain the individual daily normal feed intake. When performing quality control on abnormal feed intake, a linear mixed model needs to be used to correct the feed intake. The model covariates include data such as error frequency. When integrating single-day data, it is necessary to calculate the frequency of each abnormal type on that day, the sum of the feeding time of abnormal types 1, 2, 6, 7, 8, 9, and 10 on that day, and the sum of the feed intake of abnormal types 4 and 5 on that day, to provide covariate data for subsequent correction of abnormal feed intake.
[0069] All measured data of individuals with more than 30 feeding times per day and individuals with more than 10% of the days with less than 3 feeding times were deleted.
[0070] Finally, the feed intake data were filled, and the non-abnormal data were corrected using a linear mixed model. Then, based on the pen position, body weight, daily weight gain and frequency of abnormal types, the missing daily feed intake data were filled by the Loess local weighted regression method to ensure the completeness and accuracy of the data.
[0071] The formula for fitting the linear mixed model is as follows:
[0072] ,
[0073] Where m represents a natural number. is the normal feed intake of the mth pig in the i-th pen on the nth day; is the fixed effect of the ith column; is the weight of the mth pig on day n, which is a covariate; is the daily weight gain of the mth pig, which is a covariate; is the percentage of p-type abnormalities in the mth pig on day n, which is a covariate; It is the sum of the feeding time of each time when the p-type abnormality occurred in the m-th pig on the nth day, which is a covariate; is the total daily feed intake of the mth pig on the nth day with p-type abnormality, which is a covariate; b1, b2, b3, b4, b5 are the regression coefficients of BW, ADG, ETP, OTD, and FID respectively; P m is the individual random effect of the mth pig and satisfies ; is the residual and satisfies Therefore, the fixed effect in the formula is the pen to which the individual belongs, the random effect is the individual number, and the covariates are the body weight on the day, the average daily weight gain throughout the process, the frequency of abnormalities 1 to 10 on the day, the sum of the feeding time on the day of abnormalities 1 to 2, 6 to 10, and the sum of the feed intake on the day of abnormalities 4 and 5.
[0074] The correction value for abnormal feed intake was calculated using the covariate regression coefficients as follows:
[0075] ,
[0076] in, is the correction value of abnormal feed intake of the mth pig on the nth day, , , The definitions are the same as above, and b3, b4, and b5 are the regression coefficients of ETP, OTD, and FID obtained by solving the linear mixed model.
[0077] Calculate the sum of normal feed intake and abnormal feed intake correction value, which is the individual's corrected feed intake for the day. The calculation formula for corrected feed intake is:
[0078] ,
[0079] in, Corrected feed intake for the mth pig in the i-th pen on day n, is the normal feed intake of the mth pig in the ith pen on that day, It is the correction value of abnormal feed intake of the mth pig in the ith pen on that day.
[0080] After correction, each individual will obtain a daily feed intake data, but there will be a small amount of missing daily feed intake, which is generally caused by equipment failure at the measuring station resulting in missing daily records. In addition, the daily feed intake data does not show a certain regularity during the growth process of the pig. The Loess local weighted regression method is used to fill in the missing values.
[0081] Embodiment 2
[0082] The following will describe in detail how the present invention solves the technical problems in practical work in conjunction with this embodiment.
[0083] This example selects the original feeding data of the performance testing stations of three breeding farms of three breeds of Large White Pig, Landrace Pig and Duroc Pig, as shown in Table 2:
[0084] Table 2
[0085] .
[0086] Evaluation: Three quality control methods were used to control the original data, and the full FCR phenotypic data of three data sets were obtained for genetic evaluation. The breeding value prediction effect was evaluated by a five-fold cross-validation method with five repetitions. First, all data were genetically evaluated, and the estimated breeding value and residual were added to obtain the individual's corrected phenotypic value. The individuals with phenotypic data were randomly divided into 5 parts, and 1 part was selected each time as the validation group. The phenotypic data was set to missing, and the other individuals were used as the reference group to calculate the estimated breeding values of the validation group individuals. The accuracy of breeding value prediction is expressed by the correlation coefficient between the estimated breeding value and the corrected phenotypic value.
[0087] Without quality control: body weight is the average of all body weight values of the breeding pigs on that day, daily feed intake is the cumulative sum of all feed intake values of the breeding pigs on that day, and no filling is performed on missing values.
[0088] Common quality control process: body weight is used as the dependent variable and age as the independent variable. A quadratic equation is used to fit the regression curve. Body weight values with residuals greater than 15% are set as outliers and deleted. The 10 types of abnormal feed intake data defined in the previous article are considered outliers and deleted. A linear regression model fitted with the data of the entire measurement period of individual breeding pigs is used to fill in missing data.
[0089] QCfeed: Use a robust regression model to identify and eliminate abnormal weight values; use a linear mixed model to correct 10 abnormal feed intake data; use the filling method used in this example to fill in the missing values of body weight and feed intake.
[0090] Results: By calculating the accuracy of breeding value prediction of the data after quality control by the three methods, it can be seen that the quality control using the quality control process QCfeed proposed in this embodiment can effectively improve the accuracy of breeding value estimation, as shown in Table 3.
[0091] Table 3
[0092] ,
[0093] Among them, those marked with different letters are significantly different (p<0.01).
[0094] Embodiment 3
[0095] The present embodiment also provides a quality control and filling system for sow growth performance data, comprising: a collection module, a first processing module and a second processing module; the collection module is used to collect and preprocess the sow growth performance data, and the sow growth performance data includes weight data and feed intake data; the first processing module is used to use a regression analysis method, combined with a Tukey weight function and a robust regression method, to perform quality control on the processed weight data; according to the type of missing data, the processed weight data is filled using a linear interpolation method and a fitted binomial regression method; the second processing module is used to identify several types of abnormal feeding behavior based on the processed feed intake data, set the feed intake of the abnormal type as vacant, and then use a linear mixed model to correct the non-abnormal data, and fill the missing feed intake data using the Loess local weighted regression method based on the pen, weight, daily weight gain and frequency of the abnormal type.
[0096] First, the growth performance data of the sows is collected and preprocessed using the acquisition module. In this embodiment, the growth performance data of the sows includes: body weight data and feed intake data. Before quality control of the growth performance data of the sows is performed, the original data needs to be preprocessed, and the method includes: deleting all the measurement data of individuals with multiple measurement station numbers, individuals with a starting age of less than 60 days or greater than 130 days, individuals with a final age of less than 130 days or greater than 190 days, individuals with less than 40 days of measurement days, and individuals with a missing days ratio greater than 10%. Single data without an individual number is considered as abnormal data and deleted, and all weight data with a weight value less than 20kg or greater than 180kg during the entire individual measurement period is set to be blank, and the values of non-numerical feed intake and feeding time are set to 0.
[0097] Afterwards, the first processing module uses regression analysis methods, combined with Tukey weight function and robust regression method, to perform quality control on the processed weight data; according to the type of missing data, linear interpolation and fitted binomial regression methods are used to fill in the processed weight data.
[0098] First, quality control is performed on abnormal weight data. In the original data of the breeding pig performance testing station, most of the individual weight data show a normal growth pattern, but there are still abnormal weight values that deviate from the normal range or growth curve. Weight quality control is performed on each individual, and the quality control steps are as follows: Quality control of abnormal weight data is first performed by regression analysis to establish a relationship model between weight and age, calculate the weight residual, and then apply the Tukey weight function to determine the weight of each weight value. Then, the robust regression method is used to refit the regression curve, and iterative optimization is performed until the outliers are effectively filtered out. Finally, individual data with an average weight coefficient of variation greater than 0.02 are deleted to ensure data accuracy. The specific steps include:
[0099] (1) Fitting regression curve
[0100] Using all the weight values and age values measured during the individual measurement period, a regression curve was fitted, and the formula was:
[0101] ,
[0102] The dependent variable y is the weight value of a single individual during the whole measurement period, the independent variable x is the age of a single individual during the whole measurement period, and the covariate x is 2 is the square of the age of a single individual during the measurement period, a0, a1 and a2 are regression coefficients, which are estimated by the least squares method. The goal of the least squares method is to minimize the sum of squares of the residuals between the actual observations and the model predictions. The estimated value of the regression coefficient can be obtained by solving the optimization function. The target optimization function is:
[0103] ,
[0104] in represents the target optimization function; a0, a1 and a2 are regression coefficients; i represents a natural number; n represents a natural number.
[0105] (2) Calculate weight residual
[0106] The residual of the weight value is calculated according to the regression curve. The calculation method is the difference between the actual weight value and the predicted value of the regression curve. The formula is:
[0107] ,
[0108] Among them, e i is the residual of the i-th weight value of the individual measurement period, y i is the actual measured value of the i-th weight value of the individual measurement period, It is the predicted value of the regression curve of the i-th weight value of the individual measurement period (when there are multiple measured weight values at a certain age, the predicted weight value for that day is the same).
[0109] (3) Calculate body weight
[0110] The weight of each measured weight value is calculated according to the Tukey weight function [1]. The Tukey weight function can be expressed as:
[0111] ,
[0112] Among them, c is a regulation constant that needs to be manually adjusted, is the weight factor of a single individual, and w i is the weight of the i-th weight value of the individual, e i is the residual of the individual's ith weight value, σ is the standard deviation of the residuals of all weight values of the individual during the entire measurement period, is the standardized residual of the ith weight value; when When The size of gradually decreases, the maximum value is 1, and the minimum value is 0; , the weight is directly 0.
[0113] (4) Robust regression fitting regression curve
[0114] The least squares method is very sensitive to outliers. Robust regression uses a more robust regression coefficient estimation method to fit the model. Common robust regression methods include the M estimation method, the least median squares (LMS) method, and the least truncation squares (LTS) method. Among them, the M estimation method robust regression uses iterative weighted least squares to estimate the regression coefficient. The weight value with abnormally large residuals is not used to estimate the regression curve. The target optimization function is:
[0115] ,
[0116] Among them, w i is the weight of the i-th weight value of the individual, e i is the residual of the i-th weight value of the individual, and there are n weight values in total. After estimating the new regression curve, return to step 3 to recalculate the weights, and obtain the optimal fitting effect by continuously iteratively adjusting the constant c in step (3).
[0117] The abnormal weight values of individuals with abnormal growth patterns cannot be filtered out normally in robust regression, resulting in the individual data being unusable after quality control. This example calculates the average coefficient of variation of the weight of each individual after deleting the abnormal values:
[0118] ,
[0119] Where j represents a natural number, is the average coefficient of variation of the weight of the ith pig, is the standard deviation of the weight of the ith pig on the jth day, The average weight of all the weights of the ith pig on the jth day after the outliers are deleted. The ith pig is measured for a total of n days. All the measured data of individuals with an average coefficient of variation greater than a preset value (0.02 in this embodiment) are deleted.
[0120] After the weight data has been quality controlled, it is filled and intercepted.
[0121] Complete the individual measurement date, fill in the missing weight caused by the missing date and the missing weight caused by the quality control of abnormal weight. The middle missing data type is one or more days of missing weight values and there are weight values on both sides of the missing data. The missing values are filled using linear interpolation. The first and last missing data types are one or more days of missing weight values and there are no weight values on the left or right side of the missing data. The missing values are filled using the fitted binomial regression method. In order to prevent the first weight from being missing too many days, resulting in a minimum value being filled, the weight of the filled individual is truncated, and the measurement data before the individual first reaches the preset weight (30 kg in this embodiment) is deleted.
[0122] The second processing module identifies several types of abnormal feeding behavior based on the processed feed intake data, sets the feed intake of abnormal types as blank, and then uses a linear mixed model to correct the non-abnormal data. Based on the pen, body weight, daily weight gain and frequency of abnormal types, the missing feed intake data is filled in by the Loess local weighted regression method.
[0123] First, the abnormal feed intake data was quality controlled, and 10 types of feeding behaviors were defined as abnormal feeding types, as shown in Table 1; the daily single feeding data was identified to see if there was any abnormality, and the feed intake in the single feeding record with any abnormal feeding type was set to blank.
[0124] Then, the daily single feeding data is integrated. Each raw data exported by the measurement station contains the feed intake and body weight values of a single feeding event, and the number of daily data is the number of daily feeding times. In order to obtain the daily feed intake and daily body weight values of individuals, multiple daily feeding data need to be integrated.
[0125] In the quality control of abnormal weight, each weight is given a weight value, and the weight with the largest weight value among all the weights of the individual on that day is selected as the individual's weight on that day.
[0126] After identifying and deleting the abnormal daily single feed intake, the retained daily single feed intake is the normal feed intake. The individual normal feed intake values are summed up on a daily basis to obtain the individual daily normal feed intake. When performing quality control on abnormal feed intake, a linear mixed model needs to be used to correct the feed intake. The model covariates include data such as error frequency. When integrating single-day data, it is necessary to calculate the frequency of each abnormal type on that day, the sum of the feeding time of abnormal types 1, 2, 6, 7, 8, 9, and 10 on that day, and the sum of the feed intake of abnormal types 4 and 5 on that day, to provide covariate data for subsequent correction of abnormal feed intake.
[0127] All measured data of individuals with more than 30 feeding times per day and individuals with more than 10% of the days with less than 3 feeding times were deleted.
[0128] Finally, the feed intake data were filled, and the non-abnormal data were corrected using a linear mixed model. Then, based on the pen position, body weight, daily weight gain and frequency of abnormal types, the missing daily feed intake data were filled by the Loess local weighted regression method to ensure the completeness and accuracy of the data.
[0129] The formula for fitting the linear mixed model is as follows:
[0130] ,
[0131] Where m represents a natural number. is the normal feed intake of the mth pig in the i-th pen on the nth day; is the fixed effect of the ith column; is the weight of the mth pig on day n, which is a covariate; is the daily weight gain of the mth pig, which is a covariate; is the percentage of p-type abnormalities in the mth pig on day n, which is a covariate; It is the sum of the feeding time of each time when the p-type abnormality occurred in the m-th pig on the nth day, which is a covariate; is the total daily feed intake of the mth pig on the nth day with p-type abnormality, which is a covariate; b1, b2, b3, b4, b5 are the regression coefficients of BW, ADG, ETP, OTD, and FID respectively; P m is the individual random effect of the mth pig and satisfies ; is the residual and satisfies Therefore, the fixed effect in the formula is the pen to which the individual belongs, the random effect is the individual number, and the covariates are the body weight on the day, the average daily weight gain throughout the process, the frequency of abnormalities 1 to 10 on the day, the sum of the feeding time on the day of abnormalities 1 to 2, 6 to 10, and the sum of the feed intake on the day of abnormalities 4 and 5.
[0132] The correction value for abnormal feed intake was calculated using the covariate regression coefficients as follows:
[0133] ,
[0134] in, is the correction value of abnormal feed intake of the mth pig on the nth day, , , The definitions are the same as above, and b3, b4, and b5 are the regression coefficients of ETP, OTD, and FID obtained by solving the linear mixed model.
[0135] Calculate the sum of normal feed intake and abnormal feed intake correction value, which is the individual's corrected feed intake for the day. The calculation formula for corrected feed intake is:
[0136] ,
[0137] in, Corrected feed intake for the mth pig in the i-th pen on day n, is the normal feed intake of the mth pig in the ith pen on that day, It is the correction value of abnormal feed intake of the mth pig in the ith pen on that day.
[0138] After correction, each individual will obtain a daily feed intake data, but there will be a small amount of missing daily feed intake, which is generally caused by equipment failure at the measuring station resulting in missing daily records. In addition, the daily feed intake data does not show a certain regularity during the growth process of the pig. The Loess local weighted regression method is used to fill in the missing values.
[0139] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A method for quality control and filling of growth performance data of breeding pigs, characterized in that the steps include: Collecting and preprocessing the growth performance data of sows, wherein the growth performance data of sows includes body weight data and feed intake data; Using regression analysis method, combined with Tukey weight function and robust regression method, the processed weight data is quality controlled; The method for quality control of the processed weight data includes: firstly, establishing a relationship model between weight and age by regression analysis, calculating weight residuals, then applying Tukey weight function to determine the weight of each weight value, then refitting the regression curve by robust regression method, iterative optimization until outliers are effectively filtered, and finally deleting individual data whose average coefficient of variation of weight is greater than a preset value; the steps include: The residual of the weight value is calculated according to the regression curve, which is the difference between the actual weight value and the value predicted by the regression curve. The weight of each measured weight value is calculated according to the Tukey weight function, which is expressed as: , Among them, c is an adjustable constant, is the weight factor of a single individual, and w i is the weight of the i1th weight value of the individual, e i is the residual of the individual's i1th weight value, σ is the standard deviation of the residuals of all weight values of the individual during the entire measurement period, is the standardized residual of the i1th weight value; when When , the maximum weight is 1 and the minimum weight is 0; When , the weight is directly 0; After quality control of the processed feed intake data, a linear mixed model was used to correct the non-abnormal data: , in, is the normal feed intake of the mth pig in the i2th pen on the nth day; is the fixed effect of the i2th column; is the weight of the mth pig on day n; is the daily weight gain of the mth pig; is the percentage of type p abnormalities in the mth pig on day n; The total feeding time of each time when the p-type abnormality occurred on the nth day for the mth pig; is the total daily feed intake of the mth pig on the nth day with p-type abnormality; b1, b2, b3, b4, b5 are the regression coefficients of BW, ADG, ETP, OTD, and FID respectively; P m is the individual random effect of the mth pig and satisfies ; is the residual and satisfies ; According to the type of missing data, linear interpolation and binomial regression were used to fill in the processed weight data; Based on the processed feed intake data, several types of abnormal feeding behavior are identified, and the feed intake of abnormal types is set as blank. Then, a linear mixed model is used to correct the non-abnormal data. Based on the pen, body weight, daily weight gain and frequency of abnormal types, the missing feed intake data is filled by the Loess local weighted regression method.
2. The method for quality control and filling of breeding pig growth performance data according to claim 1, characterized in that: The method for performing the preprocessing includes: deleting all measurement data of individuals with multiple measurement station numbers, individuals with a starting measurement age of less than 60 days or greater than 130 days, individuals with a final measurement age of less than 130 days or greater than 190 days, individuals with less than 40 measurement days, and individuals with a missing day ratio greater than 10%; setting a single piece of data without an individual number as abnormal data for deletion, setting all weight data with a weight value of less than 20kg or greater than 180kg during the entire individual measurement period as blank, and setting the values of non-numerical feed intake and feeding time to 0.
3. The method for quality control and filling of breeding pig growth performance data according to claim 1, characterized in that: The method for filling the processed weight data includes: completing the individual measurement date, filling the missing weight caused by the missing date and the missing weight caused by the abnormal weight quality control; the middle missing data type is one or more days of missing weight values and there are weight values on both sides of the missing data, and the missing values are filled using linear interpolation; the first and last missing data type is one or more days of missing weight values and there are no weight values on the left or right side of the missing data, and the missing values are filled using the fitted binomial regression method; in order to prevent the first weight from being missing for too many days, resulting in a minimum value in the filling, the weight of the filled individual is truncated, and the measurement data before the individual first reaches the preset weight is deleted.
4. The method for quality control and filling of sow growth performance data according to claim 1, characterized in that: The correction value for abnormal feed intake was calculated using the covariate regression coefficients as follows: , in, is the correction value of abnormal feed intake of the mth pig on the nth day; Calculate the sum of normal feed intake and abnormal feed intake correction value, which is the individual's corrected feed intake for the day. The calculation formula for corrected feed intake is: , in, Corrected feed intake for the mth pig in the i2th pen on day n, is the normal feed intake of the mth pig in the i2th pen on that day, It is the correction value of the abnormal feed intake of the mth pig in the i2th pen on that day.
5. A quality control and filling system for breeding pig growth performance data, the system is used to implement the method according to any one of claims 1 to 4, characterized in that: include: An acquisition module, a first processing module and a second processing module; The collection module is used to collect and pre-process the growth performance data of the sows, wherein the growth performance data of the sows includes body weight data and feed intake data; The first processing module is used to perform quality control on the processed weight data by using regression analysis method, combined with Tukey weight function and robust regression method; according to the type of missing data, the processed weight data is filled by using linear interpolation method and fitting binomial regression method; The second processing module is used to identify several types of abnormal feeding behavior based on the processed feed intake data, set the feed intake of abnormal types as blank, and then use a linear mixed model to correct the non-abnormal data, and fill in the missing feed intake data through the Loess local weighted regression method based on the pen, body weight, daily weight gain and frequency of abnormal types.
Citation Information
Patent Citations
Early warning threshold setting method for dam safety monitoring data exception identification
CN111651708A
Boar growth performance measurement data correction method, system, equipment and terminal
CN116991835A
Source end data anomaly detection and cleaning treatment method and system under medium-platform architecture
CN117520746A