Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

AI-Based Prediction of Cardiovascular Risk Using Retinal Eye Images & Clinical Biometrics

An end-to-end healthcare machine learning platform designed for early, non-invasive risk stratification of Cardiovascular Disease (CVD). By synthesizing clinical biometric indicators with retinal microvasculature analysis, this system delivers predictive risk assessment to aid clinicians in early screening and decision support.


📌 Table of Contents

  1. Project Overview
  2. Key Features
  3. System Architecture & Technical Workflow
  4. Dataset & Feature Schema
  5. Model Pipeline & Evaluation
  6. Directory Structure
  7. Installation & Setup Guide
  8. Usage & Execution
  9. Live Demo
  10. Future Roadmap
  11. Contributions & Credits
  12. Conclusion
  13. Contact Information

🔬 Project Overview

Cardiovascular diseases (CVDs) remain the leading cause of mortality worldwide. Conventional diagnostic screening relies heavily on invasive blood tests and complex clinical evaluations.

This project establishes a non-invasive risk assessment platform that analyzes patient lifestyle metrics, metabolic biomarkers, and retinal vessel morphology. Retinal microvasculature serves as a direct, non-invasive window into systemic vascular health, enabling early identification of subclinical cardiovascular changes before severe symptoms manifest.

  • Phase 1 (Baseline Engine): Ingestion of clinical biometrics, comprehensive exploratory data analysis (EDA), feature engineering, and benchmarking tree-based classifiers (XGBoost, Random Forest) alongside Scikit-Learn pipelines.
  • Phase 2 (Computer Vision & Web Integration): Integration of deep learning segmentation models for retinal fundus images and web-based interface deployment.

✨ Key Features

  • 🩺 Multi-Modal Risk Stratification: Computes cardiovascular risk probability by combining systemic physiological metrics and optical vascular indicators.
  • 📊 Feature Correlation Engine: Uncovers statistical dependencies across systolic/diastolic blood pressure, glucose levels, cholesterol profiles, and target outcomes.
  • ⚡ Benchmarked Classification: Utilizes tuned XGBoost and Ensemble Machine Learning pipelines for high sensitivity and specificity in risk prediction.
  • 🚀 Modular Architecture: Clean separation of data processing, model training, evaluation metrics, and API routes to ensure maintainability.
  • 🌐 Web Deployment: Integrated web front-end hosted on Vercel for real-time patient assessment.

⚙️ System Architecture & Technical Workflow

[ Patient Data / Biometrics ] ──┐
                               ├──> [ Preprocessing & Scaling ] ──> [ XGBoost / ML Engine ] ──┐
[ Retinal Image Fundus Data ] ──┘                                                               ├──> [ Risk Stratification Output ]
                                                                 [ Web Dashboard UI ] ─────────┘

  1. Data Ingestion & Cleaning: Ingests structured clinical biometrics and raw fundus images. Handles missing values, performs outlier removal, and normalizes numeric distributions.
  2. Exploratory Data Analysis (EDA): Generates correlation heatmaps, feature density distributions, and statistical tests to validate feature relevance.
  3. Feature Engineering & Transformation: Implements standard scaling, categorical encoding, and feature interaction terms (e.g., Pulse Pressure = Systolic - Diastolic).
  4. Model Training & Hyperparameter Tuning: Trains multiple candidate classifiers (XGBoost, Scikit-Learn algorithms) using cross-validation and grid search.
  5. Inference & UI Rendering: Serves predicted risk scores, confidence intervals, and risk categories via a Flask/Python web application deployed on Vercel.

📊 Dataset & Feature Schema

The tabular diagnostic pipeline processes structured patient vectors across four core metadata categories:

Category Feature Name Description Type / Unit
Demographics age Patient Age Numerical (Years)
Demographics gender Biological Sex Categorical (Male/Female)
Clinical Biomarkers ap_hi Systolic Blood Pressure Numerical ($\text{mmHg}$)
Clinical Biomarkers ap_lo Diastolic Blood Pressure Numerical ($\text{mmHg}$)
Clinical Biomarkers cholesterol Serum Cholesterol Level Ordinal (1: Normal, 2: Above Normal, 3: High)
Clinical Biomarkers gluc Fasting Glucose Level Ordinal (1: Normal, 2: Above Normal, 3: High)
Lifestyle Markers smoke Tobacco Consumption Status Binary (0: No, 1: Yes)
Lifestyle Markers alco Alcohol Consumption Status Binary (0: No, 1: Yes)
Lifestyle Markers active Physical Activity Index Binary (0: Inactive, 1: Active)
Target Vector cardio Cardiovascular Disease Presence Binary (0: Absent, 1: Present)

🛠️ Tech Stack & Frameworks

  • Language: Python 3.8+
  • Data Processing & Analytics: NumPy, Pandas
  • Visualization: Matplotlib, Seaborn
  • Machine Learning & Modeling: Scikit-Learn, XGBoost
  • Environment & Versioning: Jupyter Notebooks, Git, GitHub Actions
  • Web Serving & Hosting: Flask, Vercel

📂 Directory Structure

CVD-Major-prj/
│
├── .github/
│   └── workflows/          # CI/CD automated build pipelines
├── datasets/               # Raw, interim, and preprocessed datasets
├── notebooks/              # Jupyter notebooks for statistical EDA & experimental training
├── src/                    # Modular source code
│   ├── preprocessing.py    # Data cleaning and scaling functions
│   ├── train.py            # Model training pipelines
│   └── evaluate.py         # Metrics calculations and ROC-AUC generation
├── Code_model/             # Trained serialization artifacts (.pkl / .json)
├── app.py                  # Main web application entry point
├── requirements.txt        # Environment package dependencies
└── README.md               # System documentation


🚀 Installation & Setup Guide

Prerequisites

  • Python 3.8 or higher installed on your system.
  • Git installed for version control.

Step 1: Clone the Repository

git clone https://github.com/StudentCoderr/CVD-Major-prj.git
cd CVD-Major-prj

Step 2: Create & Activate Virtual Environment

  • Linux / macOS:
python3 -m venv venv
source venv/bin/activate
  • Windows (Command Prompt):
python -m venv venv
venv\Scripts\activate
  • Windows (PowerShell):
python -m venv venv
.\venv\Scripts\Activate.ps1

Step 3: Install Dependencies

pip install --upgrade pip
pip install -r requirements.txt

💻 Usage & Execution

Running Exploratory Data Analysis & Notebooks

Launch Jupyter Notebook to view data analysis experiments and baseline evaluations:

jupyter notebook notebooks/

Launching the Web Application Locally

Start the Flask application server:

python app.py

Open your browser and navigate to [http://127.0.0.1:5000/](http://127.0.0.1:5000/).


🌐 Live Demo

Access the active deployment here: 👉 Cardiovascular Risk Assessment Platform - Live Demo


🗺️ Future Roadmap

  • Retinal Fundus Image Deep Learning Integration: Implement PyTorch/TensorFlow Convolutional Neural Networks (CNN) for automated optic disc and microvessel segmentations.
  • Explainable AI (XAI): Incorporate SHAP (SHapley Additive exPlanations) and LIME to provide interpretable feature impact maps for clinicians.
  • Automated PDF Diagnostic Reports: Generate downloadable patient risk summaries with biometric breakdowns.
  • EHR/FHIR Integration: Support standardized electronic health record data imports.

👥 Contributions & Credits

This project was developed within a collaborative structure.

  • Principal Developer: Poornashree J P (@StudentCoderr) — Responsible for over 80% of total system design, data engineering pipelines, feature engineering, ML algorithm training, and frontend web integration.
  • Hybrid Workflow: Built utilizing domain knowledge in machine learning coupled with AI-assisted software engineering practices for accelerated code prototyping and testing.

📝 Conclusion

Phase 1 of the Cardiovascular Disease Prediction System establishes a benchmark for non-invasive clinical risk assessment using tabular patient biometrics. By identifying key correlations between blood pressure metrics, lipid profiles, lifestyle attributes, and disease incidence, the platform lays the technical baseline required for integrating computer vision capabilities and retinal eye image analysis in upcoming releases.


📬 Contact Information

For inquiries, research collaborations, or feedback, feel free to connect:

About

An AI-driven healthcare platform for cardiovascular disease (CVD) risk assessment using patient clinical biometrics and retinal eye image analysis. Built with Scikit-Learn, XGBoost, and Python to perform non-invasive early risk stratification and feature correlation.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages