Skip to content

Latest commit

Β 

History

13 Commits

Folders and files

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

Repository files navigation

AtriaAI Banner

Stars Forks Issues License Status

🩺 AtriaAI β€” Intelligent Early Medical Diagnosis System

Web-based ML-powered assistant for early symptom assessment with bilingual (English/Urdu) support.


πŸ“‘ Table of Contents


🧠 Overview

AtriaAI helps patients perform an early self-assessment using symptoms and vitals (height, weight, BP, temperature). A trained ML model (model.pkl) runs on the server and returns a possible condition, confidence, and practical recommendations.

⚠️ AtriaAI does not replace clinical diagnosis. It is an assistive tool for awareness and timely consultation.


🎯 Objectives

  • Enable quick, simple self-checks via a clean, accessible UI.
  • Provide bilingual (English/Urdu) outputs with non-technical explanations.
  • Suggest precautions, home remedies, and exercise tips.
  • Trigger consultation alerts for red-flag scenarios.

βœ… Key Features

  • Auth & Profiles: Registration, login, profile management.
  • Vitals & Symptoms: Height, weight, BP, temperature, and free-text symptoms.
  • Real-time Inference: Flask loads model.pkl and predicts on submit.
  • Recommendations: OTC guidance, home remedies, and doctor alerts.
  • Bilingual UX: English and Urdu forms, labels, and results.
  • History & Logs: View past predictions per user.
  • Admin Dashboard: Users overview, audit, and basic model health.
  • MySQL-backed: Persistent storage for users and history.

🧩 Architecture

flowchart TD
    U[User Web or Mobile Client] -->|Forms and API requests| W[Flask Web Application]
    W --> AUTH[Authentication and Profiles]
    W --> V[Vitals and Symptom Input]
    V --> VAL[Validation and Preprocessing]
    VAL --> M[ML Inference Service<br/>model.pkl]
    M --> P[Prediction and Confidence]
    P --> R[Recommendation Engine]
    R --> F[Response Formatter<br/>English or Urdu]
    F --> UI[Dashboard and Prediction Result]

    W --> H[History and Audit Services]
    H --> DB[(MySQL Database)]
    AUTH --> DB
    H --> ADM[Admin Dashboard]
    ADM --> DB

    W --> SEC[Security Controls<br/>CSRF, RBAC, HTTPS, Secure Cookies]
Loading

The diagram reflects the documented Flask application, authentication and profiles, validated vitals/symptoms flow, model inference, bilingual response formatting, history, admin dashboard, MySQL persistence, and production security controls.


πŸ›  Tech Stack & Badges


πŸ–Ό Screenshots

Home page Registration form

Admin login Admin dashboard

Admin dashboard (light) Admin dashboard (dark)


πŸš€ Quickstart

1) Clone

git clone https://github.com/UsamaMatrix/Atria-AI.git
cd Atria-AI

2) Virtual Env

python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate

3) Install

pip install -r requirements.txt

4) Configure .env

FLASK_ENV=development
SECRET_KEY=change_this_secret
DB_HOST=127.0.0.1
DB_PORT=3306
DB_USER=atria_user
DB_PASSWORD=strong_password
DB_NAME=atria_db
DATABASE_URL=mysql+pymysql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}
MODEL_PATH=ml/model.pkl
DEFAULT_LANG=en
FALLBACK_LANG=en

5) DB Init (example)

python manage.py db upgrade

6) Run

flask --app app run --debug

πŸ”§ Configuration

  • Language: Default via DEFAULT_LANG; toggle per user in the profile.
  • Model: Configure the path with MODEL_PATH.
  • Security: Use a strong SECRET_KEY; enable HTTPS and secure cookies in production.

πŸ”Œ API Endpoints

Method Endpoint Description
GET / Health check / landing
GET /login Login form
POST /login Authenticate
GET /register Registration form
POST /register Create new user
GET /dashboard User dashboard
POST /predict Submit vitals and symptoms
GET /history Current user's prediction history
POST /logout End session

πŸ—‚ Project Structure

Atria-AI/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ routes.py
β”‚   β”œβ”€β”€ models.py
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ inference.py
β”‚   β”‚   └── recommend.py
β”‚   β”œβ”€β”€ i18n/
β”‚   β”‚   β”œβ”€β”€ en.json
β”‚   β”‚   └── ur.json
β”‚   β”œβ”€β”€ templates/
β”‚   └── static/
β”œβ”€β”€ assets/
β”œβ”€β”€ ml/
β”‚   β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ notebooks/
β”‚   β”œβ”€β”€ training.py
β”‚   └── model.pkl
β”œβ”€β”€ migrations/
β”œβ”€β”€ tests/
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .env.example
β”œβ”€β”€ manage.py
└── README.md

πŸ”’ Security & Privacy

  • Passwords: Hash and salt passwords.
  • CSRF: Protect forms with CSRF tokens.
  • Validation: Apply strict input validation.
  • Logs: Avoid PHI and redact sensitive fields.
  • RBAC: Restrict admin features.
  • Headers: Enforce HTTPS, HSTS, CSP, and secure cookies in production.

πŸ—Ί Roadmap

  • Symptom NLP (entities and negation handling)
  • Differential multi-condition outputs
  • Doctor directory and appointment integration
  • Model monitoring and drift detection
  • Dockerfile and CI/CD
  • PWA features and offline cache

🀝 Contributing

  1. Fork the repo.
  2. Create a feature branch.
  3. Commit with clear messages.
  4. Open a PR with context and screenshots.

πŸ“„ License

Licensed under the MIT License. See LICENSE.

⚠️ Disclaimer

AtriaAI provides informational guidance only and does not replace professional medical diagnosis, treatment, or advice. Always consult a qualified healthcare provider for serious or persistent symptoms.

πŸ—£ Urdu (اردو) Summary

AtriaAI ایک ویب بیسڈ Ψ³Ψ³ΩΉΩ… ہے جو ΨΉΩ„Ψ§Ω…Ψ§Ψͺ اور Ψ¨Ω†ΫŒΨ§Ψ―ΫŒ ΩˆΫŒΩΉΩ„Ψ² کی Ψ¨Ω†ΫŒΨ§Ψ― ΩΎΨ± Ψ§Ψ¨Ψͺدائی Ψ±ΫΩ†Ω…Ψ§Ψ¦ΫŒ فراہم Ϊ©Ψ±ΨͺΨ§ ہے۔ یہ ڈاکٹر Ϊ©Ψ§ Ω…ΨͺΨ¨Ψ§Ψ―Ω„ Ω†ΫΫŒΪΊ ہے۔

πŸ—‚ Assets Inventory

assets/
β”œβ”€β”€ banner/
β”‚   └── atriavai-banner.svg
└── screens/
    β”œβ”€β”€ login-light.png
    β”œβ”€β”€ login-dark.png
    β”œβ”€β”€ dashboard-patient-light.png
    β”œβ”€β”€ dashboard-patient-dark.png
    β”œβ”€β”€ dashboard-admin-light.png
    └── dashboard-admin-dark.png

About

🩺 AtriaAI β€” Intelligent Early Medical Diagnosis System using ML and Flask

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors