An advanced deep learning pipeline built to forecast chronic disease progression (Diabetes, Cardiovascular Risk, and Metabolic Stress) before critical onset. This project bridges the gap between raw clinical data and actionable business intelligence, enabling proactive healthcare interventions and targeted pharmaceutical marketing strategies.
For modern pharmaceutical marketing and sales teams, predicting patient trajectories is invaluable. This system demonstrates how raw vitals can be transformed into foresight:
- Targeted Outreach: Identifies pre-diabetic and high-CVD-risk demographics allowing for hyper-targeted educational campaigns and preventative care product marketing.
- Sales Strategy: Empowers sales teams to align product availability with forecasted regional health trends based on real-time data ingestion.
- Resource Allocation: Shifts the focus from reactive treatment to proactive care management.
This project implements a highly optimized multi-label Deep Learning model:
- Temporal Attention Mechanism: An advanced custom Keras layer that forces the LSTM network to focus on specific, critical visits (e.g., sudden spikes in BMI or LDL) rather than treating all historical data equally.
- Feature Trend Engineering (Deltas): The model dynamically calculates patient velocity (how fast vitals are changing), enabling the detection of pre-diabetes even when raw glucose levels appear stable.
- F1-Balanced Threshold Optimization: Instead of standard binary cutoffs, the system mathematically hunts for the optimal decision boundary for each specific disease, ensuring maximum sensitivity (Recall) without triggering false-alarm fatigue (Precision loss).
- Data Generation & Infrastructure: Synthea (Generating realistic EHR data) deployed via Docker to an isolated PostgreSQL instance.
- ETL & Data Engineering: Custom Python/Pandas pipelines (
etl_process.py) and complex SQL Views (analysis.sql) to clean, impute, and extract longitudinal patient timelines. - Deep Learning Engine: TensorFlow/Keras (
train_multilabel.py) utilizing LSTMs with Batch Normalization and Dropout for robust generalization.
Tested on thousands of unseen patient records, the production model achieved:
- CVD Risk: 93% Accuracy with balanced clinical thresholds.
- Metabolic Stress: 75%+ Accuracy with high sensitivity for early intervention.
- Diabetes (Critical): Maintained stable detection rates despite extreme class imbalance, prioritizing clinical safety over superficial accuracy.
- Ensure the PostgreSQL database is running via
docker-compose up -d. - Activate the virtual environment.
- Run the optimized training and evaluation pipeline:
python scripts/train_multilabel.py