HeartGuardAI is designed to assist in the early detection of heart disease by leveraging machine learning models.
The goal is to provide a simple, accurate, and accessible tool for predicting the likelihood of heart disease based on patient data.
The project aims to support preventive healthcare and reduce diagnostic delays.
HeartGuardAI uses a trained deep learning model to predict whether a patient is likely to have heart disease.
It processes key health parameters such as age, cholesterol levels, and blood pressure, then delivers predictions through an easy-to-use Streamlit web interface.
This project demonstrates the complete ML pipeline from data preprocessing to deployment.
- Loaded heart disease dataset from UCI Machine Learning Repository.
- Checked for missing/null values and handled inconsistencies.
- Encoded categorical variables into numerical format.
- Normalized and scaled features using StandardScaler from
scikit-learn. - Split dataset into 80% training and 20% testing sets for model evaluation.
Tested multiple classification models:
- Logistic Regression
- Random Forest Classifier
- Support Vector Machine (SVM)
- Decision Tree Classifier
- K-Nearest Neighbors (KNN)
- Gradient Boosting Classifier
- Deep Neural Network (✅ Best Performer)
Final Model:
- Architecture: 3 Dense layers with ReLU activation and Dropout layers to prevent overfitting
- Output Layer: Sigmoid activation for binary classification
- Optimizer: Adam
- Loss: Binary Crossentropy
- Saved using
.kerasformat for deployment andjoblibfor the scaler.
- Accuracy: 0.86 on the test set
- Precision: 0.84
- Recall: 0.87
- F1-Score: 0.85
- Confusion matrix visualized for better understanding of model performance.
- Built an interactive Streamlit web app for local deployment.
- User inputs health data through sliders and dropdowns.
- Data is scaled using the saved
StandardScalerbefore prediction. - Model predicts and displays results instantly with a clear "Heart Disease Detected" or "No Heart Disease Detected" message.
- Ready to be deployed on platforms like Streamlit Cloud or Heroku for global access.
Programming Language:
- Python
Libraries & Frameworks:
- Data Preprocessing & Analysis: pandas, numpy, scikit-learn
- Visualization: matplotlib, seaborn
- Model Building: tensorflow, keras
- Deployment: streamlit
- Model Persistence: joblib
HeartGuardAI/
├── Dataset/ # Folder containing the dataset
│ └── heart.csv # Main dataset used for training the model
├── .gitignore # Prevents Git from tracking unnecessary files
├── Heart_Disease_Prediction.ipynb # Jupyter notebook for model training & evaluation
├── LICENSE # Allows reuse, with attribution, no warranty
├── README.md # Project documentation
├── app.py # Streamlit app for deployment
├── model.keras # Saved trained model
├── requirements.txt # Python dependencies
└── scaler.pkl # Saved StandardScaler for preprocessing
- Predicts heart disease likelihood from 13 health parameters.
- Real-time prediction via a simple web interface.
- Fast and lightweight for local execution.
- Visualization of dataset patterns and model performance.
- Predicts heart disease likelihood from 13 health parameters.
- Real-time prediction via a simple web interface.
- Fast and lightweight for local execution.
- Visualization of dataset patterns and model performance.
This project is licensed under the MIT License.
Thanks for visiting ! Feel free to explore my other repositories and connect with me. 🚀