# PM2.5 Concentration Prediction Based on CNN-BiLSTM and Attention Mechanism
## 3 Experiment
### Results and Discussion
#### 3.3.1 Short-Term Forecast with Multi-Source Data  
In order to verify the performance of the proposed model, we first start with short-term predictions. A piece of input data is randomly selected from the test set. Figure 8 compares the prediction results of the proposed model (marked with a red dotted line) with original PM2.5 concentrations (marked with a blue solid line). It can be seen that although the PM2.5 concentration value fluctuates greatly, the proposed model can still fit perfectly. Additionally, the performance index MAE, RMSE, and \(R^{2}\) are 1.3, 1.702, and 0.978, respectively. To ensure the generalization of the proposed model, 10 sets of test sets were randomly selected for experiments, and MAE, RMSE, and \(R^{2}\) are shown in Table 4. The average \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Input**} & \multicolumn{6}{c}{**Output**} \\ \cline{2-7}  & \multicolumn{2}{c}{**24 h**} & \multicolumn{2}{c}{**48 h**} & \multicolumn{2}{c}{**72 h**} \\ \cline{2-7}  & \(MAE\) & \(RMSE\) & \(MAE\) & \(RMSE\) & \(MAE\) & \(RMSE\) \\ \hline
24*10 h & 5.604 & 6.268 & 5.946 & 5.202 & 5.969 & 6.290 \\
24*20 h & 4.829 & 5.740 & 4.986 & 6.043 & 3.928 & 5.715 \\
24*30 h & 4.228 & 5.295 & **2.366** & **3.095** & 3.777 & 4.834 \\
24*40 h & 4.468 & 5.694 & 3.872 & 3.988 & 4.239 & 6.876 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: MAE and RMSE with different input and output variable values (Unit: \(\upmu\)g/m\({}^{3}\)). Figure 7: The attention values of the input variables. values of MAE, RMSE, and \(R^{2}\) of the 10 experiments are calculated, which are 2.366, 3.095, and 0.960, respectively. Furthermore, comparison models are set up to verify the superiority of the proposed model. The performance of the traditional models, machine learning models, and the deep learning models, such as Lasso Regression, Ridge Regression, XGBOOST, SVR, CNN-LSTM, CNN-BiLSTM, and CNN-BiLSTM-Attention model are compared by experimenting on the hourly dataset of Beijing Shunyi District. The parameters of all the comparison models are adjusted to their optimal values. Figure 9 shows the scatter dots of the predicted values of the PM2.5 concentration drawn by the comparison model and the proposed model. The closer the scatter dots are to the diagonal line, the smaller the error is between the predicted and the observed values. It can be intuitively seen from the figure that the performance of the machine learning models is greater than the traditional models, but the prediction result of SVR is poor. Additionally, the precision of deep learning models is better than the machine learning models. The reason for this phenomenon is that the traditional regression method and the two machine learning algorithms used to predict PM2.5 concentration have linear characteristics. However, in reality there is a non-linear relationship between the PM2.5 concentration and the factors related to it. However, among the CNN-LSTM model, CNN-BiLSTM model, and CNN-BiLSTM-Attention model, the performance of the three models shown in Figure 10 is almost the same. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Sample** & **MAE** & **RMSE** & \(R^{2}\) \\ \hline
1 & 3.034 & 4.099 & 0.947 \\
2 & 2.569 & 3.527 & 0.951 \\
3 & 2.006 & 2.991 & 0.963 \\
4 & 2.606 & 3.480 & 0.955 \\
5 & 2.001 & 2.531 & 0.962 \\
6 & 5.821 & 7.503 & 0.934 \\
7 & 1.878 & 2.033 & 0.958 \\
8 & 1.725 & 2.122 & 0.965 \\
9 & 0.718 & 0.964 & 0.982 \\
10 & 1.300 & 1.702 & 0.978 \\ \hline Avg & 2.366 & 3.095 & 0.960 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The MAE, RMSE (Unit: \(\mu\)g/m\({}^{3}\) ), and \(R^{2}\) of the 10 randomized trials of the proposed model. Figure 8: Results of PM2.5 concentration prediction using the CNN-BiLSTM-Attention model. A more accurate comparison of the three deep learning models mentioned above is performed below. As shown in Figure 10, it is not difficult to find that the performance of the proposed model is better than the other two in terms of convergence speed.