A machine-learning-based clinical decision-support system that estimates a patient's cardiovascular risk from routinely measured clinical parameters and presents it in an interpretable, clinician-oriented interface.
Built as a graduation project (Grand Project II), Manisa Celal Bayar University, Department of Computer Engineering.
⚠️ Decision-support prototype — not a diagnostic device. Intended to support, never to replace, clinical judgement.
Most cardiovascular risk tools stop at either a research notebook or an isolated calculator. Cardia does both halves: it trains and validates a model and ships it inside a working application that manages patients, records assessments and produces printable clinical reports — with no server, no database and no network connection required.
The trained model runs entirely in the browser: its coefficients are embedded directly in the application, so inference is pure arithmetic on the client.
- 🔐 Password-protected sign-in — per-clinician private patient records (salted password hashing, no plaintext storage)
- 👥 Patient management — add, edit and delete patient records with derived age and MRN
- 🩺 Structured assessment workflow — measured vitals pre-filled from the last visit but editable, grouped comorbidity selection, lifestyle and diet
- 📊 Visual risk result — animated gauge, Low / Moderate / High banding, contributing factors, and a transparent base-risk → adjustment → final-risk breakdown
- 📄 Printable clinical report — save as PDF, with measurements, categories, comorbidities and signature lines
- 🧠 In-app Model & Performance page — dataset summary, six-model comparison, cross-validation results and the risk-engine design
- 💻 Three delivery targets — standalone HTML, installable desktop app (Electron), installable mobile app (PWA, works offline)
Six supervised algorithms were trained and compared on a held-out test set (80/20 stratified split, standardised features).
| Model | Accuracy | Precision | Recall | F1 | ROC-AUC |
|---|---|---|---|---|---|
| Gradient Boosting | 73.63% | 76.00% | 68.26% | 71.92% | 0.8078 |
| Random Forest | 73.42% | 76.82% | 66.27% | 71.16% | 0.8068 |
| Logistic Regression ✅ deployed | 73.21% | 76.23% | 66.62% | 71.10% | 0.7973 |
| SVM | 73.10% | 76.40% | 66.02% | 70.83% | 0.7931 |
| Decision Tree | 72.57% | 74.98% | 66.86% | 70.69% | 0.7867 |
| KNN | 71.08% | 71.94% | 68.11% | 69.97% | 0.7630 |
5-fold cross-validation (deployed model): ROC-AUC 0.791 ± 0.005
The best ensemble beats it by only ~0.01 ROC-AUC — negligible for an individual prediction. In exchange, logistic regression is fully interpretable and compact enough to be embedded directly in the application, so risk is computed locally with no server, database or network call. A deliberate trade of negligible discrimination for interpretability and portability.
The training dataset contains no comorbidity fields, so they cannot be learned directly. Following the rationale of established calculators such as QRISK3, Cardia keeps the statistical and clinical layers separate and transparent:
Measured clinical features
│
▼
1. Base model risk Logistic Regression → probability (0–1)
│
▼
2. Clinical adjustment base odds × evidence-informed multipliers
│ (comorbidities, history, diet)
▼
3. Adjusted risk final probability + Low / Moderate / High band
Both the base risk and the applied multipliers are shown to the user, so the reasoning behind a result is always visible.
Open app/index.html in any modern browser. That's it — the whole application is a
single self-contained file.
Requires Node.js (LTS).
cd desktop
npm install
npm start # run it
npm run dist # build an installer (dist/)Reports are exported straight to PDF using Electron's native print-to-PDF.
On Windows you can also just double-click desktop/Cardia (Masaüstü).bat — it opens the
app in a clean, chrome-less window with no installation at all.
Host the web/ folder on any static host (Netlify Drop, GitHub Pages, …), open the URL
on a phone, then:
- iOS (Safari): Share → Add to Home Screen
- Android (Chrome): ⋮ → Install app
It installs with its own icon, opens full-screen and works offline after the first load.
| Clinician | Password |
|---|---|
| Dr. Sarah Chen | doctor123 |
| Dr. James Okafor | doctor123 |
New accounts can be created from the sign-in screen.
├── app/ Standalone single-file web application
├── desktop/ Electron wrapper (main process, preload bridge, build config)
├── web/ Progressive Web App bundle (manifest, service worker, icons)
├── notebook/ Jupyter notebook — data prep, model training and comparison
└── docs/ Project report
Cardiovascular Disease dataset (Kaggle) — 70,000 records, reduced to 68,634 after removing physiologically implausible values.
Twelve features: age, sex, height, weight, systolic and diastolic blood pressure, cholesterol, glucose, smoking, alcohol and physical activity, plus two engineered features — BMI and pulse pressure. Classes are roughly balanced (~50/50).
The dataset itself is not redistributed here; download it from the link above and place
cardio_train.csv next to the notebook to reproduce the training.
Stated openly, since they define the boundary between this prototype and a clinical product:
- Architecture — data lives client-side in
localStorage; there is no server or real database. A production version would use a proper database, server-side authentication and encrypted storage. - Security — password hashing here is prototype-grade; production would use bcrypt or Argon2 with server-side session management.
- Clinical multipliers — literature-based, not learned from data, because the dataset lacks those variables.
- Validation — trained and validated on a single dataset. Probability calibration and external validation on an independent population were not performed.
- Regulatory — a real deployment would fall under medical-device software regulation (IEC 62304, ISO 14971) and data-protection law (KVKK, GDPR).
Modelling: Python · pandas · NumPy · scikit-learn Application: HTML5 · CSS · vanilla JavaScript (no framework) · SVG Packaging: Electron · electron-builder · PWA (manifest + service worker)
Ahmet Burak Güvercin Manisa Celal Bayar University — Department of Computer Engineering Advisor: Dr. Öğr. Üyesi Gamze Türkmen
MIT