Skip to content

TILTomorrow today: dynamic factors predicting changes in intracranial pressure treatment intensity after traumatic brain injury

License

Notifications You must be signed in to change notification settings

sbhattacharyay/TILTomorrow

Repository files navigation

DOI

TILTomorrow: dynamic, ordinal, and full-context prediction of next-day treatment intensity for TBI patients in the ICU

TILTomorrow today: dynamic factors predicting changes in intracranial pressure treatment intensity after traumatic brain injury

Contents

Overview

This repository contains the code underlying the article entitled TILTomorrow today: dynamic factors predicting changes in intracranial pressure treatment intensity after traumatic brain injury from the Collaborative European NeuroTrauma Effectiveness Research in TBI (CENTER-TBI) consortium. In this file, we present the abstract, to outline the motivation for the work and the findings, and then a brief description of the code with which we generate these finding and achieve this objective.

The code in this repository is commented throughout to provide a description of each step alongside the code which achieves it.

Abstract

Practices for controlling intracranial pressure (ICP) in traumatic brain injury (TBI) patients admitted to the intensive care unit (ICU) vary considerably between centres. To help understand the rational basis for such variance in care, this study aims to identify the patient-level determinants of changes in ICP management. We extract all heterogeneous data (2,008 pre-ICU and ICU variables) collected from a prospective cohort (n=844, 51 ICUs) of ICP-monitored TBI patients in the Collaborative European NeuroTrauma Effectiveness Research in TBI (CENTER-TBI) study. We develop the TILTomorrow modelling strategy, which leverages recurrent neural networks to map a token-embedded time series representation of all variables (including missing values) to an ordinal, dynamic prediction of the following day’s five-category therapy intensity level (TIL(Basic)) score. With 20 repeats of 5-fold cross-validation, we train TILTomorrow on different variable sets and apply the TimeSHAP (temporal extension of SHapley Additive exPlanations) algorithm to estimate variable contributions towards next-day changes in TIL(Basic). Based on Somers’ Dxy, the full range of variables explains 68% (95% CI: 65–72%) of the ordinal variance in next-day changes in TIL(Basic) on day one and up to 51% (95% CI: 45–56%) thereafter, when changes in TIL(Basic) become less frequent. Up to 81% (95% CI: 78–85%) of this explanation can be derived from non-treatment variables (i.e., markers of pathophysiology and injury severity), but the prior trajectory of ICU management significantly improves prediction of future de-escalations in ICP-targeted treatment. Whilst there is no significant difference in the predictive discriminability (i.e., area under receiver operating characteristic curve [AUC]) between next-day escalations (0.80 [95% CI: 0.77–0.84]) and de-escalations (0.79 [95% CI: 0.76–0.82]) in TIL(Basic) after day two, we find specific variable associations to be more robust with de-escalations. The most important predictors of day-to-day changes in ICP management include preceding treatments, age, space-occupying lesions, ICP, metabolic derangements, and neurological function. Serial protein biomarkers were also important and offer a potential addition to the clinical armamentarium for assessing therapeutic needs. Approximately half of the ordinal variance in day-to-day changes in TIL(Basic) after day two remains unexplained, underscoring the significant contribution of unmeasured factors or clinicians’ personal preferences in ICP treatment. At the same time, specific dynamic markers of pathophysiology associate strongly with changes in treatment intensity and, upon mechanistic investigation, may improve the precision and timing of future care.

Code

All of the code used in this work can be found in the ./scripts directory as Python (.py), R (.R), or bash (.sh) scripts. Moreover, custom classes have been saved in the ./scripts/classes sub-directory, custom functions have been saved in the ./scripts/functions sub-directory, and custom PyTorch models have been saved in the ./scripts/models sub-directory.

1. Extract and characterise study sample from CENTER-TBI dataset

  1. In this .py file, we extract the study sample from the CENTER-TBI dataset and filter patients by our study criteria. We also clean and format information pertaining to the Therapy Intensity Level (TIL) scores. We also create 100 partitions for 20-repeats of 5-fold cross-validation, and save the splits into a dataframe for subsequent scripts.
  2. In this .py file, we characterise the study dataset by calculating summary statistics for the manuscript.

2. Tokenise all CENTER-TBI variables and place into discretised ICU stay time windows

  1. In this .py file, we extract all heterogeneous types of variables from CENTER-TBI and fix erroneous timestamps and formats.
  2. In this .py file, we convert all CENTER-TBI variables into tokens depending on variable type and compile full dictionaries of tokens across the full dataset. This is run, with multi-array indexing, on the HPC using a bash script.
  3. In this .py file, we categorise and characterise the tokens in each patient's ICU stay in our study.

3. Train and evaluate full-context ordinal-trajectory-generating models

  1. In this .py file, we train the trajectory-generating models across the repeated cross-validation splits and the hyperparameter configurations. This is run, with multi-array indexing, on the HPC using a bash script.
  2. In this .py file, we compile the validation and testing set trajectories generated by the models. We determine the top-performing tuning configurations based on validation set calibration and discrimination. We also create bootstrapping resamples for dropping out poorly calibrated configurations.
  3. In this .py file, we calculate validation set trajectory calibration and discrimination based on provided bootstrapping resample row index. This is run, with multi-array indexing, on the HPC using a bash script.
  4. In this .py file, we compile and save bootstrapped validation set performance dataframes. Futhermore, the hyperparameter optimisation results are Visualised.
  5. In this .py file, we recalibrate the TILTomorrow model and save the performance measure before and after. This is run, with multi-array indexing, on the HPC using a bash script.
  6. In this .py file, we compile all the calibration performance metrics and calculate the average effect of post-processing calibration methods on each tuning configuration. We also create bootstrapping resamples for calculating testing set performance metrics.
  7. In this .py file, we calculate testing set trajectory calibration and discrimination based on provided bootstrapping resample row index. This is run, with multi-array indexing, on the HPC using a bash script.
  8. In this .py file, we compile the performance metrics and summarise them across bootstrapping resamples to define the 95% confidence intervals for statistical inference.

4. Sensitivity analysis

  1. In this .py file, train new models based on hyperparameters specific to the sensitivity analysis. This is run, with multi-array indexing, on the HPC using a bash script.
  2. In this .py file, we calculate test set calibration and discrimination based on provided bootstrapping resample row index. This is run, with multi-array indexing, on the HPC using a bash script.
  3. In this .py file, we compile the performance metrics and summarise them across bootstrapping resamples to define the 95% confidence intervals for statistical inference.

5. Interpret variable effects

  1. In this .py file, we extract and summarise the learned weights from the model relevance layers (trained as PyTorch Embedding layers).
  2. In this .py file, we define and identify significant transitions in individual patient trajectories, partition them for bootstrapping, and calculate summarised testing set trajectory information in preparation for TimeSHAP feature contribution calculation.
  3. In this .py file, we calculate variable and time-window TimeSHAP values for each individual's significant transitions. This is run, with multi-array indexing, on the HPC using a bash script.
  4. In this .py file, we load all the calculated TimeSHAP values and summarise them for population-level variable and time-window analysis.

6. Performance evaluation focused on prediction of transitions

  1. In this .py file, we calculate testing set calibration and discrimination based on provided bootstrapping resample row index. This is run, with multi-array indexing, on the HPC using a bash script.
  2. In this .py file, we compile the saved bootstraped testing set performances and calculate 95% confidence intervals.

In this .R file, we produce the figures for the manuscript and the supplementary figures. The large majority of the quantitative figures in the manuscript are produced using the ggplot package.

Citation

About

TILTomorrow today: dynamic factors predicting changes in intracranial pressure treatment intensity after traumatic brain injury

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages