Application of machine learning to identify risk factors for bloodstream

Bioengineer.org

Source published: Site published:

Original article · فارسی

Machine-learning models found different combinations of medical history, blood diseases, hospital stays, and chemotherapy exposure linked to bloodstream infections in people receiving chemotherapy. This study looked back at 1,435 confirmed bloodstream-infection episodes among 1,220 patients treated at the Cancer Institute of the State of São Paulo in Brazil between 2017 and 2022. The models were best at identifying infections involving Gram-negative bacteria resistant to carbapenems, a type of antibiotic. Their performance varied for other groups of microorganisms. The researchers said the findings could help guide future research, but the models must be tested in other patient groups before they can be used to make medical decisions.

The research team used a method called multi-label machine learning because a single infection episode could involve more than one type of microorganism or resistance pattern. The five groups studied were bloodstream infections involving Gram-negative bacteria resistant to carbapenems, staphylococci resistant to methicillin, Enterobacterales resistant to third-generation cephalosporins, fungal infections, and infections caused by organisms that were neither multidrug-resistant nor fungi. If an episode belonged to more than one group, the researchers counted it in each relevant group instead of forcing it into just one. This was important because 166 episodes, or 11.6% of the total, involved multiple types of microorganisms. Altogether, the researchers identified 1,640 microorganisms in the 1,435 infection episodes.

Most infections happened early in treatment: 60.9% occurred during a patient's first chemotherapy cycle. Organisms that were not multidrug-resistant or were fungi accounted for 1,193 episodes, or 83.1% of the total. Gram-negative bacteria resistant to carbapenems were found in 109 episodes, or 7.6%. The three most commonly identified species were Escherichia coli, which made up 26.3% of the microorganisms; Klebsiella pneumoniae, at 15.5%; and Pseudomonas aeruginosa, at 9.0%. Among Enterobacterales, 6.6% were resistant to third-generation cephalosporins and 4.7% were resistant to carbapenems. Across all Gram-negative bacteria, 10.8% were resistant to carbapenems. This represented 114 bacterial isolates from 109 infection episodes. Death rates within 30 days ranged from 30.1% to 40.6% across the infection groups. The rate was highest for infections involving carbapenem-resistant Gram-negative bacteria, at 53.2%.

Each record in the analysis represented one chemotherapy cycle, not one individual patient. This meant that patients who received several cycles could appear more than once. The researchers considered possible factors such as age, sex, cancer type, body measurements, blood-test results, chemotherapy drugs and drug classes, previous infections, antibiotic use, and time spent in hospital. They also included information about when events happened. This included whether the cycle was a patient's first, the total number of earlier infections in each microorganism group, and antibiotic use and hospital stays during the 90 days before each cycle. Another variable showed whether a cycle began during the COVID-19 pandemic. The original dataset included 1,505 infected cycles from 1,272 patients. The researchers removed records missing age or sex, excluded extreme values for height, weight, and body mass index, and marked missing blood-test results. The final analysis included 1,435 cycles from 1,220 patients.

The researchers tested four machine-learning methods: logistic regression, random forests, multilayer perceptrons, and gradient boosting. They used a technique called classifier chains. With this method, the model predicts infection groups one after another, and an earlier prediction can help inform a later one. This allows the model to account for possible links between infection groups. The team adjusted model settings using grid search and further testing within a process called fivefold cross-validation. They also set aside a separate group of records for one final evaluation. To keep uncommon infections represented as they appeared in the original data, they did not use methods to increase the number of rare cases or give different cases different weights during training. They compared models using a weighted area under the receiver operating characteristic curve, known as AUC-ROC, across the five infection groups. They then used a method called SHapley Additive exPlanations, or SHAP, on the test data to estimate how much each variable contributed to the predictions.

The best-performing setup used a chain of 20 random-forest models, each containing 100 decision trees with a maximum depth of four. During cross-validation, it achieved a weighted average AUC-ROC of 60.90%, with a standard deviation of 2.52%. On the separate test set, its weighted average was 66.37%. Its strongest result for a single infection group was for carbapenem-resistant Gram-negative bacteria, with a test-set AUC-ROC of 83.25%. The 95% confidence interval was 73.91% to 91.64%. Average precision ranged from 6.40% for Enterobacterales resistant to third-generation cephalosporins to 90.84% for infections caused by organisms that were neither multidrug-resistant nor fungi. The neural network and logistic regression models each had a weighted cross-validation AUC-ROC of 59.96%, with standard deviations of 2.89% and 2.81%, respectively. Gradient boosting had an average of 56.89%, with a standard deviation of 1.03%. The differences between the methods were not large compared with how much their results varied. The study did not show that any one algorithm was statistically better than the others.

The SHAP analysis found that the number of days spent in hospital, palliative chemotherapy, blood cancers, low monocyte counts, and low platelet counts were among the most influential variables across the infection groups. For carbapenem-resistant Gram-negative bacteria, a previous infection involving the same group was the strongest associated factor. Other important variables were time spent in hospital, blood cancer, low platelet counts, and low hematocrit, which means a low proportion of red blood cells in the blood. For Enterobacterales resistant to third-generation cephalosporins, important variables included previous glycopeptide use, hospital stays, acute leukemia, the pandemic-period indicator, and treatment with antimetabolites. Methicillin-resistant staphylococcal infections were linked in the models to time spent in hospital, blood cancer, low lymphocyte counts, a previous fungal infection, and male sex. For fungal infections, the most influential variables were the pandemic period, male sex, days of glycopeptide use, treatment with alkylating agents, and time spent in hospital. These results show relationships found by the models; they do not prove that any of these factors independently caused an infection.

Chemotherapy drug classes had less overall influence than hospital stays, previous infections, and blood diseases, but their importance differed between infection groups. Alkylating agents were linked to candidemia, an infection in which Candida fungi enter the bloodstream. Antitumor antibiotics were linked to infections involving carbapenem-resistant Gram-negative bacteria, while antimetabolites were linked to infections caused by Enterobacterales resistant to third-generation cephalosporins. The researchers said these relationships need further study. The pandemic-period indicator was the strongest feature associated with fungal infection, but the authors cautioned against interpreting this as a direct effect of SARS-CoV-2 infection. Instead, it may reflect changes in healthcare services, medical practices, and antibiotic use during the pandemic. Similarly, previous glycopeptide use may mainly indicate greater contact with healthcare services and a higher chance of infection, rather than being a specific risk factor for resistant Enterobacterales or fungi. Palliative chemotherapy was associated with infections caused by organisms that were neither multidrug-resistant nor fungi, but this finding applied only in comparison with the other chemotherapy patients included in the study.

The study design places important limits on what the results mean. The researchers looked back at existing records and included only chemotherapy cycles in which a bloodstream infection had already been confirmed. Therefore, the models estimated the likelihood of different types of microorganisms among people who already had an infection. They did not estimate the chance of developing an infection among all patients receiving chemotherapy. The study also took place at only one cancer center, so its patients and patterns of bacterial resistance may differ from those at other hospitals. Some infection groups, especially fungal infections, had relatively few cases, making their estimates less reliable. The researchers divided the data by chemotherapy cycle rather than by patient. Separating patients between the training and test groups would provide a stricter test of how well the models work for people they have never seen before. The wide confidence interval for the strong result involving carbapenem-resistant bacteria also shows that there is considerable uncertainty. Because the study was retrospective, it cannot prove that chemotherapy drugs, antibiotic exposure, hospital stays, or any other measured factor caused the infections.

Overall, the study shows that multi-label machine learning can be used to explore several types of bloodstream infections in the same group of chemotherapy patients while keeping episodes involving multiple microorganisms in the analysis. However, allowing the model to account for links between infection groups did not automatically improve its predictions. During cross-validation, the chained random-forest model performed only slightly better than a model that trained separate binary classifiers for each infection group. The clearest signals involved previous infections with resistant bacteria, time spent in hospital, blood diseases, low blood-cell counts, and treatment exposures. Chemotherapy drug classes showed smaller associations that varied by infection group. Since the study was observational, included only chemotherapy cycles with confirmed infections, and took place at one cancer center in Brazil, the models should be treated as a way to develop ideas for future research. Larger studies at other centers must validate them before they can be considered reliable tools for choosing antibiotic treatment.

Subject of Research: Using multi-label machine learning to study factors linked to bloodstream infections in patients receiving chemotherapy

Article Title: Application of machine learning to identify risk factors for bloodstream infections caused by different antimicrobial resistance phenotypes in chemotherapy patients

Article References: Villani Junior, A., Freire, M. P., De Padua Covas Lage, L. A., Lazar Neto, F., Oliveira, M. S., Abdala, E., Nunes, F. L. S., & Levin, A. S. S. (2026). Application of machine learning to identify risk factors for bloodstream infections caused by different antimicrobial resistance phenotypes in chemotherapy patients. Supportive Care in Cancer, 34(11), Article 1127. https://doi.org/10.1007/s00520-026-11379-2

Image Credits: AI-generated

DOI: 10.1007/s00520-026-11379-2

Keywords: machine learning, bloodstream infections, chemotherapy, antimicrobial resistance, cancer care, carbapenem resistance, fungal infections, clinical prediction, infectious diseases, retrospective cohort, application, machine learning