XAI-AIRNET: EXPLAINABLE SPATIOTEMPORAL MACHINE LEARNING FOR 24-HOUR AIR QUALITY FORECASTING ACROSS TEN PAKISTANI CITIES

Authors

  • Bushra Shaikh
  • Abdullah Maitlo
  • Hina Kareem
  • Manahil Shaikh

Keywords:

air quality forecasting; Air Quality Index; PM2.5; Pakistan; explainable artificial intelligence; SHAP; Random Forest; XGBoost; LightGBM; spatiotemporal machine learning

Abstract

Short-term air pollution forecasting can help environmental agencies, health services, and residents prepare for harmful pollution episodes. This study presents XAI-AirNet, an explainable artificial intelligence (XAI) framework for 24-hour-ahead Air Quality Index (AQI) forecasting across ten Pakistani cities. The analysis uses 21,840 hourly observations collected from 6 November 2025 to 4 February 2026. The records include PM10, PM2.5, carbon monoxide, nitrogen dioxide, sulfur dioxide, ozone, dust, temperature, humidity, precipitation, wind speed, wind direction, and pressure. A numeric AQI target was derived from PM2.5 and PM10 through breakpoint-based interpolation. The category target used the reported AQI class shifted 24 hours ahead. The pipeline produced 135 predictors from city identifiers, time variables, lagged pollutant values, and rolling-window summaries. A chronological 80/20 split was used to test Ridge, Random Forest, XGBoost, and LightGBM regressors. Logistic Regression, Random Forest, XGBoost, LightGBM, and a multilayer perceptron were tested for category prediction. Random Forest gave the best AQI value forecast, with MAE = 29.00, RMSE = 39.25, and R2 = 0.609. LightGBM was close, with MAE = 28.38, RMSE = 39.31, and R2 = 0.608. For category forecasting, Logistic Regression gave the best macro-F1 score of 0.506. This result shows that simple interpretable boundaries can remain useful when AQI classes are imbalanced. SHapley Additive exPlanations (SHAP) and model feature importance identified recent AQI, rolling AQI, PM2.5, PM10, temperature, and humidity as major predictors. The results show that transparent ensemble learning can support next-day air quality warning systems in Pakistan. They also show the need for longer, multi-season datasets to improve category-level warnings.

Downloads

Published

2026-05-25

How to Cite

Bushra Shaikh, Abdullah Maitlo, Hina Kareem, & Manahil Shaikh. (2026). XAI-AIRNET: EXPLAINABLE SPATIOTEMPORAL MACHINE LEARNING FOR 24-HOUR AIR QUALITY FORECASTING ACROSS TEN PAKISTANI CITIES. Spectrum of Engineering Sciences, 4(5), 2263–2276. Retrieved from https://thesesjournal.com/index.php/1/article/view/2966