An enterprise-grade, real-time Cardiac Clinical Decision Support System (CDSS). This project integrates machine learning with a professional dashboard to assist medical professionals in identifying high-risk cardiovascular patients based on clinical vitals.
The system utilizes an XGBoost Classifier, deployed via a high-performance FastAPI backend, and visualized through an advanced, intuitive Streamlit clinical suite.
- Clinical Risk Analysis: Calculates the probability of heart failure using multi-factor clinical inputs (Age, Blood Pressure, Cholesterol, etc.).
- Explainable AI (XAI) Dashboard: Features a Radar Chart (Vitals Profile Analysis) to visually represent patient health imbalances, allowing doctors to quickly identify which specific vitals are at risk.
- Real-time Inference: A robust API that processes patient vitals and returns risk probabilities in milliseconds.
- Professional Metrics: High-precision clinical monitoring with low False Positive rates.
The model was validated on a comprehensive dataset of cardiovascular vitals, achieving the following performance metrics:
| Metric | Score |
|---|---|
| Accuracy | 86.4% |
| Precision | 91.8% |
| Recall | 84.1% |
| F1-Score | 87.8% |
The model demonstrates high precision, minimizing false-alarm fatigue, which is critical for implementation in clinical environments.
The dashboard is designed to reduce cognitive load for medical staff:
- Patient Vitals Entry: Sidebar inputs for capturing precise clinical parameters.
- Calculated Risk Gauge: A visual representation of cardiac failure probability (0-100%).
- Vitals Profile Analysis (Radar Chart): Normalizes patient data to visualize the "shape" of the patient's health profile. An asymmetric polygon indicates an imbalance in critical health markers.
- Machine Learning: XGBoost Classifier trained on 11 critical cardiovascular features.
- Backend API: FastAPI server managing data validation and inference.
- Frontend Dashboard: Streamlit application featuring radar visualization and clinical risk assessment.
Heart_Failure_Prediction/
├── app/
│ ├── main.py # FastAPI backend
│ └── dashboard.py # Streamlit clinical UI
├── data/
│ ├── heart.csv # Raw dataset
│ └── dashboard_sample.csv # Processed sample data
├── models/
│ └── heart_failure_model.pkl # Serialized XGBoost model
├── notebooks/
│ └── 01_training_and_eda.ipynb # Pipeline
├── requirements.txt
└── README.md
1. Clone and Install:
git clone https://github.com/Arya-azimi/Heart-Failure-Prediction.git
cd Heart-Failure-Prediction
pip install -r requirements.txt2. Start Services:
- Backend:
cd app
uvicorn main:app --reload
- Frontend:
cd app
streamlit run dashboard.py
This project is licensed under the MIT License.