Multimodal AI-based 28-day mortality prediction of pneumonia patients at ED discharge: a multicenter study

Multimodal AI-based 28-day mortality prediction of pneumonia patients at ED discharge: a multicenter study

Study design and source of data

This retrospective study utilized two distinct databases. The first dataset was extracted from the Clinical Data Warehouse (CDW) DARWIN-C of the Samsung Medical Center (SMC), Seoul, South Korea, comprising ED visits between May 9, 2023, and December 27, 2023. The second dataset was extracted from the publicly available MIMIC-IV (v3.1)21,22, incorporating both the MIMIC-IV-ED (Emergency Department, v2.2)23 and MIMIC-CXR (chest radiograph, v2.0.0)24,25 databases from the Beth Israel Deaconess Medical Center (BIDMC), Boston, US. ED visits between 2011 and 2016 were included to enable linkage with the MIMIC-CXR database.

Participants

Patients diagnosed with pneumonia (defined as International Classification of Diseases, Ninth Revision [ICD-9] of 480–486, ICD-10 of J12-J18, clinical diagnosis of pneumonia, or recorded in the pneumonia registry of the SMC) after visiting the ED during the specified period were included.

The exclusion criteria were as follows: patients aged ≤ 18 years, those who visited the ED but did not receive medical care, those who died prior to ED disposition, those without a chest radiograph record, and those with missing data for essential variables required to calculate the CURB-65 score.

Predictors

We used predictors from three categories: conventional CURB-65 scores, AI-interpreted CXR information, and clinical information. We constructed five variable sets by combining the three categories (CURB-65-only, CXR-only, clinical-only, CURB-65-clinical, all-feature). The CURB-65-only and CURB-65-clinical variable sets incorporated the five individual binary components of the CURB-65. The entire variables used are shown in Supplementary Table S7.

For clinical information, we extracted general information (age, gender, and race), comorbidities, latest vital signs before ED disposition, and latest blood test results before ED disposition. As a vital sign-derived variable, the oxygen supply level was categorized into five levels based on the type of oxygen delivery device used. Both the highest-level during ED stay and the last level before ED disposition were recorded. To evaluate the patients’ respiratory status, the ratio of SpO2 (saturation of peripheral oxygen) to FiO2 (fraction of inspired oxygen) was calculated using ED measurements. The SpO2/FiO2 (S/F) ratio was used as the vital sign26. Additionally, the maximum, minimum, and linear regression estimates of the vital sign variables were calculated for both the entire ED stay and the 4 h preceding disposition.

During the study period, CXR performed in the SMC ED were interpreted using the AI software, Lunit INSIGHT CXR (version 3.1.5.1-S01). This AI software interprets the CXR images and estimates the probability of the presence of nine abnormal findings on a scale of 0–100%12. The nine abnormalities included pneumothorax, pneumoperitoneum, mediastinal widening, nodule, consolidation, pleural effusion, atelectasis, fibrosis, and cardiomegaly. For each patient, the latest CXR interpretation results before ED disposition were used as the CXR information. The CXR images extracted from the MIMIC-CXR database were interpreted using the same AI software, and the results were used in this study.

The CURB-65 score was calculated using the latest values before ED disposition7. In this calculation, “confusion” was defined as documentation in the pneumonia registry or any expression of confusion in nursing records, diagnoses, or chief complaints (e.g., disorientation, altered mental status, or confusion).

Data preprocessing

For variables matched with the MIMIC-IV dataset, those with a missing rate of 20% or higher were excluded, except for laboratory findings deemed clinically important. The variables included are erythrocyte sedimentation rate (ESR), absolute neutrophil count (ANC), prothrombin time (international normalized ratio, INR), C-reactive protein (CRP), lactic acid, lactate dehydrogenase (LDH), and albumin.

The SMC and MIMIC-IV datasets were then merged into a combined dataset. Institutional information was added, and the race of the patients in the SMC dataset was assumed to be Asian, as race information was not recorded because of South Korea’s healthcare environment. The acuity levels recorded in the MIMIC-IV dataset were combined with the Korean Triage and Acuity Scale (KTAS) documented in the SMC dataset.

The last observation carried forward method was applied to create the derived variables for the vital signs. To handle missing values, Multivariate Imputation by Chained Equations (MICE) was applied and constrained to the 1st and 99th percentiles of each observed distribution27. Categorical variables (oxygen supply level and acuity level) and integer variables (SpO2, blood pressure, FiO2, and respiratory rate) were rounded off after imputation.

The combined dataset was preprocessed for model training using appropriate encoding methods. Continuous numerical variables were standardized using the standard scaler, whereas ordinal variables such as acuity level, race, oxygen supply level, and CURB-65 score were encoded using the ordinal scaler. Binary variables and regression estimation values of the vital signs were used without transformation. The dataset was split into training, validation, and test sets (7:1:2) using stratified sampling to ensure an equal distribution of institution and outcome events.

Outcome

The primary outcome was all-cause mortality occurring within 28 days of ED disposition, which was analyzed as a time-to-event outcome. The date of death was initially ascertained from the hospital records of both cohorts. To improve the completeness of outcome capture, hospital records were supplemented with administrative mortality data specific to each country. Nationally collected registry data from the Ministry of the Interior and Safety were used for the SMC dataset, and state-level mortality records incorporated into the MIMIC-IV were used for the MIMIC-IV dataset21. When the date of death was recorded in the hospital records but not identified in the corresponding administrative registry, this discrepancy was considered to reflect administrative delay rather than loss to follow-up. For survival analysis, the index time was defined as the date of ED disposition. Event time was calculated as the number of days from ED disposition to death within 28 days, regardless of the disposition outcome. Patients transferred to another hospital were also considered to have experienced an event if death occurred within 28 days of transfer. Because mortality outcomes were supplemented with national registry data, incomplete death linkage was considered unlikely.

Model development

Three survival prediction models were used: Cox proportional hazards model with an elastic net penalty (Coxnet)28, random survival forest (RSF)29, and deep learning-based Cox proportional hazards model (DeepSurv)30. The Cox proportional hazards model trained using the CURB-65 score was used as the baseline model. The entire model development and evaluation process is shown in Fig. 5.

Fig. 5Fig. 5

Model development and evaluation process. Three survival prediction models were trained and validated with five variable sets in combined dataset of Samsung Medical Center (N = 688) and MIMIC-IV data (N = 2,186). SMC = Samsung Medical Center; MIMIC-IV = Medical Information Mart for Intensive Care; Coxnet = Cox proportional hazards model with an elastic net penalty; RSF = random survival forest; DeepSurv = deep learning-based Cox proportional hazards model; CXR = chest radiographs.

Each survival prediction model was independently trained using five variable sets in the training set. Feature selection for selective variable sets with clinical information (clinical-only, CURB-65-clinical, all-feature) was conducted in two steps. The feature selection process is shown in Fig. 6.

Fig. 6Fig. 6

Feature selection process. The two step feature selection process of machine and clinician were assessed in three variable sets, including clinical information. CXR = chest radiographs; CURB-65 = confusion, urea, respiratory rate, blood pressure, age ≥ 65.

The first step is in the model training. During the initial training process, feature importance was assessed using different methods for each model: SHAP values for DeepSurv and permutation importance for Coxnet and RSF. We set the mandatory features as CURB-65 components and CXR abnormality scores, and additional variables were included sequentially in order of feature importance. The optimal set of variables was determined based on the highest average C-index observed in a 5-fold cross-validation of the training set. Additionally, the “confusion” component of CURB-65, which requires clinician judgement, was excluded from the feature-selected variable sets because it demonstrated low feature importance and was inconsistent with automatically extractable variables. Accordingly, the CURB-65 score, including the confusion component, was also excluded from those selected variable sets.

The second step was conducted using the best model identified during the validation. To evaluate how the model learned from the features, we examined the relationship between the actual feature values and SHAP values through dependence plots as well as the effect size, defined as the mean absolute SHAP value. Features were selected based on the clinical plausibility of their dependence plot as assessed by two clinicians, with an effect size threshold of 0.01. Clinicians independently reviewed the outputs and excluded variables that appeared clinically implausible (e.g., an increase in white blood cell count was associated with improved patient survival). The selected features were then applied to the other models. The validation and feature selection processes were repeated iteratively until no additional features were excluded.

After feature selection step 1, parameter optimization for all models was conducted using a grid search with 5-fold cross-validation in the training set. The parameter options used in the grid search are listed in Supplementary Table S8. Finally, the performances of the models were evaluated using a test set.

Statistical analysis methods

Statistical analysis was conducted to compare the characteristics of patients from the two institutions. After the normality test using the Shapiro–Wilk test, the median value and interquartile range (IQR) for continuous variables that did not satisfy normality and the percentages for categorical variables were calculated. Subsequently, the two datasets were compared using the Chi-square test and Wilcoxon rank-sum test. Statistical significance was set at p value < 0.05. All statistical analyses were performed after excluding missing values. Additionally, characteristics across the training, validation, and test sets were compared using the Shapiro-Wilk test for normality, followed by the Kruskal-Wallis test for continuous variables and the Chi-square test or Fisher’s exact test (applied when the expected frequency was < 5) for categorical variables. The results are presented in Supplementary Table S9.

The C-index and IBS were used to evaluate the model performance on right-censored data. The 95% CI were estimated using 1,000 bootstrap iterations with a 90% resampling rate without replacement. Statistical comparisons across models and variable sets were performed using nonparametric tests. To analyze the results across different models and variable sets, the Shapiro–Wilk test was performed to assess normality, followed by the Kruskal–Wallis test for group comparisons. Pairwise comparisons were performed using Dunn’s post-hoc test with Bonferroni correction.

The cumulative/dynamic time-dependent receiver operating characteristic (ROC) curve and time-dependent AUC were calculated to evaluate the prognostic performance of the models over time31. The mean and integrated AUC for 28 days from the time of ED disposition were calculated.

Data preprocessing and integration were conducted using R (version 4.3.1), whereas model development and evaluation were performed using Python (version 3.9.13, 3.12.4). Scikit-survival (version 0.22.2) and Pycox (version 0.3.0) survival prediction models were used, and scikit-learn (version 1.3.2), lifelines (version 0.28.0), and SciPy (version 1.13.1) packages were used for model evaluation. This study adhered to the TRIPOD reporting guidelines (Supplementary Table S10)32.

Post-hoc analysis

A post-hoc sensitivity analysis was conducted to evaluate the generalizability of the model. The best-performing model from the primary analysis—the RSF all-feature model using the final selected features trained on the original multi-institution data—was compared with the Coxnet, RSF, and DeepSurv models trained on single-institution data (SMC and MIMIC-IV) using the final selected features.

For single-institution analyses, the original training and validation sets were combined and stratified by the data source to construct institution-specific training sets that comprised 80% of the cohort. Institution-specific test sets were derived from the original test set by stratification based on data source. The model performance was evaluated using the original multi-institution and institution-specific test sets. The C-index and IBS, along with the 95% CI, were estimated using 1,000 bootstrap iterations with a 90% resampling rate without replacement. No additional feature selection was performed, and parameter optimization was conducted using the same strategy as in the primary analysis.

Separately, an additional post-hoc sensitivity analysis was conducted using a leakage-free preprocessing pipeline while preserving the same training, validation, and test splits as in the primary experiment. Imputation and encoding were fitted exclusively on the training set and subsequently applied to the validation and test sets. Models were trained using the final selected features with parameter optimization and evaluated using the same procedure as in the primary analysis.

Ethical consideration

This study was approved by the Institutional Review Board (IRB) of Samsung Medical Center, and informed consent was waived (SMC 2024-03-063). All methods were performed in accordance with the relevant guidelines and regulations.