Identifying Anomalies in Air Quality Prediction Using Machine Learning and Transformer-Based Techniques
DOI:
https://doi.org/10.51483/IJAIML.6.12s.2026.1148-1160Keywords:
Air Quality Index (AQI), Anomaly Detection, Random Forest, Transformer Networks, Machine Learning, Deep Learning, Time-Series Analysis, Ensemble Learning, and Smart Air Quality Prediction.Abstract
Air pollution has become a significant environmental and public health issue due to the rapid industrialization, urbanization, increasing transport usage and changes in climate. The prediction of Air Quality Index (AQI) and the early detection of abnormal pollution situations are critical for protecting public health and supporting environmental decision-making. Although the conventional machine learning methods are effective in forecasting the overall AQI, they often fail to capture rare and irregular phenomena resulting from sharp peaks in emissions, major changes in weather conditions, sensor failures, and unexpected environmental events. To overcome these limitations, this work proposes a Hybrid Air Quality Anomaly Detection Framework which is composed of a Temporal learning model based on a Transformer deep learning model and a Random Forest (RF) model. The multi-head self-attention structure of the Transformer can capture the long-range temporal dependency and complex relationships among multiple environmental parameters, while the Random Forest algorithm can predict the AQI with stable baseline values based on concentrations of pollutants and meteorological variables. The outputs of both models are combined using an ensemble anomaly scoring technique to reduce false alarm rates and improve the detection of anomalous air quality occurrence. Benchmark air quality datasets with measurements of pollutants like PM2.5, PM10, CO, NO₂, SO₂, and O₃ as well as meteorological variables like temperature, humidity, wind speed, and atmospheric pressure are used to apply and assess the suggested framework. The experimental results demonstrate the effectiveness of the proposed hybrid framework in terms of the number of false positives and the accuracy of the anomaly detection, as well as in terms of precision, recall and F1 score, when compared with the existing methods based on machine learning and stand-alone deep learning. The proposed system provides a scalable, intelligent, and reliable solution for smart environmental management, early warning of pollution, and real-time air quality monitoring.





