Next Article in Journal
J-DEAS: A Jamming-Driven Exponential Adaptive Sleeping Technique for Energy-Aware Mitigation in LoRa Networks
Previous Article in Journal
Networked Predictive Control and Intelligent Diagnostics for Automated Mechatronic Manufacturing and Intralogistics Systems
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Citywide Air Quality Forecasting over Sparse Sensor Networks: Cross-Location Generalization and Deep Learning Reliability Under Missing Data

by
Francisco-Jose Alvarado-Alcon
1,2,
Rafael Asorey-Cacheda
1,2,
Joan Garcia-Haro
1,2,*,
Laura García
1,2 and
Antonio-Javier Garcia-Sanchez
1,2
1
Department of Information and Communications Technologies, Universidad Politécnica de Cartagena, 30202 Cartagena, Spain
2
People Oriented Smart Technologies Laboratory, European Research Group, European University of Technology, European Union
*
Author to whom correspondence should be addressed.
J. Sens. Actuator Netw. 2026, 15(4), 52; https://doi.org/10.3390/jsan15040052
Submission received: 11 May 2026 / Revised: 24 June 2026 / Accepted: 25 June 2026 / Published: 29 June 2026
(This article belongs to the Section Network Services and Applications)

Abstract

Smart city environmental monitoring depends on sparse air quality sensor networks and analytics services that remain reliable under node additions, outages, and missing streams. We propose an operational deep learning framework for citywide cross-location forecasting from a limited set of sensors, delivering low-latency, real-time concentration heatmaps at unsensed locations by combining temporal prediction with spatial regression. We formulate single-stage spatiotemporal forecasting and benchmark nine recurrent, convolutional, and multilayer architectures against classical baselines. The framework forecasts O 3 , NO 2 , PM 2.5 , and PM 10 over horizons from 1 h to 10 days. Using open monitoring data from Madrid (Spain) and Cali (Colombia), we evaluate generalization by holding out stations, reflecting deployment to new sensor nodes and sparse coverage regimes. We further compare missing data handling strategies and show that common imputation can substantially degrade accuracy, increasing RMSE by up to 74% in some settings. Beyond prediction, the framework provides a basis for guiding sensor network densification; confidence estimates can highlight locations where additional sensors may be most beneficial. These results provide actionable guidance for deploying AI-enabled sensing services with robust performance under realistic sensor reliability constraints while supporting real-time citywide mapping.

1. Introduction

The growing trend of urbanization is evident, with approximately 58% of the global population residing in cities as of 2024, according to the United Nations Population Division [1]. Urbanization and industrialization pose challenges such as traffic congestion, healthcare demands, and air quality issues. To tackle these problems and enhance urban living standards, continuous environmental monitoring—from traffic flow to air quality—is essential. Smart cities increasingly leverage the Internet of Things (IoT) to deploy sensor networks comprising monitoring stations that gather data for analysis and support informed decision-making. Many cities have installed air quality sensors that measure various pollutants, and these data are often made publicly accessible, enabling officials, automated platforms, and individuals to take action. This is especially important for vulnerable populations, such as the elderly, children, and those with respiratory conditions, who may experience adverse health effects even at pollution levels considered safe for the general population. In this context, modeling frameworks capable of processing sensor data and delivering timely, actionable insights play a crucial role in urban environmental management.
Forecasting pollutant levels not only provides governments and citizens with more time to take reactive measures, but it also enables proactive strategies to mitigate adverse outcomes. Many major cities have been forced to implement emergency interventions due to pollution episodes, such as traffic restrictions in New Delhi in November 2024 [2,3]. Consequently, research has increasingly focused on urban air quality prediction, particularly in densely populated regions such as India [4], China [5,6], and Tehran [7,8]. Deep learning (DL), a subset of machine learning (ML) based on complex neural networks (NNs), has proven especially effective for modeling frameworks that must manage high-volume, multivariate environmental data, due to its ability to extract high-level patterns from extensive datasets [9,10].
It should be noted that predicting air quality is subject to several limitations. Air pollution is inherently complex, influenced by multiple factors, including natural and anthropogenic sources. Most predictive models rely on extensive historical datasets, as shown in Table 1, where many referenced studies require several years of data. The use of large datasets also increases computational complexity. Additionally, air quality datasets, which span long periods and depend on distributed sensor networks, often contain many missing values. There are additional pain points specific to sparse sensor air quality monitoring. First, the limited number of stations produces incomplete spatial coverage, making it difficult to estimate pollutant levels at unmonitored locations. Second, monitoring streams often contain outages and missing values, which can severely reduce the amount of usable training data or distort the temporal structure when naïve imputation is applied. Third, pollutant dynamics are governed by nonlinear interactions between local emissions, meteorology, and spatial transport, which are difficult to capture with simple interpolation or shallow predictive models. Finally, from a deployment perspective, a useful smart-city system must generalize to locations not seen during training while still supporting low-latency prediction over the whole city but leveraging the shared characteristics of nearby sensors remains challenging due to potential nonlinear spatial correlations among air quality monitoring sites [10].

1.1. Related Work

Numerous papers have addressed air pollutant forecasting, many using deep learning or Bayesian spatiotemporal models. Table 1 contains a summary of the referenced air quality publications. Drewil and Al-Bahadili [4] used genetic algorithms to select the best parameters for an long short-term memory (LSTM) model and predicted four pollutants one day in advance using data between 2017 and 2020. They only tested an LSTM architecture, and found that their proposed NN gave better prediction results than when the parameters were manually fine-tuned. Similarly, the study by Tao et al. [11] predicted PM 2.5 levels using a convolutional-based bidirectional gated recurrent unit (GRU) and Bhatta et al. [12] evaluated different machine learning approaches. However, these works only consider the time dimension.
Table 1. Related works on air quality prediction. For each study, we analyze whether fine-grained cross-location spatial prediction is used to estimate the level of pollutants in places where there are no sensors, or at least whether spatial prediction is used to estimate the pollution at one or multiple locations with a sensor. When air quality forecasting is used, the time lag is expressed in hours, days, or months. We compare which studies require only fixed stations, the pollutants predicted, whether they use deep learning (DL) models, and the length of the dataset used.
Table 1. Related works on air quality prediction. For each study, we analyze whether fine-grained cross-location spatial prediction is used to estimate the level of pollutants in places where there are no sensors, or at least whether spatial prediction is used to estimate the pollution at one or multiple locations with a sensor. When air quality forecasting is used, the time lag is expressed in hours, days, or months. We compare which studies require only fixed stations, the pollutants predicted, whether they use deep learning (DL) models, and the length of the dataset used.
AuthorsCross-Location Spatial PredictionForecastingOnly Uses Fixed StationsPredicted PollutantsDL ModelsData Length
Bougoudis et al. [13]Multiple stations1 hYesCO, NO, O 3 , NO 2 , SO 2 No∼11 years
Apte et al. [14]Fine-grainedNoNoBC, NO, NO 2 No1 year
Hu et al. [15]Fine-grained1 dNo PM 2.5 No1 year
Nicolis et al. [16]Fine-grained1 dYes PM 2.5 No2.5 months
Tao et al. [11]No2 hYes PM 2.5 Yes5 years
Kalajdjieski et al. [17]NoNoYes PM 2.5 Yes2 years
Bekkar et al. [5]One station1 d, 7 dYes PM 2.5 Yes4 years
Fioravanti et al. [18]Fine-grainedNoYes PM 10 No1 year
Shahriar et al. [19]Multiple stations1 dYes PM 2.5 Yes6.5 years
Wan et al. [6]Multiple stations1 h, 2 h, 3 hYes PM 2.5 No2 years
Drewil and Al-Bahadili [4]No1 dYes PM 2.5 , PM 10 , CO, NOXYes∼3 years
Kristiani et al. [20]No8 hYes PM 2.5 Yes∼2 years
Saez and Barceló [21]Fine-grainedNoYes O 3 , NO 2 , PM 2.5 , PM 10 No∼10 years
Baniasadi et al. [7]Fine-grained1 dYes PM 2.5 Yes10 years
Kumar and Pande [22]NoNoYesAQINo6 years
Samad et al. [23]Multiple stationsNoYes NO 2 , PM 2.5 , PM 10 No4.25 years
Rabie et al. [8]No1 yYesAQIYes5 years
Rahman et al. [24]NoNoYesAQI, AQCNo23,463 instances
Wu et al. [25]Fine-grained4 d, 7 d, 10 d, 14 dNo PM 2.5 Yes∼6 years
Yang et al. [26]Fine-grained1 hNo PM 2.5 NoUp to 9 months
Zareba et al. [27]Multiple stations1 dYes PM 2.5 Yes10 years
Illescas-Martinez et al. [28]Fine-grainedNoYes O 3 , NO 2 , PM 2.5 , PM 10 Yes9 years
Xia et al. [29]No1 h–2 dYes NO 2 , PM 2.5 , PM 10 YesUp to 3 years
Zhang et al. [30]Fine-grained4 h–1 dNo NO 2 Yes1 year
Bhatta et al. [12]No1 dYes PM 2.5 No5 years
Panja et al. [31]Multiple stations30–90 dYes NO 2 , PM 2.5 , PM 10 Yes4 years
This workFine-grained1 h, 2 h, 1 d, 4 d, 7 d, 10 dYes O 3 , NO 2 , PM 2.5 , PM 10 YesUp to 6 months
However, urban air pollution exhibits significant spatial variability, often within distances of less than 1 km. This strong spatial variability leads to difficulties complain with the European Air Quality Directive, that requires that “a sampling point must be sited in such a way that the air sampled is representative of air quality for a street segment no less than 100 m in length at traffic-oriented sites” [32]. This is due to the uneven distribution of emission sources, dilution, and environmental factors. Conventional fixed-site monitoring lacks the resolution to detect such localized pollution variations [14]; however, covering entire urban areas with high-density sensing networks would be economically and logistically prohibitive. Studies have explored alternative methods for detailed air quality assessment, such as equipping Google Street View mapping vehicles with air quality measurement tools [14]. To add a spatial dimension to NNs, Baniasadi et al. [7] fine-tuned an LSTM architecture and optimized its parameters using a binary chimp optimization algorithm. However, they interpolated pollution levels throughout Tehran using the Kriging method, a geostatistical linear interpolation method for estimating values at unmeasured locations based on known data points.
Bekkar et al. [5] were able to predict PM 2.5 using different deep learning algorithms; they added an additional spatial dimension to the study by incorporating data from different stations to predict PM 2.5 in a single station. This offered great results in forecasting particulate matter up to a week in advance, but it was employed to predict air quality at a single point rather than throughout the city. Wan et al. [6] developed a spatio-temporal model to predict PM 2.5 concentrations in Beijing, taking into account air pollutants, meteorological variables, and geographical conditions. The model used data from the previous hour from multiple sensors to estimate current PM 2.5 levels. Rabie et al. [8] divided the Tehran megacity in three regions, and they used different DL models to predict the Air Quality Index (AQI) up to one year in advance.
In the work by Zareba et al. [27], global forecasting models (GFMs) were used to predict PM 2.5 levels in the city of Krakow. A GFM is a model that facilitates the concurrent construction of a unified predictive model for multiple, geographically dispersed time series. This means it forecasts all the time series simultaneously. Its objective is to capture the fundamental patterns governing the series, thereby minimizing the potential noise from each series. This methodological framework enabled the authors to effectively forecast air quality in regions with monitoring stations. The work by Shahriar et al. [19] explored the potential of ARIMA-ANN, ARIMA-SVM, Principal Component Regression, Decision Trees, and CatBoost for forecasting PM 2.5 concentrations in Bangladesh. Similarly, Kristiani et al. [20] DL methods for PM 2.5 forecasting in Taiwan. Panja et al. [31] trained spatio-temporal graph convolutional networks to predict long-term air pollution data in 37 monitoring stations across Delhi with a focus on extreme pollutant levels. However, these models can only make predictions in locations where a sensor is placed, they cannot be used to make spatially continuous predictions.
Other works focused on offering more spatially detailed levels of air quality but disregarded the temporal dimension. This allowed pollution levels in regions without stations to be spatially predicted, with the spatial domain ranging from cities to countries. Saez and Barceló [21] used a hierarchical Bayesian spatiotemporal model to predict short- and long-term exposure through different Basic Health Areas in Catalonia, Spain.
Alternatively, the study by Fioravanti et al. [18] employed a Bayesian hierarchical spatio-temporal model to predict daily air pollution concentrations. Namely, they proposed 12 statistical models (one per month) to predict PM 10 across a 1   k m   ×   1   k m grid over Italy. A similar analysis had previously been applied to Santiago de Chile (Nicolis et al. [16]) for PM 2.5 concentrations, where the authors predicted hourly concentrations one day in advance.
Each of these studies took a distinct approach to air quality prediction. The work by Samad et al. [23] sought to foresee different pollutants using several monitoring stations throughout the city to predict pollution in a few locations where other stations were present. They concluded that the pollutants from other monitoring stations as an input feature played a significant role in the estimation and, more interestingly, they observed that the same ML models were able to estimate pollutant concentrations at other locations as well. Hence, the technique could be transferred to other locations where pollutant prediction is required. However, it must be mentioned that each place has its own particularities, whether geographic, urban, or demographic. For example, in the work by Wan et al. [6], the altitude of each point was used as a factor in predicting PM 2.5 in the mountainous city of Beijing, but this information is likely to be of no interest in a city located on a plateau, such as Madrid. Furthermore, the number of monitoring stations varies depending on the size of the city and the resources invested. Therefore, in this study, we have analyzed different cities with different sizes and number of stations and compared the results.
A limited number of studies have combined forecasting and spatial predictions to determine the level of pollution that will cover an entire area using a limited number of fixed monitoring stations. These include the previously mentioned study by Baniasadi et al. [7], which used an LSTM model for forecasting and interpolation for the spatial dimension, and the one by Nicolis et al. [16], which used a Bayesian hierarchical spatio-temporal model to predict daily concentrations of air pollution one day in advance. Other approaches include the spatio-temporal air pollution DL model proposed by Zhang et al. [30] for easter China, which uses spaceborne remote sensing data combined with supplementary weather datasets, and the random forest (RF) model by Hu et al. [15], which combines data from monitoring stations that have been randomly divided into training and validation sets, as well as satellite-derived aerosol optical depth. Xia et al. [29] developed a synchronous graph transformer network to forecast air pollution in a multistep approach, and their results assumed constant pollution across a region.
Recent research by Yang et al. [26] used a Nested Air Quality Prediction Modeling System (a multi-scale air quality modeling system for reproducing atmospheric pollutant transport and evolution) to conduct several sensitivity experiments. This allowed the analysis and comparison of different measures to prevent and reduce air pollution. However, this required meticulous modeling of the area and pollution transfer. A data-driven approach can be implemented more quickly, and DL can learn to model complex transport and evolution dynamics. Finally, the study by Wu et al. [25] aimed to forecast PM 2.5 levels in the forested Heilongjiang Province. The authors focused on forest fires, using these fires as auxiliary inputs for their LSTM model. They favorably tested their model against other architectures and empirically chose the time lag. The analysis revealed that the lowest root mean squared error (RMSE) was achieved with a seven-day forecast rather than a four-day forecast, as might have been expected.
In contrast, the present work formulates spatiotemporal prediction as a single supervised learning problem in which temporal histories from multiple stations and the spatial relation to the target location are processed jointly by one model. This distinction is important because it avoids decoupling temporal forecasting errors from a second interpolation stage and allows the model to learn temporal and cross-location dependencies simultaneously. This makes the approach easily implementable and transferable to other cities, as it relies on routinely available measurements without requiring additional infrastructure. While each model is tailored to a specific city with a fixed number of monitoring stations arranged in a canonical order, the trained weights from one city can also be used to initialize models for other cities, facilitating transfer learning and reducing training effort.

1.2. Contributions

In this work, we propose a DL modeling framework for fine-grained cross-location air quality forecasting that predicts future concentrations of O 3 , NO 2 , PM 2.5 , and PM 10 at arbitrary target locations, including locations without sensors, by learning spatial–temporal dependencies from sparse fixed-station networks. By “cross-location”, we refer to the model’s ability to exploit measurements from multiple monitoring sites to forecast pollutant levels at other (possibly unmonitored) locations. By “fine-grained”, we mean that predictions can be generated on a dense spatial grid, enabling continuous citywide coverage and forecasted air quality heatmaps.
Therefore, this work addresses a practical gap in city-scale air quality prediction under sparse sensing conditions: how to forecast pollutant concentrations at future times and at locations without sensors using only the historical measurements from a limited set of fixed stations. The methodological novelty of this paper is not the introduction of a new neural architecture; instead, it lies in a unified problem formulation and deployment-oriented pipeline that integrates temporal forecasting and cross-location spatial regression in a single model. This approach enables the neural network to concurrently model the temporal evolution and cross-location spatial transfer, facilitating the learning of complex dynamics that could be compromised by the division of the pipeline into temporal and spatial steps. We train and validate on a subset of stations and evaluate on entirely unseen stations, so the test set reflects genuinely unmonitored locations.
Existing studies on air quality prediction span a broad spectrum of methods for temporal forecasting and spatial estimation. While combining spatial and temporal dimensions provides a more complete understanding, the complex, nonlinear dynamics of air pollution often limit the effectiveness of linear models. Our approach addresses this by leveraging deep learning models capable of capturing complex spatial-temporal relationships using only data from fixed sensors. Building on the spatial regression setup of Illescas-Martinez et al. [28], our system extends it to temporal forecasting, enabling future predictions at unobserved locations using only fixed-station data. Additionally, we obtained our results using shorter datasets than those used in many of the works analyzed in Table 1, which lowers the data-collection burden and facilitates deployment.
We evaluate the approach in two cities—Madrid, Spain and Cali, Colombia—which differ in sensor density, geography, and sample size. To support reproducibility, the dataset is publicly released in Zenodo [33]. We further benchmark recurrent and convolutional architectures (convolutional neural network (CNN), GRU, LSTM, Multipath-CNN-LSTM (MCNNLSTM), GRU×2, LSTM×2, LSTMGRU, bidirectional long short-term memory (BiLSTM)) against classical baselines (naïve forecast, RF, linear regression (LR)) to identify robust configurations across pollutants and forecast horizons (1 h, 2 h, 1 day, 4 days, 7 days, and 10 days).
In this context, the main contributions of this paper are summarized below:
  • We formulate and implement a single-stage DL regression model that jointly learns temporal dependencies from multi-station histories and spatial transfer to a target location via distance-conditioned inputs, enabling forecasting at unmonitored locations without requiring mobile sensing or dense deployments.
  • We provide an end-to-end pipeline (from sparse fixed-station data preprocessing and sample construction to citywide forecasted heatmap generation) and evaluate generalization under a strict hold-out-location setting, where test sensors are never seen during training/validation, reflecting realistic deployment to unmonitored areas.
  • We demonstrate the practical potential of the proposed system to support real-world monitoring by enabling the generation of fine-grained citywide pollution heatmaps and by reporting low inference times that make near real-time heatmap updates feasible.
  • We perform a comprehensive comparison of deep NN architectures and classical baselines across cities, pollutants, and horizons, and we quantify the impact of missing-data strategies, showing that common imputation can substantially degrade forecasting accuracy and that data quality may outweigh data quantity.
  • We complement performance results with model interpretability analyses using permutation importance and shapley additive explanations (SHAP), clarifying which input variables and past timesteps most influence predictions across pollutants and cities.
The rest of the paper is organized as follows. Section 2 discusses the different deep learning models analyzed in this work, and Section 3 describes the detailed methodology for the proposed approach. Results are provided in Section 4, and Section 5 concludes the paper.

2. Deep Learning Models

In this section, we briefly discuss the different DL models that have been examined in this study. We adopted the model architectures and hyperparameters reported by Illescas-Martinez et al. [28], where the hyperparameters had been tuned using a Random Search strategy. That work investigated cross-location air pollutant prediction, facilitating the inference of city-wide air quality heatmaps. The present study builds upon that foundation by integrating temporal forecasting with spatial prediction, and focuses on comparing architectures, cities, and missing-data strategies under a consistent configuration.
DL becomes saturated when inappropriate activation functions are selected [9,34]. To avoid this problem, the activation layer has been set as ReLU when applicable, except for the output layer, where it has been set as sigmoid, thereby restricting the output to the known range of values. Weights were initialized using the Glorot Uniform initializer, which has been shown to improve convergence in deep networks (Glorot and Bengio [34]). Mean squared error (MSE) was selected as the loss metric, as it is standard for regression tasks, and RMSprop was used as the optimizer due to its proven performance in air quality forecasting scenarios [11]. The output layer is a dense layer with a single unit, appropriate for predicting a single continuous value. A summary of the deep learning architectures is provided in Table 2 at the end of this section.
All DL experiments used the same training configuration: RMSprop optimizer, batch size 64, early stopping patience 100, and TensorFlow default optimizer parameters (learning rate 0.001, rho 0.9, momentum 0.0, epsilon 1 × 10 − 7 ), so that the comparison across architectures, pollutants, and time horizons isolates the effect of model design rather than changes in architecture or optimization settings. The maximum number of epochs was set high enough that early stopping always acted as the termination criterion. Loss-versus-epoch plots for the trained models are provided in [35] to illustrate training performance.

2.1. CNN

A convolutional layer is a layer within an artificial neural network that applies convolutions to the input. Convolution involves sliding a filter or kernel across the input, which is typically a two-dimensional or three-dimensional matrix, and performing a scalar product between the filter and the region of the input it covers. In the model in this paper, the convolutional layers have been constructed using one-dimensional kernels that move through the sequence (unlike images where 2D convolutions are used). These kernels act as filters that learn during training.
The CNN model in this paper uses a 1D convolutional layer with 64 filters with a kernel size of 3, followed by a Max Pool of size 2, a dense layer with 32 nodes, a dense layer with 16 nodes, and the output layer.

2.2. GRU

While the convolutional layer focuses on extracting local features and spatial patterns, GRU is a recurrent layer used in recurrent neural networks (RNNs) that adds a temporal dimension to the analysis. A GRU layer is a gating mechanism consisting of two gates: an update gate (z) and a reset gate (r). The update gate decides which information gets transferred to the next hidden state, while the reset gate determines the information to be discarded from the previous hidden state. The GRU layer also has a candidate unit ( h ∼ ), which computes the candidate hidden state based on the current input and the previous hidden state. The final hidden state (h) is achieved by combining the previous hidden state and the candidate hidden state according to the update gate.
The GRU model in this paper uses a GRU layer with 64 units, followed by a dense layer with 32 nodes, and the output layer.

2.3. LSTM

An LSTM layer is a recurrent neural network capable of learning and retaining long-term dependencies within sequential data, such as text, audio, or time series. In addition to the hidden state in traditional RNNs, an LSTM has three gates: an input gate that determines whether to let the new input in, a forget gate that deletes unimportant information, and an output gate that decides what information to output. These three gates are analogical gates based on the sigmoid function, which works in the range between 0 and 1. These gates are structures composed of linear layers and activation functions that regulate the flow of information between the cells of the LSTM layer.
The LSTM model in this paper uses an LSTM layer with 64 units, followed by a dense layer with 32 nodes, and the output layer.

2.4. MCNNLSTM

Classical CNN architecture is usually considered the best choice when the input networks are 2D or 3D tensors like images or videos. Since LSTM architectures are better adapted for 1D data, there are multiple approaches to combining CNN and LSTM that attempt to incorporate the positive aspects of both NNs. In this work, we opt for processing the input of both layers simultaneously and then concatenating the results, which are finally processed by a dense layer.
The Multipath-CNN-LSTM model in this paper uses a 1D convolutional layer with 64 filters with a kernel size of 3, followed by a Max Pool of size 2, and a dense layer with 32 nodes (similar to the proposed CNN). In parallel, we use an LSTM layer with 64 units, followed by a dropout layer with a drop rate of 0.2 and a global average pooling 1D layer. Both outputs are concatenated and connected to the output layer. This model is referred to as MCNNLSTM.
Alternatively, the MCNNLSTMv2 model in this paper uses a 1D convolutional layer with 64 filters with a kernel size of 3, followed by a 1D convolutional layer with 32 filters with a kernel size of 3 and a dense layer with 16 nodes. In parallel, we use an LSTM layer with 64 units, followed by a dropout layer with a drop rate of 0.1, a dense layer with 32 nodes, and a dense layer with 16 nodes. Both outputs are concatenated and connected to a dense layer with 8 nodes, followed by the output layer.

2.5. GRU×2

Using two consecutive GRU layers enhances the model’s ability to capture complex temporal dependencies in sequential data. The first GRU layer processes the input sequence and extracts temporal patterns, while the second layer refines these patterns by modeling higher-level representations. This hierarchical structure allows the model to learn short-term and long-term dependencies more effectively, allowing for improved predictive accuracy.
The GRU×2 model in this paper uses a GRU layer with 64 units, followed by a GRU layer with 32 units, a dropout layer with a drop rate of 0.2, and the output layer.

2.6. LSTM×2

Similar to the GRU×2 model, the LSTM×2 model in this paper uses an LSTM layer with 64 units, followed by an LSTM layer with 32 units, a dropout layer with a drop rate of 0.2, and the output layer.

2.7. LSTMGRU

Like the previous models, combining two consecutive recurrent layers may improve predictive accuracy. The LSTMGRU model in this paper uses an LSTM layer with 64 units, followed by a GRU layer with 32 units, a dense layer with 32 units, a dropout layer with a drop rate of 0.2, and the output layer.

2.8. BiLSTM

Standard RNNs and LSTMs often ignore future information during temporal processing; however, BiLSTMs are capable of leveraging future information. In essence, a BiLSTM is a sequence processing model consisting of two LSTMs, one taking the input in a forward direction and the other in a backward direction. BiLSTMs effectively increase the amount of information available to the network, improving the context available to the algorithm. Moreover, both LSTMs are connected to an input and output layer, enabling the output layer to obtain past information from each point of the input sequence and obtain future information from each point through this structure.
The BiLSTM model in this paper uses a bidirectional LSTM layer with 64 units, followed by a dropout layer with a drop rate of 0.2, and the output layer.

3. Materials and Methods

Our dataset consists of 213,297 records from two cities—Madrid, Spain and Cali, Colombia—collected via the AQI India API [36], which provides transparent access to air quality measurements independently of the original data source. As a result, the retrieved records may originate from heterogeneous sources, including official air quality monitoring stations and other sensing devices such as user-deployed or IoT sensors. Since the API does not systematically provide metadata describing the sensing technology or analyzer used at each station, the present work does not distinguish between data sources and treats all measurements uniformly within the proposed framework. Nevertheless, most of the data used in this study come from the official monitoring stations deployed by the town halls of Madrid and Cali for their respective cities. Table 3 indicates the number of sensors per city and the time interval when the values were recorded. The data from most stations are used to create a training dataset, employed for training and validation. A summary of the data statistics is presented in Table 4 after outlier removal.
These data must be divided into the stations used as inputs and stations used as labels, and then they are randomly divided so that 80% of the samples are used for training and 20% for validation. Finally, the remaining sensors are used to test the trained nets, which are never exposed to these stations during training or validation and therefore represent virtually unmonitored locations from the model’s perspective. Madrid has 15 sensors that have been randomly divided into 10 input sensors, 3 label sensors, and 2 test sensors. For Cali, there are 9 sensors that provide reliable measurements, 7 of which have been randomly selected as inputs and the other 2 as labels. The remaining 9 sensors, which provided data with less frequency, were used for testing. The random partitioning of stations follows standard machine learning evaluation practices for estimating model performance [15,37] while avoiding manual selection bias. However, alternative validation schemes also exist for spatially structured data. For example, Alazmi and Rakha [38] compared random, spatial, and spatiotemporal cross-validation strategies and showed that random partitioning can lead to better apparent performance, whereas spatial partitioning avoids placing geographically close locations in both training and test sets. As a result, spatially blocked validation may provide a more stringent assessment when the goal is geographical extrapolation to unseen regions, while the random partition adopted here is intended to evaluate cross-location interpolation within the same urban domain. These stations are geographically represented in Figure 1 and Figure 2. To facilitate the academic community’s evaluation of the models against the results of this work, the dataset used has been published in Zenodo [33].
Madrid sits on Spain’s high central plateau with relatively open terrain. Urban traffic is the primary local source of air pollutants, while episodic Saharan dust intrusions can raise particulate levels (Dirección General de Sostenibilidad y Control Ambiental [39]). Cali lies on the Cauca River valley floor between Andean ranges. Local emissions are dominated by mobile sources, with seasonal regional biomass burning contributing to elevated particulate matter (Mateus-Fontecha et al. [40]). These geographic and source patterns frame the baseline concentrations and variability that are relevant to forecasting. Both cities are densely populated, with 3.5 and 2.3 million inhabitants, respectively. This work focuses on these cities because pollution poses a greater risk in densely populated areas where people and industry, making air quality monitoring more important. However, changes in model behavior may be expected in entirely different areas.
Figure 1. Cali monitoring stations and PM 2.5 prediction for Cali. The heatmap delineates the study area and does not necessarily reflect officially recognized administrative boundaries. Map data from OpenStreetMap contributors [41]. Study area: 13.2 × 27.2 km (359 km 2 ).
Figure 1. Cali monitoring stations and PM 2.5 prediction for Cali. The heatmap delineates the study area and does not necessarily reflect officially recognized administrative boundaries. Map data from OpenStreetMap contributors [41]. Study area: 13.2 × 27.2 km (359 km 2 ).
Jsan 15 00052 g001
Figure 2. Madrid monitoring stations and PM 10 prediction for Madrid. The heatmap delineates the study area and does not necessarily reflect officially recognized administrative boundaries. Map data from OpenStreetMap contributors [41]. Study area: 76.2 × 61.2 km (4659 km ).
Figure 2. Madrid monitoring stations and PM 10 prediction for Madrid. The heatmap delineates the study area and does not necessarily reflect officially recognized administrative boundaries. Map data from OpenStreetMap contributors [41]. Study area: 76.2 × 61.2 km (4659 km ).
Jsan 15 00052 g002

3.1. Data Preprocessing

Air quality monitoring systems are prone to data loss and corruption due to issues such as equipment failure, server connectivity problems, power outages, and other uncontrollable factors. Missing or erroneous values can adversely affect data mining and model performance. To mitigate these issues and optimize model training, we applied a series of preprocessing steps, as outlined below.

3.1.1. Data Collection

Initially, the data from each city was organized into separate files, with each record containing the following relevant features: timestamp, station identifier, latitude, longitude, temperature, humidity, dew point, and pollutant concentrations ( O 3 , NO 2 , PM 2.5 , PM 10 , CO, and SO 2 ).

3.1.2. Outlier Removal

Invalid and extreme outlier values were identified and removed to ensure data quality. Records with pollutant values exceeding 10 15 (likely artifacts caused by system errors) and negative values (physically implausible for pollutant concentrations) were excluded, accounting for approximately 0.1% of the total dataset. Subsequently, statistical outliers were removed using the interquartile range (IQR) method, where values falling outside three times the IQR for a given pollutant were considered outliers. A very small number of relative-humidity values slightly above 100% remained after preprocessing; these were retained because they were rare, close to the physical limit, and could not be confidently classified as erroneous without introducing an ad hoc filtering rule.

3.1.3. Data Aggregation

A manual inspection revealed that, while sensors typically reported data simultaneously, the sampling intervals varied, ranging from 15 min to over an hour. To standardize the data, timestamps were rounded to the nearest hour. Measurements were then aggregated by timestamp and station, computing the mean when multiple observations existed for the same hour and station. This step produced an evenly spaced temporal dataset and ensured the alignment of simultaneous measurements from different sensors. Table 5 contains a data sample for a specific hour in Cali.

3.1.4. Handling Missing Values

Various strategies were considered to address missing values, including filling with the last observed value (Kalajdjieski et al. [17]), substituting zeros (Drewil and Al-Bahadili [4]), using the mean or median for each feature (Kumar and Pande [22]), and using splines (Bekkar et al. [5], Baniasadi et al. [7]). The advantages of these methods were discussed by Bougoudis et al. [13]. This paper evaluates and compares different approaches to determine the most suitable method for the given dataset. By default, missing values are discarded. These methods are detailed and analyzed in Section 3.4, and the most suitable method is selected. In any case, only the records used as inputs for the predictions were filled, never the labels.

3.1.5. Data Normalization

To facilitate model training and ensure consistent scaling across features, pollutant concentrations, meteorological variables, and distance were normalized to the [ 0 , 1 ] range for each city, with normalization parameters computed on the training and validation data.

3.1.6. Time Window

As will be shown in Section 3.4, we chose not to impute all the missing values. As a result, the dataset does not contain continuous records for all the stations at all times. An analysis of the data revealed continuous periods of time when malfunction was common—likely due to hardware or software errors that were later corrected. To construct the samples, we used a rolling window approach, which requires a continuous sequence of records spanning the input window plus the target record. For every sample, we tested whether we had enough continuous data to fill the time window used for prediction and the predicted values. Only when no missing data was present in this time frame was the set of records added to the final dataset. The selected time window size is 24 h, meaning that if we want to make predictions for 1 h into the future, each sample requires 25 continuous hours of records.

3.1.7. Formatting

Each input sample contains the selected values from each station used as input plus the distance between said station and the point where we want to predict the pollutant calculated with the haversine formula. Although distance is time-invariant, it is included at each timestep of the input window together with the temporal features. This allows the model to process spatial and temporal information jointly in a unified input representation. For example, for Cali, where 7 stations are used as inputs, if we select 4 different features as inputs, the input size will be 7 × ( 4 + 1 ) = 35 for each timestamp, vectorized so that the order of the stations is always constant. Sorting the sensors in canonical order enables the model to recognize that each input originates from a particular station, learning the particular spatial characteristics that define each sensing location. The records from Table 5 have been formatted in Table 6 as part of a valid sample, where the selected features are NO 2 , PM 2.5 , PM 10 , and CO.
Importantly, this setting differs from conventional air quality time series forecasting: the objective is not to predict the next value of any monitored station’s time series, but to forecast the pollutant at a different target location. Thus, the predicted value does not belong to a time series directly observed by the model, which makes classical single-series approaches such as ARIMA/SARIMA (defined for a fixed, observed sequence) not directly applicable to this pipeline.

3.2. Feature Selection

A correlation-based feature selection technique was employed in this study to identify the optimal set of input variables to develop a predictive model. This method calculates the statistical correlation between each input variable and the target variable. Specifically, the Pearson correlation coefficient (which quantifies the linear relationship between two datasets) was used, similarly to the approach by Kristiani et al. [20]. Variables with the highest correlation to the target variable were selected for further analysis. To mitigate the effects of outliers and differences in scale, the correlation coefficients were computed after normalizing the data. Features with a Pearson correlation coefficient of at least 0.4 in a city were selected as inputs for the predictive model.
O 3 was predicted using O 3 , temperature, and dew point values. NO 2 predictions relied on NO 2 , PM 2.5 , PM 10 , and CO. PM 2.5 was predicted using NO 2 , PM 2.5 , and PM 10 . Finally, PM 10 predictions used NO 2 , PM 2.5 , PM 10 , and CO as input variables.

3.3. Model Selection

The most suitable model for each prediction was identified among all the models described in Section 2. It had been hypothesized that not every pollutant or every time interval would achieve the best performance with the same model. To test this, a model was trained for each pollutant and time interval, and the RMSE in the validation set was compared. Each NN was trained with three different seeds, and we report the average performance across seeds. Table A1, Table A2, Table A3, Table A4, Table A5, and Table A6, respectively, corresponding to the analyzed time intervals (1 h, 2 h, 1 d, 4 d, 7 d, and 10 d), contain the mean RMSE obtained in the validation set when no imputation technique was used for every target pollutant, model, and city. The methods that minimized the mean RMSE in the validation set were selected for each pollutant, time horizon, and city. The models that have been selected are indicated in bold in Table A1, Table A2, Table A3, Table A4, Table A5 and Table A6. The tables also contain RMSE values for a LR model and a RF regressor with 100 trees. This allows for the contextualization of the improvement achieved by deep learning.

3.4. Imputation Technique Selection

As discussed earlier, this study explores different strategies for handling missing data, each of which impacts the final dataset size. The first strategy involves excluding all records with missing values. The second strategy fills gaps of up to one hour using the last available value from the same sensor; however, gaps exceeding one hour remain unfilled. The third strategy builds on the second by imputing any remaining missing values with the mean or median pollutant concentration, but only for timestamps where at least half of the sensors provided valid data. If not enough valid records were available for a particular timestamp, this imputation strategy was not performed for that timestamp. Finally, the last strategy, which is the most aggressive, uses the traditional approach of imputing all missing values with the mean. The application of these imputation techniques was exclusive to records from input stations and not to target labels.
Figure 3 provides an overview of the number of valid records retained per city after applying each missing value handling technique, not counting any record with missing values. To account for time window constraints, Figure 4 illustrates the number of samples available for each dataset after the preprocessing steps described in Section 3.1.6. For each city, datasets are presented for six prediction horizons: one hour, two hours, one day, four days, seven days, and ten days into the future.
For the selected features and models, three distinct neural networks were trained for each of the approaches described for handling missing values. The method that minimized the mean RMSE in the validation set was chosen for each city. The selected imputation techniques have been marked in bold in Table A7.
In an operational deployment, the framework can be configured to prioritize either forecast continuity or forecast reliability. In the present study, we adopt a reliability-oriented setting in which the model is updated only when the inference input satisfies the same completeness requirements used during training. This choice is motivated by the fact that, as will be shown in the Results section, once a valid input window can be constructed, the proposed framework is highly resilient to random missing values: even when a substantial fraction of the input variables is replaced by feature-wise mean values, the increase in prediction error remains moderate. However, real-world outages rarely occur as isolated missing values. In practice, sensor failures or communication problems usually produce structured gaps over extended periods, which may remove the data of multiple stations for longer than the 24-h sliding window and therefore reduce the available spatial information. Under these conditions, a more aggressive imputation strategy could still be applied to force prediction generation, but our results show that such approaches may substantially degrade predictive accuracy. For this reason, when the available data are insufficient to support a reliable update, the framework can instead rely on previously generated longer-horizon forecasts, whose expected error is already characterized. This design reflects a deliberate operational trade-off between heatmap continuity and forecast trustworthiness in sparse and imperfect sensing environments.

4. Results

This section presents the results of our proposed deep learning modeling framework for air quality forecasting, focusing on model selection and imputation strategies. We report performance across different pollutants, cities, and prediction horizons, evaluating the models using different metrics. RMSE is reported in this section, while the rest of the metrics ( R 2 , mean absolute error (MAE), symmetric mean absolute percentage error (SMAPE), and mean bias error (MBE)) are provided in Appendix B. The outcomes are analyzed to highlight the improvements achieved through optimal model configuration and data preprocessing.
To contextualize the results presented in this section, we first report the RMSE obtained using a simple non-learning baseline in Table 7. This baseline combines a naïve temporal forecast (assuming that the value at the target time is equal to the most recent observed value) and a nearest-neighbor spatial approximation (assigning to each location the value measured at the closest monitoring station). This baseline provides a practical reference point for evaluating the error reduction achieved by the proposed models relative to a simple continuity-based assumption. Compared with global statistical descriptors such as the standard deviation, this approach offers a more realistic benchmark because it explicitly accounts for both temporal persistence and spatial proximity. From these results, it can be observed that pollutant concentrations in Madrid exhibit higher variability than in Cali, which implies that all models, including the proposed deep learning approaches, are expected to face a more challenging prediction task in Madrid.

4.1. Model and Imputation Technique Selection

Table 8 contains the RMSE for the selected models, and Table A8, Table A9, Table A10 and Table A11 contain additional metrics for said models. In terms of R 2 , PM 2.5 shows the worst performance (on average, 0.8973) whereas PM 10 shows the worst RMSE (on average, 2.3515   μ g   m − 3 ) due to the greater variability of this pollutant. Note that since the precision of all the input parameters is one unit, arguably, an error of less than one should not be relevant. A real inference scenario is illustrated in Figure 1 and Figure 2, which also show the location of the monitoring stations and the area of study.
We have observed that selecting the optimal model and imputation technique is a choice that depends on the time lag, the pollutant being predicted, and the city where it is being applied. Out of all the models considered in the 48 cases shown in Table A1, Table A2, Table A3, Table A4, Table A5 and Table A6, LSTM was selected 3 times, GRU×2 13 times, LSTM×2 18 times, LSTMGRU 12 times, and BiLSTM twice. Despite CNN’s great ability to recognize patterns, its performance is not as good as models specifically designed for time series. Likewise, neither version of MCNNLSTM was the best option for any of the analyzed cases, and GRU, RF, and LR were possibly too simple for the problem at hand, as we can see a clear dominance of models with two recursive layers. Interestingly, the dominance of LSTM×2 for 1-hour forecasting is notable, whereas for longer time lags, GRU×2 and LSTMGRU offer comparable results. For Cali predictions, there is no significant difference between these three models with two recursive layers, whereas in Madrid, we see a dominance of the LSTM×2 model. Baseline models (RF and LR) fail to offer meaningful predictions, especially for Madrid, which has a smaller dataset. They lead to a 72.5% and 203.1% increase in RMSE compared to the optimal choice, respectively. For Cali, they perform better, but still undoubtedly worse that the DL architectures proposed.
The comparison of model architectures can be interpreted as an ablation study on temporal depth and architectural composition. Single-layer recurrent models (GRU, LSTM) capture short-term dependencies, whereas two-layer recurrent architectures (GRU×2, LSTM×2, LSTMGRU) provide a hierarchical temporal representation that consistently yields better performance across pollutants and forecasting horizons, indicating the presence of multi-scale temporal dynamics in air quality time series. In contrast, although the multipath models combine CNN and LSTM branches and can be viewed as an ablation of complementary feature extractors (capturing local temporal patterns and sequential dependencies) their joint representation does not translate into superior performance, as they are never selected as the best-performing models. This result is consistent with the observed behavior of the standalone CNN models, which also fail to outperform recurrent architectures in this framework. This suggests that the extraction of temporal dependencies is more effectively handled by recurrent structures than by convolutional layers in this setting. Overall, these findings indicate that increasing temporal depth within recurrent networks is more beneficial than combining heterogeneous branches, highlighting the dominant role of hierarchical temporal modeling over architectural diversity for this task.
Regarding the imputation technique, our results show that in most cases the optimal strategy is to discard missing values rather than indiscriminately replacing them with the mean or median. This finding indicates that data quality is more critical than data quantity: a smaller but more reliable dataset can yield better predictive performance than a larger dataset contaminated by poorly imputed values. Consequently, traditional imputation strategies that do not account for data availability or reliability may degrade model performance. As shown in Table A7, the most severe degradation due to traditional imputation occurred for Cali PM 10 forecasting with a 1-day time lag, where the RMSE increased by 74.3% relative to the optimal configuration.
For Madrid (where, as discussed in Section 3.4, the dataset was smaller but highly reliable, with 82.7% of valid records), we found that for more than half of the scenarios, the best approach was to discard the missing values or apply continuity for one hour. For Cali, with merely 30.5% of valid records, no imputation was usually the best approach, with the traditional approach performing better only once. In general, the enhancement achieved by joint model optimization and imputation technique selection is substantial: deviations from the best configuration resulted in RMSE increases ranging from 14.1% to 115.3%. On average, our optimized approach outperformed the worst DL model by 37.9% (by 203.8% if considering RF and LR) and the worst imputation strategy by 26.6% across all cities, pollutants, and time intervals, amounting to an average improvement of 48.9%.
By analyzing autocorrelation at a 24-h lag, we assess the strength of the daily periodicity for each pollutant across different topics. The different imputation strategies have little impact on variables that already exhibit a strong 24-h cycle, such as temperature and ozone, indicating that their intrinsic daily structure is robust to missing-data handling. In contrast, pollutants with weaker inherent periodicity are more sensitive to the imputation method, with CO being the most affected, showing a noticeable reduction in its 24-h autocorrelation. These results are consistent with the previously observed behavior: PM 10 exhibits the most significant degradation when using the most aggressive imputation, and it is also the only pollutant that uses CO as an input feature. This suggests that the loss of temporal structure in CO propagates through the modeling pipeline and contributes to the reduced performance of PM 10 forecasting.

4.2. Evaluation on Unobserved Monitoring Sites

To assess the accuracy of our model in predicting pollution levels across the city, we have evaluated the performance of our trained model compared to locations that were not used during the training process. Specifically, the levels of the four pollutants ( O 3 , NO 2 , PM 2.5 , and PM 10 ) were inferred by the test sensors. The results are presented in Table 9, which shows the RMSE, and in Table A12, Table A13, Table A14 and Table A15, which show the rest of the metrics. RMSE and R 2 are graphically represented in Figure 5 and Figure 6. As expected, performance was worse when tested against new locations than when tested against the validation set. Nevertheless, the results are still promising, with an average RMSE of 3.87 ppb for O 3 , 3.78 ppb for NO 2 , 3.95   μ g   m − 3 for PM 2.5 , and 6.44   μ g   m − 3 for PM 10 . The models, which were initially developed for short-term forecasting (up to one day), exhibit anomalous behavior in a few extended-period scenarios, as evidenced by negative R 2 values in two scenarios.Negative R 2 values indicate that, in those scenarios, the model performed worse than a constant predictor equal to the mean of the target variable. This is likely attributable to an inability to adequately capture long-term anthropogenic pollution sources, a deficiency that could be addressed by expanding the time frame under consideration and incorporating additional inputs, such as the day of the week.
This finding aligns with the conclusions drawn from prior studies, which indicate that a longer time lag does not necessarily equate with a decline in prediction accuracy. For NO 2 , the optimal results are attained for the extended 1-day time lag, whereas O 3 keeps a stable performance across time lags for Cali but degrades beyond 1-day for Madrid. The behavior of PM 10 and PM 2.5 differs between the two cities, with greater PM 2.5 precision observed for a 4-day time lag in Cali and a 10-day time lag in Madrid, and better PM 10 results for 7 days and 1 hour in Madrid, respectively.

4.3. Model Analysis

To add some insight on interpretability, a feature importance analysis is included. For each trained model we computed permutation importance by randomly shuffling the values of a single input feature across the test set (without changing the time dimension) and measuring the resulting increase in RMSE. A larger RMSE growth indicates greater feature importance because perturbing that feature degrades predictive performance more strongly. Figure 7 reports the average RMSE increase per feature for each pollutant. Results show the expected pattern for NO 2 : The pollutant’s own past values are consistently the most important predictor. However, for PM 10 , permuting NO 2 produces the largest RMSE increase, indicating a strong predictive link between NO 2 and PM 10 in our datasets. For O 3 , temperature is the most influential feature, while for PM 2.5 the importance is more uniformly distributed across the considered inputs. We also observe city-specific differences: for example, CO is a key contributor to NO 2 prediction in Madrid but is comparatively less important in Cali.
These feature-importance patterns are consistent with the physical and urban context of the studied areas, although they should be interpreted as learned statistical associations rather than direct causal attribution. For O 3 , the dominant role of temperature is coherent with the photochemical production of ozone, which is strongly modulated by solar radiation and thermal conditions. For NO 2 , the strong importance of the pollutant’s own recent history, together with the contribution of CO in Madrid, is compatible with the influence of combustion-related urban traffic emissions, which are a major local source in both cities and particularly relevant in Madrid. In the case of PM 10 , the high relevance of NO 2 suggests that the model is exploiting traffic-related co-variation, likely linked to both exhaust emissions and mechanically resuspended road dust. This interpretation is also consistent with the known source context of Madrid, where traffic dominates and episodic Saharan dust intrusions can further increase particulate concentrations, and of Cali, where particulate matter is influenced not only by mobile sources but also by seasonal regional biomass burning. The more uniform importance distribution observed for PM 2.5 is also reasonable, as fine particulate matter often reflects the combined effect of several correlated variables rather than a single dominant predictor.
To examine the temporal contribution of past observations, we applied a SHAP analysis (Lundberg and Lee [42]). SHAP is an interpretability method based on cooperative game theory that quantifies the contribution of each input feature to a given prediction. In our case, it was used to estimate the relative importance of past timesteps by measuring how much each temporal input contributes to the model output. We used the PM 10 model (single seed) as a representative example. The SHAP analysis used a background set of 100 samples and explained predictions for a random subset of 150 test samples; the model was re-evaluated 25 times to stabilize estimates. We averaged the absolute SHAP values per time-lag to obtain a single importance score for each past timestep. Figure 8 presents these timestep-averaged SHAP values across forecast horizons normalized to the range [ 0 , 1 ] . In both cities the most recent timestep is generally the most important predictor, but temporal importance is more evenly distributed in Cali. In Madrid (which has a shorter dataset), some long-horizon models (1-, 4-, and 7-day forecasts) rely on a narrower set of recent timesteps, suggesting a reduced capacity to capture long-term temporal structure. These temporal relevance patterns suggest that the models rely on different balances of short-term persistence and distributed temporal context depending on the city and forecast horizon, which is plausible given the differences in data availability, source mixture, and atmospheric variability between Madrid and Cali. Alternatively, averaging the SHAP values across features reveals that PM10 is the most influential predictor in Cali, whereas PM2.5 and distance contribute the least. In Madrid, PM10 and CO emerge as the most important predictors, while distance remains the least relevant feature. This indicates that temporal dynamics play a more significant role in PM10 forecasting than spatial relationships. However, distance is the dominant feature for the 1-day forecasting horizon, likely because temporal variability is partially constrained by periodic behavior at short lead times, but its importance progressively declines for longer forecasting horizons.
Regarding the training speed, the average training time for each of the selected models is included in Table 10. The number of samples used for Cali is, approximately, three times higher. However, the training takes 5.4 times longer, on average. All the experiments were conducted on a system equipped with 144 Intel® Xeon® Gold 5220 CPUs except for the ozone models, which additionally used a NVIDIA® Tesla® M10.
To offer a meaningful comparison between our model and the work of other authors, we have selected PM 2.5 , the most widely studied pollutant in the literature. Coincidentally, it was the pollutant that gave the worst performance in the validation set in terms of R 2 , as evidenced by Table A8. Figure 9 presents a comparative overview of our results against those reported in other studies from Section 1.1, which also address simultaneous spatial prediction and temporal forecasting for PM 2.5 . The comparison includes published results from Baniasadi et al. [7], Yang et al. [26] (averaging all the stations listed in Table 2 of their study), Nicolis et al. [16] (who did not report R 2 for temporal forecasting), and Wu et al. [25] (for whom we selected the best-performing time lag, 7 days, among their four proposed horizons). It is important to note that these results were obtained under different conditions—each study used its own dataset, city, model, and forecasting horizon—which should be considered when interpreting the comparison. Furthermore, since most studies assess model performance at sensor locations seen during training, we used our validation set results to ensure a more equitable comparison framework.
Among the reviewed studies, Baniasadi et al. [7] demonstrated comparable performance by employing an LSTM model that was optimized with a binary chimp optimization algorithm. However, it should be noted that the model was trained using a dataset that spanned a decade, a significantly more extensive dataset than the one used in this study. The required effort and computation cost of training a model with such a large dataset may not justify the marginal gains, especially when our models achieved similar results with far fewer data. Additionally, urban environments evolve continuously, and data from a decade ago may no longer reflect current conditions. Thus, excessively long datasets may even hinder model performance by introducing outdated patterns that are no longer representative of the present-day cityscape.
For most pollutants and time lags, the best-performing model for Madrid tended to achieve higher R 2 scores than the best-performing model for Cali. However, it should be noted that pollutants may have a seasonal variance, and some studies (Fioravanti et al. [18]) have even developed separate models for each month. To analyze these results, we tested the same models against the data from the last two weeks of December. Results are shown in Table 11, and additional metrics are provided in Table A16, Table A17 and Table A18. Specifically, the RMSE increased an average of 25.8% for the Cali predictions and 52.4% for the Madrid predictions. This loss of precision is especially significant for NO 2 and for longer-term forecasting. Given the limited number of results, we have opted not to include the R 2 metric, as it tends to be misleading for a small number of samples.
While these results may initially appear to support the approach of model separation by time intervals, performance significantly degrades when we are out of the training time range by up to two weeks. Although the levels of pollutants exhibit seasonal patterns, they are not periodic and vary from year to year. By separating the model by months, we not only reduce the size of the training dataset by twelve, but we also intentionally introduce overfitting into our model, which degrades its ability to generalize. Therefore, the model’s ability to make predictions for unseen pollution levels is diminished.
To analyze the temporal stability of the proposed deep learning framework, we retrained the selected models using an extended dataset, which is also publicly available in Alvarado-Alcon et al. [33]. This dataset spans from the initial dates reported in Table 3 up to 25 April 2026, thus covering more than one full year for both cities. We preserved the same preprocessing pipeline and station partitioning used in the previous experiments, ensuring that evaluation remains based on held-out monitoring stations. For this extended setting, samples up to 10 September 2026 were used for training and validation, while the final 7.5 months were reserved for testing, thereby enabling evaluation on both unseen locations and unseen future time periods. The results, summarized in Table 12, show that the proposed framework remains effective when trained on longer and more diverse datasets. In many cases, particularly for shorter forecasting horizons, the models achieve lower RMSE values than in the original experiments, indicating improved stability and learning from the increased data volume. However, a degradation in performance can still be observed for longer forecasting horizons (7 and 10 days), which remain inherently more challenging due to the increased uncertainty and weaker temporal correlations at extended lead times.
To assess operational robustness under missing data, we performed an additional experiment on the extended test subset in which non-distance input values from already constructed sliding windows were randomly replaced by the mean value of the corresponding feature and timestep (or by 0.5 when all values for a given feature and timestep were removed). The results show that the framework is highly resilient to randomly distributed missingness once a valid input window can be constructed. In Madrid, averaging across pollutants and forecast horizons, the RMSE increased by only about 0.6% for each additional 10% of substituted values between 0% and 70% missingness. In Cali, the same analysis showed no meaningful average change in RMSE over that range. Even in the most affected individual case, PM 2.5 forecasting at a 7-day horizon in Madrid, the RMSE increase remained below 30% when 60% of the non-distance inputs were replaced. These results indicate that the trained framework is robust to substantial levels of random input corruption at inference time. Nevertheless, this experiment reflects an optimistic missing-data pattern, since real sensor outages are typically structured and continuous rather than randomly distributed. In operational deployments, missingness often arises from prolonged hardware or communication failures, which may remove the observations of multiple sensors for periods longer than the 24-h sliding window. Under these conditions, spatial information is effectively lost, and forcing predictions through aggressive imputation becomes considerably less reliable. This is consistent with the imputation technique analysis, in which more aggressive strategies led to RMSE increases of up to 74.3%, far exceeding the degradation observed under randomly distributed missingness at inference time. Therefore, while the present robustness analysis supports the operational resilience of the framework to random missing values, evaluating structured and prolonged outage scenarios remains an important limitation of air quality forecasting and a relevant direction for future work.
Finally, we note that the proposed approach is amenable to real-world, online deployment because inference is computationally lightweight. In our experiments the average inference time for the complete validation set was 2.5 s for the Cali models and 1.9 s for the Madrid models. The heatmaps shown in Figure 1 and Figure 2 were generated at moderate spatial resolutions (Cali: 40 × 80 grid points; Madrid: 50 × 50 grid points) and each was produced in under one minute using a single seed. These timings imply that citywide heatmaps can be recomputed on an hourly cadence without prohibitive compute cost, making the system suitable for near-real-time dashboards, public alerts, or integration with traffic and urban management tools.

5. Discussion

In this study, we developed and evaluated a deep learning methodology that integrates temporal forecasting and spatial predictions to estimate cross-location citywide air pollution levels up to 10 days in advance. Specifically, our model enables fine-grained city-scale pollutant forecasting by inferring concentrations even in areas without sensors, leveraging spatial correlations learned from monitored locations. In addition, a comprehensive and comparative analysis of the model and imputation technique selection for different cities, pollutants, and time horizons is provided.
Our results indicate that, in general, LSTM×2 performed best for 1-hour time lag, while GRU×2 and LSTMGRU were as effective for longer time lags. However, the optimal model varied depending on the pollutant, city, and prediction horizon. For example, there is no overall difference between these three models for Cali, whereas in Madrid, we see a dominance of the LSTM×2 model. Models with two recurrent layers consistently outperformed those with a single recurrent layer or CNN, highlighting the benefits of increased model complexity. Notably, even the most complex architectures, with up to 61,953 trainable parameters, achieved satisfactory performance using less than a month of training data and approximately a thousand samples, far surpassing traditional methods such as RF.
Our findings also reveal several key insights. First, data imputation generally degraded model performance, with simple traditional approaches like mean imputation proving unreliable. Instead, discarding missing values or employing more refined imputation techniques that alter fewer records yielded much better results. A proper selection of the model and imputation technique may reduce the RMSE by up to 115%. While larger datasets spanning several years can enhance model performance, we demonstrated that comparable results can be achieved with significantly smaller datasets. This reduces both computational cost and training effort. For applications where minor accuracy differences are acceptable, smaller datasets offer a practical and efficient alternative, simplifying model maintenance and updates.
A limitation of the present framework is that spatial transfer is conditioned primarily through inter-sensor distance and the selected historical variables, without explicitly encoding anisotropic transport processes such as wind direction, wind speed, terrain elevation, or urban-topology effects. Urban pollutant dispersion is often strongly directional and source-dependent, especially for particulate matter and traffic-related gases, and these phenomena cannot be fully captured by distance alone. Although meteorological variables such as temperature, humidity, and dew point are included when supported by feature selection, future extensions could benefit from incorporating additional meteorological and geographic descriptors to better represent directional transport and urban morphology.
As future work, we plan to improve the spatial and temporal modeling capabilities of the framework by exploring more expressive architectures, such as Graph Neural Networks and advanced recurrent models, as well as by incorporating additional contextual inputs including day-of-week, holiday indicators, and weather forecasts. We also aim to remove the dependence on a canonical station order by investigating richer representations of sensing locations, such as altitude, terrain type, and urban morphology, which could also support sensor-importance analyses to identify critical or redundant monitoring sites. From an evaluation and deployment perspective, future work should examine the framework under alternative validation strategies, such as spatially blocked validation, to better assess its suitability for geographical extrapolation beyond the monitored urban domain. In addition, although the present results demonstrate robustness to random missing values, further research is needed on more challenging operational scenarios involving structured or prolonged sensor outages, as well as on transfer learning techniques to facilitate the adaptation of trained models to new cities.

Author Contributions

Conceptualization, R.A.-C. and L.G.; methodology, F.-J.A.-A., J.G.-H. and A.-J.G.-S.; software, F.-J.A.-A.; validation, J.G.-H.; formal analysis, F.-J.A.-A. and R.A.-C.; investigation, L.G.; resources, A.-J.G.-S.; data curation, F.-J.A.-A.; writing—original draft preparation, F.-J.A.-A.; writing—review and editing, R.A.-C. and J.G.-H.; visualization, F.-J.A.-A.; supervision, L.G.; project administration, J.G.-H.; funding acquisition, A.-J.G.-S. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by grant PID2023-148214OB-C21, funded by MICIU/AEI/ 10.13039/501100011033 and by FEDER/EU. This work was also supported in part by grant PDC2025-165710-C22, funded by MCIN/AEI/10.13039/501100011033; grant PCI2024-153485, funded by MICIU/AEI/10.13039/501100011033 and by the European Union; and by the PRIMA Programme under Grant Agreement No. 2431 (FUSION: Comprehensive and sustainable solution to minimize food loss and waste and promote food security in the Mediterranean region). The work of Francisco-Jose Alvarado-Alcon was supported by the Spain’s Ministry of Universities under Grant FPU22/00316.

Data Availability Statement

The data used in the study are openly available in Zenodo at https://doi.org/10.5281/zenodo.19810897 [33]. These data were obtained from the following interface available in the public domain: https://www.aqi.in/in/dashboard/india (last accessed on 25 April 2026).

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
BiLSTMBidirectional Long Short-Term Memory
CNNConvolutional Neural Network
DLDeep Learning
GFMGlobal Forecasting Model
GRUGated Recurrent Unit
IoTInternet of Things
IQRInterquartile Range
LSTMLong Short-Term Memory
LRLinear Regression
MAEMean Absolute Error
MBEMean Bias Error
MCNNLSTMMultipath CNN-LSTM
MLMachine Learning
MSEMean Squared Error
NNNeural Network
RFRandom Forest
RMSERoot Mean Squared Error
RNNRecurrent Neural Network
SHAPSHapley Additive eXplanations
SMAPESymmetric Mean Absolute Percentage Error

Appendix A. RMSE Tables for Model and Imputation Technique Selection

This section contains the RMSE obtained during model selection (Table A1, Table A2, Table A3, Table A4, Table A5 and Table A6) and imputation technique selection (Table A7). The best values for each city, pollutant, and time horizon are highlighted in bold.
Table A1. RMSE for the different models and pollutants for 1 h predictions. The minimum RMSE for each model, pollutant, and city is highlighted in bold.
Table A1. RMSE for the different models and pollutants for 1 h predictions. The minimum RMSE for each model, pollutant, and city is highlighted in bold.
CaliMadrid
Model O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
CNN1.20390.89251.39991.961.0872.50221.82213.391
GRU1.31410.89211.38372.16151.29012.87961.993.4095
LSTM1.24470.85671.40041.94011.012.76821.84792.9131
CNNLSTM1.28710.87111.45182.16671.32952.54941.90863.355
CNNLSTMv21.27190.8661.43842.21021.18132.58521.86573.2707
GRU×21.29050.89361.14191.94081.48942.73171.8753.4037
LSTM×21.14650.81741.21521.79241.11982.31771.62352.8801
LSTMGRU1.22930.87141.19461.78941.21332.61721.76183.1543
BiLSTM1.33290.86221.30272.09221.35392.25981.84292.9069
RF1.1780.84451.31242.12861.8673.75332.54964.1108
LR1.49251.25791.52083.43544.01987.21515.14569.4336
Table A2. RMSE for the different models and pollutants for 2 h predictions. The minimum RMSE for each model, pollutant, and city is highlighted in bold.
Table A2. RMSE for the different models and pollutants for 2 h predictions. The minimum RMSE for each model, pollutant, and city is highlighted in bold.
CaliMadrid
Model O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
CNN1.31090.93421.60752.23141.20262.78262.1493.7321
GRU1.41610.87131.57942.1871.25933.16632.41833.4222
LSTM1.21540.78061.39342.12670.95832.50252.0843.3678
CNNLSTM1.49781.02071.78342.39591.47562.9152.1773.9846
CNNLSTMv21.38930.95221.59632.54331.24252.73062.23773.8849
GRU×21.27820.77561.39011.83350.97122.71382.05233.4751
LSTM×21.0540.74981.30881.85231.00342.46771.92253.3865
LSTMGRU1.05210.77121.37051.88120.95582.70041.97783.2769
BiLSTM1.55350.98981.34342.13941.08982.29522.00243.5099
RF1.30380.99931.89882.20932.26274.34582.80244.7425
LR1.93171.44122.04123.57334.34598.60685.906710.2099
Table A3. RMSE for the different models and pollutants for 1 d predictions. The minimum RMSE for each model, pollutant, and city is highlighted in bold.
Table A3. RMSE for the different models and pollutants for 1 d predictions. The minimum RMSE for each model, pollutant, and city is highlighted in bold.
CaliMadrid
Model O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
CNN1.21750.93561.45532.12341.35713.48522.17074.1654
GRU1.09340.81541.32821.99691.05252.72421.85953.6473
LSTM1.01850.79061.26871.97651.05592.63572.01643.3138
CNNLSTM1.19160.98891.59022.26441.71053.11382.40954.6035
CNNLSTMv21.11020.8711.4232.2321.26223.12392.23864.2491
GRU×20.98790.7861.09421.92431.10992.82831.68463.2495
LSTM×20.97410.81251.1421.94351.12642.37381.6933.1266
LSTMGRU0.96610.78011.17281.94891.02892.58481.7753.2459
BiLSTM1.02620.83681.2072.00961.29562.71921.86693.4451
RF1.62291.05621.97652.79133.11935.43614.07797.1108
LR3.05112.27732.89925.6435.210210.45499.414811.8843
Table A4. RMSE for the different models and pollutants for 4 d predictions. The minimum RMSE for each model, pollutant, and city is highlighted in bold.
Table A4. RMSE for the different models and pollutants for 4 d predictions. The minimum RMSE for each model, pollutant, and city is highlighted in bold.
CaliMadrid
Model O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
CNN1.40670.89321.6412.98842.59312.61431.60562.9405
GRU1.29010.79941.39892.26542.15392.23551.48832.9765
LSTM1.19580.74631.38582.22622.25312.95471.4993.0553
CNNLSTM1.96090.95621.77872.91982.12272.66081.8513.2276
CNNLSTMv21.4490.87281.54712.42172.37812.62211.47653.0223
GRU×21.21910.73821.20612.27371.57172.161.42893.0113
LSTM×21.1550.73651.31292.21512.60312.29511.39252.8596
LSTMGRU1.19220.71191.2282.15871.93912.27641.47272.8436
BiLSTM1.56790.80261.34542.3922.50882.32141.41313.0261
RF1.57381.10431.74352.96493.3154.88084.1595.7669
LR3.09892.54033.01756.02115.75196.08264.76687.6473
Table A5. RMSE for the different models and pollutants for 7 d predictions. The minimum RMSE for each model, pollutant, and city is highlighted in bold.
Table A5. RMSE for the different models and pollutants for 7 d predictions. The minimum RMSE for each model, pollutant, and city is highlighted in bold.
CaliMadrid
Model O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
CNN1.27130.84141.51522.17691.72532.89431.9983.8344
GRU1.07790.76281.22561.9761.43862.69691.74063.4644
LSTM0.99950.75861.23881.88541.31882.44531.70923.3163
CNNLSTM1.7440.95921.52682.54462.35212.74191.83713.6323
CNNLSTMv21.31360.82991.35512.08231.90472.73341.84443.6965
GRU×21.06470.69571.08841.73761.36412.64611.60523.1971
LSTM×20.97760.7671.07121.87671.24242.38051.7243.3236
LSTMGRU0.97280.71791.15131.66411.36182.79681.70963.3772
BiLSTM1.28190.77791.21842.04681.60152.58381.8343.6497
RF1.33021.01261.57672.2723.91744.71753.53325.2129
LR2.6462.81342.91095.42093.49586.69316.54410.3443
Table A6. RMSE for the different models and pollutants for 10 d predictions. The minimum RMSE for each model, pollutant, and city is highlighted in bold.
Table A6. RMSE for the different models and pollutants for 10 d predictions. The minimum RMSE for each model, pollutant, and city is highlighted in bold.
CaliMadrid
Model O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
CNN1.3060.81221.44153.64071.20922.73452.02463.5158
GRU1.1690.69161.30183.17321.10452.25391.64382.9325
LSTM1.16120.69991.26953.05941.19282.20651.68532.7058
CNNLSTM1.70120.94291.7893.45691.44612.96561.86233.421
CNNLSTMv21.39790.81531.59663.38391.36182.7681.81143.4916
GRU×21.16990.6531.12883.12141.2252.30171.57383.0261
LSTM×21.18030.67871.22013.01151.07092.24161.55762.9261
LSTMGRU1.12920.6731.20743.13821.11652.39391.71152.9512
BiLSTM1.29680.71131.21823.03471.29362.24911.77142.9301
RF1.57480.94471.74553.62632.1694.62853.13974.6607
LR2.9443.27293.59466.94112.84226.95994.2585.5772
Table A7. RMSE for the different imputation techniques and pollutants for all the time lag predictions. The minimum RMSE for each imputation technique, pollutant, and city is highlighted in bold.
Table A7. RMSE for the different imputation techniques and pollutants for all the time lag predictions. The minimum RMSE for each imputation technique, pollutant, and city is highlighted in bold.
TimeImputationCaliMadrid
Lag Technique O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
1 hNone1.14650.81741.14191.78941.01002.25981.62352.8801
Continuity1.12420.88391.47992.48181.20202.58301.67632.7969
Mean1.28880.90351.27702.34111.29132.53141.80473.5056
Median1.30050.93281.46721.99121.37782.46851.56492.8882
Traditional1.26710.88041.30312.47071.38932.53141.80153.5213
2 hNone1.05210.74981.30881.83350.95582.29521.92253.2769
Continuity1.25560.77701.33792.27661.32112.17561.48033.2297
Mean1.17170.77931.30902.49341.20332.43511.58462.8608
Median1.11280.77031.20011.80181.09562.46281.61973.1134
Traditional1.20620.83331.22832.12011.17712.43511.56132.9488
1 dNone0.97410.78011.09421.92431.02892.37381.68463.1266
Continuity1.05340.94301.27472.28442.04902.51201.82952.9310
Mean1.05220.77111.33872.18771.03922.38571.63872.8488
Median1.01470.72111.28201.71011.10362.48361.65382.6917
Traditional1.02030.74651.33952.98011.14402.38571.65392.9936
4 dNone1.15500.71191.20612.15871.57172.16001.39252.8436
Continuity1.10640.72401.06342.12891.38732.56231.82943.7501
Mean1.11160.77421.37092.30131.24762.36461.94252.9230
Median1.12050.77781.36692.42011.24902.36461.94252.9230
Traditional1.09880.76811.38132.38211.23932.36461.94252.9230
7 dNone0.97280.69571.07121.66411.24242.38051.60523.1971
Continuity1.55620.78681.29072.56701.36322.63112.22233.6341
Mean1.44580.74381.40082.80371.09242.51941.76063.0882
Median1.45430.73311.44252.90651.09582.51941.76063.0882
Traditional1.45410.76771.40562.86141.15242.51941.76063.0882
10 dNone1.12920.65301.12883.01151.07092.20651.55762.7058
Continuity1.09670.77861.23082.44001.88102.25961.49992.4970
Mean1.16190.84271.28662.34581.57172.02151.35982.5251
Median1.13040.82251.28702.35401.53542.02151.35982.5251
Traditional1.19230.84641.28452.38871.54632.02151.35982.5251

Appendix B. Result Tables

This section contains the R 2 , MAE, SMAPE, and MBE metrics complementary to the RMSE tables provided in Section 4. The SMAPE is bounded between 0% and 200%.
Table A8. R 2 for the selected models in the validation set.
Table A8. R 2 for the selected models in the validation set.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
1 h0.92650.91910.83370.88290.95940.94340.95260.9498
2 h0.92930.92920.84160.89570.96330.93890.94630.9527
1 d0.94490.94640.86820.91760.94840.94090.94610.9594
4 d0.91740.94030.84100.78940.94730.94740.96420.9554
7 d0.92360.93190.81520.85510.95660.89840.95020.9167
10 d0.91080.93540.84110.83510.95280.92710.96790.9441
Table A9. Mean absolute error (MAE) for the selected models in the validation set.
Table A9. Mean absolute error (MAE) for the selected models in the validation set.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
1 h0.82000.54310.82161.27440.79171.77021.13752.0367
2 h0.78760.51550.82501.26420.72121.68401.11972.1317
1 d0.73160.50140.75881.18940.75921.86261.18471.9419
4 d0.80280.48860.75601.42630.91841.59271.08042.0428
7 d0.73340.47680.76381.10640.81571.75751.17642.2831
10 d0.79200.47300.77291.57940.80601.44550.93421.8480
Table A10. Symmetric mean absolute percentage error (SMAPE) for the selected models in the validation set.
Table A10. Symmetric mean absolute percentage error (SMAPE) for the selected models in the validation set.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
1 h6.5033.9943.9993.6648.71210.20412.4699.441
2 h6.5844.0476.2534.6227.64510.27012.51911.011
1 d6.0995.7534.9844.3828.17710.72112.80210.713
4 d6.0994.9125.5384.9408.42112.00813.82711.742
7 d5.5404.7795.4233.6857.18214.06618.01913.923
10 d6.2424.6865.3085.2856.67310.91113.96412.463
Table A11. Mean bias error (MBE) for the selected models in the validation set.
Table A11. Mean bias error (MBE) for the selected models in the validation set.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
1 h−0.0216−0.0008−0.04700.0640−0.0361−0.00960.0296−0.0098
2 h−0.03220.0969−0.07270.0847−0.0482−0.07160.02440.1088
1 d0.0241−0.0703−0.0157−0.1419−0.0701−0.09900.04970.1317
4 d−0.00170.0152−0.00420.05560.0186−0.14020.15480.2494
7 d0.0094−0.0401−0.06800.0264−0.05870.2217−0.2138−0.1615
10 d−0.05010.0258−0.03810.1673−0.08740.20230.17840.1414
Table A12. R 2 obtained on sensors not used during training or validation, reported for each city, pollutant, and forecast horizon.
Table A12. R 2 obtained on sensors not used during training or validation, reported for each city, pollutant, and forecast horizon.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
1 h0.44040.32930.18750.36040.47540.57650.63760.7839
2 h0.23910.41510.32180.25880.36900.48620.51730.6771
1 d0.53530.55470.37340.05540.36300.61570.65330.6729
4 d0.28150.20010.40650.32470.3357−0.41280.48620.5380
7 d0.0145-0.01790.14430.40350.29080.49410.52370.4046
10 d0.22760.37850.40290.29800.38130.54930.71820.6183
Table A13. MAE obtained on sensors not used during training or validation, reported for each city, pollutant, and forecast horizon.
Table A13. MAE obtained on sensors not used during training or validation, reported for each city, pollutant, and forecast horizon.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
1 h2.09011.43902.37263.68592.95364.08732.99164.0185
2 h2.52891.30282.20803.91113.02244.39053.21685.2167
1 d1.88211.19052.21334.52672.76483.86643.17205.9992
4 d2.32181.20791.93373.58684.35076.53253.98526.6443
7 d2.38581.33942.36422.93453.88964.04093.60685.5443
10 d2.10641.01722.03483.74714.68713.60592.71284.8748
Table A14. SMAPE obtained on sensors not used during training or validation, reported for each city, pollutant, and forecast horizon.
Table A14. SMAPE obtained on sensors not used during training or validation, reported for each city, pollutant, and forecast horizon.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
1 h20.69813.15417.07612.21630.80526.93726.84917.151
2 h23.66112.01415.16913.28330.26927.99126.97923.544
1 d17.66110.87416.02316.41729.67425.67727.80926.753
4 d18.90010.35112.51710.85836.46441.23634.06129.941
7 d20.21711.80015.1228.97335.16927.56533.24826.752
10 d17.7228.83312.84610.87341.58728.00028.55826.689
Table A15. MBE obtained on sensors not used during training or validation, reported for each city, pollutant, and forecast horizon.
Table A15. MBE obtained on sensors not used during training or validation, reported for each city, pollutant, and forecast horizon.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
1 h−0.24790.24921.03972.1091−1.1692−3.6888−0.08590.0865
2 h−0.47330.29960.84592.1141−1.0748−3.6533−0.0798−0.6240
1 d0.13290.08660.96922.8085−1.2121−2.50231.51422.1311
4 d−0.82810.10620.83121.9758−0.2806−6.04402.47774.6540
7 d−0.86500.29010.75721.6696−2.4089−2.1115−0.56030.6276
10 d−0.76020.22180.99621.8758−2.3824−1.33521.03330.8731
Table A16. MAE for the selected models in the last two weeks of December 2024.
Table A16. MAE for the selected models in the last two weeks of December 2024.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 NO 2 PM 2.5 PM 10
1 h2.19391.73432.62133.92467.98183.69545.1971
2 h3.39341.77072.58234.66827.78284.02276.7785
1 d2.37541.88233.36905.68317.37374.87158.6431
4 d3.83231.68153.10395.242516.56536.979210.5154
7 d5.54421.92023.10614.30226.26744.61979.6491
10 d5.33811.76023.17214.56637.60849.49537.3503
Table A17. SMAPE for the selected models in the last two weeks of December 2024.
Table A17. SMAPE for the selected models in the last two weeks of December 2024.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 NO 2 PM 2.5 PM 10
1 h25.09315.02420.81813.64952.80240.46429.331
2 h31.81315.28219.31916.43951.07943.77235.454
1 d24.09116.00524.51020.23546.80749.98140.993
4 d33.96514.55122.57316.83883.23674.28964.776
7 d45.53116.40722.68214.60439.62155.58449.253
10 d43.06115.43423.84316.45448.31070.26728.397
Table A18. MBE for the selected models in the last two weeks of December 2024.
Table A18. MBE for the selected models in the last two weeks of December 2024.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 NO 2 PM 2.5 PM 10
1 h−0.81540.46980.40381.7471−7.5200−1.8265−0.0736
2 h−2.63600.5482−0.27232.0634−7.1491−2.0166−2.2089
1 d−1.42050.7338−0.90372.4232−5.7650−1.5790−1.3816
4 d−3.63700.5386−1.6881−0.9108−16.3452−2.49874.9172
7 d−5.35040.3000−2.4844−1.1287−1.66694.03185.6632
10 d−5.05351.0038−2.8426−2.0087−5.2263−6.5994−4.4635
Table A19. R 2 obtained with the selected models trained on the extended dataset and evaluated on held-out monitoring stations using a later time period.
Table A19. R 2 obtained with the selected models trained on the extended dataset and evaluated on held-out monitoring stations using a later time period.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
1 h−4.4238−60.9569−0.0658−36.11820.4034−3.40180.6052−0.1714
2 h−15.0728−10.1848−0.1277−3.57520.2364−2.51510.3575−0.1162
1 d−1.5093−29.6489−0.7796−9.85760.1354−1.3808−0.2089−0.0111
4 d−0.8031−2.3657−0.9147−2.8975−0.1342−0.4368−1.0884−1.8335
7 d−1.7855−0.2516−0.1772−0.35480.2341−1.6020−0.3350−1.0528
10 d−0.8892−0.1974−0.6514−71.4525−0.4250−114.1359−0.3601−0.2771
Table A20. MAE obtained with the selected models trained on the extended dataset and evaluated on held-out monitoring stations using a later time period.
Table A20. MAE obtained with the selected models trained on the extended dataset and evaluated on held-out monitoring stations using a later time period.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
1 h1.64022.75652.23475.94662.78317.06721.36615.9152
2 h2.99881.08662.56107.41413.19196.11231.61016.0440
1 d4.49295.11823.821411.18833.59764.83552.63926.2571
4 d5.73444.76795.08634.61796.10394.10554.041011.5531
7 d11.05074.96415.59684.87373.15686.34393.458011.0156
10 d11.40464.04174.91906.78968.643015.14674.17448.0236
Table A21. MBE obtained with the selected models trained on the extended dataset and evaluated on held-out monitoring stations using a later time period.
Table A21. MBE obtained with the selected models trained on the extended dataset and evaluated on held-out monitoring stations using a later time period.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
1 h−0.0808−2.74421.61021.3792−1.4558−6.34510.58625.6434
2 h0.7529−0.89010.08537.2347−0.2910−4.83160.79474.7276
1 d4.3872−5.0602−0.5644−9.2547−1.8906−0.93191.20614.1317
4 d4.0050−3.8792−3.4535−0.8249−2.8533−1.57181.3318−2.8243
7 d10.9210−2.21282.2669−2.0849−0.9765−4.90580.7946−1.5829
10 d10.50220.64923.0074−6.40774.9745−15.1467−1.3231−1.1922

References

  1. The United Nations Population Division. Urban Population (% of Total Population). 2018. Available online: https://data.worldbank.org/indicator/SP.URB.TOTL.IN.ZS (accessed on 3 September 2025).
  2. The Economic Times. Delhi pollution: More areas in ‘severe’ category, fines of Rs 5.85 cr imposed as restrictions tightened. The Economic Times, 16 November 2024. Available online: https://economictimes.indiatimes.com/news/india/traffic-police-in-delhi-slaps-fines-totalling-rs-1-crore-for-violations-after-grap-3-invoked/articleshow/115363438.cms (accessed on 21 January 2025).
  3. The Sun. India court tells smog-hit capital to step up vehicle restrictions. The Sun, 22 November 2024. Available online: https://thesun.my/world-news/india-court-tells-smog-hit-capital-to-step-up-vehicle-restrictions-GD13328680 (accessed on 21 January 2025).
  4. Drewil, G.I.; Al-Bahadili, R.J. Air pollution prediction using LSTM deep learning and metaheuristics algorithms. Meas. Sens. 2022, 24, 100546. [Google Scholar] [CrossRef] [Scilit]
  5. Bekkar, A.; Hssina, B.; Douzi, S.; Douzi, K. Air-pollution prediction in smart city, deep learning approach. J. Big Data 2021, 8, 161. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  6. Wan, Y.; Xu, M.; Huang, H.; Xi Chen, S. A spatio-temporal model for the analysis and prediction of fine particulate matter concentration in Beijing. Environmetrics 2021, 32, e2648. [Google Scholar] [CrossRef] [Scilit]
  7. Baniasadi, S.; Salehi, R.; Soltani, S.; Martín, D.; Pourmand, P.; Ghafourian, E. Optimizing Long Short-Term Memory Network for Air Pollution Prediction Using a Novel Binary Chimp Optimization Algorithm. Electronics 2023, 12, 3985. [Google Scholar] [CrossRef] [Scilit]
  8. Rabie, R.; Asghari, M.; Nosrati, H.; Emami Niri, M.; Karimi, S. Spatially resolved air quality index prediction in megacities with a CNN-Bi-LSTM hybrid framework. Sustain. Cities Soc. 2024, 109, 105537. [Google Scholar] [CrossRef] [Scilit]
  9. Shiri, F.M.; Perumal, T.; Mustapha, N.; Mohamed, R. A comprehensive overview and comparative analysis on deep learning models: CNN, RNN, LSTM, GRU. arXiv 2023, arXiv:2305.17473. [Google Scholar] [CrossRef] [Scilit]
  10. Zhang, Z.; Zhang, S.; Chen, C.; Yuan, J. A systematic survey of air quality prediction based on deep learning. Alex. Eng. J. 2024, 93, 128–141. [Google Scholar] [CrossRef] [Scilit]
  11. Tao, Q.; Liu, F.; Li, Y.; Sidorov, D. Air Pollution Forecasting Using a Deep Learning Model Based on 1D Convnets and Bidirectional GRU. IEEE Access 2019, 7, 76690–76698. [Google Scholar] [CrossRef] [Scilit]
  12. Bhatta, J.; Acharya, S.R.; Yang, K.M. Machine learning-enhanced air quality forecasting and trend analysis: A five-year comprehensive assessment of PM2.5 concentrations in Bangkok, Thailand. Environ. Chall. 2026, 22, 101442. [Google Scholar] [CrossRef] [Scilit]
  13. Bougoudis, I.; Demertzis, K.; Iliadis, L. HISYCOL a hybrid computational intelligence system for combined machine learning: The case of air pollution modeling in Athens. Neural Comput. Appl. 2016, 27, 1191–1206. [Google Scholar] [CrossRef] [Scilit]
  14. Apte, J.S.; Messier, K.P.; Gani, S.; Brauer, M.; Kirchstetter, T.W.; Lunden, M.M.; Marshall, J.D.; Portier, C.J.; Vermeulen, R.C.; Hamburg, S.P. High-Resolution Air Pollution Mapping with Google Street View Cars: Exploiting Big Data. Environ. Sci. Technol. 2017, 51, 6999–7008. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  15. Hu, X.; Belle, J.H.; Meng, X.; Wildani, A.; Waller, L.A.; Strickland, M.J.; Liu, Y. Estimating PM2.5 Concentrations in the Conterminous United States Using the Random Forest Approach. Environ. Sci. Technol. 2017, 51, 6936–6944. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  16. Nicolis, O.; Díaz, M.; Sahu, S.K.; Marín, J.C. Bayesian spatiotemporal modeling for estimating short-term exposure to air pollution in Santiago de Chile. Environmetrics 2019, 30, e2574. [Google Scholar] [CrossRef] [Scilit]
  17. Kalajdjieski, J.; Zdravevski, E.; Corizzo, R.; Lameski, P.; Kalajdziski, S.; Pires, I.M.; Garcia, N.M.; Trajkovik, V. Air Pollution Prediction with Multi-Modal Data and Deep Neural Networks. Remote. Sens. 2020, 12, 4142. [Google Scholar] [CrossRef] [Scilit]
  18. Fioravanti, G.; Martino, S.; Cameletti, M.; Cattani, G. Spatio-temporal modelling of PM10 daily concentrations in Italy using the SPDE approach. Atmos. Environ. 2021, 248, 118192. [Google Scholar] [CrossRef] [Scilit]
  19. Shahriar, S.A.; Kayes, I.; Hasan, K.; Hasan, M.; Islam, R.; Awang, N.R.; Hamzah, Z.; Rak, A.E.; Salam, M.A. Potential of ARIMA-ANN, ARIMA-SVM, DT and CatBoost for Atmospheric PM2.5 Forecasting in Bangladesh. Atmosphere 2021, 12, 100. [Google Scholar] [CrossRef] [Scilit]
  20. Kristiani, E.; Lin, H.; Lin, J.R.; Chuang, Y.H.; Huang, C.Y.; Yang, C.T. Short-Term Prediction of PM2.5 Using LSTM Deep Learning Methods. Sustainability 2022, 14, 2068. [Google Scholar] [CrossRef] [Scilit]
  21. Saez, M.; Barceló, M.A. Spatial prediction of air pollution levels using a hierarchical Bayesian spatiotemporal model in Catalonia, Spain. Environ. Model. Softw. 2022, 151, 105369. [Google Scholar] [CrossRef] [Scilit]
  22. Kumar, K.; Pande, B.P. Air pollution prediction with machine learning: A case study of Indian cities. Int. J. Environ. Sci. Technol. 2023, 20, 5333–5348. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  23. Samad, A.; Garuda, S.; Vogt, U.; Yang, B. Air pollution prediction using machine learning techniques – An approach to replace existing monitoring stations with virtual monitoring stations. Atmos. Environ. 2023, 310, 119987. [Google Scholar] [CrossRef] [Scilit]
  24. Rahman, M.M.; Nayeem, M.E.H.; Ahmed, M.S.; Tanha, K.A.; Sakib, M.S.A.; Uddin, K.M.M.; Babu, H.M.H. AirNet: Predictive machine learning model for air quality forecasting using web interface. Environ. Syst. Res. 2024, 13, 44. [Google Scholar] [CrossRef] [Scilit]
  25. Wu, Z.; Tian, Y.; Li, M.; Wang, B.; Quan, Y.; Liu, J. Prediction of air pollutant concentrations based on the long short-term memory neural network. J. Hazard. Mater. 2024, 465, 133099. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  26. Yang, W.; Wu, Q.; Li, J.; Chen, X.; Du, H.; Wang, Z.; Li, D.; Tang, X.; Sun, Y.; Ye, Z.; et al. Predictions of air quality and challenges for eliminating air pollution during the 2022 Olympic Winter Games. Atmos. Res. 2024, 300, 107225. [Google Scholar] [CrossRef] [Scilit]
  27. Zareba, M.; Cogiel, S.; Danek, T.; Weglinska, E. Machine Learning Techniques for Spatio-Temporal Air Pollution Prediction to Drive Sustainable Urban Development in the Era of Energy and Data Transformation. Energies 2024, 17, 2738. [Google Scholar] [CrossRef] [Scilit]
  28. Illescas-Martinez, F.; Garcia, L.; Garcia-Sanchez, A.J.; Asorey-Cacheda, R.; Garcia-Haro, J. Air quality forecasting in non-monitored urban areas through machine and deep-learning model. Expert Syst. Appl. 2025, 284, 127749. [Google Scholar] [CrossRef] [Scilit]
  29. Xia, H.; Chen, X.; Chen, B.; Hu, Y. Dynamic synchronous graph transformer network for region-level air-quality forecasting. Neurocomputing 2025, 616, 128924. [Google Scholar] [CrossRef] [Scilit]
  30. Zhang, C.; Niu, X.; Wu, H.; Ding, Z.; Chan, K.L.; Kim, J.; Wagner, T.; Liu, C. Unleashing the potential of geostationary satellite observations in air quality forecasting through artificial intelligence techniques. Atmos. Chem. Phys. 2025, 25, 759–770. [Google Scholar] [CrossRef] [Scilit]
  31. Panja, M.; Chakraborty, T.; Biswas, A.; Deb, S. E-STGCN: Extreme spatio-temporal graph convolutional networks for air quality forecasting. J. R. Stat. Soc. Ser. A Stat. Soc. 2026, qnag010. [Google Scholar] [CrossRef] [Scilit]
  32. Santiago, J.L.; Martín, F.; Martilli, A. A computational fluid dynamic modelling approach to assess the representativeness of urban monitoring stations. Sci. Total. Environ. 2013, 454–455, 61–72. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  33. Alvarado-Alcon, F.J.; Asorey-Cacheda, R.; Garcia-Haro, J.; García, L.; Garcia-Sanchez, A.J. Replication Data for “Citywide Air Quality Forecasting over Sparse Sensor Networks: Cross-Location Generalization and Deep Learning Reliability under Missing Data”; Zenodo: Geneva, Switzerland, 2026. [Google Scholar] [CrossRef]
  34. Glorot, X.; Bengio, Y. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics Proceedings of Machine Learning Research, Sardinia, Italy, 13–15 May 2010; Proceedings of Machine Learning Research; Teh, Y.W., Titterington, M., Eds.; Journal of Machine Learning Research: Brookline, MA, USA, 2010; Volume 9, pp. 249–256. [Google Scholar]
  35. Alvarado-Alcon, F.J.; Asorey-Cacheda, R.; Garcia-Sanchez, A.J.; Garcia-Haro, J.; García, L. Loss-Versus-Epoch Graphs for “Deep Learning for Citywide Air Quality Inference: Cross-location Forecasting from Sparse Stations”; Zenodo: Geneva, Switzerland, 2025. [Google Scholar] [CrossRef]
  36. AQI India API. AQI India API. 2010. Available online: https://www.kaggle.com/datasets/omsandeeppatil/indian-aqi-stations (accessed on 31 December 2024).
  37. Hastie, T.; Tibshirani, R.; Friedman, J. The Elements of Statistical Learning: Data Mining, Inference, and Prediction, 2nd ed.; Springer: Berlin/Heidelberg, Germany, 2009; Chapter 7. [Google Scholar]
  38. Alazmi, A.; Rakha, H. Assessing and validating the ability of machine learning to handle unrefined particle air pollution mobile monitoring data randomly, spatially, and spatiotemporally. Int. J. Environ. Res. Public Health 2022, 19, 10098. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  39. Dirección General de Sostenibilidad y Control Ambiental. Calidad del Aire 2023. 2023. Available online: https://airedemadrid.madrid.es/UnidadesDescentralizadas/Sostenibilidad/CalidadAire/Publicaciones/Memorias_anuales/Ficheros/MEMORIA_2023_01.pdf (accessed on 4 September 2025).
  40. Mateus-Fontecha, L.; Vargas-Burbano, A.; Jimenez, R.; Rojas, N.Y.; Rueda-Saa, G.; van Pinxteren, D.; van Pinxteren, M.; Fomba, K.W.; Herrmann, H. Understanding aerosol composition in a tropical inter-Andean valley impacted by agro-industrial and urban emissions. Atmos. Chem. Phys. 2022, 22, 8473–8495. [Google Scholar] [CrossRef] [Scilit]
  41. OpenStreetMap Contributors. Open Street Map. 2015. Available online: https://www.openstreetmap.org (accessed on 11 February 2026).
  42. Lundberg, S.M.; Lee, S.I. A unified approach to interpreting model predictions. In Proceedings of the 31st International Conference on Neural Information Processing Systems, Red Hook, NY, USA, 4–9 December 2017; pp. 4768–4777. [Google Scholar]
Figure 3. Number of valid records per city after applying different missing data handling approaches. The expected number of records under ideal conditions, without missing data, is 7920 for Madrid and 89,760 for Cali.
Figure 3. Number of valid records per city after applying different missing data handling approaches. The expected number of records under ideal conditions, without missing data, is 7920 for Madrid and 89,760 for Cali.
Jsan 15 00052 g003
Figure 4. Number of samples per city after applying different missing data handling approaches. For each city, six datasets are presented, corresponding to predictions for 1 h, 2 h, 1 d, 4 d, 7 d, and 10 d time horizons. The expected number of samples under ideal conditions for 1-hour forecasting, without missing data, is 1584 for Madrid and 8976 for Cali.
Figure 4. Number of samples per city after applying different missing data handling approaches. For each city, six datasets are presented, corresponding to predictions for 1 h, 2 h, 1 d, 4 d, 7 d, and 10 d time horizons. The expected number of samples under ideal conditions for 1-hour forecasting, without missing data, is 1584 for Madrid and 8976 for Cali.
Jsan 15 00052 g004
Figure 5. RMSE obtained on sensors not used during training or validation, reported for each city, pollutant, and forecast horizon.
Figure 5. RMSE obtained on sensors not used during training or validation, reported for each city, pollutant, and forecast horizon.
Jsan 15 00052 g005
Figure 6. R 2 obtained on sensors not used during training or validation, reported for each city, pollutant, and forecast horizon.
Figure 6. R 2 obtained on sensors not used during training or validation, reported for each city, pollutant, and forecast horizon.
Jsan 15 00052 g006
Figure 7. Permutation feature importance as the average increase in RMSE when each input feature is randomly permuted across the test set. The first (red) bar for each pollutant corresponds to the pollutant’s own past values.
Figure 7. Permutation feature importance as the average increase in RMSE when each input feature is randomly permuted across the test set. The first (red) bar for each pollutant corresponds to the pollutant’s own past values.
Jsan 15 00052 g007
Figure 8. Timestep importance for PM 10 for Cali (top) and Madrid (bottom) as the absolute SHAP values averaged per input timestep, shown for multiple forecast horizons. Larger values indicate greater contribution of that timestep to the model’s prediction.
Figure 8. Timestep importance for PM 10 for Cali (top) and Madrid (bottom) as the absolute SHAP values averaged per input timestep, shown for multiple forecast horizons. Larger values indicate greater contribution of that timestep to the model’s prediction.
Jsan 15 00052 g008
Figure 9. RMSE and R 2 for PM 2.5 inference in studies [7,16,25,26] that integrate temporal forecasting with spatial interpolation. The temporal horizon of each study is indicated in parentheses.
Figure 9. RMSE and R 2 for PM 2.5 inference in studies [7,16,25,26] that integrate temporal forecasting with spatial interpolation. The temporal horizon of each study is indicated in parentheses.
Jsan 15 00052 g009
Table 2. Summary of deep learning architectures.
Table 2. Summary of deep learning architectures.
ModelArchitecture Description
CNN1D Conv (64 filters, kernel size 3) → MaxPool (size 2)
→ Dense (32) → Dense (16) → Output
GRUGRU (64 units) → Dense (32) → Output
LSTMLSTM (64 units) → Dense (32) → Output
MCNNLSTMCNN path: 1D Conv (64, 3) → MaxPool (2) → Dense (32)
+ LSTM path: LSTM (64) → Dropout (drop rate 0.2) → GAP1D
→ Concatenate → Output
MCNNLSTMv2CNN path: 1D Conv (64, 3) → 1D Conv (32, 3) → Dense (16)
+ LSTM path: LSTM (64) → Dropout (0.1) → Dense (32) → Dense (16)
→ Concatenate → Dense (8) → Output
GRU×2GRU (64) → GRU (32) → Dropout (0.2) → Output
LSTM×2LSTM (64) → LSTM (32) → Dropout (0.2) → Output
LSTMGRULSTM (64) → GRU (32) → Dense (32) → Dropout (0.2) → Output
BiLSTMBidirectional LSTM (64) → Dropout (0.2) → Output
Table 3. Data origin for the different cities.
Table 3. Data origin for the different cities.
CityInput SensorsLabel SensorsTest SensorsStart DateEnd Date
Cali72913/06/202417/12/2024
Madrid103225/11/202417/12/2024
Table 4. Summary statistics of air pollutants and meteorological data in air pollution monitoring sites after outlier removal. The data are stored with a precision of one unit.
Table 4. Summary statistics of air pollutants and meteorological data in air pollution monitoring sites after outlier removal. The data are stored with a precision of one unit.
VariableUnitsCaliMadrid
Mean ± SD Range Mean ± SD Range
O 3 ppb9.48 ± 2.68[2, 20]15.32 ± 5.65[2, 35]
NO 2 ppb11.81 ± 2.15[6, 22]14.81 ± 8.34[2, 56]
PM 2.5 μ g / m 3 13.22 ± 3.28[3, 27]8.78 ± 5.18[1, 33]
PM 10 μ g / m 3 30.74 ± 5.53[6, 55]17.07 ± 8.05[1, 48]
COppb666.82 ± 124.69[340, 2410]69.77 ± 56.14[1, 2432]
SO 2 ppb3.30 ± 1.10[1, 51]1.08 ± 0.62[1, 49]
Temp ° C 19.49 ± 2.50[13, 27]7.38 ± 3.22[1, 16]
Humidity%56.99 ± 25.44[1, 106]74.74 ± 14.52[30, 101]
Dew point ° C 9.35 ± 5.26[1, 26]3.95 ± 1.36[1, 12]
Table 5. Records from Cali at 12:00 on 13 June 2024 after data aggregation. Each topic corresponds to a different station.
Table 5. Records from Cali at 12:00 on 13 June 2024 after data aggregation. Each topic corresponds to a different station.
TimestampTopic O 3 NO 2 PM 2.5 PM 10 CO SO 2 TempLatitudeLongitude
13-06-2024 12:00:00331819714325401173.457128−76.502303
13-06-2024 12:00:00331917815305771173.305339−76.532581
13-06-2024 12:00:00332019714325401173.450419−76.522267
13-06-2024 12:00:00332119714325401173.455469−76.530992
13-06-2024 12:00:00332217716315771173.490514−76.521225
13-06-2024 12:00:00332319714325401173.377911−76.533811
13-06-2024 12:00:00332418611285631173.417203−76.494736
13-06-2024 12:00:00332519714325401173.415389−76.549347
13-06-2024 12:00:00332618611285631173.428389−76.466700
Table 6. Data from Cali at 12:00 on June 13th, 2024, after formatting relative to the label station with topic 3320 to predict the NO 2 . The topics are included as reference but they are not part of the input data. To create a valid sample, the data should be flattened, and 24 continuous records for all the input stations would be required.
Table 6. Data from Cali at 12:00 on June 13th, 2024, after formatting relative to the label station with topic 3320 to predict the NO 2 . The topics are included as reference but they are not part of the input data. To create a valid sample, the data should be flattened, and 24 continuous records for all the input stations would be required.
(a) First hour of the input data
topic NO 2 PM 2.5 PM 10 COdistance
33180.26090.41940.49150.18240.0809
33190.30430.45160.45760.19701.0000
33210.26090.41940.49150.18240.0000
33220.26090.48390.47460.19700.2219
33230.26090.41940.49150.18240.4680
33240.21740.32260.42370.19150.2525
33260.21740.32260.42370.19150.3665
(b) Target data (12:00 on 14 June 2024 )
topic NO 2
33200.3043
Table 7. Root mean squared error (RMSE) obtained using the non-learning baseline (naïve temporal forecast combined with nearest-neighbor spatial assignment) for each pollutant, city, and forecast horizon.
Table 7. Root mean squared error (RMSE) obtained using the non-learning baseline (naïve temporal forecast combined with nearest-neighbor spatial assignment) for each pollutant, city, and forecast horizon.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
1 h1.77041.12232.47045.04675.77805.00804.65829.1177
2 h2.33981.49132.91975.62936.06056.24564.95249.6034
1 d3.69002.57154.11557.77856.76638.57378.037413.1741
4 d5.21203.12844.60619.40088.11489.765610.564418.7440
7 d6.36353.52004.53189.14219.402310.626411.657120.8573
10 d7.52024.16245.389710.894810.319111.732413.553124.2929
Table 8. RMSE for the selected models in the validation set.
Table 8. RMSE for the selected models in the validation set.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
1 h1.12420.81741.14191.78941.01002.25981.56492.7969
2 h1.05210.74981.20011.80180.95582.17561.48032.8608
1 d0.97410.72111.09421.71011.02892.37381.63872.6917
4 d1.09880.71191.06342.12891.23932.16001.39252.8436
7 d0.97280.69571.07121.66411.09242.38051.60523.0882
10 d1.09670.65301.12882.34581.07092.02151.35982.4970
Table 9. RMSE obtained on sensors not used during training or validation, reported for each city, pollutant, and forecast horizon.
Table 9. RMSE obtained on sensors not used during training or validation, reported for each city, pollutant, and forecast horizon.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
1 h3.02981.96483.27085.03183.64025.10614.30985.5432
2 h3.57301.81763.00755.44953.99595.58534.51087.0737
1 d2.79691.65413.09656.83323.66115.13834.85808.5248
4 d3.29951.70792.65184.97265.81299.29366.292110.0208
7 d3.27431.89563.19454.15784.89445.16055.27037.6586
10 d2.98871.37952.85215.26375.50414.60474.07486.7517
Table 10. Training time for the selected models in minutes.
Table 10. Training time for the selected models in minutes.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
1 h47.640.235.718.05.64.911.57.4
2 h16.840.232.342.32.97.67.08.4
1 d46.136.827.141.52.57.112.09.9
4 d34.432.975.339.03.413.48.69.9
7 d9.938.037.940.26.510.811.215.0
10 d9.130.544.621.94.05.210.93.2
Table 11. RMSE for the selected models in the last two weeks of December 2024. No valid sample could be created for O 3 in Madrid.
Table 11. RMSE for the selected models in the last two weeks of December 2024. No valid sample could be created for O 3 in Madrid.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
1 h2.78032.24243.30255.1006NaN8.89764.94396.5915
2 h4.22512.30843.22876.2525NaN8.96045.34858.9340
1 d2.89972.43754.12007.4796NaN8.90166.143610.7410
4 d4.59002.20953.85697.1081NaN18.34938.471113.3789
7 d6.15952.46803.75795.4434NaN8.39166.440211.8535
10 d6.08812.28473.95785.6520NaN8.946411.01119.1025
Table 12. RMSE obtained with the selected models trained on the extended dataset and evaluated on held-out monitoring stations using a later time period.
Table 12. RMSE obtained with the selected models trained on the extended dataset and evaluated on held-out monitoring stations using a later time period.
TimeCaliMadrid
Lag O 3 NO 2 PM 2.5 PM 10 O 3 NO 2 PM 2.5 PM 10
1 h1.99122.99253.04796.89033.64328.54392.14526.9880
2 h3.47201.26443.30388.18494.15197.46272.55798.2239
1 d6.13465.33384.768213.39024.71766.01443.73967.9866
4 d7.79015.23106.11405.58098.13604.97225.168814.0851
7 d13.67145.76537.09255.93434.04107.38464.237913.9576
10 d15.54055.08096.49087.566710.900715.98505.593410.7095
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Alvarado-Alcon, F.-J.; Asorey-Cacheda, R.; Garcia-Haro, J.; García, L.; Garcia-Sanchez, A.-J. Citywide Air Quality Forecasting over Sparse Sensor Networks: Cross-Location Generalization and Deep Learning Reliability Under Missing Data. J. Sens. Actuator Netw. 2026, 15, 52. https://doi.org/10.3390/jsan15040052

AMA Style

Alvarado-Alcon F-J, Asorey-Cacheda R, Garcia-Haro J, García L, Garcia-Sanchez A-J. Citywide Air Quality Forecasting over Sparse Sensor Networks: Cross-Location Generalization and Deep Learning Reliability Under Missing Data. Journal of Sensor and Actuator Networks. 2026; 15(4):52. https://doi.org/10.3390/jsan15040052

Chicago/Turabian Style

Alvarado-Alcon, Francisco-Jose, Rafael Asorey-Cacheda, Joan Garcia-Haro, Laura García, and Antonio-Javier Garcia-Sanchez. 2026. "Citywide Air Quality Forecasting over Sparse Sensor Networks: Cross-Location Generalization and Deep Learning Reliability Under Missing Data" Journal of Sensor and Actuator Networks 15, no. 4: 52. https://doi.org/10.3390/jsan15040052

APA Style

Alvarado-Alcon, F.-J., Asorey-Cacheda, R., Garcia-Haro, J., García, L., & Garcia-Sanchez, A.-J. (2026). Citywide Air Quality Forecasting over Sparse Sensor Networks: Cross-Location Generalization and Deep Learning Reliability Under Missing Data. Journal of Sensor and Actuator Networks, 15(4), 52. https://doi.org/10.3390/jsan15040052

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop