AstraMed represents a paradigm shift inExplore Live App | Test API Engine | View Code
- π Live Deployment
- π― Problem Statement
- π‘ Solution Architecture
- π Key Features
- π οΈ Tech Stack
- π₯ Team Structure
- π Development Timeline
- β‘ Quick Start
- π¦ Project Structure
- π Expected Deliverables
- π Documentation
- π€ Contributing
- π License
| Component | Status | Stack | Link |
|---|---|---|---|
| Prediction Engine | π’ Online | FastAPI + XGBoost/CatBoost | API Docs |
| ML Inference Node | π’ Online | Python 3.10 | Model Spaces |
| Frontend App | π’ Online | React + TypeScript | Live App |
Interactive Demo: Visit the API Docs link to explore the Swagger documentation and test the model inference directly.
graph LR
A[π· Silent Disease<br/>Progression] --> B[β° Late Detection]
B --> C[π° Costly<br/>Interventions]
C --> D[π Poor<br/>Outcomes]
style A fill:#ff6b6b,stroke:#c92a2a,color:#fff
style B fill:#ffa94d,stroke:#e8590c,color:#fff
style C fill:#ffd43b,stroke:#fab005,color:#000
style D fill:#ff6b6b,stroke:#c92a2a,color:#fff
Chronic diseases such as diabetes often develop silently. By the time symptoms appear, interventions become costly and outcomes worsen. Clinicians operate under:
- β±οΈ Time Pressure β Limited consultation windows
- π Data Gaps β Incomplete historical records
- β Uncertainty β Complex probabilistic assessments
Meanwhile, patients struggle to understand probabilistic health risks and preventive actions.
Design a clinical decision support workflow that:
- β Surfaces early risk signals from routine patient data
- β Supports informed, timely interventions
- β Doesn't overwhelm doctors or mislead patients
|
|
|
|
|
|
|
|
AstraMed is powered by an enterprise-grade Ensemble Learning Pipeline designed for high-stakes clinical environments where accuracy and explainability are paramount.
Instead of relying on a single model, we leverage a Soft-Voting Ensemble of three industry-leading gradient boosting algorithms:
- XGBoost (eXtreme Gradient Boosting): Optimized for speed and performance on structured clinical data.
- CatBoost (Categorical Boosting): Handles categorical features (e.g., "Gender", "Smoking History") natively without leakage.
- LightGBM: Provides high efficiency on large-scale datasets.
graph TD
A[Patient Data] --> B[Preprocessing Pipeline]
B --> C{Ensemble Core}
C -->|Probability| D[XGBoost]
C -->|Probability| E[CatBoost]
C -->|Probability| F[LightGBM]
D & E & F --> G[Soft Voting Aggregator]
G --> H[Final Risk Score]
H --> I[Calibration Layer]
I --> J[Risk Stratification]
We solve the "Black Box" problem using SHAP (SHapley Additive exPlanations). Every prediction comes with a mathematical justification:
- Local Interpretability: Why did this specific patient get a high risk score? (e.g., "+15% due to High HbA1c").
- Global Interpretability: What factors drive disease risk across the entire population?
AstraMed goes beyond static predictions. Our Counterfactual Engine allows clinicians to simulate outcomes:
"If the patient reduces BMI by 2 points and lowers HbA1c to 5.7%, how does their 5-year risk change?" This empowers shared decision-making and personalized goal setting.
| Layer | Technology | Purpose |
|---|---|---|
| π¨ Frontend | React + TypeScript | Interactive UI components |
| π¨ Styling | Tailwind CSS | Responsive design system |
| β‘ Backend | FastAPI | High-performance REST API |
| π§ ML Engine | XGBoost + LightGBM + CatBoost | SOTA ensemble prediction |
| π Explainability | SHAP | Feature importance analysis |
| π€ AI Engine | BioMistral-7B | Medical language model |
| πΎ Database | JSON Store (MVP) β PostgreSQL | Patient history & records |
| π³ Container | Docker + Docker Compose | Consistent deployment |
| π Deployment | Huggingface (Backend) + Vercel (Frontend) | Cloud hosting |
|
Model Development & Explainability
|
FastAPI Services & Infrastructure
|
|
Professional Dashboard Interface
|
Patient Portal & Documentation
|
π― Click to expand tasks
-
Project Setup
- Initialize GitHub repository with proper structure
- Set up development environments (Python, Node.js)
- Configure CI/CD pipelines (GitHub Actions)
- Create project board and issue templates
-
ML Foundation
- Load and explore diabetes dataset
- Perform statistical analysis and visualization
- Handle missing values and outliers
- Feature engineering (interactions, scaling)
- Initial model prototyping
-
Backend Architecture
- Design API schema (Pydantic models)
- Set up FastAPI boilerplate
- Implement health check endpoints
- Configure CORS and middleware
-
Frontend Design
- Create wireframes for clinician dashboard
- Design patient portal mockups
- Set up React + TypeScript + Vite
- Implement component structure
π― Click to expand tasks
-
ML Pipeline
- Train ensemble model (XGBoost + LightGBM + CatBoost)
- Implement SHAP explainability
- Calculate feature importance
- Serialize models (.joblib files)
- Validate model performance (AUC-ROC, calibration)
-
Backend APIs
-
/predictβ Risk assessment endpoint -
/simulateβ What-if analysis endpoint -
/reportβ AI report generation endpoint -
/historyβ Patient timeline endpoint -
/cohortβ Population analysis endpoint
-
-
Frontend Integration
- Clinician dashboard with risk visualization
- Patient portal with simple gauges
- Connect to backend APIs
- Implement state management
- Add loading states and error handling
-
End-to-End Testing
- Integration tests for API endpoints
- UI component tests
- Full workflow validation
π― Click to expand tasks
-
Advanced Features
- Implement counterfactual engine
- Add cohort comparison functionality
- Integrate BioMistral-7B for AI reports
- Build what-if simulation interface
-
Documentation
- Write comprehensive README
- Create MODEL_CARD.md
- Document ETHICS_AND_LIMITATIONS.md
- Complete ARCHITECTURE.md
- Generate API documentation
-
Presentation
- Design pitch deck (15 slides)
- Record demo video (5-7 minutes)
- Prepare talking points
- Rehearse presentation
-
Final Polish
- UI/UX refinement and accessibility
- Performance optimization
- Bug fixes and edge case handling
- Docker deployment testing
- Submit repository and materials
# Required software
β
Python 3.10+
β
Node.js 18+
β
Git 2.30+
β
Docker 24.0+ (optional)# Navigate to backend directory
cd backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run the server
uvicorn backend.api:app --reload --port 8001
# π Server running at http://localhost:8001
# π API docs at http://localhost:8001/docs# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Start development server
npm run dev
# π App running at http://localhost:5173# Navigate to ML research directory
cd ml-research
# Install dependencies
pip install -r requirements.txt
# Train the model
python train_pro.py
# π¦ Models saved to backend/models/
# π Performance metrics in outputs/# Build and run all services
docker-compose up --build
# Services available at:
# π¨ Frontend: http://localhost:3000
# β‘ Backend: http://localhost:8001
# π API Docs: http://localhost:8001/docsclinical-risk-predictor/
β
βββ π backend/ # FastAPI Server
β βββ π app.py # Main application entry point
β βββ π requirements.txt # Python dependencies
β β
β βββ π models/ # ML Risk Models
β β βββ π risk_model.py # Ensemble prediction engine
β β βββ π counterfactuals.py # What-if analysis logic
β β βββ π explainability.py # SHAP feature importance
β β
β βββ π routes/ # API Endpoints
β β βββ π patient.py # Patient data management
β β βββ π risk.py # Risk computation APIs
β β βββ π cohort.py # Population analytics
β β
β βββ π schemas/ # Data Validation
β β βββ π patient.py # Patient data models
β β βββ π prediction.py # Prediction schemas
β β
β βββ π utils/ # Helper Functions
β βββ π preprocessing.py # Feature engineering
β βββ π validation.py # Data validation
β
βββ π frontend/ # React Application
β βββ π package.json # Node dependencies
β βββ π vite.config.ts # Vite configuration
β β
β βββ π public/ # Static Assets
β β βββ πΌοΈ logo.svg
β β
β βββ π src/
β βββ π App.tsx # Root component
β βββ π main.tsx # Entry point
β β
β βββ π components/ # React Components
β β β
β β βββ π Clinician/ # Doctor Dashboard
β β β βββ π RiskDashboard.tsx
β β β βββ π PatientList.tsx
β β β βββ π RiskDetail.tsx
β β β βββ π CohortAnalysis.tsx
β β β
β β βββ π Patient/ # Patient Portal
β β β βββ π RiskGauge.tsx
β β β βββ π SimpleReport.tsx
β β β βββ π ActionPlan.tsx
β β β βββ π Progress.tsx
β β β
β β βββ π Common/ # Shared Components
β β βββ π Header.tsx
β β βββ π Footer.tsx
β β βββ π LoadingSpinner.tsx
β β
β βββ π pages/ # Page Components
β β βββ π ClinicianView.tsx
β β βββ π PatientView.tsx
β β
β βββ π hooks/ # Custom Hooks
β β βββ π useRiskPrediction.ts
β β
β βββ π utils/ # Utilities
β βββ π api.ts # API client
β
βββ π ml-research/ # ML Development
β βββ π train.py # Model training script
β βββ π evaluate.py # Model evaluation
β βββ π requirements.txt # ML dependencies
β β
β βββ π notebooks/ # Jupyter Notebooks
β β βββ π 01_EDA.ipynb # Exploratory analysis
β β βββ π 02_Modeling.ipynb # Model development
β β βββ π 03_Evaluation.ipynb # Performance analysis
β β
β βββ π experiments/ # Experiment Logs
β βββ π model_metrics.json
β
βββ π data/ # Datasets
β βββ π diabetes_dataset.csv # Training data (provided)
β βββ π synthetic_patients.csv # Test data
β βββ π population_stats.json # Cohort statistics
β
βββ π docs/ # Documentation
β βββ π ARCHITECTURE.md # System design details
β βββ π API_SPEC.md # API documentation
β βββ π MODEL_CARD.md # Model specifications
β βββ π ETHICS_AND_LIMITATIONS.md # Safety considerations
β βββ π TEAM_ROLES.md # Team structure
β βββ π TIMELINE.md # Sprint planning
β βββ π DEPLOYMENT.md # Deployment guide
β
βββ π .github/ # GitHub Configuration
β βββ π workflows/
β βββ π backend-tests.yml # Backend CI/CD
β βββ π frontend-tests.yml # Frontend CI/CD
β
βββ π docker-compose.yml # Multi-container setup
βββ π .gitignore # Git ignore rules
βββ π README.md # This file
βββ π CONTRIBUTING.md # Contribution guidelines
βββ π LICENSE # MIT License
|
Complete Source Code with Documentation
Repository Link: GitHub.com/YourTeam/clinical-risk-predictor |
Full-Stack Application Demo
Live Demo: app.clinical-risk.demo |
|
5-7 Minute Walkthrough
Video Link: YouTube/Product-Demo |
Technical & Clinical Documentation
|
|
System design, data flow, component interactions |
Endpoint documentation, request/response schemas |
ML model details, performance metrics |
|
Bias analysis, limitations, safety guidelines |
Detailed role breakdown, deliverables |
Production setup, Docker guide |
MIT License β See LICENSE file for details
Ready to Transform Healthcare Through AI?
β Star this repository β’
π΄ Fork and contribute β’
π§ Get in touch
Last Updated: January 2025 | Version: 1.0.0 | Status: π§ In Active Development

