Skip to content

About

🚨 AI-Powered Emergency Triage & Cardiac Risk Prediction System β€” Windows desktop app built with C# that uses Machine Learning to predict patient emergency severity and cardiac crisis risk in real time.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

EmergencyX

🚨 EmergencyX

AI-Powered Emergency Triage & heart attack Prediction System

Platform Language Framework ML License Status

EmergencyX is an intelligent desktop application that leverages Machine Learning to revolutionize patient triage in emergency departments β€” predicting emergency severity levels and cardiac arrest risk in real time.


πŸ“‹ Table of Contents


🌟 Overview

EmergencyX addresses one of the most critical challenges in emergency medicine β€” speed and accuracy of triage. Every second counts in an emergency, and misclassifying a patient's severity can be fatal.

By combining a modern Windows desktop UI with a trained Machine Learning backend, EmergencyX empowers medical staff to:

  • Instantly assess emergency severity for incoming patients
  • Predict cardiac arrest risk based on vital signs and clinical data
  • Prioritize patients with confidence backed by data-driven AI

This project demonstrates the real-world integration of C# desktop development with ML-based predictive modeling.


✨ Key Features

Feature Description
πŸ₯ Smart Triage Predicts emergency level (1–5 scale) based on patient vitals & symptoms
❀️ Cardiac Risk Prediction Detects risk of cardiac crisis using clinical indicators
πŸ€– ML Integration C# frontend communicates with trained ML model for real-time inference
πŸ–₯️ Desktop Application Native Windows app β€” fast, offline-capable, no browser needed
πŸ“Š Instant Results Predictions displayed within milliseconds of data entry
🎯 Dual Module System Two independent prediction modules in one unified interface

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    EmergencyX Desktop App                    β”‚
β”‚                        (C# / .NET)                           β”‚
β”‚                                                             β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚   β”‚   Module 1          β”‚   β”‚   Module 2              β”‚    β”‚
β”‚   β”‚   Emergency Triage  β”‚   β”‚   Cardiac Crisis        β”‚    β”‚
β”‚   β”‚   (Patient Input)   β”‚   β”‚   Prediction            β”‚    β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚            β”‚                             β”‚                  β”‚
β”‚            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β”‚
β”‚                       β”‚                                     β”‚
β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”                            β”‚
β”‚              β”‚  ML Bridge      β”‚                            β”‚
β”‚              β”‚  (API / .NET)   β”‚                            β”‚
β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚     ML Model Backend        β”‚
          β”‚  (ML.NET / Python / ONNX)   β”‚
          β”‚                            β”‚
          β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
          β”‚  β”‚ Triage   β”‚ β”‚ Cardiac  β”‚ β”‚
          β”‚  β”‚ Model    β”‚ β”‚ Model    β”‚ β”‚
          β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“¦ Modules

πŸ₯ Module 1 β€” Emergency Triage Prediction

The triage module accepts patient data and classifies the emergency level using a trained classification model.

Input Parameters:

  • Age, Gender
  • Chief complaint / Symptoms
  • Vital signs (Heart Rate, Blood Pressure, Oβ‚‚ Saturation, Temperature, Respiratory Rate)
  • Consciousness level (GCS)
  • Pain score (0–10)

Output:

  • Emergency Level: Level 1 (Resuscitation) β†’ Level 5 (Non-Urgent)
  • Confidence score (%)
  • Recommended action

❀️ Module 2 β€” Cardiac Crisis Prediction

The cardiac module analyzes clinical indicators to assess the risk of an acute cardiac event.

Input Parameters:

  • Age, Gender, BMI
  • Chest pain type & duration
  • ECG findings
  • Cardiac biomarkers (Troponin, CK-MB)
  • Blood pressure, Cholesterol
  • History of diabetes, hypertension, smoking

Output:

  • Risk Level: Low / Moderate / High / Critical
  • Probability score (%)
  • Alert flag for immediate intervention

πŸ› οΈ Tech Stack

Frontend (Desktop UI)
β”œβ”€β”€ Language       : C# (.NET 6 / .NET Framework)
β”œβ”€β”€ UI Framework   : Windows Forms / WPF
└── IDE            : Visual Studio 2022

Machine Learning Backend
β”œβ”€β”€ ML Framework   : ML.NET  ──or──  Python (scikit-learn / XGBoost)
β”œβ”€β”€ Model Format   : .ZIP (ML.NET)  ──or──  .pkl / .onnx (Python)
β”œβ”€β”€ Integration    : REST API (Flask)  ──or──  Direct ML.NET call
└── Training Data  : Emergency & Cardiac clinical datasets

Communication Layer
β”œβ”€β”€ If Python ML   : HTTP REST API (localhost Flask server)
└── If ML.NET      : Direct in-process model loading

βš™οΈ Installation

Prerequisites

  • Windows 10 / 11 (64-bit)
  • .NET 6.0 Runtime or higher
  • Python 3.8+ (only if using Python ML backend)
  • Visual Studio 2022 (for development)

Clone the Repository

git clone https://github.com/YOUR_USERNAME/EmergencyX.git
cd EmergencyX

Setup β€” C# Application

# Open solution in Visual Studio
start EmergencyX.sln

# Or build via CLI
dotnet restore
dotnet build
dotnet run

Setup β€” Python ML Backend (if applicable)

cd MLBackend
pip install -r requirements.txt
python app.py

The Flask server will start on http://localhost:5000 and the C# app will connect automatically.


πŸš€ How to Use

1. Launch the Application

Run EmergencyX.exe from the bin/Release folder or press F5 in Visual Studio.

2. Select a Module

Choose between Emergency Triage or Cardiac Crisis Prediction from the main dashboard.

3. Enter Patient Data

Fill in the patient's clinical information in the structured form.

4. Run Prediction

Click "Analyze" β€” the ML model processes the input and returns results instantly.

5. Review Results

View the predicted severity level, confidence score, and recommended clinical action.


πŸ€– ML Model Details

Property Triage Model Cardiac Model
Type Multi-class Classification Binary / Multi-class Classification
Algorithm Random Forest / XGBoost Logistic Regression / Neural Net
Output Classes 5 Emergency Levels 4 Risk Levels
Input Features ~10 clinical features ~12 clinical features
Model Format .zip (ML.NET) / .pkl .zip (ML.NET) / .pkl

πŸ“ Project Structure

EmergencyX/
β”‚
β”œβ”€β”€ EmergencyX/                   # Main C# Application
β”‚   β”œβ”€β”€ Forms/
β”‚   β”‚   β”œβ”€β”€ MainDashboard.cs      # Main window
β”‚   β”‚   β”œβ”€β”€ TriageForm.cs         # Module 1 UI
β”‚   β”‚   └── CardiacForm.cs        # Module 2 UI
β”‚   β”œβ”€β”€ Models/
β”‚   β”‚   β”œβ”€β”€ PatientData.cs        # Patient data model
β”‚   β”‚   └── PredictionResult.cs   # Result model
β”‚   β”œβ”€β”€ Services/
β”‚   β”‚   β”œβ”€β”€ MLService.cs          # ML model communication
β”‚   β”‚   └── ApiService.cs         # REST API client (if Python)
β”‚   └── EmergencyX.csproj
β”‚
β”œβ”€β”€ MLBackend/                    # Python ML Backend (optional)
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ triage_model.pkl
β”‚   β”‚   └── cardiac_model.pkl
β”‚   β”œβ”€β”€ app.py                    # Flask API server
β”‚   β”œβ”€β”€ train_triage.py           # Model training script
β”‚   β”œβ”€β”€ train_cardiac.py          # Model training script
β”‚   └── requirements.txt
β”‚
β”œβ”€β”€ MLModels/                     # ML.NET Models (alternative)
β”‚   β”œβ”€β”€ TriageModel.zip
β”‚   └── CardiacModel.zip
β”‚
β”œβ”€β”€ Screenshots/                  # App screenshots
β”œβ”€β”€ README.md
β”œβ”€β”€ .gitignore
└── LICENSE

πŸ“Έ Screenshots

Dashboard Triage Module Cardiac Module
Dashboard Triage Cardiac

πŸ“„ .gitignore

# Visual Studio
.vs/
bin/
obj/
*.user
*.suo

# Python
__pycache__/
*.pyc
*.pyo
.env
venv/
*.pkl         # optional: ignore trained models if large

# ML.NET models (if large, use Git LFS instead)
# *.zip

# OS
.DS_Store
Thumbs.db
*.log

🀝 Contributing

Contributions, issues and feature requests are welcome!

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/AmazingFeature
  3. Commit your changes: git commit -m 'Add AmazingFeature'
  4. Push to the branch: git push origin feature/AmazingFeature
  5. Open a Pull Request

πŸ‘€ Author

Ahmad Albasha

GitHub LinkedIn Email


πŸ“œ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


⭐ If you find this project useful, please consider giving it a star!

Built with ❀️ to save lives through technology

About

🚨 AI-Powered Emergency Triage & Cardiac Risk Prediction System β€” Windows desktop app built with C# that uses Machine Learning to predict patient emergency severity and cardiac crisis risk in real time.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages