Abstract
Objective
While extubation failure in critically ill patients is a significant challenge in intensive care units (ICUs), traditional predictors, such as the rapid shallow breathing index (RSBI), offer limited accuracy. This study aimed to develop a machine-learning model using data collected during a spontaneous breathing trial (SBT) and the rest period after SBT to improve the prediction of extubation failure.
Methods
This retrospective and single-center cohort study analyzed data from 413 extubation cases involving 372 patients across both medical and surgical ICUs. Vital signs and ventilatory parameters were collected during the SBT and post-SBT rest period. A light gradient-boosting machine (LGBM) algorithm was employed, incorporating features derived from these vital signs. The model’s performance was assessed using the area under the receiver operating characteristic curve (AUROC), the area under the precision-recall curve (AUPRC), sensitivity, and specificity.
Results
Among the included cases, 11.01% experienced extubation failure. The LGBM model, which integrated data from both SBT and post-SBT rest periods, along with RSBI, achieved the highest performance (AUROC: 0.789, AUPRC: 0.451). Key predictors included ICU duration, RSBI, and respiratory rate during SBT. Models utilizing only SBT or rest period data individually demonstrated significantly lower predictive power compared to those incorporating both time intervals (p < 0.05).
Conclusion
Multi-parameter data from the SBT and post-SBT rest period provide dynamic insights into extubation readiness. The developed machine-learning model demonstrates modest improvement over traditional metrics such as RSBI and may serve as a complementary tool to support extubation decision-making.
Keywords
Introduction
Liberation from mechanical ventilation is a pivotal challenge in the management of critically ill patients in the intensive care unit (ICU). Extubation failure is a serious complication that can lead to prolonged mechanical ventilation, increased ICU length of stay, heightened risk of nosocomial infections, and elevated healthcare costs. A spontaneous breathing trial (SBT) is performed to determine whether a patient is prepared for extubation. The reintubation rate following extubation in patients who underwent successful SBT was approximately 13%, significantly lower than the nearly 40% observed in patients who did not undergo SBT.1–5 Despite adherence to this protocol, extubation failure rates remain high, ranging from 10% to 20%, underscoring the need for more effective predictive methods to identify patients at risk.
There is a growing interest in the potential benefits of a short rest period achieved by reconnecting the ventilator after a successful SBT. It has been shown to reduce the rate of reintubation in a prior randomized-controlled trial, 6 whereas a recent trial found no overall effect, except a potential benefit in patients ventilated over 72 hours. 7 A recent physiological study also showed that a rest period after SBT promoted complete recovery of alveolar derecruitment. 8 However, previous studies proposing machine learning models to predict extubation failure have mostly utilized data collected before and during SBT, without specifically incorporating data from the rest period after the SBT.9–11 In addition, although the rapid shallow breathing index (RSBI) shows moderate sensitivity, its specificity for predicting extubation failure remains poor. 12 Addition of ultrasound 13 or electrical impedance tomography 14 may help predict extubation outcomes, but their routine implementation in clinical practice is limited by resource constraints and the need for specialized training.
In this study, we aimed to address these gaps by developing a predictive model for extubation failure based on easily obtainable data recorded during SBT and post-SBT rest period. Our objectives were threefold: (1) to validate the predictive value of data collected during SBT and rest period, (2) to compare the performance of the model with that of the widely used clinical metric, rapid shallow breathing index (RSBI), 15 and (3) to identify clinically meaningful indicators that can enhance prediction accuracy.
Methods
Ethical approval
The dataset used in this study was constructed from data collected at Seoul National University Hospital, Seoul, Republic of Korea, between February 2020 and March 2024. The Institutional Review Board (IRB) of Seoul National University Hospital approved the study with a waiver of informed consent (IRB-2303-129-1414), as our research utilized retrospective and observational clinical data. Procedures were conducted in accordance with the ethical standards of the responsible committee on human experimentation (COMIRB) and the Helsinki Declaration of 1975.
Data collection
This analysis encompassed all adult patients (aged 18 years or older) with extubation records available in the medical and surgical ICUs during the study period. Each intubation-extubation scenario was treated as a discrete case. Consequently, a single patient may be included in multiple cases. We excluded cases involving tracheostomy, unspecified intubation history, absence or undocumented SBT, SBT duration of less than 30 minutes or more than 2 hours, absence of a post-SBT rest period, SBT performed within 12 hours of intubation, or mechanical ventilation exceeding one month.
We collected demographic and ICU chart data, including age, body mass index (BMI), Richmond Agitation-Sedation Scale (RASS) score, time of ICU admission, time of intubation and extubation, time of SBT initiation and completion, and duration of rest period. Also, laboratory data were collected, including arterial oxygen partial pressure (PaO2), partial pressure of carbon dioxide (pCO2), and pH from arterial blood gas analysis (ABGA), hemoglobin (Hb), lactate, C-reactive protein (CRP), activated partial thromboplastin time (aPTT), blood urea nitrogen (BUN), and albumin. The laboratory data were obtained using the most recent values recorded before the end point of the post-SBT rest period. Furthermore, vital sign data were collected during SBT and the rest period after SBT, including heart rate (HR), respiratory rate (RR), systolic blood pressure (SBP), mean blood pressure (MBP), and diastolic blood pressure (DBP). Ventilator parameters such as fractional inspired oxygen (FiO2), peak inspiratory pressure (PIP), positive end-expiratory pressure (PEEP), minute ventilation (MV), and tidal volume (VT) were also collected. All vital sign data and ventilator parameters were extracted at 2-second intervals from the Vital Recorder. 16 In cases where Vital Recorder data were unavailable, the data were supplemented using measurements recorded in the EMR (Electronic Medical Record) at 1-minute intervals.
Weaning protocol
Weaning from mechanical ventilation was performed according to the institutional SBT protocol. Daily assessments were conducted to determine readiness for weaning. The criteria included clinical stability, adequate oxygenation (arterial oxygen saturation > 90% on FiO2 ≤ 0.4 (or PF ratio > 200) and PEEP < 5 cmH2O), an appropriate level of consciousness, and stable respiratory mechanics (RR < 35 breaths per minute, maximum inspiratory pressure ≤ 30 cmH2O, VT > 5 mL/kg, minute ventilation between 10 and 15 L/min, and no significant increase in the work of breathing). Patients who met the criteria underwent measurement of the RSBI for 3 minutes. If the RSBI was < 105, an SBT was initiated. The SBT was conducted using one of the following modalities: T-tube, pressure support ventilation, or CPAP, with the choice determined by the treating physician based on the patient’s clinical status. SBT was performed for a minimum of 30 minutes and up to 2 hours. Patients who successfully completed the SBT underwent a 1-hour rest period followed by a cuff-leak test. In the absence of contraindications, extubation was performed.
Data preprocessing
In an ICU setting, noise can be generated from a multitude of sources. The data range considered was limited to 20 bpm ≤ HR ≤ 200 bpm, 20 mmHg ≤ SBP ≤ 200 mmHg, 20 mmHg ≤ DBP ≤ 200 mmHg, 20 mmHg ≤ MBP ≤ 200 mmHg, 5 brpm ≤ RR ≤ 40 brpm, 0 mbar ≤ PIP ≤ 30 mbar, 0 L/min ≤ MV ≤ 20 L/min, and 50 ml ≤ VT ≤ 1000 ml. Furthermore, temporary alterations in VT may occur due to medical interventions, such as suctioning or coughing by the patients. The erroneous values were removed and subsequently interpolated with the surrounding one-minute median VT.
Predictor variables
The duration of mechanical ventilation was calculated as the time interval from intubation to the initiation of SBT. ICU duration was defined as the interval from ICU admission to the start of SBT. The P/F ratio was calculated by dividing PaO2 by FiO2. Laboratory data were collected over the seven-day period preceding SBT through the post-SBT rest period, with the most recent values used for analysis.
The VT per predicted body weight (VT-PBW) was calculated using a predicted body weight (PBW), which was derived by: 50+0.91×(height (cm)−152.4) for males, and 45.5+0.91×(height (cm)−152.4) for females. 17 Dynamic compliance was calculated as VT divided by PIP-PEEP. Vital signs were extracted from the two-time ranges: (1) the SBT period, defined as the 30-minute interval immediately following initiation of the SBT; and (2) the post-SBT rest period, defined as the 30-minute interval after SBT completion during which patients were reconnected to ventilatory support (Supplementary Method 1). Ventilator parameters, VT-PBW, and dynamic compliance were extracted only from the post-SBT rest period. Variables from these respective time ranges were categorized as ‘SBT’ and ‘REST’.
The RSBI was calculated as the ratio of RR to VT. The RSBI was extracted from the REST period.
Outcome variable
Extubation failure was defined as the need for invasive mechanical ventilation within 48 hours of extubation. 18 Prophylactic respiratory support, such as high-flow nasal cannula or non-invasive ventilation, immediately after extubation in high-risk patients19,20 was not classified as extubation failure given its preventive nature rather than as a rescue therapy for clinical deterioration.
Model input features
For all ventilator-related vital signs and RSBI variables, summary statistics were extracted for the mean, maximum, minimum, 25th percentile, and 75th percentile for each time range. Furthermore, the differences between the SBT and REST for vital sign variables were extracted as additional features, with the objective of including variables that reflect changes in patient status. To enhance the precision of the model and facilitate the development of an effective model, we employed recursive feature elimination with the cross-validation (RFE-CV) method for feature selection. RFE-CV assesses the performance of the model through an iterative process of removing features deemed less necessary using cross-validation.
Model training
The light gradient-boosting machine (LGBM) model 21 was utilized to predict extubation failure. Binary cross-entropy was employed as the loss function. The detailed specification and training strategy are presented in Supplementary Method 2.
The training and testing datasets were divided based on the patient, resulting in two datasets that were completely disjoint regarding the patients, although a single patient may be included in multiple cases. The models were trained using 75% of patients, and the remaining 25% were used for testing.
The seven types of LGBM models were trained by varying the input: a model including variables from SBT, REST, and RSBI, a model including variables from REST and RSBI, a model including SBT and RSBI, a model including the RSBI only, a model including variables from SBT and REST, a model including variables from SBT, and a model including variables from REST. Note that the variables of difference in vital signs were only involved when the model took input from both SBT and REST.
Statistical analysis and model evaluation
In accordance with the results of the D'Agostino and Pearson normality test, the Mann-Whitney U test or two-sample t-test was employed to ascertain the statistical significance of general patient variables, including age, height, and weight, between the training and testing datasets. The Pearson chi-square test was utilized to evaluate the statistical significance of categorical variables, such as sex. The threshold for statistical significance was set at a p-value of less than 0.05. The model performance was evaluated in terms of the area under the receiver operating characteristic curve (AUROC), the area under the precision-recall curve (AUPRC), sensitivity, and specificity. The 95% confidence intervals for performance metrics were obtained using bootstrap resampling. A random 25% of cases were selected for the testing dataset. Note that the training and testing datasets had completely disjoint sets of patients. To determine the statistical significance of the performance difference between models with disparate inputs, a paired t-test was conducted with bootstrapping performed 1,000 times. Calibration of the best-performing model was assessed using the Brier score and calibration curve. Furthermore, to ascertain the contribution of each variable to the model predictions, we employed shapely additive explanations (SHAP) 22 to evaluate the relative importance of the features.
Results
During the study period, 1,620 extubation cases were identified from 1,115 patients, and 1,203 cases from 739 patients were excluded based on our screening criteria. Consequently, 413 cases from 372 patients were included in the final analysis (Figure 1). The training dataset consisted of 304 cases from 279 patients, of which 38 cases were extubation failures. The testing dataset consisted of 109 cases from 93 patients, including 12 extubation failure cases. Flow diagram of patient inclusion and exclusion.
Comparison of general characteristics between the training and testing group.
Data are mean(SD) or n(%). MV = Mechanical ventilation; ICU = Intensive Care Unit; BUN = Blood urea nitrogen; Hb = Hemoglobin; pH = Potential of hydrogen; pCO2 = Partial pressure of carbon dioxide; CRP = C-reactive protein; Lactate = Lactate level; aPTT = Activated partial thromboplastin time.
Continuous variables are presented as mean (SD) and compared using Two Sample T-tests for normally distributed data or Mann-Whitney U tests for non-normally distributed data. A p-value of less than 0.05 was considered statistically significant.
Performance of models.
AUROC=area under the receiver operating curve, AUPRC=area under the precision-recall curve. Values in parentheses indicate 95% confidence intervals.
Figure 2 presents the importance of variables of the best-performing model using the SHAP plot. The ICU duration, maximum RSBI, and mean of RR during SBT showed the most contributing variables. Among laboratory variables, lactate, BUN, and aPTT were significant predictors of extubation failure. More specifically, the risk of extubation failure increased with longer ICU duration, lower maximum RSBI, lower mean DBP during REST, and higher mean and maximum RR during SBT. Feature importance based on SHAP (Shapley Additive Explanations) values.
Discussion
This study demonstrates that incorporating multi-parameter data from both the SBT and post-SBT rest period into a machine-learning model significantly improves the prediction of extubation failure compared to models relying solely on SBT data. By leveraging machine learning algorithms and real-time physiological monitoring, our model integrates vital signs, ventilatory parameters, and patient characteristics, and may serve as a complimentary tool for extubation decision-making. However, its overall discrimination remains moderate (AUROC = 0.789). Accordingly, the proposed approach may be considered as a complementary tool to support extubation decision-making. The findings suggest that monitoring patients beyond the SBT into the rest period offers additional insights into post-extubation stability. A previous study has shown that minute ventilation recovery time during the post-SBT rest period has been shown to be an independent predictor of extubation outcomes. 23
Despite its potential clinical relevance, the post-SBT rest period has been largely overlooked in prior studies, which have predominantly focused on pre-SBT or SBT-derived parameters. Previous models predicting extubation failure, such as a machine learning approach using the CatBoost algorithm proposed by Zhao et al., 9 have contributed valuable insights into extubation risk stratification. However, both approaches rely predominantly on static variables obtained at a single time point. In contrast, this study incorporates data from multiple time points–before, during, and after SBT–enabling a continuous and comprehensive temporal assessment of a patient’s readiness for extubation. Our emphasis on temporal dynamics aligns with the findings of Kuo et al., 11 who established the importance of temporal patterns in respiratory data for artificial neural networks in the medical ICU. However, their model did not include data from the post-SBT period. The Extubation Predictive Score (ExPreS) by Baptistella et al., 24 achieved a high AUROC of 0.971; however, it did not incorporate the post-SBT period data, and more importantly, required the manual assessment of muscle strength via the Medical Research Council Scale. This reliance on subjective, clinician-dependent measurements may limit consistency and increase ICU workload. In contrast, our model circumvents these manual measurements by incorporating diverse machine-learning algorithms using routinely collected clinical data and optimizing them for real-time application in both medical and surgical ICUs.
Several studies explored specialized diagnostic tools to predict extubation success. For instance, the use of mechanical insufflation-exsufflation devices to measure peak cough flow 10 typically achieves an AUROC of 0.91; while lung ultrasound or chest electrical impedance tomography 25 reports AUROCs ranging from 0.786 to 0.84. Furthermore, diaphragm ultrasound for measuring diaphragm thickening 26 demonstrates an AUROC of 0.83. While the predictive performance of our model is lower than that reported using specialized diagnostic tools, the widespread adoption of such diagnostic tools is often impractical in diverse, real-world ICU settings.
SHAP analysis revealed how key predictors directionally contributed to extubation failure. The risk was higher among patients with a longer ICU stay, higher mean and maximum RR during SBT, lower mean DBP during the post-SBT rest period, higher mean HR, and elevated lactate levels. These features may reflect limited respiratory reserve, respiratory muscle fatigue, or hemodynamic instability.23,27 Several post-SBT rest-period variables exhibited non-monotonic, non-linear patterns in the SHAP analysis. These findings suggest that the effect of a variable depends on its interaction with other physiologic features, rather than on its own absolute value alone. Accordingly, the SHAP analysis highlights the need to interpret extubation risks through the combined physiologic context across the SBT and post-SBT rest periods.
The developed model may complement existing extubation workflows by supporting clinical decision-making after SBT. Upon completion of the SBT and the post-SBT rest period, the model generates an estimate of extubation failure probability, and if this exceeds the predefined threshold of 0.02, the cut-point that maximized the Youden index (sensitivity + specificity -1), an alert can be triggered. The low numeric value of this threshold is a direct consequence of the low prevalence of extubation failure in our cohort (11.01%). Because the outcome is uncommon, predicted probabilities are concentrated at low values, resulting in a corresponding low optimal cut-point that does not indicate an overly aggressive operating point. At this threshold, the model achieved a sensitivity of 0.833 and specificity of 0.649 (35.1% false-positive rate). High sensitivity was intentionally prioritized because extubation failure, leading to reintubation, presents far greater clinical consequences than a temporary precautionary delay. Although 35.1% false-positive rate could increase clinician workload and contribute to alarm fatigue. The alert is generated only once per extubation assessment rather than continuously, distinguishing it from the high-frequency monitor alarms. Furthermore, it is intended as a prompt for clinical reassessment rather than a binding criterion to defer extubation. Because daily SBTs are routine, any precautionary delay is expected to be brief. The model is thus intended not as a replacement for clinician judgment or the SBT, but as an adjunctive second-level screening tool that flags patients who may warrant a more cautious extubation strategy or benefit from proactive post-extubation support, such as non-invasive ventilation or high-flow nasal cannula.
Nevertheless, this study has several limitations. First, the retrospective design and single-center setting limit the generalizability of our findings and introduce selection bias, underscoring the need for external validation in a broader patient population. Although we attempted to mitigate this by including a relatively large cohort of both medical and surgical ICU patients compared to prior extubation failure prediction studies with complete separation between training and testing cohorts, internal validation alone is insufficient to confirm clinical applicability. Accordingly, multicenter external validation is a critical prerequisite for clinical translation and broader implementation of this model. Additionally, the model’s reliance on high-resolution data recorded every 2 seconds via the Vital Recorder 16 presents a barrier, as such infrastructure is not yet available in most ICUs. Accordingly, multicenter external validation is essential before clinical implementation of this model. Second, extubation decisions were ultimately made by the treating physicians, potentially introducing variability. Third, while the model demonstrates potential clinical utility, its predictive performance remains moderate, as reflected by the wide confidence intervals. Therefore, its immediate clinical applicability as a standalone tool may be limited. Accordingly, the model should be viewed as an objective and data-driven complementary tool to support extubation decision-making rather than as a replacement for the clinician’s judgment regarding weaning and extubation readiness. Furthermore, although the model demonstrated reasonable overall calibration, deviations from perfect calibration were observed in certain probability ranges. Specifically, the calibration curve tended to fall below the ideal reference line in the intermediate range of predicted risk, indicating that the model may have overestimated the risk of extubation failure in this range. Given the proposed use of the model as a clinical complementary tool, these deviations may affect the interpretation of individual predicted risk estimates. Therefore, predicted probabilities should be interpreted with caution, and further external validation and potential recalibration may be required before routine clinical implementation. Nonetheless, this study represents one of the earliest efforts to evaluate the utility of vital sign data recorded during the post-SBT rest period. In addition, the relatively low event rate may increase the risk of model instability and lead to overoptimistic performance estimates. The high feature-to-event ratio, despite feature reduction using RFE-CV, may also increase the risk of overfitting. To mitigate these risks, we applied cross-validated feature selection, strict patient-level separation between training and testing cohorts, and performance evaluation using both discrimination and calibration metrics. Nevertheless, external validation remains necessary to confirm the robustness and generalizability of the model. Lastly, although the proposed model holds promise as a complementary tool for extubation decision-making, prospective evaluation is warranted to confirm its clinical utility. Such studies will be essential to determine how this model can be best integrated into clinical workflows.
Future work should include validation in larger, multicenter cohorts and prospective evaluation and integration into clinical workflows to confirm clinical utility. The model’s fixed prediction time point, 30 minutes after SBT completion, provides a clear temporal anchor that supports integration into automated decision-support systems that automatically initiate risk estimation at a defined time point. Such platforms could generate interval-based updates of extubation failure risk and present these estimates in an interpretable, clinician-friendly format, thereby enhancing clinician situational awareness without adding workload. Prospective evaluation of such systems will be necessary to determine their feasibility, usability, and clinical impact.
Conclusion
Multi-parameter data obtained during the SBT and the subsequent post-SBT rest period provide dynamic insights into extubation readiness. Building upon these patterns, the developed machine-learning model achieves higher predictive performance than traditional single-parameter metrics, offering a practical tool to support extubation decision-making.
Supplemental material
Supplemental material -Multi-parameter prediction of extubation failure using spontaneous breathing trial and post-spontaneous breathing trial rest period data
Supplemental material for Multi-parameter prediction of extubation failure using spontaneous breathing trial and post-spontaneous breathing trial rest period data by Hyun-Lim Yang, Ph.D., Seong-A Park, B.S., Sangha Kim, M.S., Ho-Geol Ryu, M.D., Ph.D., Hong Yeul Lee, M.D., Ph.D., Hannah Lee, M.D., Ph.D., Hyeonhoon Lee, Ph.D., Sang-Min Lee, M.D., Ph.D., Hyung-Chul Lee, M.D., Ph.D., Jinwoo Lee, M.D., Ph.D. in DIGITAL HEALTH
Footnotes
Ethical considerations
The study was approved by the Institutional Review Board (IRB) of Seoul National University Hospital (IRB No. IRB-2303-129-1414). The requirement for written informed consent was waived by the IRB owing to the retrospective nature of the study and the use of anonymized data. According to the IRB requirement, the authors did not have access to information that could identify individual participants during or after data collection. All procedures were conducted in accordance with the ethical standards of the responsible institutional committee on human experimentation and the principles of the Declaration of Helsinki.
Author contributions
Funding
The authors disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This research was supported by a grant of the Korea Health Technology R&D Project through the Korea Health Industry Development Institute (KHIDI), funded by the Ministry of Health & Welfare, Republic of Korea (Grant number: RS-2021-KH114109).
Declaration of Conflicting interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Data Availability Statement
Due to ethical restrictions imposed by the Institutional Review Board of the Seoul National University Hospital, Seoul, Republic of Korea, data are available from the corresponding author upon reasonable request.
Statements and declarations
During the preparation of this work, the authors used GPT-4o and Grammarly to improve the manuscript’s grammar. After using these tools, the authors reviewed and edited the content as needed and took full responsibility for the final content of the publication.
Guarantor
Guarantor Jinwoo Lee, the corresponding author, serves as the guarantor of this work.
Supplemental material
Supplemental material for this article is available online.
References
Supplementary Material
Please find the following supplemental material available below.
For Open Access articles published under a Creative Commons License, all supplemental material carries the same license as the article it is associated with.
For non-Open Access articles published, all supplemental material carries a non-exclusive license, and permission requests for re-use of supplemental material or any part of supplemental material shall be sent directly to the copyright owner as specified in the copyright notice associated with the article.
