End-to-end explainable ML pipeline predicting neonatal sepsis 6 hours before clinical onset — XGBoost + LSTM ensemble on 40,000+ NICU time-series records from MIMIC-III.
Neonatal sepsis is a leading cause of mortality in ICU settings. Early detection is hindered by severe class imbalance, noisy time-series data, and the need for clinically interpretable predictions. This project builds an explainable ensemble framework that predicts sepsis onset 6 hours ahead of clinical diagnosis.
MIMIC-III NICU Time-Series (40K+ records)
│
▼
┌──────────────────────────┐
│ Preprocessing │ ← layered imputation, outlier handling,
│ │ temporal feature extraction
└────────────┬─────────────┘
│
┌──────┴──────┐
▼ ▼
┌──────────┐ ┌───────────────┐
│ XGBoost │ │ LSTM (PyTorch)│
│ Tabular │ │ Time-series │
│ Lab Feats│ │ Temporal Decay│
└────┬─────┘ └──────┬────────┘
└────────┬───────┘
▼
┌─────────────────┐
│ Ensemble Layer │ ← probability fusion
└────────┬────────┘
▼
┌─────────────────┐
│ SHAP / LIME │ ← per-patient clinical explanations
└────────┬────────┘
▼
Sepsis Risk Score
+ Feature Attributions
- LSTM captures temporal decay patterns in vitals and lab trends over time
- XGBoost handles tabular lab features (WBC, CRP, lactate, etc.) with non-linear interactions
- SMOTE applied to address severe class imbalance in NICU sepsis labels
- SHAP + LIME provide feature-level explanations for each patient prediction — critical for clinical trust
Primary metric: AUROC — chosen over accuracy due to severe class imbalance in clinical data
AUROC 0.921 is comparable to specialist-physician performance on the held-out test set.
sepsis-prediction/
├── sepsis_model.ipynb # Full pipeline: EDA, preprocessing, training, evaluation
├── training/ # Model training scripts
├── models/ # Saved model artifacts
├── evaluation/ # Metrics, curves, SHAP plots
├── utils/ # Feature engineering, SMOTE, imputation helpers
├── scripts/ # Data processing and inference scripts
├── config/ # Hyperparameter configs
├── data/ # Data loading utilities
├── docs/ # Architecture and methodology notes
├── requirements.txt
└── README.md