ICU Sepsis Onset Prediction β GRU + LightGBM
Clinical deterioration prediction system for ICU vital sign monitoring. Predicts sepsis onset from hourly time-series data (vital signs, labs, demographics).
Architecture
Two models trained and evaluated:
| Model |
Type |
Parameters |
Best For |
| GRU |
Sequential (PyTorch) |
53,953 |
Temporal pattern detection, real-time monitoring |
| LightGBM |
Tabular (gradient boosting) |
86 trees |
Fast inference, interpretable (SHAP), tabular workflows |
Evaluation Results (Test Set)
26,506 time steps from 300 held-out patients (18 sepsis, 282 healthy)
Primary Metrics
| Metric |
GRU |
LightGBM |
Winner |
| AUROC |
0.9999 |
1.0000 |
LightGBM |
| AUPRC |
0.9976 |
0.9996 |
LightGBM |
At Threshold = 0.50
| Metric |
GRU |
LightGBM |
| Precision |
0.9274 |
0.9943 |
| Recall (Sensitivity) |
0.9921 |
0.9887 |
| F1 Score |
0.9587 |
0.9915 |
| Specificity |
0.9973 |
0.9998 |
At Optimal Threshold (Youden's J)
| Metric |
GRU (t=0.324) |
LightGBM (t=0.189) |
| Precision |
0.8832 |
0.9823 |
| Recall (Sensitivity) |
0.9966 |
0.9989 |
| F1 Score |
0.9365 |
0.9905 |
| Specificity |
0.9954 |
0.9994 |
Confusion Matrices (t=0.5)
GRU: TP=881, FP=69, FN=7, TN=25,549
LightGBM: TP=878, FP=5, FN=10, TN=25,613
Data Schema (PhysioNet 2019 Compatible)
40 input features + binary missingness indicators (34 masks) = 74 total input features
- Vitals (8): HR, O2Sat, Temp, SBP, MAP, DBP, Resp, EtCO2
- Labs (26): BaseExcess, HCO3, FiO2, pH, PaCO2, SaO2, AST, BUN, Alkalinephos, Calcium, Chloride, Creatinine, Bilirubin_direct, Glucose, Lactate, Magnesium, Phosphate, Potassium, Bilirubin_total, TroponinI, Hct, Hgb, PTT, WBC, Fibrinogen, Platelets
- Demographics (6): Age, Gender, Unit1, Unit2, HospAdmTime, ICULOS
- Label: SepsisLabel (0=no sepsis, 1=sepsis onset)
Preprocessing Pipeline
Based on YAIB Benchmark (van de Water et al., 2023; arxiv:2306.05109):
- Missingness indicators β Binary mask columns for each dynamic feature (labs missing = clinically informative)
- Forward-fill β Last-observation-carried-forward within patient
- Train-mean fill β Remaining NaN filled with training set mean (prevents leakage)
- Z-score scaling β StandardScaler fit on training data only
Training Details
- Dataset: 2,000 synthetic ICU patients (120 sepsis, 1,880 healthy) matching PhysioNet 2019 schema
- Split: 70/15/15 patient-level stratified
- GRU: hidden_size=64, layers=2, lr=2e-4, batch=64, pos_weight=34.9, early stopping patience=10 β 48 epochs
- LightGBM: 600 features (40 base + rolling mean/min/max/std at 6h/12h/24h windows + delta features), 86 trees, lr=0.05, num_leaves=63
Usage
import torch
import numpy as np
checkpoint = torch.load('gru_sepsis_model.pt', weights_only=False)
model = SepsisGRU(
input_size=checkpoint['input_size'],
hidden_size=checkpoint['hidden_size'],
num_layers=checkpoint['num_layers']
)
model.load_state_dict(checkpoint['model_state_dict'])
model.eval()
with torch.no_grad():
x = torch.tensor(patient_data, dtype=torch.float32).unsqueeze(0)
logits = model(x)
risk_scores = torch.sigmoid(logits).squeeze().numpy()
Intended Use
- Primary: ICU early warning system for sepsis onset detection
- Secondary: Home patient vital sign monitoring (with VitalDB data for transfer)
- Pipeline template: Drop-in replacement for PhysioNet 2019, eICU, MIMIC-IV data
Limitations
- Trained on synthetic data β retrain on PhysioNet 2019 / eICU / MIMIC-IV before clinical deployment
- Performance on synthetic data (~0.999 AUROC) will be significantly lower on real data (expect ~0.77β0.84 AUROC per YAIB benchmark)
- Not validated for pediatric patients (training data: age β₯ 18)
References
- van de Water et al. "Yet Another ICU Benchmark" (Nature Communications, 2023) β arxiv:2306.05109
- Reyna et al. "Early Prediction of Sepsis from Clinical Data" (PhysioNet Computing in Cardiology Challenge, 2019)
- Moor et al. "Early Prediction of Sepsis in the ICU Using Machine Learning" (Frontiers in Medicine, 2021) β arxiv:2107.05230