You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An Explainable AI system for patient risk stratification in Bangladesh's low-resource healthcare settings. The system predicts patient risk levels (Low / Medium / High) using clinical data and provides human-readable explanations for every prediction — empowering doctors, nurses, and health workers to make informed decisions even without specialist support.
Bangladesh has only 0.58 physicians per 1,000 people (WHO, 2022). This project bridges the gap between collected clinical data and actionable medical insight.
Latest stable release. Better error messages, performance improvements over 3.10. Full compatibility with all ML libraries.
Data & ML
Tech
Purpose
Details
pandas
Data manipulation
The standard for tabular data. Read CSV/Excel, filter, group, merge, pivot. Everything starts here.
NumPy
Numerical computing
Underlies pandas and scikit-learn. Fast array operations, linear algebra, statistical functions.
scikit-learn
Classical ML models
Provides Logistic Regression, Random Forest, cross-validation, metrics, preprocessing (StandardScaler, train_test_split, StratifiedKFold). The backbone of the ML pipeline.
XGBoost
Gradient boosting
Our primary model. Handles missing values natively, regularization prevents overfitting, consistently wins on tabular data. Faster than Random Forest with better accuracy.
LightGBM
Light gradient boosting
Microsoft's alternative to XGBoost. Faster training on larger datasets, leaf-wise tree growth, lower memory usage. We compare both to pick the best.
imbalanced-learn
Class balancing
Provides SMOTE (Synthetic Minority Oversampling Technique). Medical data is always imbalanced — most patients are "Low risk". Without SMOTE, models ignore High-risk patients.
joblib
Model serialization
Save trained models to disk (.joblib files). Faster than pickle for NumPy arrays. Models are loaded once at API startup.
Explainability
Tech
Purpose
Details
SHAP
Model explanations
SHapley Additive exPlanations — the gold standard for ML interpretability. Based on game theory (Shapley values). Tells you exactly how much each feature pushed a prediction toward or away from risk. Works with any model.
matplotlib
Static plots
Base plotting library. Used for confusion matrices, bar charts, heatmaps. Publication-quality figures for the research paper.
seaborn
Statistical plots
Built on matplotlib. Better defaults, cleaner syntax. Used for distribution plots, correlation heatmaps, pair plots in EDA.
Plotly
Interactive plots
Used in Streamlit dashboard. Hover tooltips, zoom, pan. Makes SHAP waterfall plots and feature importance charts interactive.
Web — API (Backend)
Tech
Purpose
Details
FastAPI
REST API framework
Modern, async Python web framework. Auto-generates OpenAPI/Swagger docs. Type-safe with Pydantic. 10x faster than Flask. Endpoints for single prediction, batch prediction, and explanation retrieval.
Pydantic
Data validation
Validates incoming patient data against expected types and ranges. Example: Blood Pressure must be 0-300, Age must be 0-120. Prevents garbage predictions.
Uvicorn
ASGI server
Production-grade async server for FastAPI. Handles concurrent requests efficiently.
Web — Dashboard (Frontend)
Tech
Purpose
Details
Streamlit
Interactive dashboard
Python-only web framework for data apps. No HTML/CSS/JS needed. Perfect for ML demos — input widgets, charts, and SHAP plots in pure Python. Multi-page app with sidebar navigation.
Testing & Quality
Tech
Purpose
Details
pytest
Testing framework
Unit tests for preprocessing, feature engineering, model predictions, and API endpoints. Ensures nothing breaks when you change code.
ruff
Linting & formatting
Extremely fast Python linter (written in Rust). Replaces flake8 + black + isort. Keeps code clean and consistent.
DevOps
Tech
Purpose
Details
Git + GitHub
Version control
Track all changes. Public repo showcases your work. Clean commit history shows research methodology.
GitHub Actions
CI/CD
Auto-run tests on every push. Ensures code quality. Impressive on a portfolio project — shows engineering maturity.
Datasets
Primary Datasets (Public, Free)
Dataset
Source
Samples
Features
Target
Pima Indians Diabetes
UCI / Kaggle
768
8 (Glucose, BP, BMI, Insulin, Age, etc.)
Diabetes (binary → converted to 3-class risk)
UCI Heart Disease (Cleveland)
UCI Repository
303
13 (Age, Sex, Cholesterol, RestBP, MaxHR, etc.)
Heart Disease (binary → converted to 3-class risk)
Risk Label Engineering
We convert binary labels into 3-tier clinical risk scores:
Low Risk → Negative outcome + low-severity features
Medium Risk → Negative outcome + elevated features (borderline patients)
High Risk → Positive outcome
For diabetes (example):
Low: No diabetes + Glucose < 120 + BMI < 30
Medium: No diabetes + (Glucose ≥ 120 OR BMI ≥ 30) — borderline
High: Diabetic
This is more clinically useful than binary yes/no prediction.
Features & Functionality
Core Features
#
Feature
Description
1
3-Class Risk Prediction
Predict Low / Medium / High risk with confidence scores for each class
2
Multi-Disease Support
Separate models for diabetes risk and heart disease risk
3
SHAP Explanations
Every prediction includes feature-level explanations: "Glucose=180 increased risk by +0.23"
Page: What-If Analysis — sliders to adjust features, see risk change
Page: About — methodology, team, references
Clinical alert cards with color coding
PDF report generation
Phase 7: Polish & Deploy (Day 15-17)
Write comprehensive README.md
Add GitHub Actions CI (run tests on push)
Code cleanup with ruff
Final testing
Screenshots for README
Record demo GIF/video
Additional Suggestions
1. Add a "Model Card"
Include a model card (Google's standard) documenting: what the model does, training data, intended use, limitations, ethical considerations. Admissions committees love this — shows you think about responsible AI.
2. Clinical Validation Section
Add a section in your paper/README discussing how this would be validated clinically before deployment. Shows you understand the gap between ML research and real healthcare deployment.
3. Fairness Analysis
Add basic fairness analysis — does the model perform equally across age groups? Gender? This is cutting-edge in health AI research and will stand out.
4. Dockerize the Project
Add a Dockerfile so anyone can run the entire project (API + Dashboard) with one command. Shows DevOps awareness.
5. Consider Bangla Language Support (Future Scope)
Even though the interface is English, mention in the paper that clinical alerts could be translated to Bangla for rural health workers. This frames the project in real-world impact.
6. Use DVC (Data Version Control)
Track your datasets and models with DVC alongside Git. Research projects need reproducibility — DVC ensures anyone can replicate your exact data pipeline.
Key Metrics to Showcase
For your MSc applications, highlight these numbers in your README and paper:
Metric
Target
F1-Macro (best model)
> 0.80
Number of models compared
4
Explainability method
SHAP (Shapley values)
Datasets used
2 (1,071 total patients)
Engineered features
4 new clinical features
API endpoints
4+
Test coverage
> 80%
Research paper
4-page arXiv preprint
References
Lundberg, S.M. and Lee, S.I., 2017. "A Unified Approach to Interpreting Model Predictions." NeurIPS.