Metrology element learning architecture-based antibiotic resistance prediction method
By employing a metric learning architecture that combines machine learning and deep learning models to dynamically select antibiotic and genomic feature vectors, the limitations of existing antibiotic resistance prediction models and insufficient generalization ability are addressed, achieving efficient and accurate antibiotic resistance prediction.
Patent Information
- Application Number
- CN202510927910.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-11-14
AI Technical Summary
Existing machine learning-based methods for predicting antibiotic resistance have limitations in model construction and optimization. They fail to fully explore the potential patterns in antibiotics and biological data, resulting in prediction accuracy that is difficult to meet clinical needs. Furthermore, their generalization ability across different clinical scenarios and bacterial species is insufficient, making it difficult to adapt to diverse clinical needs.
A metric-based learning architecture is employed to generate a core SNP genome dataset by integrating antibiotic resistance phenotypic data under different strains and reference genomes with multiple sequencing results. Combined with machine learning and deep learning models, antibiotic and genome feature vectors are extracted, and the nearest model prototype center is dynamically selected for antibiotic resistance prediction. Generative adversarial networks are used for data augmentation to construct a meta-learning model.
It enables the selection of antibiotic resistance prediction models in complex scenarios, has zero-shot learning capability, reduces computational resource consumption, improves prediction accuracy and generalization ability, and adapts to different data distributions and antibiotic types.
Smart Images

Figure CN120954756A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer artificial intelligence, and in particular to a method for predicting antibiotic resistance based on a metric learning architecture. Background Technology
[0002] Antibiotic resistance has become one of the major public health problems of this century, threatening the effective prevention of infections caused by an increasing number of bacteria and fungi. World Health Organization data shows that the number of deaths due to antibiotic resistance continues to rise annually, making previously curable infectious diseases a deadly threat again. In existing assessment systems, the minimum inhibitory concentration (MIC), with its quantitative standard, remains a key indicator for determining antibiotic resistance. However, traditional detection methods based on culture and drug susceptibility testing often take days or even weeks to produce results. Against this backdrop, machine learning technology, with its efficient data processing and pattern recognition capabilities, has gradually become a research hotspot in the field of antibiotic resistance prediction due to its advantage of rapidly analyzing massive amounts of biomedical data.
[0003] However, current machine learning-based methods for predicting antibiotic resistance still face the following challenges:
[0004] First, most existing methods have limitations in model building and optimization, failing to fully explore potential patterns in antibiotics and biological data, resulting in predictive accuracy that is difficult to meet clinical needs.
[0005] Secondly, since most studies rely on small datasets, the predictive models have insufficient generalization ability across different clinical scenarios and bacterial species, and a comprehensive solution that adapts to multiple machine learning algorithms is needed.
[0006] Furthermore, in real clinical settings, the resistance gene characteristics corresponding to different types of antibiotics are highly specific, and there is currently no systematic model selection strategy for such scenarios, making it difficult for models to accurately adapt to diverse clinical needs. Summary of the Invention
[0007] The purpose of this invention is to address the shortcomings of existing technologies by providing a method for predicting antibiotic resistance based on a metric learning architecture.
[0008] The objective of this invention is achieved through the following technical solution: an antibiotic resistance prediction method based on a metric learning architecture, comprising:
[0009] Antibiotic resistance phenotype data for a single strain were obtained, and multiple sequencing results were integrated based on the reference genome of that strain to generate a core SNP genome dataset.
[0010] Several models were selected from the fields of machine learning and deep learning. Each model was trained using the core SNP genome dataset. Their performance in the antibiotic resistance prediction task was evaluated, and a preliminary model selection knowledge base was constructed.
[0011] Antibiotics are encoded into molecular structures to obtain antibiotic feature vectors; strain genomic features are extracted based on three dimensions: base mutation ratio, base mutation site, and direction, and a genomic distribution feature vector is constructed; the antibiotic feature vector is then concatenated with the genomic feature vector.
[0012] Based on the preliminary model, select a knowledge base, calculate the category center result of each model for the concatenated feature vector, and construct the prototype center of each model;
[0013] For new antibiotic-genome feature pairs, the model type corresponding to the nearest model prototype center is dynamically selected to achieve the best antibiotic resistance prediction model adaptation.
[0014] Furthermore, the generation of the core SNP genome dataset also includes:
[0015] Unmutated sites are labeled as tag N, while other mutated sites remain the bases A, T, C, and G.
[0016] Furthermore, several models were selected from the two major fields of machine learning and deep learning, and each model was trained using the core SNP genomic dataset to evaluate its performance in the antibiotic resistance prediction task, including:
[0017] Four models were selected from the two major fields of machine learning and deep learning: logistic regression, support vector machine, random forest, and graph neural network.
[0018] Using core SNP genomic data as features and the corresponding antibiotic resistance as the prediction result, the data is input into three machine learning models: logistic regression, support vector machine, and random forest. The models are then optimized through grid search to obtain the prediction results of different models.
[0019] The sequence data of the core SNP genome is converted into graph data, the gene k-mer sequence is abstracted as nodes, and the k-mer fragment is regarded as the node link relationship. The graph neural network is used to deeply mine the topological features of the gene network and its association pattern with antibiotic molecules to obtain the prediction results of antibiotic resistance.
[0020] When converting the sequence data of core SNP genomes into graph data, the k-mer sequence is a substring of k consecutive bases extracted from the genome sequence. It is the basic unit that constitutes the sequence and is treated as a node, with the vertex feature set as the occurrence count. The positional relationship between two k-mers in the original sequence is treated as a k-mer fragment, measured by the length of their interval. When the positional interval between two k-mers does not exceed the maximum allowed interval length d, they are linked by an edge, with the edge feature set as a vector of length d+1, whose elements represent the occurrence count of different interval lengths between the two k-mers. The connection relationship of the edge reflects the contextual order and spatial association of the k-mer in the genome.
[0021] Based on the prediction results, the performance of each model in the antibiotic resistance prediction task was evaluated.
[0022] Furthermore, a preliminary model selection knowledge base is constructed, including:
[0023] Based on the evaluation of the performance of each model in the antibiotic resistance prediction task, the optimal model for antibiotics corresponding to different data distributions is determined, so as to construct a preliminary model selection knowledge base.
[0024] Furthermore, to address the issue of limited knowledge base size for the optimal model of each antibiotic under different data distributions, a data augmentation strategy based on generative adversarial networks is adopted. This strategy effectively expands the data sample by organically integrating noisy data conforming to a Gaussian distribution with the original dataset.
[0025] Further, the antibiotic feature vector is obtained, including:
[0026] Two-dimensional molecular structures of each antibiotic were extracted using RDKit and Pubchempy tools, and the extracted antibiotic molecular structures were encoded using a ChemBERT pre-trained model to obtain antibiotic feature vectors.
[0027] Furthermore, a genome distribution feature vector is constructed, including:
[0028] For a given genome, the proportion of base mutations is determined by counting the number of mutated genes; the mutation proportions of the four bases A, T, C, and G are calculated separately, and a feature vector of base mutation proportions is obtained from the base level.
[0029] Considering that there are 12 mutation directions in genes, the top K sites with the highest mutation frequency were screened out, and the mutation directions corresponding to these sites were recorded. From the perspectives of site and direction, we conducted in-depth analysis to obtain statistical feature vectors of mutation sites and directions.
[0030] A genome distribution feature vector is constructed based on the base mutation ratio feature vector and the mutation site and direction statistical feature vector.
[0031] The present invention also provides an electronic device, including a memory and a processor, wherein the memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the above-described method for predicting antibiotic resistance based on a metric learning architecture.
[0032] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method for predicting antibiotic resistance based on a metric learning architecture.
[0033] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method for predicting antibiotic resistance based on a metric learning architecture.
[0034] The beneficial effects of this invention are that it proposes an antibiotic resistance prediction method based on a metric meta-learning architecture. This method employs an adaptive mechanism, deeply analyzing the characteristics of different antibiotics and the distribution features of genomic data to accurately match them with suitable machine learning models. Based on the resistance prediction results of four models for 11 antibiotics using E. coli whole-genome sequencing data, a metric-based meta-learning model matching mechanism is constructed by deeply mining the molecular structural features of drugs and data distribution patterns. The method described in this invention can effectively solve the model selection problem in antibiotic resistance prediction under complex scenarios; and in the task of predicting new drug resistance, it achieves zero-shot learning capability, completing model adaptation without additional training data, effectively reducing the computational resource consumption cost during model training. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0036] Figure 1 This is a flowchart of an antibiotic resistance prediction method based on a metric learning architecture.
[0037] Figure 2 This is a framework diagram of an antibiotic resistance prediction method based on a metric learning architecture.
[0038] Figure 3 This is a schematic diagram of the gene expression map optimization process.
[0039] Figure 4 This is a schematic diagram of an electronic device structure provided in an embodiment of the present invention. Detailed Implementation
[0040] The present invention will now be described in detail with reference to the accompanying drawings. Unless otherwise specified, the features of the following embodiments and implementations can be combined with each other.
[0041] This invention relates to an antibiotic resistance prediction method based on a metric learning architecture. See also: Figure 1 and Figure 2 ,include:
[0042] Antibiotic resistance phenotype data for a single strain were obtained, and multiple sequencing results were integrated based on the reference genome of that strain to generate a core SNP genome dataset.
[0043] In one embodiment, a dataset of the whole genome of Escherichia coli and corresponding antibiotics is obtained. Through data screening and the Snippy tool, multiple Snippy results are integrated based on the reference genome to generate a core SNP genome dataset.
[0044] This step includes:
[0045] 1) Data collection
[0046] This study obtained raw sequencing data of *E. coli* isolates from the European Nucleotide Archive (ENA). Specifically, raw sequence data were downloaded in batches based on the phenotypic accession numbers in the public dataset. During data preprocessing, a two-way matching process was performed using the accession numbers to filter out two types of invalid data: firstly, sample data lacking corresponding phenotypic information in the database; and secondly, phenotypic records for which no corresponding sample sequence could be found. After this processing, the final dataset covered 1677 *E. coli* isolates, but exhibited significant data characteristics: a large difference in the number of samples with different antibiotic types, and an uneven distribution of antibiotic resistance tags. To ensure the reliability of model training, the dataset was divided into training and testing sets in an 8:2 ratio. The training set was used for model parameter optimization, while the testing set independently evaluated the model's generalization ability.
[0047] 2) Data Filtering
[0048] Because not all isolates underwent susceptibility testing against all 11 antimicrobial agents, some test results were missing in the dataset. This study adopted a no-fill strategy for missing values, preserving the original data. For valid test results, the internationally accepted antibiotic susceptibility labeling system was used: "R" indicates resistant, meaning the strain did not respond to the antibiotic; "S" indicates susceptible, meaning the antibiotic effectively inhibited the strain's growth; "I" represents intermediate, indicating that the antibiotic dose required to inhibit the strain's growth is higher than that of susceptible strains but lower than that of resistant strains, requiring a higher dosage to achieve a therapeutic effect. Furthermore, the study found that approximately 85% of the isolates completed susceptibility testing against five first-line antibiotics; these data will be the focus of the analysis.
[0049] Among the 1677 isolates tested for ciprofloxacin (CIP), nalidixic acid (NAL), ampicillin (AMP), tetracycline (TET), and fusidic acid (FIS), the resistance rates were 21.3%, 19.4%, 18.2%, 16.2%, and 15.7%, respectively. In contrast, the resistance rates for chloramphenicol (CHL), augmentin (AUG), trimethoprim-sulfamethoxazole (COT), oxacillin (AXO), and cefoxitin (FOX) were significantly lower, at 7.2%, 4.9%, 4.2%, 3.6%, and 2.9%, respectively. Furthermore, 1619 genes were tested for streptomycin (STR), of which 305 were resistant, representing 18.2%. Given the significant imbalance in the current dataset, we propose four dataset construction strategies with different proportions to evaluate model accuracy under different drug types and data distributions. This study set the ratio of susceptible genes to drug-resistant genes to be 1:1, 1:2, 1:3, and 1:4. By adjusting these ratios, the aim was to more effectively evaluate the predictive performance of each model on different datasets.
[0050] 3) Generation of core SNP genomic data
[0051] The genomic data of the *E. coli* strains involved in this study exhibited significant heterogeneity, with genome lengths ranging from 4.6 million to 5.5 million base pairs. Preliminary analysis revealed gene insertions, deletions, or rearrangements in some strains, leading to structural differences between their genomes and the reference sequence. To accurately identify single nucleotide polymorphisms (SNPs), the Snippy (Ver: 3.1.0) tool was used for core genome alignment. This tool, based on the *E. coli* reference genome and whole-genome sequencing data, rapidly identifies SNP sites through multi-threaded parallel computation. If an annotated reference genome is input, Snippy automatically invokes the SnpEff tool to perform functional annotation of variant sites, analyzing their potential impact on gene expression and biological function; if only the reference sequence is provided, the tool focuses on SNP site detection. Finally, the comparison output by Snippy yields the results of gene mutation locations. In this study, non-mutated sites were labeled as tag N, while other mutated sites remained labeled as bases A, T, C, and G, ultimately constructing a core SNP genome dataset.
[0052] Several models were selected from the fields of machine learning and deep learning. Each model was trained using the core SNP genome dataset. Their performance in the antibiotic resistance prediction task was evaluated, and a preliminary model selection knowledge base was constructed.
[0053] In one embodiment, four models—logistic regression, support vector machine, random forest, and graph neural network—are selected from the two major fields of machine learning and deep learning. The advantages of different models in data analysis and feature extraction are used to predict antibiotic resistance.
[0054] This step includes:
[0055] 1) Machine learning model selection
[0056] a. Logistic Regression (LR): Constructs a linear model that linearly combines the input features. Assuming the input feature vector is x, the feature weight vector is w, and the bias term is b, then the output of the linear model is w·x+b.
[0057] b. Support Vector Machine (SVM) Model: The basic idea of SVM is to find an optimal hyperplane in the feature space that accurately classifies different types of data while maximizing the distance from different types of data to the hyperplane. The hyperplane is defined by the equation w·x + b = 0, where w is the normal vector of the hyperplane, x is the feature vector, and b is the bias term. Its objective is to maximize the margin, calculated using the formula: This leads to the following optimization problem:
[0058]
[0059] c. Random Forest (RF) Model: Random Forest is an ensemble classification algorithm based on decision trees. During the prediction phase, each decision tree produces a result, and the final classification result is determined by majority voting. Specifically, the classification result of each decision tree can be represented as h. t (x;Θ t ), here h t (x;Θ t ) represents the classification result of the t-th decision tree, x is the input feature vector, and Θ t Let be the parameter set of the t-th tree. The final classification result of the random forest is H(x) = RF{h1(x; Θ1),h2(x; Θ2),…,h T (X;Θ T This algorithm can handle high-dimensional data and is insensitive to missing features. Furthermore, its training process can be highly parallelized, enabling efficient operation on large datasets and improving computational speed.
[0060] 2) Deep learning model selection
[0061] Graph Neural Networks (GNNs), a deep learning paradigm specifically designed for processing graph-structured data, have demonstrated remarkable application potential in various fields in recent years. In this study, we employ a Gene Expression Graph (GPG) architecture, fully leveraging its topology-aware capabilities to significantly enhance gene structure representation while effectively compressing the dimensionality of long gene sequences. Furthermore, to address the limitation of the GPG model's native support for only four base encodings (A, T, C, and G), we innovatively introduce a tag N. By expanding the type space of graph nodes, we further improve the model's expression accuracy for complex gene graphs.
[0062] In the initial GPG model, see Figure 3For a given sequence DNA = 'TATTATT', taking the parameters k-mer length k = 3 and the maximum allowed interval length d = 3, we obtain the k-mer list kmers = ['TAT', 'ATT', 'TTA', 'TAT', 'ATT']. Using the unique value of the k-mer as the vertex, and the vertex characteristic as the frequency of occurrence, we obtain the vertex list V = [('TAT', 2), ('ATT', 2), ('TTA', 1)]. If two k-mers are in sequence... If the positional interval of the occurrences in the column does not exceed d (i.e., the next k-mer after the previous k-mer with an interval of at most d characters), then the vertices are connected by an edge. The edge feature is a vector of length d+1, and its (i+1)th element represents the number of times the interval between two k-mers is of length i. The resulting edge list is E = [(′TAT-TAT′,[1,0,0,0]),(′ATT-ATT′,[1,0,0,0]),(′TAT-ATT′,[0,1,0,0])]. In this study, we introduced a new tag N, assuming DNA = 'TANNANN', kmers = ['TAN', 'ANN', 'NNA', 'NAN', 'ANN'], resulting in V = [('TAN', 1), ('ANN', 2), ('NNA', 1), ('NAN', 1)], and the edge list is E = [('TAN-NAN', [1, 0, 0, 0]), ('ANN-ANN', [1, 0, 0, 0]), ('TAN-ANN', [0, 1, 0, 0])], which expands the graph structure obtained based on gene mutations and improves expression accuracy.
[0063] In the graph data embedding stage, we choose the Graph Isomorphic Network with Edge Features (GINE), a model in the graph neural network family that excels at jointly modeling the multidimensional edge attributes and node features of directed graphs. GINE utilizes a dynamic edge feature aggregation mechanism and a node state update function to seamlessly integrate topological information with attribute details. Specifically, the message passing rules of GINE can be formalized as follows:
[0064]
[0065] in This represents the embedding vector of node v at layer k. This represents the set of neighboring nodes of node v. Let e represent the embedding vector of node u in the (k-1)th layer. (u,v) These are the attribute features of edge (u,v), AGG (k) and MLP (k) These are aggregation functions and multilayer perceptrons, respectively. Through iterative updates, they achieve hierarchical encoding of graph structure and attribute information.
[0066] 3) Prediction results of different models for antibiotic resistance
[0067] a. Model parameter tuning
[0068] This invention first selects LR, RF, and SVM algorithms from Scikit-learn (v1.3.2) and initializes their parameters. A grid search combined with two-fold cross-validation is then used to systematically explore the hyperparameter space. The hyperparameters of LR include C∈{0.1,1,5,10} and max=5000; the hyperparameters of RF cover n∈{50,100}, max∈{None,10,20}, min∈{2,5,10}, min∈{1,2,4}, and bootstrap∈{True,False}; and the hyperparameters of SVM include C∈{1,3,5}, kernel∈{′linear′,′sigmoid′}, and γ∈{′scale′,′auto′}. Through the iterative process of GridSearchCV, the optimal parameter configuration that maximizes the cross-validation accuracy is determined for final prediction.
[0069] To investigate the impact of graph data input on model performance, we used GPG as the graph data representation format and systematically examined the optimization of the k-mer segmentation parameter K and the interval parameter d. For the AMP antibiotic resistance prediction task, nine parameter combinations were set, with K∈{2,3,4} and d∈{3,5,7}, and the accuracy performance of the GNN under different parameter configurations was evaluated through cross-validation. Experimental results show that the GNN achieves the best prediction performance when K=3 and d=5.
[0070] b. Experimental Results and Analysis
[0071] Experiments verified that different models exhibited significant performance differences in predicting drug antimicrobial resistance, and the predictive performance of the same drug was affected by dataset imbalance. Specifically, Support Vector Machine (SVM) performed best in predicting NAL resistance; for AUG and CHL, Graph Neural Network (Graph Neural Network) and Random Forest (Random Forest) showed better resistance prediction; for AMP, AXO, FIS, FOX, and STR, only Logistic Regression (Logistic Regression) and Random Forest were applicable. Furthermore, the optimal prediction models for CIP, COT, and TET varied depending on the data balance ratio. Specifically, for CIP, Graph Neural Network, Logistic Regression, and SVM showed the best performance under different balance ratios; for COT, the optimal models were SVM, Logistic Regression, and Random Forest; and for TET, the optimal models were Graph Neural Network, Random Forest, and Logistic Regression.
[0072] Analysis of drug accuracy showed that CIP and NAL achieved accuracies exceeding 0.9 across all data ratios, indicating that their positive and negative sample characteristics were easily identifiable, facilitating accurate model predictions. COT and FOX maintained stable accuracies around 0.8, primarily due to the smaller differences in sample characteristics, increasing the difficulty for the model to distinguish between them. The experiment also revealed that the prediction accuracy of most drugs decreased when the data distribution was balanced, as the models were prone to "averaging" learning, making it difficult to capture key features of a few samples, resulting in insufficient generalization ability. Different drugs exhibited varying adaptability to data distribution. AMP, AXO, CIP, FIS, and STR reached peak accuracy at a 1:3 data ratio, while CHL, COT, NAL, and TET performed best at a 1:4 data ratio. Appropriately adjusting the sample ratio can improve the prediction performance of specific drugs.
[0073] In comparisons of LR, SVM, RF, and GNN models for gene sequence data, GNN generally exhibits lower accuracy and precision, sometimes even misclassifying all test data as positive samples. This is due to the loss of contextual information during k-mer segmentation and node recombination, leading to misalignment of mutation sites and biased feature representation during gene sequence graph transformation. However, compared to traditional machine learning models, GNN significantly reduces input dimensionality through graph structure encoding, substantially improving computational efficiency and offering a clear advantage in processing time, thus providing an innovative paradigm for gene sequence analysis.
[0074] Table 1: Prediction results of different models for antibiotic resistance
[0075]
[0076] Table 2: Preliminary model selection knowledge base for different antibiotics and data distributions
[0077]
[0078] Antibiotics are encoded into molecular structures to obtain antibiotic feature vectors; strain genomic features are extracted based on three dimensions: base mutation ratio, base mutation site, and direction, and a genomic distribution feature vector is constructed; the antibiotic feature vector is then concatenated with the genomic feature vector.
[0079] In one embodiment, the step includes:
[0080] 1) Base mutation ratio analysis
[0081] For a given gene, the mutation ratio is calculated by counting the number of mutated bases within it. Furthermore, the mutation ratios of the four bases (A, T, C, and G) are calculated separately to refine the variation characteristics of different base types. This index is used to quantify the overall mutation level and base preference of a gene sequence, providing fundamental molecular-level data support for the analysis of drug resistance mechanisms.
[0082] 2) Statistics on mutation sites and directions
[0083] The gene exhibits 12 possible mutation directions, including 'A-T', 'A-C', 'A-G', 'T-A', 'T-C', 'T-G', 'C-A', 'C-T', 'C-G', 'G-A', 'G-T', and 'G-C'. We first identified the top K mutation sites with the highest mutation frequency and recorded the specific mutation directions at these sites. By focusing on high-frequency mutation sites and their directions, we can reveal hotspot mutation patterns related to drug resistance, providing crucial clues for understanding the association between genomic variations and antibiotic resistance.
[0084] 3) Drug molecular structure characteristics
[0085] Differences in drug molecular structure significantly influence the weighting of gene features in drug resistance prediction models. To quantify this effect, we extracted the two-dimensional molecular structure of each antibiotic using RDKit and Pubchempy tools, and encoded the molecular structure using SMILES notation in conjunction with a ChemBERT pre-trained model. This feature transforms the chemical structural information of the drug into a computable numerical representation, enhancing the model's ability to characterize drug-genome interactions.
[0086] Table 3: Molecular Structure of Antibiotics
[0087]
[0088] 4) Joint eigenvectors
[0089] By combining antibiotic molecular features encoded by ChemBERT with genomic distribution statistics, this method effectively captures antibiotic-genome interactions. First, a pre-trained ChemBERT model is used to encode the molecular structure of antibiotics. Then, the drug feature vector and the genomic distribution feature vector are merged into a single high-dimensional vector h. i (i.e., molecular-genomic joint feature vector):
[0090]
[0091] in, d represents the drug molecule embedding vector. chem =768; The characteristics of genome distribution, where a i The t represents the eigenvector representing the proportion of base mutations. i d represents the statistical eigenvector of mutation sites and directions. genome =4+k, where k is the number of hotspot mutation sites.
[0092] By combining the initial model selection knowledge base, the class center results of each model for the spliced feature vector are calculated, and the prototype center of each model is constructed. For new antibiotic-genome feature pairs, the model type corresponding to the nearest model prototype center is dynamically selected to achieve the best antibiotic resistance prediction model adaptation.
[0093] In one embodiment, by combining drug characteristics with genomic distribution statistics, a prototype network is used to calculate the distance between features to measure their similarity, thereby obtaining the optimal drug resistance prediction model selection under different antibiotics and data distributions;
[0094] This step is the core of this method and is divided into the following sub-steps.
[0095] 1) Data augmentation based on generative adversarial networks
[0096] In this study, the limited size of the optimal model knowledge base for each antibiotic under different data distributions significantly restricts model performance, making it difficult for the model to effectively extract data features during training. This increases the risk of overfitting, affecting prediction efficiency and limiting generalization ability. To alleviate this problem, this study adopts a data augmentation strategy based on generative adversarial networks. By organically fusing noisy data conforming to a Gaussian distribution with the original dataset, the data samples are effectively expanded. The specific steps are as follows: First, the meta-learning dataset is divided into training and test sets in an 8:2 ratio; then, based on the difference in the number of samples for different model categories in the training set, a dynamic augmentation rule is designed: when the number of samples n... samples When the sample size is ≤5, the sample size is expanded to max(30,n). samples ×5); when 5 < n samples When ≤10, expand to max(30,n) samples ×3); when 10 <n samples When ≤20, expand to max(30,n) samples ×1.5). This adaptive sample augmentation mechanism effectively increases the proportion of data in the few-sample classes, significantly increasing the diversity and complexity of the dataset.
[0097] 2) Model selection strategy based on prototype networks
[0098] The core idea of prototype networks is to achieve classification and similarity assessment by calculating the distance between a sample and the prototypes of each category. In molecular and genomic feature analysis, we use prototype networks to calculate the distance between features to measure their similarity: for a joint molecular-genomic feature vector set, the prototype network learns the prototype p corresponding to each category. k For two given eigenvectors h i and h jInstead of directly calculating the cosine similarity between the two, we calculate their distances to the prototypes of each category separately. Where h i With category k prototype p k The distance is d i,k =|h i -p k |2,h j With prototype p k The distance is d j,k =|h j -p k |2.
[0099] Based on the above distance distribution, a comprehensive distance metric s is defined. ij To quantify the global alignment between molecular and genomic features:
[0100]
[0101] Where w k This represents the weight of each prototype category. The range of this metric is similar to that of the original cosine similarity: a smaller value indicates a stronger similarity between the molecular structure and the mutation spectrum, while a larger value suggests a greater difference in drug resistance pathways. Through the prototype network, the model can effectively distinguish the optimal model selection under different antibiotic and data distribution conditions.
[0102] 3) Experimental Results and Analysis
[0103] a. Experimental results for selecting the best model
[0104] Based on the accuracy analysis results of different drugs under various data proportions, this invention systematically examines the applicability of each model. Building upon this, it innovatively combines drug molecular structure features with inherent attributes of the dataset, introducing a matching network to construct a meta-learning framework. This framework effectively solves the generalization limitations of traditional models in complex scenarios by dynamically capturing high-order correlations between drug data features.
[0105] This model demonstrates strong robustness in selecting the optimal base model (LR, RF, SVM, GNN) for a given drug-dataset pair. To ensure the reliability and accuracy of the experimental results, a five-fold cross-validation method was employed: the dataset was divided into five equal parts, with four parts used for training and one for testing each time, repeated five times so that each part was used as the test set once. The result was the average of the five validations, and the confusion matrix was a comprehensive summary of the five-fold results, fully reflecting the model's classification performance. The model predicted that SVM and GNN were the optimal models with the highest accuracy of 0.83; followed by RF and LR with 0.77 and 0.70, respectively. In terms of recall, GNN achieved the ideal value of 1.00, RF was 0.85, SVM was 0.71, and LR was 0.58.
[0106] Table 4: Experimental results for selecting the best meta-learning model
[0107] Label MP Recall F1 score LR 0.7 0.58 0.64 SVM 0.83 0.71 0.77 RF 0.77 0.85 0.81 GNN 0.83 1.00 0.91
[0108] b. Performance of cross-validation for unknown drugs
[0109] This invention employs a hierarchical cross-validation method to evaluate the model's predictive performance on resistance to unknown drugs. First, a specific category of drugs is designated as the test set. A positive training set is constructed by carefully selecting drugs with structures highly similar to those in the test set, while drugs with significant structural differences are selected as the negative training set to form a control group.
[0110] To characterize the structural relationships between drug molecules, pairwise similarity comparisons were performed using molecular fingerprints. The Morgan fingerprints of each compound with radii of 2 and 1024 were calculated using the cheminformatics tool in RDKit, and the similarity score was calculated using the Tanimoto coefficient, as shown in the following formula:
[0111]
[0112] Where n is the fingerprint vector length, A i and B i Let A and B be the i-th elements (with values of 0 or 1), respectively; the numerator is the number of elements in both vectors whose corresponding positions are both 1, and the denominator is the total number of elements in both vectors whose at least one position is 1, with values ranging from 0 to 1 (0 indicates complete dissimilarity, 1 indicates complete similarity). Based on the similarity scores, it can be found that AMP, AUG, and AXO have high similarity, while other drugs have low similarity.
[0113] Table 5: Similarity matrix among antibiotics
[0114]
[0115] Experimental results show that the model performs well in predicting AMP, AUG, and AXO, with macro-accuracies of 0.83, 0.63, and 0.75, respectively, while the prediction performance for other drugs declines. This indicates that the similarity between training and testing data significantly affects the model's predictive ability. Constructing a training set with chemical structures and pharmacological properties highly similar to the test drugs can effectively improve the model's ability to capture and predict the characteristics of similar drugs. Experiments also demonstrate that when faced with unknown drug inputs, the model can screen and recommend suitable prediction schemes based on drug similarity metrics, exhibiting a certain generalization ability and reference value in zero-shot testing scenarios.
[0116] Table 6: Performance of cross-validation for unknown drugs
[0117] index AMP AUG AXO CHL CIP COT FIS FOX NAL STR TET MP 0.83 0.63 0.75 0.5 0.33 0.08 0.25 0.25 0.5 0.5 0.44
[0118] Figure 4 This is a schematic diagram of an electronic device structure provided in an embodiment of the present invention. Please refer to... Figure 4 The electronic device provided in this embodiment includes a memory and a processor. The memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions. When the program instructions are loaded and executed by the processor, they realize an antibiotic resistance prediction based on a metric learning architecture according to the present invention.
[0119] It should be noted that, in addition to Figure 4 In addition to the memory and processor shown, electronic devices may include other hardware depending on their actual functions, which will not be elaborated further.
[0120] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method for predicting antibiotic resistance based on a metric learning architecture.
[0121] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method for predicting antibiotic resistance based on a metric learning architecture.
[0122] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0123] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0124] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0125] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0126] The above embodiments are only used to illustrate the design concept and features of the present invention, and their purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, all equivalent changes or modifications made based on the principles and design ideas disclosed in the present invention are within the protection scope of the present invention.
Claims
1. A method for predicting antibiotic resistance based on a metric learning architecture, characterized in that, include: Antibiotic resistance phenotype data for a single strain were obtained, and multiple sequencing results were integrated based on the reference genome of that strain to generate a core SNP genome dataset. Several models were selected from the fields of machine learning and deep learning. Each model was trained using the core SNP genome dataset. Their performance in the antibiotic resistance prediction task was evaluated, and a preliminary model selection knowledge base was constructed. Antibiotics are encoded into molecular structures to obtain antibiotic feature vectors; strain genomic features are extracted based on three dimensions: base mutation ratio, base mutation site, and direction, and a genomic distribution feature vector is constructed; the antibiotic feature vector is then concatenated with the genomic feature vector. Based on the preliminary model, select a knowledge base, calculate the category center result of each model for the concatenated feature vector, and construct the prototype center of each model; For new antibiotic-genome feature pairs, the model type corresponding to the nearest model prototype center is dynamically selected to achieve the best antibiotic resistance prediction model adaptation.
2. The method according to claim 1, characterized in that, The generation of the core SNP genome dataset also includes: Unmutated sites are labeled as tag N, while other mutated sites remain the bases A, T, C, and G.
3. The method according to claim 1, characterized in that, Several models from the fields of machine learning and deep learning were selected and trained using the core SNP genomic dataset. Their performance in the antibiotic resistance prediction task was then evaluated, including: Four models were selected from the two major fields of machine learning and deep learning: logistic regression, support vector machine, random forest, and graph neural network. Using core SNP genomic data as features and the corresponding antibiotic resistance as the prediction result, the data is input into three machine learning models: logistic regression, support vector machine, and random forest. The models are then optimized through grid search to obtain the prediction results of different models. The sequence data of the core SNP genome is converted into graph data. Gene k-mer sequences are abstracted as nodes, and k-mer fragments are regarded as node links. Graph neural networks are used to deeply mine the topological features of the gene network and its association patterns with antibiotic molecules to obtain the prediction results of antibiotic resistance. Among them, the k-mer sequence is a substring of k consecutive bases extracted from the genome sequence, which is the basic unit of the sequence. It is regarded as a node, and the vertex feature is set as the occurrence frequency. The positional relationship between two k-mers in the original sequence is regarded as a k-mer fragment. Based on the prediction results, the performance of each model in the antibiotic resistance prediction task was evaluated.
4. The method according to claim 1, characterized in that, Constructing a preliminary model and selecting a knowledge base includes: Based on the evaluation of the performance of each model in the antibiotic resistance prediction task, the optimal model for antibiotics corresponding to different data distributions is determined, so as to construct a preliminary model selection knowledge base.
5. The method according to claim 1, characterized in that, To address the issue of limited knowledge base size for optimal models of various antibiotics under different data distributions, a data augmentation strategy based on generative adversarial networks is adopted. This strategy effectively expands the data sample by organically integrating noisy data conforming to a Gaussian distribution with the original dataset.
6. The method according to claim 1, characterized in that, Obtaining antibiotic feature vectors includes: Two-dimensional molecular structures of each antibiotic were extracted using RDKit and Pubchempy tools, and the extracted antibiotic molecular structures were encoded using a ChemBERT pre-trained model to obtain antibiotic feature vectors.
7. The method according to claim 1, characterized in that, Constructing a genome distribution feature vector includes: For a given genome, the proportion of base mutations is determined by counting the number of mutated genes; the mutation proportions of the four bases A, T, C, and G are calculated separately, and a feature vector of base mutation proportions is obtained from the base level. Considering that there are 12 mutation directions in genes, the top K sites with the highest mutation frequency were screened out, and the mutation directions corresponding to these sites were recorded. From the perspectives of site and direction, we conducted in-depth analysis to obtain statistical feature vectors of mutation sites and directions. A genome distribution feature vector is constructed based on the base mutation ratio feature vector and the mutation site and direction statistical feature vector.
8. An electronic device comprising a memory and a processor, characterized in that, The memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the antibiotic resistance prediction method based on a metric learning architecture as described in any one of claims 1-7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements an antibiotic resistance prediction method based on a metric learning architecture as described in any one of claims 1-7.
10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements an antibiotic resistance prediction method based on a metric learning architecture as described in any one of claims 1-7.