LIVE AIR QUALITY / CAMS MODEL

Read the air
before it arrives.

A clear, local view of Faisalabad's air today, with a machine-learning horizon reaching three days ahead.

Connecting to live data
Forecast window72hours ahead
Updated hourly from Open-Meteo
+
CURRENT AQIWaiting for reading
°
Temperature
Humidity
Wind speed
Pressure
+24 hours
+48 hours
+72 hours
PM
Particulate matterPM2.5
PM
Coarse particlesPM10
NO₂
Nitrogen dioxideNO₂
O₃
Ground-level ozoneO₃

Hourly observations flowing into the next three model horizons.

ObservedForecast
HazardousVery unhealthyUnhealthyModerateGood

MODEL NOTES / EVIDENCE

Metrics &
findings.

What the data says about Faisalabad's air and the limits of a long-horizon forecast.

01

The season has a signature.

The monthly distribution shows the highest median AQI and widest spread in November, December, and January. Winter pollution is not a single spike: it is a recurring seasonal regime consistent with industrial emissions and crop-burning conditions.

Box plots of AQI by month
AQI distribution by month
02

The air is volatile by nature.

The long series makes the operational challenge visible: quiet periods can shift into sharp pollution episodes. This is why a chronological split and rolling cross-validation matter more than a convenient random split.

AQI over time in Faisalabad
US AQI over the observed period
HorizonCV mean MAECV mean R²Read
24h23.300.514Useful one day out
48h31.500.187Modest signal
72h35.110.039Near the edge of predictability

CV mean is the metric of record. The held-out summer test window was unusually calm, so its more flattering R² should not be treated as the general expectation.

04

Recent history leads the model.

Recent history and environment lead the model. SHAP shows that seasonality, surface pressure, current AQI, PM10, and wind speed carry the strongest influence, with additional contributions from AQI lags and rolling averages. The model is learning persistence plus weather context, not inventing a hidden cause.

SHAP beeswarm feature importance for the 24 hour model
SHAP summary, AQI +24h
05

Experiment Tracking

ML Flow used for experiment Tracking

AQI over time in Faisalabad
06

Feature correlation

Full feature correlation matrix

SYSTEM MAP / FROM DATA TO DECISION

One hourly loop,
three horizons.

The production system turns modeled atmospheric data into a forecast that can be read in a browser, without changing the model-serving path.

AQI Predictor end-to-end MLOps architecture
End-to-end MLOps architecture
01

From Open-Meteo to the browser.

Hourly data ingestion transforms weather and air-quality observations into the Hopsworks feature store. The FastAPI service reads the latest features, loads the registered CatBoost models, and exposes the three horizon predictions through the existing API.

Nginx serves this interface and routes prediction requests to the backend. The frontend keeps the operational view simple: current conditions, pollutants, historical context, and a forecast that can be understood at a glance.

02

Hourly ingestion

GitHub Actions runs the ingestion and feature-store update every hour. There is no always-on training server in this loop.

03

Daily retraining

The model retraining workflow runs once a day, evaluates candidates with MLflow, and registers the selected horizon models in Hopsworks.

04

Production serving

A DigitalOcean VPS runs FastAPI behind Nginx. The application retrieves predictions on demand while the model cache stays warm in the backend.

GitHub Actions keeps the data and model lifecycle moving on a predictable schedule. The deployed application remains focused on serving and explaining the latest result.

GitHub Actions workflow
Scheduled automation workflow