Air Quality Prediction Method Based on the Fusion of Multiple Neural Networks
By fusing CNN, BiLSTM, and GRU neural networks to build CNN-BiLSTM-GRU neural networks, the problem of inability to learn long-distance dependence and low prediction accuracy in air quality prediction in the prior art is solved, and more efficient and more accurate air quality prediction is achieved.
Patent Information
- Application Number
- CN202210905830.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2042-07-29
AI Technical Summary
The prior art cannot learn long-distance dependencies in air quality prediction, and is prone to falling into local minimization problems, slow convergence speed and low prediction accuracy.
Using the fusion method of three neural networks, CNN, BiLSTM and GRU, features are extracted through CNN, BiLSTM captures long-distance dependencies, GRU improves convergence speed and prevents gradient diffusion, and builds a CNN-BiLSTM-GRU neural network for air quality prediction.
The accuracy of air quality prediction and the calculation efficiency of the model are improved, and the pollutant concentration value can be predicted more accurately at the next moment.
Smart Images

Figure CN115308370B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of environmental data prediction methods based on deep learning algorithms, and particularly to an air quality prediction method based on the fusion of multiple neural networks. Background Art
[0002] Among gaseous pollutants, the emitted sulfur dioxide will stimulate the respiratory tract of the human body, induce various respiratory diseases, and at the same time cause harm to vegetation, etc. The emitted nitrogen oxides will combine with other pollutants to produce photochemical smog pollution. The current national indicators for evaluating environmental air quality are mainly based on the concentrations of six pollutants, namely ozone (O3), nitrogen dioxide (NO2), sulfur dioxide (SO2), carbon monoxide (CO), fine particulate matter (PM2.5), and inhalable particulate matter (PM10). In addition, meteorological data including temperature, air pressure, dew point, wind speed and direction, etc. can be observed at Chinese meteorological stations.
[0003] In recent years, the problem of air pollution has become increasingly serious and has become a global issue. Air quality monitoring is an important means to deal with air pollution. The country has established multiple air monitoring stations to monitor air pollution conditions in real time. Overall planning is carried out by government departments, and its data accuracy is relatively high. Predicting the pollutant concentration data at the next moment from the historical data and the data at the current moment can help people reduce the probability of going to areas with poor air quality and better avoid the harm caused by pollutants.
[0004] At present, commonly used prediction networks include RNN, BPNN, etc. They have disadvantages such as being unable to learn long-distance dependence relationships, being prone to falling into local minima problems, and having a slow convergence speed when actually used. This patent combines three networks, CNN, BiLSTM, and GRU, which can not only extract representative features, reduce the dimension of features, but also better capture the long-distance dependence relationships between various features, improve the convergence speed, and improve the calculation efficiency of the model while improving the prediction accuracy of pollutant concentrations. Summary of the Invention
[0005] The purpose of the present invention is to make up for the defects of the existing technology and provide an air quality prediction method based on the fusion of multiple neural networks to solve the problems existing in the prior art, such as being unable to learn long-distance dependence relationships, being prone to falling into local minima problems, having a slow convergence speed, and low prediction accuracy.
[0006] The present invention is realized through the following technical solutions:
[0007] An air quality prediction method based on the fusion of multiple neural networks includes the following steps:
[0008] Step 1: Obtain the time series data of air pollutants and meteorological characteristics measured at national control stations, construct a data set as the feature input based on this, and preprocess the data set, dividing it into a training set and a test set;
[0009] The data measured at national control stations includes the concentration values of various air pollutants, temperature, dew point, wind speed and direction, and air pressure values. The present invention constructs a data set based on these data measured at national control stations.
[0010] Step 2: Check the Pearson correlation coefficients between each feature, and eliminate other features that are not relevant to the feature to be predicted to reduce data redundancy;
[0011] Step 3: Determine the sliding time window T, perform data sequence segment slicing processing on each feature component, construct batch data, and perform data encapsulation on it;
[0012] Step 4: Construct a CNN-BiLSTM-GRU neural network through the existing tensorflow framework, input the encapsulated training data set into the network, continuously adjust the neural network parameters, create a file to save the best weight values, and obtain the optimal parameters of the network;
[0013] Step 5: Input the test set into the network obtained in Step 4, obtain the correlation coefficient and root mean square error between the predicted value and the true value of the feature to be predicted, and measure the prediction performance of the network;
[0014] Step 6: Use the trained network for air quality prediction, perform anti-normalization processing on the predicted value, and obtain the accurate air quality prediction value for the next moment;
[0015] In Step 1, the linear interpolation method is used to fill the data in the data set to complete the missing values in the data set, and its calculation formula is:
[0016]
[0017] In the formula, x i is the value of the missing part, x j is the known value in front of x i , x k is the known value behind x i , and i, j, and k are natural numbers greater than or equal to 1.
[0018] In Step 1, the MaxAbs normalization method is used to normalize the data in the data set, and its calculation formula is:
[0019]
[0020] In the formula, x is the original value, x′ is the value after normalization, x maxis the maximum value of the input feature.
[0021] The calculation formula of the Pearson correlation coefficient in step 2 is:
[0022]
[0023] In the formula, cov(X,Y) is the covariance between features X and Y, and σ X , σ Y are the standard deviations of features X and Y respectively.
[0024] In step 3, the size of the sliding time window T is set to 12, and the batch data size is set to 120;
[0025] In step 4, the CNN convolutional neural network uses one-dimensional convolution and one-dimensional pooling layers. One-dimensional convolution slides a window in the length or width direction and multiplies and sums. The size of the convolutional layer filter is set to 96, the activation function is set to PReLU, and the convolution operation process is:
[0026]
[0027] In the formula, y l is the output after l-layer convolution operations, g() is the activation function, is the input of the m-th part of the l-th layer convolutional region, is the weight of the m-th part of the l-th layer, * is the convolution operation, is the bias term of the l-th layer.
[0028] There are no parameters to be trained in the pooling layer of the convolutional neural network. Just specify the pooling type, the kernel size of the pooling operation, and the moving step size. The pooling operation process is:
[0029]
[0030] Among them: is the pooling result of the m-th array of the l-th layer, is the p-th value in the m-th array region of the l-th layer, and h() is the pooling function.
[0031] In step 4, the BiLSTM bidirectional long short-term memory neural network is single-layer, and the number of neurons is 64.
[0032] In step 4, the GRU gated recurrent unit neural network is double-layer. The number of neurons in the first layer is 64, and the number of neurons in the second layer is 32. To prevent overfitting, Dropout is introduced between the two layers of GRU networks, the parameter is set to 0.2, and the learning rate is set to 3e-4.
[0033] In the fully connected layer of the network constructed in step 4, the neurons in this layer are connected to the neurons in the previous layer one by one.
[0034] The data obtained thereby is de-normalized to obtain the final predicted value.
[0035] In the present invention, the CNN convolutional neural network extracts and filters the main features of the input time series data, reduces the data dimension, and then, through the learning of the BiLSTM bidirectional long short-term memory neural network and the GRU gated recurrent unit network layer, and through de-normalization, finally obtains the pollutant concentration value at the next moment. This method retains the advantages of the three algorithms and further improves the accuracy of pollutant concentration prediction on the basis of improving the algorithm efficiency.
[0036] The advantages of the present invention are:
[0037] The method of the present invention integrates three neural networks, namely CNN, BiLSTM, and GRU, and retains the advantages of each algorithm. CNN can extract representative features and reduce the data dimension. The BiLSTM neural network can better capture the long-term dependencies between various features, and its expression ability is stronger than that of GRU, and the controllable granularity for time series is finer; as a variant of the LSTM long short-term memory neural network, GRU has fewer network parameters, so it is easier to converge and can prevent gradient dispersion. Description of the Drawings
[0038] Figure 1 It is a flow chart of the method of the present invention.
[0039] Figure 2 It is a network structure diagram of the method of the present invention.
[0040] Figure 3 It is the R 2 correlation graph of the predicted value and the true value.
[0041] Figure 4 It is a comparison graph of the predicted value and the true value. Detailed Embodiments
[0042] The present invention will be further described below with reference to the drawings and embodiments.
[0043] A method for predicting pollutant concentration based on the fusion of multiple neural network algorithms according to the present invention includes the following steps:
[0044] Step 1: Obtain the time series public data of air pollutants and meteorological characteristics measured at the national control station in the Olympic Sports Center in Beijing, construct a data set therefrom, and preprocess the data set.
[0045] Among the information downloaded from the website, the dataset contains 35,064 pieces of data, with a time span from March 2013 to February 2017. The data collection interval is 1 hour. Taking the prediction of the concentration of particulate matter pollutant PM2.5 as an example, in step 1, the dataset is preprocessed. The missing values of the data are filled in by linear interpolation method, the data in the dataset is normalized by MaxAbs normalization method, and the dataset is divided into a training set and a test set.
[0046] Step 2: Check the Pearson correlation coefficients between each feature, and remove other features that are not relevant to the feature to be predicted to reduce data redundancy;
[0047] Step 3: Determine the sliding time window T, perform data sequence segment slicing processing on each feature component, construct batch data, and encapsulate the data;
[0048] In step 3 of the present invention, through multiple experiments, it is verified that when the size of the sliding time window T is set to 12 and the size of the batch data is set to 120, the prediction effect is the best;
[0049] Step 4: Construct a CNN-BiLSTM-GRU neural network architecture. Its flowchart is as Figure 1 shown, and its structure diagram is as Figure 2 shown. Input the encapsulated training dataset into the network, continuously adjust the neural network parameters, create a file to save the best weight values, and obtain the optimal parameters of the network;
[0050] In step 4 of the present invention, a CNN-BiLSTM-GRU neural network is constructed, the network parameters are initialized, and after multiple experimental adjustments, the optimal parameters of the neural network are finally determined.
[0051] In the CNN network layer of the present invention, the size of the convolutional layer filter is set to 96, the size of the convolutional kernel is 1×1, the size of the pooling layer is set to 1, the moving step size is set to 1, and the activation function is PReLU. In the BiLSTM network layer, the number of neurons in the hidden layer is set to 64. In the GRU network layer, a two-layer structure is set. The number of neurons in the first layer is set to 64, and the number of neurons in the second layer is set to 32. To prevent overfitting, Dropout is introduced between the two layers of GRU network, the parameter is set to 0.2, and the learning rate is set to 3e-4.
[0052] In step 4, the CNN convolutional neural network adopts one-dimensional convolution and one-dimensional pooling layer. One-dimensional convolution slides a window in the length or width direction and multiplies and sums. The size of the convolutional layer filter is set to 96, the activation function is set to PReLU, and the convolution operation process is as follows:
[0053]
[0054] where y l is the output after l layers of convolution operations, g() is the activation function, is the input of the m-th part of the convolution region in the l-th layer, is the weight of the m-th part in the l-th layer, and * is the convolution operation, is the bias term of the l-th layer.
[0055] There are no parameters to be trained in the pooling layer of the convolutional neural network. Specifying the pooling type, the kernel size of the pooling operation, and the moving step size is sufficient. The process of the pooling operation is as follows:
[0056]
[0057] where: is the pooling result of the m-th array in the l-th layer, is the p-th value in the m-th array region of the l-th layer, and h() is the pooling function.
[0058] Step 5: Input the test set into the network obtained in Step 4 to obtain the correlation coefficient and root mean square error between the predicted value and the true value of the predicted feature, and measure the prediction performance of the network;
[0059] The evaluation metrics of the prediction method of the present invention are MAE, RMSE, and R 2 , and the calculation formulas are respectively:
[0060]
[0061] where, is the true value of the test set, is the prediction result of the prediction method of the present invention, and m is determined by the size of the test set.
[0062]
[0063] where, is the true value of the test set, is the prediction result of the prediction method of the present invention, and m is determined by the size of the test set.
[0064]
[0065] where y (i) is the true value of the test set, is the prediction result of the prediction method of the present invention, is the average value of the true values, and i is a natural number greater than or equal to 1.
[0066] Step 6: Use the trained network for air quality prediction, and perform anti-normalization processing on the predicted value to obtain an accurate air quality prediction value;
[0067] The comparison of the concentration prediction results of the present invention and different algorithms in the prior art is shown in Table 1 as follows:
[0068] Table 1 is the comparison of the prediction results of different network algorithms
[0069] Model MAE RMSE <![CDATA[R 2 <!-- 4 -->]]> BiLSTM 11.72 20.02 0.94 BiLSTM-GRU 12.36 21.11 0.94 CNN-BiLSTM 11.07 18.29 0.95 CNN-BiLSTM-GRU 9.80 17.20 0.96
[0070] The prediction performance of the network of the present invention is as follows Figure 3 , 4 as shown Figure 4 wherein, Measured Value and TrueValue represent the true value, Predicted Value and Pred Value represent the predicted value, and Density represents the density.
[0071] It can be seen from Table 1 that the accuracy of the pollutant concentration prediction algorithm proposed by the present invention is better than other methods. This method combines three neural network algorithms of CNN, BiLSTM, and GRU, retaining the advantages of each algorithm. CNN can extract representative features and reduce the data dimension. The BiLSTM neural network can better capture the long-term dependencies between features, and its expression ability is stronger than that of GRU, and the controllable granularity for time series is finer; GRU, as a variant of the LSTM long short-term memory neural network, has fewer network parameters, so it is easier to converge and can prevent gradient dispersion.
[0072] The present invention has been described exemplarily above in conjunction with the accompanying drawings. Obviously, the specific implementation of the present invention is not limited by the above-mentioned manner. As long as various improvements are made by adopting the method concept and technical solution of the present invention, or directly applied to other occasions without such improvement, they are all within the protection scope of the present invention.
Claims
1. An air quality prediction method based on the fusion of multiple neural networks, characterized in that: The specific steps include: Step 1: Obtain time series data of air pollutants and meteorological characteristics measured by national control stations, use this to construct a data set as feature input, and preprocess the data set to divide the data set into a training set and a test set; Step 2: Check the Pearson correlation coefficient between each feature and eliminate other features that are not related to the features to be predicted; Step 3: Determine the sliding time window T, segment the data sequence for each feature component, construct batch data, and perform data encapsulation on it; Step 4: Build a CNN-BiLSTM-GRU neural network through the tensorflow framework, input the packaged training set into the neural network, continuously adjust the neural network parameters, create a file to save the best weight value, and obtain the optimal parameters of the network; Step 5: Input the packaged test set into the network architecture with optimal parameters obtained in step 4, obtain the correlation coefficient and root mean square error between the predicted value and the true value of the predicted feature, and measure the prediction performance of the network; Step 6: Use the trained network architecture for air quality prediction, perform denormalization on the predicted value, and obtain an accurate predicted value of air quality at the next moment; In step 4, the CNN convolutional neural network uses a one-dimensional convolution and a one-dimensional pooling layer; In step 4, the BiLSTM bidirectional long short-term memory neural network is a single layer with 64 neurons; In step 4, the GRU gated recurrent unit neural network is a double-layered one, with 64 neurons in the first layer and 32 neurons in the second layer; In the fully connected layer of the network architecture constructed in step 4, the neurons in this layer are connected one by one with the neurons in the previous layer.
2. The air quality prediction method based on the fusion of multiple neural networks according to claim 1, wherein: The data measured at the national control station described in step 1 include various air pollutant concentration values, temperature, dew point, wind speed and direction, and air pressure values.
3. A method for predicting air quality based on the fusion of multiple neural networks according to claim 1, characterized in that: In step 1, linear interpolation is used to fill the data in the data set to complete the missing values in the data set. The calculation formula is: where x i is the value of the missing part, x j is the value of x i known previously, x k is the value of x i known subsequently, and i, j, k are natural numbers greater than or equal to 1.
4. A method for predicting air quality based on the fusion of multiple neural networks according to claim 1, characterized in that: In step 1, the MaxAbs normalization method is used to normalize the data in the data set, and the calculation formula is: where x is the original value, x' is the value after standardization, and x max is the maximum value of the input feature.
5. A method for predicting air quality based on the fusion of multiple neural networks according to claim 1, characterized in that: The calculation formula of Pearson correlation coefficient in step 2 is: where cov(X,Y) is the covariance between features X and Y, and σ X , σ Y are the standard deviations of features X and Y, respectively.
6. The air quality prediction method based on the fusion of multiple neural networks according to claim 1, wherein: In step 3, the sliding time window T size is set to 12 and the batch data size is set to 120.
7. A method for predicting air quality based on the fusion of multiple neural networks according to claim 1, characterized in that: One-dimensional convolution is to slide the window in the length or width direction and multiply and sum. The filter size is set to 96, the activation function is set to PReLU, and the convolution operation process is: where y l is the output after l layers of convolution operations, g() is the activation function, is the input of the m-th part of the convolution region in the l-th layer, is the weight of the m-th part in the l-th layer, * is the convolution operation, is the bias term of the l-th layer; There are no parameters that need to be trained in the pooling layer of the convolutional neural network. The pooling type, kernel size and moving step size of the pooling operation are specified. The pooling operation process is: Wherein: is the pooling result of the m-th array in the l-th layer, is the p-th value in the m-th array region of the l-th layer, and h() is the pooling function.
Citation Information
Patent Citations
PM2.5 concentration prediction method and device and medium
CN109978228A
Multi-parameter atmospheric environment data generation method based on stacked LSTM-GRU
CN112101664A
Greenhouse cabbage potential evapotranspiration prediction method based on CNN-BiLSTM fusion neural network
CN114330098A