Skip to main content

Interpretable machine learning model for predicting delirium in patients with sepsis: a study based on the MIMIC data

Abstract

Objective

The aim of this study was to construct interpretable machine learning models to predict the risk of developing delirium in patients with sepsis and to explore the impact of delirium on the 28-day survival rate of patients.

Methods

We enrolled 10,321 patients with sepsis older than eighteen years from the MIMIC-IV (Medical Information Mart for Intensive Care) database. Sepsis is defined as the presence or suspected presence of infection, along with a SOFA (Sequential Organ Failure Assessment) score of ≥ 2. Four machine learning models, namely XGBoost (extreme gradient Boost), SVM (support vector machine), Logistic (logistic regression) and RF (random forest), were established for prediction, and the prediction model was constructed.

Results

A total of 10,321 sepsis patients were included, among whom 4,691 (45.45%) developed delirium. The 28-day mortality rate was markedly elevated in the delirium group (log-rank P < 0.001). The XGBoost model has the best performance. Finally, 5 variables were selected to draw a nomogram: hypertension, SOFA score, chlorine, Hb (hemoglobin), creatinine. The receiver operating characteristic (ROC) curve of the predictive delirium model showed better predictive efficiency, with an AUC of 0.767 (95%CI (confidence interval): 0.726–0.798).

Conclusion

The nomogram built on the XGBoost model provides clinicians with an easy tool to quickly assess the risk of developing delirium in patients with sepsis. It provides a new idea and direction for the best model to predict delirium in patients with sepsis, so as to promote the development of delirium related research.

Peer Review reports

Introduction

Sepsis is a systemic inflammatory response syndrome caused by infection that can lead to multiple organ dysfunction and high mortality. According to the latest statistics, sepsis morbidity and mortality in intensive care units (ICU) continue to rise and has become a serious public health problem worldwide [1]. In the course of treatment, patients with sepsis often experience delirium, which is an acute brain dysfunction with symptoms such as disturbance of consciousness, inattention, and decreased cognitive function [2]. It represents a significant public health challenge, with an estimated 20 to 30 million cases occurring globally each year, resulting in high morbidity and mortality rates, particularly among vulnerable populations such as the elderly and those with pre-existing comorbidities [3]. The management of sepsis involves prompt recognition and treatment, including antibiotic therapy and support for organ function, yet it remains one of the most difficult and deadly unmet medical needs in contemporary healthcare [4]. The pathophysiological mechanism of sepsis involves many aspects, including the overactivation of the immune system, the release of cytokines, the damage of endothelial cells and the disturbance of microcirculation. Studies have shown that inflammatory mediators in sepsis patients, such as tumor necrosis factor and interleukin (IL- 6), play a key role in the occurrence and development of sepsis, and these factors not only promote the inflammatory response, but may also cause damage to the nervous system. In addition, sepsis can also cause insufficient oxygenation and metabolic disorders, further aggravating organ damage and increasing the risk of delirium [5, 6]. The incidence of delirium in patients with sepsis is as high as 50% [7]. Delirium is a common neurological complication in patients with sepsis in ICU, with a reported incidence of 17.7% to 48%, and its severity is strongly correlated with patient prognosis [8]. There are many causes of delirium, including drug side effects, metabolic disorders, infections, and hypoxia. The systemic inflammatory response of sepsis patients due to infection is often accompanied by electrolyte imbalance and endocrine disorders, which may induce delirium [9]. Delirium not only affects the patient's recovery process, but can also lead to longer hospital stays and increased medical costs. Patients admitted to the ICU with sepsis or who developed sepsis during a stay in the ICU were screened positive for delirium using the ICU Assessment of Confusion of Consciousness (CAM-ICU). The diagnosis of delirium includes four features: acute changes or fluctuations in mental status (feature 1), attention disorders (feature 2), disorganized thinking (feature 3), and altered levels of consciousness (feature 4). The patient needs to meet features 1 and 2, and at least one of features 3 or 4, to be diagnosed with delirium [10, 11].

Studies have shown that the incidence of delirium in patients with sepsis is significantly higher than in other patient groups, and this phenomenon is often overlooked, leading to inadequate clinical recognition and management of it. Therefore, it is very important to recognize the occurrence of delirium in time and take corresponding intervention measures to improve the prognosis of patients with sepsis [12]. Although the epidemiology and etiology of delirium have been investigated, the specific role and mechanism of delirium in patients with sepsis are still lacking. Existing literature indicates that delirium not only affects the quality of life of patients, but also is associated with long-term cognitive dysfunction [13]. Due to the complex pathophysiological mechanism of sepsis, the pathogenesis of delirium remains unclear, and more studies are needed to reveal its potential pathological mechanism and influencing factors. Several studies have analyzed the risk factors for delirium in patients with sepsis, but the specific role and mechanism of delirium in patients with sepsis are still lacking. Current tools for early prediction of delirium in patients with sepsis have limitations, such as not being optimized for patients with sepsis and lack of interpretability [6, 14, 15].

In recent years, machine learning, as a new technology, has been widely used in the medical field [16, 17]. By analyzing large amounts of clinical data, machine learning is able to identify potential patterns and risk factors to support disease prediction and management. In the prediction of delirium in patients with sepsis, machine learning models can integrate multiple clinical variables to help physicians identify high-risk patients earlier and intervene accordingly [18, 19].

Existing delirium prediction tools lack sepsis-specific customization and rely on subjective assessments. Therefore, our model integrates ICU data to achieve objective real-time risk stratification, enabling clinicians to prioritize high-risk patients for targeted interventions. This study utilizes the MIMIC-IV database to construct an interpretable machine learning model to predict the risk of delirium in sepsis patients. By analyzing feature importance using the SHAP method, we enhance the model's interpretability, allowing clinicians to better understand the basis of model predictions, improve the effectiveness of clinical decision-making, and facilitate early identification of the risk of delirium in septic patients. This enables early targeted treatment, reducing the likelihood of delirium and subsequently decreasing the risk of mortality. This provides new ideas and directions for future research and contributes to the advancement of delirium-related studies.

Methods

Data

This study used data from MIMIC-IV 3.0 (Medical Information Mart for Intensive Care), a large, open database of critical clinical studies. The data mainly included patient demographic information, infection site, comorbidities, laboratory indicators during hospitalization, surgical records, medication status, fluid resuscitation, disease score and survival prognosis. One member of this research team is trained and certified (certification number: 44274909) to be responsible for database access and data extraction. The MIMIC database follows a review board protocol in which all patient personal information is de-identified, using random codes to identify specific patients. The Ethics Committee of Yangzhou University Affiliated North District People's Hospital agreed to exempt this study from informed consent and ethical approval requirements.

Study population

This study included patients diagnosed with sepsis in an intensive care unit, identified using the International Classification of Diseases (ICD-9 and ICD-10) codes. Exclusion criteria include: (1) age below 18 years; (2) patients with missing laboratory indicators and other information. A total of 18,504 patients were included, and 10,321 critically ill patients with sepsis were included in the study according to the inclusion criteria. (For specific procedures, see Figure S1).

Data extraction

Data extraction and management through Structured Query Language (SQL) and PostgreSQL 15 tools. The data extracted included admission number, age, sex, previous diseases, laboratory indicators, ICU assessment of confusion of consciousness (CAM-ICU), disease score, length of stay and date of death of patients with sepsis. Pre-existing medical conditions include high blood pressure, diabetes, stroke, heart failure and kidney damage. Laboratory indicators include WBC (white blood cells), Hb (hemoglobin), PLT (platelets), albumin, Lac (lactic acid), ALT (alanine aminotransferase), AST (aspartate aminotransferase), sodium, potassium, chlorine, BUN (blood urea nitrogen) and CR (creatinine). The primary outcome of the study was 28-day survival in patients with or without delirium and sepsis.

Definition of delirium

Patients admitted to the ICU with sepsis or who developed sepsis during a stay in the ICU were screened positive for delirium using the ICU Assessment of Confusion of Consciousness (CAM-ICU). The diagnosis of delirium includes four features: acute changes or fluctuations in mental status (feature 1), attention disorders (feature 2), disorganized thinking (feature 3), and altered levels of consciousness (feature 4). The patient needs to meet features 1 and 2, and at least one of features 3 or 4, to be diagnosed with delirium [10, 11].

Statistical analysis

Patients with sepsis were grouped according to whether they developed delirium or not, and the statistical significance of the difference between continuous variables was assessed. Continuous variables conforming to the normal distribution are expressed as mean ± standard deviation, using the T-test. Variables that do not conform to a normal distribution are expressed as IQR (interquartile spacing), using the Wilcoxon rank sum test. Categorical variables are expressed as percentages, and chi-square tests are used for comparison. Kaplan–Meier analysis and log-rank test were used to assess the difference between groups in delirium for survival analysis, and multiple Cox proportional risk models were constructed to assess the association between delirium and 28-day survival status in patients with sepsis. To investigate whether delirium affects the short-term survival of patients with sepsis through other variables through mediation effect analysis. Mediated effect analysis was used to investigate whether delirium mediated the change of 28-day survival of sepsis patients through related factors. We hypothesize that the relationship between delirium (X) and sepsis survival (Y) is mediated by a factor (M). The total effects (TE) of delirium on patient survival are divided into direct effects (DE) and indirect effects (IE). According to Baron and Kenny's theory [20], a mediator effect is considered to exist when a statistically significant association exists between "X" and "M" and a significant association exists between "M" and "Y". Mediation effects were assessed using the nonparametric bootstrap approach with 1,000 resamples (R mediation package). The average causal mediation effect (ACME), average direct effect (ADE), and proportion mediated were calculated, with bias-corrected 95% confidence intervals.

To build a predictive model for delirium in sepsis patients, the sample data is first divided into a training set and a validation set in a 7:3 ratio. Then, feature selection is performed on the training set using Lasso regression and Boruta, taking the intersection of both to identify important features and reduce redundancy. Four machine learning models, namely XGBoost (extreme gradient Boost), SVM (support vector machine), Logistic (logistic regression) and RF (random forest), were established for prediction, and the prediction model was constructed. The model performance was then evaluated according to the maximum area under the ROC (receiver operating characteristic) curve (AUC) of the validation set, as well as sensitivity, specificity, recall rate, F1 score and accuracy. The higher the value of AUC, the better the ability of the model to distinguish. Sensitivity and specificity reflect the model's ability to correctly identify positive and negative samples, respectively. DCA (decision curve analysis) and calibration curves to demonstrate true clinical utility. The SHAP method is further used to draw a bar chart to show the contribution of each feature to the prediction results, and the influence of a specific feature on a specific sample is evaluated by SHAP to help understand the model decision-making process. Finally, the research team selected the top 5 variables with the largest contribution based on the contribution values of variables calculated by SHAP to build a nomogram. All statistical analyses were performed using R software (version 4.3.1) and STATA 17.0 (64-bit), with bilateral P-values < 0.05 considered statistically significant. The above research methods and processes are shown in Fig. 1.

Fig. 1
figure 1

Research methods and procedures are detailed

Results

Comparison of basic characteristics and clinical information of included patients

A total of 10,321 patients with sepsis who met the inclusion criteria were included in this study, among which 4691 (45.45%) patients developed delirium and 5630 (54.55%) patients did not develop delirium. The basic characteristics and clinical information of delirium in patients with sepsis are shown in Table 1. Compared with patients without delirium, the age, WBC, CR, BUN, Lac and Potassium in patients with delirium were significantly higher, which was statistically significant (p < 0.05). Hb, PLT, sodium and chloride were found to be significantly higher in patients without delirium, with statistical significance (p < 0.05). SOFA (Sequential organ failure assessment) and APSIII (Acute physiology III) scores of disease severity in patients with delirium were significantly higher than those in patients without delirium, with statistical significance (p < 0.05). Patients with hypertension, heart failure or kidney injury were prone to delirium (p < 0.05). There were no significant differences in other complications such as diabetes and stroke between the two groups (p > 0.05).Analysis of the infection site of sepsis showed that patients with infection in lung, coagulation, liver, central or kidney were prone to delirium, with statistical significance (p < 0.05). Patients with long hospital stay were prone to delirium, with statistical significance (p < 0.05). There were no significant differences in gender, albumin, AST and ALT between the two groups (p > 0.05).

Table 1 The basic characteristics and clinical information of delirium in patients with sepsis

Relationship between delirium and 28-day mortality in patients with sepsis

Based on whether patients with sepsis developed delirium, Kaplan–Meier survival curve analysis was drawn to compare the incidence of primary outcomes between the two groups (Fig. 2). The risk of 28-day mortality was significantly higher in patients with delirium, with statistically significant differences (log-rank P < 0.001).

Fig. 2
figure 2

Kaplan–Meier survival curve analysis was used to compare 28-day mortality in sepsis patients with or without delirium

In addition, the research team constructed five multifactor COX regression models for the relationship between delirium and the 28-day survival status of patients with sepsis (Table 2) to verify the stability of the above results. In model 1, without adjusting for any variables, results showed that patients with delirium had a significantly increased risk of 28-day mortality (HR = 2.35, 95% CI 2.17–2.54, p < 0.001) in the group without delirium. After adjusting for age and sex in Model 2, the analysis was consistent with the above results, but the degree of risk was slightly lower than in Model 1, and patients in the delirium group still had a significantly increased risk of 28-day mortality (HR = 2.29, 95% CI 2.11–2.48, p < 0.001). Model 3 and Model 4 further adjusted for comorbidities (such as hypertension, diabetes, stroke, etc.) and infection site, respectively, and the analysis results were consistent with statistical differences (p < 0.001). Finally, laboratory indicators (such as WBC, Hb, PLT, albumin, CR, BUN, AST, ALT, sodium, potassium, chlorine, Lac, etc.) were added to Model 5, and the risk was reduced (HR = 1.98, 95%CI 1.83–2.15, p < 0.001). Through the construction and analysis of several models, it is found that the trend is consistent with the results of Kaplan–Meier survival curve.

Table 2 Five multivariate COX regression models were constructed to study the 28-day mortality of delirium in patients with sepsis

Analysis of mediating causal factors for 28-day mortality in delirium and sepsis patients

According to the analysis of the above results, it is found that delirium has an important impact on the survival outcome of patients with sepsis. Therefore, in order to further understand whether the influence of delirium on the death of patients is influenced by other factors, we conducted a mediating causal analysis, as shown in Fig. 3. Delirium may affect the 28-day death outcome of sepsis patients through age, Hb, BUN and Lac. Age-mediated effects accounted for 4.40% of the association between delirium and 28-day mortality (IE = 0.009, 95% CI: 0.006–0.01; DE = 0.19, 95%CI: 0.17–0.20, Fig. 3A). Hb-mediated effects accounted for 0.01% of the association between delirium and 28-day mortality (IE = 0.002, 95% CI: 0.001–0.003; DE = 0.19, 95% CI: 0.18–0.21, Fig. 3B). BUN-mediated effects accounted for 0.41% of the association between delirium and 28-day mortality (IE = 0.008, 95%CI: 0.006–0.01; DE = 0.19, 95%CI: 0.18–0.21, Fig. 3C). Lac-mediated effects accounted for 3.1% of the association between delirium and 28-day mortality (IE = 0.006, 95% CI: 0.004–0.01; DE = 0.19, 95%CI: 0.17–0.20, Fig. 3D). The analysis of hypertension, heart failure and kidney injury (Fig. 3E, F and G) had different effects and were statistically significant. According to the above results, age mediation effect accounted for the largest proportion, Hb mediation effect accounted for the lowest proportion, and other indicators were significant, but the effect was low.

Fig. 3
figure 3

Intermediate causality analysis. A Age-mediated effects account for 4.40% of the association between delirium and 28-day mortality; B HB-mediated effects accounted for 0.01% of the association between delirium and 28-day mortality; C Bun-mediated effects accounted for 0.41% of the association between delirium and 28-day mortality; D Lac-mediated effects accounted for 3.1% of the association between delirium and 28-day mortality; E Hypertension-mediated effect accounted for 3.11% of the association between delirium and 28-day mortality; F Heart failment-mediated effect accounts for 0.08% of the association between delirium and 28-day mortality; G Kidney injury-mediated effects accounted for 1.3% of the association between delirium and 28-day mortality

Screening of characteristic variables of delirium in patients with sepsis

A total of 29 variables were included in the analysis of factors causing delirium in patients. In order to screen variables with high contribution ratios, Boruta algorithm and Lasso regression were used to screen relevant features (Fig. 4). Firstly, the Boruta algorithm (Fig. 4 A) was used to calculate the variables in the green area as important features, the yellow area as critical features, the variables in the red area as not important features in the Boruta algorithm, and the variables in the green area were hypertension, chlorine, SOFA, kidney injury, mechanical ventilation time, heart failure, and central infection. Hb, sodium, age, APSIII score, BUN, Lac, ALT, PLT, AST, CR, pulmonary infection and albumin were 19 variables. Subsequently, Lasso regression analysis was performed (Fig. 4B and C), and the ten-fold cross-validation method was adopted for iterative analysis, and it was found that all the analysis variables were included. Finally, the variables selected by the two feature selection methods were selected according to the intersection of the two. The variables included were hypertension, chloride, SOFA, kidney injury, mechanical ventilation time, heart failure, central infection, Hb, sodium, age, APSIII score, BUN, Lac, ALT, PLT, AST, CR, pulmonary infection and albumin.

Fig. 4
figure 4

The relevant features were screened by Boruta algorithm and Lasso regression. A In the calculation of Boruta algorithm, the variables in the green area are identified as important features, the yellow area is critical features, and the variables in the red area are identified as unimportant features in the Boruta algorithm; B, C Ten fold cross validation method for iterative analysis

Comparison of multiple models

To obtain the best model for predicting delirium in patients with sepsis, we constructed four machine learning models to identify risk factors for delirium in patients with sepsis (Fig. 5). Figure 5 A show the differential performance of these four models in terms of ROC curves. The four models all show a considerable effect in predicting performance, among which XGBoost model performs the best. The training set AUC of the four models is: Logistic: 0.71(0.67–0.76), RF: 0.74(0.71–0.78), SVM: 0.73(0.68–0.77), XGBoost: 0.79 (0.75–0.83). The validation set AUC of the four models is: Logistic: 0.68(0.62–0.73), RF: 0.68(0.66–0.70), SVM: 0.71(0.67–0.75), XGBoost:0.71(0.67–0.74). Table 3 shows detailed performance metrics for the four models. According to a comprehensive evaluation, the XGBoost model showed superior overall performance (training set sensitivity: 0.82, specificity: 0.80 and validation set sensitivity: 0.73, specificity: 0.78). Figure 5B shows DCA, and the results are the same as before, finding that the XGBoost model has the best DCA performance. The calibration curves of the four models are shown in Fig. 5 C, showing good agreement between the predicted probabilities of the XGBoost model and the observed results.

Fig. 5
figure 5

Machine learning model. A, B It shows the differentiation performance of these four models in ROC curve, among which XGBoost model performs best; C DCA is shown, and the results are still consistent with the previous results, finding that the XGBoost model has the best DCA performance

Table 3 Performance of machine learning models in predicting the 28-day status of sepsis patients (Detailed performance indicators of 4 models)

Interpretability analysis

Figures 6A and B show a comprehensive population picture of patients developing delirium, illustrating the variables in the XGBoost model. The horizontal axis represents SHAP values, while the vertical axis shows features sorted by their cumulative SHAP value impact. Each data point corresponds to a particular instance, and its position on the X-axis represents the SHAP value for that particular instance and feature. The results showed that the contribution of each variable, in descending order, was: hypertension, chloride, SOFA, Hb, CR, PLT, sodium, mechanical ventilation time, kidney injury, albumin, APSIII score, age, AST, ALT, BUN, Lac, heart failure, pulmonary infection and central infection. In order to more intuitively understand the changes in each indicator, a dependency graph is drawn (Figure S2). The horizontal coordinate is the value of each variable, and the vertical coordinate is the SHAP value of the feature. The results are basically consistent with the above results, that is, with the increase of AST, BUN, SOFA and Lac, SHAP value also increases, while with the increase of albumin, SHAP value decreases, and age, chlorine and sodium indexes show a U-shaped trend. Figure 6C provides a detailed case study showing the model's predictive course for a specific patient. In this visualization, the red indicator indicates a negative contribution to the prediction, while the blue indicator indicates a positive impact. The f(x) value represents the actual SHAP value for each factor.

Fig. 6
figure 6

Comprehensive population map. A, B Presents a comprehensive population map of delirium in sepsis patients, illustrating the variables in the XGBoost model; C In order to more intuitively understand the change of each indicator, the dependency graph is drawn; D Provides a detailed case study showing the model's predictive course for a specific patient. In this visualization, the red indicator indicates a negative contribution to the prediction, while the blue indicator indicates a positive impact

The construction of nomogram

In order to enhance the clinical applicability of the model and facilitate rapid decision making by clinicians, we selected the top 5 variables hypertension, SOFA, chlorine, Hb and CR to draw a nomogram based on the optimal XGBoost model constructed above and the proportion of variables analyzed by SHAP interpretation (Fig. 7A). Figure 7B shows that the ROC curve for predicting delirium models shows better predictive efficiency, with an AUC of 0.767(95%CI: 0.726–0.798). At the same time, we draw a calibration curve (Fig. 7C), which shows a good agreement between the predicted probability of the model and the actual observed results.

Fig. 7
figure 7

Construction of a nomogram. A The first 5 variables hypertension, SOFA, chlorine, Hb and CR were selected to draw a column diagram; B showed that the ROC curve for predicting delirium models showed better predictive efficiency, with an AUC of 0.767; C Calibration curve

Discussion

Sepsis is a complex and life-threatening condition characterized by a dysregulated host response to infection, leading to systemic inflammation, organ dysfunction, and potentially death. Delirium has a significant negative impact on the prognosis of patients with sepsis. Studies have shown that the onset of delirium is closely associated with longer hospital stays, increased medical costs, and increased mortality [21]. In patients with sepsis, delirium not only affects the patient's short-term prognosis, but may also lead to long-term cognitive dysfunction and reduced quality of life [6]. Understanding the factors that contribute to poor outcomes, such as delirium, is essential for improving clinical management and patient prognosis in sepsis patients. The aim of this study was to clarify the association between delirium and 28-day mortality in patients with sepsis using data from the MIMIC-IV database.

Through a large cohort study of more than 10,000 patients, the study aimed to highlight factors significantly associated with an increased risk of death from delirium in patients with sepsis. The findings highlight the importance of identifying risk factors and developing targeted interventions to mitigate the adverse effects of delirium in this critical population. Through rigorous statistical analysis, this study provides valuable insights that can inform clinical protocols and improve patient outcomes in intensive care Settings. In our study, 45.45% of patients with sepsis developed delirium, higher than in Zhang Y et al.'s study (36.9%) [14]. There is a significant increase in 28-day mortality in patients with sepsis and delirium. Age, WBC, CR, BUN, Lac, potassium, SOFA and APSIII score were significantly higher in patients with delirium, and Hb, PLT, sodium and chloride were decreased. Patients with sepsis with high blood pressure, heart failure, or kidney damage are prone to delirium, as are patients with infections in the lungs, clotting, liver, center, or kidneys. Lac serves as a pivotal biomarker for organ dysfunction in clinical practice [22]. During sepsis, inadequate oxygen delivery prompts hypoxic tissues to undergo anaerobic glycolysis, generating lactic acid [23]. SOFA has demonstrated high specificity and sensitivity as a screening tool for predicting in-hospital sepsis mortality [24]. The APS III score is a component of APACHEII (Acute Physiology and Chronic Health Assessment II), which is simpler than APACHEII. It does not have an age score or a chronic health score, and is easier to use clinically than the APACHE II score. APSIII can predict mortality in ICU [25]. Studies have shown that an elevated APSIII score is a risk factor for delirium [26]. In patients with chronic conditions, compromised vascular integrity due to inflammatory, oxidative, and coagulation dysfunction significantly escalates the risk for sepsis and worsens the prognosis [27]. Delirium may affect the 28-day death outcome of sepsis patients through age, Hb, BUN and Lac.

The novel point of this study is the construction of an interpretable machine learning model based on the MIMIC-IV database to predict the risk of developing delirium in sepsis patients. This study adds to the knowledge of prediction of delirium in intensive care by analyzing a large number of clinical data and identifying a variety of important clinical features and laboratory indicators that are significantly associated with the development of delirium. Compared with previous studies, although the relationship between delirium and sepsis has been explored in the literature [8], this study applied machine learning technology in a large-scale human sample to build and validate an effective predictive model to identify the risk factors for delirium in patients with sepsis. In addition, this study provides interpretability of the model through the SHAP approach, allowing clinicians to better understand the model output and make clinical decisions based on this information. The XGBoost model has the best performance in the validation set with an AUC of 0.71, sensitivity of 0.73 and specificity of 0.78. Finally, 5 variables were selected to draw a nomogram: hypertension, SOFA score, chlorine, Hb, CR. The ROC curve of the predictive delirium model showed better predictive efficiency, with an AUC of 0.767. Consistent with our study, Zhang Y et al. also believe that the XGBoost model is superior to other models in predicting the incidence of sepsis associated delirium [14]. Gu Q et al. identified four independent predictors of patients with sepsis associated delirium, including SOFA, mechanical ventilation, phosphate, and Lac, for constructing a nomogram. AUC of the predicted model was 0.742 in the training set [15].

SOFA score is a tool used to assess the degree of organ failure in patients in ICU. SOFA score is generally considered the standard for sepsis, and in some studies, it is used to predict and evaluate neurological outcomes [28]. One study showed that SOFA score had a sensitivity, specificity, negative and positive predictive value of 99%, 73%, 98%, and 76%, respectively, in predicting mortality with delirium in elderly patients undergoing open heart surgery [29]. It has been hypothesized that delirium may be associated with rupture of the blood–brain barrier, and that dynamically increased permeability is associated with neuroinflammation and lac response [30]. Lac is an important metabolic substrate, and abnormal changes in its concentration may indicate an imbalance in brain metabolism and can be used to predict neurological impairment and outcomes [31]. Studies have also shown that higher lac early in the ICU are associated with a higher risk of delirium and subsequent death. Hyperlactacemia (lac levels 2–5 mmol/L and PH > 7.35) was associated with a higher chance of delirium (OR = 1.277,95%CI: 1.126–1.447) [32]. Low Hb levels may lead to reduced oxygen supply to the brain, which increases the risk of delirium [33]. Hypertension may increase the risk of postoperative delirium by increasing cerebrovascular reactivity, resulting in reduced cerebral blood flow. Patients with hypertension have higher mean arterial pressure, which may be related to cardiovascular disease, cerebrovascular disease, etc., all of which may increase the risk of delirium [34]. Toxins such as creatinine induce neurotoxic effects by inhibiting GABA receptors and activating NMDA receptors, causing neuronal overexcitation, epileptiform activity, and hippocampal damage [35].

The findings have significant implications for clinical practice and policy making. Our findings suggest that delirium is not only an important complication in patients with sepsis, but also significantly affects patient prognosis. Therefore, early identification of delirium risk and taking preventive measures may help improve survival and quality of life for people with sepsis. This finding underscores the importance of implementing systemic delirium assessment in clinical practice, especially in intensive care units.

The limitations of this study are mainly reflected in the single source of data and retrospective design. Although the MIMIC-IV database provides a wealth of clinical information, its data are mainly from intensive care units in specific regions, which may affect the generality of the results. In addition, retrospective analyses inevitably carry the risk of selection and information bias, which may affect the accurate assessment of the causal relationship between survival in patients with delirium and sepsis. Potential confounders in the data were not fully controlled for and could have contributed to a bias in the results. In addition, despite the use of multiple statistical analysis methods and machine learning models, the results of this study need to be validated in different populations and in a broader clinical setting to improve their clinical applicability and generalizability. Next step, our model needs to be further validated in multicenter, geographically distributed cohorts to confirm its universality.

Conclusion

In summary, this study constructed an interpretable machine learning model by analyzing factors associated with delirium in sepsis patients and their impact on 28-day survival. The findings of the study not only provide an important predictive tool for clinicians, but also highlight the need to pay attention to delirium in the management of patients with sepsis. Future studies are needed to further explore the underlying mechanisms of delirium and intervention strategies to improve the prognosis of patients with sepsis.

Data availability

The datasets used and/or analysed during the current study are available from the corresponding author on reasonable request.

References

  1. Atterton B, Paulino MC, Povoa P, et al. Sepsis associated delirium. Medicina (Kaunas) 2020;56(5):240.

  2. Stollings JL, Kotfis K, Chanques G, et al. Delirium in critical illness: clinical manifestations, outcomes, and management. Intensive Care Med. 2021;47:1089–103.

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  3. Van Looveren K, Van Wyngene L, Libert C. An extracellular microRNA can rescue lives in sepsis. EMBO Rep. 2020;21:e49193.

    Article  PubMed  Google Scholar 

  4. Yu H, Yang Q, Qian Y, et al. A positive correlation between serum lactate dehydrogenase level and in-hospital mortality in ICU sepsis patients: evidence from two large databases. Eur J Med Res. 2024;29:525.

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  5. Cross D, Drury R, Hill J, et al. Epigenetics in Sepsis: Understanding Its Role in Endothelial Dysfunction, Immunosuppression, and Potential Therapeutics. Front Immunol. 2019;10:1363.

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  6. Lei W, Ren Z, Su J, et al. Immunological risk factors for sepsis-associated delirium and mortality in ICU patients. Front Immunol. 2022;13: 940779.

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  7. Bateman RM, Sharpe MD, Jagger JE, et al. 36th International Symposium on Intensive Care and Emergency Medicine : Brussels, Belgium. 15–18 March 2016. Crit Care. 2016;20:94.

    Article  PubMed  PubMed Central  Google Scholar 

  8. Yamamoto T, Mizobata Y, Kawazoe Y, et al. Incidence, risk factors, and outcomes for sepsis-associated delirium in patients with mechanical ventilation: A sub-analysis of a multicenter randomized controlled trial. J Crit Care. 2020;56:140–4.

  9. Hong Y, Chen P, Gao J, et al. Sepsis-associated encephalopathy: From pathophysiology to clinical management. Int Immunopharmacol. 2023;124:110800.

  10. Ew E, Sk I, Gr B, et al. Delirium in mechanically ventilated patients: validity and reliability of the confusion assessment method for the intensive care unit (CAM-ICU). JAMA. 2001;286:2703–10.

    Article  Google Scholar 

  11. Schreiber N, Eichlseder M, Orlob S, et al. Sex specific differences in short-term mortality after ICU-delirium. Crit Care. 2024;28:413.

    Article  PubMed  PubMed Central  Google Scholar 

  12. Tokuda R, Nakamura K, Takatani Y, et al. Sepsis-associated delirium: a narrative review. J Clin Med. 2023;12(4):1273.

  13. Yoo J, Joo B, Park J, et al. Delirium-related factors and their prognostic value in patients undergoing craniotomy for brain metastasis. Front Neurol. 2022;13: 988293.

    Article  PubMed  PubMed Central  Google Scholar 

  14. Zhang Y, Hu J, Hua T, et al. Development of a machine learning-based prediction model for sepsis-associated delirium in the intensive care unit. Sci Rep. 2023;13:12697.

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  15. Gu Q, Yang S, Fei D, et al. A nomogram for predicting sepsis-associated delirium: a retrospective study in MIMIC III. BMC Med Inform Decis Mak. 2023;23:184.

    Article  PubMed  PubMed Central  Google Scholar 

  16. Xie H, Jia Y, Liu S. Integration of artificial intelligence in clinical laboratory medicine: advancements and challenges. Interdiscip Med. 2024;2:e20230056.

  17. Defilippo A, Bertucci G, Zurzolu C, et al. On the computational approaches for supporting triage systems. Interdiscip Med. 2023;1:e20230015.

  18. Banerjee S. Generating complex explanations for artificial intelligence models: an application to clinical data on severe mental illness. Life (Basel) 2024;14(7):807.

  19. Karako K, Tang W. Applications of and issues with machine learning in medicine: Bridging the gap with explainable AI. Biosci Trends. 2025;18:497–504.

    Article  PubMed  Google Scholar 

  20. He A, Liu J, Qiu J, et al. Risk and mediation analyses of hemoglobin glycation index and survival prognosis in patients with sepsis. Clin Exp Med. 2024;24:183.

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  21. Contreras M, Silva B, Shickel B, et al. Dynamic delirium prediction in the intensive care unit using machine learning on electronic health records. IEEE EMBS Int Conf Biomed Health Inform. 2023;2023:10.1109/bhi58575.2023.10313445.

  22. Bakker J, Postelnicu R, Mukherjee V. Lactate: Where Are We Now? Crit Care Clin. 2020;36:115–24.

    Article  PubMed  Google Scholar 

  23. Brooks GA. The Science and Translation of Lactate Shuttle Theory. Cell Metab. 2018;27:757–85.

    Article  CAS  PubMed  Google Scholar 

  24. Xia Q, Yu-Peng L, Rui-Xi Z. SIRS, SOFA, qSOFA, and NEWS in the diagnosis of sepsis and prediction of adverse outcomes: a systematic review and meta-analysis. Expert Rev Anti Infect Ther. 2023;21:0.

    Google Scholar 

  25. Fan S, Ma J. The value of five scoring systems in predicting the prognosis of patients with sepsis-associated acute respiratory failure. Sci Rep. 2024;14:4760.

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  26. Cheng H, Ling Y, Li Q, et al. Association between modified frailty index and postoperative delirium in patients after cardiac surgery: A cohort study of 2080 older adults. CNS Neurosci Ther. 2024;30:e14762.

    Article  PubMed  PubMed Central  Google Scholar 

  27. Mitchell E, Pearce MS, Roberts A. Gram-negative bloodstream infections and sepsis: risk factors, screening tools and surveillance. Br Med Bull. 2019;132:5–15.

    Article  PubMed  Google Scholar 

  28. Matsuda J, Kato S, Yano H, et al. The Sequential Organ Failure Assessment (SOFA) score predicts mortality and neurological outcome in patients with post-cardiac arrest syndrome. J Cardiol. 2020;76:295–302.

    Article  PubMed  Google Scholar 

  29. Mousabeygi E, Rahmati M, Salari N, et al. Predicting mortality of elderly patients undergoing open heart surgery with delirium using sequential organ failure assessment (SOFA), multi-organ dysfunction (MODS), and logistic organ dysfunction system (LODS) scores. Geriatr Nurs. 2024;60:146–9.

  30. Taylor J, Parker M, Casey CP, et al. Postoperative delirium and changes in the blood-brain barrier, neuroinflammation, and cerebrospinal fluid lactate: a prospective cohort study. Br J Anaesth. 2022;129:219–30.

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  31. Liu D, Yao Q, Song B, et al. Serum lactate monitoring may help to predict neurological function impairment caused by acute metabolism crisis. Sci Rep. 2023;13:2820.

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  32. Qian X, Sheng Y, Jiang Y, et al. Associations of serum lactate and lactate clearance with delirium in the early stage of ICU: a retrospective cohort study of the MIMIC-IV database. Front Neurol. 2024;15:1371827.

  33. Heikal M, Saad H, Ghanime PM, et al. Using machine learning and electronic health records to identify neuropsychiatric risk scores for delirium in ICU and general hospital settings. Neuropsychiatr Dis Treat. 2024;20:1861–76.

  34. Nguyen DN, Huyghens L, Parra J, et al. Hypotension and a positive fluid balance are associated with delirium in patients with shock. PLoS ONE. 2018;13:e0200495.

    Article  PubMed  PubMed Central  Google Scholar 

  35. Pang H, Kumar S, Ely EW, et al. Acute kidney injury-associated delirium: a review of clinical and pathophysiological mechanisms. Crit Care. 2022;26:258.

    Article  PubMed  PubMed Central  Google Scholar 

Download references

Acknowledgements

Not applicable.

Funding

This study was sponsored by the Yancheng Science and Technology Bureau (YCBE202365) and the Jiangsu Vocational College of Medicine's School-Local Collaborative Innovation Research Project (202491001).

the Yancheng Science and Technology Bureau,YCBE202365,the Jiangsu Vocational College of Medicine's School-Local Collaborative Innovation Research Project,202491001

Author information

Authors and Affiliations

Authors

Contributions

All authors contributed to the study conception and design. Material preparation, data collection and analysis were performed by Jing Fu, Aifeng He, Lulu Wang, Xia Li, Jiangquan Yu and Ruiqiang Zheng. The first draft of the manuscript was written by Jing Fu and all authors commented on previous versions of the manuscript. All authors read and approved the final manuscript.

Corresponding authors

Correspondence to Jiangquan Yu or Ruiqiang Zheng.

Ethics declarations

Ethics approval and consent to participate

This study was performed in line with the principles of the Declaration of Helsinki. The MIMIC database follows a review board protocol in which all patient personal information is de-identified, using random codes to identify specific patients. The Ethics Committee of Yangzhou University Affiliated North District People's Hospital agreed to exempt this study from informed consent and ethical approval requirements.

Consent for publication

Not applicable.

Competing interests

The authors declare no competing interests.

Additional information

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary Information

Additional file 1: Figure S1. Inclusion and exclusion flow charts.

12879_2025_10982_MOESM2_ESM.tif

Additional file 2: Figure S2. The changes of hypertension(A), albumin(B), AST(C), BUN(D), Chloride(E), Sofa(F), Lac(G), and Sodium(H) in delirium patients correspond to the dependence diagram of the change of SHAP value.

Additional file 3.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Fu, J., He, A., Wang, L. et al. Interpretable machine learning model for predicting delirium in patients with sepsis: a study based on the MIMIC data. BMC Infect Dis 25, 585 (2025). https://doiorg.publicaciones.saludcastillayleon.es/10.1186/s12879-025-10982-8

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doiorg.publicaciones.saludcastillayleon.es/10.1186/s12879-025-10982-8

Keywords