https://github.com/shehzansk/healthx
A COVID-19 containment simulator with AI-powered agents and RL-based policy planning using a digital twin of Los Angeles.
https://github.com/shehzansk/healthx
ai digital-twin flask healthcare nextjs reinforcement-learning simulation
Last synced: about 1 month ago
JSON representation
A COVID-19 containment simulator with AI-powered agents and RL-based policy planning using a digital twin of Los Angeles.
- Host: GitHub
- URL: https://github.com/shehzansk/healthx
- Owner: shehzansk
- License: mit
- Created: 2025-04-10T06:42:08.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-04-10T07:38:03.000Z (8 months ago)
- Last Synced: 2025-04-10T08:24:39.405Z (8 months ago)
- Topics: ai, digital-twin, flask, healthcare, nextjs, reinforcement-learning, simulation
- Language: JavaScript
- Homepage:
- Size: 5.82 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐งฌ COVID Digital Twin & Containment Simulation
A digital twin of an urban environment powered by AI agents and Reinforcement Learning to simulate, analyze, and optimize pandemic containment strategies.
---
## ๐ฏ Objectives
- **Simulate Realistic Human Agents to Model Urban Dynamics**
Create human-like agents with lifelike demographics, routines, and behaviors that evolve over time, reflecting real-world social dynamics. This helps uncover patterns that drive smarter policy and resource planning during pandemics.
- **Train RL Agents for Disease Containment**
Utilize Reinforcement Learning to develop adaptive containment strategies (like dynamic lockdowns) that minimize disease spread while balancing economic and societal impacts.
---
## ๐ง Overview
This project combines **agent-based modeling** with **reinforcement learning** to build a **dynamic digital twin** of a city (modeled on Los Angeles). Each AI agent simulates real human behavior, allowing the system to evaluate and adapt containment strategies in response to pandemic scenarios.
---
## ๐ Key Features
### ๐๏ธ Digital Twin of a City
Simulates thousands of realistic human-like agents in a virtual city with detailed spatial geography and movement dynamics based on historical epidemic/pandemic data.
### ๐ Chain-of-Thought Driven Routines
Agents follow daily schedules generated using large language models to mimic diverse real-world behaviors and responses under epidemic conditions.
### ๐งช RL-Based Policy Optimization
Custom OpenAI Gym environment enables RL agents to learn dynamic intervention policies (e.g., selective lockdowns) using algorithms like **Proximal Policy Optimization (PPO)**.
### ๐ฅ Predictive Healthcare Insights
- Forecasts shortages in medical equipment, ICU beds, and medicine.
- Simulates the impact of travel restrictions and lockdowns on healthcare logistics.
### ๐งฉ Modular Architecture
- **Frontend:** Interactive dashboard (Next.js) with maps (Leaflet) and charts for visualization.
- **Backend:** Flask-based API hosting the simulation logic and chain-of-thought reasoning.
- **ML Module:** Scripts and environments for RL training using `stable-baselines3`.
---
## ๐งฌ How It Works

### ๐น Agent-Based Simulation
Each agent is initialized with a profile and dynamic routine. They interact, move, and influence infection dynamics across city neighborhoods.
### ๐น Data-Driven Urban Modeling
Tracks time-series data like population density, infection rates, and economic loss. Enables realistic forecasting and planning.
### ๐น Reinforcement Learning for Policy Optimization
Encapsulated in a custom Gym environment. The RL agent learns when and where to apply interventions to contain disease spread optimally.
### ๐น Visualization & Insights
Real-time maps and dashboards show:
- Agent movements
- Infection spread
- Hospital resource predictions
- RL policy plans
---
## ๐ฅ๏ธ Tech Stack

---
## ๐ท Gallery

---
## ๐ Getting Started
### ๐ง Prerequisites
- Node.js & npm
- Python 3.8+
- MongoDB
## ๐ Directory Structure
```
HealthX/
โโโ backend/ # Flask app, simulation engine, RL environment
โโโ frontend/ # Next.js frontend with interactive maps & controls
```
---
### ๐ ๏ธ Manual Setup
1. **Backend**
```bash
cd HealthX/backend
pip install -r requirements.txt
python app.py
```
2. **Frontend**
```bash
cd HealthX/frontend
npm install
npm run dev
```
---
## ๐ Sample Outputs
- ๐ **Interactive Map:** Live city simulation with infection and economic overlays.
- ๐ **Containment Timeline:** RL-generated policy sequence (lockdowns/travel bans).
- ๐ฅ **Hospital Insights:** Shortage forecasts and surplus indicators.
- ๐ง **Gemini Suggestions:** AI-generated recommendations for resource management.
---
## ๐ Note
This project is a research-oriented prototype and not intended for real-world deployment without further clinical and epidemiological validation.