Skip to content

Repository files navigation

🩺 NEO SEPSIS — Early Neonatal Sepsis Detection

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.

Python PyTorch XGBoost scikit-learn Pandas

AUROC Dataset Domain


Overview

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.

Property Details
MIMIC-III — 40,000+ NICU patient time-series records
Binary classification: sepsis onset within 6h window
Risk probability + SHAP/LIME per-patient explanation
0.921 — comparable to specialist-physician performance

Model Pipeline

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

Key Design Decisions

  • 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

Evaluation

Primary metric: AUROC — chosen over accuracy due to severe class imbalance in clinical data

AUROC Precision Recall F1 Score

AUROC 0.921 is comparable to specialist-physician performance on the held-out test set.


Repository Structure

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

Tech Stack

Python PyTorch XGBoost scikit-learn Pandas NumPy


Author

Kriti Raj — B.Tech CSE (AI/ML), KIIT University

GitHub LinkedIn

About

Early sepsis detection using ML classification — clinical data pipeline with accuracy evaluation

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages