Air quality prediction method based on multi-task spatiotemporal graph convolution
Through the multi-task spatio-temporal graph convolution method, the relationship between sites is dynamically constructed, and combined with the memory network and the graph convolution network, it solves the problem of dynamic spatial relationships and global patterns in air quality prediction that are difficult to capture in the existing technology, and improves air quality prediction. accuracy and stability.
Patent Information
- Application Number
- CN202210299336.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-25
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-03-25
AI Technical Summary
Existing air quality prediction methods are difficult to effectively capture the dynamic spatial relationships and overall global patterns between sites, resulting in limited prediction accuracy, and the static graph structure is not suitable for dynamic air quality tasks.
The multi-task spatio-temporal graph convolution method is used, combined with the memory network, attention mechanism and multi-layer graph convolution network, to dynamically construct the adjacency relationship graph between sites, aggregate temporal relationships and spatial relationships, and consider both fine-grained site-level predictions and Focus on coarse-grained city-level predictions.
It significantly improves the prediction effect of spatio-temporal sequence data for air quality prediction, enhances the stability and prediction accuracy of the model, and adapts to dynamic changes in air quality.
Smart Images

Figure CN114841400B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of spatiotemporal data mining, and in particular relates to an air quality prediction method based on multi-task spatiotemporal graph convolution. Background Art
[0002] With the continuous development of industrialization and urbanization, air pollution is now considered to be a major problem for the human community in the present and future. Air pollution is usually defined as the concentration of certain substances entering the atmosphere due to human activities or natural processes that is sufficient to endanger life and health. In order to reduce the impact of people's long-term exposure to air pollution, accurate air quality prediction is crucial for government decision-making and individuals. For example, it can help city managers make better traffic control decisions and significantly reduce local severe pollution (Francesca and Ivo 2008). However, since air quality has a complex and dynamic relationship with meteorological factors (wind direction, wind speed, temperature, etc.), road network topology and regional functionality, it brings many challenges to the air quality prediction task. Since the diffusion of atmospheric pollutants is essentially a spatiotemporal process, spatiotemporal correlation modeling is the key to the air quality prediction task.
[0003] A large amount of research work has made great progress in air quality prediction methods in recent decades. The most basic and commonly used method is to simply merge the data of heterogeneous data sources at a single time step to form a feature vector, as proposed by Li and Zhang in 2017 and 2019 respectively, and apply recurrent neural networks (RNN, GRU) to model nonlinear time series. Since such simple methods do not consider the spatial relationship between different stations, the prediction ability is limited. Zheng proposed the U-air model in 2013 and began to try to use the spatial relationship between stations to assist prediction. Simply aggregating air quality monitoring readings, spatial features (POIs, road networks) and meteorological data of neighboring stations improved the prediction accuracy. The model explicitly shows that spatial correlation is an indispensable part of modeling prediction models. However, the spatial correlations expressed by these methods are often static and are not suitable for generalization and application throughout the training. Due to the importance of modeling dynamic spatial relationships, Cheng proposed in 2018 to use the attention mechanism to distinguish the contribution weights of different stations to the air quality (AQI) of the target station. Furthermore, Liang et al. proposed an improved prediction model in the same year, which learns the dynamic spatial relationship of sites at different time steps while considering the geographic spatial similarity.
[0004] Graph convolutional networks (GCNs) have received increasing attention in recent years and have been applied to modeling spatial relationships between sites in air quality prediction. Wilson et al. proposed in 2018 to obtain high-order spatial relationships between monitoring stations through graph convolution. Wang et al. modeled a variety of predefined spatial relationships into underlying graphs in 2021, and designed a parallel encoding model based on GCN, using the attention mechanism to obtain aggregate features of different spatial relationships. In this type of framework, the nodes in the graph are a collection of monitoring sites, and the edges in the graph represent the spatial correlation between pairs of monitoring sites. Although existing methods can capture complex spatiotemporal correlations, only considering the local features of a single time step ignores the overall global pattern of the site, which makes the model unstable. In addition, calculating the static graph structure predetermined by the spatial relationship is not the optimal solution for dynamic tasks such as air quality prediction.
[0005] For temporal correlation, although RNN is widely used in temporal correlation modeling, for example, Liet et al. used stacked long short-term memory networks (LSTM) to extract features from historical air quality data and other auxiliary data in 2017. Zhang et al. and Luo et al. used encoder-decoder networks in 2019 to simulate nonlinear time evolution to model long-term air quality series. Most existing methods rely heavily on RNN when modeling temporal correlation. If the time series correlation is weak or there is more noise, convolutional networks seem to have an advantage over RNN due to their stable gradients. In addition, the correlation between monitoring sites depends not only on the local features of a single time step, but also on the long-term global features of the site, such as periodicity and trend. Since the joint modeling of short-term intentions and long-term preferences in recommendation systems can improve recommendation accuracy, it is believed that considering the overall pattern while considering the local data of the site when modeling spatial relationships will also promote the learning of air quality prediction tasks. Summary of the invention
[0006] The purpose of the present invention is to address the problem of air quality prediction, overcome the shortcomings of the prior art, and propose an air quality prediction method based on multi-task spatiotemporal graph convolution. The present invention uses memory networks, attention mechanisms, multi-layer graph convolution networks and other technologies to construct an air quality prediction method based on multi-task spatiotemporal graph convolution, and dynamically constructs an adjacency relationship graph between sites using the local attributes of a single site and the global attributes of the entire site; uses multi-layer graph convolution to aggregate the temporal relationship of a single site and the spatial relationship of neighboring sites respectively; uses a multi-task collaborative training strategy to consider both fine-grained site-level prediction tasks and coarse-grained city-level prediction tasks, greatly improving the prediction effect of spatiotemporal series data.
[0007] The present invention is implemented by the following technical scheme. The present invention proposes an air quality prediction method based on multi-task spatiotemporal graph convolution, and the method comprises the following steps:
[0008] Step 1: Obtain the site air quality monitoring dataset and the fine-grained gridded meteorological dataset, construct the POI dataset and the time feature dataset, preprocess the dataset and divide it into training set, validation set and test set, and use PM2.5 as the target pollutant;
[0009] Step 2: Build an air quality prediction model based on multi-task spatiotemporal graph convolution;
[0010] Step 3: Use the training set to train the air quality prediction model based on multi-task spatiotemporal graph convolution described in step 2;
[0011] Step 4: Input the spatiotemporal series data of the stations in the test set into the air quality prediction model based on multi-task spatiotemporal graph convolution trained in step 3, and output the air quality prediction value for the next γ steps.
[0012] Furthermore, the step 1 comprises the following steps:
[0013] Step 1.1: In the air quality monitoring data set, the historical monitoring data of each station is preprocessed using linear interpolation and maximum and minimum normalization methods;
[0014] Step 1.2: In the gridded meteorological data set, the data of the nearest meteorological monitoring station is used as the meteorological data of the air quality monitoring station according to the latitude and longitude of each air quality monitoring station, and preprocessed using the maximum and minimum normalization method;
[0015] Step 1.3: Extract the information of points of interest around each station from the road network dataset, use various points of interest technologies as POI features, and perform maximum and minimum standardization preprocessing;
[0016] Step 1.4: Extract time features;
[0017] Step 1.5: Divide the preprocessed dataset into training set, validation set and test set.
[0018] Furthermore, the step 2 comprises the following steps:
[0019] Step 2.1: Use memory network and attention mechanism to build a dynamic spatial relationship graph for each time step;
[0020] Step 2.1.1: Obtain the monitoring data of each time step in the historical monitoring data set, and input the N site data of each time step into the feature reconstruction module, which is an encoder-decoder structure to obtain the reconstructed embedding representation of each site;
[0021] Step 2.1.2: Construct a long-term memory unit for each site; aggregate the embedding representation reconstructed in step 2.1.1 with the long-term pattern embedding representation to obtain the final embedding representation of each site at that time step;
[0022] Step 2.1.3: Based on the embedding representation obtained in step 2.1.2, the attention mechanism is used to adaptively obtain the influence weights between pairs of sites to form a spatial relationship graph at each moment;
[0023] Step 2.2: Use graph convolutional networks and graph neural networks to model spatial correlation and temporal correlation respectively;
[0024] Step 2.2.1: At each time step, the final embedding representation of each site and the N×N adjacency matrix are obtained according to step 2.1, and then concatenated and input into the L-layer graph convolutional neural network module. Through the L-layer graph convolutional neural network, the information in the spatial dimension is aggregated to obtain the embedding representation of each site after fusing K-hop neighbors;
[0025] Step 2.2.2: According to the operation of step 2.2.1, a T×N embedding representation matrix is finally obtained, where T is the length of the historical time series. The embedding representation matrix is input into the CNN convolutional neural network module to aggregate the embedding representation in the time dimension to obtain the representation vector of each site after integrating the spatiotemporal information;
[0026] Step 2.3: Use a multi-layer graph neural network to construct the short-term features and long-term patterns of the site, and use a multi-task framework to obtain fine-grained site-based prediction tasks and coarse-grained city-based prediction tasks;
[0027] Step 2.3.1: Input the representation vector obtained by step 2.2.2 after integrating the spatiotemporal information into the long-term CNN prediction module and the short-term CNN prediction module respectively to obtain the final fine-grained site-level prediction sequence;
[0028] Step 2.3.2: Input the representation vector obtained in step 2.2.2 after integrating the spatiotemporal information into another long-term CNN prediction module to obtain the final coarse-grained city-level prediction sequence.
[0029] Furthermore, the step 3 comprises the following steps:
[0030] Step 3.1: Input the data in the training set into the adaptive spatial relationship graph module to obtain a different spatial relationship graph for each time step in a time series;
[0031] Step 3.2: Input the different spatial relationship graphs at each time step obtained in step 3.1 into the spatiotemporal relationship modeling module to obtain the embedded representation of each site after integrating the spatiotemporal information at each time step;
[0032] Step 3.3: embed the spatiotemporal features of each station in step 3.2 and input them into the multi-task air quality prediction module to obtain the prediction results at the fine-grained station level and the coarse-grained city level;
[0033] Step 3.4: Update the model parameters by calculating the error between the predicted PM2.5 at the fine-grained site level at the next γ moments and the actual PM2.5 to optimize the loss function, and train the optimal air quality prediction model based on multi-task spatiotemporal graph convolution.
[0034] Furthermore, the input of the feature reconstruction module in step 2.1.1 is the feature vector of each site in step 1. In order to make the model training more stable, an autoencoder is used to obtain the reconstructed feature vector as the input of the subsequent model. The feature reconstruction module is constructed by the following steps:
[0035] (1) Construct an encoder with the original feature vector as input. The encoder is a layer of neural network that encodes the original input into an embedded representation. The specific calculation formula is as follows:
[0036] h=σ(Wx+b)
[0037] Where x is the original feature vector of the site; W and b are the transformation matrices of the encoder; σ is the activation function;
[0038] (2) Construct a decoder with the encoder output as input. The decoder is a layer of neural network that restores the embedded representation to a feature vector with the same dimension as the original input. The specific calculation formula is as follows:
[0039]
[0040] Among them, h is the final output vector of the encoder; W′ and b′ are the transformation matrices of the decoder, and σ′ is the activation function.
[0041] Furthermore, the memory unit in step 2.1.2 captures the long-term pattern of each site, and uses a fully connected network to concatenate the long-term pattern representation of each site with the reconstructed feature vector to obtain the final embedded representation. The specific calculation steps are as follows:
[0042] (1) Initialize a memory unit for each site. The memory function of the memory unit is expressed as follows:
[0043]
[0044] (2) The final embedding representation is
[0045] Where || represents the concatenation operation, β defines the forgetting factor in the memory network; the matrix Wm and W h , and the vector b m and b h are all training parameters in the model; in the initial state, Use random initialization.
[0046] Furthermore, in step 2.1.3, the dynamic spatial relationship graph structure at each moment is obtained through the attention mechanism. The N nodes of the spatial association graph represent the set of N monitoring sites, and the edges represent the spatial influence between the sites at the current moment. The specific calculation steps are as follows:
[0047] (1) Input the final embedding representation of each site obtained in step 2.1.2 into the attention mechanism module to obtain the attention score between sites, which is expressed as follows:
[0048]
[0049] Among them, W s is the transformation matrix of the attention mechanism, N is the total number of sites, and σ is the activation function; in the formula and The sites are i and sites j Embedded representation of
[0050] (2) The attention scores between all sites form an adjacency matrix The dynamic adjacency matrix is concatenated with a unit matrix and then normalized to obtain the final adjacency matrix. The calculation formula is as follows:
[0051]
[0052]
[0053] in, is an N×N unit matrix, D t It is a diagonal matrix composed of all sites at time t.
[0054] Furthermore, the spatiotemporal modeling module corresponding to step 2.2 aggregates space and time respectively, and the input is the final historical feature embedding representation of each site and the dynamic adjacency matrix, which is achieved by the following steps:
[0055] (1) First, spatial aggregation is performed. At each time step, the final historical feature embedding representation and dynamic adjacency matrix of each site are known. Multi-layer graph convolutional layers are used to aggregate the information of multi-hop neighboring sites. The specific formula is as follows:
[0056]
[0057] Among them, Ht Aggregates the spatial information of all sites at time t, l represents the number of aggregation steps of the convolutional network, that is, the information of l-hop neighbor sites; is the transformation matrix of the spatial graph convolution, where h is the dimension of the site features;
[0058] (2) Spatial aggregation is performed on the N monitoring sites of T time steps to obtain a T×N matrix. Next, time dimension aggregation is performed. A convolutional neural network with a convolution kernel of Γ×1 and padding of (1, 0) is applied to the T×N matrix to aggregate the longitudinal time dimension features. The specific formula is as follows:
[0059]
[0060] in, Indicates site i The set of neighboring sites at time t, Γ is the aggregation span in the time dimension; since the historical monitoring data is ordered, the time convolutional network is applied to obtain the final site representation, the specific formula is as follows:
[0061]
[0062] in, It is a site i The embedded representation after integrating spatial information at time t, θ D is the set of parameters of the temporal convolutional network.
[0063] Furthermore, the coarse-grained city-level prediction task described in step 2.3.2 is used as an auxiliary task, and a convolutional neural network is used to obtain the coarse-grained city air quality prediction result. The specific calculation formula is as follows:
[0064]
[0065] Where N is the number of sites, is the average of the spatiotemporal data of all stations at each time step; θ A is the set of parameters of the convolutional neural network in the coarse-grained site-level prediction task.
[0066] Furthermore, the loss function described in step 3.4 combines the prediction error at the fine-grained site level and the prediction error at the coarse-grained city level, and is specifically calculated as follows:
[0067]
[0068]
[0069] Where M is the number of training samples, γ is the prediction time window, and α is a parameter that balances the fine-grained site-level prediction loss and the coarse-grained city-level loss.
[0070] Compared with the prior art, the beneficial effect of the present invention is that it provides an air quality prediction method based on multi-task spatiotemporal graph convolution, which fully considers and mines the dynamic spatial relationship between sites and the temporal relationship of the monitoring sequence of the site itself, and constructs a multi-task prediction model based on the site's air quality monitoring data, meteorological data and road network data and utilizes memory networks, attention mechanisms and (graph) convolutional neural networks and other technologies to improve the accuracy of air quality prediction and alleviate the problem of data instability. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 This is a flow chart of the air quality prediction method based on multi-task spatiotemporal graph convolution;
[0072] Figure 2 This is a framework diagram of the air quality prediction model based on multi-task spatiotemporal graph convolution. DETAILED DESCRIPTION
[0073] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0074] Combination Figure 1-2 The present invention provides an air quality prediction method based on multi-task spatiotemporal graph convolution, which specifically includes the following steps:
[0075] Step 1: Obtain air quality monitoring data, meteorological data, road network data, etc., preprocess the data set and divide it into training set, validation set and test set;
[0076] The step 1 specifically comprises the following steps:
[0077] Step 1.1: Extract monitoring data of each station from historical air quality monitoring data, such as PM2.5, PM10, NO2, SO2, CO, O3 and other information;
[0078] Step 1.2: Extract the gridded meteorological monitoring data and the longitude and latitude coordinates of the meteorological monitoring stations from the historical meteorological monitoring data set, and combine them with the longitude and latitude coordinates of the air quality monitoring stations to calculate the distance between the air quality monitoring stations and each meteorological monitoring station. The data of the meteorological monitoring station closest to each air quality monitoring station is used as the meteorological data of the air monitoring station, including wind speed, wind direction, temperature, humidity, air pressure and other meteorological information;
[0079] Step 1.3: From the road network dataset, extract the POI category data and road network topology data around each station, such as industrial plants, parks, entertainment venues, restaurants, highways, small roads, and other road network related information, with each station as the center and r as the radius;
[0080] Step 1.4: Extract time features (hours, weeks, and months);
[0081] Step 1.5: Preprocess the dataset and divide it into training set, validation set and test set in a ratio of 8:1:1.
[0082] Step 2: Build an air quality prediction model based on multi-task spatiotemporal graph convolution;
[0083] The step 2 specifically comprises the following steps:
[0084] Step 2.1: Use memory network and attention mechanism to build a dynamic spatial relationship graph for each time step;
[0085] In step 2.1, since the air quality monitoring data are all numerical information and there are missing data in the data, the missing data are filled by using the linear interpolation method, and then the maximum and minimum standardization method is used for preprocessing to obtain the initial embedded representation;
[0086] In step 2.1, for meteorological data and road network data, since these two data sets are relatively complete, the maximum and minimum normalization method is used to obtain the initial embedding representation after removing the abnormal minimum value;
[0087] In step 2.1, the final embedding representation of each station is a fusion of the initial embedding representation sequences of air monitoring data, meteorological data, and road network data;
[0088] The monitoring site spatial relationship diagram (G) in step 2.1 is dynamically constructed based on the real-time data of the monitoring sites, such as Figure 2 As shown in the green dashed box, the nodes are the set of air quality monitoring sites, and the edges are the dynamic spatial relationships between pairs of air quality monitoring sites, which are constructed through the following steps:
[0089] (1) At any time t, for the real-time characteristics of the site (x t ), the original feature x is converted into t The purpose of reconstruction is to improve the stability of the sample and reduce the impact of abnormal data on training. The automatic encoder is calculated as follows:
[0090] h=σ(Wx+b)
[0091]
[0092] Among them, x is the original feature vector of the site, h is the final output vector of the encoder; σ and σ' are the activation functions of the encoder and decoder respectively, W and W' are the transformation matrices of the encoder and decoder respectively, and b and b' are the bias vectors of the encoder and decoder respectively.
[0093] (2) At any time t, for the long-term pattern features of the site, the memory network method is used to learn the long-term sequence pattern of each site. The input of the memory network is the reconstructed features of the time step obtained in the previous step and the output of the memory network in the previous time step, which can be calculated by the following formula:
[0094]
[0095] Among them, || represents the splicing operation, It is a site i The reconstructed embedding representation, β defines the forgetting factor in the memory network; σ is the activation function of the memory network, It is a site i The long-term pattern embedding representation at time t-1, matrix W m and vector b m is the transformation matrix and bias vector in the memory network model.
[0096] (3) The final feature expression of each site is the reconstructed short-term real-time data feature Long-term sequence patterns The fusion is calculated as follows:
[0097]
[0098] Where || represents the concatenation operation, σ is the activation function of feature fusion, and the matrix W h and vector b h is the transformation matrix and bias vector of the feature fusion network.
[0099] (4) Based on the data obtained from the previous step, the attention mechanism is used to dynamically model the relationship between the edges (spaces) of different sites. i and j The attention score between them is calculated according to the following formula:
[0100]
[0101] Among them, W s is the transformation matrix of the attention mechanism, N is the total number of sites, and σ is the activation function; in the formula and The sites are i and sites j Embedded representation of .
[0102] (5) According to the previous step, a weight value can be calculated between each pair of sites, that is, the weight of the edge in the spatial graph G. In addition, due to the diffusion characteristics of air pollution, the spatial relationship graph of the sites should contain the self-loops of each site. Therefore, the adjacency matrix of the spatial graph G at each time can be calculated by the following formula:
[0103]
[0104]
[0105] in, is an N×N unit matrix, D t is the diagonal matrix of all sites at time t; A t is the adjacency matrix formed by the spatial relationship between each pair of sites at time t, It is the final site spatial relationship diagram at time t. Therefore, it can be seen that this adaptive adjacency matrix method is more suitable for the actual scenario of air quality data prediction.
[0106] Step 2.2: Use graph convolutional networks and graph neural networks to model spatial correlation and temporal correlation respectively;
[0107] like Figure 2 As shown in the blue dotted box, step 2.2 includes spatial dimension information fusion and temporal dimension information fusion. The spatial relationship diagram required for spatial dimension information fusion is the dynamic spatial relationship diagram described in step 2.1, and the structure after spatial information fusion is used as the input of temporal dimension information fusion, which is specifically constructed by the following steps:
[0108] (1) At any time t, the node set of spatial information aggregation is the set of all air monitoring sites described in step 2.1. According to the adaptive spatial relationship graph (adjacency matrix A) obtained in step 2.1, the graph convolutional network (GCN) method is used to aggregate the information of multi-layer neighboring sites to obtain the node embedding representation after integrating multi-layer spatial relationships, which is specifically calculated as follows:
[0109]
[0110] Among them, H t Aggregates the spatial information of all sites at time t; is the final site spatial relationship diagram at time t, l represents the number of aggregation steps of the convolutional network, that is, the information of the l-hop neighbor site; E t is the set of all site embedding representations at time t; is the transformation matrix of the spatial graph convolution, where h is the dimension of the site features.
[0111] (2) For information aggregation in the time dimension, the result of spatial information fusion at each moment is obtained according to the previous step {H 1 ,H 2 ,H 3 ,…,H T}, where T is the historical time window, and a convolutional neural network with a convolution kernel of ((2×Γ)+1,1) is used to aggregate the information of the time dimension, as shown in the following formula:
[0112]
[0113]
[0114] in, Indicates site i The set of neighboring sites at time t, Γ is the aggregation span in the time dimension; It is a site i The embedded representation after integrating spatial information at time t, θ D is the set of parameters of the temporal convolutional network.
[0115] Step 2.3: Use a multi-layer graph neural network to construct the short-term features and long-term patterns of the site, and use a multi-task framework to obtain fine-grained site-based prediction tasks and coarse-grained city-based prediction tasks;
[0116] The multi-task air quality prediction model in step 2.3 includes a main task and an auxiliary task. The main task is a fine-grained site-level air quality prediction task; the auxiliary task is a coarse-grained city-level air quality prediction task, such as Figure 2 As shown in the red dashed box, the main task and auxiliary task are trained using different networks, which are constructed through the following steps:
[0117] (1) The main task is a fine-grained site-level prediction task. According to step 2.2, the embedded representation of each site after integrating the spatiotemporal information is obtained. The impact of the site's own long-term time series at different time steps on future air quality and the impact of neighboring sites on future air quality due to topological relationships in the short term are considered. The specific construction is carried out through the following steps:
[0118] Since the weight of each historical time step for predicting future air quality should not be the same, the longitudinal convolutional neural network (CNN) method is used to automatically learn the weights at different time steps, as shown in the following formula:
[0119]
[0120] in, is the embedded representation of all sites after integrating spatiotemporal information, θ Lis the set of parameters of the convolutional neural network used in modeling long-term dependencies at different time steps.
[0121] In addition to the long-term impact of the station's own historical monitoring forecast, the station's future air quality is also related to the historical monitoring data of neighboring stations at the last n moments. The horizontal convolutional neural network (CNN) method is used to calculate the short-term impact weight of neighboring stations on the target station, as shown in the following formula:
[0122]
[0123] in, is the embedded representation after the fusion of the spatiotemporal information of the latest n steps, N is the number of sites; θ S is the set of parameters of the convolutional neural network in modeling short-term spatial dependencies.
[0124] The fine-grained site-level prediction task is a fusion of the above two aspects, as shown in the following formula:
[0125]
[0126] Among them, W o and b o is the transformation matrix for fine-grained site-level prediction.
[0127] (2) The auxiliary task is a coarse-grained city-level prediction task. According to step 2.2, the embedding representation of each station after integrating the spatiotemporal information is obtained. The embedding representation of each station at each time step is averaged as the coarse-grained embedding representation of the entire city. The convolutional neural network (CNN) is used to make predictions for future time steps using the following formula:
[0128]
[0129] Where N is the number of sites, is the average of the spatiotemporal data of all stations at each time step; θ A is the set of parameters of the convolutional neural network in the coarse-grained site-level prediction task.
[0130] Step 3: Use the training set to train the air quality prediction model based on multi-task spatiotemporal graph convolution described in step 2;
[0131] Step 3.1: Input the data in the training set into the adaptive spatial relationship graph module to obtain a different spatial relationship graph for each time step in a time series;
[0132] Step 3.2: Input the different spatial relationship graphs for each time step obtained in 3.1 into the spatiotemporal relationship modeling module to obtain the embedded representation of each site after integrating the spatiotemporal information at each time step;
[0133] Step 3.3: Input the spatiotemporal feature representation of the site learned in 3.2 into the multi-task air quality prediction module to obtain the fine-grained site-level prediction results and the coarse-grained city-level prediction results;
[0134] Step 3.4: Update the model parameters by calculating the error between the predicted PM2.5 at the fine-grained site level at the next γ moments and the actual PM2.5 to optimize the loss function, and train the optimal air quality prediction model based on multi-task spatiotemporal graph convolution.
[0135] Preferably, the loss function described in step 3.4 is specifically calculated as follows:
[0136]
[0137]
[0138] Where M is the number of training samples, γ is the prediction time window, and α is a parameter that balances the fine-grained site-level prediction loss and the coarse-grained city-level loss.
[0139] Step 3.5: After every K training times, the data in the validation set is input into the air quality prediction model based on multi-task spatiotemporal graph convolution trained in step 3.4 to obtain the air quality value (PM2.5) of each station in the validation set for the next γ time steps;
[0140] Step 3.6: Calculate the error between the predicted air quality value and the actual air quality value in the validation set. Do not update the network parameters. The purpose of the validation set is to assist in future training to find the optimal hyperparameters to achieve the highest prediction accuracy.
[0141] Step 4: Input the air quality monitoring data, historical meteorological data, road network data and other information in the historical time window to be predicted in the test set into the air quality prediction model based on multi-task spatiotemporal graph convolution that has been trained in step 3 to obtain the air quality value (PM2.5) of each station in the future γ time steps.
[0142] The air quality prediction method based on multi-task spatiotemporal graph convolution proposed in the present invention is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. An air quality prediction method based on multi-task spatiotemporal graph convolution, characterized in that: The method comprises the following steps: Step 1: Obtain the site air quality monitoring dataset and the fine-grained gridded meteorological dataset, construct the POI dataset and the time feature dataset, preprocess the dataset and divide it into training set, validation set and test set, and use PM2.5 as the target pollutant; Step 2: Build an air quality prediction model based on multi-task spatiotemporal graph convolution; Step 3: Use the training set to train the air quality prediction model based on multi-task spatiotemporal graph convolution described in step 2; Step 4: Input the spatiotemporal sequence data of the stations in the test set into the air quality prediction model based on multi-task spatiotemporal graph convolution trained in step 3, and output the air quality prediction value for the next γ steps; The step 2 comprises the following steps: Step 2.1: Use memory network and attention mechanism to build a dynamic spatial relationship graph for each time step; Step 2.1.1: Obtain the monitoring data of each time step in the historical monitoring data set, and input the N site data of each time step into the feature reconstruction module, which is an encoder-decoder structure to obtain the reconstructed embedding representation of each site; Step 2.1.2: Construct a long-term memory unit for each site; aggregate the embedding representation reconstructed in step 2.1.1 with the long-term pattern embedding representation to obtain the final embedding representation of each site at that time step; Step 2.1.3: Based on the embedding representation obtained in step 2.1.2, the attention mechanism is used to adaptively obtain the influence weights between pairs of sites to form a spatial relationship graph at each moment; Step 2.2: Use graph convolutional networks and graph neural networks to model spatial correlation and temporal correlation respectively; Step 2.2.1: At each time step, the final embedding representation of each site and the N×N adjacency matrix are obtained according to step 2.1, and then concatenated and input into the L-layer graph convolutional neural network module. Through the L-layer graph convolutional neural network, the information in the spatial dimension is aggregated to obtain the embedding representation of each site after fusing K-hop neighbors; Step 2.2.2: According to the operation of step 2.2.1, a T×N embedding representation matrix is finally obtained, where T is the length of the historical time series. The embedding representation matrix is input into the CNN convolutional neural network module to aggregate the embedding representation in the time dimension to obtain the representation vector of each site after integrating the spatiotemporal information; Step 2.3: Use a multi-layer graph neural network to construct the short-term features and long-term patterns of the site, and use a multi-task framework to obtain fine-grained site-based prediction tasks and coarse-grained city-based prediction tasks; Step 2.3.1: Input the representation vector obtained by step 2.2.2 after integrating the spatiotemporal information into the long-term CNN prediction module and the short-term CNN prediction module respectively to obtain the final fine-grained site-level prediction sequence; Step 2.3.2: Input the representation vector obtained in step 2.2.2 after integrating the spatiotemporal information into another long-term CNN prediction module to obtain the final coarse-grained city-level prediction sequence.
2. The method according to claim 1, characterized in that: The step 1 comprises the following steps: Step 1.1: In the air quality monitoring data set, the historical monitoring data of each station is preprocessed using linear interpolation and maximum and minimum normalization methods; Step 1.2: In the gridded meteorological data set, the data of the nearest meteorological monitoring station is used as the meteorological data of the air quality monitoring station according to the latitude and longitude of each air quality monitoring station, and preprocessed using the maximum and minimum normalization method; Step 1.3: Extract the information of points of interest around each station from the road network dataset, use various points of interest technologies as POI features, and perform maximum and minimum standardization preprocessing; Step 1.4: Extract time features; Step 1.5: Divide the preprocessed dataset into training set, validation set and test set.
3. The method according to claim 1, characterized in that The step 3 comprises the following steps: Step 3.1: Input the data in the training set into the adaptive spatial relationship graph module to obtain a different spatial relationship graph for each time step in a time series; Step 3.2: Input the different spatial relationship graphs at each time step obtained in step 3.1 into the spatiotemporal relationship modeling module to obtain the embedded representation of each site after integrating the spatiotemporal information at each time step; Step 3.3: embed the spatiotemporal features of each station in step 3.2 and input them into the multi-task air quality prediction module to obtain the prediction results at the fine-grained station level and the coarse-grained city level; Step 3.4: Update the model parameters by calculating the error between the predicted PM2.5 at the fine-grained site level at the next γ moments and the actual PM2.5 to optimize the loss function, and train the optimal air quality prediction model based on multi-task spatiotemporal graph convolution.
4. The method according to claim 1, characterized in that: The input of the feature reconstruction module in step 2.1.1 is the feature vector of each site in step 1. In order to make the model training more stable, an autoencoder is used to obtain the reconstructed feature vector as the input of the subsequent model. The feature reconstruction module is constructed by the following steps: (1) Construct an encoder with the original feature vector as input. The encoder is a layer of neural network that encodes the original input into an embedded representation. The specific calculation formula is as follows: h=σ(Wx+b) Where x is the original feature vector of the site; w and b are the transformation matrices of the encoder; σ is the activation function; (2) Construct a decoder with the encoder output as input. The decoder is a layer of neural network that restores the embedded representation to a feature vector with the same dimension as the original input. The specific calculation formula is as follows: Among them, h is the final output vector of the encoder; W′ and b′ are the transformation matrices of the decoder, and σ′ is the activation function.
5. The method according to claim 1, characterized in that The memory unit in step 2.1.2 captures the long-term pattern of each site, and uses a fully connected network to concatenate the long-term pattern representation of each site with the reconstructed feature vector to obtain the final embedded representation. The specific calculation steps are as follows: (1) Initialize a memory unit for each site. The memory function of the memory unit is expressed as follows: (2) The final embedding representation is Where || represents the concatenation operation, β defines the forgetting factor in the memory network; the matrix W m and W h , and the vector b m and b h are all training parameters in the model; in the initial state, Use random initialization.
6. The method according to claim 1, characterized in that In step 2.1.3, the dynamic spatial relationship graph structure at each moment is obtained through the attention mechanism. The N nodes of the spatial association graph represent the set of N monitoring sites, and the edges represent the spatial influence between the sites at the current moment. The specific calculation steps are as follows: (1) Input the final embedding representation of each site obtained in step 2.1.2 into the attention mechanism module to obtain the attention score between sites, which is expressed as follows: Among them, W s is the transformation matrix of the attention mechanism, N is the total number of sites, and σ is the activation function; in the formula and The sites are i and sites j Embedded representation of (2) The attention scores between all sites form an adjacency matrix The dynamic adjacency matrix is concatenated with a unit matrix and then normalized to obtain the final adjacency matrix. The calculation formula is as follows: in, is an N×N unit matrix, D t It is a diagonal matrix composed of all sites at time t.
7. The method according to claim 6, characterized in that The spatiotemporal modeling module corresponding to step 2.2 aggregates space and time respectively, and the input is the final historical feature embedding representation of each site and the dynamic adjacency matrix, which is achieved through the following steps: (1) First, spatial aggregation is performed. At each time step, the final historical feature embedding representation and dynamic adjacency matrix of each site are known. Multi-layer graph convolutional layers are used to aggregate the information of multi-hop neighboring sites. The specific formula is as follows: Among them, H t Aggregates the spatial information of all sites at time t, l represents the number of aggregation steps of the convolutional network, that is, the information of the hopping neighbor sites; is the transformation matrix of the spatial graph convolution, where h is the dimension of the site features; (2) Spatial aggregation is performed on the N monitoring sites of T time steps to obtain a T×N matrix. Next, time dimension aggregation is performed. A convolutional neural network with a convolution kernel of Γ×1 and padding of (1, 0) is applied to the T×N matrix to aggregate the longitudinal time dimension features. The specific formula is as follows: in, Indicates site i The set of neighboring sites at time t, Γ is the aggregation span in the time dimension; since the historical monitoring data is ordered, the time convolutional network is applied to obtain the final site representation, the specific formula is as follows: in, It is a site i The embedded representation after integrating spatial information at time t, θ D is the set of parameters of the temporal convolutional network.
8. The method according to claim 1, characterized in that The coarse-grained city-level prediction task described in step 2.3.2 is used as an auxiliary task, and a convolutional neural network is used to obtain the coarse-grained city air quality prediction results. The specific calculation formula is as follows: Where N is the number of sites, is the average of the spatiotemporal data of all stations at each time step; θ A is the set of parameters of the convolutional neural network in the coarse-grained site-level prediction task.
9. The method according to claim 8, characterized in that The loss function described in step 3.4 combines the fine-grained site-level prediction error and the coarse-grained city-level prediction error, and is calculated as follows: Where M is the number of training samples, γ is the prediction time window, and α is a parameter that balances the fine-grained site-level prediction loss and the coarse-grained city-level loss.
Citation Information
Patent Citations
Prediction model training method and device, prediction model prediction method and device, equipment, program and medium
CN112561191A
Crop yield estimation method based on deep temporal and spatial feature combined learning
WO2021098472A1
