Machine learning to predict bacteriuria in the emergency department.
Journal:
Scientific reports
Published Date:
Aug 24, 2025
Abstract
Urinary tract infections (UTIs) are among the most common bacterial infections, yet they are both frequently misdiagnosed and inappropriately treated. We aimed to determine whether a machine learning model could accurately predict bacteriuria by using only the data that are readily available during the emergency department (ED) patient encounter. We retrospectively identified records of 62,963 patient encounters at our EDs that included results from a urinalysis and urine cultures. Encounters occurred from January 1, 2017, through December 31, 2021. We used a logistic regression classifier, k-nearest neighbors, random forest classifier, extreme gradient boosting (XGBoost), and a deep neural network to determine how well they predicted 3 urine culture outcomes: (1) no microbial growth vs. any microbial growth, including mixed flora; (2) ≥10,000 colony-forming units per milliliter (CFU/mL) for ≥1 organism vs. < 10,000 CFU/mL for all organisms; and (3) ≥100,000 CFU/mL for ≥1 organism vs. < 100,000 CFU/mL for all organisms. XGBoost had the highest area under the receiver operating characteristic curve (AUROC) for all outcomes assessed: 86.1% for no microbial growth, 89.1% for ≥10,000 CFU/mL for ≥1 organism, and 93.1% for ≥100,000 CFU/mL for ≥1 organism. For encounters where the treating healthcare provider diagnosed with patient with a UTI before urine culture results were known and urine cultures showed either no microbial growth or ≥100,000 CFU/mL, the AUROC was 91%. XGBoost could accurately predict bacteriuria by using only data that were available during the ED patient encounter. These findings suggest that machine learning algorithms could be valuable tools in clinical settings by helping predict culture results and guiding decisions on whether to initiate empiric antibiotic treatment.