Hostname: page-component-89b8bd64d-9prln Total loading time: 0 Render date: 2026-05-05T09:10:37.980Z Has data issue: false hasContentIssue false

Short-term forecasting of ozone air pollution across Europe with transformers

Published online by Cambridge University Press:  04 December 2023

Sebastian H. M. Hickman*
Affiliation:
Yusuf Hamied Department of Chemistry, University of Cambridge, Cambridge, United Kingdom The Alan Turing Institute, London, United Kingdom
Paul T. Griffiths
Affiliation:
Yusuf Hamied Department of Chemistry, University of Cambridge, Cambridge, United Kingdom National Centre for Atmospheric Science, University of Cambridge, Cambridge, United Kingdom
Peer J. Nowack
Affiliation:
Institute of Theoretical Informatics, Karlsruhe Institute of Technology, Karlsruhe, Germany
Alexander T. Archibald
Affiliation:
Yusuf Hamied Department of Chemistry, University of Cambridge, Cambridge, United Kingdom National Centre for Atmospheric Science, University of Cambridge, Cambridge, United Kingdom
*
Corresponding author: Sebastian H. M. Hickman; Email: shmh4@cam.ac.uk

Abstract

Surface ozone is an air pollutant that contributes to hundreds of thousands of premature deaths annually. Accurate short-term ozone forecasts may allow improved policy actions to reduce the risk to human health. However, forecasting surface ozone is a difficult problem as its concentrations are controlled by a number of physical and chemical processes that act on varying timescales. We implement a state-of-the-art transformer-based model, the temporal fusion transformer, trained on observational data from three European countries. In four-day forecasts of daily maximum 8-hour ozone (DMA8), our novel approach is highly skillful (MAE = 4.9 ppb, coefficient of determination $ {\mathrm{R}}^2=0.81 $) and generalizes well to data from 13 other European countries unseen during training (MAE = 5.0 ppb, $ {\mathrm{R}}^2=0.78 $). The model outperforms other machine learning models on our data (ridge regression, random forests, and long short-term memory networks) and compares favorably to the performance of other published deep learning architectures tested on different data. Furthermore, we illustrate that the model pays attention to physical variables known to control ozone concentrations and that the attention mechanism allows the model to use the most relevant days of past ozone concentrations to make accurate forecasts on test data. The skillful performance of the model, particularly in generalizing to unseen European countries, suggests that machine learning methods may provide a computationally cheap approach for accurate air quality forecasting across Europe.

Information

Type
Application Paper
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (http://creativecommons.org/licenses/by/4.0), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2023. Published by Cambridge University Press
Figure 0

Table 1. The relative performance of different ML and numerical approaches to ozone forecasting

Figure 1

Figure 1. (a) illustrates predictions against observations on 2012 test data for forecasting ozone with the TFT. The number of data points in each bin is shown by the color bar, using a log scale. (b) shows a 4-day forecast on test data at a single station. The gray line shows the attention that the transformer is paying to different days in the time history. The prediction intervals generated with the quantile loss are also shown, with the 7 different quantiles illustrated by orange shading.

Figure 2

Figure 2. (a) illustrates the performance of the TFT when predicting on 2012 test data from 13 European countries unseen during training. (b) shows that when forecasting on spring and summertime test data, the performance of the TFT was poorer (MAE = 5.4 ppb, $ {R}^2= 0.64 $) than predicting on the whole year.

Figure 3

Figure 3. (a) illustrates the difference in performance of the model in different countries, in terms of MAE, between spring and summer, while (b) illustrates the same for MAPE. The countries are plotted by the mean ozone during spring and summer in the country.

Figure 4

Table 2. The relative performance of different ML approaches to ozone forecasting for different domains within our data

Figure 5

Figure 4. (a) shows the width of prediction intervals generated by the model on the test data for the countries used for training (UK, France, Italy) and for test data from the unseen European countries. The prediction intervals are marginally wider for the unseen countries, in line lower model performance in these countries. (b) illustrates that the prediction intervals increase as the MAE of the predictions increases, consistent with well-calibrated prediction intervals.

Figure 6

Figure 5. (a) shows the accuracy of different ML methods on the test data for the countries used for training (UK, France, Italy) and for a pair of unseen countries (Spain and Poland). The performance of the LSTM and the TFT is relatively stable when forecasting in new countries, while the random forest and ridge regression models perform poorly. (b) shows a density plot of ozone concentrations observed in the test data for the countries used for training (UK, France, Italy) and for 2 of the 13 unseen test countries (Spain and Poland).

Figure 7

Figure 6. The variable importances of the TFT when making forecasts, derived from the weights of the attention mechanism. These are largely in line with expected physical relationships.

Figure 8

Table A1. Relevant data extracted from the TOAR database

Figure 9

Figure A.1. Plot illustrating the hyperparameter optimization and the skill, in terms of the loss on the validation data, of various hyperparameter combinations for the TFT.

Figure 10

Table A2. Hyperparameters for the final TFT and LSTM models used for model evaluation

Figure 11

Figure A.2. Plots illustrating the skill of the model in predicting ozone in different countries across Europe.

Figure 12

Figure A.3. (a) Performance of the TFT when predicting on 2012 spring test data from the UK, France, and Italy. (b) Performance of the TFT when predicting on 2012 summer test data from the UK, France, and Italy.

Figure 13

Figure A.4. Setup of a typical multi-horizon forecasting problem. Source: ’Temporal Fusion Transformers for interpretable multi-horizon time series forecasting’, Lim et al. (2021), licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).

Figure 14

Figure A.5. Architecture of the temporal fusion transformer model. The model consists of a combination of RNN encoders, followed by an attention layer, and then a fully connected decoder layer. Source: ’Temporal Fusion Transformers for interpretable multi-horizon time series forecasting’, Lim et al. (2021), licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).

Figure 15

Figure A.6. Left-hand plot shows the attention paid to different days in the past, averaged over the whole test set. The right-hand plot illustrates an example of the model attending to previous low ozone days when making forecasts of future low ozone. This example is from a station in one of the unseen countries.

Figure 16

Figure A.7. Plot illustrating the feature importances for the static features.