Ishan Ayus,Narayanan Natarajan,Deepak Gupta
Comparison of machine learning and deep learning techniques for the prediction of air pollution: a case study from China
AQI,Bidirectional GRU,Bidirectional LSTM,CNN BiLSTM,Conv1D BiLSTM
The adverse effect of air pollution has always been a problem for human health. The presence of a high level of air pollutants can cause severe illnesses such as emphysema, chronic obstructive pulmonary disease (COPD), or asthma. Air quality prediction helps us to undertake practical action plans for controlling air pollution. The Air Quality Index (AQI) reflects the degree of concentration of pollutants in a locality. The average AQI was calculated for the various cities in China to understand the annual trends. Furthermore, the air quality index has been predicted for ten major cities across China using five different deep learning techniques, namely, Recurrent Neural Network (RNN), Bidirectional Gated Recurrent unit (Bi-GRU), Bidirectional Long Short-Term Memory (BiLSTM), Convolutional Neural Network BiLSTM (CNN-BiLSTM), and Convolutional BiLSTM (Conv1D-BiLSTM). The performance of these models has been compared with a machine learning model, eXtreme Gradient Boosting (XGBoost) to discover the most efficient deep learning model. The results suggest that the machine learning model, XGBoost, outperforms the deep learning models. While Conv1D-BiLSTM and CNN-BiLSTM perform well among the deep learning models in the estimation of the air quality index (AQI), RNN and Bi-GRU are the least performing ones. Thus, both XGBoost and neural network models are capable of capturing the non-linearity present in the dataset with reliable accuracy.
Comparison of machine learning and deep learning techniques for the prediction of air pollution: a case study from China

The adverse effect of air pollution has always been a problem for human health. The presence of a high level of air pollutants can cause severe illnesses such as emphysema, chronic obstructive pulmonary disease (COPD), or asthma. Air quality prediction helps us to undertake practical action plans for controlling air pollution. The Air Quality Index (AQI) reflects the degree of concentration of pollutants in a locality. The average AQI was calculated for the various cities in China to understand the annual trends. Furthermore, the air quality index has been predicted for ten major cities across China using five different deep learning techniques, namely, Recurrent Neural Network (RNN), Bidirectional Gated Recurrent unit (Bi-GRU), Bidirectional Long Short-Term Memory (BiLSTM), Convolutional Neural Network BiLSTM (CNN-BiLSTM), and Convolutional BiLSTM (Conv1D-BiLSTM). The performance of these models has been compared with a machine learning model, eXtreme Gradient Boosting (XGBoost) to discover the most efficient deep learning model. The results suggest that the machine learning model, XGBoost, outperforms the deep learning models. While Conv1D-BiLSTM and CNN-BiLSTM perform well among the deep learning models in the estimation of the air quality index (AQI), RNN and Bi-GRU are the least performing ones. Thus, both XGBoost and neural network models are capable of capturing the non-linearity present in the dataset with reliable accuracy.

Air pollution has become a significant concern in several countries. The issue of urban air pollution has grown more acute as a result of the fast urbanization and acceleration of industrialization. It has adversely affected our physical health and living environment. This is caused due to excessive release of dangerous substances into the atmosphere, such as greenhouse gases, particulates, and biological compounds (Goudarzi et al., 2019; Khaefi et al., 2016). The presence of pollutants in the air can cause allergies, illnesses, and even death (He et al., 2019; Liu et al., 2018). Urbanization and industrialization have tremendously augmented air pollution (Lin & Zhu, 2018). The public is sensitive even to marginal changes in air quality as it has a severe impact on human health (Khaniabadi et al., 2017; Zou et al., 2019). Air pollution control is complex with no rigid environmental regulations (Kumar et al., 2022). As a result, research on forecasting air quality is crucial and has always been seen as a crucial issue in environmental preservation. It serves as a key tool for guiding scientific judgement in air pollution warning and management decisions. To track a city’s PM2.5 and other air pollutants in real time, several large cities have installed air quality monitoring stations. A major challenge of the work of forecasting air quality is the early diagnosis of air pollution incidence and PM2.5 concentration value progression. Several studies have been conducted for the prediction of individual air quality parameters (Wu et al., 2011; Li et al. 2016; Li et al., 2017; Wen et al., 2019; Al-Janabi et al. 2020; Gu et al. 2020), which are measured in the units of parts per million or micrograms per cubic metres. In comparison with the individual parameters, the Air quality index (AQI) is a comprehensive index that measures air quality in a quantitative manner, obtained by integrating numerous air quality pollutants. This is estimated with reference to the new ambient air quality standards GB2095-2012 for China (Zhu et al., 2017). The AQI is a unique indicator that enables us to closely monitor the influence of air quality on health (Ribeiro et al., 2016). The lower value of AQI guarantees better human health, and vice versa. Table 1 provides the air quality index classification for China. Real-time AQI facilitates air pollution control and the protection of human health (Ni et al., 2017). Early prediction of AQI plays a vital role in the decision-making for environmental management and prevention of upcoming dangers due to air pollution (Jiang et al., 2018; Pisoni et al., 2018). In the past, approaches such as Artificial Neural Networks (ANN) (Song et al., 2015; Patra et al., 2016; Perez et al. 2016; Biancofiore et al., 2017), Support Vector Machine (SVM) (Osowski & Garanty, 2007), and Adaptive Neuro-Fuzzy Inference System (ANFIS) (Taylan 2017) were used to predict the air quality parameters. Recently, Shahriar et al. (2020) used machine learning models such as Linear Support Vector Machine (L-SVM), ANN, Gaussian Process Regression (GPR), Medium Gaussian-Support Vector Machine (M-SVM), time series model PROPHET, and Random Forest Regression (RFR), for the prediction of oxides of nitrogen (NOX), ozone (O3), sulphur dioxide (SO2), and carbon monoxide (CO) along with meteorological parameters from Dhaka, Rajshahi, Chattogram, and Sylhet. Later, Shaziayani et al. (2021) determined the best loss function between Quantile Regression (QR) and Ordinary Least Squares (OLS) using Boosted Regression Tree (BRT) for the prediction of particulate matter with 10 microns (PM10) concentration in Malaysia. Jing et al. (2020) have utilized the XGBoost model of machine learning to study the hourly prediction of AQI for Shijiazhuang, Hebei province. Kumar et al. (2022) have investigated the performance of various machine learning models for the analysis of 6 years of air pollution data across 23 stations in India where XGBoost performs best among the considered models. While both machine learning and deep learning use data for feature learning, deep learning differs considerably from machine learning due to its ability to scale with data. Machine learning systems generally experience a performance plateau after training on large data sets before diminishing returns occur. However, as the size of the training datasets increases, deep learning models perform better. Deep learning automatically performs feature extraction and modelling following data training, whereas machine learning requires data scientists or users to do it. Traditional machine learning models cannot solve some problems, but deep learning models can. In recent decades, deep learning (DL) has picked up momentum since it considers a multi-level learning process, where learning occurs at each level for a particular part of the problem, and the conglomeration of the results enables to solve the overall problem (Al-Janabi et al. 2020). In Ong et al. (2015), proposed a Deep Recurrent Neural Network (DRNN) enhanced with a novel pre-training technique, auto-encoder for the prediction of PM2.5 concentrations in Japan. In 2006, Li et al. proposed a novel Spatio-Temporal Deep Learning (STDL)-based air quality prediction method that uses a stacked autoencoder to extract inherent air quality features to predict PM2.5. They reported that their proposed method performed better compared to Spatio-Temporal ANN (STANN), Spatio-Temporal Support Vector Regression (STSVR), and Spatio-Temporal Autoregressive Moving Average (STARMA). Freeman et al. (2018) predicted 8-h averaged surface ozone (O3) concentrations using deep learning consisting of a recurrent neural network (RNN) with long short-term memory (LSTM). They found that the LSTM was able to forecast the duration of continuous O3 exceedances as well. In Jiao et al. (2019), predicted the AQI using Long Short-Term Memory (LSTM) with the help of PM2.5, PM10, sulphur dioxide (SO2), wind direction, nitrogen dioxide (NO2), carbon monoxide (CO), and ozone (O3). They concluded that LSTM is capable of the prediction of AQI. In 2020, Al-Janabi et al. proposed a new predictor based on LSTM and Particle Swarm Optimisation (PSO) to predict the concentration of six types of air pollutants. Dhakal et al. (2021) used deep LSTM to predict PM2.5 in Kathmandu Valley, Bangladesh, accurately. Many researchers have also analysed various recurrent deep neural networks such as RNN, GRU, and LSTM networks for identifying efficient predictive models (Athira et al., 2018; Navares & Aznarte, 2020). Literature review reveals that various deep learning techniques have been employed to predict the air quality parameters but the performance comparison of various recurrent deep learning, hybrid deep learning, and machine learning techniques is yet to be explored. From past studies, it is quite evident that machine learning and deep learning techniques are widely used for various studies. In certain circumstances, machine learning performs well. While in other circumstances, deep learning models present their best performance. A hybrid model is created based on the combination of their better halves. The hybrid deep learning techniques are found to be useful for modelling the uncertainty by the fusion of deep neural networks along with a probabilistic approach. These models are more advantageous than any other model because they maintain the dual effect of the original model. In this study, we have compared various recurrent-based networks to identify a better predictive model for predicting AQI. The objective of the study is to compare various machine and deep learning techniques for predicting the air quality index. For this purpose, we have considered the data from various stations in China. The researchers have suggested that among the various machine learning models the XGBoost is considered the most suitable machine learning model for prediction and hence, considered in this study. Similarly, among the recurrent deep neural network-based models, simple recurrent neural networks, bidirectional gated recurrent networks, bidirectional long short-term memory networks, etc., have been considered. All the above-mentioned models have been compared with hybrid deep learning models such as Convolutional LSTM and Convolutional neural network- LSTM. In the present study, we have analysed the five different deep learning (both recurrent and hybrid) techniques, namely, Bidirectional-GRU (Bi-GRU), Bidirectional LSTM (Bi-LSTM), Recurrent Neural Network (RNN), CNN-BiLSTM, and Convolutional BiLSTM (Conv1D-BiLSTM), along with a machine learning technique, i.e. XGBoost for comparison of their accuracy in forecasting AQI. This study performs a detailed analysis on the performance of the above-mentioned models for ten stations across China. In essence, the behaviour of various predictive models has been compared for the efficient prediction of AQI in China.

China is located in the Southeast region of Asia (Agency, 2011) with the world’s highest population. To meet the increasing needs of the growing population, China had to increase investments in various developmental projects. The surge in various goods manufacturing factories and the increasing number of motorized vehicles are potential factors for rising air pollution. The alarming situation caused due to the increasing air pollution needs to be handled carefully for the betterment of people. According to an earlier study, China possesses a higher distribution of population density in the southeast region when compared to the northwest (Minmin, et al. 2018). Therefore in this study, we have considered ten major stations in the most populated regions of China. These cities include Beijing, Chengdu, Chongqing, Dongguan, Guangzhou, Shanghai, Shenyang, Shenzhen, Tianjin, and Wuhan. The location of the various stations is shown in Fig. 1. The geographical details such as latitude, longitude, and elevation of the selected stations are provided in Table 2. It is observed from Table 2 that most of the stations are lying in very low altitudes (Shenzhen, Shanghai, Tianjin, and Dongguan), while some of them are situated higher (Shenyang, Wuhan, Guangzhou, and Beijing). Among the chosen stations, Chongqing and Chengdu are situated at higher elevations of 244 m and 500 m. Hence, the current study takes into account stations located at various altitudes.

This study evaluates six different models using a variety of deep learning and machine learning methods, including CNN-BiLSTM, Conv1D-BiLSTM, RNN, BiLSTM, Bi-GRU, and XGBoost. We have compared and identified the most appropriate model for efficient forecasting of air quality. Figure 2 presents a schematic flow diagram representing the methodology for air quality prediction. The methodology in this study includes collecting and loading the air quality datasets, data pre-processing, model building, model training, prediction, performance evaluation, and selection of the most suitable model. Initially, the air quality data was collected for analysis. The study involved a series of data preprocessing steps aimed at cleaning noisy data, followed by the calculation of the Air Quality Index (AQI) and the division of the dataset into training and testing sets. The preprocessed data contained information on PM2.5, carbon monoxide (CO), sulphur dioxide (SO2), PM10, nitrogen dioxide (NO2), and ozone (O3), along with their corresponding AQI values, for a duration of 24 h. Machine learning models such as XGBoost, and deep learning models such as RNN, BiLSTM, and BiGRU, as well as hybrid models such as CNN-BiLSTM and Conv1D-BiLSTM, were employed for training. These models were trained successfully on the preprocessed data. During the testing phase, models were evaluated using pollutant data from the testing set to determine their predictive accuracy of AQI. The predicted and observed data were then compared to produce performance metrics, and the performance of each predictive model was compared to identify the most appropriate model for accurate AQI prediction.

In this study, we examined daily air quality data obtained from ten different cities in China, namely, Beijing, Shanghai, Chongqing, Dongguan, Shenyang, Shenzhen, Chengdu, Guangzhou, Tianjin, and Wuhan. The data spanned more than 7 years, specifically, from December 31, 2013, to May 6, 2021. The data was collected from the website https://aqicn.org comprising several crucial variables, namely, PM2.5 (particle diameter ≤ 2.5 µm), PM10 (particle diameter ≤ 10 µm), sulphur dioxide (SO2), nitrogen dioxide (NO2), ozone (O3), and carbon monoxide (CO), which was deemed necessary for accurately predicting the air quality index (AQI).

Data pre-processing is one of the essential stages for any data analysis problem where the noise present in the datasets is detected and removed. The data pre-processing consists of three different sub-steps, i.e. data cleaning, AQI calculation, and splitting of the dataset into training and testing sets. Initially, the process of data cleaning was performed on the raw data, where the missing values present in the dataset are replaced. We have considered a simple imputation technique using a central tendency measure for filling in the missing value. When outliers are present in the observed data, using the median is more reliable than the mean. Hence, the median values are considered to replace the missing values for various pollutant parameters such as PM2.5, PM10, SO2, O3, CO, and NO2 data. The duplicate observations and outliers were also identified and removed. Further, the AQI values were calculated using various air pollutant parameters for selected stations in China. The AQI value is an essential index value used for determining the quality of air in a particular region. The calculated AQI was added to the dataset as a target variable. Data are normalized to deal with variable significance and improve the model learning rate. To normalize the data, in this study, we have used min–max normalization which performs a linear transformation on the given data. Multiple variables are normalized by normalizing each variable (PM2.5 (particle diameter ≤ 2.5 µm), PM10 (particle diameter ≤ 10 µm), sulphur dioxide (SO2), ozone (O3), nitrogen dioxide (NO2), and carbon monoxide (CO)) separately. Normalization retains the pattern of data by scaling down the data to the range of 0–1. The relationship between the various variables is preserved in normalization. Mathematically, Here represents the maximum value of a variable K, represents the minimum value of a variable K, is the input value, is the new maximum value which is equal to 1, and is the new minimum value which is equal to 0 (Han et al., 2012). Again presents the normalized values of each data entry on the basis of respective variables. The considered variables are essential for better forecasting of the air quality index. Therefore, these variables normalized each entry of the variable by utilizing the minimum ( and maximum () values of the respective variable. Again here K ranges from 0 to 5 where K = 0 refers to PM2.5, K = 1 refers to PM10, K = 2 refers to SO2, K = 3 refers to O3, K = 4 refers to NO2, K = 5 refers to CO. Further, the normalized dataset is ready for random splitting where 80% of the total dataset is considered as training dataset and rest 20% of the total dataset is considered as testing dataset.

The Air Quality Index (AQI) measures the status of air quality. The index value of AQI generally ranges from 0 to 500, where the highest index value indicates the presence of harmful air pollutants in the air, thus causing adverse health effects on the common people. Similarly, the presence of the lowest index value ensures the presence of the best quality of air in the atmosphere. The input data is composed of the various air pollutant concentrations as a variable such as SO2, CO, NO2, O3, PM2.5, and PM10. These input variables have various constraints for different air pollutants such as O3 which is collected with a maximum of 8 h while SO2, CO, NO2, PM2.5, and PM10 are collected with an average concentration of 24 h as shown in Table 3. The computation of AQI (average of 24 h) is a two-step process as given below. (i) Individual -index for each pollutant. Mathematically, the sub-index () is given by where is the pollutant concentration, is the breakpoint concentration which is either greater than or equal to the given concentration , is the breakpoint concentration which is either smaller or equal to the given concentration , is the breakpoint index for , is the breakpoint index for . The calculated sub-index of each pollutant concentration describes their influence on human health. And the calculated sub-index of each pollutant is utilized to determine an overall AQI value of the basis of different pollutants such as SO2, CO, NO2, O3, PM2.5, and PM10. (ii) The sub-indices for pollutant concentration are aggregated to determine the overall AQI values by using weighted average method as given below. where (PM2.5) is the sub-index value for PM2.5 with an average of 24-h concentration, (PM10) is the sub-index value for PM10 with an average of 24-h concentration, is the sub-index value for O3 with a maximum of 8-h concentration, is the sub-index value for SO2 with an average of 24-h concentration, is the sub-index value for CO with an average of 24-h concentration, and is the sub-index value for NO2 with an average of 24-h concentration. And WA refers to the weighted average method to calculate AQI value. The AQI index was calculated as output data concentration for an average duration of 24 h.

Extreme Gradient Boosting is an efficient Gradient Boosting Decision Tree (GBDT) algorithm with the perfect combination of hardware and software optimization techniques that produce better results with efficient usage of memory. This model prevents the condition of overfitting as it supports both LASSO (L1) and Ridge (L2) regularization. The use of regularization, sparsity awareness, weighted quantile sketch algorithm, and cross-validation results in algorithmic enhancement. The system optimization is assisted by parallelization, tree pruning, and hardware optimization (Chen & Guestrin, 2016). At each iteration, the XGBoost algorithm computes a set of features that are most important for predicting the target variable. These features are used to split the data into smaller subgroups based on their values. The subgroups are split until the model can no longer make improvements, or until a predefined stopping criterion is met. The goal of the XGBoost algorithm is to learn a function that can predict a continuous numerical value given a set of input features. To increase the model’s accuracy, the XGBoost method iteratively adds decision trees to it. The decision trees are built using a process called boosting, where each subsequent tree is built to correct the errors of the previous trees. The boosting process is done in a way that each new tree focuses on the samples that were misclassified by the previous trees. The tuning of parameters and other influential factors is responsible for winning an algorithm. The model has been implemented for a wide range of parameters to choose the best-performing parameter for the problem.

A short-term memory network formed from a feed-forward neural network is referred to as RNN. The connection between the different nodes and backward loops enables the network to remember the present and the recent past. Thus, the model retains essential information of input data allowing precise prediction of the corresponding output. Mathematically, the output from the different layers is given bywhere represent input layer sequence, represents hidden layer sequence, and represents output layer sequence. is the hidden-output weights, is the hidden-hidden weight, is the input-hidden weight, is the current input data, is the new state of the hidden layer, is the previous state of the corresponding hidden layer, is bias at the hidden layer, and bias at the output layer. The RNN models do suffer from the problem of vanishing gradient, i.e. as the parameters are updated the gradient becomes smaller and smaller, and gradually the parameters become insignificant affecting the learning rate of the long data sequence (Nejadettehad et al., 2020). In this study, we have used 2 simple RNN layers followed by a dense layer. The parameters like Adam optimizer, number of epochs as 200, learning rate as 1e − 8, and decay as 1e − 9 are utilized by the designed model.

GRUs is a special type of recurrent neural network that has two primary gates, the update gate and the reset gate. The memory of the network is controlled using these gates. The update gate permits us to control the amount of the new state as just the copy of the old state whereas the reset gate permits us to control the amount of the previous state we want the network to remember. Mathematically, if represents the input state of given time step and represents the hidden state of previous time step, then output at reset gate, i.e.; output at update gate, i.e.; candidate hidden state, i.e.; and final update equation, i.e., are given bywhere , are biases and , , are weight parameters. The Hadamard product operator is represented by the symbol ⨀. The sigmoid function is used to remodel the input data to the interval (0–1) (Zhou et al., 2019a, 2019b). The following parameters are considered for this model, Adam optimizer, number of epochs as 200, learning rate as 1e − 3, and decay rate as 1e − 9.

Bi-GRU is a bidirectional structure with the ability to learn the data sequence from both directions. This model is a combination of two unidirectional GRUs. One of these GRU models allows learning in a forward direction, i.e. from the beginning of the data sequence whereas the other GRU allows learning in a backward direction, i.e. from the end of the data sequence. Mathematically, the definition of Bi-GRU can be expressed as:where represents the final state of forward GRU, represents the final state of backward GRU, and ⨂ symbol represents the concatenation operation (Zhou et al., 2019a, 2019b). In this study, we have used two layers of Bi-GRU followed by dense layers. The following parameters are considered for this model, Adam optimizer, number of epochs as 200, learning rate as 1e − 3, and decay rate as 1e − 9.

A variant of RNN with the ability to solve long-term dependency problems is referred to as LSTM. LSTM comprises different gates like forget, input, and output gate which retains or remove information from the given cell state. The different mathematical operations used in each layer are as followswhere is the weight, are the biases, is the input, is the output of previous state, is the output of forget gate, is the output of input gate, is the output of output gate, and is the cell state (Xayasouk et al., 2020). The different variants of LSTM networks considered in this study are BiLSTM, CNN-BiLSTM, and Conv1D-BiLSTM. These models have some common parameters such as number of epochs as 200, learning rate as 1e − 8, and decay as 1e − 9. The Adam optimizer was found to be the most suitable type of optimizer for the given problem.

The bi-LSTM model is a unique LSTM model with the ability to capture both forward and backward information from input data. This network runs the input sequence in two ways, i.e. from past to future as well as from future to past. The corresponding outputs are concatenated before passing to the next layer. The bidirectional network learns both from past and future data to predict the current state precisely (Li et al., 2018a, 2018b; Zhang et al., 2021). A bi-LSTM network is designed using two layers of bidirectional LSTM layer with the default merge mode, i.e. ‘concat’ followed by dense layers.where ⨂ symbol represents the concatenation operation, is the input, is the output of past state, and is the output of future state.

CNN-BiLSTM is a hybrid model which uses a convolutional neural network for feature extraction and the bidirectional LSTM model to perform sequence prediction. This model is temporally and spatially deep and flexible enough to solve various problems of prediction. The convolution operation determines the relationship between two functions (Lu et al., 2020). The implementation of the CNN-BiLSTM model uses a 1D convolutional network which consists of Conv1D and MaxPooling1D layers, two BiLSTM layers followed by two dense layers. The Conv1D layer is assigned with the following parameters, namely, kernel size as 5, filters as 32, activation function as relu, and strides as 1. The Maxpooling1D layer uses a single parameter pool size which is assigned as 2.

Conv1D-BiLSTM is a special kind of LSTM with an encoding–forecasting structure (Shi et al., 2015). The Conv1D-BiLSTM layer has been implemented with the Conv1D layer, two BiLSTM layers followed by two dense layers. This model performs padding just before the convolution operation to ensure that the state has the same number of rows and columns as that of input data. The different parameters used by the conv1D layer includes filters as 32, activation function as relu, kernel size as 5, and strides as 1.

The reliability of different models is evaluated using different statistical indices such as Mean Square Error (MSE), Index of Agreement (IA), Mean Absolute Error (MAE), Root Mean Square Error (RMSE), and Symmetric Mean Absolute Percentage Error (SMAPE). They are mathematically defined as follows:where K is the number of samples, is the actual AQI level, is the average of original AQI level, is the forecasted AQI level, is the average of forecast AQI level, and IA . In this study, we compared a number of performance indicators for predicted and measured Air Quality Index (AQI) values for the time period from 17 November 2019 to 6 May 2021.

In this section, the average annual AQI trends are analysed for the selected stations, namely, Beijing, Chengdu, Chongqing, Dongguan, Guangzhou, Shanghai, Shenyang, Shenzhen, Tianjin, and Wuhan from the period of 2014 to 2020. From Fig. 3, it is observed that the annual AQI of all the selected cities has improved over the years except for a year or two in between. It is observed that most of the stations (Beijing, Chengdu, Chongqing, Dongguan, Guangzhou, Shenyang, Shenzhen, Tianjin, and Wuhan) are having a poor average air quality index in the year 2014. Shanghai is having the same in the year 2015. All the chosen stations have the best average air quality index in the year 2020 due to the imposition of lockdown to prevent the spread of the COVID-19 virus. In this study, the calculation of the Air Quality Index (AQI) value was conducted during the pre-processing stage. Subsequently, the pollutant data (SO2, CO, NO2, O3, PM2.5, and PM10) was employed as feature variables to training the models, and the calculated AQI was considered as the target variable. The models were utilized to forecast the predicted AQI value, which was subsequently compared with the calculated AQI value utilizing the pollutant data. The actual predicted values and measured values of the parameters in this scenario depend on the specific considered models and dataset being used. The measured values of these pollutants would be the actual values measured by sensors located throughout the city, expressed in units such as μg/m3 or parts per million (ppm). The calculation of the Air Quality Index (AQI) involves a two-step process as described by Eqs. 2 and 3. In the first step, sub-indices are computed for each individual pollutant. Subsequently, the sub-indices are aggregated (weighted average method) and used to determine the AQI for a 24-h period. The actual predicted values, on the other hand, would be the predicted AQI values for a period of 24-h predicted based on the air pollutant measurements. To make these predictions, various machine learning models and deep learning models are considered taking into account the air pollutant measurements as input features and output predicted AQI values. The performance of the six different models, XGBoost, RNN, BiLSTM, BiGRU, CNN-BiLSTM, and Conv1D-BiLSTM, is compared on the basis of different performance metrics for various stations in China as presented in Tables 4, 5, 6, 7, 8, 9, 10, 11, 12, and 13. The performance metrics measure the deviation of the predicted value from the actual value. The Mean Absolute Error (MAE) and Root Mean Square Error (RMSE) are closer to zero indicating the highest prediction accuracy. The RMSE values obtained from the application of the XGBoost model for Beijing, Chengdu, Chongqing, Dongguan, Guangzhou, Shanghai, Shenyang, Shenzhen, Tianjin, and Wuhan stations are 0.0103, 0.0086, 0.0086, 0.0027, 0.0191, 0.0082, 0.0082, 0.002, 0.0219, and 0,0113. Only for station Tianjin, the RMSE values of XGBoost coincides with that obtained from Conv 1D-BiLSTM, while for all other stations XGBoost has acquired the least RMSE. Therefore, based on the comparison of the evaluation metrics of the various models, it can be concluded that XGBoost outperforms the deep learning models, irrespective of whether it is simple or hybrid. The overall performance measures for different models are also compared by average rank calculation as shown in Table 14. The XGBoost presents the highest rank in the average rank table (Table 14). Thus, it can be concluded that XGBoost is the best predictive model among the selected models. The algorithmic enhancements and systems optimization are the major reasons for the outstanding performance of the XGBoost model. The XGBoost model’s exceptional performance can be attributed to its ground-breaking algorithmic enhancements and finely tuned systems optimization. The various algorithmic enhancement used by XGBoost includes the presence of regularized gradient boosting, approximate computing, and distributed computing technique. Through meticulous optimization, the XGBoost model has achieved unparalleled precision and accuracy, surpassing all previous benchmarks and raising the bar for machine learning models. The various system optimization technique used in XGBoost is parallelization, approximate algorithms, cache-aware access, block algorithms, out-of-core computation, tree pruning, etc. The innovative algorithmic enhancements have enabled the XGBoost model to learn and adapt with remarkable efficiency, making it a standout model in the field of data science. One of the key advantages of XGBoost over RNNs is its ability to handle high-dimensional and sparse data. XGBoost utilizes an ensemble of decision trees to make predictions, which can handle sparse data more effectively than RNNs. Additionally, XGBoost is computationally efficient, which allows it to train on large datasets in a relatively short amount of time. The decision trees used in XGBoost are easy to interpret and can provide insights into how the model is making predictions. This can be useful in certain industries, such as finance, where understanding the reasoning behind a prediction is crucial. RNNs have a memory component that allows them to retain information from previous time steps, which can be useful in predicting future values in a time series. Additionally, RNNs can handle variable-length sequences, which can be difficult for XGBoost to handle. Ultimately, the choice between XGBoost and RNNs depends on the specific problem at hand and the nature of the data. While XGBoost may be better suited for certain types of data and problems, RNNs may be the better choice for others. It is important to carefully consider the strengths and weaknesses of each algorithm prior to their implementation. The performance of Conv1D-BiLSTM is the best among the deep-learning models. Next to the XGBoost model, CNN-BiLSTM shows good satisfactory performance for some of the stations. The denoising effect caused by the convolutional layer in the Conv1D-BiLSTM and CNN-BiLSTM models enabled them to perform better than the superior variant of RNN. Hence, the hybrid deep learning models tend to perform better than the simple stand-alone deep learning model. The majority of the models that were chosen fit the dataset and show minor deviations between the predicted and actual AQI values as shown in Figs. 4, 5, 6, 7, 8, 9, 10, 11, 12, and 13. The calculated equation generally minimizes the distance between the fitting line and the data points. The statistical measure r-square provides the closeness of data to the fitted regression line, which varies from 0 to 1. The r-square values are closer to 1 for most of the models indicating that the model is able to fit the given data. In most of the stations, the r-square value of the XGBoost model is closest to 1, therefore, suggesting XGBoost as the better-performing model for all the selected stations. As demonstrated in Fig. 14, the performances of multiple models in predicting AQI levels were evaluated over a specific period of 30 days. Through this analysis, the study sought to identify the most effective models for AQI prediction and to provide insight into the factors influencing air quality levels during the research period. From the comparison plots (Fig. 14 a–j), it is observed that both XGBoost and neural network models are capable of capturing the non-linearity present in the dataset with reliable accuracy. The performance gaps between the different models are quite small with similarity in capturing the generic trend of the air quality index for the ten stations during the testing period. As per the graph, it can be visualized that the XGBoost model has better superimposition among the considered models on the actual AQI value in all selected stations. The RNN and Bi-GRU are the least-performing models among the selected models. Some of the better-performing models include Bi-LSTM, CNN-BiLSTM, and Conv1D-BiLSTM. It is found that the XGBoost is the most significant model to perform efficient AQI forecasting. Hence, the results reveal that the prediction of the air quality index through XGBoost outperforms other deep learning models.

This study proposes a prediction framework using six different models (deep learning models and XGBoost) to understand the estimation of AQI on the basis of 7 years of data collected from various stations in China. The prediction of AQI was carried out using a machine learning model, namely, XGBoost, and five deep learning models, namely, Bi-GRU, BiLSTM, CNN-BiLSTM, Conv1D-BiLSTM, and RNN. The performance of RNN and Bi-GRU models is poor when compared to the other models. The XGBoost model has outperformed even the deep learning models due to the least RMSE values in the prediction of AQI for the chosen 10 stations. The conv1D-BiLSTM model is found to be the most efficient deep learning model to predict the AQI due to its hybrid nature and performance on par with XGBoost for some stations. This study has analysed the performance of various machine learning, deep learning, and hybrid models which helps us understand the behaviour of these models on the air quality data with a sample size of 7 years. These hybrid models combine the best characteristic of the base model. The performance of hybrid models such as Conv1D-BiLSTM and CNN-BiLSTM is better than that of the base models for some stations. While in other stations, XGBoost outperforms other considered models due to the consideration of a smaller sample size. Therefore, such an analytical study will help us understand the merits of the considered models under certain circumstances. Furthermore, this study provides insight into the effectiveness of different predictive models for air quality, which can be useful for policymakers and city planners to design effective strategies to mitigate air pollution. The results also show that XGBoost is preferable to deep learning models for the prediction of air quality in several Chinese cities. This study also demonstrates the promise of deep learning models for effectively modelling data’s inherent non-linearities and boosting the precision of the prediction. The findings augment knowledge in the field of environmental engineering as it illustrates the application of machine learning and deep learning techniques in this field. Hence, the prediction of AQI using machine learning and deep learning models can enable environmentalists to take appropriate actions to minimize air pollution in the cities. The study also carries a few limitations. An efficient prediction of the air quality index is not possible by analysing limited pollutants such as SO2, CO, NO2, O3, PM2.5, and PM10. Consistent availability of data is very important in obtaining an efficient predictive model but the unavailability of consistent environmental data is one of the huddles of such air pollution prediction studies.