Skip to content
This repository was archived by the owner on Sep 22, 2025. It is now read-only.

Conversation

@pasanweerawardana
Copy link
Contributor

📌 Summary

This PR introduces two major contributions to the Guardian Monitor AI module:

A robust data generation framework for synthetic patient monitoring.

A complete model formation pipeline covering data preparation, feature engineering, exploratory analysis, baseline models, and an advanced LSTM sequence model.

Together, these form a reproducible end-to-end workflow for generating, preparing, and modeling patient health and risk alert data.

🔹 Key Additions

  1. Data Generation (Data_generation_code.ipynb)

Generates realistic multi-day patient datasets with 10-minute monitoring intervals.

Includes vitals (HR, SpO₂, BP, temperature, resp. rate), wearable signals (steps, accelerometer), and contextual features (activity level, meals, emotions).

Built-in rule-based logic for risk_alert labels, capturing anomalies (e.g., high HR, low SpO₂, abnormal meal/emotion effects).

Produces modular CSV batches for scalable experimentation.

  1. Model Formation (Model_fomation_with_all_steps.ipynb)

EDA: Distribution checks, correlation analysis, and anomaly detection.

Feature Engineering: Rolling statistics (5-min, 60-min), HRV, step variability, and meal effects.

Data Prep: Scaling, encoding, and patient-level train/test split to avoid leakage.

Baseline Models: Logistic Regression and Random Forest with feature importance analysis.

Advanced Model: LSTM sequence model trained on 10-minute windows (~2 hours context).

Achieved ROC-AUC = 1.0 and PR-AUC ≈ 0.9999 on test data.

Very low false positives/negatives (≈ 4 misclassifications out of ~2000 samples).

Visualization: Training curves (loss, AUC, precision/recall), ROC/PR plots, and confusion matrix heatmap.

🔹 Why This Matters

Establishes a realistic, reproducible dataset for training/testing.

Provides a baseline-to-advanced modeling pipeline for Guardian Alert System development.

Lays the foundation for future experimentation (e.g., longer sequences, CNN-LSTM hybrids, real-time API integration).

✅ Next Steps

Extend generation to larger patient cohorts and longer monitoring periods.

Test alternative architectures (GRU, CNN-LSTM, Transformer).

Integrate trained models into the Guardian Alert System API for real-time monitoring.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant