Egg hatching rate prediction model construction method, hatching rate characteristic evaluation method and egg hatching rate prediction method
By constructing a multi-stage feature hierarchical learner model, the deviation and overfitting problems in egg hatching rate prediction are solved, and the hatching rate prediction with high accuracy and interpretability is achieved, supporting the precise management of the hatchery.
Patent Information
- Application Number
- CN202411292829.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-09-14
AI Technical Summary
The existing egg hatching rate prediction method ignores the imbalance distribution of egg hatching rate, resulting in prediction deviation, and a single prediction model is prone to overfitting problems, making it difficult to achieve accurate prediction, and lacks interpretability, which limits its incubation site. Practical application.
A egg hatching rate prediction model was constructed. By obtaining multi-stage feature data of biometrics, environmental features and incubation equipment characteristics, using condition generation adversarial networks to augment data, and building a layered learner model, combining random forests and lightweight The level gradient enhancement tree and support vector machine model adopt linear regression as the second layer learner to perform hierarchical supervision and prediction of feature enhancement.
It significantly improves the prediction accuracy of egg hatching rate, alleviates the overfitting problem of a single model, achieves interpretable prediction results, supports accurate management of the entire cycle of incubation, and reduces production costs and resource waste.
Smart Images

Figure CN119250273A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of machine learning, and in particular relates to the construction of an egg hatchability prediction model, a hatchability characteristic evaluation and a prediction method. Background Art
[0002] With the development of the economy, residents' demand for dietary nutrition continues to increase. Eggs are an important source of protein in residents' diets and are of great significance for ensuring good health. The incubation of laying hen eggs is crucial for a stable supply of eggs, and eggs without hatching ability will occupy the space of the incubation equipment, resulting in a waste of energy and food. Therefore, it is necessary to accurately predict the hatchability of eggs before incubation, focus on monitoring eggs with low hatchability, and remove eggs without hatchability.
[0003] At present, the research on egg hatching mainly includes hatching rate prediction methods and hatching process management methods based on factors affecting hatching rate. The traditional method of hatching rate prediction is manual visual inspection, using an egg candling device to illuminate the embryo eggs in the dark and observe the development of the embryo. The hatching performance of the egg is judged based on the distribution and color of the vascular network of the egg embryo. This method is relatively accurate but requires a large number of professional technicians and is time-consuming and labor-intensive.
[0004] Machine learning methods have improved the efficiency of hatchability prediction to a certain extent. Therefore, large hatcheries are gradually using machine learning technology to predict egg hatchability. For example, information related to egg hatchability performance is obtained through technologies such as ultrasound and machine vision. et al. punched small holes in eggs to allow ultrasound to enter the eggs, and used ultrasound images of eggs to infer embryonic development and thus predict the hatching rate of eggs ( E, IH, Gulhan T, et al. Astudy 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 image of eggs, detect the fertilization information of eggs, and realize the non-destructive detection of the hatching performance of group eggs (Zhang Fu et al. Group egg image segmentation fertilization information detection device and method based on deep learning [P]. Henan Province: CN114544630A, 2022-05-27.).
[0005] For the management of egg hatching process, predecessors mainly explored from three aspects: biological factors (genetic breeding), environmental factors and hatching equipment factors. Tona et al. found through control experiments that the eggs produced by brown strains of breeders have a higher hatching rate than 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 the storage temperature of eggs above 21°C is harmful to the development of chick embryos, thereby 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 that can automatically disinfect, which improves the hatching rate of eggs (Xu Qingzhen, Li Ping. Xu Qingzhen and Li Ping: CN108293915B [P]. 2018-02-24.).
[0006] Traditional machine learning-driven hatchability prediction methods ignore the unbalanced distribution of egg hatchability, that is, most eggs have a high hatchability, while only a small number of eggs cannot hatch. In this case, the machine learning model will be biased towards the majority class samples (eggs with high hatchability), resulting in prediction bias. In addition, the hatchability prediction method using a single prediction model is prone to overfitting problems, thereby reducing the prediction accuracy. Moreover, although the machine learning method has a high prediction accuracy, it is a "black box" model with poor interpretability, which restricts its 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 hatching rate of eggs, such as the egg storage environment and hatching equipment, which is not conducive to the precise management of the entire egg hatching cycle. In addition, improving the hatching rate through genetic improvement and the development of new hatching equipment requires a large amount of capital investment, a long payback period, and high technical requirements for professionals. Summary of the invention
[0008] In order to solve the above problems existing in the prior art, the present invention provides a method for constructing a prediction model for egg hatchability, evaluating hatchability characteristics and predicting the hatchability. The technical problem to be solved by the present invention is achieved by the following technical solutions:
[0009] In a first aspect, an embodiment of the present invention provides a method for constructing an egg hatchability prediction model, the method comprising:
[0010] For multiple batches of eggs, corresponding feature data groups and hatching rates are obtained respectively; wherein each batch of eggs contains a number of eggs; and the feature data group of each batch of eggs contains multiple feature data corresponding to biological features, environmental features, and hatching equipment features;
[0011] Preprocess the characteristic data groups of each egg batch separately to obtain data samples of the corresponding egg batch, and merge all data samples to obtain the original sample set;
[0012] Performing augmentation processing on the data samples whose hatching rates are lower than the hatching rate threshold in the original sample set to obtain an augmented sample set;
[0013] Building 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 in parallel, all used to predict the hatching rate of eggs, and the second layer learner is connected to the output ends of the plurality of base learners and adopts a linear regression model;
[0014] Based on the augmented sample set and the hatchability of each data sample therein, the original prediction model is trained to obtain a trained egg hatchability prediction model.
[0015] In one embodiment of the present invention, in any characteristic data set of an egg batch,
[0016] The characteristic data corresponding to the biological characteristics include: breeding grade of breeder chickens, breeder chicken strain, breeding farm of breeder chickens, average age of breeder chickens, average egg weight and egg weight uniformity;
[0017] Characteristic data corresponding to environmental characteristics include: hatching month, storage days, conversion days, and weight loss;
[0018] The characteristic data corresponding to the hatching equipment characteristics include: number of eggs, incubator number and hatcher number.
[0019] In one embodiment of the present invention, for any feature data set, the data preprocessing process includes:
[0020] Normalizing the continuous characteristic data in the characteristic data group; wherein the continuous characteristic data include the average age of breeder chickens, the average weight of eggs, the uniformity of egg weight, the number of storage days, the number of conversion days, the weight loss and the number of eggs;
[0021] Performing discrete-to-continuous conversion processing on the cyclical characteristic data in the characteristic data group; wherein the cyclical characteristic data includes hatching months;
[0022] The categorical feature data in the feature data group is converted into a one-hot encoding; wherein the categorical feature data includes the breeding grade of the breeder chickens, the breeder chicken strain, the breeding farm where the breeder chickens come from, the incubator number and the hatcher number.
[0023] In one embodiment of the present invention, data samples in the original sample set whose hatching rates are lower than a hatching rate threshold are augmented to obtain an augmented sample set, including:
[0024] For data samples in the original sample set whose hatching rates are lower than a hatching rate threshold, a conditional generative adversarial network is used to generate similar data samples, and all the obtained similar data samples are added to the original sample set to obtain an augmented sample set.
[0025] In one 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 one embodiment of the present invention, based on the augmented sample set and the hatchability of each data sample therein, the original prediction model is trained to obtain a trained egg hatchability prediction model, including:
[0027] Using the augmented sample set and the hatching rate of each data sample therein, each base learner in the first layer learner is trained separately in a multi-fold cross-validation manner to obtain each trained base learner;
[0028] The multi-fold mean of the hatchability prediction values of the trained base learners for the data samples is used as input data, and the hatchability of the data samples is used to train the second-layer learners. The trained second-layer learners and the trained first-layer learners constitute an egg hatchability prediction model.
[0029] In a second aspect, an embodiment of the present invention provides a method for evaluating characteristics of egg hatchability, the method comprising:
[0030] Acquire an egg hatchability prediction model and data samples of each egg batch used in the training process of the egg hatchability prediction model; wherein the egg hatchability prediction model is obtained by using the egg hatchability prediction model construction method described in the first aspect;
[0031] For each batch of eggs, the SHAP method is used to calculate the marginal contribution value of each characteristic data in the characteristic data group of the egg batch to the hatching rate, so as to perform the impact analysis of the characteristic data in the egg batch; wherein the marginal contribution value represents the impact of the characteristic data on the hatching rate of the egg batch, which is divided into positive impact and negative impact;
[0032] For each type of characteristic data, calculate the average marginal contribution value of this type of characteristic data in all egg batches, and use the average marginal contribution value calculated for each type of characteristic data to conduct an impact analysis of the characteristic data in all egg batches.
[0033] In one embodiment of the present invention, the average marginal contribution value calculated using various types of characteristic data is used to perform an impact analysis of the characteristic data in all egg batches, including:
[0034] A scatter plot is drawn based on the average marginal contribution value of each type of characteristic data, and the importance and direction of the impact of each type of characteristic data on the hatching rate of all egg batches are analyzed.
[0035] In a third aspect, an embodiment of the present invention provides a method for predicting the hatchability of eggs, the method comprising:
[0036] Acquire a characteristic data group of a target egg batch; wherein the characteristic data group contains a plurality of characteristic data corresponding to biological characteristics, environmental characteristics, and incubation equipment characteristics;
[0037] After data preprocessing of the characteristic data group of the target egg batch, the pre-trained egg hatching rate prediction model is input to obtain the predicted hatching rate of the target egg batch; wherein the egg hatching rate prediction model is obtained according to the egg hatching rate prediction model construction method described in the first aspect.
[0038] In one embodiment of the present invention, after obtaining the predicted hatchability of the target egg batch, the egg hatchability prediction method further includes:
[0039] For the target egg batch, the SHAP method is used to calculate the marginal contribution value of each characteristic data in its characteristic data group to the hatching rate, so as to perform an impact analysis of the characteristic data within the target egg batch; wherein the marginal contribution value represents the impact of the characteristic data on the hatching rate of the target egg batch, which is divided into positive impact and negative impact.
[0040] Beneficial effects of the present invention:
[0041] For the problem of egg hatchability prediction, traditional machine learning algorithm models often only focus on biological features (the properties of the eggs themselves), and the prediction results will be biased towards the majority class samples and easily produce overfitting problems, thereby causing prediction bias. The egg hatchability prediction model obtained according to the egg hatchability prediction model construction method provided by the present invention comprehensively considers biological features, environmental features and incubation equipment features, collects these multi-stage features that affect egg hatching as input data, so that the method can more comprehensively extract the feature distribution that affects the hatchability of eggs, thereby significantly improving the accuracy of prediction. The model of the present invention can estimate the hatchability of a whole batch of eggs using the feature-enhanced hierarchical supervision prediction method through the key factors that affect the hatchability of eggs, such as the biological features, environmental features and incubation equipment features of eggs, which can prevent the prediction results from being biased towards the majority class and alleviate the overfitting problem caused by a single prediction model.
[0042] In the egg hatchability characteristic evaluation method provided in the embodiment of the present invention, the egg hatchability prediction model provided and the data samples of each egg batch used in the egg hatchability prediction model training process are used to analyze the prediction results using an interpretable machine learning method, and the key features that affect the hatchability can be determined, thereby breaking the "black box" attribute of the traditional machine learning method, realizing accurate management of the entire incubation cycle to improve the hatchability, and providing a decision support method for hatchery operation and management, which can better guide the daily operation of the hatchery, reduce production costs and reduce resource waste.
[0043] The egg hatchability prediction method provided in the embodiment of the present invention adopts a novel algorithm framework, has high accuracy, and is highly interpretable. It can effectively solve the prediction bias of traditional machine learning when the samples are unbalanced and the overfitting problem that a single model is prone to. It can achieve accurate prediction of the hatchability of egg batches, and can perform interpretable analysis on the prediction results of the hatchability to support accurate management of the entire hatching cycle. The present invention uses artificial intelligence algorithms to solve problems such as egg hatchability prediction and hatching process management in the context of modern commercial hatcheries, and has high practical value. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A schematic diagram of a process for constructing an egg hatchability prediction model provided by an embodiment of the present invention;
[0045] Figure 2 A schematic diagram of understanding a hierarchical supervised learning strategy used in the training of the original prediction model in an embodiment of the present invention;
[0046] Figure 3 This is an example diagram of the original prediction model training process in an embodiment of the present invention;
[0047] Figure 4 A schematic diagram of a flow chart of a method for evaluating characteristics of egg hatchability provided by an embodiment of the present invention;
[0048] Figure 5 A schematic diagram for understanding a method for evaluating characteristics of egg hatchability provided by an embodiment of the present invention;
[0049] Figure 6 A schematic diagram of a flow chart of a method for predicting egg hatchability provided by an embodiment of the present invention;
[0050] Figure 7 A schematic diagram of the interpretability analysis of the prediction of the hatchability of a batch of eggs by the method for evaluating the hatchability of eggs provided in an embodiment of the present invention;
[0051] Figure 8 A schematic diagram of the interpretability analysis of the prediction of the hatchability of a whole batch of eggs by the egg hatchability characteristic evaluation method provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The present invention is further described in detail below with reference to specific embodiments, but the embodiments of the present invention are not limited thereto.
[0053] In order to realize automatic prediction of egg hatchability and optimize the hatching process accordingly to improve the hatchability, an explainable egg hatchability prediction technology is needed. To this end, the present invention proposes an egg hatchability prediction model construction method, an egg hatchability characteristic evaluation method and an egg hatchability prediction method.
[0054] In a first aspect, an embodiment of the present invention provides a method for constructing an egg hatchability prediction model. Figure 1 As shown, the egg hatchability prediction model construction method may include the following steps:
[0055] S1, for multiple egg batches, respectively obtain corresponding feature data groups and hatching rates;
[0056] Among them, each batch of eggs contains a number of eggs; in the embodiment of the present invention, the number of eggs contained in each batch of eggs can be the same or different.
[0057] In the embodiment of the present invention, the characteristic data group of each batch of eggs contains a plurality of characteristic data corresponding to biological characteristics, environmental characteristics, and hatching equipment characteristics;
[0058] The characteristic data set for any batch of eggs is the various characteristic data collected that affect the hatching rate. Generally speaking, it can be divided into three categories, namely biological characteristics, environmental characteristics and hatching equipment characteristics. Each category has multiple characteristic data, thus forming a one-dimensional characteristic data set.
[0059] In an optional embodiment, in any characteristic data set of an egg batch,
[0060] The characteristic data corresponding to the biological characteristics include: breeding grade of breeder chickens, breeder chicken strain, breeding farm of breeder chickens, average age of breeder chickens, average egg weight and egg weight uniformity;
[0061] Characteristic data corresponding to environmental characteristics include: hatching month, storage days, conversion days, and weight loss;
[0062] The characteristic data corresponding to the hatching equipment characteristics include: number of eggs, incubator number and hatcher number.
[0063] Specifically, the hatchability of eggs is affected by many factors.
[0064] First, biological characteristics can reflect the characteristics of breeder chickens and the quality of eggs themselves, which directly affect embryonic development. For production practice considerations, the embodiment of the present invention collects the following six biological characteristics: breeder breeding grade (grandparent or parent generation), breeder strain, breeder source farm, breeder average age, average egg weight and egg weight uniformity. Therefore, for any batch of eggs, there are 6 feature data corresponding to the biological characteristics.
[0065] Among them, the breeding grade of breeder chickens refers to whether the breeder chickens from this batch of eggs are the grandparent generation or the parent generation; the breeder chicken strain refers to the genetic strain of the breeder chickens from this batch of eggs; the breeder chicken source farm refers to the name of the farm where the breeder chickens for this batch of eggs come from; the average age of breeder chickens refers to the average age of the breeder chickens from this batch of eggs; the average egg weight refers to the average weight of the eggs in this batch; the egg weight uniformity refers to the proportion of eggs in this batch whose weight is within the range of ±10% of the average weight.
[0066] Second, environmental characteristics also have an important impact on the hatchability. In the production practice of egg hatcheries, the main cause of hatching failure is embryo death, which is more due to the unfavorable hatching environment, such as inappropriate temperature and humidity for egg storage, rather than the quality of the eggs themselves. The present invention collects the following four environmental characteristics: hatching month, storage days, conversion days, and weight loss. Therefore, for any batch of eggs, there are 4 feature data corresponding to the environmental characteristics.
[0067] Among them, the incubation month refers to the month when the batch of eggs are placed in the incubator, such as February or March, which refers to a specific month and takes a value from 1 to 12; the storage days refer to the interval between the purchase of the batch of eggs from the hatchery and the placement in the incubator; the transfer days refer to the interval 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] Third, the incubator provides a suitable temperature and humidity environment and turning frequency for egg incubation to promote embryonic development. The operating condition of the incubator also has an important impact on the hatching rate of eggs. The present invention collects three incubator characteristics, including: the number of eggs, the incubator number, and the hatcher number. Therefore, for any batch of eggs, there are 3 feature data corresponding to the incubator characteristics.
[0069] Among them, the number of eggs refers to the number of eggs in this batch; the incubator number refers to the number of the incubator where the batch of eggs is located; and the hatcher number refers to the number of the hatcher where the batch of eggs is located.
[0070] From the above, it can be seen that, corresponding to the 13 types of features, for any batch of eggs, there are 13 feature data in the feature data group.
[0071] Moreover, the feature data group of each egg batch in S1 will be used as samples in the training process later. Therefore, it is also necessary to obtain the hatching rate of the corresponding egg batch as the true value label in the training process. This part of the hatching rate is the known real hatching rate.
[0072] The prediction target of the present invention is the hatching rate of eggs, specifically the hatching rate of fertilized eggs in a batch of eggs, and the calculation formula is:
[0073]
[0074] For ease of understanding, the features and their definitions in the feature data group are shown in Table 1.
[0075] Table 1 Features and their definitions in feature data set
[0076]
[0077]
[0078] S2, preprocessing the characteristic data groups of each egg batch separately to obtain data samples of the corresponding egg batch, and merging all data samples to obtain the original sample set;
[0079] The biological characteristics, environmental characteristics and incubation equipment characteristics that affect the hatching rate of eggs include continuous characteristics (characteristics can be understood as variables), cyclic characteristics and categorical characteristics. The data dimensions of each type of characteristics are not uniform. Directly inputting the original feature data into the machine learning prediction model for training will lead to difficulties in model convergence, which in turn affects the accuracy of the prediction results. Therefore, it is necessary to preprocess the collected feature data.
[0080] In an optional implementation manner, for any feature data group, the data preprocessing process includes:
[0081] 1) normalizing the continuous feature data in the feature data group;
[0082] The continuous characteristic data include the average age of breeder hens, average egg weight, egg weight uniformity, storage days, conversion days, weight loss and number of eggs;
[0083] Normalization processing can be performed using any existing normalization method. For example, in an optional implementation, the Min-Max normalization method can be used to linearly scale the continuous feature data to the range of [0,1] to obtain normalized continuous feature 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 feature to be normalized, X min is the minimum value of the feature, X max is the maximum value of the feature, X scaled is the normalized feature value.
[0087] For details about the Min-Max normalization method, please refer to the relevant technical understanding.
[0088] According to the above Min-Max normalization method, each continuous feature data can be normalized separately.
[0089] 2) performing discrete-to-continuous conversion processing on the cyclic characteristic data in the characteristic data group;
[0090] Among them, the cyclic characteristic data includes the month of incubation; the month when the eggs are placed in the incubator is a cyclic variable, and its value ranges from 1 to 12, and the difference between consecutive values is 1. However, the value from December to January of the following year jumps. Therefore, the embodiment of the present invention first converts the month value (1 to 12) into radians (0 to 2π), with January being 0 radians and December being 2π radians. Then, the Sin and Cos values of radians are taken to represent the month, so that each month can be uniquely represented and the value is 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 classification feature data includes the breeding grade of breeder chickens, breeder chicken strains, breeder chicken source farms, incubator numbers, and hatcher numbers. These features are all categorical variables. For the needs of machine learning model training, the present invention converts these classification feature data into corresponding one-hot encodings. For the understanding of one-hot encoding, please refer to the relevant technical understanding, which will not be described in detail here.
[0093] It can be understood that the feature data set corresponding to each batch of eggs is subjected to data preprocessing to obtain the corresponding preprocessed feature data set as the data sample of the batch of eggs, which contains 13 data. The data samples of all batches of eggs constitute the original sample set.
[0094] S3, performing augmentation processing on the data samples in the original sample set whose hatching rates are lower than the hatching rate threshold, to obtain an augmented sample set;
[0095] The original sample set in the embodiment of the present invention can be used for model training, and all or part of the data samples whose hatching rate is lower than the hatching rate threshold can be augmented. The hatching rate threshold can be set as needed, for example, 60%.
[0096] In this implementation manner, data samples in the original sample set whose hatching rates are lower than the hatching rate threshold are augmented to obtain an augmented sample set, including:
[0097] For data samples in the original sample set whose hatching rates are lower than a hatching rate threshold, a conditional generative adversarial network is used to generate similar data samples, and all the obtained similar data samples are added to the original sample set to obtain an 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 real samples based on the training data set (real) samples. The discriminator D is used to distinguish between real samples and fake samples.
[0099] Alternatively, the original sample set can be randomly divided into a training set and a test set, the training set can be used for model training, and the test set can be used for model prediction. For example, 60% of the data samples in the original sample set can be used as a training set, and the remaining 40% can be used as a test set.
[0100] Under this implementation, low hatching rate data samples (i.e., data samples with hatching rates lower than a hatching rate threshold, referred to as low hatching rate samples) in the training set of the original sample set can be screened out and augmented using a conditional generative adversarial network.
[0101] Among them, the process of augmentation processing using conditional generative adversarial networks includes:
[0102] A training data set of a conditional generative adversarial network (CTGAN) is obtained; wherein each training data in the training data set is a data sample whose hatching rate in the original sample set is lower than a 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 features 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 value 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 value 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 cannot distinguish the generated samples from the real samples. At this point, CTGAN stops working. The synthetic samples generated by CTGAN are new samples that are highly similar to 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] The augmentation process in the embodiment of the present invention can be understood in conjunction with the working principle of the existing CTGAN, and no further detailed description is given here.
[0108] It should be noted that the synthetic samples generated by CTGAN also have corresponding hatching rates, but it is understandable that their hatching rates are generated, not the real hatching rates.
[0109] S4, building an original prediction model, wherein 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 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 plurality of base learners and adopts a linear regression model;
[0110] The multiple base learners in parallel in the first layer of learners can be implemented using different existing machine learning models that can perform predictions, and there is no limit on the number and type.
[0111] In an optional implementation, the first layer learner includes three base learners in parallel, namely a random forest model (RF for short), a lightweight gradient boosting tree model (LightGBM for short) and a support vector machine model (SVR for short).
[0112] The working principles and advantages and disadvantages of these three models are different. Each model can capture the characteristic distribution model that affects the hatching rate from different aspects, so 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 lot 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 in the forest n_estimators and the maximum depth of the tree max_depth, etc.; for the LightGBM model, its model parameters include the learning rate learning_rate, the number of trees to be built n_estimators and the maximum depth of the tree max_depth, 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 be referred to the relevant existing technology.
[0114] S5, based on the augmented sample set and the hatching rate of each data sample therein, the original prediction model is trained to obtain a trained egg hatching rate prediction model.
[0115] In an optional implementation manner, S5 may include the following steps:
[0116] S51, using the augmented sample set and the hatching rate of each data sample therein, respectively 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 embodiment of the present invention, each base learner is trained independently at the same time. When each base learner completes its own training, all the trained base learners are used as the first layer learners.
[0118] In an optional implementation, the data samples in the training set (i.e., training samples) can be divided into a training set and a validation set in a ratio of 4:1 for five cross-validations. The training set is first used to train each base learner in the first layer, and then the validation set is used for validation.
[0119] During training, the training set and the hatching rate of the data samples in it are used, and then the validation set is input into the trained base learner. The first layer learner will output the corresponding egg hatching rate prediction result for each data sample. The prediction result is P kn , the formula is as follows:
[0120]
[0121] Among them, k is the cross-validation fold number, which can be set as needed and is not limited to 5; n is the number of base learners.
[0122] S52, taking the multi-fold mean of the hatchability prediction values of the data samples of each trained base learner as input data, and using the hatchability of the data samples to train the second layer learner, the trained second layer learner and the trained first layer learner constitute an egg hatchability prediction model.
[0123] The prediction results of the first-layer learner verified on the validation set will be used as the feature input of the second-layer learner h′. Specifically, the feature input for a data sample is the average of the prediction results of each base learner for the data sample under multiple folds. In addition, the hatching rate of the data sample is used as a label to train the second-layer learner. Finally, the second-layer learner obtains a prediction result for the above data sample, namely the hatching rate.
[0124] The present invention selects a linear regression model as the second-layer learner (meta-model). This is because the complex machine learning model in the first-layer learner can accurately predict the hatching rate while also causing overfitting problems, while a 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, …, β n is the regression coefficient. The above parameters are obtained using the least squares method to minimize the difference between the actual observed value and the model predicted value. This completes the model training process.
[0128] This is followed by 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 of the first stage. kn , T kn Take the average value x of all predictions obtained by each base learner n Input to 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 as:
[0130]
[0131]
[0132]
[0133] Among them, k is the number of cross-validation folds; AVE is the calculated average value; n is the number of base learners; T kn Represents the prediction results 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 the heterogeneous base learner and the meta-learner is used to implement the training. Figure 2 As shown, Figure 2 The test set in can also be the validation set. This hierarchical supervised learning strategy can prevent the overfitting problem of a single model and improve the accuracy of egg hatching prediction. For an example of a model training process, see Figure 3 shown.
[0135] By iterating the above training process, a trained egg hatching rate prediction model can be obtained when the iteration termination conditions are met (such as the model performance reaches the preset requirements, etc.). After inputting a feature data group of an egg batch that has undergone data preprocessing, the egg hatching rate prediction model can output the corresponding egg hatching rate prediction result, which represents the probability of hatching eggs in the egg batch and can be expressed in the form of a percentage.
[0136] For the problem of egg hatchability prediction, traditional machine learning algorithm models often only focus on biological features (the properties of the eggs themselves), and the prediction results will be biased towards the majority class samples and easily produce overfitting problems, thereby causing prediction bias. The egg hatchability prediction model obtained according to the egg hatchability prediction model construction method provided by the present invention comprehensively considers biological features, environmental features and incubation equipment features, collects these multi-stage features that affect egg hatching as input data, so that the method can more comprehensively extract the feature distribution that affects the hatchability of eggs, thereby significantly improving the accuracy of prediction. The model of the present invention can estimate the hatchability of a whole batch of eggs using the feature-enhanced hierarchical supervision prediction method through the key factors that affect the hatchability of eggs, such as the biological features, environmental features and incubation equipment features of eggs, which can prevent the prediction results from being biased towards the majority class and alleviate the overfitting problem caused by a single prediction model.
[0137] In the second aspect, based on the egg hatchability prediction model construction method provided in the first aspect, the embodiment of the present invention further provides an egg hatchability characteristic evaluation method, such as Figure 4 As shown, the method for evaluating the characteristics of egg hatchability may include the following steps:
[0138] S01, obtaining an egg hatchability prediction model and data samples of each egg batch used in the egg hatchability prediction model training process;
[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 of the first aspect, which will not be repeated here.
[0140] Step S01 essentially obtains data samples of each egg batch used in the model training process, and uses the prediction results of the trained hatchability prediction model to analyze the impact of each feature in the same egg batch on the prediction results in step S02, and analyze the impact of each feature in all egg batches on the prediction results in step S03, thereby analyzing the degree and direction of the impact of each feature on the hatchability of eggs.
[0141] S02, for each batch of eggs, using the SHAP (SHapley Additive exPlanations) method to calculate the marginal contribution value of each characteristic data in the characteristic data group of the egg batch to the hatchability, so as to perform an impact analysis of the characteristic data within the egg batch;
[0142] Among them, the marginal contribution value represents the impact of the characteristic data on the hatchability of the egg batch, which can be divided into positive impact and negative impact;
[0143] Specifically, the feature data set of each batch of eggs is regarded as a sample. As mentioned above, there are 13 types of features to be analyzed. For the jth feature in the i-th sample, its marginal contribution value to the hatchability is φ ij It can be calculated according to the following formula:
[0144]
[0145] Where N is the number of features; M is the number of samples; i is the sample number; j is the feature number; S is a feature subset of N (but does not include feature j), f i (S) is the predicted value of the egg hatchability 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., hatchability) of the egg hatchability prediction model proposed in the present invention after adding j to the subset S. SHAP value (i.e., marginal contribution value φ ij ) provides a clear numerical value for each feature, indicating the impact of the feature on the model prediction. ij A positive value indicates that the feature improves the predicted value (hatch rate), which is a positive impact, and a negative value indicates that the feature reduces the predicted value, which is a negative impact.
[0146] It can be understood that for any sample, the 13 feature data 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 hatchability benchmark value is the prediction result of the egg hatchability prediction model, which satisfies the following formula:
[0148]
[0149] Among them, f i (x) represents the prediction result of the egg hatchability prediction model for the i-th egg batch; φ0 represents the hatchability benchmark value, which is the average hatchability of all egg batches.
[0150] When the marginal contribution value φ of each feature data is calculated for a batch of eggs, ij After that, individual sample analysis can be performed. Specifically, φ ij The absolute value of φ ij The positive or negative value of the characteristic can be used to determine the direction of its influence, whether it increases or decreases 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 egg batches, and use the average marginal contribution value calculated for each type of characteristic data to perform an impact analysis of the characteristic data in all egg batches.
[0152] For each type of feature, the marginal contribution value of this type of feature in all egg batches can be averaged as follows:
[0153]
[0154] Among them, C j It represents the average marginal contribution value of the jth (class) feature in all samples. The average marginal contribution value of all class features is used to perform the impact analysis of the feature data in all egg batches.
[0155] In an optional embodiment, the average marginal contribution value calculated using various characteristic data is used to perform an impact analysis of the characteristic data in all egg batches, including:
[0156] A scatter plot is drawn based on the average marginal contribution value of each type of characteristic data, and the importance and direction of the impact of each type of characteristic data on the hatching rate of all egg batches are analyzed.
[0157] Specifically, the importance of features can be ranked according to the average marginal contribution values of all features, and a scatter plot can be drawn according to all the average marginal contribution values. The scatter plot can be used to analyze the importance and direction of the impact of various features on the hatchability of all egg batches, so as to make corresponding management and production decisions. The egg hatchability feature evaluation method provided in the embodiment of the present invention can be found in Figure 5 understand.
[0158] In the egg hatchability characteristic evaluation method provided in the embodiment of the present invention, the egg hatchability prediction model provided and the data samples of each egg batch used in the egg hatchability prediction model training process are used to analyze the prediction results using an interpretable machine learning method, and the key features that affect the hatchability can be determined, thereby breaking the "black box" attribute of the traditional machine learning method, realizing accurate management of the entire incubation cycle to improve the hatchability, and providing a decision support method for hatchery operation and management, which can better guide the daily operation of the hatchery, reduce production costs and reduce resource waste.
[0159] In a third aspect, based on the egg hatchability prediction model construction method provided in the first aspect, an embodiment of the present invention further provides an egg hatchability prediction method, such as Figure 6 As shown, the egg hatchability prediction method may include the following steps:
[0160] S100, obtaining a characteristic data set of a target egg batch;
[0161] The target egg batch refers to a batch of eggs to be tested, which is similar to any egg batch in the first aspect, but its hatchability is unknown.
[0162] Among them, for the target batch of eggs, the characteristic data group contains multiple characteristic data corresponding to biological characteristics, environmental characteristics, and incubation equipment characteristics. Please refer to the relevant content of the first aspect for understanding, and will not be elaborated here.
[0163] S200, after data preprocessing, the characteristic data group of the target egg batch is input into a pre-trained egg hatchability prediction model to obtain a predicted hatchability of the target egg batch;
[0164] Wherein, the egg hatching rate prediction model is obtained according to the egg hatching rate prediction model construction method described in the first aspect.
[0165] For the specific construction process and data preprocessing process of the egg hatching rate prediction model, please refer to the relevant content of the first aspect and will not be elaborated here.
[0166] Furthermore, after obtaining the predicted hatchability of the target egg batch, the egg hatchability prediction method may further include:
[0167] For the target egg batch, the SHAP method is used to calculate the marginal contribution value of each characteristic data in its characteristic data group to the hatching rate, so as to perform the influence analysis of the characteristic data in the target egg batch;
[0168] Among them, the marginal contribution value represents the impact of the characteristic data on the hatching rate of the target egg batch, which is divided into positive impact and negative impact.
[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 is understandable that, for the target egg batch to be tested, the influence of each feature on the hatchability of the target egg batch can also be analyzed based on the interpretable machine learning method, so as to perform hatching process management, etc.
[0170] The egg hatchability prediction method provided in the embodiment of the present invention adopts a novel algorithm framework, has high accuracy, and is highly interpretable. It can effectively solve the prediction bias of traditional machine learning when the samples are unbalanced and the overfitting problem that a single model is prone to. It can achieve accurate prediction of the hatchability of egg batches, and can perform interpretable analysis on the prediction results of the hatchability to support accurate management of the entire hatching cycle. The present invention uses artificial intelligence algorithms to solve problems such as egg hatchability 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 hatchability prediction method proposed in the present invention and its effectiveness in hatching management, a comparative experiment was set up and an example analysis was performed as follows.
[0172] The egg hatching rate prediction method provided by the embodiment of the present invention is implemented based on the feature enhancement hierarchical supervision method of interpretable machine learning. During the model training process, low hatching rate samples can be first screened out from the training set of the original sample set and put into the conditional generative adversarial network for training, and samples that are highly similar to but different from the low hatching rate samples are generated and added to the training set of the original sample set, thereby 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 prediction bias towards the majority class. At the same time, a hierarchical supervised learning structure is used in the prediction process. The first-layer learner is composed of a variety of complex and heterogeneous base learners, which can obtain the probability distribution of the characteristics affecting the hatching rate of eggs from different aspects, reducing the prediction bias of a single machine learning model. The results predicted by the first-layer learner are 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 results 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 results of hatching rate prediction more robust.
[0174] Then, the present invention uses an explainable machine learning method (SHAP) to analyze the obtained prediction results. SHAP can calculate the influence of each feature on the hatchability of each specific sample data and its direction. From the perspective of individual samples, this method can understand the key features (factors) and their influence directions that affect the hatchability of a certain batch of eggs, so as to carry out fine management of egg hatching in batches. From the perspective of the overall sample, this method can calculate the importance ranking of factors affecting the hatchability of the entire batch of eggs and their directions, so that the hatchery can optimize resource allocation from a global perspective and use limited manpower and material resources on the key factors that affect the hatchability. Therefore, the present invention solves the problems of low hatchability prediction accuracy and poor model generalization ability caused by unbalanced samples, 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 100 to 166 eggs. The original sample set is divided, wherein 833 data samples are divided into a training set, 209 data samples are divided into a validation set, and 695 data samples are divided into a test set. The proportions of high hatching rate samples and low hatching rate samples in the three sets are equal.
[0176] Then, the first layer of learners was constructed using the random forest model, lightweight gradient boosting tree model, and support vector machine model as base learners. The second layer of learners was constructed using the linear regression model. According to the training method described above, the three base learners of the first layer were first trained using the training set and verified using the validation set. The prediction results after verification were used as the feature input of the second layer of learners, and the hatching rate was used as the label for retraining to form the second layer of learners.
[0177] The trained model can then be evaluated using mean square error (MSE), root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), and coefficient of determination (R 2 ) to evaluate the prediction performance of the model. The calculation methods of these evaluation indicators are as follows:
[0178]
[0179]
[0180]
[0181]
[0182]
[0183] Among them, 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, in order to verify the effectiveness and superiority of the embodiments of the present invention, four comparative methods were compared and verified with the methods of the embodiments of the present invention. These four methods use different models to realize the prediction of egg hatching rate, and the data sets used to train these models are also the above-mentioned data sets containing 1737 samples. Among them, the model used in the first comparative method only includes a single RF model, the model used in the second comparative method only includes a single LightGBM, the model used in the third comparative method only includes a single SVR model, and the fourth comparative method adopts a traditional hierarchical learning method, in which the first layer learner includes an RF model, a LightGBM and an SVR model, that is, these three models are used to predict the hatching rate of eggs, and then the prediction results are used as the input features of the second layer to train the second layer model to obtain the final prediction results. The difference between the fourth method and the method proposed in the present invention is that CTGAN is not used to generate new low hatching rate samples to add to the training set of the hierarchical learner, that is, the feature enhancement method is not 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 hatchability prediction models
[0186] Evaluation Metrics 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] It can be seen from Table 1 that the prediction performance of the hierarchical supervised hatchability prediction method based on feature enhancement provided by the embodiment of the present invention is better than the prediction method using a single machine learning model, and is also better than the traditional hierarchical learning method (not using feature enhancement technology).
[0188] In addition, the present invention also provides a method for evaluating the hatchability of eggs. The SHAP method can be used to calculate the importance of the factors affecting the hatchability of each batch of eggs and their influencing directions. The predictive results of the hatchability of a batch of eggs can be analyzed by using SHAP. Figure 7 shown.
[0189] In this figure, the red features play a positive role in hatchability, while the blue features play a negative role in hatchability. The closer the features are to the middle, the greater the impact on hatchability. It can be seen that the baseline value of egg hatchability is 73.24%. The weight uniformity of this batch of eggs reached 89.3%, which is the primary positive factor for improving the hatchability of this batch of eggs, while the long storage time of eggs in the hatchery (13 days) is the primary negative factor for reducing the hatchability of this batch of eggs. Other influencing factors have a relatively small impact on the hatchability of this batch of eggs. The hatchery can conduct targeted inspections (using technologies such as thermal infrared and machine vision) on eggs with large average weight deviations and long storage times in this batch of eggs, rather than inspecting them one by one. Using SHAP to perform interpretable analysis on the prediction results of hatchability of a single batch of eggs can help the hatchery determine the key factors affecting the hatchability of a batch of eggs, and use this as a basis to focus on inspecting the eggs with low hatchability in the batch of eggs, screen out infertile eggs in advance, and reduce hatchery operating costs.
[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 interpretability analysis of the prediction results of the hatchability of all eggs in the embodiment using SHAP.
[0191] Figure 8 The top 20 features are ranked in descending order according to the average of the absolute number of SHAP values of each feature in all samples (the complete definition of the features is shown in Table 1). The different 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 month when the eggs are placed in the incubator and then converted into radians to obtain their Cos and Sin values.
[0192] Each sample is represented by a point. The color of the sample point represents the size 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 hatchability prediction value of the sample (the more to the left, the greater the negative impact), otherwise it has a positive impact (the more to the right, the greater the positive impact).
[0193] From the global interpretation diagram of SHAP values ( Figure 8) shows that biological traits have the most significant impact on egg hatchability, with 14 of the top 20 traits belonging to this category. Among them, 6 traits are breeder strains. Four strains, 4, 15, 16 and 25, have a positive effect on hatchability, while two strains, 10 and 26, have a negative effect on hatchability. Considering the price of hatching eggs, hatcheries can consider purchasing more eggs from high-hatching strains. In addition, hatchability is significantly negatively correlated with breeder age. Hatcheries should optimize the age structure of breeders and determine an appropriate breeder culling age threshold to prevent economic losses due to low hatchability. In addition, egg weight uniformity is positively correlated with hatchability. Therefore, hatcheries should purchase eggs with moderate weight. In addition, breeder farms also have a considerable impact on hatchability. Some breeder farms, such as VDZ and EV, are positively correlated with hatchability, while others, such as VDG and SCH, are negatively correlated with hatchability. Hatcheries can optimize their sources of hatching eggs based on the interpretable results of SHAP and cooperate more with high-quality breeder farms.
[0194] Secondly, environmental characteristics also have a great impact on the hatchability of eggs. A long interval between the time the eggs enter the hatchery and the time they are placed in the incubator, as well as a long storage time of the eggs during the transfer from the incubator to the hatcher, will have a negative impact on the hatchability. This suggests that hatcheries should speed up the hatching turnover efficiency of the eggs to reduce the economic losses caused by the decline in hatchability due to the long storage time of the eggs. In addition, "Month_Cos" is negatively correlated with the hatchability, indicating that the low temperatures in winter and spring are not suitable for hatching. Hatcheries should adjust the number of eggs purchased according to the seasonal fluctuations in the hatchability and changes in market demand.
[0195] Finally, the characteristics of the incubation equipment should also be focused on. In the above example, there is a significant negative correlation between incubator No. 2 and the hatchability. Failure of the incubation equipment will damage the incubation environment, affect the temperature and humidity of the egg incubation and the frequency of egg turning, thereby affecting the normal development of the embryo and reducing the hatchability. Therefore, the hatchery manager can conduct a comprehensive inspection of the incubator to troubleshoot or eliminate the equipment, thereby reducing losses in a timely manner and maintaining the normal operation of the hatchery equipment.
[0196] In summary, based on the limitations of existing egg hatchability prediction and hatching management methods, the embodiment of the present invention proposes an interpretable feature-enhanced hierarchical hatchability prediction method, which not only fully utilizes the advantages of hierarchical supervised learning, but also uses CTGAN to enhance the features of a few samples to improve the prediction accuracy. At the same time, the interpretable machine learning method SHAP is used to perform interpretable analysis on the prediction results, and the importance and direction of the influence of biological characteristics, environmental characteristics and hatching equipment characteristics on the hatchability of a batch of eggs and all eggs are fully explored. This method provides an efficient and reliable method for the accurate prediction of egg hatchability, provides full-cycle decision support for the daily operation of the hatchery, thereby improving the operational management efficiency of the hatchery and reducing resource waste.
[0197] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification. The above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention are included in the scope of protection of the present invention.
Claims
1. A method for constructing an egg hatchability prediction model, characterized in that: include: For multiple batches of eggs, corresponding feature data groups and hatching rates are obtained respectively; wherein each batch of eggs contains a number of eggs; and the feature data group of each batch of eggs contains multiple feature data corresponding to biological features, environmental features, and hatching equipment features; Preprocess the characteristic data groups of each egg batch separately to obtain data samples of the corresponding egg batch, and merge all data samples to obtain the original sample set; Performing augmentation processing on the data samples whose hatching rates are lower than the hatching rate threshold in the original sample set to obtain an augmented sample set; Building 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 in parallel, all used to predict the hatching rate of eggs, and the second layer learner is connected to the output ends of the plurality of base learners and adopts a linear regression model; Based on the augmented sample set and the hatchability of each data sample therein, the original prediction model is trained to obtain a trained egg hatchability prediction model.
2. The method for constructing an egg hatchability prediction model according to claim 1, wherein: In any characteristic data set of an egg batch, The characteristic data corresponding to the biological characteristics include: breeding grade of breeder chickens, breeder chicken strain, breeding farm of breeder chickens, average age of breeder chickens, average egg weight and egg weight uniformity; Characteristic data corresponding to environmental characteristics include: hatching month, storage days, conversion days, and weight loss; The characteristic data corresponding to the hatching equipment characteristics include: number of eggs, incubator number and hatcher number.
3. The method for constructing an egg hatchability prediction model according to claim 2, wherein: For any feature data set, the data preprocessing process includes: Normalizing the continuous characteristic data in the characteristic data group; wherein the continuous characteristic data include the average age of breeder chickens, the average weight of eggs, the uniformity of egg weight, the number of storage days, the number of conversion days, the weight loss and the number of eggs; Performing discrete-to-continuous conversion processing on the cyclical characteristic data in the characteristic data group; wherein the cyclical characteristic data includes hatching months; The categorical feature data in the feature data group is converted into a one-hot encoding; wherein the categorical feature data includes the breeding grade of the breeder chickens, the breeder chicken strain, the breeding farm where the breeder chickens come from, the incubator number and the hatcher number.
4. The method for constructing an egg hatchability prediction model according to claim 1, wherein: The data samples in the original sample set whose hatching rates are lower than the hatching rate threshold are augmented to obtain an augmented sample set, including: For data samples in the original sample set whose hatching rates are lower than a hatching rate threshold, a conditional generative adversarial network is used to generate similar data samples, and all the obtained similar data samples are added to the original sample set to obtain an augmented sample set.
5. The method for constructing an egg hatchability prediction model according to claim 1, wherein: 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.
6. The method for constructing an egg hatchability prediction model according to claim 1, wherein: Based on the augmented sample set and the hatchability of each data sample therein, the original prediction model is trained to obtain a trained egg hatchability prediction model, including: Using the augmented sample set and the hatching rate of each data sample therein, each base learner in the first layer learner is trained separately in a multi-fold cross-validation manner to obtain each trained base learner; The multi-fold mean of the hatchability prediction values of the trained base learners for the data samples is used as input data, and the hatchability of the data samples is used to train the second-layer learners. The trained second-layer learners and the trained first-layer learners constitute an egg hatchability prediction model.
7. A method for evaluating the hatchability characteristics of eggs, characterized in that: include: Obtaining an egg hatchability prediction model and data samples of each egg batch used in the egg hatchability prediction model training process; wherein the egg hatchability prediction model is obtained by using the egg hatchability prediction model construction method according to any one of claims 1 to 6; For each batch of eggs, the SHAP method is used to calculate the marginal contribution value of each characteristic data in the characteristic data group of the egg batch to the hatching rate, so as to perform the impact analysis of the characteristic data in the egg batch; wherein the marginal contribution value represents the impact of the characteristic data on the hatching rate of the egg batch, which is divided into positive impact and negative impact; For each type of characteristic data, calculate the average marginal contribution value of this type of characteristic data in all egg batches, and use the average marginal contribution value calculated for each type of characteristic data to conduct an impact analysis of the characteristic data in all egg batches.
8. The method for evaluating the hatchability of eggs according to claim 7, characterized in that: The average marginal contribution value calculated using various characteristic data is used to perform an impact analysis of the characteristic data in all egg batches, including: A scatter plot is drawn based on the average marginal contribution value of each type of characteristic data, and the importance and direction of the impact of each type of characteristic data on the hatching rate of all egg batches are analyzed.
9. A method for predicting the hatchability of eggs, characterized in that: include: Acquire a characteristic data group of a target egg batch; wherein the characteristic data group contains a plurality of characteristic data corresponding to biological characteristics, environmental characteristics, and incubation equipment characteristics; After data preprocessing of the characteristic data group of the target egg batch, the pre-trained egg hatching rate prediction model is input to obtain the predicted hatching rate of the target egg batch; wherein the egg hatching rate prediction model is obtained according to the egg hatching rate prediction model construction method according to any one of claims 1-6.
10. The method for predicting the hatchability of eggs according to claim 9, characterized in that: After obtaining the predicted hatchability of the target egg batch, the egg hatchability prediction method further includes: For the target egg batch, the SHAP method is used to calculate the marginal contribution value of each characteristic data in its characteristic data group to the hatching rate, so as to perform an impact analysis of the characteristic data within the target egg batch; wherein the marginal contribution value represents the impact of the characteristic data on the hatching rate of the target egg batch, which is divided into positive impact and negative impact.
Citation Information
Patent Citations
Visible near infrared spectrum-based establishment method of hatching early-stage fertilized hatching egg discrimination model
CN111476320A
Non-destructive testing method for sex of hatching early-stage embryonated egg based on RF-DS spectrum information fusion
CN115187514A
Hatching egg incubation intelligent management system and method capable of achieving comprehensive monitoring
CN117356478A
Hatching egg nondestructive detection method and fertilization information detection system
CN117502303A
Method for improving weight loss control of an egg in a controlled incubation or storage environment, particularly for eggs of galliforms
WO2008141846A1
