Construction of Egg Hatching Rate Prediction Model, Evaluation of Hatching Rate Characteristics and Prediction Method
By constructing an egg hatching rate prediction model that comprehensively considers biological, environmental and equipment characteristics, the problems of prediction deviation and overfitting in the existing technology are solved, and high accuracy and interpretability of hatching rate prediction is achieved, supporting the precise management of hatchery.
Patent Information
- Application Number
- CN202411292829.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2044-09-14
AI Technical Summary
The egg hatching rate prediction method in the prior art has prediction deviations and overfitting problems, and lacks comprehensive consideration of biological, environmental and equipment factors, resulting in inaccurate hatching rate prediction and poor interpretability, making it difficult to achieve accurate management throughout the cycle.
A egg hatching rate prediction model is constructed. By obtaining the biological, environmental and hatching equipment characteristic data of multiple egg batches, data preprocessing and augmentation processing is performed, multiple basis learners and linear regression models are trained, and feature evaluation is used to achieve accurate prediction and interpretability analysis of hatching rate.
It improves the accuracy of egg hatching rate prediction, alleviates prediction deviation and overfitting problems, realizes interpretability analysis of hatching rate, supports accurate management of the entire incubation cycle, and reduces production costs and resource waste.
Smart Images

Figure CN119250273B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of machine learning, and particularly relates to a method for constructing an egg hatching rate prediction model, evaluating hatching rate characteristics, and making predictions. Background Art
[0002] With the development of the economy, residents' demand for dietary nutrition has been continuously increasing. Eggs are an important source of protein in residents' diets and are of great significance for ensuring good health. The hatching of laying hen eggs is crucial for the stable supply of eggs, and eggs without hatching ability will occupy the space of hatching equipment, causing waste of energy and food. Therefore, it is very necessary to accurately predict the hatching rate of eggs before hatching, conduct key monitoring on eggs with low hatching rates, and eliminate eggs without hatching ability.
[0003] Currently, the research on egg hatching mainly includes hatching rate prediction methods and hatching process management methods based on factors affecting the hatching rate. The traditional hatching rate prediction method is manual visual inspection. A candling device is used to perform perspective lighting on the embryo eggs under dark conditions to observe the development of the embryo. The hatching performance of the eggs is judged according to the distribution and color of the blood vessel network of the egg embryo. This method is relatively accurate but requires a large number of professional technicians and is time-consuming and laborious.
[0004] Machine learning methods have improved the efficiency of hatching rate prediction to a certain extent. Therefore, large-scale hatcheries gradually use machine learning technologies to predict the hatching rate of eggs. For example, technologies such as ultrasonic and machine vision are used to obtain information related to the hatching performance of eggs. et al. drilled small holes in the eggs to allow ultrasonic waves to enter the interior of the eggs, and used the ultrasonic images of the eggs to infer the development of the embryo, and then predicted the hatching rate of the eggs ( E, I H, Gulhan T, et al. A study regarding the fertility discrimination of eggs by using ultrasound[J]. Indian Journal of Animal Research, 2017, 51(2): 322 - 326.). The patent invented by Zhang Fu et al. uses a neural network model to extract the texture features of the optical images of eggs, detect the fertilization information of the eggs, and achieve non-destructive detection of the hatching performance of a group of breeding eggs (Zhang Fu et al. Device and method for detecting fertilization information by segmenting group egg images based on deep learning[P]. Henan Province: CN114544630A, 2022 - 05 - 27.).
[0005] For the management of the egg hatching process, previous studies mainly explored from three aspects: biological factors (gene breeding), environmental factors, and hatching equipment factors. Tona et al. found through controlled experiments that eggs produced by brown-strain breeding hens had a higher hatching rate than those of white strains (Tona K, Agbo K, Kamers B, et al. Comparison of Lohmann White and Lohmann Brown strains in embryo physiology[J]. International Journal of Poultry Science, 2010, 9(9): 907-910.). Tainika et al. found that storing eggs at temperatures above 21°C was harmful to the embryonic development of chicks, thus reducing the hatching rate. Therefore, eggs need to be stored in a relatively cool environment before hatching (Tainika B, Abdallah N, Damaziak K, et al. Egg storage conditions and manipulations during storage: effect on egg quality traits, embryonic development, hatchability and chick quality of broiler hatching eggs[J]. World's Poultry Science Journal, 2024, 80(1): 75-107.). Xu Qingzhen and Li Ping invented an egg hatching device capable of automatic disinfection, which improved the egg hatching rate (Xu Qingzhen, Li Ping. Xu Qingzhen and Li Ping: CN108293915B[P]. 2018-02-24.).
[0006] Traditional machine learning-driven hatching rate prediction methods ignore the imbalanced distribution of egg hatching rates, that is, most eggs have a high hatching rate, while eggs that cannot hatch only account for a very small proportion. In this case, the machine learning model will be biased towards the majority class samples (high-hatching-rate eggs), resulting in prediction bias. In addition, the hatching rate prediction method using a single prediction model is prone to overfitting problems, thereby reducing the prediction accuracy. Moreover, although machine learning methods have a high prediction accuracy, they belong to the "black box" model and have poor interpretability, which restricts their practical application in hatchery production management.
[0007] At the same time, the existing egg hatching management methods mainly focus on biological factors related to genetic breeding, but pay less attention to other factors that have a significant impact on the egg hatching rate, such as the egg storage environment and hatching equipment, which is not conducive to realizing the full-cycle precise management of egg hatching. In addition, improving the hatching rate by means of gene improvement and developing new hatching equipment requires a large amount of capital investment, has a long return period, and requires a high technical level of professional personnel. Summary of the Invention
[0008] To solve the above problems existing in the prior art, the present invention provides a method for constructing an egg hatching rate prediction model, evaluating hatching rate characteristics and prediction. The technical problems to be solved by the present invention are realized through the following technical solutions:
[0009] In the first aspect, an embodiment of the present invention provides a method for constructing an egg hatching rate prediction model, and the method for constructing the egg hatching rate prediction model includes:
[0010] For multiple batches of eggs, obtain the corresponding characteristic data sets and hatching rates respectively; wherein, each batch of eggs contains several eggs; the characteristic data set of each batch of eggs contains multiple characteristic data corresponding to biological characteristics, environmental characteristics, and hatching equipment characteristics;
[0011] Perform data preprocessing on the characteristic data set of each batch of eggs to obtain the data samples corresponding to the batch of eggs, and merge all the data samples to obtain the original sample set;
[0012] Perform augmentation processing on the data samples in the original sample set with a hatching rate lower than the hatching rate threshold to obtain the augmented sample set;
[0013] Build an original prediction model, the original prediction model includes a first-layer learner and a second-layer learner connected in sequence; the first-layer learner includes a plurality of base learners arranged in parallel, all of which are used to predict the egg hatching rate, and the second-layer learner is connected to the output ends of the plurality of base learners and uses a linear regression model;
[0014] Train the original prediction model based on the augmented sample set and the hatching rates of the data samples therein to obtain a trained egg hatching rate prediction model.
[0015] In an embodiment of the present invention, in the characteristic data set of any batch of eggs,
[0016] The characteristic data corresponding to the biological characteristics include: breeding grade of breeding chickens, strain of breeding chickens, source farm of breeding chickens, average age of breeding chickens, average weight of eggs, and egg weight uniformity;
[0017] The characteristic data corresponding to the environmental characteristics include: hatching month, storage days, conversion days, and weight loss;
[0018] The characteristic data corresponding to the incubation equipment characteristics include: the number of eggs, the incubator number, and the hatcher number.
[0019] In an embodiment of the present invention, for any characteristic data group, the process of data preprocessing includes:
[0020] Normalize the continuous characteristic data in the characteristic data group; wherein, the continuous characteristic data includes the average age of breeding chickens, the average weight of eggs, the egg weight uniformity, the storage days, the conversion days, the weight loss, and the number of eggs;
[0021] Perform a discrete-to-continuous conversion process on the cyclic characteristic data in the characteristic data group; wherein, the cyclic characteristic data includes the hatching month;
[0022] Convert the categorical characteristic data in the characteristic data group into one-hot encoding; wherein, the categorical characteristic data includes the breeding grade of breeding chickens, the chicken strain, the source farm of breeding chickens, the incubator number, and the hatcher number.
[0023] In an embodiment of the present invention, perform an augmentation process on the data samples in the original sample set with a hatching rate lower than the hatching rate threshold to obtain an augmented sample set, including:
[0024] For the data samples in the original sample set with a hatching rate lower than the hatching rate threshold, use a conditional generative adversarial network to generate similar data samples, and add all the obtained similar data samples to the original sample set to obtain the augmented sample set.
[0025] In an embodiment of the present invention, the first-layer learner includes three parallel base learners, namely a random forest model, a lightweight gradient boosting tree model, and a support vector machine model.
[0026] In an embodiment of the present invention, based on the augmented sample set and the hatching rates of the data samples therein, train the original prediction model to obtain a trained egg hatching rate prediction model, including:
[0027] Use the augmented sample set and the hatching rates of the data samples therein to separately train each base learner in the first-layer learner in a multi-fold cross-validation manner to obtain each trained base learner;
[0028] Take the multi-fold mean of the hatching rate prediction values of each trained base learner for the data samples as input data, and use the hatching rates of the data samples to train the second-layer learner. The trained second-layer learner and the trained first-layer learner constitute an egg hatching rate prediction model.
[0029] Second aspect, an embodiment of the present invention provides a method for evaluating the characteristics of egg hatching rate, and the method for evaluating the characteristics of egg hatching rate includes:
[0030] Obtain an egg hatching rate prediction model and data samples of each egg batch used during the training process of the egg hatching rate prediction model; wherein, the egg hatching rate prediction model is obtained by using the egg hatching rate prediction model construction method described in the first aspect;
[0031] For each egg batch, use the SHAP method to calculate the marginal contribution value of each feature data to the hatching rate in the feature data group of this egg batch, so as to analyze the influence of the feature data within this egg batch; wherein, the marginal contribution value represents the influence of the feature data on the hatching rate of this egg batch, and is divided into positive influence and negative influence;
[0032] For each type of feature data, calculate the average marginal contribution value of this type of feature data in all egg batches, and use the average marginal contribution values calculated from various types of feature data to analyze the influence of the feature data within all egg batches.
[0033] In an embodiment of the present invention, the using the average marginal contribution values calculated from various types of feature data to analyze the influence of the feature data within all egg batches includes:
[0034] Draw a scatter plot according to the average marginal contribution values of various types of feature data, and analyze the importance and influence direction of various types of feature data on the hatching rate of all egg batches.
[0035] Third aspect, an embodiment of the present invention provides a method for predicting egg hatching rate, and the method for predicting egg hatching rate includes:
[0036] Obtain the feature data group of the target egg batch; wherein, the feature data group contains multiple feature data corresponding to biological characteristics, environmental characteristics, and hatching equipment characteristics;
[0037] After preprocessing the feature data group of the target egg batch, input it into the pre-trained egg hatching rate prediction model to obtain the predicted hatching rate of the target egg batch; wherein, the egg hatching rate prediction model is obtained by using the egg hatching rate prediction model construction method described in the first aspect.
[0038] In an embodiment of the present invention, after obtaining the predicted hatching rate of the target egg batch, the method for predicting egg hatching rate further includes:
[0039] For the target batch of eggs, the SHAP method is used to calculate the marginal contribution value of each feature data to the hatching rate in its feature data group, so as to analyze the influence of the feature data within the target batch of eggs; among them, the marginal contribution value represents the influence of the feature data on the hatching rate of the target batch of eggs, which is divided into positive influence and negative influence.
[0040] Advantages of the present invention:
[0041] For the problem of predicting the hatching rate of eggs, traditional machine learning algorithm models often only focus on biological characteristics (the attributes of the eggs themselves), and the prediction results will tend to the majority class samples and are prone to overfitting problems, thus causing prediction deviation. However, the egg hatching rate prediction model obtained according to the egg hatching rate prediction model construction method provided by the present invention comprehensively considers biological characteristics, environmental characteristics and hatching equipment characteristics, and collects these multi-stage characteristics affecting egg hatching as input data, so that this method can more comprehensively extract the characteristic distribution affecting the egg hatching ability, thereby significantly improving the prediction accuracy. The model of the present invention can estimate the hatching rate of the whole batch of eggs by using the key factors affecting the hatching rate, such as the biological characteristics, environmental characteristics and hatching equipment characteristics of the eggs, and can prevent the prediction results from tending to the majority class and alleviate the overfitting problem brought by a single prediction model.
[0042] In the egg hatching rate feature evaluation method provided by the embodiments of the present invention, by using the provided egg hatching rate prediction model and the data samples of each egg batch used in the training process of the egg hatching rate prediction model, and using an interpretable machine learning method to analyze the prediction results, the key features affecting the hatching rate can be determined, thereby breaking the "black box" attribute of traditional machine learning methods, realizing precise management of the entire hatching cycle to improve the hatching rate, providing a decision-making support method for the operation and management of the hatchery, and being able to better guide the daily operation of the hatchery, reduce production costs and reduce resource waste.
[0043] The egg hatching rate prediction method provided by the embodiments of the present invention adopts a novel algorithm framework, has high accuracy and strong interpretability, can effectively solve the prediction deviation of traditional machine learning in the case of sample imbalance and the overfitting problem easily occurring in a single model, can accurately predict the hatching rate of the egg batch, and can perform interpretable analysis on the prediction results of the hatching rate to support the precise management of the entire hatching cycle. The present invention uses artificial intelligence algorithms to solve problems such as egg hatching rate prediction and hatching process management in the context of modern commercial hatcheries, and has high practical value. Description of the drawings
[0044] Figure 1 It is a flowchart showing a method for constructing an egg hatching rate prediction model provided by an embodiment of the present invention;
[0045] Figure 2 Schematic diagram for understanding a hierarchical supervised learning strategy adopted by an embodiment of the present invention for training an original prediction model;
[0046] Figure 3 Example diagram of the training process of the original prediction model in an embodiment of the present invention;
[0047] Figure 4 Schematic flow diagram of a method for evaluating egg hatching rate characteristics provided by an embodiment of the present invention;
[0048] Figure 5 Schematic diagram for understanding a method for evaluating egg hatching rate characteristics provided by an embodiment of the present invention;
[0049] Figure 6 Schematic flow diagram of a method for predicting egg hatching rate provided by an embodiment of the present invention;
[0050] Figure 7 Schematic diagram for interpretability analysis of the prediction of the hatching rate of a certain batch of eggs by the method for evaluating egg hatching rate characteristics provided by an embodiment of the present invention;
[0051] Figure 8 Schematic diagram for interpretability analysis of the prediction of the hatching rate of all batches of eggs by the method for evaluating egg hatching rate characteristics provided by an embodiment of the present invention. Detailed implementation manners
[0052] The present invention will be further described in detail below in conjunction with specific embodiments, but the implementation manners of the present invention are not limited thereto.
[0053] To achieve automatic prediction of egg hatching rate and optimize the hatching process accordingly to improve the hatching rate, an interpretable egg hatching rate prediction technology is required. For this purpose, the present invention proposes a method for constructing an egg hatching rate prediction model, a method for evaluating egg hatching rate characteristics, and a method for predicting egg hatching rate.
[0054] In a first aspect, an embodiment of the present invention provides a method for constructing an egg hatching rate prediction model, as Figure 1 shown, the method for constructing an egg hatching rate prediction model may include the following steps:
[0055] S1, for multiple batches of eggs, respectively obtain the corresponding characteristic data groups and hatching rates;
[0056] Among them, each batch of eggs contains several eggs; in an embodiment of the present invention, the number of eggs contained in each batch of eggs may be the same or different.
[0057] In the embodiments of the present invention, the characteristic data group of each egg batch contains multiple characteristic data corresponding to biological characteristics, environmental characteristics, and hatching equipment characteristics;
[0058] For the characteristic data group of any egg batch, it is various characteristic data collected that affect the hatching rate. Generally speaking, it can be divided into three major categories, namely biological characteristics, environmental characteristics, and hatching equipment characteristics. There are multiple characteristic data under each major category, thus constituting a one-dimensional characteristic data group.
[0059] In an optional embodiment, in the characteristic data group of any egg batch,
[0060] The characteristic data corresponding to biological characteristics include: breeding grade of breeding chickens, strain of breeding chickens, source farm of breeding chickens, average age of breeding chickens, average weight of eggs, and egg weight uniformity;
[0061] The characteristic data corresponding to environmental characteristics include: hatching month, storage days, conversion days, and weight loss;
[0062] The characteristic data corresponding to hatching equipment characteristics include: number of eggs, incubator number, and chick hatchery number.
[0063] Specifically, the hatching rate of eggs is affected by many factors.
[0064] First, biological characteristics can reflect the characteristics of breeding chickens and the quality of the eggs themselves, and these characteristics directly affect embryonic development. For the consideration of production practice, the following six biological characteristics are collected in the embodiments of the present invention: breeding grade of breeding chickens (grandparent stock or parent stock), strain of breeding chickens, source farm of breeding chickens, average age of breeding chickens, average weight of eggs, and egg weight uniformity. Therefore, for any egg batch, there are 6 pieces of characteristic data corresponding to biological characteristics.
[0065] Among them, the breeding grade of breeding chickens refers to whether the breeding chickens from which the eggs of this batch are sourced are grandparent stock or parent stock; the strain of breeding chickens refers to the genetic strain of the breeding chickens from which the eggs of this batch are sourced; the source farm of breeding chickens refers to the name of the farm where the breeding chickens of this batch of eggs are sourced; the average age of breeding chickens refers to the average age in weeks of the breeding chickens from which the eggs of this batch are sourced; the average weight of eggs refers to the average weight of the eggs of this batch; the egg weight uniformity refers to the proportion of eggs in this batch whose weight is within the range of the average weight ± 10%.
[0066] Second, environmental characteristics also have an important impact on the hatching rate. In the production practice of egg hatcheries, the main reason for hatching failure is embryonic death, which is more not due to the quality of the eggs themselves, but due to an unfavorable hatching environment, such as inappropriate temperature and humidity during egg storage, etc. The following four environmental characteristics are collected in the present invention: hatching month, storage days, conversion days, and weight loss. Therefore, for any egg batch, there are 4 pieces of characteristic data corresponding to environmental characteristics.
[0067] Among them, the hatching month refers to the month when the batch of eggs is put into the incubator, such as February or March, which refers to a specific month, and the value ranges from 1 to 12; the storage days refer to the number of days between the purchase of the batch of eggs by the hatchery and their being put into the incubator; the conversion days refer to the number of days between the transfer of the batch of eggs from the incubator to the hatcher; the weight loss refers to the average weight loss of the batch of eggs in the incubator, that is, the average egg weight loss during the transfer from the incubator to the hatcher.
[0068] Thirdly, the hatching equipment provides a suitable temperature, humidity environment and turning frequency for egg hatching to promote embryo development, and the operating conditions of the hatching equipment also have an important impact on the hatching rate of eggs. The present invention collects three hatching equipment characteristics, including: the number of eggs, the incubator number and the hatcher number. Therefore, for any batch of eggs, there are 3 characteristic data corresponding to the hatching equipment characteristics.
[0069] Among them, the number of eggs refers to the number of eggs in the batch; the incubator number refers to the number of the incubator where the batch of eggs is located; the hatcher number refers to the number of the hatcher where the batch of eggs is located.
[0070] In summary, for 13 categories of characteristics, for any batch of eggs, there are 13 characteristic data in the characteristic data group.
[0071] Moreover, the characteristic data group of each batch of eggs in S1 will be used as a sample in the training process later. Therefore, it is also necessary to obtain the hatching rate corresponding to the batch of eggs as the true value label in the training process, and this part of the hatching rate is the known and true hatching rate.
[0072] The prediction target of the present invention is the egg hatching rate, specifically the hatching rate of fertilized eggs in a certain batch of eggs, and the calculation formula is:
[0073]
[0074] For the convenience of understanding, please refer to Table 1 for each characteristic and its definition in the characteristic data group.
[0075] Table 1 Each characteristic and its definition in the characteristic data group
[0076]
[0077]
[0078] S2. Perform data preprocessing on the characteristic data group of each batch of eggs respectively to obtain the data samples corresponding to the batch of eggs, and merge all the data samples to obtain the original sample set;
[0079] Among the biological characteristics, environmental characteristics, and hatching equipment characteristics that affect the hatching rate of eggs, there are continuous characteristics (characteristics can be understood as variables), cyclic characteristics, and categorical characteristics, and the data dimensions of each type of characteristic are not unified. Directly inputting the original characteristic data into a machine learning prediction model for training will cause difficulties in model convergence and thus affect the accuracy of the prediction results. Therefore, it is necessary to perform data preprocessing on the collected characteristic data.
[0080] In an optional implementation manner, for any group of characteristic data, the process of the data preprocessing includes:
[0081] 1) Normalize the continuous characteristic data in this group of characteristic data;
[0082] Among them, the continuous characteristic data includes the average age of breeding chickens, the average weight of eggs, the egg weight uniformity, the storage days, the conversion days, the weight loss, and the number of eggs;
[0083] The normalization process can be carried out using any existing normalization method. For example, in an optional implementation manner, the Min-Max normalization method can be used to linearly scale the continuous characteristic data to the range of [0, 1] to obtain the normalized continuous characteristic data.
[0084] Among them, the formula of the Min-Max normalization method is as follows:
[0085]
[0086] Among them, X is the value of the continuous characteristic to be normalized, X min is the minimum value of this characteristic, X max is the maximum value of this characteristic, X scaled is the normalized characteristic value.
[0087] For the specific Min-Max normalization method, please refer to the relevant technologies for understanding.
[0088] According to the above Min-Max normalization method, each continuous characteristic data can be normalized separately.
[0089] 2) Perform a discrete-to-continuous conversion process on the cyclic characteristic data in this group of characteristic data;
[0090] Among them, the cyclic feature data includes the hatching month; the month when the eggs are put into the incubator is a cyclic variable, and its value ranges from 1 to 12, and the difference between consecutive values is 1. However, the values from December to January of the next year are discontinuous. Therefore, in the embodiment of the present invention, the month values (1 to 12) are first converted into radians (0 to 2π), January is radian 0, and December is radian 2π. Subsequently, the Sin and Cos values of the radians are taken to represent the months, so that each month can be uniquely represented and the values are continuous. This processing method can convert the month from a discrete variable to a continuous variable.
[0091] 3) Convert the categorical feature data in the feature data group into one-hot encoding;
[0092] Among them, the categorical feature data includes the breeding grade of breeding chickens, the strain of breeding chickens, the source farm of breeding chickens, the incubator number, and the hatcher number. These features are all categorical variables. For the need of machine learning model training, the present invention converts these categorical feature data into corresponding one-hot encoding. For the one-hot encoding, please refer to the related technology for understanding and will not be elaborated here.
[0093] It can be understood that the feature data group corresponding to each egg batch has undergone data preprocessing to obtain the corresponding preprocessed feature data group, which is used as the data sample of the egg batch, and contains 13 data. The original sample set is composed of the data samples of all egg batches.
[0094] S3. Perform augmentation processing on the data samples in the original sample set with a hatching rate lower than the hatching rate threshold to obtain an augmented sample set;
[0095] In the embodiment of the present invention, the entire original sample set can be used for model training, and all or part of the data samples in the original sample set with a hatching rate lower than the hatching rate threshold can be augmented. The hatching rate threshold can be set as needed, for example, it can be 60%.
[0096] In this implementation manner, performing augmentation processing on the data samples in the original sample set with a hatching rate lower than the hatching rate threshold to obtain an augmented sample set includes:
[0097] For the data samples in the original sample set with a hatching rate lower than the hatching rate threshold, use a conditional generative adversarial network to generate similar data samples, and add all the obtained similar data samples to the original sample set to obtain the augmented sample set.
[0098] Among them, the Conditional Generative Adversarial Networks (CTGAN) consists of a generator G and a discriminator D. The generator G can generate synthetic samples (fake samples) that are highly similar to but different from the real samples according to the training dataset (real) samples. The discriminator D is used to distinguish real samples from fake samples.
[0099] Alternatively, the original sample set can also be randomly divided into a training set and a test set. The training set is used for model training, and the test set is used for model prediction. For example, 60% of the data samples in the original sample set can be used as the training set, and the remaining 40% can be used as the test set.
[0100] In this implementation, low hatching rate data samples (i.e., data samples with a hatching rate lower than the hatching rate threshold, hereinafter referred to as low hatching rate samples) in the training set of the original sample set can be screened out and augmented using the conditional generative adversarial network.
[0101] Among them, the process of augmenting using the conditional generative adversarial network includes:
[0102] Obtain the training dataset of the conditional generative adversarial network CTGAN; among them, each training data in the training dataset is a data sample in the original sample set with a hatching rate lower than the hatching rate threshold, that is, a low hatching rate sample.
[0103] In the generator G, the prior noise z and the sample label y (i.e., the hatching rate of the low hatching rate sample) are jointly input into the model to form a joint hidden layer. At the same time, the feature x of the real sample, the sample label y, and the data G(z|y) generated by the generator G are jointly input into the discriminator D. When the discriminator D remains unchanged, the parameters of the generator are updated to minimize the mathematical expectation of log(1 - D(G(z|y))). When the generator G is fixed, the parameters of the discriminator D are updated to maximize the mathematical expectation of log D(x|y) + log(1 - D(G(z|y))). The objective function of CTGAN is:
[0104]
[0105] Among them, E x ~p data(x) [logD(x|y)] is the mathematical expectation of logD(x|y), E z ~p z(z) [log(1 - D(G(z|y)))] is the mathematical expectation of log(1 - D(G(z|y))).
[0106] The generator G and the discriminator D work simultaneously until the discriminator D can no longer distinguish between the generated samples and the real samples. At this time, CTGAN stops working. The synthetic samples generated by CTGAN are new samples that are highly similar but different from the low hatching rate samples. Adding them to the training set can enhance the features of the low hatching rate samples. This method can enhance the features of the minority class (low hatching rate) samples to alleviate the prediction error caused by the model's bias towards the majority class.
[0107] Regarding the process of augmentation processing in the embodiments of the present invention, please understand it in combination with the working principle of the existing CTGAN, and no more detailed description will be given here.
[0108] It should be added that the synthetic samples generated by CTGAN also have corresponding hatching rates. However, it can be understood that their hatching rates are generated and not the real hatching rates.
[0109] S4. Build an original prediction model, where the original prediction model includes a first-layer learner and a second-layer learner connected in sequence; the first-layer learner includes a plurality of base learners arranged in parallel, all of which are used to predict the egg hatching rate, and the second-layer learner is connected to the output ends of the plurality of base learners and uses a linear regression model;
[0110] The plurality of base learners arranged in parallel in the first-layer learner can be implemented using existing different machine learning models capable of prediction, and the quantity and type are not limited here.
[0111] In an optional implementation manner, the first-layer learner includes three base learners arranged in parallel, namely a random forest model (abbreviated as RF), a light gradient boosting tree model (abbreviated as LightGBM), and a support vector machine model (abbreviated as SVR).
[0112] The working principles, advantages and disadvantages of these three models are different. Each model can capture the feature distribution model affecting the hatching rate from different aspects. Therefore, combining these three models can improve the generalization ability of the model. Compared with popular deep learning models, these three models do not require a large amount of manual intervention to adjust parameters, are more suitable for structured data, and have faster training and prediction speeds.
[0113] Among them, for the RF model, its model parameters include the number of trees n_estimators and the maximum depth max_depth of the trees in the forest, etc.; for the LightGBM model, its model parameters include the learning rate learning_rate, the number of trees n_estimators to be constructed, and the maximum depth max_depth of the trees, etc.; for the SVR model, its model parameters include the regularization parameter C and the kernel function type kernel, etc. The calculation method of the loss function can refer to the relevant existing technologies.
[0114] S5. Based on the augmented sample set and the hatching rates of the data samples therein, train the original prediction model to obtain a trained prediction model for egg hatching rate.
[0115] In an optional implementation, S5 may include the following steps:
[0116] S51. Use the augmented sample set and the hatching rates of the data samples therein to separately train each base learner in the first-layer learner in a multi-fold cross-validation manner to obtain each trained base learner;
[0117] In the embodiments of the present invention, each base learner is trained independently and simultaneously. When each of them completes its training, all the trained base learners are used as the first-layer learner.
[0118] In an optional implementation, the data samples (i.e., training samples) in the training set can be divided into a training set and a validation set in a ratio of 4:1 for 5-fold cross-validation. First, use the training set to train each base learner in the first layer and use the validation set for validation.
[0119] During training, use the training set and the hatching rates of the data samples therein. Then, input the validation set into the trained base learners. The first-layer learner will output the corresponding egg hatching rate prediction results for each data sample, and the prediction result is P kn , and the formula is as follows:
[0120]
[0121] where k is the number of cross-validation folds, which can be set as needed and is not limited to 5; n is the number of base learners.
[0122] S52. Use the multi-fold mean of the hatching rate prediction values of each trained base learner for the data samples as input data, and use the hatching rates of the data samples to train the second-layer learner. The trained second-layer learner and the trained first-layer learner constitute a prediction model for egg hatching rate.
[0123] The prediction results of the first-layer learner that pass the validation on the validation set will be used as the feature input for the second-layer learner h'. Specifically, for the feature input of a data sample, it is the mean of the prediction results of each base learner for this data sample under multiple folds. And, use the hatching rate of this data sample as the label to train the second-layer learner. Finally, the second-layer learner obtains a prediction result for the above data sample, that is, the hatching rate.
[0124] The present invention selects the Linear Regression model as the second-layer learner (meta-model). Because the complex machine learning models in the first-layer learner can accurately predict the hatching rate while also suffering from overfitting problems, the relatively simple linear model can make the prediction results smoother, alleviate overfitting, and make the prediction results more robust.
[0125] The training formula for the second-layer learner is as follows:
[0126]
[0127] Among them, β0 is the intercept, ε is the error term, and β1, β2, …, β in β n are the regression coefficients. All the above parameters are obtained using the least squares method to minimize the difference between the actual observed values and the model prediction values. Thus, the model training process is completed.
[0128] Subsequently is the model testing process. Specifically, the data samples of the test set are input into the first-layer learner for k-fold cross-validation to obtain the prediction results T kn of the first stage. The average value x kn of all the prediction results obtained by each base learner in T n is input into the second-layer learner for prediction, and the prediction result of the second-layer learner is the final prediction result
[0129] The prediction process of the second-layer learner can be expressed by the formula as:
[0130]
[0131]
[0132]
[0133] Among them, k is the number of cross-validation folds; AVE is to calculate the average value; n is the number of base learners; T kn represents the prediction result of the first-layer learner.
[0134] In the training process of the original prediction model in the embodiment of the present invention, the hierarchical supervised learning strategy of heterogeneous base learners and meta-learners is used to achieve training. For this hierarchical supervised learning strategy, please refer to Figure 2 as shown. Figure 2 The test set in Figure 3 can also be a validation set. This hierarchical supervised learning strategy can prevent the overfitting problem of a single model and improve the accuracy of egg hatching prediction. As an example of a model training process, please refer to
[0135] Through the iteration of the above training process, when the iteration termination condition is met (such as the model performance reaching the preset requirements, etc.), a trained egg hatching rate prediction model can be obtained. After inputting a feature data group of a pre-processed egg batch, the egg hatching rate prediction model can output the corresponding egg hatching rate prediction result, which represents the probability of egg hatching in this egg batch and can be expressed in the form of a percentage.
[0136] For the problem of egg hatching rate prediction, traditional machine learning algorithm models often only focus on biological characteristics (the attributes of the eggs themselves), and the prediction results tend to be biased towards majority-class samples and are prone to overfitting problems, thus causing prediction deviations. However, the egg hatching rate prediction model obtained according to the egg hatching rate prediction model construction method provided by the present invention comprehensively considers biological characteristics, environmental characteristics, and hatching equipment characteristics, and collects these multi-stage characteristics affecting egg hatching as input data, enabling this method to more comprehensively extract the feature distribution affecting egg hatching ability, thereby significantly improving the prediction accuracy. The model of the present invention can estimate the hatching rate of the entire batch of eggs through key factors affecting the hatching rate such as the biological characteristics, environmental characteristics, and hatching equipment characteristics of the eggs, prevent the prediction results from being biased towards the majority class, and alleviate the overfitting problem brought by a single prediction model.
[0137] In a second aspect, based on the egg hatching rate prediction model construction method provided in the first aspect, an embodiment of the present invention further provides an egg hatching rate feature evaluation method, as Figure 4 shown. The egg hatching rate feature evaluation method may include the following steps:
[0138] S01, obtaining the egg hatching rate prediction model and data samples of each egg batch used in the training process of the egg hatching rate prediction model;
[0139] Among them, the egg hatching rate prediction model is obtained by the egg hatching rate prediction model construction method described in the first aspect; for the specific construction process, please refer to the relevant content in the first aspect and will not be elaborated here.
[0140] Step S01 essentially obtains the data samples of each egg batch used in the model training process, and uses the prediction results of the trained hatching rate prediction model, so as to analyze the influence of each feature within the same egg batch on the prediction result in step S02, and analyze the influence of each feature among all egg batches on the prediction result in step S03, thereby analyzing the influence degree and direction of each feature on the egg hatching rate.
[0141] S02. For each batch of eggs, the SHAP (SHapley Additive exPlanations) method is used to calculate the marginal contribution value of each feature data to the hatching rate in the feature data set of this batch of eggs, so as to analyze the influence of the feature data within this batch of eggs;
[0142] Among them, the marginal contribution value represents the influence of the feature data on the hatching rate of this batch of eggs, which is divided into positive influence and negative influence;
[0143] Specifically, the feature data set of each batch of eggs is regarded as a sample. As mentioned above, a total of 13 types of features need to be analyzed. For the j-th feature in the i-th sample, its marginal contribution value φ ij can be calculated according to the following formula:
[0144]
[0145] Among them, N represents the number of features; M represents the number of samples; i is the sample serial number; j is the feature serial number; S is a feature subset of N (but does not include feature j), and f i (S) is the predicted value of the egg hatching rate prediction model on the feature subset S for the i-th sample. |S| represents the number of features in the feature subset S. [f i (S∪{j}) - f i (S)] represents the marginal contribution of feature j, that is, the increment of the output (i.e., the hatching rate) of the egg hatching rate prediction model proposed by the present invention after adding j to the subset S. The SHAP value (i.e., the marginal contribution value φ ij ) provides a clear numerical value for each feature, indicating the influence of this feature on the model prediction. φ ij being a positive value indicates that this feature increases the predicted value (hatching rate), showing a positive influence, and a negative value indicates that this feature decreases the predicted value, showing a negative influence.
[0146] It can be understood that for any sample, the 13 feature data respectively correspond to a marginal contribution value φ ij .
[0147] In the i-th batch of eggs, the sum of the SHAP values of each feature plus the hatching rate reference value is the prediction result of the egg hatching rate prediction model, that is, the following formula is satisfied:
[0148]
[0149] Among them, f i (x) represents the prediction result of the egg hatching rate prediction model for the i-th batch of eggs; φ0 represents the hatching rate reference value, which is the average hatching rate of all batches of eggs.
[0150] When the marginal contribution value φ of each characteristic data is calculated for a certain batch of eggs ij after that, individual sample analysis can be carried out. Specifically, the absolute values of φ ij can be compared to analyze which characteristics have a greater impact on the hatching rate of this batch of eggs, and the positive or negative nature of φ ij is used to judge the direction of the influence of the characteristics, whether it is to increase the hatching rate or decrease the hatching rate.
[0151] S03. For each type of characteristic data, calculate the average marginal contribution value of this type of characteristic data in all batches of eggs, and use the average marginal contribution values calculated from various types of characteristic data to analyze the influence of the characteristic data within all batches of eggs.
[0152] For each type of characteristic, the average value of the marginal contribution values of this type of characteristic in all batches of eggs can be obtained, as follows:
[0153]
[0154] Among them, C j represents the average marginal contribution value of the jth (type) characteristic in all samples. Use the average marginal contribution values of all types of characteristics to analyze the influence of the characteristic data within all batches of eggs.
[0155] In an optional implementation manner, the using the average marginal contribution values calculated from various types of characteristic data to analyze the influence of the characteristic data within all batches of eggs includes:
[0156] Draw a scatter plot based on the average marginal contribution values of various types of characteristic data, and analyze the importance and direction of the influence of various types of characteristic data on the hatching rate of all batches of eggs.
[0157] Specifically, the importance of the characteristics can be sorted according to the average marginal contribution values of all characteristics, a scatter plot can be drawn based on all the average marginal contribution values, and the scatter plot is used to analyze the importance and direction of the influence of various types of characteristics on the hatching rate of all batches of eggs, so as to make corresponding management and production decisions. The egg hatching rate characteristic evaluation method provided by the embodiments of the present invention can be referred to Figure 5 for understanding.
[0158] In the egg hatching rate characteristic evaluation method provided by the embodiments of the present invention, using the provided egg hatching rate prediction model and the data samples of each batch of eggs used in the training process of the egg hatching rate prediction model, and using an interpretable machine learning method to analyze the prediction results, the key characteristics affecting the hatching rate can be determined, thereby breaking the "black box" attribute of traditional machine learning methods, realizing precise management of the entire hatching cycle to improve the hatching rate, providing a decision support method for the operation and management of the hatchery, being able to better guide the daily operation of the hatchery, reducing production costs and reducing resource waste.
[0159] Thirdly, based on the method for constructing an egg hatching rate prediction model provided in the first aspect, an embodiment of the present invention further provides an egg hatching rate prediction method. As Figure 6 shown, the egg hatching rate prediction method may include the following steps:
[0160] S100, obtaining a feature data group of a target egg batch;
[0161] The target egg batch refers to an egg batch to be tested, similar to any egg batch in the first aspect, but its hatching rate is unknown.
[0162] Among them, for the target egg batch, the feature data group contains multiple feature data corresponding to biological features, environmental features, and hatching equipment features. For details, reference can be made to the relevant content in the first aspect and will not be elaborated here.
[0163] S200, after preprocessing the feature data group of the target egg batch, inputting it into a pre-trained egg hatching rate prediction model to obtain the predicted hatching rate of the target egg batch;
[0164] Among them, the egg hatching rate prediction model is obtained according to the method for constructing an egg hatching rate prediction model described in the first aspect.
[0165] For the specific construction process and data preprocessing process of the egg hatching rate prediction model, reference can be made to the relevant content in the first aspect and will not be elaborated here.
[0166] Further, after obtaining the predicted hatching rate of the target egg batch, the egg hatching rate prediction method may further include:
[0167] For the target egg batch, using the SHAP method to calculate the marginal contribution value of each feature data in its feature data group to the hatching rate, so as to analyze the influence of the feature data within the target egg batch;
[0168] Among them, the marginal contribution value represents the influence of the feature data on the hatching rate of the target egg batch, which is divided into positive influence and negative influence.
[0169] This part of the content can be understood by referring to step S02 in the second aspect and will not be repeated here. It can be understood that for the target egg batch to be tested, the influence of each feature on the hatching rate of the target egg batch can also be analyzed based on the interpretable machine learning method, so as to manage the hatching process, etc.
[0170] The egg hatching rate prediction method provided by the embodiments of the present invention adopts a novel algorithm framework, with high accuracy and strong interpretability. It can effectively solve the prediction bias of traditional machine learning in the case of sample imbalance and the overfitting problem that is prone to occur in a single model. It can accurately predict the hatching rate of egg batches and perform interpretability analysis on the prediction results of the hatching rate to support the precise management of the entire hatching cycle. The present invention uses artificial intelligence algorithms to solve problems such as egg hatching rate prediction and hatching process management in the context of modern commercial hatcheries, and has high practical value.
[0171] In order to verify the accuracy of the egg hatching rate prediction method proposed by the present invention and its effectiveness in hatching management, the following comparative experiments were set up and case studies were conducted.
[0172] The egg hatching rate prediction method provided by the embodiments of the present invention is implemented based on the feature-enhanced hierarchical supervision method of interpretable machine learning. During the model training process, it can first screen out low-hatching-rate samples from the training set of the original sample set and put them into the conditional generative adversarial network for training. Samples that are highly similar but different from the low-hatching-rate samples are generated and added to the training set of the original sample set, thus forming an augmented sample set and obtaining a new training set.
[0173] The new training set can better capture the characteristics of low-hatching-rate samples to reduce the bias caused by the model's prediction tendency towards the majority class. At the same time, a hierarchical supervision learning structure is adopted during the prediction process. The first-layer learner consists of a variety of complex and heterogeneous base learners, which can obtain the probability distribution of the characteristics affecting the egg hatching rate from different aspects, reducing the prediction bias of a single machine learning model. The prediction result of the first-layer learner is used as the feature input of the second-layer learner. The second-layer learner is a relatively simple linear model (linear regression), which can make the prediction result of the first-layer base learner smoother and alleviate the overfitting problem of complex models. The hierarchical learning structure solves the problem of poor generalization ability of a single model while improving the prediction accuracy, making the prediction result of the hatching rate more robust.
[0174] Then, the present invention uses an interpretable machine learning method (SHAP) to analyze the obtained prediction results. SHAP can calculate the magnitude and direction of the influence of each feature on the hatching rate of each specific sample data. From the perspective of individual samples, this method can understand the key features (factors) affecting the hatching rate of a certain batch of eggs and their influence directions, so as to conduct fine management of egg hatching in batches. From the perspective of the overall sample, this method can calculate the importance ranking and direction of the factors affecting the hatching rate of the entire batch of eggs, so that the hatchery can optimize resource allocation from a global perspective and use limited human and material resources on the key factors affecting the hatching rate. Therefore, the present invention solves the problems of low prediction accuracy of the hatching rate and poor model generalization ability caused by sample imbalance, and makes the prediction results obtained by the machine learning algorithm more interpretable to guide production practice.
[0175] In a specific embodiment, the present invention constructs an original sample set containing 1737 data samples. Among these 1737 batches of eggs, each batch contains from 100 to 166 eggs. The original sample set is divided, with 833 data samples assigned to the training set, 209 data samples assigned to the validation set, and 695 data samples assigned to the test set. The proportions of high-hatching-rate samples and low-hatching-rate samples in the three sets are equal.
[0176] Then, a first-layer learner is constructed using a random forest model, a light gradient boosting tree model, and a support vector machine model as base learners. A second-layer learner is constructed using a linear regression model. According to the training method described above, first, the three base learners of the first layer are trained using the training set and verified using the validation set. The prediction results after passing the verification are used as the feature input of the second-layer learner, and the hatching rate is used as the label for retraining to form the second-layer learner.
[0177] Then, the trained model can be evaluated. When evaluating, the mean squared error (MSE), root mean squared error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), and coefficient of determination (R 2 ) are used to evaluate the prediction performance of the model. The calculation methods of these evaluation indicators are as follows:
[0178]
[0179]
[0180]
[0181]
[0182]
[0183] where y i is the true value of the i-th sample, is the predicted value of the i-th sample, is the average value of all samples, and t is the number of samples.
[0184] In addition, to verify the effectiveness and superiority of the embodiments of the present invention, four comparison methods were also compared and verified with the method of the embodiments of the present invention. These four methods respectively used different models to implement the prediction of egg hatching rate. The dataset used when training these models was also the above dataset containing 1737 samples. Among them, the model used in the first comparison method only included a single RF model, the model used in the second comparison method only included a single LightGBM, the model used in the third comparison method only included a single SVR model, and the fourth comparison method adopted a traditional hierarchical learning method. The first-layer learner included RF model, LightGBM and SVR models, that is, these three models were respectively used to predict the egg hatching rate, and then the prediction results were used as the input features of the second layer to train the second-layer model to obtain the final prediction result. The difference between the fourth method and the method proposed by the present invention is that no new low-hatching-rate samples generated by CTGAN were added to the training set of the hierarchical learner, that is, no feature enhancement method was used to optimize the training process. Table 1 shows the performance test comparison results of the hierarchical hatching rate prediction method based on feature enhancement provided by the present invention and the other four methods.
[0185] Table 1 Performance comparison of various egg hatching rate prediction models
[0186] Evaluation Index MSE RMSE MAE MAPE <![CDATA[R 2 > RF 70.225 8.380 6.300 9.635 0.352 LGB 70.574 8.401 6.263 9.543 0.349 SVR 77.214 8.787 6.885 10.104 0.288 Traditional Hierarchical Learning 69.392 8.330 6.240 9.524 0.360 Feature Enhancement Hierarchical Learning Method Provided by the Present Invention 67.484 8.215 6.338 9.417 0.378
[0187] As can be seen from Table 1, the hierarchical supervised hatching rate prediction method based on feature enhancement provided by the embodiments of the present invention has better prediction performance than the prediction method using a single machine learning model and also better than the traditional (without using feature enhancement technology) hierarchical learning method.
[0188] In addition, the embodiments of the present invention also provide an egg hatching rate feature evaluation method. Using the SHAP method, it can calculate the importance and influence direction of the influencing factors of the hatching rate of each batch of eggs. Using SHAP for interpretability analysis of the prediction results of the hatching rate of a certain batch of eggs is as Figure 7 shown.
[0189] In this figure, the red features play a positive role in the hatching rate, while the blue features play a negative role. The features closer to the middle have a greater impact on the hatching rate. It can be seen that the baseline value of the egg hatching rate is 73.24%. The weight uniformity of this batch of eggs reaching 89.3% is the primary positive factor in improving the hatching rate of this batch of eggs, while the eggs being stored in the hatchery for too long (13 days) is the primary negative factor in reducing the hatching rate of this batch of eggs. The other influencing factors have relatively little impact on the hatching rate of this batch of eggs. The hatchery can conduct targeted inspections (using technologies such as thermal infrared and machine vision) on the eggs in this batch with relatively large average weight deviation and long storage time, rather than inspecting them one by one. Using SHAP to perform interpretability analysis on the prediction results of the hatching rate of a single batch of eggs helps the hatchery determine the key factors affecting the hatching rate of a certain batch of eggs, and based on this, focus on inspecting the eggs with a lower hatching rate in this batch, screening out infertile eggs in advance, and reducing the operating costs of the hatchery.
[0190] In addition, the SHAP method can also explain the importance ranking and influence direction of each feature in the overall sample from a global perspective. Figure 8 The figure shows a schematic diagram of the interpretability analysis of the prediction results of the hatching rate of all eggs in the embodiment using SHAP.
[0191] Figure 8 The top 20 features in terms of importance are arranged in descending order according to the average absolute value of the SHAP values of each feature in the overall sample (the complete definitions of the features are shown in Table 1). Among them, the different numerical values after Line represent the values of different strains, and the characters after Farm represent the corresponding farm names. Month_Cos and Month_Sin represent the Cos value and Sin value after converting the month when the eggs are placed in the incubator into radians.
[0192] Each sample is represented by a point. The color of the sample point represents the magnitude of the feature value. When the sample is on the left side of the vertical axis, it means that the feature has a negative impact on the predicted hatching rate of this sample (the more to the left, the greater the negative impact), and vice versa, it has a positive impact (the more to the right, the greater the positive impact).
[0193] From the global interpretation graph of the SHAP values ( Figure 8) It can be seen that biometric characteristics have the most significant impact on the hatching rate of eggs, and 14 out of the top 20 characteristics belong to this category. Among them, 6 characteristics are related to the strain of breeding hens. Four strains, namely 4, 15, 16, and 25, have a positive impact on the hatching rate, while two strains, 10 and 26, have a negative impact on the hatching rate. Considering the price of breeding eggs, hatcheries can consider purchasing more breeding eggs from strains with high hatching rates. In addition, the hatching rate is significantly negatively correlated with the age of breeding hens. Hatcheries should optimize the age structure of breeding hens and determine an appropriate threshold for culling breeding hens to prevent economic losses caused by low hatching rates. In addition, the uniformity of egg weight is positively correlated with the hatching rate. Therefore, hatcheries should purchase breeding eggs of moderate weight. In addition, the breeding hen farms also have a considerable impact on the hatching rate. Some breeding hen farms, such as VDZ and EV, are positively correlated with the hatching rate, while others, such as VDG and SCH, are negatively correlated with the hatching rate. Hatcheries can optimize the source of their breeding eggs based on the interpretable results of SHAP and cooperate more with high-quality breeding hen farms.
[0194] Secondly, environmental characteristics also have a great impact on the hatching rate of eggs. An overly long interval between the entry of breeding eggs into the hatchery and their placement in the incubator, as well as an overly long storage time of breeding eggs during the transfer from the incubator to the hatcher, will have a negative impact on the hatching rate. This indicates that hatcheries should accelerate the hatching turnover efficiency of breeding eggs to reduce economic losses caused by the decline in hatching rate due to overly long storage time of breeding eggs. In addition, "Month_Cos" is negatively correlated with the hatching rate, indicating that the low temperatures in winter and spring are not suitable for hatching. Hatcheries should adjust the quantity of breeding eggs purchased according to the seasonal fluctuations of the hatching rate and changes in market demand.
[0195] Finally, attention should also be focused on the characteristics of hatching equipment. In the above embodiment, there is a significant negative correlation between incubator No. 2 and the hatching rate. Malfunctions of hatching equipment will disrupt the hatching environment, affect the temperature, humidity, and egg-turning frequency during egg hatching, thereby affecting the normal development of embryos and reducing the hatching rate. Therefore, hatchery managers can conduct a comprehensive inspection of this incubator to eliminate malfunctions or discard this equipment, so as to promptly reduce losses and maintain the normal operation of hatchery equipment.
[0196] In summary, based on the limitations of the existing egg hatching rate prediction and hatching management methods, the embodiment of the present invention proposes an interpretable feature-enhanced hierarchical hatching rate prediction method, which not only makes full use of the advantages of hierarchical supervised learning, but also uses CTGAN to enhance the features of minority samples to improve the prediction accuracy. At the same time, the interpretable machine learning method SHAP is used to perform interpretability analysis on the prediction results, and fully explore the importance and influence direction of biological characteristics, environmental characteristics and hatching equipment characteristics on the hatching rate of a certain batch of eggs and all eggs. This method provides an efficient and reliable method for the accurate prediction of egg hatching rate, provides full-cycle decision support for the daily operation of the hatchery, and then improves the operation and management efficiency of the hatchery and reduces resource waste.
[0197] In the description of this specification, the descriptions referring to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification. The above are only the preferred embodiments of the present invention, and are not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A method for constructing an egg hatching rate prediction model, characterized in that, Including: For multiple batches of eggs, respectively obtain the corresponding feature data groups and hatching rates; where each batch of eggs contains several eggs; the feature data group of each batch of eggs contains multiple feature data corresponding to biological features, environmental features, and hatching equipment features; Perform data preprocessing on the feature data group of each batch of eggs to obtain data samples corresponding to the batch of eggs, and merge all data samples to obtain an original sample set; Perform augmentation processing on the data samples in the original sample set with hatching rates lower than the hatching rate threshold to obtain an augmented sample set; Build an original prediction model, where the original prediction model includes a first-layer learner and a second-layer learner connected in sequence; the first-layer learner includes multiple base learners in parallel, all of which are used to predict the hatching rate of eggs, and the second-layer learner is connected to the output ends of the multiple base learners and uses a linear regression model; Train the original prediction model based on the augmented sample set and the hatching rates of the data samples therein to obtain a trained egg hatching rate prediction model; Among them, in the feature data group of any batch of eggs, The feature data corresponding to biological features include: breeding grade of breeding chickens, strain of breeding chickens, source farm of breeding chickens, average age of breeding chickens, average weight of eggs, and egg weight uniformity; The feature data corresponding to environmental features include: hatching month, storage days, conversion days, and weight loss; The feature data corresponding to hatching equipment features include: number of eggs, incubator number, and chick hatchery number; Among them, for any feature data group, the process of the data preprocessing includes: Perform normalization processing on the continuous feature data in the feature data group; where the continuous feature data includes the average age of breeding chickens, the average weight of eggs, egg weight uniformity, storage days, conversion days, weight loss, and the number of eggs; Perform a discrete-to-continuous conversion process on the cyclic feature data in the feature data group; where the cyclic feature data includes the hatching month; Convert the categorical feature data in the feature data group into one-hot encoding; where the categorical feature data includes the breeding grade of breeding chickens, the strain of breeding chickens, the source farm of breeding chickens, the incubator number, and the chick hatchery number.
2. The method for constructing an egg hatching rate prediction model according to claim 1, wherein Performing augmentation processing on the data samples in the original sample set with hatching rates lower than the hatching rate threshold to obtain an augmented sample set, including: For the data samples in the original sample set with hatching rates lower than the hatching rate threshold, use a conditional generative adversarial network to generate similar data samples, and add all the obtained similar data samples to the original sample set to obtain an augmented sample set.
3. The method for constructing an egg hatching rate prediction model according to claim 1, wherein The first-layer learner includes three base learners in parallel, namely a random forest model, a light gradient boosting tree model, and a support vector machine model.
4. The method for constructing an egg hatching rate prediction model according to claim 1, wherein Training the original prediction model based on the augmented sample set and the hatching rates of the data samples therein to obtain a trained egg hatching rate prediction model, including: Using the augmented sample set and the hatching rates of the data samples therein, train each base learner in the first-layer learner separately in a multi-fold cross-validation manner to obtain each trained base learner; Use the multi-fold mean of the hatching rate prediction values of each base learner for the data samples after training as the input data, and use the hatching rate of the data samples to train the second-layer learner. The egg hatching rate prediction model is composed of the trained second-layer learner and the trained first-layer learner.
5. A method for evaluating the characteristics of egg hatching rate, characterized in that, Including: Obtain the egg hatching rate prediction model and the data samples of each egg batch used in the training process of the egg hatching rate prediction model; wherein, the egg hatching rate prediction model is obtained by using the egg hatching rate prediction model construction method according to any one of claims 1-4; For each egg batch, use the SHAP method to calculate the marginal contribution value of each feature data to the hatching rate in the feature data group of this egg batch, so as to conduct an impact analysis of the feature data within this egg batch; wherein, the marginal contribution value represents the impact of the feature data on the hatching rate of this egg batch, and is divided into positive impact and negative impact; For each type of feature data, calculate the average marginal contribution value of this type of feature data in all egg batches, and use the average marginal contribution values calculated by various types of feature data to conduct an impact analysis of the feature data within all egg batches.
6. The method for evaluating the characteristics of egg hatching rate according to claim 5, wherein The using the average marginal contribution values calculated by various types of feature data to conduct an impact analysis of the feature data within all egg batches includes: Draw a scatter plot according to the average marginal contribution values of various types of feature data, and analyze the importance and impact direction of various types of feature data on the hatching rate of all egg batches.
7. A method for predicting the hatching rate of eggs, characterized in that, Including: Obtain the feature data group of the target egg batch; wherein, the feature data group contains multiple feature data corresponding to biological features, environmental features, and hatching equipment features; After preprocessing the feature data group of the target egg batch, input it into the pre-trained egg hatching rate prediction model to obtain the predicted hatching rate of the target egg batch; wherein, the egg hatching rate prediction model is obtained by using the egg hatching rate prediction model construction method according to any one of claims 1-4.
8. The method for predicting the hatching rate of eggs according to claim 7, wherein After obtaining the predicted hatching rate of the target egg batch, the egg hatching rate prediction method further includes: For the target egg batch, use the SHAP method to calculate the marginal contribution value of each feature data to the hatching rate in its feature data group, so as to conduct an impact analysis of the feature data within the target egg batch; wherein, the marginal contribution value represents the impact of the feature data on the hatching rate of the target egg batch, and is divided into positive impact and negative impact.
Citation Information
Patent Citations
A livestock egg incubation device
CN108293915B
Deep learning-based egg group image segmentation fertilization information detection device and method
CN114544630A
Visible near infrared spectrum-based establishment method of hatching early-stage fertilized hatching egg discrimination model
CN111476320A
Method for improving weight loss control of an egg in a controlled incubation or storage environment, particularly for eggs of galliforms
WO2008141846A1