Skip to content

A Streamlit-based ML application that predicts heart disease risk using a highly optimized Random Forest model. Features a clean UI, real-time predictions, preset inputs, and a fully deployed live app for quick medical risk assessment.

Notifications You must be signed in to change notification settings

Priyanshu-302/Heart-Disease-Prediction-System

Repository files navigation

CardioGuard AI • Neural Diagnostic System 🫀

Python Streamlit Scikit-learn License

CardioGuard AI is a state-of-the-art heart disease prediction system powered by machine learning. It utilizes a Random Forest Classifier to analyze patient biometric data and provide a real-time risk assessment. The application features a futuristic, "Ultra Premium" user interface designed for clarity, engagement, and professional medical aesthetics.

✨ Key Features

  • 🤖 Advanced ML Engine: Powered by a robust Random Forest Classifier trained on clinical heart disease data.
  • 🎨 Futuristic UI/UX: Immersive interface with animated backgrounds, particle effects, and glassmorphism design.
  • 📊 Interactive Biometrics: Easy-to-use sliders and dropdowns for inputting patient data (Age, BP, Cholesterol, etc.).
  • ⚡ Real-time Analysis: Instant risk probability calculation with visual feedback.
  • 📈 Dynamic Visualizations:
    • Animated gauge charts for risk scoring.
    • Key health metrics dashboard.
    • Lottie animations for visual engagement.
  • 🔄 Auto-Healing: Automatically retrains the model if the model file is missing or incompatible.

🛠️ Tech Stack

📂 Project Structure

├── app.py                  # Main Streamlit application
├── train_model.py          # Model training script
├── heart.csv               # Dataset for training
├── model.joblib            # Trained Random Forest model
├── healthy_profile.joblib  # Reference profile for default values
├── requirements.txt        # Python dependencies
└── README.md               # Project documentation

🚀 Installation & Setup

  1. Clone the repository (or download the files):

    git clone <repository-url>
    cd heart-disease-prediction
  2. Create a virtual environment (optional but recommended):

    python -m venv venv
    # Windows
    venv\Scripts\activate
    # macOS/Linux
    source venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Train the Model (First Run): If model.joblib is missing, the app will attempt to train it automatically. You can also manually train it:

    python train_model.py

💻 Usage

  1. Run the application:

    streamlit run app.py
  2. Navigate the Interface:

    • Enter patient details in the Biometric Input section.
    • Adjust sliders for numerical values (Age, Blood Pressure, etc.).
    • Select options for categorical values (Chest Pain Type, ECG results, etc.).
  3. Analyze:

    • Click the ⚡ INITIATE ANALYSIS button.
    • View the Risk Probability gauge and detailed recommendation card.

⚠️ Medical Disclaimer

CardioGuard AI is a demonstration tool for educational and research purposes only.

  • It is NOT a substitute for professional medical advice, diagnosis, or treatment.
  • Always seek the advice of your physician or other qualified health provider with any questions you may have regarding a medical condition.
  • Do not disregard professional medical advice or delay in seeking it because of something you have read on this application.

© 2025 CardioGuard AI | Neural Diagnostic System

About

A Streamlit-based ML application that predicts heart disease risk using a highly optimized Random Forest model. Features a clean UI, real-time predictions, preset inputs, and a fully deployed live app for quick medical risk assessment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages