Transformer encoder for one-step-ahead AQI forecasting using multivariate air-quality monitoring data

Read full text
Authors: Kun-Chou Lee, Shi-Qi Chen
Cited by: 1
References: 7

Abstract

Short-term forecasting of the Air Quality Index (AQI) can support public health risk management and real-time environmental decision-making. In this study, we propose a multivariate, one-step-ahead time-series forecasting approach based on a Transformer encoder. The model predicts the AQI at the next time point using an observation sequence within a fixed historical window (five time steps in this work), where the input features include AQI and other numerical variables. For data preprocessing, the observation time column is converted into a temporal index, missing values are handled using forward-fill, and Min–Max normalization is fitted on the training set and then applied to the test set to prevent data leakage. Supervised learning samples are constructed using a sliding-window scheme, and the dataset is split into training and test sets in chronological order. The proposed model stacks encoder blocks composed of multi-head self-attention and feed-forward networks, and a causal mask is applied in the attention mechanism to ensure that predictions rely only on historical information. The representation at the final time step is fed into a regression head to output the AQI forecast. To improve reproducibility, we fix random seeds and enable deterministic settings during training. Experimental results on the test set show that the proposed method achieves MSE = 19.84, RMSE = 4.45, and MAE = 3.57, demonstrating its ability to capture short-term temporal dependencies and provide stable AQI forecasting performance.

Fields of Study & Subjects

Air Quality Monitoring and Forecasting Air Quality and Health Impacts Atmospheric chemistry and aerosols

Publication details

Journal / source
Frontiers in Environmental Science
Publisher
Frontiers Media SA
Volume
14
Publication date
13 May 2026
Language
EN