An air quality prediction method based on multi-relation mining spatiotemporal attention mechanism

By introducing multi-relational mining and space-time attention mechanisms in air quality prediction, the problem of inaccurate prediction in traditional methods in multi-site environments is solved, and higher prediction accuracy and timeliness are achieved.

CN119204352BActive Publication Date: 2025-02-25SOUTHWEST PETROLEUM UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411699283.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-02-25
Estimated Expiration
2044-11-26

AI Technical Summary

Technical Problem

Traditional air quality prediction methods are difficult to effectively capture the complex spatial relationships and interactions between sites in a multi-site environment, resulting in the prediction results deviating from the actual pollution transmission trend, limiting the accuracy and reliability of the model.

Method used

The space-time attention mechanism based on multi-relational mining is adopted, and the multi-relational matrix and attention feature vector are determined by constructing a space-time graph structure, and air quality prediction is carried out in combination with multi-layer perceptrons.

Benefits of technology

This method can flexibly capture the complex spatial relationships and interactions between sites, adaptively adjust the importance of different sites and time steps, and improve the accuracy and timeliness of air quality prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119204352B_ABST
    Figure CN119204352B_ABST
Patent Text Reader

Abstract

The present invention discloses an air quality prediction method based on multi-relation mining spatiotemporal attention mechanism, including: constructing pollutant concentration change matrix and meteorological change matrix; obtaining geographical location information data, site feature data and time series data of monitoring sites; determining the edges of the spatiotemporal graph according to the pollutant concentration data set and the historical meteorological data set, determining the nodes of the spatiotemporal graph according to the geographical location information data, and constructing the spatiotemporal graph structure; determining the adjacency matrix according to the spatiotemporal graph structure, and normalizing the adjacency matrix according to the second normalization formula; training the neural network model to obtain the air quality prediction model; inputting the target data to be measured into the air quality prediction model, and outputting the target predicted air quality data through the air quality prediction model. The present invention can improve the accuracy and timeliness of the prediction of pollutants in the air.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine learning, and in particular to an air quality prediction method based on a multi-relationship mining spatiotemporal attention mechanism. Background Art

[0002] Traditional measurement methods do not pay enough attention to spatial correlation and multiple relationship processing in multi-site air quality prediction, so it is difficult to effectively capture the complex interactions between sites, which leads to the problem of spatial offset. Spatial offset means that due to the different geographical distribution, environmental conditions and meteorological factors between sites, the prediction results of a single site often cannot accurately reflect the pollution diffusion and changes in the surrounding area. This phenomenon is particularly significant in the scenario of pollutant transmission and diffusion between multiple sites, causing the prediction results to deviate from the actual pollution propagation trend, limiting the accuracy and reliability of the model. Summary of the invention

[0003] In view of the above-mentioned deficiencies in the prior art, the present invention provides an air quality prediction method based on multi-relationship mining spatiotemporal attention mechanism, which solves the problem of inaccurate air quality prediction in the prior art.

[0004] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is: an air quality prediction method based on multi-relation mining spatiotemporal attention mechanism, comprising the following steps:

[0005] S1. Obtain a pollutant concentration data set and a historical meteorological data set, construct a pollutant concentration change matrix and a meteorological change matrix according to the pollutant concentration data set and the historical meteorological data set, and normalize the pollutant concentration change matrix and the meteorological change matrix using a first normalization formula;

[0006] S2. Obtaining geographic location information data, site feature data and time series data of the monitoring site;

[0007] S3. Determine the edges of the space-time graph based on the pollutant concentration data set and the historical meteorological data set, determine the nodes of the space-time graph based on the geographic location information data, and construct the space-time graph structure;

[0008] S4, determining an adjacency matrix according to the spatiotemporal graph structure, and normalizing the adjacency matrix according to a second normalization formula;

[0009] S5. Using the site characteristic data, time series data, normalized pollutant concentration change matrix, normalized meteorological change matrix and normalized adjacency matrix to train the neural network model to obtain an air quality prediction model;

[0010] The air quality prediction model includes a multi-relation mining module, a spatiotemporal attention mechanism module, and a multi-layer perceptron;

[0011] The multi-relationship mining module is used to determine the multi-relationship matrix according to the normalized pollutant concentration change matrix, the normalized meteorological change matrix and the normalized adjacency matrix;

[0012] The spatiotemporal attention mechanism module is used to determine the attention feature vector based on the site feature data, time series data and multi-relation matrix;

[0013] The multi-layer perceptron is used to determine the predicted air quality data based on the attention feature vector;

[0014] S6. Input the target data to be measured into the air quality prediction model, and output the target predicted air quality data through the air quality prediction model.

[0015] The beneficial effects of the above scheme are:

[0016] (1) The spatiotemporal attention mechanism in this invention dynamically adjusts the weights between sites, enabling the model to flexibly capture the complex spatial relationships and interactions between sites. Combined with the multi-relationship mining module, the model can extract deep information from multi-dimensional relationships such as pollutant diffusion paths and meteorological changes, thereby more accurately predicting changes in air quality at multiple sites.

[0017] (2) By introducing the time step and spatial attention mechanism, the present invention enables the model to flexibly adjust the importance of different sites and time steps in the temporal and spatial dimensions. The model can adaptively determine the weights of key sites and time steps based on real-time data, thereby better capturing the spatiotemporal variation characteristics of pollutants and improving the accuracy and timeliness of predictions.

[0018] (3) Through the multi-relationship mining module, the present invention can automatically learn the multi-dimensional relationship between monitoring sites, taking into account not only the geographical distance, but also meteorological conditions, pollutant diffusion paths and other factors. This enables the model to dynamically adjust the impact of different sites on the prediction results.

[0019] Furthermore, in step S1, the pollutant concentration data set includes concentration, concentration, concentration, concentration, Concentration and Concentration,historical meteorological datasets include temperature, humidity, wind speed, wind direction, and precipitation;

[0020] In step S2, the pollutant concentration data set and the historical meteorological data set correspond to the geographical location information data one by one, and the geographical location information data includes longitude and latitude.

[0021] Furthermore, in step S4, the adjacency matrix for:

[0022]

[0023] in, , and represents the weight coefficient, , and They represent pollution concentration weight, jaccard similarity weight and Euclidean distance weight respectively;

[0024] The second normalization formula is:

[0025]

[0026] in, Represents the normalized adjacency matrix Line The elements of the column, Indicates the number of nodes, Representation Node and nodes The attributes and weights of the edges between them, Slave Node To other nodes The attributes and weights of the edges.

[0027] The beneficial effects of the above further scheme are: the adjacency matrix, as a mathematical representation of the graph, can be directly used in the calculation of various graph algorithms, and the graph structure and the adjacency matrix can be used as input features and integrated into the air quality prediction model to learn the patterns and rules in the network and improve the performance of the air quality prediction model on graph data.

[0028] Furthermore, in step S5, a multi-relationship matrix is ​​determined according to the normalized pollutant concentration change matrix, the normalized meteorological change matrix and the normalized adjacency matrix, specifically including:

[0029] S51, defining a node embedding matrix according to the normalized pollutant concentration change matrix, the normalized meteorological change matrix, and the normalized adjacency matrix;

[0030] S52, calculating the Euclidean distance matrix between node embeddings in the node embedding matrix according to the node distance formula;

[0031] Node distance formula for:

[0032]

[0033] in, Indicates The embedding representation of nodes, Indicates The embedded representation of each node;

[0034] S53, converting the Euclidean distance matrix into a similarity matrix through a Gaussian kernel function;

[0035] Gaussian kernel function for:

[0036]

[0037] in, represents the variance of the Euclidean distance matrix;

[0038] S54, calculating the degree matrix of the similarity matrix;

[0039] S55, subtracting the similarity matrix from the degree matrix to obtain a Laplace matrix;

[0040] S56, performing eigenvalue decomposition on the Laplace matrix to obtain a matrix composed of eigenvectors;

[0041] S57, clustering the matrix composed of feature vectors using K-Means clustering algorithm;

[0042] S58. Determine a multi-relationship matrix based on the clustering results.

[0043] The beneficial effect of the above further scheme is that the multi-relationship matrix integrates data of different dimensions, so that the air quality prediction model can simultaneously consider the concentration changes of pollutants themselves, the influence of meteorological conditions, and the adjacent relationship of geographical locations. It helps to more comprehensively understand and predict the changing trend of air quality. By integrating multi-source information, the air quality prediction model can capture the complex correlations and interactions that are difficult to reveal from a single data source, and improve the accuracy and stability of the prediction.

[0044] Furthermore, in step S5, the attention feature vector is determined according to the site feature data, the time series data and the multi-relationship matrix, specifically including:

[0045] S59, determining a spatial hidden representation according to the site characteristic data;

[0046] S510, determining a spatial attention score according to the spatial hidden representation and the multi-relation matrix;

[0047] S511, converting the spatial attention score into a spatial attention weight according to a preset first conversion function;

[0048] S513, determining the time series characteristics of the time series data according to the time series data;

[0049] S514, determining a temporal hidden representation according to the time series characteristics;

[0050] S515, determining a temporal attention score according to the temporal hidden representation and the multi-relation matrix;

[0051] S516, converting the temporal attention score into a temporal attention weight according to a preset second conversion function;

[0052] S517, generating a final time series representation according to the time attention weight and the time series data;

[0053] S518. Determine the attention feature vector based on the spatial attention weight and the final time series representation.

[0054] The beneficial effect of the above further scheme is that the spatiotemporal attention mechanism combines spatial attention and temporal attention, ensuring that the air quality prediction model can dynamically adjust the impact of different time steps while capturing the complex relationships between sites.

[0055] Further, in step S5, the multilayer perceptron includes an input layer, three hidden layers connected in sequence, and an output layer.

[0056] Furthermore, the activation function of the input layer is:

[0057]

[0058] in, represents the attention feature vector, Represents the output of the input layer;

[0059] The activation functions of the three sequentially connected hidden layers are:

[0060]

[0061] in, , , Represent the outputs of three hidden layers connected in sequence, Represent the weight matrices of three hidden layers connected in sequence, Represent the bias vectors of three hidden layers connected in sequence;

[0062] The activation function of the output layer is:

[0063]

[0064] in, represents the weight matrix of the output layer, represents the bias vector of the output layer, Represents the predicted air quality data output by the output layer.

[0065] The beneficial effect of the above further scheme is that the activation function is one of the key components that enables the air quality prediction model to efficiently learn complex patterns, and the performance of the air quality prediction model is enhanced in many ways, such as introducing nonlinearity, promoting gradient flow, and improving model expressiveness.

[0066] Furthermore, the method further comprises:

[0067] The air quality prediction model was evaluated using the correlation coefficient.

[0068] The above further scheme has the beneficial effect of measuring the prediction error in a numerical way, providing a quantitative standard for comparing the performance of air quality prediction models under different parameter settings. It can identify which factors are highly correlated with the air quality prediction results, which helps to adjust and optimize the model structure or parameters and improve the prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 The figure is a flowchart of an air quality prediction method based on multi-relation mining spatiotemporal attention mechanism.

[0070] Figure 2 Schematic diagram of the evaluation results of the air quality prediction model. DETAILED DESCRIPTION

[0071] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0072] like Figure 1 As shown, an air quality prediction method based on multi-relation mining spatiotemporal attention mechanism includes the following steps:

[0073] S1. Obtain a pollutant concentration data set and a historical meteorological data set, construct a pollutant concentration change matrix and a meteorological change matrix according to the pollutant concentration data set and the historical meteorological data set, and use the first normalization formula to normalize the pollutant concentration change matrix and the meteorological change matrix.

[0074] In this embodiment, the pollutant concentration dataset includes concentration, concentration, concentration, concentration, Concentration and Concentration,historical meteorological datasets include temperature, humidity, wind speed, wind direction, and precipitation.

[0075] For example, Concentration PM2.5 concentration refers to the mass of PM2.5 particles contained in unit volume of air, usually measured in micrograms per cubic meter (μg / m³). Concentration refers to the mass of particulate matter (PM10) with a diameter less than or equal to 10 microns contained in a unit volume of air, and the unit is also micrograms per cubic meter (μg / m³). Concentration refers to the sulfur dioxide contained in a unit volume of air ( ) The mass of a gas, usually measured in parts per million (ppm), milligrams per cubic meter (mg / m³), or micrograms per cubic meter (μg / m³). Concentration refers to the nitrogen dioxide contained in a unit volume of air ( ) The mass of a gas, usually expressed in units such as parts per billion (ppb) and micrograms per cubic meter (μg / m³). Concentration refers to the carbon monoxide (CO) contained in a unit volume of air. ) The mass of a gas, usually expressed in parts per million (ppm) or milligrams per cubic meter (mg / m³). Concentration refers to the amount of ozone contained in a unit volume of air ( ) The mass of a gas, usually measured in parts per billion (ppb) or micrograms percubic meter (μg / m³).

[0076] For example, the pollutant concentration change matrix can be:

[0077]

[0078] Each row represents a monitoring station, and each column represents a pollutant concentration. The concentration at time t is in the first row, the concentration at time t+1 is in the second row, and so on. The elements in this matrix are specific concentration values.

[0079] The meteorological change matrix can be:

[0080]

[0081] Each row represents a monitoring station, and each column represents a meteorological factor. The meteorological factor at time t is in the first row, the meteorological factor at time t+1 is in the second row, and so on. The elements in this matrix are specific meteorological factor values. T represents temperature, H represents humidity, WS represents wind speed, WD represents wind direction, and P represents precipitation. Each row corresponds to a monitoring station, and each column corresponds to a meteorological factor at a specific time.

[0082] For example, in order to make all features on a similar scale, the first normalization formula can be used to scale all features within the range of [0, 1]. For special cases such as temperature, it can be scaled within the range of [-1, 1]. The first normalization formula can be:

[0083]

[0084] Optionally, before normalizing the pollutant concentration change matrix and the meteorological change matrix using the first normalization formula, the pollutant concentration change matrix and the meteorological change matrix may also be output preprocessed. Data preprocessing may include: Handling missing values: Checking the data for missing values ​​and selecting appropriate methods to fill or delete these missing values. Handling outliers: Identifying and handling data points that may be abnormal to prevent them from having a negative impact on the model. Time alignment: Ensure that the timestamps of the time series data are aligned to make time series analysis and modeling easier.

[0085] S2. Obtaining geographic location information data, site feature data and time series data of the monitoring site.

[0086] In this embodiment, the pollutant concentration data set and the historical meteorological data set correspond to the geographical location information data one by one, and the geographical location information data includes longitude and latitude.

[0087] S3. Determine the edges of the space-time graph based on the pollutant concentration dataset and the historical meteorological dataset, determine the nodes of the space-time graph based on the geographic location information data, and construct the space-time graph structure.

[0088] Exemplarily, the geographic location information of all monitoring stations is obtained and used as the adjacency matrix node. A set of edges is constructed based on the distance, wind speed, wind direction, temperature, humidity, and precipitation between the monitoring stations. The weights are calculated based on the direct pollutant concentration of the monitoring stations, Jaccard similarity, and Euclidean distance.

[0089] Exemplarily, the constructed weighted graph structure may be: Among them, the node set Contains the spatial geographic information (coordinates) of the monitoring sites. It includes the direct spatial distance of the monitoring site and meteorological factors (temperature, humidity, wind direction, wind speed and precipitation). The connection relationship between nodes is represented by the edge set Represented by , and each edge can have a corresponding weight, which can be composed of the comprehensive weight of the air pollution concentration, Jaccard similarity and Euclidean distance directly at the monitoring station. It can be expressed as , used to represent a node collection The connection relationship and weights between the elements in the map are calculated, and the weights take into account spatial distance, meteorological factors and pollutant concentrations.

[0090] S4. Determine an adjacency matrix according to the spatiotemporal graph structure, and normalize the adjacency matrix according to a second normalization formula.

[0091] In this embodiment, in step S4, the adjacency matrix for:

[0092]

[0093] in, , and represents the weight coefficient, , and They represent pollution concentration weight, jaccard similarity weight and Euclidean distance weight respectively;

[0094] The second normalization formula is:

[0095]

[0096] in, Represents the normalized adjacency matrix Line The elements of the column, Indicates the number of nodes, Representation Node and nodes The attributes and weights of the edges between them, Slave Node To other nodes The attributes and weights of the edges.

[0097] S5. Use the site characteristic data, time series data, normalized pollutant concentration change matrix, normalized meteorological change matrix and normalized adjacency matrix to train the neural network model to obtain an air quality prediction model.

[0098] The air quality prediction model includes a multi-relationship mining module, a spatiotemporal attention mechanism module and a multi-layer perceptron; the multi-relationship mining module is used to determine the multi-relationship matrix based on the normalized pollutant concentration change matrix, the normalized meteorological change matrix and the normalized adjacency matrix; the spatiotemporal attention mechanism module is used to determine the attention feature vector based on the site feature data, time series data and the multi-relationship matrix; the multi-layer perceptron is used to determine the predicted air quality data based on the attention feature vector.

[0099] In this embodiment, in step S5, a multi-relationship matrix is ​​determined according to the normalized pollutant concentration change matrix, the normalized meteorological change matrix and the normalized adjacency matrix, specifically including:

[0100] S51, defining a node embedding matrix according to the normalized pollutant concentration change matrix, the normalized meteorological change matrix, and the normalized adjacency matrix;

[0101] S52, calculating the Euclidean distance matrix between node embeddings in the node embedding matrix according to the node distance formula;

[0102] Node distance formula for:

[0103]

[0104] in, Indicates The embedding representation of nodes, Indicates The embedded representation of each node;

[0105] S53, converting the Euclidean distance matrix into a similarity matrix through a Gaussian kernel function;

[0106] Gaussian kernel function for:

[0107]

[0108] in, represents the variance of the Euclidean distance matrix;

[0109] S54, calculating the degree matrix of the similarity matrix;

[0110] S55, subtracting the similarity matrix from the degree matrix to obtain a Laplace matrix;

[0111] S56, performing eigenvalue decomposition on the Laplace matrix to obtain a matrix composed of eigenvectors;

[0112] S57, clustering the matrix composed of feature vectors using K-Means clustering algorithm;

[0113] S58. Determine a multi-relationship matrix based on the clustering results.

[0114] For example, the pollutant concentration change matrix, the meteorological change matrix, and the adjacency matrix can be used as inputs of the multi-relationship mining module, and the spectral clustering algorithm is used to mine multiple relationships in the node embedding space and generate a multi-relationship matrix. The final output multi-relationship matrix contains the similarity or connectivity between nodes under different relationships, which is used in the spatiotemporal attention mechanism.

[0115] The goal of the multi-relationship mining module is to extract multiple potential relationships from node embeddings and construct a multi-relationship matrix between nodes. First, we can define the node embedding matrix given the number of nodes N and the dimension d of the node embedding in a graph: , whose shape is . Each node The embedding representation is a vector Then, the Euclidean distance matrix between two nodes can be calculated by the node distance formula to obtain the Euclidean distance matrix between nodes: , where each element Representation Node and nodes The distance between Then, the Euclidean distance matrix is ​​converted into a similarity matrix through the Gaussian kernel function In order to further perform spectral clustering of the graph, we first calculate the degree matrix of the similarity matrix . Degree matrix is a diagonal matrix whose diagonal elements is the sum of the elements in the corresponding rows of the similarity matrix. Next, the Laplacian matrix Defined as the degree matrix Subtract similarity matrix In order to extract the structural features of the nodes, the Laplacian matrix Perform eigenvalue decomposition and obtain The matrix of eigenvectors , then we get the matrix of eigenvectors Then, the K-Means clustering algorithm is used to cluster these feature vectors. The nodes are divided into Clusters, each cluster represents a potential relationship category. Finally, a three-dimensional multi-relationship matrix can be constructed based on the clustering results. , whose shape is If the matrix Elements in , indicating a node and nodes There is a connection in relation K.

[0116] In this embodiment, a multi-relationship matrix between nodes is constructed based on the node embedding features. By calculating the distance matrix between nodes, the similarity matrix is ​​obtained using the Gaussian kernel function, and then the Laplace matrix of the graph is calculated, and the eigenvalue decomposition is performed. After that, K-Means is used to cluster the eigenvectors, the nodes are divided into multiple subsets, and finally a three-dimensional tensor is generated to represent the multiple relationships between different nodes. The above process can be used to reveal the multi-dimensional complex relationship structure between nodes.

[0117] In this embodiment, in step S5, the attention feature vector is determined according to the site feature data, the time series data and the multi-relationship matrix, specifically including:

[0118] S59, determining a spatial hidden representation according to the site characteristic data;

[0119] S510, determining a spatial attention score according to the spatial hidden representation and the multi-relation matrix;

[0120] S511, converting the spatial attention score into a spatial attention weight according to a preset first conversion function;

[0121] S513, determining the time series characteristics of the time series data according to the time series data;

[0122] S514, determining a temporal hidden representation according to the time series characteristics;

[0123] S515, determining a temporal attention score according to the temporal hidden representation and the multi-relation matrix;

[0124] S516, converting the temporal attention score into a temporal attention weight according to a preset second conversion function;

[0125] S517, generating a final time series representation according to the time attention weight and the time series data;

[0126] S518. Determine the attention feature vector based on the spatial attention weight and the final time series representation.

[0127] For example, the input of the spatiotemporal attention mechanism module consists of site features, time series data, and the multi-relation matrix generated by the multi-relation mining module. These inputs dynamically adjust the weights of the model in the spatial and temporal dimensions through the spatial and temporal attention mechanism.

[0128] Input data: If monitoring sites, each with Features. The site feature data can be defined as: .

[0129] The time series data of the monitoring station can be expressed as Sites in The feature vector dimension of each site can also be .

[0130] Multi-relationship matrix generated by multi-relationship mining module ,in, Elements in The k in represents the number of relations. Indicates the association between site i and site j under k.

[0131] The spatiotemporal attention mechanism module can include the spatial attention mechanism and the temporal attention mechanism. The spatial attention mechanism dynamically adjusts the impact of different sites on the prediction results by learning the correlation between different sites. The temporal attention mechanism is responsible for dynamically challenging the importance of different time steps based on the features in the actual sequence data.

[0132] Exemplarily, the input of the spatial attention mechanism includes: site feature data And the multi-relation matrix Among them, site characteristic data Indicates that at time step Characteristics of all sites at the moment, multi-relationship matrix Represents multiple relationships between sites.

[0133] In the spatial attention mechanism, we need to Calculate the weight matrix between sites (i.e., spatial attention weight). If the spatial attention weight is expressed as , it can be calculated by the following steps:

[0134] First, based on the site feature data, the spatial hidden representation is calculated:

[0135]

[0136] in, is the linear transformation matrix, d is the dimension of the hidden layer, Spatially hidden representation of site characteristics.

[0137] Next, hide the space representation With multiple relationship matrix Combined to generate a spatial attention score :

[0138]

[0139] in, is the second linear transformation matrix, Representation tensors are multiplied element-wise to generate the attention score matrix.

[0140] Finally, the preset first conversion function is applied to convert the spatial attention score Normalized to spatial attention weights :

[0141]

[0142] Among them, the spatial attention weight Indicates the relative importance of each site at time step t.

[0143] For example, the input of the temporal attention mechanism is: time series features . is the time series feature of site i (representing the feature sequence of site i in T time steps).

[0144] First, the temporal hidden representation can be determined by the following formula:

[0145]

[0146] in, is the linear transformation matrix, d is the dimension of the hidden layer, Representation time hides representation.

[0147] Next, hide the time representation With multiple relationship matrix Combined to generate a temporal attention score.

[0148] Then, the temporal attention weight is calculated by the following preset second conversion function:

[0149]

[0150] in, is the linear transformation matrix, is the temporal attention weight, is the linearly transformed representation of the i-th element in the temporal attention score.

[0151] Finally, the temporal attention weights can be Acting on input time series features To generate the final time series representation, the following formula can be used in the generation process:

[0152]

[0153] in, Indicates The temporal attention weights for time steps, Indicates The time series features of time steps, represents the attention feature vector, Indicates the number of time steps.

[0154] The spatiotemporal attention mechanism module combines the spatial attention mechanism with the temporal attention mechanism to ensure that the model can capture the complex relationship between sites while dynamically adjusting the influence of different time steps. And the output of the spatial attention mechanism , we can get the attention feature vector after weighting the moment features :

[0155]

[0156] in, Represents the attention feature vector finally output by the spatiotemporal attention mechanism module.

[0157] In this embodiment, in step S5, the multilayer perceptron includes an input layer, three hidden layers connected in sequence, and an output layer.

[0158] In this embodiment, the activation function of the input layer is:

[0159]

[0160] in, represents the attention feature vector, Represents the output of the input layer;

[0161] The activation functions of the three sequentially connected hidden layers are:

[0162]

[0163] in, , , Represent the outputs of three hidden layers connected in sequence, Represent the weight matrices of three hidden layers connected in sequence, Represent the bias vectors of three hidden layers connected in sequence;

[0164] The activation function of the output layer is:

[0165]

[0166] in, represents the weight matrix of the output layer, represents the bias vector of the output layer, Represents the predicted air quality data output by the output layer.

[0167] S6. Input the target data to be measured into the air quality prediction model, and output the target predicted air quality data through the air quality prediction model.

[0168] In this embodiment, the method further includes: evaluating the air quality prediction model using the correlation coefficient.

[0169] like Figure 2 As shown, Figure 2 This is a schematic diagram of the evaluation results of the air quality prediction model. Figure 2 The closer the correlation coefficient is to 1, the stronger the linear relationship between the two is, and the higher the accuracy of the air quality data predicted by the air quality prediction model output target is.

[0170] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the invention.

Claims

1. An air quality prediction method based on multi-relation mining spatiotemporal attention mechanism, characterized in that: The method comprises: S1. Obtain a pollutant concentration data set and a historical meteorological data set, construct a pollutant concentration change matrix and a meteorological change matrix according to the pollutant concentration data set and the historical meteorological data set, respectively, and normalize the pollutant concentration change matrix and the meteorological change matrix using a first normalization formula; S2. Obtaining geographic location information data, site feature data and time series data of the monitoring site; Wherein, the pollutant concentration data set and the historical meteorological data set correspond one-to-one to the geographical location information data respectively; S3, determining the edges of the space-time graph according to the pollutant concentration data set and the historical meteorological data set, determining the nodes of the space-time graph according to the geographic location information data, and constructing a space-time graph structure; S4, determining an adjacency matrix according to the spatiotemporal graph structure, and normalizing the adjacency matrix according to a second normalization formula; S5. Training a neural network model using the site feature data, the time series data, the normalized pollutant concentration change matrix, the normalized meteorological change matrix, and the normalized adjacency matrix to obtain an air quality prediction model; The air quality prediction model includes a multi-relation mining module, a spatiotemporal attention mechanism module and a multi-layer perceptron; The multi-relationship mining module is used to determine a multi-relationship matrix according to the normalized pollutant concentration change matrix, the normalized meteorological change matrix and the normalized adjacency matrix; The spatiotemporal attention mechanism module is used to determine an attention feature vector according to the site feature data, the time series data and the multi-relation matrix; The multilayer perceptron is used to determine predicted air quality data based on the attention feature vector; S6. Input the target data to be measured into the air quality prediction model, and output the target predicted air quality data through the air quality prediction model.

2. The method according to claim 1, characterized in that In step S1, the pollutant concentration data set includes concentration, concentration, concentration, concentration, Concentration and concentration, the historical meteorological data set includes temperature, humidity, wind speed, wind direction and precipitation; In the step S2, the pollutant concentration data set and the historical meteorological data set correspond to geographical location information data one by one, and the geographical location information data includes longitude and latitude.

3. The method according to claim 1, characterized in that In step S4, the adjacency matrix for: in, , and represents the weight coefficient, , and They represent pollution concentration weight, jaccard similarity weight and Euclidean distance weight respectively; The second normalization formula is: in, Represents the normalized adjacency matrix Line The elements of the column, Indicates the number of nodes, Representation Node and nodes The attributes and weights of the edges between them, Slave Node To other nodes The attributes and weights of the edges.

4. The method according to claim 1, characterized in that: In step S5, determining a multi-relationship matrix according to the normalized pollutant concentration change matrix, the normalized meteorological change matrix and the normalized adjacency matrix specifically includes: S51, defining a node embedding matrix according to the normalized pollutant concentration change matrix, the normalized meteorological change matrix and the normalized adjacency matrix; S52, calculating the Euclidean distance matrix between node embeddings in the node embedding matrix according to the node distance formula; The node distance formula for: in, Indicates The embedding representation of nodes, Indicates The embedded representation of each node; S53, converting the Euclidean distance matrix into a similarity matrix through a Gaussian kernel function; The Gaussian kernel function for: in, represents the variance of the Euclidean distance matrix; S54, calculating the degree matrix of the similarity matrix; S55, using the degree matrix to subtract the similarity matrix to obtain a Laplace matrix; S56, performing eigenvalue decomposition on the Laplace matrix to obtain a matrix composed of eigenvectors; S57, clustering the matrix composed of the feature vectors using a K-Means clustering algorithm; S58. Determine the multi-relationship matrix according to the clustering result.

5. The method according to claim 1, characterized in that In step S5, determining the attention feature vector according to the site feature data, the time series data and the multi-relationship matrix specifically includes: S59, determining a spatial hidden representation according to the site characteristic data; S510, determining a spatial attention score according to the spatial hidden representation and the multi-relation matrix; S511, converting the spatial attention score into a spatial attention weight according to a preset first conversion function; S513, determining a time series feature of the time series data according to the time series data; S514, determining a temporal hidden representation according to the time series feature; S515, determining a temporal attention score according to the temporal hidden representation and the multi-relation matrix; S516. Convert the temporal attention score into a temporal attention weight according to a preset second conversion function; S517, generating a final time series representation according to the time attention weight and the time series data; S518. Determine the attention feature vector based on the spatial attention weight and the final time series representation.

6. The method according to claim 1, characterized in that In step S5, the multilayer perceptron includes an input layer, three hidden layers connected in sequence, and an output layer.

7. The method according to claim 6, characterized in that The activation function of the input layer is: in, represents the attention feature vector, Represents the output of the input layer; The activation functions of the three sequentially connected hidden layers are: in, , , Represent the outputs of three hidden layers connected in sequence, Represent the weight matrices of three hidden layers connected in sequence, Represent the bias vectors of three hidden layers connected in sequence; The activation function of the output layer is: in, represents the weight matrix of the output layer, represents the bias vector of the output layer, Represents the predicted air quality data output by the output layer.

8. The method according to claim 1, characterized in that The method further comprises: The air quality prediction model was evaluated using the correlation coefficient.

Citation Information

Patent Citations

  • Air pollutant concentration prediction method based on graph attention mechanism

    CN111832814A

  • Air quality prediction method based on space-time diagram convolutional network

    CN114240000A