ResPredAI

Antimicrobial Resistance Prediction via Artificial Intelligence

A machine learning pipeline for predicting antimicrobial resistance in Gram-negative bloodstream infections

Discover more!

Project Overview

ResPredAI is an open-source machine learning pipeline designed to predict antimicrobial resistance (AMR) in Gram-negative bloodstream infections. Built to support clinical decision-making, it implements the methodology described in our research published in npj Digital Medicine.

The framework provides a comprehensive workflow for training, validating, and deploying predictive models, enabling clinicians to anticipate resistance patterns and optimize antimicrobial therapy selection.

Multiple ML Models

Support for 9 algorithms including Random Forest, XGBoost, CatBoost, and TabPFN

Rigorous Validation

Nested cross-validation with group-aware stratification to prevent data leakage

Model Interpretability

Feature importance analysis using native and SHAP-based methods

Documentation

Detailed guides, CLI reference, tutorials, and usage examples

Advanced Capabilities

Built-in tools for reliable, clinically meaningful predictions

Probability Calibration

Sigmoid and isotonic calibration with post-hoc adjustment for reliable predicted probabilities

Threshold Optimization

Youden, F1, F2, and cost-sensitive threshold selection for clinical decision-making

Conformal Prediction

Distribution-free prediction sets with per-class coverage guarantees via CV+ Mondrian conformal

Temporal Validation

Prospective-style evaluation using time-based train/test splits

Cross-Dataset Validation

Train on one dataset and evaluate on another for external generalizability

Subgroup Analysis

Stratified performance evaluation across clinical subgroups

Command Line Interface

A streamlined interface for reproducible model development and validation

respredai run

Execute nested cross-validation with configurable parameters

respredai feature-importance

Extract feature contributions for model interpretability

respredai train

Fit models with automated hyperparameter optimization

respredai evaluate

Assess model performance on external datasets

Original Research

npj Digital Medicine

Artificial Intelligence model to predict resistances in Gram-negative bloodstream infections

Bonazzetti, C., Rocchi, E., Toschi, A. et al.

npj Digital Medicine 8, 319 (2025)

Abstract

Artificial intelligence (AI) models are promising tools for predicting antimicrobial susceptibility in gram-negative bloodstream infections (GN-BSI). Single-center study on hospitalized patients with GN-BSI, over 7-year period, aimed to predict resistance to fluoroquinolones (FQ-R), third generation cephalosporins (3GC-R), beta-lactam/beta-lactamase inhibitors (BL/BLI-R) and carbapenems (C-R) was performed. Analyses were carried out within a machine learning framework, developed using the scikit-learn Python package. Overall, 2552 patients were included. Enterobacterales accounted for 85.5% of isolates, with E. coli, Klebsiella spp, and Proteus spp being most common. Distribution of resistance was FQ-R 48.6%, 3GC-R 40.1%, BL/BLI-R 29.9%, and C-R 16.9%. Models' validation showed good performance predicting antibiotic resistance for all four resistance classes, with the best performance for C-R (AUC-ROC 0.921 ± 0.013). The developed pipeline has been made available (https://github.com/EttoreRocchi/ResPredAI), along with documentation for running the same workflow on a different dataset, to account for local epidemiology and clinical features.