An intelligent healthcare research project that explores machine learning and deep learning techniques for identifying early signs of clinical deterioration in Intensive Care Unit (ICU) patients. The system uses patient time-series data, vital signs, and laboratory measurements to investigate early prediction of sepsis and other critical events.
The project explores XGBoost, LSTM, GRU, and attention-based deep learning approaches to analyze patient data and support research into early warning systems for critical care.
๐ Table of Contents
- Context
- Objectives
- Features
- Dataset
- System Architecture
- Methodology
- Technology Stack
- Project Structure
- Installation
- Dataset Preparation
- Running Experiments
- Models
- Evaluation
- Limitations
- Future Improvements
- Ethical Considerations
- Acknowledgements
- Author
๐ง Context
Sepsis is a life-threatening condition that can lead to organ dysfunction and death. Early recognition is particularly important in intensive care, where a patient's condition can deteriorate rapidly.
Traditional clinical monitoring relies on regularly measured vital signs, laboratory tests, and clinical assessment. Machine learning can help researchers investigate patterns in these measurements that may indicate an increased risk of deterioration.
The ICU Early Warning System explores predictive modeling using clinical time-series data. It combines conventional machine learning with recurrent neural network architectures to study patterns associated with sepsis and other critical ICU outcomes.
The project uses the Sepsis-3 framework to define sepsis labels based on suspected infection and an increase in the Sequential Organ Failure Assessment (SOFA) score.
Project goal: Explore data-driven approaches for identifying potential clinical deterioration earlier and evaluating their predictive performance.
๐ฏ Objectives
- Analyze clinical time-series data from ICU patients.
- Explore patterns in vital signs and laboratory measurements.
- Investigate sepsis prediction using machine learning.
- Compare gradient-boosting and recurrent neural network approaches.
- Apply data preprocessing, missing-value handling, and time-series preparation.
- Evaluate model performance through structured experiments.
- Develop a research foundation for future ICU early-warning applications.
โจ Features
- ๐ฅ ICU Data Analysis: Work with critical-care patient records and clinical measurements.
- ๐ Exploratory Data Analysis: Examine patient characteristics, clinical variables, and time-series patterns.
- ๐งน Data Preprocessing: Prepare clinical records for machine learning experiments.
- โฑ๏ธ Time-Series Processing: Organize sequential patient measurements for recurrent neural networks.
- ๐ค Machine Learning: Experiment with XGBoost-based predictive models.
- ๐ง Deep Learning: Explore recurrent neural network models, including LSTM and GRU architectures.
- ๐ฏ Attention-Based Modeling: Investigate attention mechanisms for sequential clinical data.
- โ๏ธ Hyperparameter Optimization: Run tuning experiments to explore model configurations.
- ๐ Visualization: Generate exploratory and model-evaluation plots.
- ๐ฌ Reproducible Experiments: Organize training and testing through dedicated experiment scripts.
These features describe the repository's research workflow; they do not imply that the project is a validated clinical monitoring or alerting product.
๐๏ธ Dataset
MIMIC-III Clinical Database
This project uses the MIMIC-III v1.4 critical-care database, which contains de-identified hospital and ICU records.
Dataset source: MIMIC-III on PhysioNet
The database contains clinical information such as:
- Patient demographics and hospital admissions.
- ICU admission and discharge information.
- Vital signs and physiological measurements.
- Laboratory test results.
- Medication and microbiology records.
- Clinical measurements collected over time.
Sepsis Labeling
The project follows a Sepsis-3-based labeling approach. Sepsis labels are derived from the temporal relationship between suspected infection and organ dysfunction.
The labeling process considers:
- Suspected infection: The timing of microbiology culture collection and antibiotic treatment.
- Organ dysfunction: An increase of at least two points in the SOFA score.
- Temporal alignment: The relationship between these events at the hourly level.
Correct labeling depends on the implementation details and the availability and quality of the source records.
Important: The dataset is not included in this repository. Access requires the appropriate PhysioNet credentials, completion of required training, and acceptance of the applicable data-use agreement.
๐๏ธ System Architecture
The research pipeline can be summarized as follows:
MIMIC-III Clinical Database
|
v
Data Extraction and Collection
|
v
Clinical Data Preprocessing
|
v
Missing-Value Handling
and Time-Series Preparation
|
v
Feature Engineering
|
v
Data Splitting
|
+----------------------+
| |
v v
XGBoost Model LSTM / GRU Model
| |
v v
Model Training and Hyperparameter Tuning
| |
+----------------------+
|
v
Model Evaluation
|
v
Results and VisualizationsThe diagram represents the overall research workflow. Exact processing steps and model configurations depend on the implementation in the source files.
๐ฌ Methodology
1. Clinical Data Collection
The pipeline uses clinical records derived from MIMIC-III. The records provide the measurements and timestamps required to construct patient-level and time-series datasets.
2. Data Preprocessing
Clinical data require preparation before modeling. The project includes preprocessing utilities for collecting records, transforming variables, handling missing values, and preparing model inputs.
3. Missing-Value Handling
Clinical measurements are not always recorded at uniform intervals. Preprocessing includes binning and imputation utilities to handle missing values in time-series data.
The choice of imputation method can affect model performance and must be considered during evaluation.
4. Feature Engineering
Clinical measurements are transformed into model-compatible features.
For XGBoost, time-series variables can be transformed into statistical or structured features. Recurrent neural networks use sequential inputs that preserve temporal information.
5. Model Training
The repository includes separate experiment workflows for gradient boosting and recurrent neural networks.
Hyperparameter tuning is used to investigate candidate model configurations before testing.
6. Model Evaluation
The trained models are evaluated using the available experimental workflow. Results should be interpreted using appropriate classification metrics, class imbalance considerations, and a clearly defined evaluation split.
No numerical performance claims are made here because the actual experiment results must be verified from the generated outputs.
๐ ๏ธ Technology Stack
| Component | Technology |
|---|---|
| Programming Language | Python |
| Data Analysis | Pandas, NumPy |
| Machine Learning | XGBoost |
| Deep Learning | LSTM, GRU, attention-based neural networks |
| Data Processing | Python preprocessing utilities |
| Experimentation | Custom training and experiment scripts |
| Exploratory Analysis | Jupyter Notebook |
| Visualization | Matplotlib and project visualization utilities |
| Dataset | MIMIC-III v1.4 |
| Clinical Labeling Framework | Sepsis-3 / SOFA |
The exact package versions and dependencies are defined in requirements.txt.
๐ Project Structure
ICU_Early_Warning_System_Presentation/
โ
โโโ configs/
โ โโโ Experiment configuration files
โ
โโโ models/
โ โโโ hyperparam_opt/
โ โโโ Hyperparameter optimization artifacts
โ
โโโ notebooks/
โ โโโ files_preview.ipynb
โ โโโ static_variables_eda.ipynb
โ โโโ time_series_eda.ipynb
โ
โโโ output/
โ โโโ Training, tuning, and evaluation outputs
โ
โโโ src/
โ โโโ experiments/
โ โ โโโ rnn_experiments.py
โ โ โโโ xgboost_experiments.py
โ โ
โ โโโ models/
โ โ โโโ Model implementation
โ โ
โ โโโ preprocessing/
โ โ โโโ bin_and_impute.py
โ โ โโโ collect_records.py
โ โ โโโ main_preprocessing.py
โ โ โโโ rnn_preprocessing.py
โ โ โโโ xgboost_preprocessing.py
โ โ โโโ util.py
โ โ
โ โโโ visualization/
โ โ โโโ plots.py
โ โ โโโ util.py
โ โ
โ โโโ train_rnn.py
โ โโโ train_xgboost.py
โ
โโโ requirements.txt
โโโ README.mdThis structure summarizes the repository's documented files. Some generated files and directories may be created during data preparation and experiments.
๐ Installation
Prerequisites
Make sure you have:
- Python 3.8 or a compatible Python environment for the original project dependencies.
- Git.
- PostgreSQL, if you intend to reproduce the original database extraction workflow.
- Authorized access to the MIMIC-III database.
- Sufficient storage for the database, processed datasets, and model outputs.
1. Clone the Repository
git clone https://github.com/saranshvaidya0/ICU_Early_Warning_System_Presentation.git
cd ICU_Early_Warning_System_Presentation2. Create a Virtual Environment
Windows:
python -m venv venv
venv\Scripts\activateLinux/macOS:
python3 -m venv venv
source venv/bin/activate3. Install Dependencies
python -m pip install --upgrade pip
pip install -r requirements.txtUse a compatible Python environment if any dependency is incompatible with your installed Python version.
๐ฅ Dataset Preparation
Step 1: Request Dataset Access
Visit the MIMIC-III PhysioNet page and complete the required credentialing and data-use procedures.
Step 2: Prepare the Database
Follow the official MIMIC Code Repository documentation to build the database using the supported PostgreSQL workflow.
Step 3: Extract and Preprocess Records
Follow the data-extraction workflow documented by the original project and its referenced research resources.
Prepare the processed datasets expected by the preprocessing and experiment scripts.
Note: Raw patient records are not included in this repository. The original research workflow also relies on external data-extraction resources, so installing Python dependencies alone may not be sufficient to reproduce the full pipeline.
โถ๏ธ Running Experiments
The repository provides separate experiment scripts for XGBoost and recurrent neural networks.
XGBoost Experiments
Hyperparameter tuning:
python3 ./src/experiments/xgboost_experiments.py tuningTesting:
python3 ./src/experiments/xgboost_experiments.py testRecurrent Neural Network Experiments
Hyperparameter tuning:
python3 ./src/experiments/rnn_experiments.py tuningTesting:
python3 ./src/experiments/rnn_experiments.py testTraining Entry Points
The repository also contains the following scripts:
python3 ./src/train_xgboost.py
python3 ./src/train_rnn.pyCheck the implementation and required arguments before running these training scripts. They may require prepared input datasets, configuration files, and trained or tuned model parameters.
๐ค Models
1. XGBoost
XGBoost is a gradient-boosting method used to investigate predictive patterns in structured clinical features.
Potential strengths include:
- Handling structured numerical features.
- Modeling nonlinear relationships.
- Supporting feature-importance analysis.
- Providing a useful comparison against deep learning approaches.
2. LSTM
Long Short-Term Memory networks are recurrent neural networks designed to model dependencies across sequential data.
In an ICU setting, LSTM models can learn temporal patterns in clinical measurements when supplied with appropriately prepared sequences.
3. GRU
Gated Recurrent Units provide an alternative recurrent architecture with a different gating design.
They can be investigated as an alternative to LSTM for learning temporal patterns in patient measurements.
4. Attention Mechanisms
Attention-based approaches can help a model assign different weights to information within a sequence, depending on the architecture and implementation.
Attention weights alone should not be interpreted as definitive clinical explanations.
๐ Evaluation
A reliable evaluation should consider more than overall accuracy, particularly when critical events are relatively uncommon.
Recommended metrics include:
| Metric | Purpose |
|---|---|
| Precision | Measures how many positive predictions are correct |
| Recall / Sensitivity | Measures how many actual positive cases are identified |
| F1-score | Balances precision and recall |
| AUROC | Measures ranking performance across classification thresholds |
| AUPRC | Evaluates precision-recall performance, especially with imbalanced classes |
| Confusion Matrix | Summarizes true and false predictions |
Evaluation should use an appropriate held-out test set and avoid patient overlap or temporal data leakage between training and testing.
Actual scores should be reported only after verifying the experiment outputs.
โ ๏ธ Limitations
- Model performance depends on data quality and preprocessing.
- Missing or irregularly collected clinical measurements can affect predictions.
- Sepsis labeling depends on the operational definition and timestamp alignment.
- Imbalanced outcome classes can make accuracy misleading.
- Performance on MIMIC-III may not generalize to other hospitals or patient populations.
- The repository does not, by itself, establish real-time hospital monitoring or deployment readiness.
- Clinical validation, external validation, calibration, and workflow evaluation are necessary before any real-world application.
๐ฎ Future Improvements
Potential areas for improvement include:
- Add a unified training and evaluation pipeline.
- Compare LSTM, GRU, XGBoost, and attention-based architectures systematically.
- Add model calibration and decision-threshold analysis.
- Improve missing-data handling and temporal feature engineering.
- Add explainability tools for model predictions.
- Create a dashboard for exploring research results.
- Add automated experiment tracking.
- Introduce patient-level validation and external validation.
- Add reproducible environment and data-preparation documentation.
- Evaluate alert frequency and false-alarm trade-offs.
- Investigate deployment only after appropriate clinical validation.
๐ฉบ Ethical Considerations
This project is intended for educational and research purposes.
- Patient data must be handled in accordance with the applicable PhysioNet data-use agreement.
- Do not upload protected patient information to public repositories.
- Do not commit raw patient records, credentials, or sensitive data.
- Predictions must not be used as a substitute for professional clinical judgment.
- Any future clinical deployment requires rigorous validation, privacy safeguards, and appropriate regulatory and institutional review.
Disclaimer: This project is not a certified medical device and must not be used to diagnose, treat, or make emergency-care decisions for real patients.
๐ Acknowledgements
This project acknowledges the contributions of the clinical research and open-source communities.
- MIMIC-III: PhysioNet
- MIMIC Code Repository: MIT Laboratory for Computational Physiology
- Sepsis Prediction Research: Moor et al., Early Recognition of Sepsis with Gaussian Process Temporal Convolutional Networks and Dynamic Time Warping (2019).
- MIMIC-III Publication: Johnson et al., MIMIC-III, a freely accessible critical care database (2016).
Please consult the original publications and dataset terms when using the associated data or research methods.
๐จโ๐ป Author
Saransh Vaidya
- GitHub: @saranshvaidya0
- Project Repository: ICU Early Warning System Presentation
โญ If you find this project useful for learning or research, consider starring the repository.
Built for healthcare AI research, machine learning experimentation, and early-warning system development.