Machine Learning Classification of Antimicrobial Resistance Genes
Introduction
Antimicrobial resistance (AMR) represents a growing threat to veterinary medicine, livestock production, and companion animal health. The identification and classification of resistance genes from bacterial genomes and metagenomes have become essential for surveillance, outbreak investigation, and therapeutic guidance. Traditional methods such as phenotypic susceptibility testing and PCR-based assays are increasingly supplemented by computational approaches that leverage whole-genome sequencing (WGS) data [1, 2, 3]. Machine learning (ML) classifiers offer the ability to detect known resistance genes, identify novel determinants, and predict resistance phenotypes directly from genomic sequences [4, 5, 6]. This article provides an exhaustive technical review of the computational frameworks, feature engineering strategies, and model architectures employed for the ML-based classification of AMR genes, with a focus on applications in veterinary bacterial pathogens.
Feature Representations for AMR Gene Classification
The performance of any ML classifier depends critically on the representation of input genomic data. Several paradigms have been developed to encode bacterial sequences into feature vectors that ML algorithms can process.
K-mer Frequency Profiles
The simplest and most widely used representation is based on k-mer frequencies. Short oligonucleotide sequences of length k are counted from assembled contigs or raw reads, and the resulting abundance vector is used as input to classifiers such as random forests, support vector machines, or gradient-boosted trees [7, 8]. K-mers capture local sequence composition and can distinguish between conserved resistance determinants and flanking mobile genetic elements. For example, the AMR-meta pipeline employs a k-mer and metafeature approach to classify resistance from short-read metagenomic data, achieving high accuracy across diverse environments [7]. K-mer-based features have been successfully applied to predict resistance in Escherichia coli [1, 8], Klebsiella pneumoniae [9], Staphylococcus aureus [10], and Mycobacterium tuberculosis [11, 12].
Unitig and Pan-Genome Representations
A more sophisticated representation uses unitigs, which are short, non-branching sequences extracted from a de Bruijn graph assembled from a collection of genomes. Unitig-centered pan-genome approaches capture both core and accessory genomic variation without requiring a complete genome assembly [13]. Do et al. demonstrated that unitig-based features combined with gradient boosting can predict antibiotic resistance and discover novel resistance genes in bacterial strains [13]. This approach overcomes the reference bias inherent in mapping-based methods and is particularly useful for species with high genomic diversity, such as Salmonella enterica [14, 2] and Listeria monocytogenes [15].
Whole-Genome Variant Matrices
For organisms where well-curated reference genomes exist, single-nucleotide polymorphisms (SNPs) and insertion-deletion variants can be encoded as binary or categorical matrices. Each variant position is treated as a feature, and the collection of variants across a training set is used to train classifiers that associate specific mutations with resistance phenotypes [16, 17, 18]. Jiang et al. employed a hierarchical attentive neural network that uses genome-wide variants to predict drug resistance in M. tuberculosis [16]. Similarly, Libiseller-Egger et al. developed a robust detection method for point mutations involved in multi-drug resistance in the presence of co-occurrent resistance markers [19].
Protein Sequence and Structural Encodings
For classification of resistance genes at the protein level, amino acid sequences can be converted into numerical features using physicochemical properties, position-specific scoring matrices, or embeddings from protein language models. Deep learning architectures such as convolutional neural networks (CNNs) and Transformers have been adapted to process protein sequences directly. The multi-channel Transformer model MCT-ARG uses embeddings from multiple sequence representations to identify and classify antibiotic resistance genes with high sensitivity [4]. ARGNet employs deep neural networks on sequence encodings for robust identification and classification of resistance genes from both genomic and metagenomic data [6].
The choice of feature representation is often determined by the available data type (assemblies versus raw reads) and the specific classification task (gene detection versus phenotype prediction). Table 1 summarizes the main feature types and their applications.
Table 1. Common feature representations for ML-based AMR classification.
| Feature Type | Data Source | Typical Models | Example Applications | Key References |
|---|---|---|---|---|
| K-mer frequencies | Raw reads or contigs | Random forest, XGBoost | Metagenomic resistome profiling | [7, 8, 20] |
| Unitig presence-absence | Pan-genome graphs | Gradient boosting | Novel gene discovery | [13] |
| SNP/variant matrices | Aligned genomes | Neural networks, SVM | Phenotype prediction | [16, 19, 17] |
| Protein embeddings | Translated ORFs | CNNs, Transformers | Gene family classification | [4, 6] |
Machine Learning Algorithms and Architectures
A broad spectrum of ML algorithms has been applied to AMR classification, ranging from classical ensemble methods to deep neural networks and generative adversarial networks (GANs).
Ensemble Methods
Ensemble learning approaches, particularly random forests and gradient-boosted trees (e.g., XGBoost, LightGBM), have been widely adopted due to their robustness to high-dimensional feature spaces and ability to capture non-linear interactions. Wijaya et al. evaluated ensemble learning for horizontal gene transfer detection, demonstrating that combining multiple base classifiers improved sensitivity for detecting mobile resistance elements [21]. Chowdhury et al. developed PARGT, a software tool that uses random forests to predict antimicrobial resistance from genomic features [20]. Game theory-based feature evaluation has also been integrated with ensemble methods to identify the most informative k-mers for Gram-negative bacteria [22].
Deep Neural Networks
Deep learning has substantially advanced AMR classification, particularly for phenotype prediction from WGS data. Hierarchical attentive neural networks can process genome-wide variant positions and assign attention weights to mutations that are most predictive of resistance [16]. Multi-label classification frameworks allow simultaneous prediction of resistance to multiple drugs from a single input, as demonstrated for E. coli by Ren et al. [8]. For M. tuberculosis, Deelder et al. showed that deep learning models trained on WGS data can predict drug resistance more accurately than conventional rule-based genotyping [23].
Transformer Models and Attention Mechanisms
Transformer architectures, originally developed for natural language processing, have been adapted for genomic sequences due to their ability to capture long-range dependencies. The MCT-ARG model uses a multi-channel Transformer with self-attention layers to classify antibiotic resistance genes [4]. This approach effectively highlights conserved motifs within resistance determinants while ignoring non-informative flanking sequence.
Convolutional Neural Networks
CNNs applied to one-dimensional sequence encodings (1D-CNNs) are effective for detecting conserved resistance domains such as beta-lactamase active sites or aminoglycoside modifying enzymes. ARGNet uses deep 1D-CNN layers to robustly classify resistance genes even from partial or noisy sequences [6].
Generative Adversarial Networks and Data Augmentation
A major challenge in AMR classification is the class imbalance between resistant and susceptible strains, as well as the underrepresentation of rare resistance genes. Nayak et al. introduced ARGai 1.0, a GAN augmented approach that generates synthetic sequence variants of known resistance genes to improve the training of vision transformers for E. coli [24]. This augmentation strategy significantly enhanced recall for rare resistance classes.
Figure 1. Generalized workflow for ML-based AMR gene classification.
flowchart TD
A[Genomic or metagenomic DNA], > B[Sequencing & base calling]
B, > C{Data type}
C, >|Assembly-based| D[Genome assembly & annotation]
C, >|Read-based| E[K-mer counting or unitig extraction]
D, > F[Variant calling or ORF prediction]
E, > G[Feature vector construction]
F, > G
G, > H[Model training or inference]
H, > I[Classification output: Resistance gene present/absent or drug phenotype]
I, > J[Validation with phenotypic data or databases]
Applications Across Veterinary Pathogen Species
ML-driven AMR classification has been applied to a wide range of bacterial species relevant to veterinary medicine.
Escherichia coli and Avian Colibacillosis
E. coli is a major pathogen in poultry, causing colibacillosis and extraintestinal infections. Several studies have used WGS combined with ML to predict resistance phenotypes in avian and urinary tract isolates [1, 25, 26, 8, 3]. Wan et al. utilized whole genome sequencing data and ML models to predict antibiotic resistance in E. coli, identifying key genomic features associated with multidrug resistance [1]. Nayak et al. developed aiGeneR 3.0, an enhanced deep network model that uses next-generation sequencing data for resistant strain identification and multi-drug prediction in E. coli causing urinary tract infections [25]. The pan-genomic approach of Shaik et al. identified both core and accessory resistance determinants in globally prevalent E. coli lineages, including high-risk clonal complexes [3]. For poultry-specific context, see the article on Avian Colibacillosis: Pathogenesis, Diagnosis, and Antimicrobial Resistance Patterns in Poultry.
Salmonella enterica
Salmonella serovars are important zoonotic pathogens transmitted through food animals. Yang et al. performed a genome-wide association study to identify bla-harboring Salmonella and cephalosporin resistance mechanisms, using ML models to classify resistance genotypes [14]. Chen and Cui examined the population structure of chicken-associated Salmonella Typhimurium in the United States, integrating comparative genomics with ML to link serovar-specific resistance profiles [2]. Chalka et al. showed that intergenic regions provide valuable genomic features for host attribution and resistance classification in Salmonella Typhimurium [27].
Staphylococcus aureus in Livestock
S. aureus is a major cause of mastitis in dairy cattle and skin infections in poultry. Chaki et al. performed a comprehensive in silico genomic surveillance of beta-lactam and methicillin resistance in S. aureus, applying ML to analyze lineage dynamics and global evolution of resistance determinants [10]. The study identified lineage-specific signatures that improve classification accuracy. For a broader perspective, see Antimicrobial Resistance in Livestock-Associated Staphylococcus aureus: Genomic Epidemiology and One Health Implications.
Mycobacterium tuberculosis Complex
M. tuberculosis complex organisms cause tuberculosis in cattle, wildlife, and humans. ML classification of resistance in mycobacteria has been extensively studied due to the clonal nature of the pathogen. Serajian et al. developed a scalable de novo classification method for antibiotic resistance of M. tuberculosis that does not require a reference genome [12]. Subalakshmi and Mahesh reviewed various ML approaches for predicting drug resistance in tuberculosis [11]. Several studies have used hierarchical neural networks, random forests, and SVM on variant data [16, 19, 17, 23, 18]. While primarily focused on human isolates, these methodologies are directly transferable to bovine tuberculosis surveillance.
Other Veterinary Pathogens
ML-based AMR classification has been applied to an expanding list of veterinary pathogens. Chen et al. used pan-genomics and machine learning to explore serotyping and antibiotic resistance differences in Riemerella anatipestifer, an important pathogen of ducks [28]. For Listeria monocytogenes, Sun et al. combined WGS and ML to identify genomic features associated with persistence in ice cream facilities, including resistance genes [15]. Hyun et al. performed global pathogenomic analysis across twelve species, using ML to identify both known and candidate genetic AMR determinants [29]. The study by Peng et al. applied WGS and gene sharing network analysis powered by ML to identify antibiotic resistance sharing between animals, humans, and the environment in livestock farming settings [30].
Challenges and Considerations
Data Imbalance and Novel Gene Detection
Resistance genes are often rare in training datasets, leading to class imbalance that degrades classifier performance. GAN-based augmentation [24] and synthetic minority oversampling techniques have been employed to address this. However, the detection of truly novel resistance genes that share little sequence homology with known determinants remains a major challenge. DRAMMA, a multifaceted ML approach, attempts to detect novel AMR genes in metagenomic data by using context-based features rather than homology alone [5].
Interpretability and Biological Validation
Many deep learning models function as black boxes, making it difficult to identify which sequence regions drive classification decisions. Interpretable models such as attention-based Transformers provide some transparency by highlighting important input features [9, 4]. Araujo et al. harnessed interpretable deep learning to predict resistance in K. pneumoniae, enabling visualization of key k-mers [9]. Biological validation through gene knockout and heterologous expression experiments remains essential to confirm predicted resistance functions.
Horizontal Gene Transfer and Mobile Elements
Resistance genes are frequently located on mobile genetic elements such as plasmids, transposons, and integrons. This complicates classification because the same resistance gene can be present in different genomic contexts across species. Ensemble learning for horizontal gene transfer detection has been explored by Wijaya et al. to improve identification of transferred resistance determinants [21]. Accessory genes, which are often plasmid-borne, define species-specific routes to antibiotic resistance, as demonstrated by Dillon et al. [31].
Multi-Drug Resistance Prediction
Predicting resistance to multiple antibiotics simultaneously (multi-label classification) is more clinically relevant than binary predictions for single drugs. Ren et al. developed a multi-label classification approach for E. coli that predicts resistance to 11 antibiotics simultaneously using k-mer features [8]. Tan et al. used ML to classify non-coding genomic allelic variations associated with Erm-mediated antibiotic resistance, highlighting the role of regulatory mutations in multidrug resistance [32].
Computational Scalability
Processing large volumes of metagenomic or multi-strain WGS data requires efficient algorithms. The AMR-meta pipeline demonstrated scalable classification from short-read data using k-mer features [7]. Unitig-based methods also offer computational efficiency by reducing the feature space [13]. For Candida auris drug resistance analysis, ML classifiers were applied to variant data with manageable computational overhead [33]. Similar principles apply to bacterial pathogens.
Future Directions
The integration of protein language models and structural bioinformatics is expected to improve the detection of resistance genes with low sequence identity to known families. Approaches combining genomic context, such as flanking mobile element signatures, will enhance novel gene discovery. Multi-omics integration, including transcriptomic and proteomic data, may provide more accurate phenotype predictions. Large-scale collaborative initiatives that standardize training datasets across veterinary and human health sectors will be critical. For related computational approaches in virology, see Computational Approaches to Understanding Antimicrobial Resistance (AMR) and Predicting Antimicrobial Resistance from Genomic Data.
Frequently Asked Questions
What are the main data types used for training machine learning models to classify AMR genes?
The primary data types are k-mer frequency vectors from raw reads or assemblies, unitig presence-absence matrices from pan-genome graphs, binary SNP matrices from aligned genomes, and protein sequence embeddings [7, 13, 8, 4]. Each representation captures different aspects of genomic variation relevant to resistance.
Which machine learning algorithms perform best for AMR gene classification?
Ensemble methods (random forests, XGBoost) are robust for high-dimensional k-mer data [21, 22]. Deep neural networks, including 1D-CNNs and hierarchical attention networks, excel at phenotype prediction from variant data [9, 16]. Transformer-based models such as MCT-ARG provide strong performance for gene-level classification [4].
Can machine learning detect completely novel resistance genes with no known homologs?
Detection of truly novel genes remains difficult because most models rely on sequence similarity to training data. However, context-based approaches that examine genomic neighborhoods and structural features (e.g., DRAMMA, unitig-based methods) offer some capability for discovering distant homologs [5, 13].
How are class imbalance issues addressed in AMR gene classification?
Data augmentation using generative adversarial networks (ARGai 1.0) and synthetic oversampling are used to balance resistant and susceptible classes [24]. Weighted loss functions and ensemble bootstrapping also help mitigate imbalance.
Is machine learning-based AMR classification ready for clinical veterinary diagnostics?
Several tools (e.g., aiGeneR 3.0, PARGT, AMR-meta) have shown high accuracy in research settings [25, 20, 7]. However, integration into routine veterinary diagnostic workflows requires further validation across diverse animal species, standardised phenotypic databases, and regulatory approval.
References
[1] Wan F, Tong W, Wu W et al. Utilizing whole genome sequencing data for machine learning driven prediction of antibiotic resistance in Escherichia coli. Front Microbiol. 2026.
[2] Chen Z, Cui M. Comparative genomics reveals antimicrobial resistance and population structure of chicken-associated Salmonella enterica serotype Typhimurium in the United States. Lett Appl Microbiol. 2025.
[3] Shaik S, Singh A, Suresh A et al. Genome Informatics and Machine Learning-Based Identification of Antimicrobial Resistance-Encoding Features and Virulence Attributes in Escherichia coli Genomes Representing Globally Prevalent Lineages, Including High-Risk Clonal Complexes. mBio. 2021.
[4] He L, Li H, Qi R et al. MCT-ARG: Identification and classification of antibiotic resistance genes based on a multi-channel Transformer model. Sci Total Environ. 2025.
[5] Rannon E, Shaashua S, Burstein D. DRAMMA: a multifaceted machine learning approach for novel antimicrobial resistance gene detection in metagenomic data. Microbiome. 2025.
[6] Pei Y, Shum MH, Liao Y et al. ARGNet: using deep neural networks for robust identification and classification of antibiotic resistance genes from sequences. Microbiome. 2024.
[7] Marini S, Oliva M, Slizovskiy IB et al. AMR-meta: a k-mer and metafeature approach to classify antimicrobial resistance from high-throughput short-read metagenomics data. Gigascience. 2022.
[8] Ren Y, Chakraborty T, Doijad S et al. Multi-label classification for multi-drug resistance prediction of Escherichia coli. Comput Struct Biotechnol J. 2022.
[9] Araujo NDMF, Chagas MDS, Santos MF et al. Harnessing interpretable deep learning to predict resistance in Klebsiella pneumoniae. Front Cell Infect Microbiol. 2026.
[10] Chaki SSG, Midhin BK, Alshkarchy SS et al. Comprehensive in silico genomic surveillance of β-lactam and methicillin resistance in Staphylococcus aureus: Machine learning-based analysis of lineage dynamics and global evolution. Infect Genet Evol. 2026.
[11] Subalakshmi AT, Mahesh A. Machine learning approaches to predict drug resistance in tuberculosis. Comput Biol Chem. 2026.
[12] Serajian M, Marini S, Alanko JN et al. Scalable de novo classification of antibiotic resistance of Mycobacterium tuberculosis. Bioinformatics. 2024.
[13] Do DT, Yang MR, Vo TNS et al. Unitig-centered pan-genome machine learning approach for predicting antibiotic resistance and discovering novel resistance genes in bacterial strains. Comput Struct Biotechnol J. 2024.
[14] Yang Q, Zhang J, Chen T et al. Global prevalence and distribution of bla-harboring Salmonella: A genome-wide association study of cephalosporin resistance mechanisms. Food Microbiol. 2026.
[15] Sun L, Zhou J, Shen Y et al. Whole-genome sequencing and machine learning reveal candidate genomic features associated with Listeria monocytogenes persistence in two ice cream facilities. Int J Food Microbiol. 2026.
[16] Jiang Z, Lu Y, Liu Z et al. Drug resistance prediction and resistance genes identification in Mycobacterium tuberculosis based on a hierarchical attentive neural network utilizing genome-wide variants. Brief Bioinform. 2022.
[17] Jamal S, Khubaib M, Gangwar R et al. Artificial Intelligence and Machine learning based prediction of resistant and susceptible mutations in Mycobacterium tuberculosis. Sci Rep. 2020.
[18] Sergeev RS, Kavaliou IS, Sataneuski UV et al. Genome-Wide Analysis of MDR and XDR Tuberculosis from Belarus: Machine-Learning Approach. IEEE/ACM Trans Comput Biol Bioinform. 2019.
[19] Libiseller-Egger J, Phelan J, Campino S et al. Robust detection of point mutations involved in multidrug-resistant Mycobacterium tuberculosis in the presence of co-occurrent resistance markers. PLoS Comput Biol. 2020.
[20] Chowdhury AS, Call DR, Broschat SL. PARGT: a software tool for predicting antimicrobial resistance in bacteria. Sci Rep. 2020.
[21] Wijaya AJ, Anžel A, Hattab G. Evaluating ensemble learning approaches for horizontal gene transfer detection. Sci Rep. 2026.
[22] Chowdhury AS, Call DR, Broschat SL. Antimicrobial Resistance Prediction for Gram-Negative Bacteria via Game Theory-Based Feature Evaluation. Sci Rep. 2019.
[23] Deelder W, Christakoudi S, Phelan J et al. Machine Learning Predicts Accurately Mycobacterium tuberculosis Drug Resistance From Whole Genome Sequencing Data. Front Genet. 2019.
[24] Nayak DSK, Das R, Sahoo SK et al. ARGai 1.0: A GAN augmented in silico approach for identifying resistant genes and strains in E. coli using vision transformer. Comput Biol Chem. 2025.
[25] Nayak DSK, Pati A, Panigrahi A et al. aiGeneR 3.0: an enhanced deep network model for resistant strain identification and multi-drug resistance prediction in Escherichia coli causing urinary tract infection using next-generation sequencing data. Front Genet. 2025.
[26] Nayak DSK, Mahapatra S, Routray SP et al. aiGeneR 1.0: An Artificial Intelligence Technique for the Revelation of Informative and Antibiotic Resistant Genes in Escherichia coli. Front Biosci (Landmark Ed). 2024.
[27] Chalka A, Dallman TJ, Vohra P et al. The advantage of intergenic regions as genomic features for machine-learning-based host attribution of Salmonella Typhimurium from the USA. Microb Genom. 2023.
[28] Chen J, Liu Y, Fu L et al. Exploring the molecular basis of serotyping and antibiotic resistance differences in Riemerella anatipestifer based on pan-genomics and machine learning. Vet Microbiol. 2026.
[29] Hyun JC, Monk JM, Szubin R et al. Global pathogenomic analysis identifies known and candidate genetic antimicrobial resistance determinants in twelve species. Nat Commun. 2023.
[30] Peng Z, Maciel-Guerra A, Baker M et al. Whole-genome sequencing and gene sharing network analysis powered by machine learning identifies antibiotic resistance sharing between animals, humans and environment in livestock farming. PLoS Comput Biol. 2022.
[31] Dillon L, Dimonaco NJ, Creevey CJ. Accessory genes define species-specific routes to antibiotic resistance. Life Sci Alliance. 2024.
[32] Tan Y, Le Scornet A, Yap MF et al. Machine learning-based classification reveals distinct clusters of non-coding genomic allelic variations associated with Erm-mediated antibiotic resistance. mSystems. 2024.
[33] Li D, Wang Y, Hu W et al. Application of Machine Learning Classifier to Candida auris Drug Resistance Analysis. Front Cell Infect Microbiol. 2021.
[34] Naidenov B, Lim A, Willyerd K et al. Pan-Genomic and Polymorphic Driven Prediction of Antibiotic Resistance in Elizabethkingia. Front Microbiol. 2019.
[35] Cai Y, Liao Z, Ju Y et al. Resistance gene identification from Larimichthys crocea with machine learning techniques. Sci Rep. 2016. *** Disclaimer: This article is for educational and informational purposes only. It is not intended to substitute for professional veterinary advice, diagnosis, treatment, or regulatory guidance. Always consult a licensed veterinarian or qualified specialist regarding animal health, disease diagnosis, and therapeutic decisions.