Web-based ML-powered assistant for early symptom assessment with bilingual (English/Urdu) support.
- Overview
- Objectives
- Key Features
- Architecture
- Tech Stack & Badges
- Screenshots
- Quickstart
- Configuration
- API Endpoints
- Project Structure
- Security & Privacy
- Roadmap
- Contributing
- License
- Disclaimer
- Urdu (اردو) Summary
- Assets Inventory
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 with precautions, OTC suggestions, and doctor alerts for critical cases.
⚠️ AtriaAI does not replace clinical diagnosis. It is an assistive tool for awareness and timely consultation.
- 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.
- Auth & Profiles: Registration, login, profile management.
- Vitals & Symptoms: Height, weight, BP, temp, and free-text symptoms.
- Real-time Inference: Flask loads
model.pkland predicts on submit. - Recommendations: OTC guidance, home remedies, doctor alerts.
- Bilingual UX: English + Urdu forms, labels, and results.
- History & Logs: View past predictions per user.
- Admin Dashboard: Users overview, audit, model health (basic).
- MySQL-backed: Persistent storage for users and history.
flowchart TD
A[User (Web/Mobile)] -->|Forms/Requests| B[Flask App]
B --> C[Validation + Preprocess]
C --> D[ML Model (model.pkl)]
D --> E[Prediction + Confidence]
E --> F[Recommendation Engine]
F --> G[Response Formatter (EN/UR)]
B <-->|ORM/SQL| H[(MySQL)]
git clone https://github.com/UsamaMatrix/Atria-AI.git
cd Atria-AIpython -m venv .venv
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activatepip install -r requirements.txt# Flask
FLASK_ENV=development
SECRET_KEY=change_this_secret
# DB
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}
# ML
MODEL_PATH=ml/model.pkl
# i18n
DEFAULT_LANG=en
FALLBACK_LANG=enpython manage.py db upgrade # or run provided init scriptflask --app app run --debug
# http://127.0.0.1:5000- Language: Default via
DEFAULT_LANG. Toggle per-user in profile. - Model: Path configurable via
MODEL_PATH. Replaceml/model.pklwith a new export when retraining. - Security: Use a strong
SECRET_KEY. Enable HTTPS and secure cookies in production.
| 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 & symptoms → prediction |
| GET | /history |
Current user’s prediction history |
| POST | /logout |
End session |
/predict — Request
{
"height_cm": 175,
"weight_kg": 78,
"bp_systolic": 120,
"bp_diastolic": 80,
"temperature_c": 37.2,
"symptoms": "headache, fatigue, mild cough"
}/predict — Response
{
"prediction": "Viral Infection (mild)",
"confidence": 0.82,
"advice": {
"medicines": ["paracetamol 500mg (if needed)", "oral hydration salts"],
"home_remedies": ["rest", "warm fluids"],
"exercises": ["light stretching only"],
"consult_doctor": false,
"alerts": ["if fever > 38.5°C for 48h, seek medical attention"]
},
"lang": "en"
}Atria-AI/
├── app/
│ ├── __init__.py
│ ├── routes.py
│ ├── models.py
│ ├── services/
│ │ ├── inference.py # loads model.pkl, schema, predict()
│ │ └── recommend.py # rules for meds/exercises/alerts
│ ├── i18n/
│ │ ├── en.json
│ │ └── ur.json
│ ├── templates/
│ │ ├── base.html
│ │ ├── auth/
│ │ │ ├── login.html
│ │ │ └── register.html
│ │ └── dashboard/
│ │ ├── patient.html
│ │ └── admin.html
│ └── static/
│ ├── css/
│ └── js/
├── 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
├── ml/
│ ├── data/
│ ├── notebooks/
│ ├── training.py
│ └── model.pkl
├── migrations/
├── tests/
├── requirements.txt
├── .env.example
├── manage.py
└── README.md
- Passwords: Hash + salt (e.g.,
werkzeug.security/passlib). - CSRF: Protect forms (e.g.,
Flask-WTF). - Validation: Strict input schema (e.g.,
pydantic/marshmallow). - Logs: Avoid PHI; redact sensitive fields.
- RBAC: Reserved for admin features and future doctor roles.
- Headers: Enforce HTTPS, HSTS, CSP, and secure cookies in production.
- Symptom NLP (entities + negation handling)
- Differential multi-condition outputs
- Doctor directory + appointment integration
- Model monitoring + drift detection
- Dockerfile + CI/CD (GitHub Actions)
- PWA features + offline cache
- Fork the repo
- Create a feature branch
- Commit with clear messages
- Open a PR with context and screenshots
Licensed under the MIT License. See LICENSE.
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 or before taking any medication.
AtriaAI ایک ویب بیسڈ سسٹم ہے جو علامات اور بنیادی ویٹلز (قد، وزن، بلڈ پریشر، درجہ حرارت) کی بنیاد پر ابتدائی خود جانچ میں مدد دیتا ہے۔
- ممکنہ بیماری/حالت کی پیش گوئی
- احتیاطی تجاویز، گھریلو علاج، ہلکی ورزشیں
- ڈاکٹر سے رجوع کی وارننگ اگر مسئلہ سنگین ہو
یہ سسٹم ڈاکٹر کا متبادل نہیں، صرف ابتدائی رہنمائی کے لیے ہے۔
Place these files in the repo to match references above:
assets/
├── banner/
│ └── atriavai-banner.svg # top README banner
└── screens/
├── login-light.png # login page (light)
├── login-dark.png # login page (dark)
├── dashboard-patient-light.png # patient dashboard (light)
├── dashboard-patient-dark.png # patient dashboard (dark)
├── dashboard-admin-light.png # admin dashboard (light)
└── dashboard-admin-dark.png # admin dashboard (dark)





