CoolFace
Modelpublic

Abdu347/icu-sepsis-prediction

sourceHugging Faceapache-2.0updated 5mo agoView on Hugging Face
0likes
Model Card

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:

ModelTypeParametersBest For
GRUSequential (PyTorch)53,953Temporal pattern detection, real-time monitoring
LightGBMTabular (gradient boosting)86 treesFast inference, interpretable (SHAP), tabular workflows

Evaluation Results (Test Set)

26,506 time steps from 300 held-out patients (18 sepsis, 282 healthy)

Primary Metrics

MetricGRULightGBMWinner
AUROC0.99991.0000LightGBM
AUPRC0.99760.9996LightGBM

At Threshold = 0.50

MetricGRULightGBM
Precision0.92740.9943
Recall (Sensitivity)0.99210.9887
F1 Score0.95870.9915
Specificity0.99730.9998

At Optimal Threshold (Youden's J)

MetricGRU (t=0.324)LightGBM (t=0.189)
Precision0.88320.9823
Recall (Sensitivity)0.99660.9989
F1 Score0.93650.9905
Specificity0.99540.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, Bilirubindirect, Glucose, Lactate, Magnesium, Phosphate, Potassium, Bilirubintotal, 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):

  1. 1.Missingness indicators — Binary mask columns for each dynamic feature (labs missing = clinically informative)
  2. 2.Forward-fill — Last-observation-carried-forward within patient
  3. 3.Train-mean fill — Remaining NaN filled with training set mean (prevents leakage)
  4. 4.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: hiddensize=64, layers=2, lr=2e-4, batch=64, posweight=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

python
import torch
import numpy as np

# Load GRU model
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()

# Predict on a patient's hourly data (T timesteps × 74 features)
with torch.no_grad():
    x = torch.tensor(patient_data, dtype=torch.float32).unsqueeze(0)  # (1, T, 74)
    logits = model(x)
    risk_scores = torch.sigmoid(logits).squeeze().numpy()
    # risk_scores[t] = P(sepsis onset at hour t)

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

  1. 1.van de Water et al. "Yet Another ICU Benchmark" (Nature Communications, 2023) — arxiv:2306.05109
  2. 2.Reyna et al. "Early Prediction of Sepsis from Clinical Data" (PhysioNet Computing in Cardiology Challenge, 2019)
  3. 3.Moor et al. "Early Prediction of Sepsis in the ICU Using Machine Learning" (Frontiers in Medicine, 2021) — arxiv:2107.05230