Variety identification method, system and terminal based on ensemble learning
By preprocessing and model building of molecular genetic marker data from variety databases using ensemble learning methods, the subjectivity and accuracy issues of variety identification in existing technologies are resolved, enabling efficient and automated variety identification and pedigree inference.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI BIOCHIP
- Filing Date
- 2022-12-12
- Publication Date
- 2026-06-05
AI Technical Summary
Existing methods for variety identification rely on phenotypic characteristics, making it difficult to distinguish closely related varieties. The judgments are subjective and lack scientific basis, making it difficult to quantitatively measure the degree of purity.
An ensemble learning-based approach was adopted. Molecular genetic marker data from a variety database were preprocessed to construct a feature data matrix, classifiers were selected, and a prediction model was built. The ensemble classifier was then used for variety identification.
It achieves highly accurate, rapid, automated, and transferable variety identification and pedigree inference, enabling scientific and accurate differentiation of varieties and determination of purebred degree.
Smart Images

Figure CN116168766B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of variety identification, and in particular to a variety identification method, system and terminal based on ensemble learning. Background Technology
[0002] Variety identification refers to the process of evaluating artificially bred populations that possess certain morphological characteristics and productive traits. It plays an extremely important role in plant genetics and breeding, seedling propagation, and the purebred breeding of cats and dogs.
[0003] Early variety identification relied primarily on phenotypes, mainly through visual or instrumental measurements of the external characteristics of the sample. These morphological or physiological traits were used as genetic markers to identify the variety of the sample. However, this method has several drawbacks. First, it struggles to distinguish between phenotypically similar varieties or to identify hybrids. Second, the judgments are too subjective and sometimes lack objective scientific evidence. Finally, it is difficult to quantitatively measure the purity of the sample. Summary of the Invention
[0004] In view of the shortcomings of the prior art described above, the purpose of this invention is to provide a variety identification method, system and terminal based on ensemble learning to solve the above-mentioned technical problems in the prior art.
[0005] To achieve the above and other related objectives, this invention provides a variety identification method based on ensemble learning. The method includes: preprocessing molecular genetic marker data of samples from all varieties in a variety database to obtain a feature data matrix; wherein the feature data matrix includes a sample feature matrix for each sample corresponding to each variety; constructing and screening classifiers based on the feature data matrix and the variety to which each sample belongs; constructing an ensemble classifier for each molecular genetic marker locus based on the screened classifiers to build a prediction model; and preprocessing the molecular genetic marker data of the sample to be tested based on the constructed prediction model, and outputting the corresponding variety identification result according to the sample feature matrix obtained from the preprocessing.
[0006] In one embodiment of the present invention, the sample feature data matrix includes: a genotype feature matrix corresponding to each molecular genetic marker locus; wherein, the genotype feature matrix includes: feature values corresponding to each type of genotype at the current molecular genetic marker locus; wherein, the genotype types include known types and unknown / undetected types; wherein, the feature value of the known type genotype is the number of corresponding genotypes; the feature value of the unknown / undetected type genotype is set based on a setting rule; and wherein, the setting rule includes: a non-zero natural number with a first threshold as the mean, conforming to a specific distribution, and a maximum value not exceeding a second threshold; wherein, if the feature value exceeds the second threshold, it is changed to the second threshold.
[0007] In one embodiment of the present invention, the step of constructing and screening classifiers based on the feature data matrix and the variety to which each sample belongs includes: constructing classifiers for each selected algorithm based on the feature data matrix and the variety to which each sample belongs; using a two-way selection rule, selecting each classifier as a classifier to be screened, and screening one or more classifiers based on the prediction evaluation results of each classifier.
[0008] In one embodiment of the present invention, the construction of an ensemble classifier for each molecular genetic marker locus based on the selected classifiers to build a prediction model includes: constructing an ensemble classifier for each molecular genetic marker locus based on the algorithm corresponding to each selected classifier and the corresponding weighting coefficient; wherein, the ensemble classifier includes: sub-classifiers constructed according to the algorithm corresponding to each selected classifier; and determining the ensemble classifier corresponding to each molecular genetic marker locus as the ensemble classifier used to construct the prediction model.
[0009] In one embodiment of the present invention, the construction of an ensemble classifier for each molecular genetic marker locus based on the selected classifiers to build a prediction model includes: constructing an ensemble classifier for each molecular genetic marker locus based on the algorithm and weighting coefficients corresponding to each selected classifier; wherein, the ensemble classifier includes: sub-classifiers constructed by the algorithms corresponding to each selected classifier; based on a two-way selection rule, each ensemble classifier is used as a classifier to be screened, and multiple ensemble classifiers corresponding to molecular genetic marker loci are selected as determined ensemble classifiers for constructing the prediction model based on the prediction evaluation results of the ensemble classifiers corresponding to each molecular genetic marker locus, so as to construct the prediction model.
[0010] In one embodiment of the present invention, the prediction model includes: a locus classification module, comprising determined ensemble classifiers, for outputting classification results of each variety corresponding to the sample based on the genotype feature matrix corresponding to the corresponding molecular genetic marker locus of the sample; wherein, if the value of the corresponding classification result is zero, the result is assigned a non-zero constant less than 1 / s; wherein s is the total number of varieties in the variety database; a fusion module, connected to the locus classification module, for cumulatively multiplying the classification results of each variety corresponding to the sample output by each ensemble classifier to obtain the L value of each variety corresponding to the sample; and an identification result output module, connected to the fusion module, for calculating the probability value of each variety corresponding to the sample based on the L value of each variety of the corresponding sample, so as to output the corresponding variety identification result.
[0011] In one embodiment of the present invention, the bidirectional selection rule includes: Step 1: Ranking the classifiers to be screened according to their predictive abilities based on the corresponding prediction evaluation results to form a set of candidate models; Step 2: Selecting the two classifiers with the best predictive abilities to integrate into a preferred model set; Step 3: Selecting the classifier with the best predictive ability from the candidate model set (excluding the classifiers in the preferred model set) and adding it to the current preferred model set to integrate into a new model set; Step 4: Comparing the predictive abilities of the current preferred model set and the new model set; if the predictive ability of the current preferred model set is better than that of the new model set, the preferred model set remains unchanged; otherwise, the new model set is used as the preferred model set; Step 5: Removing each classifier to be screened from the current preferred model set in sequence, and re-selecting... Construct a new set of classification ensemble models and select the set of classification ensemble models with the best predictive ability that has not yet been selected; compare the predictive ability of the current preferred model set with that of the selected set of classification ensemble models with the best predictive ability; if the predictive ability of the current preferred model set is better than that of the set of classification ensemble models, then the preferred model set remains unchanged; otherwise, the set of classification ensemble models is used as the preferred model set; continue until all sets of classification ensemble models have been selected and the preferred model set remains unchanged; Step 6: Determine whether all the classifiers to be screened in the candidate model set have been selected; if so, use each classifier to be screened in the current preferred model set as the screened classifier; if not, return to step 3 until all the classifiers to be screened in the candidate model set have been selected, and use each classifier to be screened in the current preferred model set as the screened classifier.
[0012] In one embodiment of the present invention, the method further includes: filtering and optimizing the variety database, wherein if more than half of the samples in the variety database are misclassified by the constructed classifier or the classification result predicted by the constructed ensemble classifier is less than a set threshold, then the sample is removed; if the number of samples of a variety is less than the sample threshold, or more than half of the samples are considered to be removed, then all samples of that variety are removed.
[0013] To achieve the above and other related objectives, this invention provides a variety identification system based on ensemble learning. The system includes: a data preprocessing module for preprocessing molecular genetic marker data of samples from all varieties in a variety database to obtain a feature data matrix; wherein the feature data matrix includes a sample feature matrix for each sample corresponding to each variety; a classifier selection module connected to the data preprocessing module for constructing and selecting classifiers based on the feature data matrix and the variety to which each sample belongs; a model building module connected to the classifier selection module for constructing an ensemble classifier for each molecular genetic marker locus based on the selected classifiers to build a prediction model; and a variety identification module connected to the model building module for preprocessing the molecular genetic marker data of the sample to be tested based on the constructed prediction model, and outputting the corresponding variety identification result according to the corresponding sample feature matrix obtained from the preprocessing.
[0014] To achieve the above and other related objectives, the present invention provides a variety identification terminal based on ensemble learning, comprising: one or more memory units and one or more processor units; the one or more memory units are used to store a computer program; the one or more processor units are connected to the memory units and are used to run the computer program to execute the variety identification method based on ensemble learning.
[0015] As described above, this invention is a variety identification method, system, and terminal based on ensemble learning, which has the following beneficial effects: This invention preprocesses the molecular genetic marker data of each sample from all varieties in the variety database to obtain a feature data matrix. Based on this feature data matrix and the variety to which each sample belongs, a classifier is constructed and screened. Then, a prediction model is constructed based on the screened classifiers. Finally, variety identification and pedigree inference are completed based on the constructed prediction model. This invention enables highly accurate, rapid, high-throughput, parallel, automated, and transferable variety identification and pedigree inference. Attached Figure Description
[0016] Figure 1 The diagram shown is a flowchart of a variety identification method based on ensemble learning according to an embodiment of the present invention.
[0017] Figure 2 The diagram shown is a flowchart illustrating the bidirectional selection rule in one embodiment of the present invention.
[0018] Figure 3 The diagram shown is a flowchart of a variety identification method based on ensemble learning according to an embodiment of the present invention.
[0019] Figure 4 The diagram shown is a flowchart illustrating the bidirectional selection rule in one embodiment of the present invention.
[0020] Figure 5 The diagram shown is a schematic representation of the variety identification results in one embodiment of the present invention.
[0021] Figure 6 The diagram shown is a structural schematic of a variety identification system based on ensemble learning according to an embodiment of the present invention.
[0022] Figure 7 The diagram shown is a structural schematic of a variety identification terminal based on ensemble learning according to an embodiment of the present invention. Detailed Implementation
[0023] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.
[0024] It should be noted that in the following description, reference is made to the accompanying drawings, which illustrate several embodiments of the invention. It should be understood that other embodiments may also be used, and changes in mechanical composition, structure, electrical system, and operation may be made without departing from the spirit and scope of the invention. The following detailed description should not be considered limiting, and the scope of the embodiments of the invention is defined only by the claims of the published patents. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. Spatially related terms, such as “upper,” “lower,” “left,” “right,” “below,” “below,” “lower part,” “above,” “upper part,” etc., may be used herein to illustrate the relationship between one element or feature shown in the figures and another element or feature.
[0025] Throughout this specification, when it is said that a part is "connected" to another part, this includes not only "direct connection" but also "indirect connection" by placing other elements in between. Furthermore, when it is said that a part "includes" a certain constituent element, unless otherwise stated otherwise, this does not exclude other constituent elements, but rather means that other constituent elements may also be included.
[0026] The terms "first," "second," and "third," etc., used herein are for the purpose of describing various parts, components, regions, layers, and / or segments, but are not limiting. These terms are used only to distinguish one part, component, region, layer, or segment from others. Therefore, the "first part," "component," "region," "layer," or "segment" described below may refer to a "second part," "component," "region," "layer," or "segment" without departing from the scope of this invention.
[0027] Furthermore, as used herein, the singular forms “a,” “an,” and “the” are intended to include the plural forms as well, unless the context indicates otherwise. It should be further understood that the terms “comprising,” “including,” indicate the presence of the stated feature, operation, element, component, item, kind, and / or group, but do not preclude the presence, occurrence, or addition of one or more other features, operations, elements, components, items, kinds, and / or groups. The terms “or” and “and / or” as used herein are interpreted as inclusive, or mean any one or any combination thereof. Thus, “A, B, or C” or “A, B, and / or C” means “any one of: A; B; C; A and B; A and C; B and C; A, B, and C.” Exceptions to this definition arise only when combinations of elements, functions, or operations are inherently mutually exclusive in some manner.
[0028] Molecular genetic markers are genetic markers based on nucleotide sequence variations within the genetic material of individuals, and are a direct reflection of genetic polymorphism at the DNA level. They have the following advantages: extremely rich genomic variation, with an almost unlimited number of molecular markers; DNA from different stages of biological development and different tissues can be used for marker analysis; and the detection methods are simple and rapid. They enable large-scale variety identification in a scientific, accurate, efficient, and rapid manner.
[0029] Ensemble learning is a technique that uses multiple compatible learning algorithms / models to perform a single task, with the aim of achieving better prediction performance. Ensemble learning primarily combines multiple base learners to achieve superior generalization performance compared to a single learner.
[0030] Therefore, this invention provides a variety identification method, system, and terminal based on ensemble learning. It preprocesses the molecular genetic marker data of samples from all varieties in a variety database to obtain a feature data matrix. Based on this feature data matrix and the variety to which each sample belongs, classifiers are constructed and selected. Then, a prediction model is built based on the selected classifiers. Finally, variety identification and pedigree inference are completed based on the constructed prediction model. This invention enables highly accurate, rapid, high-throughput, parallel, automated, and transferable variety identification and pedigree inference.
[0031] The present invention will now be described in detail with reference to the accompanying drawings, so that those skilled in the art can readily implement it. The present invention can be embodied in many different forms and is not limited to the embodiments described herein.
[0032] like Figure 1 This is a flowchart illustrating a variety identification method based on ensemble learning in an embodiment of the present invention.
[0033] The method includes:
[0034] Step S1: Preprocess the molecular genetic marker data of each sample of all varieties in the variety database to obtain the feature data matrix.
[0035] In detail, the variety database contains samples of multiple varieties; the feature data matrix includes: the sample feature matrix corresponding to each sample of each variety.
[0036] In one embodiment, the sample feature data matrix includes: a genotype feature matrix corresponding to each molecular genetic marker locus; wherein, the genotype feature matrix includes: feature values corresponding to each type of genotype at the current molecular genetic marker locus; wherein, the genotype types include known types and unknown / undetected types; wherein, the feature value of the known type genotype is the number of corresponding genotypes; the feature value of the unknown / undetected type genotype is set based on a setting rule; and wherein, the setting rule includes: a non-zero natural number with a first threshold as the mean, conforming to a specific distribution, and a maximum value not exceeding a second threshold; wherein, if the feature value exceeds the second threshold, it is changed to the second threshold.
[0037] Specifically, methods for preprocessing molecular genetic marker data of samples to obtain matrices include:
[0038] Molecular genetic marker data are obtained and converted into matrix form, with each known polymorphism of an independent molecular genetic marker locus representing a single feature; where the matrix value represents the number of samples containing that feature, and 0 indicates that the sample does not contain that feature.
[0039] Given that each molecular genetic marker locus has unknown and / or low-frequency polymorphism types that have not been detected, for each molecular genetic marker locus, an additional feature is added to represent the combination of unknown and / or low-frequency polymorphism types. The value of this feature is a non-zero natural number with a mean of μ, conforming to a specific distribution X, and a maximum value not exceeding m. Values exceeding m are replaced with m.
[0040] For example, a non-zero natural number that follows a normal distribution with a mean of 0.01 and a standard deviation of 0.003 and whose maximum value does not exceed 0.1.
[0041] Step S2: Based on the feature data matrix and the variety to which each sample belongs, construct and select a classifier.
[0042] In one embodiment, step S2 includes: constructing classifiers for each selected algorithm based on the feature data matrix and the variety to which each sample belongs; specifically, using the feature data matrix as feature values and the variety to which each sample belongs as target values, selecting an algorithm capable of outputting probability values for each class for model training. One classifier is constructed for each type of algorithm; the classifiers undergo cross-validation to prevent overfitting and determine model parameters. The classifiers are evaluated based on the prediction results to obtain prediction evaluation results.
[0043] Based on the two-way selection rule, each classifier is selected as a classifier to be screened, and one or more classifiers are selected based on the prediction evaluation results of each classifier.
[0044] For example, classifiers can be constructed using algorithms such as SVM, Random Forest, Gradient Boosting, Extreme Random Tree, Naive Bayes (multinomial distribution, Bernoulli), LDA, Logistic Regression (L1, L2 regularization), XGBoost, Nearest Neighbor, and Neural Network.
[0045] In one embodiment, the probability of the optimal classifier (algorithm) combination predicted by the final selection is calculated, and the proportion of the correct probability of each classifier is obtained, that is, the weighting coefficient of each classifier is calculated.
[0046] Step S3: Based on the selected classifiers, construct an ensemble classifier for each molecular genetic marker locus to build a prediction model.
[0047] In one embodiment, step S13: Based on the algorithms and weighting coefficients corresponding to each of the selected classifiers, an ensemble classifier is constructed for each molecular genetic marker locus; wherein, the ensemble classifier includes: sub-classifiers constructed according to the algorithms corresponding to each of the selected classifiers; wherein, the prediction result of the ensemble model is obtained by using the weighted average method or stacking method with the weighting coefficients of each of the selected classifiers.
[0048] Each molecular genetic marker locus corresponds to an ensemble classifier, which is then used to construct the prediction model.
[0049] In this embodiment, the prediction model includes:
[0050] The locus classification module includes an integrated classifier constructed for each molecular genetic marker locus, which is used to output the classification results of each variety of the sample based on the genotype feature matrix corresponding to each molecular genetic marker locus of the sample; wherein, if the corresponding classification result is zero, the result is assigned a non-zero constant less than 1 / s; wherein s is the total number of varieties in the variety database;
[0051] The fusion module, connected to the site classification module, is used to accumulate and multiply the classification results of each sample corresponding to each variety output by each ensemble classifier to obtain the L value of each sample corresponding to each variety.
[0052] The identification result output module, connected to the fusion module, is used to calculate the probability value of each variety based on the L value of each variety of the corresponding sample, so as to output the corresponding variety identification result.
[0053] It should be noted that the inheritance between molecular genetic marker loci is independent and conforms to Mendel's laws of inheritance. The results of multiple loci are cumulatively multiplied, which requires that there is no genetic linkage and no sex-linked inheritance between each locus.
[0054] Preferably, for each variety, the probability value of a sample being predicted as that variety is the L value of that variety divided by the sum of the L values of all predicted varieties; based on the probability value of the measured sample being predicted as each variety, it is possible to determine which purebred species the measured sample belongs to and the corresponding degree of purity; or to determine which varieties the sample is a hybrid of and the proportion of lineage hybridization, thereby inferring the potential lineage.
[0055] In one specific embodiment, the selected molecular genetic marker sites can either be modeled separately as a single dataset and then integrated together, or all sites can be modeled together as a single dataset.
[0056] To save costs, while ensuring accurate differentiation of the target varieties, the goal is to screen out as few STR loci as possible. The following examples will explain the implementation method and process.
[0057] In one embodiment, the screening-based classifiers construct an ensemble classifier for each molecular genetic marker locus to build a prediction model, including:
[0058] Based on the algorithms and weighting coefficients corresponding to each selected classifier, an ensemble classifier is constructed for each molecular genetic marker locus; wherein, the ensemble classifier includes: sub-classifiers constructed for each selected classifier's corresponding algorithm;
[0059] Based on the bidirectional selection rule, each ensemble classifier is selected as a classifier to be screened, and multiple ensemble classifiers corresponding to molecular genetic marker loci are selected as determined ensemble classifiers for constructing the prediction model based on the prediction evaluation results of the ensemble classifiers corresponding to each molecular genetic marker locus.
[0060] In this embodiment, the prediction model includes:
[0061] The locus classification module includes an integrated classifier constructed from each of the selected molecular genetic marker loci, used to output the classification results of each variety of the corresponding sample based on the genotype feature matrix corresponding to the corresponding molecular genetic marker locus of the sample; wherein, if the corresponding classification result is zero, the result is assigned a non-zero constant less than 1 / s; wherein s is the total number of varieties in the variety database;
[0062] The fusion module, connected to the site classification module, is used to accumulate and multiply the classification results of each sample corresponding to each variety output by each ensemble classifier to obtain the L value of each sample corresponding to each variety.
[0063] The identification result output module, connected to the fusion module, is used to calculate the probability value of each variety based on the L value of each variety in the corresponding sample, so as to output the corresponding variety identification result.
[0064] In one embodiment, such as Figure 2 As shown, the bidirectional selection rules include:
[0065] Step 1: Sort the classifiers to be screened according to their predictive ability based on the corresponding prediction evaluation results, and form a set of candidate models.
[0066] Step 2: Select the two classifiers with the best predictive ability and integrate them into an optimal model set;
[0067] Step 3: Select the classifier with the best predictive ability from the candidate model set after removing all the classifiers to be screened from the preferred model set and add it to the current preferred model set to form a new model set;
[0068] Step 4: Compare the predictive power of the current preferred model set with that of the new model set; if the predictive power of the current preferred model set is better than that of the new model set, then the preferred model set remains unchanged; otherwise, the new model set is adopted as the preferred model set.
[0069] Step 5: Includes:
[0070] Step 51: Remove each classifier to be selected from the current preferred model set in turn, and reconstruct a new set of classification ensemble models;
[0071] Step 52: Select the set of classification ensemble models with the best predictive power that have not yet been selected;
[0072] Step 53: Compare the current preferred model set with the prediction ability of the selected classification ensemble model set with the best prediction ability; if the prediction ability of the current preferred model set is better than that of the classification ensemble model set, then the preferred model set remains unchanged; otherwise, the classification ensemble model set is used as the preferred model set.
[0073] Step 54: Determine whether all the ensemble model sets to be classified have been selected. If yes, proceed to the next step; otherwise, proceed to step 52 until all ensemble model sets have been selected and the preferred model set remains unchanged.
[0074] Step 6: Determine whether all the classifiers to be filtered in the candidate model set have been selected; if yes, use each classifier to be filtered in the current preferred model set as the filtered classifier; if no, return to step 3 until all the classifiers to be filtered in the candidate model set have been selected, and use each classifier to be filtered in the current preferred model set as the filtered classifier.
[0075] Step S4: Based on the constructed prediction model, output the corresponding variety identification result according to the corresponding sample feature matrix obtained by preprocessing the molecular genetic marker data of the sample to be tested.
[0076] Specifically, the molecular genetic data of the sample to be tested is preprocessed according to S1 to obtain the corresponding sample feature matrix. This matrix is then input into the prediction model to obtain the prediction results for each variety corresponding to the sample. Specifically, the results (probability values) of each point are accumulated and multiplied to obtain the final value L. For each variety, the probability value of the sample being predicted as that variety is the L value of that variety divided by the sum of the L values of all predicted varieties. This identifies the variety affiliation. Based on the probability values of the tested sample being predicted as each variety, it is possible to determine which purebred species the tested sample belongs to and the corresponding degree of purity; or to determine which varieties the sample is a hybrid of and the proportion of lineage hybridization, thereby inferring the potential pedigree.
[0077] In one embodiment, the method further includes:
[0078] Filtering and optimizing the variety database can be done in the following ways:
[0079] If the variety database contains samples that are misclassified by more than half of the constructed classifiers or whose classification results predicted by the constructed ensemble classifier are less than a set threshold, then the sample is removed. Specifically, for a single sample in the database, if it is misclassified by more than half (including half) of the classifiers, or if its probability value of correctly predicting the variety in the ensemble classifier is less than a set threshold, then the sample is removed.
[0080] If the number of samples for a variety is less than the sample threshold, or if more than half of the samples are considered to be excluded, then all samples of that variety are excluded. Specifically, for different varieties in the database, if the number of samples for a variety is less than 4, or if more than half of the samples are considered to be excluded, then that variety is excluded.
[0081] To better describe the method for building a customer platform and providing communication services based on personal mobile devices, the following specific embodiments are provided for illustration;
[0082] Example 1: A variety identification method based on ensemble learning; Figure 3 This is a flowchart illustrating the variety identification method based on ensemble learning in this embodiment.
[0083] The breed database used to construct the model in this embodiment is a STR (microsatellite) database (diploid) of purebred pet dogs, with 15 STR loci (246 genotypes) and 123 breeds (1772 samples).
[0084] Step 11: Preprocessing of molecular genetic marker data.
[0085] To help those skilled in the art better understand the technical solution of this step, the following explanation is provided in conjunction with Table 1. Table 1 is a matrix representation of the preprocessing of STR-1 loci in the purebred pet dog database. There are a total of 9 different genotypes for STR-1 loci (G1, G2, G3, G4, G5, G6, G7, G8, G9). Row 29 in the table represents 29 samples. The numbers in the table indicate the number of samples with that genotype; "other" represents other low-frequency or unknown genotypes, conforming to a normal distribution with a mean of 0.01 and a standard deviation of 0.003, and a non-zero natural number whose maximum value does not exceed 0.1. For example, sample 0 represents a genotype of 044052; sample 1 represents a genotype of 052.
[0086] Table 1: STR Data Preprocessing
[0087]
[0088]
[0089] Step 12: Selection of classifier (algorithm).
[0090] As described in step 11, a 1772*264 matrix is obtained as the feature value, and the variety to which the 1772 samples belong is used as the target value. Algorithms such as SVM, Random Forest, Gradient Boosting, Extreme Random Tree, Naive Bayes (multinomial distribution, Bernoulli), LDA, Logistic Regression (L1, L2 regularization), XGBoost, Nearest Neighbor, and Neural Networks are selected to construct a classifier model set. Figure 4As shown, selection is performed according to a two-way selection rule. The sub-models contained in model a are the final selected classifiers (algorithms). The optimal combination of classifiers (algorithms) is SVM, LDA, and Bernoulli Naive Bayes. Their probabilities of correctly predicting varieties are 774.473509, 1589.794006, and 1700.910500, respectively. The percentages of the correct probability sum for each classifier are 0.1905140, 0.3910761, and 0.4184098, respectively, i.e., the weighting coefficients are 0.1905140, 0.3910761, and 0.4184098.
[0091] Step 13: Construction of the prediction model.
[0092] As described in step 12, an ensemble classifier is constructed for each of the 15 STR loci (one sub-classifier is constructed for each algorithm). The prediction results of the ensemble model are calculated using a weighted average method, and the weighting coefficients are obtained in step S12. For the possible zero values of the results (probability values) for each locus, a value of 5.643341e-08 is assigned. For the 123 varieties, the results (probability values) of the 15 loci are accumulated and multiplied to obtain the final value L.
[0093] Step 14: Complete variety identification.
[0094] The molecular genetic data of the samples to be tested were preprocessed according to step 11. This data was then input into the ensemble model, yielding prediction results for 123 varieties, such as... Figure 5 As shown. The variety identified in this sample is Golden Retriever; its purity reaches 95.83%.
[0095] Example 2: An optimization method for STR loci.
[0096] This embodiment primarily differentiates between three canine breeds: Jack Russell Terrier, Australian Shepherd, and Rat Terrier. There are currently 15 STR loci (73 samples), with a prediction accuracy of 73 / 73. To save costs, the goal is to select as few STR loci as possible while ensuring accurate differentiation of the target breed.
[0097] For each of the 15 STR loci, an ensemble learning model was constructed as a sub-model, and the models were selected according to a two-way selection rule, such as... Figure 4 The loci corresponding to the sub-models included in model a are the final selected loci. This results in a simplified set of 6 loci. Their probability of correctly predicting a particular variety is 73 / 73.
[0098] As shown in Table 2, the "predict" column represents the number of samples correctly predicted out of 73 sample varieties, and the "proba" column represents the sum of the probabilities of the 73 samples being correctly predicted as varieties in the model. "15STRs" and "6STRs" represent the prediction results of 15 STR loci and 6 selected STR loci, respectively. "6STRs-x" (x is a number) represents the prediction results of 6 randomly selected STR loci from the 15 STR loci. Table 2 shows that the discriminative power of the 6 selected STR loci for Jack Russell Terrier, Australian Shepherd, and Rat Terrier is similar to that of the 15 STR loci, and significantly better than the random results.
[0099] Table 2: Comparison of Prediction Results for 6-STR & 15-STR
[0100] name predict proba 15 STRs 73 72.99922092 6STRs 73 72.24644694 6STRs-1 64 61.654921 6STRs-2 61 58.108301 6STRs-3 62 60.017926 6STRs-4 61 57.855817 6STRs-5 68 62.808373 6STRs-6 63 58.412947 6STRs-7 67 65.870364 6STRs-8 69 63.265737 6STRs-9 69 66.151941 6STRs-10 63 60.046227 6STRs-11 62 58.025687 6STRs-12 63 60.824249 6STRs-13 69 65.842423 6STRs-14 59 54.627643 6STRs-15 60 59.257195 6STRs-16 69 62.773011 6STRs-17 60 57.787691 6STRs-18 60 58.768493 6STRs-19 61 55.49531 6STRs-20 60 55.848688
[0101] The method described in this embodiment can optimize the purebred database and screen reliable molecular genetic markers during the model construction process. Therefore, while ensuring that the model has both good predictive and generalization capabilities, it reduces the amount of computation and increases the computation speed. The model constructed by this method can achieve high accuracy, speed, high throughput, parallelization, automation, and transferability in variety identification and strain inference.
[0102] Similar to the principles of the above embodiments, the present invention provides a variety identification system based on ensemble learning.
[0103] The following specific embodiments are provided in conjunction with the accompanying drawings:
[0104] like Figure 6 This diagram illustrates the structure of a variety identification system based on ensemble learning, as described in an embodiment of the present invention.
[0105] The system includes:
[0106] The data preprocessing module 61 is used to preprocess the molecular genetic marker data of each sample of all varieties in the variety database to obtain a feature data matrix; wherein, the feature data matrix includes: the sample feature matrix of each sample corresponding to each variety.
[0107] The classifier selection module 62 is connected to the data preprocessing module 61 and is used to construct and filter classifiers based on the feature data matrix and the variety to which each sample belongs.
[0108] The model building module 63 is connected to the classifier selection module 62 and is used to build an ensemble classifier for each molecular genetic marker site based on the selected classifiers, so as to build a prediction model.
[0109] The variety identification module 64 is connected to the model construction module 63 and is used to output the corresponding variety identification result based on the constructed prediction model and the corresponding sample feature matrix obtained by preprocessing the molecular genetic marker data of the sample to be tested.
[0110] It should be noted that, as should be understood Figure 6 The division of modules in the system embodiment is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these units can be implemented entirely in software through processing element calls; they can be implemented entirely in hardware; or some units can be implemented by processing element calls to software, while others are implemented in hardware.
[0111] Since the implementation principle of this variety identification system based on ensemble learning has been described in the foregoing embodiments, it will not be repeated here.
[0112] In one embodiment, the sample feature data matrix includes: a genotype feature matrix corresponding to each molecular genetic marker locus; wherein, the genotype feature matrix includes: feature values corresponding to each type of genotype at the current molecular genetic marker locus; wherein, the genotype types include known types and unknown / undetected types; wherein, the feature value of the known type genotype is the number of corresponding genotypes; the feature value of the unknown / undetected type genotype is set based on a setting rule; and wherein, the setting rule includes: a non-zero natural number with a first threshold as the mean, conforming to a specific distribution, and a maximum value not exceeding a second threshold; wherein, if the feature value exceeds the second threshold, it is changed to the second threshold.
[0113] In one embodiment, the classifier selection module 62 is used to construct classifiers for various selected algorithms based on the feature data matrix and the variety to which each sample belongs; based on the two-way selection rule, each classifier is used as a classifier to be screened, and one or more classifiers are screened according to the prediction evaluation results of each classifier.
[0114] In one embodiment, the model building module 63 is used to build an ensemble classifier for each molecular genetic marker site based on the algorithms and weighting coefficients corresponding to each selected classifier; wherein, the ensemble classifier includes: sub-classifiers built according to the algorithms corresponding to each selected classifier; and the ensemble classifier corresponding to each molecular genetic marker site is determined as the ensemble classifier for building the prediction model, so as to build the prediction model.
[0115] In one embodiment, the model building module 63 is used to build an ensemble classifier for each molecular genetic marker locus based on the algorithms and weighting coefficients corresponding to each selected classifier; wherein, the ensemble classifier includes: sub-classifiers built by the algorithms corresponding to each selected classifier; based on a two-way selection rule, each ensemble classifier is used as a classifier to be screened, and multiple ensemble classifiers corresponding to each molecular genetic marker locus are selected as determined ensemble classifiers for building the prediction model based on the prediction evaluation results of the ensemble classifiers corresponding to each molecular genetic marker locus, so as to build the prediction model.
[0116] In one embodiment, the prediction model includes: a locus classification module, comprising determined ensemble classifiers, for outputting classification results for each variety of the corresponding sample based on the genotype feature matrix corresponding to the corresponding molecular genetic marker locus of the sample; wherein, if the corresponding classification result is zero, the result is assigned a non-zero constant less than 1 / s; wherein s is the total number of varieties in the variety database; a fusion module, connected to the locus classification module, for cumulatively multiplying the classification results of each variety of the sample output by each ensemble classifier to obtain the L value of each variety of the sample; and an identification result output module, connected to the fusion module, for calculating the probability value of each variety corresponding to the corresponding sample based on the L value of each variety of the corresponding sample, so as to output the corresponding variety identification result.
[0117] In one embodiment, the bidirectional selection rule includes: Step 1: Ranking the classifiers to be screened according to their predictive abilities based on the corresponding prediction evaluation results to form a set of candidate models; Step 2: Selecting the two classifiers with the best predictive abilities to integrate into a preferred model set; Step 3: Selecting the classifier with the best predictive ability from the candidate model set (excluding the classifiers in the preferred model set) and adding it to the current preferred model set to integrate into a new model set; Step 4: Comparing the predictive abilities of the current preferred model set and the new model set; if the predictive ability of the current preferred model set is better than that of the new model set, the preferred model set remains unchanged; otherwise, the new model set is used as the preferred model set; Step 5: Sequentially removing each classifier from the current preferred model set to reconstruct a new model set. A new set of classification ensemble models is generated, and the set of classification ensemble models with the best predictive ability that has not been selected is selected. The predictive ability of the current preferred model set and the selected set of classification ensemble models with the best predictive ability are compared. If the predictive ability of the current preferred model set is better than that of the selected set of classification ensemble models, the preferred model set remains unchanged; otherwise, the selected set of classification ensemble models is used as the preferred model set. This process continues until all sets of classification ensemble models have been selected and the preferred model set remains unchanged. Step 6: Determine whether all the classifiers to be screened in the candidate model set have been selected. If so, each classifier to be screened in the current preferred model set is used as the screened classifier. If not, return to step 3 until all the classifiers to be screened in the candidate model set have been selected, and each classifier to be screened in the current preferred model set is used as the screened classifier.
[0118] In one embodiment, the identification system is further used to filter and optimize the variety database, including: if more than half of the samples in the variety database are misclassified by the constructed classifier or the classification result predicted by the constructed ensemble classifier is less than a set threshold, then the sample is removed; if the number of samples of a variety is less than the sample threshold, or more than half of the samples are considered to be removed, then all samples of that variety are removed.
[0119] like Figure 7 A schematic diagram of the structure of the variety identification terminal 10 based on ensemble learning in an embodiment of the present invention is shown.
[0120] The variety identification terminal 70 based on ensemble learning includes: a memory 71 and a processor 72. The memory 71 stores computer programs; the processor 72 runs the computer programs to implement, for example,... Figure 1 The variety identification method based on ensemble learning is described above.
[0121] Optionally, the number of memories 71 can be one or more, and the number of processors 72 can be one or more. Figure 7 Each example is taken as an instance.
[0122] Optionally, the processor 72 in the ensemble learning-based variety identification terminal 70 will perform the following... Figure 1 The steps described involve loading one or more instructions corresponding to the process of an application into memory 71, and having the processor 72 run the application stored in the first memory 71, thereby achieving the following: Figure 1 The various functions in the variety identification method based on ensemble learning.
[0123] Optionally, the memory 71 may include, but is not limited to, high-speed random access memory and non-volatile memory. For example, one or more disk storage devices, flash memory devices, or other non-volatile solid-state storage devices; the processor 72 may include, but is not limited to, a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0124] Optionally, the processor 72 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0125] The present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed, implements as follows: Figure 1The illustrated method for variety identification based on ensemble learning. The computer-readable storage medium may include, but is not limited to, floppy disks, optical disks, CD-ROMs (Read-Only Optical Disk Memory), magneto-optical disks, ROMs (Read-Only Memory), RAMs (Random Access Memory), EPROMs (Erasable Programmable Read-Only Memory), EEPROMs (Electrically Erasable Programmable Read-Only Memory), magnetic cards or optical cards, flash memory, or other types of media / machine-readable media suitable for storing machine-executable instructions. The computer-readable storage medium may be a product not connected to a computer device or a component used with a computer device.
[0126] In summary, the ensemble learning-based variety identification system of this invention preprocesses the molecular genetic marker data of samples from all varieties in the variety database to obtain a feature data matrix. Based on this feature data matrix and the variety to which each sample belongs, a classifier is constructed and screened. Then, a prediction model is built based on the screened classifiers. Finally, variety identification and pedigree inference are completed based on the constructed prediction model. This invention enables highly accurate, rapid, high-throughput, parallel, automated, and transferable variety identification and pedigree inference. Therefore, this invention effectively overcomes the various shortcomings of existing technologies and has high industrial application value.
[0127] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A variety identification method based on ensemble learning, characterized in that, The method includes: Molecular genetic marker data of all samples from all varieties in the variety database are preprocessed to obtain a feature data matrix. This feature data matrix includes: a sample feature matrix for each sample corresponding to each variety; a genotype feature matrix corresponding to each molecular genetic marker locus; and feature values for each type of genotype corresponding to the current molecular genetic marker locus. The genotype types include known types and unknown / undetected types. The feature value for a known type of genotype is the number of corresponding genotypes. The feature values for unknown / undetected types of genotypes are set based on a set rule. This set rule includes: a non-zero natural number with a first threshold as its mean, conforming to a specific distribution, and a maximum value not exceeding a second threshold. If a feature value exceeds the second threshold, it is changed to the second threshold. Based on this feature data matrix and the variety to which each sample belongs, a classifier is constructed and selected; An ensemble classifier is constructed for each molecular genetic marker locus based on the selected classifiers to build a prediction model. This includes: constructing an ensemble classifier for each molecular genetic marker locus based on the algorithms and weighting coefficients corresponding to the selected classifiers; wherein the ensemble classifier includes sub-classifiers constructed by the algorithms corresponding to the selected classifiers; based on a two-way selection rule, each ensemble classifier is selected as a classifier to be screened, and multiple ensemble classifiers corresponding to each molecular genetic marker locus are selected as the determined ensemble classifiers for constructing the prediction model based on the prediction evaluation results of the ensemble classifiers corresponding to each molecular genetic marker locus, thereby constructing the prediction model; the prediction model includes... The system comprises: a locus classification module, including defined ensemble classifiers, used to output classification results for each variety of the corresponding sample based on the genotype feature matrix corresponding to the corresponding molecular genetic marker locus of the sample; wherein, if the value of the corresponding classification result is zero, the result is assigned a non-zero constant less than 1 / s; where s is the total number of varieties in the variety database; a fusion module, connected to the locus classification module, used to accumulate and multiply the classification results of each variety of the sample output by each ensemble classifier to obtain the L value of each variety of the sample; and an identification result output module, connected to the fusion module, used to calculate the probability value of each variety corresponding to the corresponding sample based on the L value of each variety of the corresponding sample, so as to output the corresponding variety identification result. Based on the constructed prediction model, the molecular genetic marker data of the sample to be tested are preprocessed, and the corresponding variety identification results are output according to the sample feature matrix obtained by preprocessing.
2. The variety identification method based on ensemble learning according to claim 1, characterized in that, The process of constructing and selecting a classifier based on the feature data matrix and the variety to which each sample belongs includes: Based on the feature data matrix and the variety to which each sample belongs, classifiers are constructed for each of the selected algorithms. Based on the two-way selection rule, each classifier is selected as a classifier to be screened, and one or more classifiers are selected based on the prediction evaluation results of each classifier.
3. The variety identification method based on ensemble learning according to claim 2, characterized in that, The screening-based classifiers construct an ensemble classifier for each molecular genetic marker locus to build a prediction model, including: Based on the algorithms and weighting coefficients corresponding to each selected classifier, an ensemble classifier is constructed for each molecular genetic marker locus; wherein, the ensemble classifier includes: sub-classifiers constructed for each selected classifier's corresponding algorithm; Each molecular genetic marker locus corresponds to an ensemble classifier, which is then used to construct the prediction model.
4. The variety identification method based on ensemble learning according to claim 1 or 3, characterized in that, The two-way selection rules include: Step 1: Sort the classifiers to be screened according to their predictive ability based on the corresponding prediction evaluation results, and form a set of candidate models. Step 2: Select the two classifiers with the best predictive ability and integrate them into an optimal model set; Step 3: Select the classifier with the best predictive ability from the candidate model set after removing all the classifiers to be screened from the preferred model set and add it to the current preferred model set to form a new model set; Step 4: Compare the predictive power of the current preferred model set with that of the new model set; if the predictive power of the current preferred model set is better than that of the new model set, then the preferred model set remains unchanged; otherwise, the new model set is adopted as the preferred model set. Step 5: Sequentially remove each unselected classifier from the current preferred model set, reconstruct a series of new classification ensemble model sets, and select the classification ensemble model set with the best predictive ability that was not selected; compare the predictive ability of the current preferred model set with that of the selected classification ensemble model set with the best predictive ability; if the predictive ability of the current preferred model set is better than that of the selected classification ensemble model set, then the preferred model set remains unchanged; otherwise, the selected classification ensemble model set is used as the preferred model set; until all classification ensemble model sets have been selected and the preferred model set remains unchanged. Step 6: Determine whether all the classifiers to be filtered in the candidate model set have been selected; if yes, use each classifier to be filtered in the current preferred model set as the filtered classifier; if no, return to step 3 until all the classifiers to be filtered in the candidate model set have been selected, and use each classifier to be filtered in the current preferred model set as the filtered classifier.
5. The variety identification method based on ensemble learning according to claim 1, characterized in that, The method further includes: Filtering and optimizing the variety database can be done in the following ways: If the variety database contains samples where more than half of the constructed classifiers misclassify or the constructed ensemble classifier predicts a classification result less than a set threshold, then the sample is removed. If the number of samples for a variety is less than the sample threshold, or if more than half of the samples are considered to be excluded, then all samples of that variety are excluded.
6. A variety identification system based on ensemble learning, characterized in that, The system includes: A data preprocessing module is used to preprocess the molecular genetic marker data of each sample from all varieties in the variety database to obtain a feature data matrix. The feature data matrix includes: a sample feature matrix for each sample corresponding to each variety; a sample feature matrix including: a genotype feature matrix corresponding to each molecular genetic marker locus; and a genotype feature matrix including: feature values of each type of genotype corresponding to the current molecular genetic marker locus. The genotype types include known types and unknown / undetected types. The feature value of a known type of genotype is the number of corresponding genotypes. The feature values of unknown / undetected types of genotypes are set based on a set rule. The set rule includes: a non-zero natural number with a first threshold as the mean, conforming to a specific distribution, and a maximum value not exceeding a second threshold. If a feature value exceeds the second threshold, it is changed to the second threshold. The classifier selection module, connected to the data preprocessing module, is used to construct and select classifiers based on the feature data matrix and the variety to which each sample belongs; The model building module, connected to the classifier selection module, is used to construct an ensemble classifier for each molecular genetic marker locus based on the selected classifiers, in order to build a prediction model. This includes: constructing an ensemble classifier for each molecular genetic marker locus based on the algorithms and weighting coefficients corresponding to the selected classifiers; wherein the ensemble classifier includes sub-classifiers constructed by the algorithms corresponding to the selected classifiers; based on a two-way selection rule, each ensemble classifier is selected as a classifier to be screened, and multiple ensemble classifiers corresponding to molecular genetic marker loci are selected as determined ensemble classifiers for constructing the prediction model based on the prediction evaluation results of the ensemble classifiers corresponding to each molecular genetic marker locus, in order to construct the prediction model. The prediction model includes: a locus classification module, comprising determined ensemble classifiers, used to output classification results for each variety of the corresponding sample based on the genotype feature matrix corresponding to the corresponding molecular genetic marker locus of the sample; wherein, if the value of the corresponding classification result is zero, the result is assigned a non-zero constant less than 1 / s; wherein s is the total number of varieties in the variety database; a fusion module, connected to the locus classification module, used to accumulate and multiply the classification results of each variety of the sample output by each ensemble classifier to obtain the L value of each variety of the sample; and an identification result output module, connected to the fusion module, used to calculate the probability value of each variety corresponding to the corresponding sample based on the L value of each variety of the corresponding sample, so as to output the corresponding variety identification result. The variety identification module, connected to the model construction module, is used to preprocess the molecular genetic marker data of the sample to be tested based on the constructed prediction model, and output the corresponding variety identification result according to the sample feature matrix obtained by preprocessing.
7. A variety identification terminal based on ensemble learning, characterized in that, include: One or more memories and one or more processors; The one or more memories are used to store computer programs; The one or more processors are connected to the memory and are used to run the computer program to perform the method as described in any one of claims 1 to 5.