A federated learning-enabled framework for urban air quality forecasting across East African cities β exploring personalization, non-IID heterogeneity, and digital twin concepts for smart city environmental monitoring.
# fedtwin-air
A federated learning-enabled framework for urban air quality forecasting across East African cities β exploring personalization, non-IID heterogeneity, and digital twin concepts for smart city environmental monitoring.
# π FedTwin-Air
### Federated Learning for Urban Air Quality Forecasting Across East Africa
*A privacy-preserving, city-aware approach to predicting air quality using Federated Learning*
---
## π About the Project
**FedTwin-Air** predicts urban air quality across **7 East African cities** β Nairobi, Kampala, Kigali, Addis Ababa, Dodoma, Dar es Salaam, and Mogadishu β using **Federated Learning** instead of a single centralized model.
Instead of pooling all cities' data into one place, each city trains locally on its own data, and only model updates are shared and aggregated. This keeps data decentralized while still learning a shared global model β with the ability to personalize it per city afterward.
The project explores a key real-world challenge: **cities don't behave the same way.** Different pollution levels, different seasons, different climates. FedTwin-Air is built around understanding and handling that diversity.
---
## π― What This Project Does
- π₯ Collects real weather and air pollution data for 7 cities
- π Explores and cleans the data through EDA
- ποΈ Builds a centralized deep learning baseline
- π€ Trains a federated model (LSTM & GRU) across all cities without merging raw data
- π― Personalizes the federated model for each individual city
- π¦οΈ Tests whether adding seasonal patterns improves predictions
- π Compares performance across all approaches
---
## ποΈ Dataset
- **Source:** Open-Meteo (Air Quality + Historical Weather APIs)
- **Coverage:** 7 East African cities
- **Features:** 6 key meteorological variables (finalized after EDA β redundant features like max/min temperature and max wind speed were removed)
- **Preprocessing:** Per-city normalization (MinMax scaling) + 120-day sliding time windows
--- β¦