Animal and plant evaluation method and device based on genetic algorithm, equipment and medium
By setting mutation rate and crossover rate in the genetic algorithm and combining it with neural network model to evaluate gene encoding, the problems of high iteration count and low quality of target solution in animal and plant breeding by genetic algorithm are solved, realizing an efficient and low-cost breeding process.
Patent Information
- Application Number
- CN202310731895.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-19
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-06-19
AI Technical Summary
Existing genetic algorithms suffer from excessive iterations and low-quality target solutions in plant and animal breeding, exhibiting problems of blindness and inefficiency.
By setting preset mutation and crossover rates, the genetic algorithm is used to simulate the breeding process of plants and animals. Combined with a neural network model, the quality of gene coding is evaluated, and high-quality genes are screened out to guide breeding.
This improved breeding efficiency, reduced the number of iterations, resulted in better varieties that met the needs, and lowered costs.
Smart Images

Figure CN116776972B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and in particular to a method, apparatus, equipment and medium for evaluating plants and animals based on genetic algorithms. Background Technology
[0002] In modern agriculture, to obtain better-performing plants and animals, it is usually necessary to breed them for many generations and observe the performance of each generation. For example, multiple hybridization experiments are conducted on rice to obtain high-yielding or disease-resistant varieties. However, multi-generation breeding experiments consume a significant amount of time and money. Therefore, genetic algorithms are introduced into the plant and animal breeding process. Genetic algorithms are used to extract the genes to be simulated and to perform crossover and mutation of gene pairs, thereby simulating the hybridization and mutation processes of plants and animals and improving the efficiency of plant and animal breeding practices. However, since crossover and mutation in genetic algorithms are random events, they have a certain degree of randomness, requiring numerous experiments and multiple iterations to obtain the target solution, leading to low efficiency and the possibility of getting trapped in local optima, resulting in plants and animals corresponding to the target solution that are not of sufficient quality. Summary of the Invention
[0003] In view of this, this application provides a method, apparatus, medium and equipment for evaluating plants and animals based on genetic algorithms, which solves the problems of excessive iterations and insufficient quality of target solutions in existing schemes.
[0004] A first aspect of this application provides a method for evaluating plants and animals based on a genetic algorithm, the method comprising:
[0005] Obtain evaluation indicators, determine the initial gene to be scored based on the evaluation indicators, and determine the chromosome where the initial gene is located as the initial chromosome;
[0006] A preset mutation rate is set for the location of each gene on the initial chromosome, and the preset mutation rate corresponding to the location of the initial gene is increased to obtain the target mutation rate corresponding to the location of the initial gene.
[0007] A genetic algorithm is used to perform genetic simulation on the initial chromosome based on a preset crossover rate, a preset mutation rate, and a target mutation rate to obtain the target chromosome.
[0008] The gene encoding of the target chromosome is input into a preset neural network model;
[0009] In the preset neural network model, the evaluation score of the target chromosome is determined based on the properties and / or functions of the protein corresponding to the gene encoding, and the role of the protein in biological signaling pathways; if the evaluation score is higher than a preset threshold, the gene encoding the gene corresponding to the evaluation score is determined to be a high-quality gene.
[0010] In a second aspect of the present application, a plant and animal evaluation device based on a genetic algorithm is provided, the device comprising:
[0011] An initialization module is configured to obtain an evaluation index, determine an initial gene to be scored according to the evaluation index, and determine a chromosome where the initial gene is located as an initial chromosome;
[0012] An iteration module is configured to set a preset mutation rate for each gene position on the initial chromosome, increase the preset mutation rate corresponding to the initial gene position, obtain a target mutation rate corresponding to the initial gene position, and perform genetic simulation on the initial chromosome according to a preset crossover rate, the preset mutation rate, and the target mutation rate by using a genetic algorithm to obtain a target chromosome;
[0013] An evaluation module is configured to input gene encoding of the target chromosome into a preset neural network model, determine an evaluation score of the target chromosome according to properties and / or effects of a protein corresponding to the gene encoding and an effect of the protein in a biological signal pathway in the preset neural network model, and determine that the gene encoding corresponding to the evaluation score is a high-quality gene if the evaluation score is higher than a preset threshold.
[0014] In a third aspect of the present application, an electronic device is provided, comprising a storage medium, a processor, and instructions or codes stored on the storage medium and executable on the processor, wherein the processor executes the instructions or codes to implement the plant and animal evaluation method based on a genetic algorithm.
[0015] In a fourth aspect of the present application, a storage medium is provided, which stores instructions or codes, wherein the instructions or codes are executed by a processor to implement the plant and animal evaluation method based on a genetic algorithm.
[0016] The plant and animal evaluation method, device, equipment, and medium based on a genetic algorithm simulate the breeding and gene mutation of plants and animals through the genetic algorithm, obtain superior chromosomes through multiple iterations, and then screen out plant and animal individuals with better performance according to the superior chromosomes, and use the screened plant and animal individuals for breeding. In this process, different evaluation indexes can be set according to actual needs, and the mutation rate of genes related to the evaluation indexes can be increased. The higher the mutation rate of a gene, the higher the probability of gene mutation of the gene, so the probability of gene mutation related to the evaluation index is higher, thereby realizing targeted mutation of chromosomes to realize directional evolution. Compared with traditional methods, the above method has strong directionality, and can obtain offspring that meet the requirements in fewer iteration times, thereby obtaining higher benefits. Compared with the traditional method of obtaining excellent varieties through hybridization, the scheme has short time consumption, high efficiency, and low cost.
[0017] The above description is only a summary of the technical solutions of the present application. In order to enable the technical means of the present application to be more clearly understood and implemented according to the content of the description, and in order to enable the above and other purposes, characteristics and advantages of the present application to be more apparent and easy to understand, the following specific embodiments of the present application are described. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0019] Figure 1 A schematic diagram of a plant and animal evaluation method based on a genetic algorithm provided by an embodiment of the present application is shown;
[0020] Figure 2 A flowchart of another plant and animal evaluation method based on a genetic algorithm provided by an embodiment of the present application is shown;
[0021] Figure 3 A structural block diagram of a plant and animal evaluation device based on a genetic algorithm provided by an embodiment of the present application is shown;
[0022] Figure 4 A structural block diagram of an electronic device provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0023] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0024] The plant and animal evaluation method based on a genetic algorithm provided by the embodiments of the present application can be applied to electronic devices with instruction or program running capability. The electronic devices can be, but are not limited to, various servers, workstations, personal computers, notebook computers, etc. Running in different computing devices is only a difference in the execution subject of the scheme, and those skilled in the art can predict that running in different computing devices can produce the same technical effects. The present application will be described in detail below through specific embodiments.
[0025] Please refer to Figure 1 shown, Figure 1A flowchart of a plant and animal evaluation method based on a genetic algorithm provided by an embodiment of the present application includes the following steps:
[0026] S10: Obtain evaluation indexes, determine initial genes to be scored according to the evaluation indexes, and determine the chromosome where the initial genes are located as initial chromosomes.
[0027] The method provided by the present application can simulate new genes by an iterative evolution method and analyze the new genes to obtain superior genes of the evaluation indexes, and then generate a corresponding breeding plan according to the superior genes to guide the reproduction of plants and animals. The evaluation indexes can be set according to actual business needs.
[0028] For example, for a dairy cow breeding research project, the milk yield can be used as an evaluation index. According to existing research, it is known that some genes of dairy cows can affect milk yield. Therefore, these genes can be used as initial genes to be scored, and the chromosomes where the initial genes are located are initial chromosomes. Then, the genetic algorithm is used for iteration, the performance of each offspring generated by iteration is analyzed, and it is determined that the milk yield is higher when the gene is of a certain structure. The gene of this structure is the superior gene. The existing dairy cows are subjected to gene detection to obtain dairy cows carrying the superior genes, and the dairy cows carrying the superior genes are used for breeding. Compared with other dairy cows, the offspring obtained by breeding the dairy cows carrying the superior genes also have a higher probability of carrying the superior genes. Therefore, through such a breeding plan, high-yield dairy cows can be obtained, which is conducive to the breeding of excellent breeds and obtaining higher yields.
[0029] Based on this, the initial genes to be scored are first determined according to the evaluation indexes, and the chromosomes where the initial genes are located are determined as initial chromosomes. It can be understood that each chromosome is composed of multiple genes, and each gene is represented by a string of base letters. The initial genes to be scored can be determined according to actual needs, which are genes that may have an impact on the target variation direction. For example, if the evaluation index is the ability of poultry to resist avian influenza, genes that may have an impact on resistance are searched as initial genes.
[0030] S20: Set a preset variation rate for the position of each gene on the initial chromosome, and increase the preset variation rate corresponding to the position of the initial gene to obtain a target variation rate corresponding to the position of the initial gene.
[0031] Unlike the traditional random mutation method, this step performs mutation with a certain direction, so that the mutated poultry has a higher probability of obtaining genes resistant to avian influenza.
[0032] In a specific application, first, a preset mutation rate is set for each gene on the chromosome, and then the mutation rate of the initial gene position on the chromosome is adjusted to the target mutation rate, while the mutation rate of other genes on the chromosome remains the preset mutation rate unchanged, wherein the target mutation rate is greater than the preset mutation rate, and the specific values of the preset mutation rate and the target mutation rate can be determined according to historical experience. For example, if it is determined that the 3-10th genes on the chromosome are likely to be genes related to the resistance of poultry, the preset mutation rate corresponding to the position of the genes can be increased to obtain the corresponding target mutation rate; and the mutation rates of other positions remain unchanged. When determining the genes on the chromosome to be subjected to mutation operation, there is a higher probability of selecting genes with high mutation rates, and therefore it is more likely to select the genes related to milk yield for mutation to promote the generation of more different resistance gene combinations, and then screen out the best genes among them. Compared with the traditional genetic algorithm which can only perform random mutation, this mutation method has higher optimization efficiency, more specific target and more focused problem to be solved, and the desired results can be obtained through fewer iteration times.
[0033] S30: performing genetic simulation on the initial chromosome according to the preset crossover rate, the preset mutation rate and the target mutation rate by using the genetic algorithm to obtain a target chromosome.
[0034] In this step, the initial chromosome is iterated by using the genetic algorithm to obtain a target chromosome. It can be understood that the genetic algorithm (Genetic Algorithm, GA) is a computational model simulating the natural selection and genetic mechanism of the biological evolution process of Darwin's biological evolution theory, which is a method of searching for optimal solutions by simulating the natural evolution process, including steps such as crossover, mutation, selection, etc.
[0035] In one possible specific application scenario, the genetic algorithm includes the following steps:
[0036] Step 1: representing the problem variable domain as a fixed-length chromosome, selecting the size of the chromosome population, the crossover probability and the mutation probability;
[0037] Step 2: defining a fitness function to measure the performance or fitness of a single chromosome in the problem domain;
[0038] Step 3: randomly generating an initial population of chromosomes with a size of N;
[0039] Step 4: calculating the fitness of each chromosome;
[0040] Step 5: selecting a pair of chromosomes from the current population for pairing, and the probability of selecting parent chromosomes is related to their fitness;
[0041] Step 6: Create a pair of offspring chromosomes through genetic manipulation - crossover and mutation;
[0042] Step 7: Put the created offspring chromosomes into a new population;
[0043] Step 8: Repeat Step 5 until the size of the new chromosome population equals the size N of the initial chromosome population;
[0044] Step 9: Replace the initial parent chromosome population with the new offspring chromosome population;
[0045] Step 10: Go to Step 4 and repeat the process until the termination condition is met.
[0046] In this embodiment, the chromosomes where the initial genes to be scored are located are taken as the problem variable domain. For example, the purpose of this evolutionary simulation is to find genes that can improve the milk yield of dairy cows, so the problem variable domain is all the chromosomes where the genes known to be related to the milk yield of dairy cows are located. Each chromosome is composed of N genes, and each gene is represented by a string of base letters. The size of the chromosome population, the crossover probability, and the mutation probability can be arbitrarily chosen by humans and are determined according to actual needs, wherein the crossover probability can be set to 100%, i.e., all offspring are generated through hybridization. Design the fitness function, which can represent the performance of the chromosome, and the fitness function lays the foundation for selecting the chromosome to be inherited in the breeding process, wherein the setting method of the fitness function is the same as that of the existing genetic algorithm. Then a chromosome initial population of size N is randomly generated, which includes N chromosomes, denoted as x1, x2, …, xN. According to the fitness function, the fitness of each chromosome is calculated and denoted as f(x1), f(x2), … f(xN). A pair of chromosomes is selected from the current population for pairing, and crossover and mutation operations are performed on the pair of chromosomes to obtain a pair of offspring chromosomes. The probability of selecting a chromosome is related to its fitness, and a parent chromosome with higher fitness can be selected for crossover and mutation operation. The offspring chromosomes obtained by crossover and mutation are added to the new population, and the operation of selecting a pair of chromosomes for crossover and mutation and adding them to the new population is repeated until the size of the new population also reaches N. The new population replaces the initial parent chromosome population, and one iteration operation is completed. Return to the step of calculating the fitness of each chromosome, and the subsequent steps are all for the new initial parent chromosome population. In this way, multiple iterations are repeated until the termination condition is met.
[0047] This embodiment simulates the evolutionary process using genetic algorithms. Compared with traditional hybridization experiments, the simulation process of this embodiment is implemented using a computer, so it is more efficient and less costly.
[0048] In step S30, the initial chromosome is simulated by using a genetic algorithm according to a preset crossover rate, a preset mutation rate and a target mutation rate to obtain a target chromosome, including the following steps:
[0049] S31: An initial population corresponding to the initial chromosome is constructed, and the initial population is used as an iteration population, and the chromosomes in the initial population are used as iteration chromosomes;
[0050] S32: The fitness of each iteration chromosome is calculated according to a preset fitness function;
[0051] S33: The iteration chromosomes are subjected to a crossover operation and a mutation operation according to the fitness, the preset crossover rate, the preset mutation rate and the target mutation rate to obtain offspring chromosomes;
[0052] S34: The offspring chromosomes are used as new iteration chromosomes to form a new iteration population, and the step of calculating the fitness of each iteration chromosome according to the preset fitness function is returned until a preset termination condition is met;
[0053] S35: The target chromosome is determined from the iteration chromosomes in the iteration population.
[0054] In steps S31-S35, in the specific operation process, a new population is generated by performing genetic operations on individuals with a certain structure in the population, so as to gradually approach the optimal solution. In the solving process, a fixed-size population is set, each individual in the population represents a possible solution to the problem, the degree to which the individual adapts to the environment is judged by the fitness function, and the individual with poor fitness is eliminated, and the individual with good fitness is allowed to continue to reproduce. During the reproduction process, selection, crossover and mutation can be performed to form a new population, and the process is repeated until more and better solutions are obtained.
[0055] Specifically, first, a population initialization operation is performed to generate an initial population representing a potential solution set of the problem. In the population initialization process, the population size can be set according to the actual application scenario and historical experience. Specifically, a large population size can avoid falling into a local optimum, and a small population size can reduce the amount of calculation. The initial population is recorded as an iteration population, and the chromosomes in the initial population are recorded as iteration chromosomes.
[0056] Then, selection is performed on all the chromosomes, and according to the fitness of each chromosome, the inferior chromosomes are eliminated according to the principle of survival of the fittest. Specifically, the fitness function of each chromosome is calculated, and the higher the fitness, the better the chromosome is considered. Therefore, the chromosomes with higher fitness are used as parent chromosomes to obtain offspring chromosomes, and the chromosomes with lower fitness do not leave offspring. In this way, a new iteration population is obtained. In the specific application process, the selection of chromosomes with higher fitness can be realized by using roulette selection method, tournament selection method, etc. Other selection strategies can also be used according to actual needs.
[0057] Among them, the offspring chromosomes are obtained by using the crossover and mutation operations on the iteration chromosomes. It can be understood that crossover is sexual reproduction. It combines genetic material from both parents to produce excellent offspring. A crossover point of a parent chromosome is randomly selected, and then the chromosome part after the point is exchanged, that is, two new offspring are generated. Mutation is a genetic operation that changes one or more gene values on a chromosome. The possibility of mutation of each gene on the chromosome depends on the mutation rate corresponding to the position of the gene. Since mutation can mutate a base pair of a gene into a new base pair, randomness is introduced through mutation. Through crossover and mutation, the natural evolution process can be simulated.
[0058] Through the above steps, one iteration operation is completed. In actual application, the above iteration operation can be repeatedly cycled, and through multiple iterations, chromosomes with better performance, that is, target chromosomes, are obtained.
[0059] Among them, the preset termination condition corresponds to the evaluation index.
[0060] Correspondingly, in step S35, the target chromosome is determined among the iteration chromosomes in the iteration population, including:
[0061] S351: In the iteration population, the iteration chromosome corresponding to the preset termination condition is determined as the target chromosome.
[0062] Specifically, the evaluation index is determined according to the actual business needs, and then the preset termination condition is determined according to the evaluation index. For example, if the actual business requirement is to find poultry that is not susceptible to avian influenza virus and to breed, the evaluation index is the ability of poultry to resist avian influenza, and then the genes that may have an impact on resistance can be found as initial genes, and the chromosomes where they are located are initial chromosomes. The preset termination condition is that the binding rate of the protein formed by the gene code corresponding to the iteration chromosome in the iteration population to the avian influenza virus is 0, and the iteration chromosome is the target chromosome. In actual application, the preset termination condition can also be set to a value close to 0 to avoid always failing to meet the preset termination condition.
[0063] The embodiment is different from the traditional method of taking the iteration number as the termination condition, but sets the termination condition according to the target mutation direction, so as to ensure that the final result is the required result. Meanwhile, the iteration is avoided in the case where the required result is obtained, so as to avoid increasing the operation amount and wasting time.
[0064] In step S33, the iteration chromosome is subjected to the crossover operation and the mutation operation according to the fitness, the preset crossover rate, the preset mutation rate and the target mutation rate, so as to obtain the offspring chromosome, including the following steps.
[0065] S321: At least one pair of genes to be crossed is randomly selected from the iteration chromosome according to the fitness and the preset crossover rate, and the positions of the pair of genes to be crossed are exchanged, so as to obtain the offspring chromosome.
[0066] S322: At least one gene to be mutated is determined from the iteration chromosome according to the fitness, the preset mutation rate and the target mutation rate, and the gene to be mutated is changed into the target gene corresponding to the target mutation direction, so as to obtain the offspring chromosome.
[0067] In steps S321-S322, specifically, a plurality of pairs of chromosomes to be subjected to the crossover operation are selected from the iteration chromosome according to the fitness and the preset crossover rate, and the genes to be subjected to the crossover operation on each pair of chromosomes are determined, and then the genes are exchanged, so as to obtain a new pair of chromosomes, i.e. the offspring chromosome. The genes to be subjected to the crossover operation can be a segment of genes, one gene, or a plurality of segments of genes or a plurality of genes. For example, one crossover point can be determined in the chromosome, and the genes after the crossover point are the genes to be subjected to the crossover operation; or two crossover points can be determined in the chromosome, and the genes between the two crossover points are the genes to be subjected to the crossover operation; or one crossover point can be determined in the chromosome, and the gene at the crossover point is the gene to be subjected to the crossover operation. It can be understood that the higher the fitness, the higher the probability of being selected to be subjected to the crossover operation; the lower the fitness, the lower the probability of being selected to be subjected to the crossover operation; the higher the preset crossover rate, the more the chromosomes subjected to the crossover operation; and the lower the preset crossover rate, the fewer the chromosomes subjected to the crossover operation.
[0068] The mutation operation is to select a plurality of chromosomes to be subjected to the mutation operation, determine the genes to be subjected to the mutation operation on the chromosome according to the mutation rate of each gene in the chromosome, and then mutate the gene to change the base structure in the gene to obtain a new chromosome, i.e., a child chromosome. It can be understood that the fitness of each chromosome is different, and the higher the fitness, the higher the probability of being selected for mutation operation; the lower the fitness, the lower the probability of being selected for mutation operation; the mutation rate of each gene in the chromosome can be different, the mutation rate of the initial gene is the target mutation rate, which is higher than the mutation rate of other positions, i.e., the preset mutation rate. As in the foregoing embodiment, the genes at positions 3-10 in the chromosome can be genes related to the resistance of poultry, and the initial gene corresponds to positions 3-10, so in each iteration process, the mutation rate of positions 3-10 in each chromosome is the target mutation rate, and the mutation rate of other positions in each chromosome is the preset mutation rate. The higher the mutation rate, the higher the probability of mutation operation of the gene; the lower the mutation rate, the lower the probability of mutation operation of the gene.
[0069] S40: input the gene code of the target chromosome into the preset neural network model;
[0070] S50: in the preset neural network model, determine the evaluation score of the target chromosome according to the properties and / or effects of the protein corresponding to the gene code and the effect of the protein in the biological signal pathway.
[0071] S60: if the evaluation score is higher than the preset threshold, determine that the gene code corresponding to the evaluation score is a high-quality gene.
[0072] In steps S40-S60, the target chromosome is scored according to the gene code of the target chromosome. If the score reaches the preset threshold, it can be considered that the gene code corresponding to the target chromosome is a high-quality gene, and the target chromosome is a dominant chromosome. Then, a corresponding breeding plan can be generated based on the dominant chromosome. Individuals of animals and plants carrying high-quality genes are screened out, and high-quality varieties are bred to obtain better offspring.
[0073] In this embodiment, a neural network model is designed in advance, and the scoring process is completed in the model according to the relationship between the gene sequence and the protein properties and the biological signal pathway. Specifically, in the preset neural network model, the relationship between the gene sequence and the protein properties, functions, and biological signal pathways is comprehensively analyzed to obtain the properties and / or functions of the protein and the role of the protein in the biological signal pathway, so that the performance characteristics of the plants and animals carrying the gene can be predicted, and the prediction can be used as a basis for formulating a breeding plan, and the direction is more clear. In addition, unlike the traditional genetic algorithm which only considers the inhibition or opening state of a certain gene level, this embodiment further analyzes each base mutation inside the gene and its corresponding protein structure and function through protein analysis, and the analysis is more in-depth.
[0074] This embodiment uses genetic algorithm to simulate the breeding of plants and animals and gene mutation in a directional manner based on the evaluation indexes corresponding to the actual business needs, and obtains the superior genes and superior chromosomes through multiple iterations, thereby guiding the generation of a breeding plan. Compared with the traditional random and blind method, this embodiment has a strong purpose, so it is time-saving, efficient, and low-cost, and reduces the probability of falling into a local optimal solution to result in a suboptimal target chromosome.
[0075] In step S50, the evaluation score of the target chromosome is determined according to the properties and / or functions of the protein corresponding to the gene coding and the role of the protein in the biological signal pathway, including the following steps:
[0076] S51: determining the properties and / or functions of the protein corresponding to the gene coding as a first prediction value;
[0077] S52: constructing a knowledge graph network according to the role of the protein in the biological signal pathway, and taking the knowledge network graph as a second prediction value;
[0078] S53: determining the evaluation score of the target chromosome according to the first prediction value and the second prediction value.
[0079] In steps S51-S53, the protein corresponding to the gene coding of the target chromosome is scored to obtain the evaluation score. In a specific application process, the prediction factor is the gene sequence, the gene coding corresponding to the value chromosome is input into the neural network model, at least one of the properties and functions of the protein corresponding to the gene coding is obtained as a first prediction value, and the role of the protein in the biological signal pathway is obtained, and a knowledge network graph is constructed based on the role as a second prediction value. The first prediction value and the second prediction value are comprehensively analyzed, for example, the first prediction value and the second value are weighted to obtain the final evaluation score.
[0080] In step S51, the property and / or the function of the protein coded by the gene is determined as the first predicted value, including the following steps:
[0081] S511: determining the interaction relationship between the protein coded by the gene and other proteins as the predicted function;
[0082] S512: determining the binding relationship between the protein coded by the gene and a preset drug as the first predicted property;
[0083] S513: determining the affinity of the protein coded by the gene to a protein receptor as the second predicted property;
[0084] S514: taking at least one of the predicted function, the first predicted property and the second predicted property as the first predicted value; or, performing weighted summation on at least two of the predicted function, the first predicted property and the second predicted property to obtain the first predicted target value.
[0085] In steps S511-S514, the first predicted value is determined by at least one of the predicted function, the first predicted property and the second predicted property, wherein the predicted function indicates the interaction relationship between the protein coded by the gene and other proteins. It can be understood that, for animals and plants, different genes can generate different proteins, and the proteins can interact with each other and transmit signals, thereby constituting the basic unit of biological signal pathways. Therefore, the interaction relationship between the proteins can be taken as one of the influencing factors of the first preset value.
[0086] In addition, the binding rate of the protein to the drug also affects the performance of the animals and plants, and therefore, the binding relationship between the protein coded by the gene and the preset drug can be taken as an influencing factor of the first preset value. For example, the specific binding rate value can be used to represent the first predicted property, and the binding rate is a value between 0 and 1, which is 1 if the protein binds to the drug and 0 if the protein does not bind to the drug. If the binding relationship between the protein and multiple drugs is determined at the same time, a vector can also be used as the first predicted property, and each element in the vector represents the binding rate between the protein and one drug. It can be understood that, in actual application, other values can also be used to represent the binding rate, such as values between 1 and 10.
[0087] Further, the affinity of the protein to the protein receptor also affects the performance of the animals and plants, and therefore, the affinity of the protein coded by the gene to the protein receptor can be taken as an influencing factor of the first preset value. Similar to the binding rate of the drug, the specific affinity value can also be used to represent the second predicted property, and the larger the value is, the stronger the affinity is, and vice versa.
[0088] In step S52, a knowledge graph network is constructed according to the role of the protein in the biological signal pathway, including the following steps:
[0089] S521: A plurality of gene-encoded corresponding proteins are taken as nodes, and the interaction relationship between each two gene-encoded corresponding proteins is taken as an edge to construct a knowledge graph network.
[0090] In step S521, a knowledge graph network is constructed according to the interaction of the protein. As described above, different gene codes can generate different proteins, and the proteins can interact with each other and transmit signals. Based on this, each gene-encoded corresponding protein in an animal or plant is taken as a node, and the interaction relationship between the proteins represented by each two nodes is taken as an edge to construct a knowledge network graph. Specifically, for example, A gene sequence can improve the milk yield of a dairy cow, B gene sequence can improve the immunity of the dairy cow, and the protein corresponding to the A gene sequence has a negative effect on the protein corresponding to the B gene sequence. Therefore, the dairy cow carrying both A and B gene sequences has high milk yield but low immunity and is prone to illness, so such a dairy cow is not a high-quality dairy cow, and is not used as a breeding cow when formulating a breeding plan.
[0091] This embodiment considers the performance of animals and plants from multiple angles by constructing a knowledge graph network, avoiding breeding animals and plants that perform well in only a single angle but have disadvantages in other angles, thereby reducing the yield.
[0092] Before step S40, the method further includes the following steps:
[0093] S401: Obtain existing genes and input the existing genes as a model;
[0094] S402: Obtain the performance and / or function of the protein corresponding to the existing genes and take it as a first output;
[0095] S403: Construct a knowledge graph network according to the role of the protein of the existing genes in the biological signal pathway, and take it as a second output;
[0096] S404: Train a preset neural network model using the model input, the first output, and the second output.
[0097] In steps S401-S404, before the score is calculated by using the neural network model, the neural network model is first trained, and the parameters of the model are adjusted according to the existing properties and functions of genes and proteins, and the signal pathway knowledge graph, so that the calculation result of the model is more accurate. Specifically, the existing genes are taken as the input of the model, the performance and / or function of the protein, and the signal pathway knowledge graph are taken as the output of the model, and the parameters of the model are adjusted under the condition that the input and output of the model are known.
[0098] Figure 2 The flowchart of the genetic algorithm-based plant and animal evaluation method provided by another embodiment of the present application is shown, as shown in the figure, including the following steps:
[0099] S001: Obtain existing genes and take the existing genes as model input;
[0100] S002: Obtain the performance and / or function of the protein corresponding to the existing gene as the first output;
[0101] S003: Construct a knowledge graph network according to the role of the protein of the existing gene in the biological signal pathway, and take it as the second output;
[0102] S004: Train the preset neural network model by using the model input, the first output, and the second output;
[0103] S005: Obtain an evaluation index, determine an initial gene to be scored according to the evaluation index, and determine the chromosome where the initial gene is located as an initial chromosome;
[0104] S006: Set a preset mutation rate for the position of each gene on the initial chromosome, and increase the preset mutation rate corresponding to the position of the initial gene to obtain a target mutation rate corresponding to the position of the initial gene;
[0105] S007: Construct an initial population corresponding to the initial chromosome, and take the initial population as an iteration population, and the chromosomes in the initial population as iteration chromosomes;
[0106] S008: Calculate the fitness of each iteration chromosome according to a preset fitness function;
[0107] S009: According to the fitness and a preset crossover rate, randomly select at least one pair of genes to be crossed in the iteration chromosome, and exchange the positions of the pair of genes to be crossed to obtain offspring chromosomes;
[0108] S010: According to the fitness, the preset mutation rate, and the target mutation rate, determine at least one gene to be mutated in the iteration chromosome, and change the gene to be mutated into a target gene corresponding to the target mutation direction to obtain offspring chromosomes;
[0109] S011: forming a new iteration population by taking the child chromosome as a new iteration chromosome;
[0110] S012: determining whether a preset termination condition is met; if yes, jumping to step S013; if not, jumping to step S008;
[0111] S013: determining an iteration chromosome corresponding to the preset termination condition in the iteration population as a target chromosome;
[0112] S014: inputting gene encoding of the target chromosome into a preset neural network model;
[0113] S015: determining, in the preset neural network model, an interaction relationship between a protein corresponding to the gene encoding and other proteins as a predicted action, determining a binding relationship between the protein corresponding to the gene encoding and a preset drug as a first predicted property, determining an affinity of the protein corresponding to the gene encoding to a protein receptor as a second predicted property, taking at least one of the predicted action, the first predicted property and the second predicted property as a first prediction value, or, performing weighted summation on at least two of the predicted action, the first predicted property and the second predicted property to obtain the first prediction value;
[0114] S016: constructing, in the preset neural network model, a knowledge graph network by taking proteins corresponding to a plurality of gene encodings as nodes and an interaction relationship between every two proteins corresponding to the gene encodings as edges, and taking the knowledge network graph as a second prediction value;
[0115] S017: determining an evaluation score of the target chromosome according to the first prediction value and the second prediction value;
[0116] S18: if the evaluation score is higher than a preset threshold, determining a gene encoding corresponding to the evaluation score as a high-quality gene.
[0117] For steps S001-S018, the principles and effects are similar to those of the foregoing embodiments, and reference can be made to the related descriptions in the method embodiments. To avoid repetition, no further description is given here.
[0118] It should be understood that the size of the serial number of each step in the foregoing embodiments does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0119] It can be seen that, compared with the existing method, the above scheme simulates the breeding and gene mutation of plants and animals by using a genetic algorithm, obtains superior chromosomes through multiple iterations, and then screens out plant and animal individuals with better performance according to the superior chromosomes, and uses the screened plant and animal individuals for breeding. In this process, different evaluation indexes can be set according to actual needs, and the mutation rate of the genes related to the evaluation indexes can be increased, and the higher the mutation rate of the genes, the higher the probability of gene mutation, so the probability of gene mutation related to the evaluation indexes is higher, thereby realizing targeted mutation of the chromosomes to realize directional evolution. Compared with the traditional method, the above scheme has strong directionality and can obtain offspring that meet the needs more in fewer iteration times, thereby obtaining higher benefits. In addition, the above scheme comprehensively analyzes the molecular properties and functions of the proteins encoded by the genes and the signal pathway knowledge graph to obtain the evaluation score of the chromosome. Compared with the traditional method of only scoring the external performance of plants and animals, the present scheme can clearly indicate what performance the genes will cause the plants and animals to produce, and the evaluation result is more accurate.
[0120] In an embodiment, a plant and animal evaluation device based on a genetic algorithm is provided, which corresponds to the plant and animal evaluation method based on a genetic algorithm in the above embodiment. As shown in the figure, the plant and animal evaluation device based on a genetic algorithm includes an initialization module, an iteration module, and an evaluation module. The functions of each module are described in detail as follows: Figure 3
[0121] The initialization module is configured to obtain evaluation indexes, determine initial genes to be scored according to the evaluation indexes, and determine the chromosome where the initial genes are located as an initial chromosome.
[0122] The iteration module is configured to set a preset mutation rate for each gene position on the initial chromosome, increase the preset mutation rate corresponding to the position of the initial gene, obtain a target mutation rate corresponding to the position of the initial gene, and use a genetic algorithm to simulate the genetic of the initial chromosome according to a preset crossover rate, a preset mutation rate, and a target mutation rate, to obtain a target chromosome.
[0123] The evaluation module is configured to input the gene code of the target chromosome into a preset neural network model, and in the preset neural network model, determine the evaluation score of the target chromosome according to the properties and / or functions of the protein corresponding to the gene code and the role of the protein in the biological signal pathway, and if the evaluation score is higher than a preset threshold, determine the gene code corresponding to the evaluation score as a high-quality gene.
[0124] In an embodiment, the evaluation module is configured to:
[0125] determine the properties and / or functions of the protein corresponding to the gene code as a first prediction value;
[0126] constructing a knowledge graph network according to the roles of the proteins in the biological signal pathways, and taking the knowledge graph network as a second prediction value;
[0127] determining an evaluation score of the target chromosome according to the first prediction value and the second prediction value.
[0128] In an embodiment, the evaluation module is configured to:
[0129] determining that the interaction relationship between the protein corresponding to the gene coding and other proteins is a predicted role;
[0130] determining that the result relationship between the protein corresponding to the gene coding and the preset drug is a first prediction property;
[0131] determining that the affinity of the protein corresponding to the gene coding to the protein receptor is a second prediction property;
[0132] taking one of the predicted role, the first prediction property and the second prediction property as the first prediction value, or performing weighted summation on at least two of the predicted role, the first prediction property and the second prediction property to obtain the first prediction value;
[0133] and:
[0134] constructing a knowledge graph network with the proteins corresponding to the plurality of gene codings as nodes and the interaction relationship between each two of the proteins corresponding to the gene codings as edges.
[0135] In an embodiment, the iteration module is configured to:
[0136] constructing an initial population corresponding to an initial chromosome, and taking the initial population as an iteration population and the chromosomes in the initial population as iteration chromosomes;
[0137] calculating the fitness of each iteration chromosome according to a preset fitness function;
[0138] performing crossover operation and mutation operation on the iteration chromosomes according to the fitness, a preset crossover rate, a preset mutation rate and a target mutation rate to obtain offspring chromosomes;
[0139] taking the offspring chromosomes as new iteration chromosomes to form a new iteration population, and returning to the step of calculating the fitness of each iteration chromosome according to the preset fitness function until a preset termination condition is met;
[0140] determining the target chromosome from the iteration chromosomes in the iteration population.
[0141] In an embodiment, the iteration module is configured to:
[0142] According to the fitness and a preset crossover rate, at least one pair of genes to be crossed is randomly selected in the iteration chromosome, and positions of the pair of genes to be crossed are exchanged to obtain a child chromosome;
[0143] According to the fitness, a preset mutation rate and a target mutation rate, at least one gene to be mutated is determined in the iteration chromosome, and the gene to be mutated is changed into a target gene corresponding to a target mutation direction to obtain a child chromosome.
[0144] In an embodiment, the preset termination condition corresponds to the evaluation index.
[0145] Correspondingly, the iteration module is configured to determine, in the iteration population, an iteration chromosome corresponding to the preset termination condition as a target chromosome.
[0146] In an embodiment, the evaluation module is configured to:
[0147] The existing gene is obtained and used as a model input.
[0148] The performance and / or function of the protein corresponding to the existing gene are obtained and used as a first output.
[0149] A knowledge graph network is constructed according to the role of the protein of the existing gene in a biological signal pathway, and used as a second output.
[0150] The preset neural network model is trained by using the model input, the first output and the second output.
[0151] In an embodiment, an electronic device is provided, which can be a mobile device such as a mobile phone, a tablet, a vehicle-mounted mobile terminal, or other devices with program execution capability. The internal structure of the electronic device can be as shown in Figure 4 The electronic device includes a processor, a memory and a network module. The processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes non-volatile and / or volatile storage media, internal memory. The non-volatile storage medium stores an operating system, instructions or codes. The internal memory provides an environment for the operating system and instructions or codes in the non-volatile storage medium to run. The instructions or codes are executed by the processor to implement the functions or steps of the above-mentioned plant and animal evaluation method based on genetic algorithm. The network module of the electronic device can include a network interface and / or a wireless network module, and the electronic device can communicate with other devices or service platforms through the network module. In addition, the electronic device can further include a display screen and an input device, etc.
[0152] In an embodiment, an electronic device is provided, which includes a memory, a processor and instructions or codes stored in the memory and executable on the processor, and the processor executes the instructions or codes to implement the following steps:
[0153] an evaluation index is obtained, an initial gene to be scored is determined according to the evaluation index, and a chromosome in which the initial gene is located is determined as an initial chromosome;
[0154] A preset mutation rate is set for each gene position on the initial chromosome, and the preset mutation rate corresponding to the position of the initial gene is increased to obtain a target mutation rate corresponding to the position of the initial gene;
[0155] A genetic algorithm is used to perform genetic simulation on the initial chromosome according to a preset crossover rate, a preset mutation rate and the target mutation rate to obtain a target chromosome;
[0156] The gene code of the target chromosome is input into a preset neural network model;
[0157] In the preset neural network model, an evaluation score of the target chromosome is determined according to properties and / or functions of proteins corresponding to the gene code and functions of the proteins in biological signal pathways;
[0158] If the evaluation score is higher than a preset threshold, the gene code corresponding to the evaluation score is determined as a high-quality gene.
[0159] In an embodiment, a storage medium having instructions or codes stored thereon is provided, and the instructions or codes are executed by a processor to implement the following steps:
[0160] an evaluation index is obtained, an initial gene to be scored is determined according to the evaluation index, and a chromosome in which the initial gene is located is determined as an initial chromosome;
[0161] A preset mutation rate is set for each gene position on the initial chromosome, and the preset mutation rate corresponding to the position of the initial gene is increased to obtain a target mutation rate corresponding to the position of the initial gene;
[0162] A genetic algorithm is used to perform genetic simulation on the initial chromosome according to a preset crossover rate, a preset mutation rate and the target mutation rate to obtain a target chromosome;
[0163] The gene code of the target chromosome is input into a preset neural network model;
[0164] In the preset neural network model, an evaluation score of the target chromosome is determined according to properties and / or functions of proteins corresponding to the gene code and functions of the proteins in biological signal pathways;
[0165] If the evaluation score is higher than a preset threshold, the gene code corresponding to the evaluation score is determined as a high-quality gene.
[0166] It should be noted that the functions or steps that the storage medium or the electronic device can implement described above can be referred to the related description in the foregoing method embodiments, and will not be described here again to avoid repetition.
[0167] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing relevant hardware through instructions or codes, and the instructions or codes can be stored in a non-volatile readable storage medium. When the instructions or codes are executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, storage, database or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0168] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of functional units and modules is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the above-mentioned functions.
[0169] Those skilled in the art can understand that the units or processes in the drawings are not necessarily necessary for the implementation of the present application. Those skilled in the art can understand that the units in the system in the implementation scenario can be distributed in the system in the implementation scenario according to the description of the implementation scenario, or can be changed to be located in one or more systems different from the implementation scenario. The units of the above-mentioned implementation scenario can be combined into one unit, or can be further split into multiple sub-units.
[0170] The above-described embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit the present application; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A method for evaluating animals and plants based on a genetic algorithm, characterized by, The method comprises: obtaining an evaluation index, determining an initial gene to be scored according to the evaluation index, and determining a chromosome where the initial gene is located as an initial chromosome; setting a preset mutation rate for each gene position on the initial chromosome, and increasing the preset mutation rate corresponding to the position of the initial gene to obtain a target mutation rate corresponding to the position of the initial gene; performing genetic simulation on the initial chromosome according to a preset crossover rate, the preset mutation rate and the target mutation rate by using a genetic algorithm to obtain a target chromosome; inputting gene coding of the target chromosome into a preset neural network model; in the preset neural network model, determining an evaluation score of the target chromosome according to properties and / or effects of proteins corresponding to the gene coding and effects of the proteins in biological signal pathways; if the evaluation score is higher than a preset threshold, determining that the gene coding corresponding to the evaluation score is a high-quality gene.
2. The method of claim 1, wherein, The method comprises: determining properties and / or effects of proteins corresponding to the gene coding as a first prediction value; constructing a knowledge graph network according to the effects of the proteins in biological signal pathways, and taking the knowledge graph network as a second prediction value; determining the evaluation score of the target chromosome according to the first prediction value and the second prediction value.
3. The method of claim 2, wherein, The method comprises: determining an interaction relationship between the protein corresponding to the gene coding and other proteins as a predicted effect; determining a binding relationship between the protein corresponding to the gene coding and a preset drug as a first predicted property; determining an affinity of the protein corresponding to the gene coding to a protein receptor as a second predicted property; taking one of the predicted effect, the first predicted property and the second predicted property as the first prediction value; or, performing weighted summation on at least two of the predicted effect, the first predicted property and the second predicted property to obtain the first prediction value. The method comprises: taking proteins corresponding to a plurality of gene codings as nodes and interaction relationships between proteins corresponding to each two gene codings as edges to construct the knowledge graph network.
4. The method of claim 2, wherein, The method comprises: constructing an initial population corresponding to the initial chromosome, and taking the initial population as an iteration population and chromosomes in the initial population as iteration chromosomes; calculating an adaptability of each iteration chromosome according to a preset adaptability function; performing crossover operation and mutation operation on the iteration chromosomes according to the adaptability, the preset crossover rate, the preset mutation rate and the target mutation rate to obtain offspring chromosomes; and performing genetic simulation on the initial chromosome according to a preset crossover rate, the preset mutation rate and the target mutation rate by using a genetic algorithm to obtain a target chromosome. The offspring chromosomes are taken as new iteration chromosomes to form a new iteration population, and the step of calculating the fitness of each iteration chromosome according to the preset fitness function is returned until a preset termination condition is met; An iteration chromosome corresponding to the preset termination condition is determined from the iteration chromosomes in the new iteration population as the target chromosome.
5. The method of claim 4, wherein, The cross operation and the mutation operation are performed on the iteration chromosomes according to the fitness, the preset crossover rate, the preset mutation rate and the target mutation rate to obtain offspring chromosomes, including: At least one pair of genes to be crossed is randomly selected from the iteration chromosomes according to the fitness and the preset crossover rate, and the positions of the pair of genes to be crossed are exchanged to obtain the offspring chromosomes; At least one gene to be mutated is determined from the iteration chromosomes according to the fitness, the preset mutation rate and the target mutation rate, and the gene to be mutated is changed into a target gene corresponding to a target mutation direction to obtain the offspring chromosomes.
6. The method of claim 5, wherein, The preset termination condition corresponds to the evaluation index.
7. The method of claim 2, wherein, Before the gene encoding of the target chromosome is input into the preset neural network model, the method further includes: An existing gene is obtained and taken as a model input; The properties and / or functions of a protein corresponding to the existing gene are obtained and taken as a first output; A knowledge graph network is constructed according to the role of the protein of the existing gene in a biological signal pathway and taken as a second output; The preset neural network model is trained by using the model input, the first output and the second output.
8. A plant and animal evaluation device based on a genetic algorithm, characterized in that, The device includes: An initialization module is configured to obtain an evaluation index, determine an initial gene to be scored according to the evaluation index, and determine a chromosome where the initial gene is located as an initial chromosome; An iteration module is configured to set a preset mutation rate for each gene position on the initial chromosome, increase the preset mutation rate corresponding to the initial gene position, obtain a target mutation rate corresponding to the initial gene position, and perform genetic simulation on the initial chromosome according to a preset crossover rate, the preset mutation rate and the target mutation rate by using a genetic algorithm to obtain a target chromosome; An evaluation module is configured to input gene encoding of the target chromosome into a preset neural network model, and determine an evaluation score of the target chromosome according to the properties and / or roles of a protein corresponding to the gene encoding and the role of the protein in a biological signal pathway in the preset neural network model; and if the evaluation score is higher than a preset threshold, determine that the gene encoding corresponding to the evaluation score is a high-quality gene.
9. A storage medium having stored thereon a program or instructions, characterized in that, The program or instructions are executed by the processor to implement the method of any one of claims 1 to 7.
10. An electronic device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, The processor executes the program to implement the method of any one of claims 1 to 7.
Citation Information
Patent Citations
Pattern recognition method and device based on convolutional neural network and computer equipment
CN111666991A
Gene sequence optimization method , device and equipment and medium
CN111883208A