Developing Machine Learning Models for Predicting Intensive Care Unit Resource Use During the COVID-19 Pandemic

Stephan Sloth Lorenzen, Mads Nielsen, Espen Jimenez‐Solem, Tonny Studsgaard Petersen, Anders Perner, Hans‐Christian Thorsen‐Meyer, Christian Igel, Martin SillesenmedRxiv 2021

Abstract

Importance: The COVID-19 pandemic has placed unprecedented strain on global healthcare systems. Hospital planners require precise tools to manage resource allocation during fluctuating infection rates. Objective: This study investigates whether Machine Learning (ML) can accurately forecast intensive care requirements 5 and 10 days into the future. Design: A retrospective study using health records from 34,012 SARS-CoV-2 positive patients. Random Forest (RF) models were trained to predict the risk of ICU admission and mechanical ventilation requirements. Setting: Two Danish regions covering approximately 2.5 million citizens. Results: The models predicted 5-day ICU admission risk with an Area Under the Receiver Operating Characteristic curve (ROC-AUC) of 0.986 and 5-day ventilator use with an ROC-AUC of 0.995. Forecasting models for total capacity achieved a coefficient of determination ($R^2$) of 0.930 for ICU beds and 0.934 for ventilation. Conclusions: Random Forest-based modeling provides a robust framework for short-term forecasting of ICU resource requirements, offering a valuable tool for hospital logistics and crisis management.

Introduction

During the COVID-19 pandemic, hospital resource management became a high-stakes balancing act. Administrators were forced to make critical decisions regarding the mobilization of ad-hoc intensive care units and the suspension of elective surgeries. Traditional epidemiological models, while useful for understanding broad population trends, often rely on macroscopic variables like social mobility and general infection rates. These models frequently struggle to adapt to shifting patient demographics, evolving testing strategies, or changes in clinical treatment protocols.

To address these limitations, this research proposes a "micro-to-macro" framework. Rather than forecasting population-level trends directly, the study focuses on calculating the specific risk for every individual who tests positive for SARS-CoV-2 and aggregating those risks to predict regional resource demand.

Methodology

The Micro-to-Macro Framework

The core innovation of this study is the extrapolation from individual risk to population-wide demand. Instead of training a model directly on the "total number of beds used," the researchers trained a Random Forest (RF) model to predict the probability of an individual patient requiring an ICU bed or ventilator $n$ days in the future. By summing these individual probabilities—treating them as dichotomous Bernoulli variables—the researchers generated a stable and highly accurate forecast for the entire regional population.

Temporal Snapshots and Feature Engineering

The model utilized Electronic Health Records (EHR) to process data in 24-hour "snapshots." This allowed the model to update its predictions as a patient’s condition evolved, incorporating new laboratory results or vital signs. The features included:

  • Static Data: Age, BMI, comorbidities (ICD-10 codes), and smoking status.
  • Dynamic Data: Time since the first positive test, time already spent in the hospital or ICU, and medication history (ATC codes).

Evaluation Scenarios

To ensure the model's utility in a real-world setting, two specific scenarios were tested:

  1. Monthly Retraining: Simulating a live deployment where the model is updated with the most recent data.
  2. Second Wave Generalization: Training the model on data from the first wave of the pandemic and testing its performance on the second wave to evaluate its robustness against shifting clinical protocols.

Data and Participants

The study utilized a comprehensive dataset from the Danish Capital and Zealand regions, encompassing approximately 2.5 million citizens. The cohort included 34,012 SARS-CoV-2 positive patients identified between March 3, 2020, and January 5, 2021. This resulted in 826,715 individual snapshots, providing a rich longitudinal view of patient progression.

Results

The Random Forest models demonstrated exceptional performance across both micro-level risk assessment and macro-level capacity forecasting.

Individual Risk Prediction (Micro)

For 5-day predictions, the models achieved:

  • ICU Admission: ROC-AUC of 0.986
  • Ventilator Use: ROC-AUC of 0.995
  • Mortality: High predictive accuracy was also maintained for mortality risks.

Capacity Forecasting (Macro)

When individual risks were aggregated to forecast total regional demand, the 5-day models achieved:

  • ICU Capacity: $R^2 = 0.930$
  • Ventilator Use: $R^2 = 0.934$

Performance remained high for 10-day forecasts, though it was slightly reduced compared to the 5-day window. Notably, the RF models significantly outperformed standard Logistic Regression and Linear Regression baselines, highlighting the importance of capturing non-linear relationships in clinical data.

Discussion and Limitations

The study demonstrates that underlying clinical indicators of severe disease remained relatively consistent despite changes in treatment protocols between the first and second waves. By using full EHR data rather than just infection counts, the model naturally accounts for shifts in the health profile of the infected population.

However, several limitations remain:

  • Testing Lag: If a patient is hospitalized before their positive test result is entered into the system, the model cannot include them in the forecast, leading to a consistent underestimation of resource needs.
  • Retrospective Design: While the results are promising, prospective validation in a live clinical environment is necessary.
  • Local Calibration: Because healthcare systems and demographics vary, the authors recommend that these models be retrained on local data rather than transferred directly between different countries or healthcare environments.

Conclusion

Machine learning models based on individual patient data offer a powerful tool for hospital planners. By providing accurate 5- and 10-day forecasts of ICU and ventilator requirements, this framework can assist in the logistical management of healthcare resources during the ongoing COVID-19 pandemic and future public health crises.

Summary updated

BibTeX
@misc{lorenzen2021developing,
  author = {Stephan Sloth Lorenzen and Mads Nielsen and Espen Jimenez‐Solem and Tonny Studsgaard Petersen and Anders Perner and Hans‐Christian Thorsen‐Meyer and Christian Igel and Martin Sillesen},
  title = {{Developing Machine Learning Models for Predicting Intensive Care Unit Resource Use During the COVID-19 Pandemic}},
  year = {2021},
  doi = {10.1101/2021.03.19.21253947},
  howpublished = {medRxiv},
}
Figure