Livestock character observation model training method and device, equipment and storage medium
By constructing a livestock trait observation model and employing multidimensional feature extraction and fusion methods, the problem of insufficient information utilization in traditional pig breeding was solved, thereby improving prediction accuracy and selection accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-04-10
AI Technical Summary
Traditional pig breeding methods rely on phenotypic data and simple genetic assessments, resulting in insufficient information utilization and limited selection accuracy. In particular, statistical reliability is reduced in multi-line and small-sample scenarios, and it is difficult to balance the improvement of genetic antagonism when selecting multiple traits.
By constructing a livestock trait observation model, multi-dimensional scale feature extraction and feature fusion methods are adopted. Combined with livestock genome data, family data and environmental data, gene features and environmental features are extracted using the first and second feature extraction layers, respectively, and then fused and trained to generate predictive trait labels.
It improved the prediction accuracy of livestock trait observation models, enhanced their ability to learn from genetic, pedigree, and environmental characteristics, and improved the accuracy of model training and prediction.
Smart Images

Figure CN121834671A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of computer, in particular to a livestock trait observation model training method and device, equipment and storage medium. BACKGROUND
[0002] Current pig breeding practices face multiple technical bottlenecks. Traditional selection methods mainly rely on phenotypic data and simple genetic evaluation, which has the problems of insufficient information utilization and limited selection accuracy. Especially in the context of multiple families and small sample sizes, the phenotypic records of individual families are limited, resulting in reduced statistical reliability. In multi-trait selection, there are often genetic antagonistic relationships between economic traits, making it difficult to achieve balanced improvement. Existing technical solutions are mostly based on linear mixed models or traditional genomic selection methods, which have obvious shortcomings in handling high-dimensional genomic data, integrating multi-source heterogeneous information, and simulating complex genetic interactions. SUMMARY
[0003] The present application provides a livestock trait observation model training method, device, equipment and storage medium to improve the prediction accuracy of livestock trait prediction.
[0004] According to an aspect of the present application, a livestock trait observation model training method is provided, which comprises:
[0005] Obtaining historical livestock data of a target livestock, and constructing livestock sample data based on the historical livestock data; the livestock sample data includes livestock genomic data, livestock family data and livestock environmental data, and at least one real trait label;
[0006] Respectively extracting features from the livestock genomic data through a first feature extraction layer and a second feature extraction layer to obtain first livestock genetic features and second livestock genetic features; the first feature extraction layer is different from the second feature extraction layer;
[0007] Respectively extracting features from the livestock family data and the livestock environmental data to generate livestock environmental features and livestock family features;
[0008] Fusing the extracted first livestock genetic features and livestock environmental features to obtain first fusion features, and fusing the extracted second livestock genetic features and livestock family features to obtain second fusion features;
[0009] Performing trait prediction according to the first fusion features and the second fusion features to obtain predicted trait labels, and performing model training according to the predicted trait labels and real trait labels to obtain a livestock trait observation model.
[0010] According to another aspect of this application, a training apparatus for a livestock trait observation model is provided, the apparatus comprising:
[0011] The data acquisition module is used to acquire historical livestock data of the target livestock and construct livestock sample data based on the historical livestock data; the livestock sample data includes livestock genome data, livestock pedigree data, and livestock environmental data, as well as at least one real trait label;
[0012] The first feature extraction module is used to extract features from the livestock genome data through a first feature extraction layer and a second feature extraction layer to obtain first livestock gene features and second livestock gene features; the first feature extraction layer and the second feature extraction layer are different.
[0013] The second feature extraction module is used to extract features from the livestock pedigree data and livestock environment data respectively, and generate livestock environment features and livestock pedigree features.
[0014] The feature fusion module is used to fuse the extracted first livestock gene features with livestock environmental features to obtain a first fused feature, and to fuse the extracted second livestock gene features with livestock pedigree features to obtain a second fused feature.
[0015] The model training module is used to predict trait labels by performing trait prediction based on the first fusion feature and the second fusion feature, and to train the model based on the predicted trait labels and the true trait labels to obtain a livestock trait observation model.
[0016] According to another aspect of this application, an electronic device is provided, the electronic device comprising:
[0017] One or more processors;
[0018] Memory, used to store one or more programs;
[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement any of the training methods for livestock trait observation models provided in the embodiments of this application.
[0020] According to another aspect of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements a training method for any of the livestock trait observation models provided in the embodiments of this application.
[0021] According to another aspect of this application, a computer program product is provided, including a computer program that, when executed by a processor, implements a training method for any of the livestock trait observation models provided in the embodiments of this application.
[0022] This application extracts features from livestock gene data at multiple scales and fuses these features with pedigree and environmental features, increasing the feature dimensions of the sample features used in model training. This enables the livestock trait observation model to learn multi-scale gene features and the influence of pedigree and environmental features on genes during training, thereby improving the training accuracy of the livestock trait observation model and, consequently, the prediction accuracy of the livestock trait observation model. Attached Figure Description
[0023] Figure 1 This is a flowchart of a training method for a livestock trait observation model provided in Embodiment 1 of this application;
[0024] Figure 2 This is a flowchart of a training method for a livestock trait observation model provided in Embodiment 2 of this application;
[0025] Figure 3 This is a flowchart of a training method for a livestock trait observation model provided in Embodiment 3 of this application;
[0026] Figure 4 This is a schematic diagram of the structure of a training device for a livestock trait observation model provided in Embodiment 4 of this application;
[0027] Figure 5 This is a schematic diagram of the structure of an electronic device for implementing the training method of the livestock trait observation model of Embodiment 5 of this application. Detailed Implementation
[0028] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0030] Example 1
[0031] Figure 1 This is a flowchart of a training method for a livestock trait observation model according to Embodiment 1 of this application. This embodiment is applicable to situations where a model for predicting livestock traits is constructed based on historical livestock data. The method can be executed by a training device for the livestock trait observation model, which can be implemented in hardware and / or software and can be configured in a computer device, such as a server. Figure 1 As shown, the method includes:
[0032] S110. Obtain historical livestock data of the target livestock and construct livestock sample data based on the historical livestock data.
[0033] Historical livestock data may include livestock genome data, livestock pedigree data, livestock environmental data, and livestock morphology data. Livestock sample data may include livestock genome data, livestock pedigree data, livestock environmental data, and at least one true trait label.
[0034] Optionally, in this embodiment of the invention, historical livestock data may be derived from 1,000 individual livestock, 5,000 SNP (Single Nucleotide Polymorphism) loci, 10 livestock families, 2 types of livestock rearing environments, and 4 livestock traits: offspring number, survival rate, growth rate, and feed efficiency.
[0035] It should be noted that SNP loci are used to record the allele combinations of an individual livestock at that locus. A standard 0-1-2 coding system can be used to encode genomic data; for example, 0 represents a homozygous reference allele (AA), 1 represents a heterozygous allele (AB), and 2 represents a homozygous alternative allele (BB). Livestock pedigree data are used to record the kinship and family affiliation of individual livestock. Livestock environmental data are used to characterize non-genetic effects such as feeding and management conditions, including environmental factors such as feeding location, temperature, humidity, feed type, feeding space, and light duration. Optionally, after obtaining historical livestock data, data standardization can be performed to eliminate the influence of different dimensions between data points. Missing data can be imputed using averages.
[0036] Optionally, historical livestock data of the target livestock is acquired, and livestock sample data is constructed based on the historical livestock data, including: generating a gene data table based on livestock genome data; wherein the gene data table includes livestock sample identifiers and corresponding gene data codes of the livestock samples; generating a pedigree data table based on livestock pedigree data; wherein the pedigree data table includes livestock pedigree identifiers and livestock sample identifiers, used to characterize the blood relationship within the pedigree to which the livestock sample belongs; generating an environmental data table based on livestock environmental data; wherein the environmental data table is used to characterize the feeding environment of livestock samples in each pedigree; generating a sample label table based on livestock pedigree data, livestock environmental data, and livestock trait data; wherein the sample label table is used to characterize the actual breeding trait performance of each livestock sample in its feeding environment under different pedigrees; the gene data table, pedigree data table, environmental data table, and sample label table establish a mapping relationship through livestock sample identifiers and livestock pedigree identifiers.
[0037] For example, a genetic data table can be shown in Table 1, a pedigree data table can be shown in Table 2, and an environmental data table can be shown in Table 3.
[0038] Table 1
[0039]
[0040] Table 2
[0041]
[0042] Table 3
[0043]
[0044] It should be noted that a corresponding number of pedigree data tables can be established based on the number of family types to record the parent information and family affiliation of each individual livestock, thus maintaining appropriate genetic diversity. In the pedigree data table, 0 represents the original parent of this livestock family.
[0045] Optionally, in this embodiment of the invention, the genotype data can also be enhanced based on a pre-established gene data annotation table. For example, the gene enhancement process can be performed using the following formula:
[0046] ;
[0047] in, Let be the gene encoding the j-th SNP site in the i-th livestock individual. The functional annotation weights are assigned to the j-th SNP site.
[0048] It should be noted that each SNP locus in the gene data annotation table is annotated with its color-coded location and functional information. Optionally, the functional annotation can be determined based on prior biological knowledge. For example, the functional annotation weights corresponding to SNP loci can be determined as follows: High-weight SNP loci (0.7-1.0) correspond to known causal variation sites: 1. located in the gene coding region, 2. located in the regulatory region, 3. known QTL (Quantitative Trait Locus) genes, 4. evolutionarily conserved regions; Medium-weight SNP loci (0.3-0.6) correspond to potential functional regions: 1. intron regions, 2. distal regulatory regions, 3. linkage disequilibrium with other functional SNPs; Low-weight SNPs (0.0-0.2) correspond to possible neutral variations: 1. intergenic regions, 2. repetitive sequence regions, 3. evolutionarily non-conserved regions. By performing gene augmentation on the genotype data, the biological rationality is improved, and the interference of non-functional variations is reduced through noise suppression mechanisms, thereby improving the data quality and ultimately enhancing the training effect of the model.
[0049] S120. The first livestock gene features and the second livestock gene features are obtained by extracting features from the livestock genome data through the first feature extraction layer and the second feature extraction layer, respectively.
[0050] The first feature extraction layer differs from the second feature extraction layer. Specifically, the first feature extraction layer comprises a first convolutional layer and a second convolutional layer connected in series, while the second feature extraction layer comprises a third convolutional layer, a fourth convolutional layer, and a fifth convolutional layer connected in parallel. The first and second feature extraction layers are also connected in parallel.
[0051] It should be noted that, in the embodiments of the present invention, those skilled in the art can adaptively determine the feature pooling layer to perform feature pooling processing on the feature parameters output by the convolutional layer based on the feature parameters output by the convolutional layer.
[0052] S130. Extract features from livestock pedigree data and livestock environment data respectively to generate livestock environment features and livestock pedigree features.
[0053] It should be noted that for each type of environmental factor in the livestock environmental data, the data for each type of environmental factor can be integrated into an environmental data vector. Then, feature mapping can be performed on the environmental data vector and its corresponding feeding environment identifier to generate livestock environmental features, for example, through feature learning using the `Embedding()` function. Similarly, the `Embedding()` function is also used to perform feature learning on the pedigree data of each family in the livestock pedigree data to generate livestock pedigree features. It should be noted that the feature dimensions of the livestock environmental features must be consistent with the first livestock genetic feature, and the feature dimensions of the livestock pedigree features must be consistent with the second livestock genetic feature.
[0054] S140. The extracted first livestock gene features are fused with the livestock environmental features to obtain the first fused feature, and the extracted second livestock gene features are fused with the livestock pedigree features to obtain the second fused feature.
[0055] Optionally, the feature fusion methods for the first livestock genetic feature and the livestock environmental feature, as well as the feature fusion methods for the second livestock genetic feature and the livestock pedigree feature, can be adapted to the needs of those skilled in the art. For example, a linear splicing method can be used for feature fusion. It should be noted that the livestock environmental features corresponding to the livestock genome data belonging to the same livestock individual are the same, and the livestock pedigree features corresponding to the livestock genome data of livestock individuals belonging to the same livestock pedigree are the same.
[0056] For example, the feature fusion process of the first livestock genetic characteristics and livestock environmental characteristics can be represented by the following formula:
[0057] ;
[0058] ;
[0059] in, G represents the first fusion trait, and G represents the first livestock gene trait. For the characteristics of the livestock environment, To fuse the weight matrix, Here, is the bias vector, and ReLU is the activation function. To prevent overfitting of parameters, BN() is a normalization function used to perform a linear transformation on the features. and These are learnable scaling and translation parameters.
[0060] S150. Based on the first fusion feature and the second fusion feature, predict the trait to obtain the predicted trait label, and train the model based on the predicted trait label and the real trait label to obtain the livestock trait observation model.
[0061] Optionally, predicting the predicted trait label based on the first fusion feature and the second fusion feature includes: fusing the first fusion feature and the second fusion feature to generate a target fusion feature; and inputting the target fusion feature into a classifier in the trait observation model to generate a predicted trait label.
[0062] Among them, target fusion features can refer to feature data carrying multiple dimensions such as livestock pedigree, livestock environment and livestock genes.
[0063] It should be noted that, in the embodiments of the present invention, multiple different livestock traits can be treated as a unified label vector, and a classifier can be used to output the predicted trait label vector. Alternatively, a sub-classifier with the same number of livestock trait types can be used to output the label for each predicted trait separately.
[0064] Optionally, in this embodiment of the invention, the objective loss function for the training process of the livestock trait observation model can be optimized by using a dimensional loss function in conjunction with other loss functions. For example, the objective loss function can be weight 1 × prediction loss + weight 2 × dynamic trait trade-off score. It should be noted that the prediction loss can be used to characterize the deviation between the predicted trait label and the true trait label, and can be determined using mean squared error; the dynamic trait trade-off score can refer to the regularization term introduced in each training process.
[0065] By constructing a multi-dimensional target loss function, the training accuracy of the model can be further improved.
[0066] Optionally, the dynamic trait trade-off score can be determined using the following formula:
[0067] ;
[0068] ;
[0069] ;
[0070] ;
[0071] ;
[0072] Where G is the dynamic trait trade-off score, For family diversity score, Trait index, The trait equilibrium index is F, where F is the number of livestock pedigrees present in the livestock sample data. Used to represent the genetic distance between pedigrees f and k, where T is the number of different breeding traits in the livestock sample data. For the j-th trait corresponding to the i-th livestock sample, the standardized predicted trait label is... Let j be the trait weight of the j-th trait. The trait weight of the j-th trait corresponding to the i-th livestock sample.
[0073] This application embodiment extracts features from livestock gene data at multiple scales and fuses gene features with pedigree features and environmental features respectively, increasing the feature dimension of the sample features participating in model training. This enables the livestock trait observation model to learn multi-scale gene features and the influence of pedigree features and environmental features on genes during training, thereby improving the training accuracy of the livestock trait observation model and thus improving the prediction accuracy of the livestock trait observation model.
[0074] Example 2
[0075] Figure 2 This is a flowchart of a training method for a livestock trait observation model according to Embodiment 2 of this application. Based on the technical solutions of the above embodiments, this embodiment refines the step of "extracting features from the livestock genome data through a first feature extraction layer and a second feature extraction layer to obtain first and second livestock gene features," further describing the feature extraction process of the first and second feature extraction layers. It should be noted that for parts not detailed in this embodiment, please refer to the relevant descriptions in other embodiments. Figure 2 As shown, the method includes:
[0076] S210. Input the livestock genome data into the first convolutional layer to perform the first feature extraction operation, and output the first feature extraction parameters.
[0077] S220. Input the first feature extraction parameters into the second convolutional layer to perform the second feature extraction operation and output the first livestock gene features.
[0078] The kernel size of the first convolutional layer is larger than that of the second convolutional layer.
[0079] By employing a progressive convolutional architecture, the hierarchical structure of the genome is simulated, and effective feature information is gradually extracted from local haplotype patterns to global feature combinations.
[0080] S230. Input the livestock genome data into the third, fourth and fifth convolutional layers respectively, and perform feature extraction operations on the livestock genome data in parallel to generate the third feature extraction parameters, the fourth feature extraction parameters and the fifth feature extraction parameters.
[0081] S240. The third feature extraction parameter, the fourth feature extraction parameter, and the fifth feature extraction parameter are spliced together to generate the second livestock gene feature.
[0082] In this embodiment of the invention, the third, fourth, and fifth convolutional layers are convolutional layers with different kernel sizes. For example, the kernel size of the third convolutional layer is 50, the kernel size of the fourth convolutional layer is 100, and the kernel size of the fifth convolutional layer is 200. Through these three parallel convolutional layers, multi-scale parallel feature extraction is performed on livestock genome data, including gene features such as short-range linkage disequilibrium, mid-range haplotype blocks, and long-range epistatic interactions. It should be noted that the feature dimensions of the feature parameters output by the third, fourth, and fifth convolutional layers are the same. The feature parameters output by the third, fourth, and fifth convolutional layers can be linearly concatenated to generate a second livestock gene feature. For example, if the feature dimensions of the feature parameters output by the third, fourth, and fifth convolutional layers are all 180, then the feature dimension of the linearly concatenated second livestock gene feature is 480.
[0083] Optionally, in this embodiment of the invention, the second livestock gene features can be further fused with the livestock genome data. This involves learning the complex interactions between the original features and multi-scale features through nonlinear transformations and compressing them into a low-dimensional representation, thus fully integrating the complementary information of the original genome features and the multi-scale convolutional features. For example, the process of fusing the second livestock gene features with the livestock genome data can be represented by the following formula:
[0084] ;
[0085] in, The feature is the result of fusing the second livestock gene characteristic with the livestock genome data, where X is the livestock genome data. This is a second livestock gene characteristic; MLP is a multilayer sensing mechanism.
[0086] This application embodiment employs a first feature layer and a second feature layer to perform parallel feature extraction on livestock genome data, extracting feature information at different scales from the livestock genome data, fully exploring the data value of the livestock genome data, providing data support for the subsequent model training process, and improving prediction reliability.
[0087] Example 3
[0088] Figure 3 This is a flowchart of a training method for a livestock trait observation model according to Embodiment 3 of this application. Based on the technical solutions of the above embodiments, this embodiment further refines the "feature extraction from livestock pedigree data," providing an optional method for extracting pedigree features. It should be noted that for parts not detailed in this embodiment, please refer to the relevant descriptions in other embodiments. Figure 3 As shown, the method includes:
[0089] S310. Group the livestock pedigree data according to different livestock pedigree identifiers to generate at least one livestock pedigree group.
[0090] S320. Determine the types of pedigree data in each livestock pedigree group, and select the livestock pedigree group with the most types of pedigree data as the target livestock pedigree group.
[0091] S330. Based on the types of pedigree data in the target livestock pedigree group, fill in the livestock pedigree data in the other livestock pedigree groups so that the types of pedigree data are the same in different livestock family groups.
[0092] S340. Using a multi-head self-attention mechanism, feature extraction is performed on the livestock pedigree data in each livestock family group after filling, and the corresponding livestock pedigree features of each livestock family group are determined.
[0093] In this embodiment of the invention, livestock pedigree data can be grouped according to livestock pedigree identifiers to generate livestock pedigree groups. Different livestock pedigree groups have different livestock pedigree identifiers. The types of pedigree data within each livestock family group are calculated, and the livestock family group with the largest number of pedigree data types is determined as the target livestock family group. Based on the types of pedigree data within the target livestock family group, the livestock pedigree data in the remaining livestock family groups is filled with different types of pedigree data to make the types of pedigree data in different livestock family groups the same. A corresponding filling mask is established for each livestock family group to identify the position of the filled livestock pedigree data. For example, the position mask of the filled data is 1, and the position mask of the real data is 0.
[0094] A multi-head self-attention mechanism is employed to extract features from the pedigree data of each livestock family group after infilling. Each head can focus on different relationship feature patterns, capturing complex feature relationships (such as parent-child and sibling relationships) between individuals within each livestock family, thus achieving deep semantic modeling of pedigree features and determining the corresponding livestock pedigree features for each livestock family group. Furthermore, for each livestock family group, feature fusion can be performed on the livestock genome features within the group based on its corresponding pedigree features, propagating pedigree-level features back to the individual level, enabling each livestock sample data to obtain enhanced pedigree relationship features.
[0095] This application embodiment adopts a multi-head self-attention mechanism to adaptively learn the relationship characteristics between sample individuals within a family, generates livestock family characteristics, and back-transmits the genetic characteristics of sample individuals within each livestock family group based on the livestock family characteristics, so that each sample individual integrates the information characteristics of the whole family, which helps to improve the richness and accuracy of sample individual characteristics.
[0096] Example 4
[0097] Figure 4 This is a schematic diagram of a training device for a livestock trait observation model according to Embodiment 4 of this application. It is applicable to situations where a model for predicting livestock traits is constructed based on historical livestock data. The training device for this livestock trait observation model can be implemented in hardware and / or software, and can be configured in a computer device, such as a server. Figure 4 As shown, the device includes:
[0098] The data acquisition module 410 is used to acquire historical livestock data of the target livestock and construct livestock sample data based on the historical livestock data; the livestock sample data includes livestock genome data, livestock pedigree data and livestock environmental data, as well as at least one real trait label;
[0099] The first feature extraction module 420 is used to extract features from the livestock genome data through a first feature extraction layer and a second feature extraction layer to obtain first livestock gene features and second livestock gene features, respectively; the first feature extraction layer and the second feature extraction layer are different.
[0100] The second feature extraction module 430 is used to extract features from the livestock pedigree data and the livestock environment data respectively, and generate livestock environment features and livestock pedigree features.
[0101] The feature fusion module 440 is used to fuse the extracted first livestock gene features with the livestock environmental features to obtain a first fused feature, and to fuse the extracted second livestock gene features with the livestock pedigree features to obtain a second fused feature.
[0102] The model training module 450 is used to predict trait labels by performing trait prediction based on the first fusion feature and the second fusion feature, and to train the model based on the predicted trait labels and the true trait labels to obtain a livestock trait observation model.
[0103] This application embodiment extracts features from livestock gene data at multiple scales and fuses gene features with pedigree features and environmental features respectively, increasing the feature dimension of the sample features participating in model training. This enables the livestock trait observation model to learn multi-scale gene features and the influence of pedigree features and environmental features on genes during training, thereby improving the training accuracy of the livestock trait observation model and thus improving the prediction accuracy of the livestock trait observation model.
[0104] Optionally, the first feature extraction layer includes a first convolutional layer and a second convolutional layer.
[0105] Optionally, the first feature extraction module 420 includes:
[0106] The first feature extraction unit is used to input the livestock genome data into the first convolutional layer to perform the first feature extraction operation and output the first feature extraction parameters.
[0107] The second feature extraction unit is used to input the first feature extraction parameters into the second convolutional layer to perform the second feature extraction operation and output the first livestock gene features.
[0108] Optionally, the second feature extraction layer includes a third convolutional layer, a fourth convolutional layer, and a fifth convolutional layer.
[0109] Optionally, the first feature extraction module 420 further includes:
[0110] The third feature extraction unit is used to input the livestock genome data into the third convolutional layer, the fourth convolutional layer and the fifth convolutional layer respectively, and to perform feature extraction operations on the livestock genome data in parallel to generate the third feature extraction parameters, the fourth feature extraction parameters and the fifth feature extraction parameters.
[0111] The multi-scale feature fusion unit is used to splice the third feature extraction parameters, the fourth feature extraction parameters, and the fifth feature extraction parameters to generate the second livestock gene feature.
[0112] Optionally, the second feature extraction module 430 includes:
[0113] A pedigree grouping unit is used to group livestock genome data into pedigrees according to different livestock pedigree identifiers, generating at least one livestock pedigree group.
[0114] The target pedigree determination unit is used to determine the number of genes in the livestock genome data of each livestock pedigree group, and the livestock pedigree group with the largest number of gene data is selected as the target livestock pedigree group.
[0115] Gene filling units are used to fill the gene data in other livestock pedigrees based on the amount of gene data in the target livestock pedigree, so that the amount of genomic data in different livestock family groups is the same.
[0116] The pedigree feature determination unit is used to extract features from the livestock genome data of each livestock family group after filling in the data using a multi-head self-attention mechanism, and to determine the pedigree features of each livestock family group.
[0117] Optionally, the model training module 450 may be specifically used to: fuse the first fusion feature and the second fusion feature to generate a target fusion feature; and input the target fusion feature into the classifier in the trait observation model to generate a predicted trait label.
[0118] Optionally, the data acquisition module 410 includes:
[0119] A gene table unit is used to generate a gene data table based on the livestock genome data; wherein the gene data table includes livestock sample identifiers and gene data codes corresponding to the livestock samples;
[0120] A pedigree table unit is used to generate a pedigree data table based on the livestock pedigree data; wherein, the pedigree data table includes livestock pedigree identifiers and livestock sample identifiers, used to characterize the blood relationship within the pedigree to which the livestock sample belongs;
[0121] An environment table unit is used to generate an environment data table based on the livestock environment data; wherein the environment data table is used to characterize the feeding environment of livestock samples in each family.
[0122] The trait table unit is used to generate a sample label table based on the livestock pedigree data, the livestock environment data, and the livestock trait data; wherein, the sample label table is used to characterize the actual breeding trait performance of each livestock sample under different pedigrees in its feeding environment; the gene data table, the pedigree data table, the environment data table, and the sample label table establish a mapping relationship through livestock sample identifiers and livestock pedigree identifiers.
[0123] The training device for the livestock trait observation model provided in this application embodiment can execute the training method of the livestock trait observation model provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the training method of each livestock trait observation model.
[0124] According to embodiments of this application, this application also provides an electronic device, a readable storage medium, and a computer program product.
[0125] Example 5
[0126] Figure 5 This is a schematic diagram of the structure of an electronic device 510 implementing the training method of the livestock trait observation model according to embodiments of this application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present application described and / or claimed herein.
[0127] like Figure 5 As shown, the electronic device 510 includes at least one processor 511 and a memory, such as a read-only memory 512 or a random access memory 513, communicatively connected to the at least one processor 511. The memory stores computer programs executable by the at least one processor. The processor 511 can perform various appropriate actions and processes based on the computer program stored in the read-only memory 512 or loaded from storage unit 518 into the random access memory 513. The random access memory 513 can also store various programs and data required for the operation of the electronic device 510. The processor 511, read-only memory 512, and random access memory 513 are interconnected via a bus 514. An input / output interface 515 is also connected to the bus 514.
[0128] Multiple components in electronic device 510 are connected to input / output interface 515, including: input unit 516, such as keyboard, mouse, etc.; output unit 517, such as various types of monitors, speakers, etc.; storage unit 518, such as disk, optical disk, etc.; and communication unit 519, such as network card, modem, wireless transceiver, etc. Communication unit 519 allows electronic device 510 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0129] Processor 511 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 511 include, but are not limited to, central processing units, graphics processing units, various special-purpose artificial intelligence computing chips, various processors running machine learning model algorithms, digital signal processors, and any suitable processor, controller, microcontroller, etc. Processor 511 performs the various methods and processes described above, such as training methods for livestock trait observation models.
[0130] In some embodiments, the training method for the livestock trait observation model can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 518. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 510 via read-only memory 512 and / or communication unit 519. When the computer program is loaded into random access memory 513 and executed by processor 511, one or more steps of the training method for the livestock trait observation model described above can be performed. Alternatively, in other embodiments, processor 511 can be configured as the training method for the livestock trait observation model by any other suitable means (e.g., by means of firmware).
[0131] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays, application-specific integrated circuits (ASICs), application-specific standard products (ASICs), systems-on-a-chip (SoCs), payload programmable logic devices, computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0132] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to the processor of a general-purpose computer, a special-purpose computer, or other training device for a programmable livestock trait observation model, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0133] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, optical fibers, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0134] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a cathode ray tube or liquid crystal display monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0135] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0136] A computing system can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product within the cloud computing service system to address the shortcomings of traditional physical hosts and virtual private servers, such as high management difficulty and weak business scalability.
[0137] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this application can be achieved, and this is not limited herein.
[0138] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A training method for a livestock trait observation model, characterized in that, include: Historical livestock data of the target livestock is obtained, and livestock sample data is constructed based on the historical livestock data; the livestock sample data includes livestock genome data, livestock pedigree data, and livestock environmental data, as well as at least one real trait label; The livestock genome data is subjected to feature extraction through a first feature extraction layer and a second feature extraction layer to obtain first livestock gene features and second livestock gene features; the first feature extraction layer and the second feature extraction layer are different. Feature extraction is performed on the livestock pedigree data and livestock environment data respectively to generate livestock environment features and livestock pedigree features; The extracted first livestock genetic features are fused with livestock environmental features to obtain the first fused feature, and the extracted second livestock genetic features are fused with livestock pedigree features to obtain the second fused feature. Based on the first fusion feature and the second fusion feature, trait prediction is performed to obtain predicted trait labels, and based on the predicted trait labels and the actual trait labels, a model is trained to obtain a livestock trait observation model.
2. The method according to claim 1, characterized in that, The first feature extraction layer includes a first convolutional layer and a second convolutional layer; Accordingly, feature extraction is performed on the livestock genome data through a first feature extraction layer, including: The livestock genome data is input into the first convolutional layer to perform the first feature extraction operation, and the first feature extraction parameters are output. The first feature extraction parameters are input into the second convolutional layer to perform the second feature extraction operation, and the first livestock gene features are output.
3. The method according to claim 1, characterized in that, The second feature extraction layer includes a third convolutional layer, a fourth convolutional layer, and a fifth convolutional layer; Accordingly, the second feature extraction layer for feature extraction of the livestock genome data also includes: The livestock genome data is input into the third, fourth, and fifth convolutional layers respectively, and feature extraction operations are performed on the livestock genome data in parallel to generate the third, fourth, and fifth feature extraction parameters. The third feature extraction parameter, the fourth feature extraction parameter, and the fifth feature extraction parameter are spliced together to generate the second livestock gene feature.
4. The method according to claim 1, characterized in that, Feature extraction from livestock pedigree data includes: The livestock pedigree data are grouped according to different livestock pedigree identifiers to generate at least one livestock pedigree group. Determine the types of pedigree data in each livestock pedigree group, and select the livestock pedigree group with the most types of pedigree data as the target livestock pedigree group. Based on the types of pedigree data in the target livestock pedigree group, fill in the livestock pedigree data in the other livestock pedigree groups to make the types of pedigree data the same in different livestock family groups. A multi-head self-attention mechanism is used to extract features from the livestock pedigree data in each livestock family group after filling, and to determine the corresponding livestock pedigree features for each livestock family group.
5. The method according to claim 1, characterized in that, Based on the first fusion feature and the second fusion feature, trait prediction is performed to obtain predicted trait labels, including: The first fusion feature and the second fusion feature are fused to generate the target fusion feature; The target fusion features are input into the classifier in the trait observation model to generate predicted trait labels.
6. The method according to claim 1, characterized in that, Obtain historical livestock data for the target livestock, and construct livestock sample data based on the historical livestock data, including: Gene data table is generated based on the livestock genome data; wherein, the gene data table includes livestock sample identifiers and the gene data codes corresponding to the livestock samples; A pedigree data table is generated based on the livestock pedigree data; wherein, the pedigree data table includes livestock pedigree identifiers and livestock sample identifiers, used to characterize the blood relationship within the pedigree to which the livestock sample belongs; An environmental data table is generated based on the livestock environmental data; wherein the environmental data table is used to characterize the feeding environment of livestock samples in each family. A sample label table is generated based on the livestock pedigree data, the livestock environment data, and the livestock trait data; wherein, the sample label table is used to characterize the actual breeding trait performance of each livestock sample under its feeding environment in different pedigrees; the gene data table, the pedigree data table, the environment data table, and the sample label table establish a mapping relationship through livestock sample identifiers and livestock pedigree identifiers.
7. A training device for a livestock trait observation model, characterized in that, include: The data acquisition module is used to acquire historical livestock data of the target livestock and construct livestock sample data based on the historical livestock data; the livestock sample data includes livestock genome data, livestock pedigree data, and livestock environmental data, as well as at least one real trait label; The first feature extraction module is used to extract features from the livestock genome data through a first feature extraction layer and a second feature extraction layer to obtain first livestock gene features and second livestock gene features; the first feature extraction layer and the second feature extraction layer are different. The second feature extraction module is used to extract features from the livestock pedigree data and livestock environment data respectively, and generate livestock environment features and livestock pedigree features. The feature fusion module is used to fuse the extracted first livestock gene features with livestock environmental features to obtain a first fused feature, and to fuse the extracted second livestock gene features with livestock pedigree features to obtain a second fused feature. The model training module is used to predict trait labels by performing trait prediction based on the first fusion feature and the second fusion feature, and to train the model based on the predicted trait labels and the true trait labels to obtain a livestock trait observation model.
8. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the training method for the livestock trait observation model as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the training method for the livestock trait observation model as described in any one of claims 1-6.
10. A computer program product comprising a computer program that, when executed by a processor, implements a training method for a livestock trait observation model according to any one of claims 1-6.