AI-powered Dengue Hemorrhagic Fever Early Warning System
Platform Prediksi dan Peringatan Dini Wabah Demam Berdarah Dengue
DBDWaspada is an advanced AI-driven prediction system designed to forecast Dengue Hemorrhagic Fever (DHF/DBD) outbreaks at the kelurahan (sub-district) level. By integrating epidemiological data, weather patterns, satellite imagery, and social media sentiment, the platform provides a comprehensive early warning system for public health officials.
The system utilizes an XGBoost machine learning model trained on three years of weekly data (2022β2024) across 553 kelurahan in Jakarta, Bandung, and Surabaya. The model predicts outbreak risks two weeks in advance, allowing for proactive intervention. Risks are categorized into three tiers based on incidence rates: LOW (<20/100k), MEDIUM (20β55/100k), and HIGH (>55/100k).
Built specifically for Dinas Kesehatan (Health Departments), the dashboard offers interactive visualizations and explainable AI through SHAP values. This transparency helps decision-makers understand the specific environmental or social factors driving risk in each neighborhood, leading to more precise and effective preventative measures.
The platform streamlines the transition from data to action by automating multi-channel alerts. Whether it's rising temperatures or increasing social media reports of fever, DBDWaspada captures the signals early, helping cities move from reactive treatment to proactive prevention.
| Peta Risiko (Risk Map) | Riwayat Peringatan (Alert History) |
|---|---|
![]() |
![]() |
| Monitoring Tweet | Navigation Sidebar |
|---|---|
![]() |
![]() |
graph LR
FE["π₯οΈ Frontend\nNext.js 15\n:3000"] -->|REST API| BE["β‘ Backend\nFastAPI\n:8001"]
BE --> DB["ποΈ PostgreSQL 16\n+ TimescaleDB\n+ PostGIS\n:5433"]
BE --> ML["π MLflow\n:5000"]
BE --> PF["π Prefect 3\n:4200"]
style FE fill:#1e293b,color:#fff
style BE fill:#0f766e,color:#fff
style DB fill:#1d4ed8,color:#fff
style ML fill:#7c3aed,color:#fff
style PF fill:#b45309,color:#fff
| Feature | Description |
|---|---|
| πΊοΈ Interactive Choropleth Map | MapLibre GL JS + Deck.gl visualization at kelurahan level |
| π€ XGBoost ML Prediction | 2-week ahead dengue outbreak risk prediction |
| π SHAP Explainability | Per-kelurahan SHapley Additive exPlanations for model transparency |
| π Multi-Channel Alerts | Automated warnings via WhatsApp, SMS, and Email |
| π§οΈ Weather Integration | Rainfall, humidity, and temperature data |
| π°οΈ Satellite Imagery | Standing water score from satellite data |
| π¦ Social Media Monitoring | Twitter/X sentiment analysis for DBD-related posts |
| π Trend Analytics | Historical charts with Recharts |
| π§ͺ MLflow Experiment Tracking | Full ML experiment reproducibility |
| π Prefect 3 Pipeline | Automated data pipeline orchestration |
| π Swagger API Docs | Auto-generated interactive API documentation |
# 1. Clone the repository
git clone https://github.com/vaskoyudha/DBDWaspada.git
cd DBDWaspada
# 2. Copy environment file
cp .env.example .env
# 3. Launch all services
docker compose up -d
# 4. Check service status
docker compose psAfter the containers are running, initialize the database and generate the required mock data:
# Apply database migrations
docker compose exec backend alembic upgrade head
# Seed geographical data (Cities, Districts, Sub-districts)
docker compose exec backend python -m backend.seeders.kelurahan_seeder
# Generate mock datasets for each category
docker compose exec backend python -m backend.generators.dinkes_generator
docker compose exec backend python -m backend.generators.weather_generator
docker compose exec backend python -m backend.generators.satellite_generator
docker compose exec backend python -m backend.generators.tweet_generator
# Train the XGBoost model
docker compose exec backend python -m backend.ml.train
# Generate initial predictions
docker compose exec backend python -m backend.ml.predict| Service | URL | Description |
|---|---|---|
| π₯οΈ Frontend Dashboard | http://localhost:3000 | Main UI |
| β‘ Backend API | http://localhost:8001 | FastAPI REST API |
| π API Docs | http://localhost:8001/docs | Swagger UI |
| π MLflow UI | http://localhost:5000 | ML Experiment Tracking |
| π Prefect UI | http://localhost:4200 | Pipeline Orchestration |
| ποΈ Database | localhost:5433 | PostgreSQL (psql) |
All endpoints are prefixed with /api/v1.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/kota | List all cities |
| GET | /api/v1/kota/{kota_id}/kelurahan | Sub-districts per city (GeoJSON) |
| GET | /api/v1/kelurahan/{kelurahan_id} | Specific sub-district details (GeoJSON) |
| GET | /api/v1/predictions?city={name} | Risk predictions per city (GeoJSON + SHAP top-5) |
| GET | /api/v1/predictions/shap?city={name}&kelurahan_id={id} | SHAP waterfall values per sub-district |
| GET | /api/v1/alerts | List of alerts (filters, pagination) |
| GET | /api/v1/alerts/logs?channel={channel} | Alert delivery history logs |
| GET | /api/v1/alerts/{alert_id} | Specific alert details |
| POST | /api/v1/alerts/dispatch | Manually dispatch alerts for current predictions |
| GET | /health | System health check |
| GET | /docs | Interactive Swagger UI documentation |
- Backend:
SQLAlchemy, Alembic, XGBoost, SHAP, Prefect 3, MLflow
- Frontend:
Tailwind CSS v4, MapLibre GL JS, Deck.gl, Recharts
- Database:
TimescaleDB, PostGIS
- Infrastructure:
Verify the system by running tests across the stack:
# Backend unit tests (Mocked DB)
docker compose exec backend python -m pytest backend/tests/ -m "not integration" -v
# Backend integration tests (Full DB)
docker compose exec backend python -m pytest backend/tests/ -v
# End-to-End pipeline tests
docker compose exec backend python -m pytest tests/e2e/ -v
# Frontend test suite
docker compose exec frontend pnpm test --run- Network Ports: The database uses host port
5433and the backend uses8001to avoid common local conflicts. Port8000and5432are reserved for internal container mapping. - Reproducibility: Mock data generators use a fixed seed of
42. - Epidemiological Weeks: Based on WIB (UTC+7) timezone.
- Data Coverage: 3 years of weekly data (2022β2024) across 7 city entities: Jakarta (5 administrative cities), Bandung, and Surabaya.
- Resolution: Covers 553 kelurahan: 262 in Jakarta, 137 in Bandung, and 154 in Surabaya.
- Risk Tiers:
- LOW (RENDAH): < 20 per 100k population.
- MEDIUM (SEDANG): 20 β 55 per 100k population.
- HIGH (TINGGI): > 55 per 100k population.
- Prediction Target: The model predicts 2 weeks ahead (Target Week = Current Week + 2).
Contributions are welcome! Please open an issue first to discuss what you would like to change. Pull requests should be against the main branch.
This project is licensed under the MIT License.



