Using machine learning for predicting intensive care unit resource use during the COVID-19 pandemic in Denmark

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

Abstract

The COVID-19 pandemic has put massive strains on hospitals, and tools to guide hospital planners in resource allocation during the ebbs and flows of the pandemic are urgently needed. We investigate whether machine learning (ML) can be used for predictions of intensive care requirements a fixed number of days into the future. Retrospective design where health Records from 42,526 SARS-CoV-2 positive patients in Denmark was extracted. Random Forest (RF) models were trained to predict risk of ICU admission and use of mechanical ventilation after n days (n = 1, 2, …, 15). An extended analysis was provided for n = 5 and n = 10. Models predicted n-day risk of ICU admission with an area under the receiver operator characteristic curve (ROC-AUC) between 0.981 and 0.995, and n-day risk of use of ventilation with an ROC-AUC between 0.982 and 0.997. The corresponding n-day forecasting models predicted the needed ICU capacity with a coefficient of determination (R²) between 0.334 and 0.989 and use of ventilation with an R² between 0.446 and 0.973. The forecasting models performed worst, when forecasting many days into the future (for large n). For n = 5, ICU capacity was predicted with ROC-AUC 0.990 and R² 0.928, and use of ventilator was predicted with ROC-AUC 0.994 and R² 0.854. Random Forest-based modelling can be used for accurate n-day forecasting predictions of ICU resource requirements, when n is not too large.

Introduction

During a pandemic like COVID-19, hospital resource management is a high-stakes balancing act. Planners must decide when to "up-scale" intensive care capacity and when to "down-scale" to resume elective surgeries. Traditional epidemiological models often rely on macroscopic variables (like overall infection rates) which can struggle to adapt to shifting demographics, new viral variants, or changes in testing strategies. This paper addresses the need for a "micro-to-macro" forecasting approach: using the detailed clinical history of individual patients already in the system to accurately predict the total future demand for ICU beds and mechanical ventilators.

Methodology

The study utilized a massive retrospective dataset from the Danish Capital and Zealand regions, encompassing 42,526 SARS-CoV-2 positive patients and over 1.2 million 24-hour patient snapshots. The authors employed a Random Forest (RF) architecture to perform $n$-day forecasting. Their approach is distinct because it starts at the individual level:

  1. Patient Snapshots: Daily snapshots captured features like age, BMI, comorbidities, and temporal clinical data (vitals and lab results).
  2. Micro-Prediction: The RF model predicts the probability that a specific individual will require an ICU bed or a ventilator $n$ days into the future ($n$ ranging from 1 to 15).
  3. Macro-Forecasting: These individual probabilities are summed to generate a population-wide forecast for a specific region.

The researchers tested two deployment scenarios: Monthly Retraining (mimicking real-world use where the model learns from the most recent data) and First Wave Training (testing how well a model trained on early data generalizes to later pandemic waves).

Results

The Random Forest model demonstrated high predictive power, particularly for shorter time horizons. For individual risk, the model achieved an ROC-AUC between 0.981 and 0.997 for predicting $n$-day risk of ICU admission and ventilator use.

As expected, accuracy decreased as the forecast window widened. For a 5-day window ($n=5$), the model predicted ICU capacity with a coefficient of determination ($R^2$) of 0.928. However, for a 10-day ICU forecast, the $R^2$ dropped significantly.

Figure 2: Model performance ($R^2$ and Mean Error) as the number of forecast days ($n$) increases. Performance is highest for short-term predictions.

Discussion

A key insight is the power of aggregation: while predicting exactly which patient will end up in the ICU is useful, aggregating these individual risks provides a remarkably stable and accurate forecast for total capacity.

Figure 3: 5-day forecast vs. actual targets. The model (orange) closely tracks the true target (dark grey) during peak periods.

The models consistently underestimate the "true" target as $n$ increases. This "late arrival" limitation occurs because the model only knows about patients already in the EHR system. If a patient is tested and admitted to the ICU on the same day, they weren't "visible" to a 5-day forecast made previously. Despite this, monthly retraining allowed the model to adjust to shifts in pandemic constants (like improved treatments or new variants) better than static models.

Conclusion

Random Forest-based modelling can be used for accurate $n$-day forecasting of ICU resource requirements, provided the forecast horizon is not too large. While limited by the inability to account for patients not yet in the hospital system, this framework offers a data-driven tool for hospital planners. Future work could integrate community infection rates to correct underestimation bias and explore applications in other disease settings, such as seasonal flu.

Summary updated

BibTeX
@inproceedings{lorenzen2021using,
  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 = {{Using machine learning for predicting intensive care unit resource use during the COVID-19 pandemic in Denmark}},
  booktitle = {Scientific},
  year = {2021},
  doi = {10.1038/s41598-021-98617-1},
}
Figure