Plant antibiotic resistance gene transmission evaluation method and device based on machine learning

Through machine learning-based methods, a resistance gene transmission evaluation model is constructed, which solves the problems of complexity and time-consuming prediction of resistance gene transmission in the existing technology, improves prediction accuracy and generalization capabilities, and provides scientific basis to control The spread of ARGs protects public health and agricultural ecology.

CN119028445APending Publication Date: 2024-11-26SOUTH CHINA AGRICULTURAL UNIVERSITY

Patent Information

Application Number
CN202410922646.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The prior art is difficult to effectively predict and control the spread of antibiotic resistance genes (ARGs) in the environment, especially in soil to vegetables, and traditional methods analyze it in a complex and time-consuming manner.

Method used

Using a machine learning-based approach, a stochastic forest model and cross-validation are combined with random search to optimize model parameters, to construct a resistance gene transmission evaluation model, automatically predict the abundance of resistance genes in vegetables, and to analyze the keys that affect resistance gene transmission. factor.

Benefits of technology

Improve the accuracy and generalization ability of resistance gene transmission prediction, systematically understand the transmission rules of ARGs from soil to vegetables, provide scientific basis for better prevention and control, and reduce the potential for public health and agricultural ecology. threaten.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119028445A_ABST
    Figure CN119028445A_ABST
Patent Text Reader

Abstract

The invention discloses a plant antibiotic resistance gene transmission evaluation method and device based on machine learning, and the method comprises the steps: collecting a data set affecting antibiotic resistance transmission, and carrying out the preprocessing of the data set; dividing the data set into a training set and a test set, and constructing a gene propagation evaluation model based on the random forest; adopting cross validation to evaluate the training set and the prediction sample, inputting the test set into the gene propagation evaluation model to carry out antibiotic resistance gene prediction evaluation, and determining an optimal random seed value; the model is optimized, the important resistance gene abundance is sorted according to importance, and an important feature sorting graph is obtained. According to the method, the feature parameter importance is analyzed, the optimal parameter combination of the model is searched by using random search, the prediction performance of the model is improved, and meanwhile, the prediction performance and generalization of the model are evaluated by adopting folding and cross validation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of resistance gene propagation prediction, and specifically relates to a method and device for evaluating plant antibiotic resistance gene propagation based on machine learning. Background Art

[0002] Due to the rapid promotion of large-scale farming in my country, the use of veterinary antibiotics has gradually increased. With the widespread use of antibiotics, the spread and prevalence of antibiotic resistance genes (ARGs) has become a major problem in the 21st century. Veterinary antibiotics induce microorganisms to produce antibiotic resistance genes in livestock and poultry, and they are excreted into the environment with feces. Therefore, livestock and poultry manure is considered to be one of the main media for the spread of ARGs throughout the environment. The residual antibiotics in a certain concentration of feces exert selective pressure on microorganisms, promoting the production of soil microbial resistance and the spread of resistance genes. ARGs have been proven to be able to spread between organisms through horizontal gene transfer. Therefore, ARGs have been detected in different environmental media. At present, many studies have shown that antibiotic resistance genes have been detected in farmland soil, crops and leaf surfaces where manure is applied, and the abundance is higher than that of crops without manure. However, it is still unclear whether antibiotic resistance genes come from livestock and poultry manure and which microorganisms play an important role in it. However, once ARGs enter the human body through the food chain, they may lead to the failure of antibiotic treatment and trigger a global public health and ecological security crisis. Therefore, it is necessary to reduce the risk of ARGs transmission.

[0003] Previous studies have shown that the spread of ARGs from soil to vegetables is affected by many conditions, such as temperature, soil physicochemical properties, microbial community structure, vegetable type, soil ARGs abundance, etc. However, under complex management and environmental practices, traditional methods are time-consuming and laborious to analyze the interactions between environmental factors, MGEs, and ARGs one by one. In addition, due to differences in detection techniques (such as qPCR and HT-qPCR), the quantification of ARGs results in large differences in the abundance of ARGs detected in different ARG categories. Summary of the invention

[0004] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and to provide a method and device for evaluating the spread of plant antibiotic resistance genes based on machine learning. By analyzing the importance of characteristic parameters and using random search to find the optimal parameter combination of the model, the model prediction performance is improved. At the same time, cross-validation is used to evaluate the prediction performance and generalization of the model.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] In a first aspect, the present invention provides a method for evaluating the spread of plant antibiotic resistance genes based on machine learning, comprising the following steps:

[0007] S1. Collect data sets that affect the spread of antibiotic resistance and preprocess the data sets;

[0008] S2. Divide the data set into a training set and a test set, build a gene propagation evaluation model based on random forest, use the training set to predict the changes in antibiotic resistance genes, and obtain prediction samples;

[0009] S3, cross-validation is used to evaluate the training set and prediction samples, and the test set is input into the gene propagation evaluation model to perform antibiotic resistance gene prediction evaluation and determine the optimal random seed value;

[0010] S4. Use random search to find the optimal parameter combination of the model, and retrain the gene propagation evaluation model according to the optimal parameter combination to obtain a trained gene propagation evaluation model; input the optimal random seed value into the trained gene propagation evaluation model for prediction to obtain the abundance of important resistance genes; sort the abundance of important resistance genes according to importance to obtain an important feature sorting diagram.

[0011] As a preferred technical solution, step S1 includes:

[0012] S11. Use origin2022 to extract features from the collected data and obtain the data set;

[0013] S12. Perform a preliminary screening of the data set, including: deleting features with a large number of missing values ​​and data strips with missing labels; using the average value of specific or adjacent corresponding features to fill in individual missing values; taking the logarithm of the abundance of label resistance genes;

[0014] S13. Perform one-hot encoding on character variables and standardize the data.

[0015] As a preferred technical solution, step S2 includes:

[0016] Divide the dataset into training set and test set in proportion, and the label types of the data in the training set and the test set are the same;

[0017] According to the division ratio of the data set, a random forest-based gene propagation evaluation model was established.

[0018] As a preferred technical solution, step S3 includes:

[0019] S31. Use cross-validation to evaluate the performance of the gene propagation evaluation model on the training set, calculate the average cross-validation score, and obtain the score CV_score1; use cross-validation prediction to evaluate the prediction sample, calculate the average cross-validation score, and obtain the score CV_score2;

[0020] S32, input the test set into the gene propagation evaluation model to perform antibiotic resistance gene prediction evaluation, obtain the test prediction result, and calculate the score of the test prediction result to obtain the test score; select the model parameters according to the score CV_score1, the score CV_score2 and the test score;

[0021] S33, inputting the model parameters into the gene propagation evaluation model, and scoring the gene propagation evaluation model through five-fold cross validation, and using the scoring result cross_val_score to select the highest random seed value;

[0022] S34, looping step S33 multiple times, finding the data set with the highest cross_val_score, and determining the random seed value.

[0023] As a preferred technical solution, step S3 includes:

[0024] If the score CV_score1 and the score CV_score2 are both greater than the first setting value, the test score is greater than the second setting value, and the difference between the score CV_score1 and the test score and the difference between the score CV_score2 and the test score are both less than the third setting value, then the corresponding model parameters are selected.

[0025] As a preferred technical solution, step S4 includes:

[0026] Loop through step S3, and sequentially perform random searches to determine the optimal model parameters; the optimal model parameters include: random state, number of trees, maximum depth, and maximum eigenvalue;

[0027] Model performance metrics were evaluated by performing five-fold cross-validation and external validation to predict gene transmission;

[0028] The random forest was established using the optimal model parameters and read into the gene propagation evaluation model to evaluate the performance of the gene propagation evaluation model.

[0029] As a preferred technical solution, the random search includes:

[0030] Confirm the possible values ​​of the model parameters, specify the number of random searches, and randomly select a possible value combination for evaluation each time;

[0031] Search for multiple possible value combinations, perform cross-validation on each possible value combination using a given training set, select the parameter combination with the best performance based on the cross-validation results, and select the optimal model parameters.

[0032] As a preferred technical solution, the factors affecting the spread of antibiotic resistance and the actual values ​​of resistance gene abundance are obtained according to the important feature ranking diagram experiment, the factors affecting the spread of antibiotic resistance are input into the trained gene transmission evaluation model to obtain the predicted value of resistance gene abundance; the predicted value of resistance gene abundance is compared with the actual value of resistance gene abundance.

[0033] In a second aspect, the present invention also provides a plant antibiotic resistance gene propagation assessment system based on machine learning, which is applied to the plant antibiotic resistance gene propagation assessment method based on machine learning, and includes a data processing module, a model building module, a model optimization module and a gene propagation assessment module;

[0034] A data processing module is used to collect data sets that affect the spread of antibiotic resistance and pre-process the data sets;

[0035] The model building module is used to divide the data set into a training set and a test set, build a gene propagation evaluation model based on random forests, use the training set to predict changes in antibiotic resistance genes, and obtain prediction samples;

[0036] The model optimization module is used to take cross-validation evaluation training sets and prediction samples, input the test set into the gene propagation evaluation model to perform antibiotic resistance gene prediction evaluation, and determine the optimal random seed value;

[0037] The gene propagation evaluation module is used to use random search to find the optimal parameter combination of the model, and then train the gene propagation evaluation model according to the optimal parameter combination to obtain the trained gene propagation evaluation model; input the best random seed value into the trained gene propagation evaluation model for prediction to obtain the abundance of important resistance genes; sort the abundance of important resistance genes according to importance to obtain an important feature sorting diagram.

[0038] In a third aspect, the present invention provides an electronic device, the electronic device comprising:

[0039] at least one processor; and,

[0040] a memory communicatively connected to the at least one processor; wherein,

[0041] The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor to enable the at least one processor to perform the plant antibiotic resistance gene transmission assessment method based on machine learning.

[0042] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0043] (1) The machine learning framework adopted by the present invention automatically predicts the abundance of resistance genes in vegetables by learning a large amount of literature data and rules in the field of antibiotic resistance genes, and processes complex data sets in numerous literatures through algorithm simulation and data-driven methods, providing reliable data support for the relationship analysis between the many factors that affect the spread of resistance genes.

[0044] (2) The present invention uses machine learning to analyze the key factors that affect the generation and migration mechanism of ARGs, and more systematically understands the spread of ARGs from soil to vegetables, providing a scientific basis for better prevention and control of the spread of ARGs in farmland ecosystems, protecting human health and agricultural ecological security. It helps to reduce the intermediate links of the environmental and ecological impacts of ARGs, thereby promoting the development of green agriculture and sustainable agriculture, reducing potential threats to public health, and helping to solve the current environmental challenges facing the world.

[0045] (3) The present invention uses random search to find the optimal model parameters, and combines it with fold cross-validation evaluation to improve the robustness and generalization ability of model prediction, providing a method improvement for predicting the abundance of resistance genes in vegetables. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0047] Figure 1 This is a flow chart of a method for evaluating the spread of plant antibiotic resistance genes based on machine learning according to an embodiment of the present invention;

[0048] Figure 2 This is a schematic diagram of the random forest fitting results of an embodiment of the present invention;

[0049] Figure 3 Schematic diagram of feature importance for model evaluation implemented in the present invention

[0050] Figure 4 This is a schematic diagram of the structure of a plant antibiotic resistance gene propagation assessment system based on machine learning according to an embodiment of the present invention;

[0051] Figure 5 4 is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0052] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.

[0053] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.

[0054] See also Figure 1 This embodiment provides a method for evaluating the spread of plant antibiotic resistance genes based on machine learning, comprising the following steps:

[0055] S1. Collect data sets that affect the spread of antibiotic resistance and preprocess the data sets.

[0056] The literature with the keywords "vegetables", "soil" and "resistance genes" was searched, and the following data were collected: including pH, vegetable types, soil types, total carbon, total nitrogen, different types of resistance genes in soil (Aminoglycoside, Beta Lactam, MLSB, Multidrug, Sulfonamide, Tetracycline, Vancomycin, FCA), different sampling parts of vegetables, soil and vegetable mge, microbial community structure in soil and vegetables, types and absolute abundance of vegetable resistance genes; origin2022 was used to extract features of the collected data, and 243 valid data were collected.

[0057] After the data is collected, it is preliminarily screened, including: deleting features with more missing values ​​and data strips with missing labels; using the average value of specific or adjacent corresponding features to fill in individual missing values; taking the logarithm of the abundance of label resistance genes.

[0058] The character variables are encoded using OneHotEncoder in sklearn.preprocessing, and the data is standardized using StandardScaler.

[0059] S2. Divide the data set into a training set and a test set, build a gene propagation evaluation model based on random forest, use the training set to predict the changes in antibiotic resistance genes, and obtain prediction samples.

[0060] In this embodiment, the obtained data set is first divided, 80% of which is used as a training set and the remaining 20% ​​is used as a test set, and the ratio of label types of data in the training set and the test set is ensured to be the same.

[0061] Next, we started to build a gene propagation evaluation model based on random forest. In this embodiment, under the Python+Scikit-learn framework, we imported the RandomForestRegressor module in sklearn.ensemble, set and execute 500 different test set and training set divisions, built a random forest, and obtained a gene propagation evaluation model.

[0062] Finally, the training set is input to train the gene propagation evaluation model, and the changes in antibiotic resistance genes are predicted to obtain the predicted samples, which are used to determine the random seed value, as shown in step S3.

[0063] S3. Cross-validation is used to evaluate the training set and prediction samples, and the test set is input into the gene propagation evaluation model to perform antibiotic resistance gene prediction evaluation and determine the optimal random seed value.

[0064] In order to find a model with robust performance, this embodiment uses a cross-validation method to calculate the score. And by predicting the model parameters, the random seed value is determined. Specifically, the following steps are included:

[0065] S31. Use cross-validation to evaluate the performance of the gene propagation evaluation model on the training set, calculate the average cross-validation score, and obtain the score CV_score1; use cross-validation prediction to evaluate the prediction sample, calculate the average score of the five-fold cross-validation, and obtain the score CV_score2;

[0066] S32, input the test set into the gene propagation evaluation model to perform antibiotic resistance gene prediction evaluation, obtain the test prediction result, and calculate the score of the test prediction result to obtain the test score; select the model parameters according to the score CV_score1, the score CV_score2 and the test score;

[0067] In step S32, if the score CV_score1 and the score CV_score2 are both greater than the first setting value, the test score is greater than the second setting value, and the difference between the score CV_score1 and the test score and the difference between the score CV_score2 and the test score are both less than the third setting value, then select the corresponding model parameters;

[0068] S33, inputting the model parameters into the gene propagation evaluation model, and scoring the gene propagation evaluation model through five-fold cross validation, and using the scoring result cross_val_score to select the highest random seed value;

[0069] S34, looping step S33 multiple times, finding the data set with the highest cross_val_score, and determining the random seed value.

[0070] In particular, the random seed value determined in this embodiment is 395.

[0071] S4. Use random search to find the optimal parameter combination of the model, and retrain the gene propagation evaluation model according to the optimal parameter combination to obtain a trained gene propagation evaluation model; input the optimal random seed value into the trained gene propagation evaluation model for prediction to obtain the abundance of important resistance genes; sort the abundance of important resistance genes according to importance to obtain an important feature sorting diagram.

[0072] In step S4, random search is used. Random search is a randomized search method that finds the optimal hyperparameters by randomly sampling the combination of hyperparameters. In particular, the following steps are included: determining the parameter range, determining the possible values ​​or ranges that each parameter can take; specifying the number of random searches, and randomly selecting a parameter combination for evaluation each time; for each randomly selected parameter combination, cross-validation is performed on a given training set, and based on the results of the cross-validation, the parameter combination with the best performance is selected as the final model parameter.

[0073] In a more specific embodiment, the random search includes the following steps:

[0074] In each parameter optimization step, such as the optimization of random_state, n_estimators, max_depth, and max_features, the possible values ​​in the specified range are scored and the best performing parameters are selected. Unlike grid search, random search does not try all possible parameter combinations, but randomly selects parameters within the specified range for evaluation, which can find a better parameter combination in a shorter time.

[0075] Random search feature: In the process of finding the best parameters, a randomly set random_state value is used, specifically by iterating within the range (0, 400, 1) to perform a random search.

[0076] Cyclic Iteration: Through cyclic iteration, each parameter (random_state, n_estimators, max_depth, max_features) is continuously changed, and cross-validation is used in each iteration to evaluate the model performance.

[0077] Cross-validation evaluation: In each iteration, the random forest regressor model is evaluated by performing a five-fold cross-validation evaluation by calling the cross_val_score function and calculating the average score to evaluate the model performance.

[0078] Select the best parameters: After each parameter is iterated, the evaluation results of each iteration are recorded, and the parameters with the best performance score are finally selected as the optimal parameters.

[0079] In addition to using random search, this embodiment can also use grid search to screen the optimal model parameters. Unlike random search, random search does not only randomly extract a certain number of combinations in the hyperparameter space for evaluation, but will traverse all possible hyperparameter combinations. For example, if the learning rate is [0.1, 0.01, 0.001], the maximum depth is [3, 5, 7], and the feature selection is ['auto', 'sqrt'], then a three-dimensional grid will be formed, containing all possible combinations. Grid search forms a parameter network with various possible values, and after parameter network search and cross-validation evaluation, the optimal model parameters are screened out.

[0080] Next, the parameters of the random forest model are optimized and evaluated. Through iterative cycles, a random forest model is established, and the average score of the model is calculated using five-fold cross validation. The optimal model is obtained through random search in turn, and finally the optimal values ​​of the four parameters of the random forest model, random_state, n_estimator, Max_depth, and max_features, are determined; in this example, the random state (random_state) = 257, the number of trees (n_estimator) is 76, the maximum depth (Max_depth) is 20, and the maximum number of features (max_features) is 40. The random forest fitting results are as follows: Figure 2 As shown;

[0081] Through five-fold cross validation and external validation, the performance evaluation indicators of the prediction model include the determination coefficient R 2 , root mean square error RMSE and mean absolute error MAE.

[0082] Using the best parameter configuration obtained, a random forest model was established, and the performance of the model was evaluated using five-fold cross validation. The average score, root mean square error (RMSE), and mean absolute error (MAE) were calculated.

[0083] The calculation formulas are:

[0084]

[0085] Among them, y i is the experimental value, f i is the predicted value, is the average value of the features of the descriptor, SS res is the residual sum of squares, SS tot is the sum of squares, and n is the number of prediction samples.

[0086] From now on, the training of the gene propagation evaluation model is completed, and the trained gene propagation evaluation model is obtained.

[0087] Finally, the trained gene propagation evaluation model was used to rank the importance of the generated factors affecting the propagation of resistance genes, and the factors with the highest feature importance were selected, including:

[0088] The feature_importances attribute is used to obtain the importance of each feature in the random forest model and rank them. It is found that vegetable Proteobacteria, vegetable resistance gene types, vegetable mge, and the abundance of different resistance genes in soil are important features; the feature importance ranking is as follows Figure 3 shown.

[0089] In order to test and verify the accuracy of the model, this example uses the soil physical and chemical properties obtained from the test, the microbial community structure, and the resistance gene abundance characteristics as data points to input into the prediction model, obtains the resistance gene abundance predicted by the model, and compares it with the resistance gene abundance measured in the test to evaluate the accuracy of the prediction model, specifically including:

[0090] S61. Select farmland soil with no fertilization history and farmland soil with chicken manure applied all year round to plant lettuce and cherry radish respectively, and carry out a 60-day pot experiment. Soil samples and vegetable samples were collected separately according to the random sampling method.

[0091] S62. The three indicators of soil physicochemical properties, resistance genes and microbial community structure and diversity of the test samples are: soil physicochemical properties (pH value, electrical conductivity, total nitrogen, total carbon, organic carbon content), types and abundance of resistance genes of soil samples and vegetable samples (including 296 resistance genes including eight major types of antibiotic resistance genes), and microbial community structure and diversity of soil samples and vegetable samples.

[0092] S63. The experiment detects the abundance of resistance gene species and microbial community structure in soil and vegetable samples; the steps of resistance gene detection are: extracting DNA and using high-throughput quantitative PCR (HT-qPCR) technology to determine the abundance and diversity of ARGs and MGEs in the samples.

[0093] S64, the 285 ARGs selected cover all common resistance gene types. The pre-made PCR mixture was loaded onto a chip containing 5184 nanowells, and high-throughput quantitative PCR was performed using the Wafergen SmartChip Real-time PCR system.

[0094] S65. Follow the steps of the thermal cycle program: first activate at 95°C for 10 min, then perform 40 cycles of denaturation at 95°C for 30 s, and annealing and extension at 60°C for 30 s. Use CT=31 as the detection limit of the qPCR cycle number, and retain the sample wells with a single peak melting curve and amplification efficiency of 90%-110%. ARGs that are within the detection limit in at least two of the three replicates are considered positive.

[0095] S66, ARGs and MGEs absolute abundance calculation The qPCR data were presented by comparing the CT method, which can well calculate the relative abundance of ARGs and MGEs relative to the internal control 16S rRNA gene, where ΔCT = (CT detected ARGs (MGEs) – CT 16S rRNA gene). The absolute abundance of ARGs and MGEs was calculated by multiplying their relative abundance by the absolute abundance of the 16S rRNA gene in the same sample (copies g -1 dry solid

[0096] S67. Detect the microbial community structure in soil and vegetable samples. According to the specified sequencing region, the extracted DNA was synthesized with specific primers with label sequences (barcode) (515F: 5'-GTGCCAGCMGCCGCGG-3'; 907R: 5'-CCGTCAATCMTTTRAGTTT-3'), and PCR amplification was performed. The samples were then sent to Novogene Biotech Co., Ltd. for 16S rRNA sequencing.

[0097] S68. The soil physical and chemical properties obtained from the experiment, the structure and diversity characteristics of the vegetable microbial community, and the abundance of resistance genes in soil vegetables are used as data points to input into the prediction model, obtain the resistance gene abundance predicted by the model, and compare it with the resistance gene abundance measured in the experiment to evaluate the accuracy of the prediction model.

[0098] It should be noted that, for the sake of convenience, the aforementioned method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited to the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously.

[0099] Based on the same idea as the plant antibiotic resistance gene propagation assessment method based on machine learning in the above-mentioned embodiment, the present invention also provides a plant antibiotic resistance gene propagation assessment system based on machine learning, which can be used to execute the above-mentioned plant antibiotic resistance gene propagation assessment method based on machine learning. For ease of explanation, the structural schematic diagram of the embodiment of the plant antibiotic resistance gene propagation assessment system based on machine learning only shows the parts related to the embodiment of the present invention. Those skilled in the art can understand that the illustrated structure does not constitute a limitation on the device, and may include more or fewer components than shown in the diagram, or combine certain components, or arrange the components differently.

[0100] See also Figure 5 , in another embodiment of the present application, a plant antibiotic resistance gene propagation assessment system 10 based on machine learning is provided, the system comprising a data processing module 11, a model building module 12, a model optimization module 13 and a gene propagation assessment module 14;

[0101] The data processing module 11 is used to collect data sets that affect the spread of antibiotic resistance and pre-process the data sets;

[0102] A model building module 12 is used to divide the data set into a training set and a test set, build a gene propagation evaluation model based on a random forest, use the training set to predict changes in antibiotic resistance genes, and obtain prediction samples;

[0103] The model optimization module 13 is used to take cross-validation evaluation training sets and prediction samples, input the test set into the gene propagation evaluation model to perform antibiotic resistance gene prediction evaluation, and determine the best random seed value;

[0104] The gene propagation evaluation module 14 is used to use random search to find the optimal parameter combination of the model, and retrain the gene propagation evaluation model according to the optimal parameter combination to obtain a trained gene propagation evaluation model; input the best random seed value into the trained gene propagation evaluation model for prediction to obtain the abundance of important resistance genes; sort the abundance of important resistance genes according to importance to obtain an important feature sorting diagram.

[0105] It should be noted that the plant antibiotic resistance gene transmission assessment system based on machine learning of the present invention corresponds one-to-one to the plant antibiotic resistance gene transmission assessment method based on machine learning of the present invention. The technical features and beneficial effects described in the embodiment of the above-mentioned plant antibiotic resistance gene transmission assessment method based on machine learning are applicable to the embodiment of the plant antibiotic resistance gene transmission assessment method based on machine learning. For specific contents, please refer to the description in the embodiment of the method of the present invention, which will not be repeated here. This is hereby declared.

[0106] In addition, in the implementation of the plant antibiotic resistance gene transmission assessment system based on machine learning in the above-mentioned embodiment, the logical division of each program module is only an example. In actual application, the above-mentioned functions can be assigned to different program modules as needed, for example, for the configuration requirements of the corresponding hardware or the convenience of software implementation. That is, the internal structure of the plant antibiotic resistance gene transmission assessment system based on machine learning is divided into different program modules to complete all or part of the functions described above.

[0107] See also Figure 5 In one embodiment, an electronic device for implementing a method for evaluating the spread of plant antibiotic resistance genes based on machine learning is provided. The electronic device 20 may include a first processor 21, a first memory 22, and a bus. It may also include a computer program stored in the first memory 22 and executable on the first processor 21, such as a plant antibiotic resistance gene spread evaluation program 23 based on machine learning.

[0108] The first memory 22 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the first memory 22 can be an internal storage unit of the electronic device 20, such as a mobile hard disk of the electronic device 20. In other embodiments, the first memory 22 can also be an external storage device of the electronic device 20, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 20. Further, the first memory 22 can also include both an internal storage unit of the electronic device 20 and an external storage device. The first memory 22 can not only be used to store application software and various types of data installed in the electronic device 20, such as the code of the plant antibiotic resistance gene propagation assessment program 23 based on machine learning, but also can be used to temporarily store data that has been output or is to be output.

[0109] In some embodiments, the first processor 21 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The first processor 21 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes various functions and processes data of the electronic device 20 by running or executing programs or modules stored in the first memory 22, and calling data stored in the first memory 22.

[0110] Figure 5 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 5 The structure shown does not constitute a limitation on the electronic device 20 , and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0111] The plant antibiotic resistance gene propagation assessment program 23 based on machine learning stored in the first memory 22 of the electronic device 20 is a combination of multiple instructions. When running in the first processor 21, it can achieve:

[0112] S1. Collect data sets that affect the spread of antibiotic resistance and preprocess the data sets;

[0113] S2. Divide the data set into a training set and a test set, build a gene propagation evaluation model based on random forest, use the training set to predict the changes in antibiotic resistance genes, and obtain prediction samples;

[0114] S3, cross-validation is used to evaluate the training set and prediction samples, and the test set is input into the gene propagation evaluation model to perform antibiotic resistance gene prediction evaluation and determine the optimal random seed value;

[0115] S4. Use random search to find the optimal parameter combination of the model, and retrain the gene propagation evaluation model according to the optimal parameter combination to obtain a trained gene propagation evaluation model; input the optimal random seed value into the trained gene propagation evaluation model for prediction to obtain the abundance of important resistance genes; sort the abundance of important resistance genes according to importance to obtain an important feature sorting diagram.

[0116] Furthermore, if the module / unit integrated in the electronic device 20 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0117] 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 the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), 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).

[0118] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0119] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. A method for evaluating the spread of plant antibiotic resistance genes based on machine learning, characterized in that: The steps include: S1. Collect data sets that affect the spread of antibiotic resistance and preprocess the data sets; S2. Divide the data set into a training set and a test set, build a gene propagation evaluation model based on random forest, use the training set to predict the changes in antibiotic resistance genes, and obtain prediction samples; S3, cross-validation is used to evaluate the training set and prediction samples, and the test set is input into the gene propagation evaluation model to perform antibiotic resistance gene prediction evaluation and determine the optimal random seed value; S4. Use random search to find the optimal parameter combination of the model, and retrain the gene propagation evaluation model according to the optimal parameter combination to obtain a trained gene propagation evaluation model; input the best random seed value into the trained gene propagation evaluation model for prediction to obtain the abundance of important resistance genes; Sort the abundance of important resistance genes according to their importance to obtain a ranking diagram of important features.

2. The method for evaluating the spread of plant antibiotic resistance genes based on machine learning according to claim 1, characterized in that: The step S1 comprises: S11, extracting features from the collected data to obtain a data set; S12. Perform a preliminary screening of the data set, including: deleting features with a large number of missing values ​​and data strips with missing labels; using the average value of specific or adjacent corresponding features to fill in individual missing values; taking the logarithm of the abundance of label resistance genes; S13. Perform one-hot encoding on character variables and standardize the data.

3. The method for evaluating the spread of plant antibiotic resistance genes based on machine learning according to claim 1, characterized in that: The step S2 comprises: Divide the dataset into training set and test set in proportion, and the label types of the data in the training set and the test set are the same; According to the division ratio of the data set, a random forest-based gene propagation evaluation model was established.

4. The method for evaluating the spread of plant antibiotic resistance genes based on machine learning according to claim 1, characterized in that: The step S3 comprises: S31. Use cross-validation to evaluate the performance of the gene propagation evaluation model on the training set, calculate the average cross-validation score, and obtain the score CV_score1; use cross-validation prediction to evaluate the prediction sample, calculate the average cross-validation score, and obtain the score CV_score2; S32, input the test set into the gene propagation evaluation model to perform antibiotic resistance gene prediction evaluation, obtain the test prediction result, and calculate the score of the test prediction result to obtain the test score; select the model parameters according to the score CV_score1, the score CV_score2 and the test score; S33, inputting the model parameters into the gene propagation evaluation model, and scoring the gene propagation evaluation model through five-fold cross validation, and using the scoring result cross_val_score to select the highest random seed value; S34, looping step S33 multiple times, finding the data set with the highest cross_val_score, and determining the random seed value.

5. The method for evaluating the spread of plant antibiotic resistance genes based on machine learning according to claim 4, characterized in that: The step S3 comprises: If the score CV_score1 and the score CV_score2 are both greater than the first setting value, the test score is greater than the second setting value, and the difference between the score CV_score1 and the test score and the difference between the score CV_score2 and the test score are both less than the third setting value, then the corresponding model parameters are selected.

6. The method for evaluating the spread of plant antibiotic resistance genes based on machine learning according to claim 1, characterized in that: The step S4 comprises: Loop through step S3, and sequentially perform random searches to determine the optimal model parameters; the optimal model parameters include: random state, number of trees, maximum depth, and maximum eigenvalue; Model performance metrics were evaluated by performing five-fold cross-validation and external validation to predict gene transmission; The random forest was established using the optimal model parameters and read into the gene propagation evaluation model to evaluate the performance of the gene propagation evaluation model.

7. The method for evaluating the spread of plant antibiotic resistance genes based on machine learning according to claim 1, characterized in that: The random search includes: Confirm the possible values ​​of the model parameters, specify the number of random searches, and randomly select a possible value combination for evaluation each time; Search for multiple possible value combinations, perform cross-validation on each possible value combination using a given training set, select the parameter combination with the best performance based on the cross-validation results, and select the optimal model parameters.

8. The method for evaluating the spread of plant antibiotic resistance genes based on machine learning according to claim 1, characterized in that: According to the important feature ranking diagram experiment, the factors affecting the spread of antibiotic resistance and the actual values ​​of resistance gene abundance are obtained, and the factors affecting the spread of antibiotic resistance are input into the trained gene transmission evaluation model to obtain the predicted value of resistance gene abundance; the predicted value of resistance gene abundance is compared with the actual value of resistance gene abundance.

9. A plant antibiotic resistance gene propagation assessment system based on machine learning, characterized in that: A method for evaluating the spread of a plant antibiotic resistance gene based on machine learning applied to any one of claims 1 to 8, comprising a data processing module, a model building module, a model optimization module and a gene spread evaluation module; A data processing module is used to collect data sets that affect the spread of antibiotic resistance and pre-process the data sets; The model building module is used to divide the data set into a training set and a test set, build a gene propagation evaluation model based on random forests, use the training set to predict changes in antibiotic resistance genes, and obtain prediction samples; The model optimization module is used to take cross-validation evaluation training sets and prediction samples, input the test set into the gene propagation evaluation model to perform antibiotic resistance gene prediction evaluation, and determine the optimal random seed value; The gene propagation evaluation module is used to use random search to find the optimal parameter combination of the model, and then train the gene propagation evaluation model according to the optimal parameter combination to obtain the trained gene propagation evaluation model; the best random seed value is input into the trained gene propagation evaluation model for prediction to obtain the abundance of important resistance genes; Sort the abundance of important resistance genes according to their importance to obtain a ranking diagram of important features.

10. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the plant antibiotic resistance gene transmission assessment method based on machine learning as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Method and device for predicting antibiotic resistance phenotype based on machine learning and application

    CN114388062A

  • Method and device for evaluating adsorption performance of metal organic framework on arsenic and related equipment

    CN115049019A

  • Soil heavy metal content prediction method based on machine learning and application thereof

    CN116187543A

  • Machine learning method for predicting diversity of soil rhizosphere microorganisms

    CN117198395A

  • Method for predicting toxicity of metal to fishes in specific water area based on machine learning method

    CN117454130A

Cited By

  • Resistance gene horizontal migration frequency prediction and model construction method and device

    CN119993278A