Hybrid Random Forest and Transformer-Based Framework for Robust Air Quality Anomaly Detection and Forecasting


Date Published : 30 September 2026

Contributors

Tharini Benarji

Lincoln University College
Author

Keywords

Air Quality Index (AQI) Air Pollution Anomaly Detection Random Forest Transformer Time-Series Forecasting Multivariate Sensor Data Multi-Head Self-Attention Air Quality Monitoring Hybrid Machine Learning Environmental Monitoring Smart Cities.

Proceeding

Track

General Track

License

Copyright (c) 2026 Sustainable Global Societies Initiative

Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

Abstract

With the growth of urbanization, industrialization and vehicular emissions, air pollution is a major environmental and public-health issue. Multivariate sensor data from continuous air-quality monitoring systems is a large volume of data that includes pollutant concentrations and meteorological data. But time-series data of air quality present various nonlinear relationships, noise, missing values, evolving environments, and highly unbalanced pollution anomalies, which make anomaly detection and forecasting difficult. On the one hand, traditional machine-learning models are capable of strong nonlinear prediction, but they struggle to identify long-range temporal dependency, on the other hand, Transformer-based models can learn and identify long-range temporal dependency but need to consume a lot of computing resources and may generate false alarms under the circumstances of dynamic environment.In this paper, a hybrid Random Forest – Transformer model is developed to address the robust air-quality anomaly detection and Air-Quality Index (AQI) forecasting problem. Random Forest regression model is used as a stable baseline model for AQI prediction and prediction residuals are used to detect the deviation from the expected air-quality behavior. Meanwhile, a Transformer based temporal-learning model is proposed to capture long-range temporal dependencies and interactions between pollutant and meteorological variables using multi-head self-attention. The anomaly information from the two complementary branches is normalized and fused together by a weighted fusion mechanism to produce a holistic hybrid anomaly score. A pre-defined threshold is then used to separate normal from anomalous observations.The experimental evaluation compares the performance of the proposed hybrid framework, with random forest and transformer, by measuring forecasting and anomaly-detection. The representative results demonstrate that the hybrid approach enhances the performance of the AQI forecasting and detection of anomalies with the decrease in false alarms compared to the individual models. The proposed framework offers a common solution for continuous air quality monitoring, detection of air pollution events, smart city environmental systems, and for public health decision support.

References

No References

Downloads

How to Cite

Tharini, B. (2026). Hybrid Random Forest and Transformer-Based Framework for Robust Air Quality Anomaly Detection and Forecasting. Sustainable Global Societies Initiative, 1(12). https://vectmag.com/sgsi/paper/view/1321