Read Time: 7 minutes

Predicting microbial antibiotic resistance with AI

Scientists used machine learning models to predict the prevalence of antibiotic resistance genes in agricultural soil under future climate scenarios.


shadow
Image Credit: "Staphylococcus Bacteria" from Scientific Animations is licensed under CC BY-SA 4.0

Have you ever wondered how researchers use artificial intelligence (AI) in environmental science? Certain AI computer models can learn from scientific data and operate without manual programming, in a process called machine learning. Machine learning models can identify patterns in environmental datasets and help scientists assess public health risks linked to environmental conditions.

One well-known public health risk is the rise in antibiotic-resistant bacteria. These bacteria carry genes called antibiotic resistance genes that protect them from antibiotic medicines. As the number of these genes increases, the medicines become less effective, and diseases spread faster.

Agricultural soils are the largest reservoirs of antibiotic resistance genes, because manure from livestock like cows and pigs often contains leftover antibiotics fed to them. When used as fertilizer, this manure transfers antibiotics into the agricultural soil, where bacteria develop antibiotic resistance genes.

To better understand how antibiotic-resistant bacteria will affect global health in the future, scientists want to develop faster ways to detect antibiotic resistance genes. However, current methods of detection are slow and fail to predict future trends. To address this problem, a group of scientists from Algeria used machine learning models to predict the prevalence of antibiotic resistance genes in soil microbes under future climate scenarios, and to identify the key environmental drivers and high-risk areas.

​The team compiled existing microbial data from 3 public databases: the National Center for Biotechnology Information’s Sequence Read Archive, the Metagenomic Rapid Annotations using Subsystems Technology database, and the Joint Genome Institute’s Integrated Microbial Genomes & Microbiomes database. Their final dataset contained about 2,000 agricultural soil samples from 67 countries across 6 continents. These samples represented a wide range of soil characteristics, climate conditions, and different types of antibiotic resistance genes. 

They integrated the microbial dataset with climate data, including global temperature and precipitation measurements from WorldClim, and land use data, including crop types, irrigation systems, and livestock density from the European Space Agency Climate Change Initiative Land Cover maps. The researchers also included data on future climate projections for 2050 and 2070 from the World Climate Research Programme based on low, medium, and high global greenhouse gas emission scenarios. 

After preparing the datasets, the team set up 6 machine learning models that differ in terms of their data size, model complexity, analytical speed, and customization. These models included Light Gradient Boosting Machine (LightGBM), eXtreme Gradient Boosting (XGBoost), Random Forest (RF), Support Vector Machine (SVM), Deep Neural Network (DNN), and Logistic Regression (LR). 

They ran each model using different combinations of variables from their datasets, including soil properties, microbial community metrics, climate variables, and land use characteristics. To validate the models, the team separated the full dataset into 10 random subsets. They trained the models on 9 of the subsets, then recorded the result of the 10th subset. Each model repeated this process 10 times in a different order so that each subset was evaluated once in the results, using a technique known as stratified 10-fold cross-validation. The researchers scored each model on 5 performance metrics, including precision, sensitivity, and predictive power. Based on these results, they determined that LightGBM was the most accurate model. 

They found that the LightGBM model identified soil temperature as the strongest environmental predictor of antibiotic resistance genes. At soil temperatures above 18°C (about 64°F), the number of antibiotic resistance genes increased dramatically. The model also identified soil acidity, organic carbon content, moisture, and annual precipitation as influential variables, accounting for 71% of the increase in antibiotic resistance genes under future climate scenarios. Likewise, the LightGBM model predicted that the number of high-risk areas would increase by 35% under the high-emissions scenario, with South Asia, Sub-Saharan Africa, and Mediterranean Europe as the most vulnerable regions.

Based on the LightGBM model output, the team concluded that soil conditions will change to favor antibiotic resistance genes under all future climate scenarios. They also suggested that LightGBM is a fast and effective model for environmental predictions that could be used to assess other climate change risks such as natural disasters. They recommended that future researchers explore how to apply machine learning methods to early warning systems and utilize machine learning results in environmental management decisions. 

Study Information

Original study: Machine learning-based prediction of antibiotic resistance gene distribution in agricultural soils under different climate change scenarios

Study was published on: June 1, 2026

Study author(s): Meriem Kenzi, Meriem Benbernou, Hadjer Khelifa, Hadja Fatima Tbahriti

The study was done at: Higher School of Biological Sciences of Oran (Algeria), University of Oran (Algeria)

The study was funded by: None acknowledged

Raw data availability: Metagenomic data are available from the NCBI Sequence Read Archive, MG-RAST, and JGI Integrated Microbial Genomes & Microbiomes. Climate data were obtained from WorldClim 2.1 and CMIP6 archive.

Featured image credit: "Staphylococcus Bacteria" from Scientific Animations is licensed under CC BY-SA 4.0

This summary was edited by: Erin Faye Dizon