How mackshema/pollution_prediction works
AirGuard collects city sensor readings and live wind, combines them with historical wind trajectories and satellite pollution data to build a training dataset, then cleans and trains a forecasting model. Its separate live prediction process reads the latest IoT and wind CSV data, estimates pollution and wind-driven spread, and writes forecasts that the dashboard presents on maps and charts. The README also describes risk alerts. Evidence is strongest for the excerpted scripts; the documented Bi-LSTM training and the live predictor’s Random Forest/scaler artifacts do not line up, so no model handoff between them is asserted.
Main entry points: iot_gateway.py Sensor Readings · merge_datasets.py Dataset Merge · dashboard.py Monitoring Dashboard · live_wind_feed.py Live Wind Buffer
Components 22
Data Ingestion
- Sensor Gateway
pollution_ai_project/iot_gateway.py - Sensor Readings
pollution_ai_project/iot_gateway.py - Wind Collector
pollution_ai_project/live_wind_feed.py - Live Wind Buffer
pollution_ai_project/live_wind_feed.py
Historical Data
- ERA5 Download
pollution_ai_project/era5_download.py - Wind Trajectories
pollution_ai_project/convert_wind_to_trajectory.py - Sentinel-5P Export
pollution_ai_project/sentinel5p_download.py - Dataset Merge
pollution_ai_project/merge_datasets.py - Training Dataset
pollution_ai_project/merge_datasets.py - Data Cleaning
pollution_ai_project/clean_training_data.py - Clean Dataset
pollution_ai_project/clean_training_data.py
Training and Inference
- Model Training
pollution_ai_project/train_pollution_model.py - Trained Model
pollution_ai_project/train_pollution_model.py - Live Predictor
pollution_ai_project/predict_pollution.py - Prediction Output
pollution_ai_project/predict_pollution.py
Monitoring and Output
- Monitoring Dashboard
pollution_ai_project/dashboard.py
Other components
- IoT Sensors
- MQTT Broker
- Open-Meteo
- Climate Data Store
- Google Earth Engine
- City Authorities
Connections 24
- IoT Sensors → MQTT Broker: publishes readings
- Sensor Gateway → MQTT Broker: subscribes to
pollution_ai_project/iot_gateway.py - Sensor Gateway → Sensor Readings: appends readings
pollution_ai_project/iot_gateway.py - Open-Meteo → Wind Collector: provides wind
pollution_ai_project/live_wind_feed.py - Wind Collector → Live Wind Buffer: appends readings
pollution_ai_project/live_wind_feed.py - Climate Data Store → ERA5 Download: serves reanalysis
pollution_ai_project/era5_download.py - ERA5 Download → Wind Trajectories: downloads wind data
pollution_ai_project/era5_download.py - ERA5 Download → Wind Trajectories: reads NetCDF
pollution_ai_project/convert_wind_to_trajectory.py - Google Earth Engine → Sentinel-5P Export: provides imagery
pollution_ai_project/sentinel5p_download.py - Sensor Readings → Dataset Merge: loads readings
pollution_ai_project/merge_datasets.py - Wind Trajectories → Dataset Merge: loads trajectories
pollution_ai_project/merge_datasets.py - Sentinel-5P Export → Dataset Merge: loads pollution CSV
pollution_ai_project/merge_datasets.py - Dataset Merge → Training Dataset: writes merged data
pollution_ai_project/merge_datasets.py - Training Dataset → Data Cleaning: loads dataset
pollution_ai_project/clean_training_data.py - Data Cleaning → Clean Dataset: writes clean data
pollution_ai_project/clean_training_data.py - Clean Dataset → Model Training: loads training rows
pollution_ai_project/train_pollution_model.py - Model Training → Trained Model: saves model
pollution_ai_project/train_pollution_model.py - Sensor Readings → Live Predictor: reads latest sensor
pollution_ai_project/predict_pollution.py - Live Wind Buffer → Live Predictor: reads latest wind
pollution_ai_project/predict_pollution.py - Live Predictor → Prediction Output: writes forecasts
pollution_ai_project/predict_pollution.py - Sensor Readings → Monitoring Dashboard: loads sensor data
pollution_ai_project/dashboard.py - Live Wind Buffer → Monitoring Dashboard: loads wind data
pollution_ai_project/dashboard.py - Prediction Output → Monitoring Dashboard: loads forecasts
pollution_ai_project/dashboard.py - Monitoring Dashboard → City Authorities: presents forecasts
README.md