Air quality prediction method of space-time diagram neural network based on trend information perception

Through a spatio-temporal graph neural network based on trend information perception, combined with the trend-aware attention mechanism and the dual-channel attention module, the problem of insufficient accuracy of air quality prediction in traditional methods is solved, and more efficient air quality data flow prediction is achieved.

CN120539348APending Publication Date: 2025-08-26SOUTHWEST PETROLEUM UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510538072.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-27
Publication Date
2025-08-26

AI Technical Summary

Technical Problem

Existing air quality prediction methods cannot effectively capture complex spatial and temporal changes and nonlinear relationships. Traditional attention mechanisms ignore local trends, resulting in insufficient prediction accuracy.

Method used

A spatio-temporal graph neural network based on trend information perception is adopted, combining the trend-aware attention mechanism and the dual-channel attention module, by constructing a mapping window for trend information and numerical information, the local change trend of the air quality data flow is captured, and a multi-graph convolutional network is used for encoding.

Benefits of technology

It improves the accuracy and real-time nature of air quality prediction, can better understand the dynamic changes of air quality data flow, and improves the reliability of forecasts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120539348A_ABST
    Figure CN120539348A_ABST
Patent Text Reader

Abstract

The invention provides an air quality prediction method of a space-time diagram neural network based on trend information perception, and the method specifically comprises the steps: constructing network data which comprises an adjacent matrix between air monitoring stations and a feature information matrix of each air monitoring station; an air quality prediction model of a space-time diagram neural network based on trend information perception is constructed, the model comprises a trend perception attention mechanism and a double-channel attention module, and a trend sequence is introduced to improve an adaptive graph learning module; training an air quality prediction model; and predicting the air quality by using the trained air quality prediction model. The invention provides a novel air quality prediction method which can extract the time and space characteristics of a data set at the same time and aims to improve the accuracy and universality of air quality prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of environmental monitoring, and in particular to an air quality prediction method based on machine learning, and specifically to an air quality prediction technology that combines trend information perception with a spatiotemporal graph neural network. Background Art

[0002] 1. With the acceleration of urbanization, air pollution is becoming increasingly serious, posing a major challenge to global public health and environmental protection. Studies have shown that air pollution is closely linked to a variety of health issues, such as respiratory and cardiovascular diseases, and an increased risk of premature death. According to the World Health Organization (WHO), air pollution causes up to 7 million deaths worldwide each year. Therefore, accurate monitoring and prediction of air quality has become an urgent need.

[0003] 2. Traditional air quality prediction methods rely primarily on linear models and time series analysis, which cannot effectively capture complex spatiotemporal variations and nonlinear relationships, limiting the accuracy of predictions. Furthermore, existing monitoring systems face challenges in data collection and processing, especially in large-scale sensor networks, where missing data and noise often lead to unreliable results.

[0004] 3. The self-attention mechanism effectively alleviates the vanishing gradient problem by reducing the distance between any two time points during operation, thereby demonstrating excellent performance in capturing long-term dependencies in time series. However, the self-attention mechanism divides time series data into multiple discrete segments and assigns attention scores based on these segments, thus implementing its core logic: shifting from focusing on all information to focusing on important parts. However, this approach does not fully consider local trends in continuous data. Therefore, simply applying the self-attention mechanism to time series data processing may result in mismatches. To address this issue, this paper proposes a trend-aware attention mechanism to overcome the drawback of traditional attention mechanisms that ignore local trends during sequence pairing. This mechanism constructs a mapping window (Tendency Conversion) to convert numerical data reflecting the size of the air quality data stream into trend data that reveals the changing trends of air quality. An embedded attention module (Attention Embedding) is then used to capture and perceive these trend changes.

[0005] 4. Traditional air quality data stream prediction methods usually focus on basic numerical information, such as historical air pollution data and meteorological data. However, relying solely on these numerical data may not be able to fully capture the potential trends and changing patterns in the air quality data stream. Therefore, this chapter proposes a new model that combines trend data, that is, information that describes the changing trend of the air quality data stream, so as to more comprehensively understand the dynamic change process of the air quality data stream. However, in the time series, although some time segments may have similar changing trends, their flow patterns are not necessarily similar. To solve this problem, this paper proposes an innovative dual-channel attention module. The core idea of ​​this module is not only to use historical data to mine similarities in the air quality prediction model, but also to reveal the changing trends of the air quality data stream through the trend-aware attention mechanism, thereby improving the accuracy and reliability of the prediction.

[0006] 5. Although some scholars have proposed using convolutional operations to take local context as input, thereby enabling the model to recognize local trends hidden in air quality and meteorological data sequences, they are unable to fully extract trend features because the size of the numerical data cannot directly represent trend information. In response to the traditional attention mechanism that ignores local trends in sequences when pairing data, as well as some of the above-mentioned social context challenges, this paper proposes an air quality prediction method based on trend information-aware spatiotemporal graph neural networks. This method aims to combine the advantages of trend analysis of historical data and spatiotemporal graph neural networks to improve the accuracy and real-time performance of air quality predictions. Summary of the Invention

[0007] The present invention proposes an air quality prediction method based on a spatiotemporal graph neural network with trend information perception to solve the problem of low accuracy in current air quality prediction.

[0008] The technical solution of the present invention to solve the above problems is: an air quality prediction method based on a spatiotemporal graph neural network with trend information perception, comprising the following specific steps:

[0009] Step 1: Obtain air pollutant data and meteorological data from each monitoring station, as well as their historical sequence data. These two types of data are collectively referred to as air quality data. Preprocess the corresponding datasets. Finally, divide the datasets into training, test, and validation sets, and use them as input variables in the time dimension.

[0010] Step 2: Construct a trend information-aware spatiotemporal graph neural network model, which includes a trend-aware attention mechanism and a dual-channel attention module;

[0011] Step 3: Train the constructed trend information-aware spatiotemporal graph neural network;

[0012] Step 4: Use the air quality model described in step 3 to make predictions on the dataset.

[0013] On this basis, further, the data for air quality prediction is obtained specifically as follows:

[0014] Step 1.1: Obtain historical data on various air pollutants and meteorological data for each monitoring station, as well as the distances between each monitoring station. This dataset is derived from N meteorological stations at Sichuan University of Science and Chemical Technology, Yibin Danfeng Park, and Luzhou High School, with data collected every hour.

[0015] The data collected mainly include relevant meteorological characteristics such as wind direction, humidity, temperature, pressure, precipitation and visibility, as well as PM 2.5 、PM 10 , O3, CO, conventional SO2, NO and NO2 seven atmospheric pollution characteristics.

[0016] The PM mentioned 2.5 and PM 10 The main components in the molten salt include two organic compounds: total elemental carbon concentration TOT_EC and total organic carbon concentration TOT_OC, and Cl - 、 K + , Ca 2+ 、Na + and Mg 2+ Eight inorganic salt ions and 32 metal elements such as Si, Al, Ca, Fe, and Ti. These elements and ions are not direct variables in the model, but are used to describe the composition and pollution characteristics of particulate matter in the air. They provide important information about pollution sources and air quality status.

[0017] Step 1.2: According to step 1.1, the distance characteristics between the monitoring sites are characterized by constructing an adjacency matrix between the air monitoring sites.

[0018] Step 1.3: Preprocess the data used for air quality prediction to obtain the characteristic matrix between each air monitoring station.

[0019] Step 1.4: The data preprocessing is characterized by using linear interpolation to fill in the missing data in the time dimension used for air quality prediction; and using Z-score to normalize the data used for air quality prediction in the time dimension.

[0020] Step 1.5: Based on Step 1.4, the characteristic of the linear interpolation method for missing data is that the missing value at the current moment is estimated based on the missing values ​​at the moments before and after the current moment. The specific calculation formula is:

[0021]

[0022] Among them, X t is the missing value at time t, X t-1 and X t+1 are the missing values ​​of the previous and next moments, and α and β can be constants, indicating the different weights of the previous and next moments.

[0023] Step 1.6: As described in step 1, the data for air quality prediction is divided into a training set, a test set, and a validation set, wherein the proportions are 70%, 20%, and 10%, respectively.

[0024] In step 1.2, the air quality data stream and trend data are used simultaneously to construct spatial relationships. The similarity is dynamically evaluated through the air quality data stream and air quality trend of each site to improve the similarity adjacency matrix. The specific steps are as follows:

[0025] Step 2.1: Obtain the historical average air quality data d of air quality monitoring station i in time period t (t∈T) i , and calculate the air quality data flow change trend h of each station in period t i , h i The average value of the trend information in the time period t is obtained. The air quality data status at time t is represented by the feature vector X t =[d i ,h i ]∈R N×1 To express.

[0026] Step 2.2: According to step 2.1, the similarity of the air quality data conditions between different sensors is calculated in Euclidean space as follows:

[0027]

[0028] Step 2.3: According to the above step 2.1, the improved similarity adjacency matrix can be expressed as:

[0029]

[0030] Among them A vh represents the improved similarity adjacency matrix, W ijrepresents the similarity of spatial patterns between nodes i and j. This matrix not only fully captures the immediate similarity of air quality data flows between nodes, but also reveals the trend similarity patterns of data from different air quality monitoring stations in the temporal dimension.

[0031] The air quality prediction method based on trend information perception spatiotemporal graph neural network is characterized in that the trend information perception spatiotemporal graph neural network model specifically includes:

[0032] Step 3.1: Define the trend sequence that describes the changes in network data and design a trend-aware attention mechanism to capture the local trend information of the time series.

[0033] Step 3.2: Design a dual-channel attention module to simultaneously focus on the actual state of traffic flow and its potential changing trends. Step 3.3: Introduce trend sequences to improve the adaptive graph learning module to optimize the learning of dynamic spatiotemporal graphs.

[0034] Step 3.4: Introduce trend information to optimize the learning of dynamic spatiotemporal graphs, and use multi-graph convolutional networks to encode the dynamic spatial information and trend information of network data nodes. In step 3.1, define the trend sequence that describes the changes in network data, and design a trend-aware attention mechanism to capture the local trend information of the time series. The specific steps are as follows:

[0035] Step 4.1: The definition describes the trend sequence of network data changes, which is characterized by: given a time series of a node X = [x 0 ,x 2 ,x 3 ,…,x T ]∈R (T+1)×M , a window with a width of 2 is used to slide in the time dimension to obtain the changing trend of node traffic in each time slice, which is defined as follows:

[0036]

[0037] Among them, H i It represents the percentage change of trend at time point i, which reflects the change of traffic between adjacent time slices. By applying this calculation method to the entire sequence X, we can get the trend sequence H of a node = [H 0 ,H 1 ,H 3 ,…,H T-1 ]∈R T×M ,This sequence can accurately describe the changing trend of air data flow.

[0038] Furthermore, since the entire air quality data network is composed of data from N air monitoring stations, this trend sequence calculation method is extended to all nodes in the network, thereby comprehensively depicting the flow change trend of the entire air quality data network.

[0039] Given a time series X∈R of N nodes (T+1)×N×M , define the trend sequence according to the formula:

[0040] (H1,H1,…,H n )=f(X1,X1,…,X n )

[0041] Where n∈N represents the observation node, f(·) represents the application of the above formula to process the time series of all nodes, and finally obtains the trend sequence H∈R T×N×M .

[0042] Step 4.2: The design of a trend-aware attention mechanism is characterized in that a trend-aware attention mechanism that considers local context information is designed.

[0043] A mapping window is constructed to convert the numerical data reflecting the size of the air quality data stream into trend data reflecting the change of the air quality data stream, and the embedded attention module is used to perceive this trend change.

[0044] Step 4.3: According to step 3.2, given an original sequence data X∈R (T+1)×N×M , which is converted into a trend sequence H∈R that reflects the local changes in the air quality data stream through the mapping window T×N×M .

[0045] Then, the trend sequence H is passed through the fully connected layer to generate the corresponding query vector Q H and key value K H .

[0046] Finally, the attention mechanism is used to calculate the attention score of the trend sequence to highlight the trend information with significant influence. The calculation formula is:

[0047]

[0048] Through the above steps, we can obtain the attention score of the trend sequence, which will highlight the trend information that has an important impact on the final result.

[0049] Finally, the trend attention score is weighted with the original numerical information to match the time nodes with the same local transformation trend. The calculation formula is as follows:

[0050] TAM=S H *X[S H]

[0051] Where X represents the original sequence data containing numerical information, X[] represents the sequence X=[x 0 ,x 2 ,x 3 ,…,x T ] to transform the dimension so that it is consistent with The dimensions remain consistent.

[0052] In step 3.2, a dual-channel attention module is designed. The core of this mechanism is to not only use historical data to mine the similarity of air quality data models, but also to mine the changing trends of air quality data streams through a trend-aware attention mechanism. The specific steps are as follows:

[0053] Step 5.1: In the numerical attention channel, the original numerical data is modeled through the self-attention mechanism to emphasize the key numerical information. The calculation formula is as follows:

[0054]

[0055] Where the query vector Q v and key value K v Represents the corresponding numerical sequence X∈R T×N×M The matrix vector

[0056] Step 5.2: Concatenate the results of the numerical attention channel and the trend attention channel to form a global weighted representation of the original data.

[0057] In the trend data attention channel, the sliding window technique is used to calculate the changes in the original numerical data, and the generated trend data is weighted through the attention mechanism to highlight the trend information with significant influence. This can be expressed as TAM. The specific process is described in step 4.3 above. This comprehensive representation includes information from both the numerical and trend channels, allowing the model to more comprehensively understand the dynamic characteristics of time series data. Its calculation formula is as follows:

[0058] DCAM=Concatenate(TAM,ESAM)

[0059] By introducing this dual-channel attention module, we hope to improve the model's ability to model time series data, enable it to better adapt to complex time series patterns, and thus improve the accuracy of traffic flow prediction.

[0060] Compared with the existing technology, the present invention has the beneficial effect of providing an air quality prediction method based on trend information perception and spatiotemporal graph neural network, which cleverly transforms the numerical sequence and enables the model to deeply explore the local change trend of the air quality data stream;

[0061] At the same time, a dual-channel attention module was developed, which uses two parallel attention mechanisms to focus on dynamic traffic patterns and changing trends respectively, thereby fully capturing the temporal correlation of the air quality data stream;

[0062] Finally, trend information is introduced to optimize the learning of dynamic spatiotemporal graphs, and a multi-graph convolutional network is used to encode the dynamic spatial information and trend information of air quality monitoring sites, thereby modeling complex spatiotemporal dependencies and improving the accuracy of air quality prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 This is a flow chart of the air quality prediction method based on trend information perception and spatiotemporal graph neural network;

[0064] Figure 2 This is the overall framework diagram of the air quality prediction model based on trend information perception and spatiotemporal graph neural network;

[0065] Figure 3 This is a diagram of the framework of the trend-aware attention mechanism;

[0066] Figure 4 This is the framework diagram of the dual-channel attention module.

[0067] Specific Implementation Methods The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. 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 making creative efforts are within the scope of protection of the present invention.

[0068] Combine Figure 1-4 The air quality prediction method is shown in Figure 2. Figure 1 As shown in the figure, the overall framework of the air quality prediction model is as follows Figure 2 As shown. In the structure of the overall prediction framework, the trend perception attention mechanism and dual-channel attention module model framework proposed in this invention are as follows Figure 3 、 4 shown.

[0069] Combine Figure 1 The flow chart of the air quality prediction method based on trend information perception and spatiotemporal graph neural network is characterized in that it specifically includes the following steps:

[0070] Step 1: Obtain air pollution data and meteorological data from each monitoring site, preprocess the data, and then divide it into training set, test set, and validation set;

[0071] The step 1 specifically includes the following steps:

[0072] Step 1.1: Collect historical air pollutant and meteorological data from each monitoring station and calculate the distance between stations. This dataset contains air quality and meteorological data from Sichuan University of Science and Chemical Technology, Yibin Danfeng Park, and Luzhou High School. Each station records data every hour, covering the entire year of 2023.

[0073] The historical data collected mainly include relevant meteorological characteristics such as wind direction, humidity, temperature, pressure, precipitation and visibility, as well as PM 2.5 、PM 10 , O3, CO, conventional SO2, NO and NO2 seven atmospheric pollution characteristics.

[0074] The PM mentioned 2.5 and PM 10 The main components in the molten salt include two organic compounds: total elemental carbon concentration TOT_EC and total organic carbon concentration TOT_OC, and Cl - 、 K + , Ca 2+ 、Na + and Mg 2+ Eight inorganic salt ions and 32 metal elements such as Si, Al, Ca, Fe, and Ti. These elements and ions are not direct variables in the model, but are used to describe the composition and pollution characteristics of particulate matter in the air. They provide important information about pollution sources and air quality status.

[0075] Step 1.2: According to step 1.1, the distance characteristics between the monitoring sites are characterized by constructing an adjacency matrix between the air monitoring sites.

[0076] Step 1.3: Preprocess the data used for air quality prediction to obtain a feature matrix between each air monitoring station. Step 1.4: The characteristics of the data preprocessing are: for the time series data used for air quality prediction, linear interpolation is used to fill missing values; at the same time, the data is normalized using the Z-score method to adjust the time dimension to a uniform scale.

[0077] Step 1.5: Based on Step 1.4, the characteristic of the linear interpolation method for missing data is that the missing value at the current moment is estimated based on the missing values ​​at the moments before and after the current moment. The specific calculation formula is:

[0078]

[0079] Among them, X t is the missing value at time t, X t-1 and X t+1are the missing values ​​of the previous and next moments, and α and β can be constants, indicating the different weights of the previous and next moments.

[0080] Step 1.6: As described in step 1, the data for air quality prediction is divided into a training set, a test set, and a validation set, wherein the proportions are 70%, 20%, and 10%, respectively.

[0081] In step 1.2, spatial relationships are established by combining air quality data streams and trend data, and the air quality data streams and trend information of each monitoring site are used to dynamically evaluate the similarity between sites, thereby optimizing the similarity adjacency matrix. The specific steps are as follows:

[0082] Step 2.1: Obtain the historical average air quality data d of air quality monitoring station i in time period t (t∈T) i , and calculate the air quality data flow change trend h of each station during this time period i , where h i is the average value of trend information in time period t. Then, use the eigenvector X t =[d i ,h i ]∈R N×1 To represent the air quality status at time t.

[0083] Step 2.2: According to step 2.1, the similarity of the air quality data conditions between different sensors is calculated in Euclidean space as follows:

[0084]

[0085] Step 2.3: According to the above step 2.1, the improved similarity adjacency matrix can be expressed as:

[0086]

[0087] Among them A vh represents the improved similarity adjacency matrix, W ij represents the similarity of spatial patterns between nodes i and j. This matrix not only effectively reflects the instantaneous similarity of air quality data flows between nodes, but also deeply explores the trend similarity patterns of data changes in the time dimension of different air quality monitoring stations.

[0088] The air quality prediction method based on trend information perception spatiotemporal graph neural network is characterized in that the trend information perception spatiotemporal graph neural network model specifically includes:

[0089] Step 3.1: Define the trend sequence that describes the changes in network data and design a trend-aware attention mechanism to capture the local trend information of the time series. The specific model framework is as follows: Figure 3 shown

[0090] Step 3.2: Introduce trend sequences to improve the adaptive graph learning module to optimize the learning of dynamic spatiotemporal graphs

[0091] Step 3.3: Design a dual-channel attention module to simultaneously focus on the actual state of the air quality data stream and its potential changes. The specific model framework is as follows: Figure 4 shown

[0092] Step 3.4: Introduce trend information to optimize the learning of dynamic spatiotemporal graphs, and use multi-graph convolutional networks to encode the dynamic spatial information and trend information of network data nodes. In step 3.1, a sequence is defined to describe the trend of network data changes, and a trend-aware attention mechanism is designed to capture local trend features in the time series. The specific steps are as follows:

[0093] Step 4.1: The network data change trend sequence defined above is characterized by: given a time series of a node X = [x 0 ,x 2 ,x 3 ,…,x T ]∈R (T+1)×M , by applying a sliding window with a width of 2 in the time dimension, the changing trend of node traffic in each time slice is captured, which is defined as follows:

[0094]

[0095] Among them, H i It represents the percentage change of trend at time point i, reflecting the change of node traffic between adjacent time slices. By applying this calculation method to the entire time series X, we can get the trend sequence of a node H = [H 0 ,H 1 ,H 3 ,…,H T-1 ]∈R T×M ,This sequence can effectively describe the changing trend of air data flow.

[0096] Furthermore, since the entire air quality data network is composed of data from N air monitoring stations, this trend sequence calculation method is extended to all nodes in the network, thereby comprehensively depicting the flow change trend of the entire air quality data network.

[0097] Given a time series X∈R of N nodes (T+1)×N×M, define the trend sequence according to the formula:

[0098] (H1,H1,…,H n )=f(X1,X1,…,X n )

[0099] Where n∈N represents the observation node, f(·) represents the application of the above formula to process the time series of all nodes, and finally obtains the trend sequence H∈R T×N×M .

[0100] Step 4.2: The design of a trend-aware attention mechanism is characterized in that a trend-aware attention mechanism that considers local context information is designed.

[0101] By constructing a mapping window, the numerical data representing the size of the air quality data stream is converted into a sequence reflecting the changing trend of the air quality data stream, and the embedded attention module is used to capture this trend change.

[0102] Step 4.3: According to step 3.2, given an original sequence data X∈R (T+1)×N×M , which is converted into a trend sequence H∈R that reflects the local changes in the air quality data stream through the mapping window T×N×M .

[0103] Then, the trend sequence H is passed through the fully connected layer to generate the corresponding query vector Q H and key value K H .

[0104] Finally, the attention mechanism is used to calculate the attention score of the trend sequence to highlight the trend information with significant influence. The calculation formula is:

[0105]

[0106] Through the above steps, we can obtain the attention score of the trend sequence, which will highlight the trend information that has an important impact on the final result.

[0107] Finally, the trend attention score is weighted with the original numerical information to match the time nodes with the same local transformation trend. The calculation formula is as follows:

[0108] TAM=S H *X[S H ]

[0109] Where X represents the original sequence data containing numerical information, X[] represents the sequence X=[x 0 ,x 2 ,x 3 ,…,x T ] to transform the dimension so that it is consistent with The dimensions remain consistent.

[0110] By taking local context as input, the trend-aware attention mechanism can effectively capture and compute representations of changing trends in air quality data streams, thereby enabling the model to be fully aware of the local changing trends hidden in the air quality data sequence.

[0111] In step 3.2, a dual-channel attention module is designed. The core of this mechanism is to not only use historical data to mine the similarity of air quality data models, but also to mine the changing trends of air quality data streams through a trend-aware attention mechanism. The specific steps are as follows:

[0112] Step 5.1: In the numerical attention channel, the original numerical data is modeled through the self-attention mechanism to emphasize the key numerical information. The calculation formula is as follows:

[0113]

[0114] Where the query vector Q v and key value K v Represents the corresponding numerical sequence X∈R T×N×M The matrix vector

[0115] Step 5.2: Concatenate the results of the numerical attention channel and the trend attention channel to form a global weighted representation of the original data.

[0116] In the trend data attention channel, the sliding window technique is used to calculate the changes in the original numerical data, and the generated trend data is weighted through the attention mechanism to highlight the trend information with significant influence. This can be expressed as TAM. The specific process is described in step 4.3 above. This comprehensive representation includes information from both the numerical and trend channels, allowing the model to more comprehensively understand the dynamic characteristics of time series data. Its calculation formula is as follows:

[0117] DCAM=Concatenate(TAM,ESAM)

[0118] By introducing this dual-channel attention module, we hope to improve the model's ability to model time series data, making it better adaptable to complex time series patterns, thereby improving the accuracy of air quality data stream predictions.

Claims

1. An air quality prediction method based on trend information perception and spatiotemporal graph neural network, characterized in that: Including the following step: Step 1: Acquire air quality data and meteorological data from each monitoring site, i.e., construct network data, where the network data includes a connection relationship matrix (adjacency matrix) between air monitoring sites and a feature information matrix for each air monitoring site; The air quality data and meteorological data are preprocessed; then they are divided into training set, test set and validation set, and used as input of the spatiotemporal graph neural network. Step 2: Construct a spatiotemporal graph neural network model for trend information perception, which includes a trend perception attention mechanism and a dual-channel attention module. Step 3: Train the constructed trend information perception spatiotemporal graph neural network. Step 4: Use the air quality model described in step 3 to predict the above data set.

2. The air quality prediction method based on a spatiotemporal graph neural network with trend information perception according to claim 1, It is characterized by: The data obtained for air quality prediction is specifically: Step 1.1: Obtain historical air quality data and meteorological data from each monitoring station and calculate the spatial distance between each monitoring station. The data set is obtained from N meteorological stations, and data is collected once every hour. The collected data mainly includes relevant meteorological characteristics such as wind direction, humidity, temperature, pressure, precipitation, visibility, and PM 2.5 、PM 10 , O3, CO, conventional SO2, NO and NO2 seven atmospheric pollution characteristics. Step 1.2: According to step 1.1, the distance characteristics between the monitoring sites are characterized by constructing an adjacency matrix between the air monitoring sites. Step 1.3: Preprocess the data used for air quality prediction to obtain a feature matrix between each air monitoring station. Step 1.4: The preprocessing features of the data include: using linear interpolation to fill missing values ​​in the time dimension of the air quality prediction data; and normalizing the data using the Z-score standardization method to ensure consistency and comparability of the data in the time dimension. Step 1.5: Based on Step 1.4, the characteristic of the linear interpolation method for missing data is that the missing value at the current moment is estimated based on the missing values ​​at the moments before and after the current moment. The specific calculation formula is: Among them, X t is the missing value at time t, X t-1 and X t+1 are the missing values ​​of the previous and next moments, and α and β can be constants, indicating the different weights of the previous and next moments. Step 1.6: As described in step 1, the data for air quality prediction is divided into a training set, a test set, and a validation set, wherein the proportions are 70%, 20%, and 10%, respectively.

3. The air quality prediction method based on trend information perception and spatiotemporal graph neural network according to claim 2 is characterized by: In step 1.2, the air quality data stream and trend data are used simultaneously to construct spatial relationships. The similarity is dynamically evaluated through the air quality data stream and air quality trend of each site to improve the similarity adjacency matrix. The specific steps are as follows: Step 2.1: Characterize the pollution characteristics of the air quality monitoring station in time period T. First, obtain the historical average data d of each station i i and trend information i . That is d i It is obtained by calculating the arithmetic mean of all monitoring data in the T period, reflecting the overall pollution level; the trend h i The linear regression method is used to capture the long-term upward or downward direction of pollution intensity by taking the slope of the time series data as the average rate of change. The two are combined into a feature vector X t =[d i ,h i ], where d i Provides static benchmark, h i The pollution evolution patterns of different sites are dynamically distinguished by positive and negative signs and numerical values, thereby significantly enhancing the characteristic differences and interpretability between different sites while retaining the core statistical characteristics. Step 2.2: According to step 2.1, the similarity of the air quality data conditions between different sensors is calculated in Euclidean space as follows: Step 2.3: According to the above step 2.1, the improved similarity adjacency matrix can be expressed as: Among them A vh represents the improved similarity adjacency matrix, and W ij represents the spatial pattern similarity between nodes i and j. This matrix not only effectively captures the immediate similarities in air quality data streams between nodes but also reveals more deeply the trend-based similarities across time at different air quality monitoring stations. In other words, this matrix not only accounts for spatial similarity but also further explores the dynamic temporal trends in data from different stations.

4. The air quality prediction method based on trend information perception and spatiotemporal graph neural network according to claim 1 is characterized in that: The trend information perception spatiotemporal graph neural network model specifically includes: Step 3.1: Construct a trend sequence describing the changes in network data and propose a trend-aware attention mechanism to capture local trend features in the time series. Step 3.2: Design a dual-channel attention module to simultaneously capture the current state of the air quality data stream and its future change trend. Step 3.3: Optimize the adaptive graph learning module by introducing trend sequences to improve the learning effect of dynamic spatiotemporal graphs. Step 3.4: Optimize the learning of dynamic spatiotemporal graphs by introducing trend information and use a multi-graph convolutional network to encode the dynamic spatial features and trend information of network data nodes.

5. The air quality prediction method based on trend information perception and spatiotemporal graph neural network according to claim 4 is characterized by: In step 3.1, we define a trend sequence that describes changes in network data and design a trend-aware attention mechanism to capture local trend information in the time series. The specific steps are as follows: Step 4.1: The above definition describes the trend sequence of network data changing over time. Its main feature is that for a certain node’s time series X=[x 0 ,x 2 ,x 3 ,…,x T ]∈R (T+1)×M , a sliding window with a width of 2 is used to move along the time axis to capture the traffic change trend of the node in different time periods. That is, by using the sliding window method, the data changes in each time segment can be effectively captured, thereby revealing the time dynamic change pattern of the node traffic, which is defined as follows: In this model, H i It represents the percentage change of trend at time point i, which is used to measure the change of traffic volume between adjacent time periods. By applying this calculation method to the entire time series X, the trend series H = [H 0 ,H 1 ,H 2 ,…,H T-1 ]∈R T×M ,This sequence can effectively describe the changing trend of air quality data stream. Furthermore, the air quality data network consists of data from N air quality monitoring stations. The same trend sequence calculation method is used and extended to all nodes to fully capture the flow change trend in the entire air quality network. For a given N nodes, its time series X∈R (T+1)×N×M , the corresponding trend sequence can be defined and calculated according to the formula: (H1,H1,…,H n )=f(X1,X1,…,X n ) Where n∈N represents the observation node, f(·) represents the above formula processing the time series of all nodes, and finally obtains the trend sequence H∈R T×N×M . Step 4.2: Design a trend-aware attention mechanism. Its characteristics are: by constructing a mapping window, the numerical data of the air quality data stream is converted into trend data that reflects the data's changing trend. A trend-aware attention mechanism that considers local context information is also introduced. This mechanism utilizes an embedded attention module to effectively capture the changing trends of the air quality data stream over time. This approach not only focuses on changes in the data stream but also mines trend information within the local context, thereby improving the ability to perceive and model trend changes. Step 4.3: According to step 3.2, given the original data sequence X∈R (T+1)×N×M , by designing a mapping window, it is converted into a trend sequence H∈R that can reflect the local changes of the air quality data stream T×N×M ,. Use full connection to process the trend sequence H and generate the corresponding query vector Q H and key value K H The attention mechanism is used to calculate the attention score of the trend sequence to highlight the trend information that plays an important role in the change of data flow. The specific calculation process can be achieved through the following formula: Through the above process, we can calculate the attention score of the trend sequence, thereby highlighting the trend information that has a significant impact on the final result. Finally, these trend attention scores are weighted and combined with the original numerical information to better match nodes with the same local change trend in the time dimension. The specific calculation formula is as follows: THERE=S H *X[S H ] Where X represents the original sequence data containing numerical information, X[] represents the sequence X=[x 0 ,x 2 ,x 3 ,…,x T ] to transform the dimension so that it is consistent with The dimensions remain consistent.

6. The air quality prediction method based on trend information perception and spatiotemporal graph neural network according to claim 4 is characterized by: In step 3.2, a dual-channel attention module is designed. The core of this mechanism is to not only use historical data to mine the similarity of air quality data models, but also to mine the changing trend of air quality data streams through the trend-aware attention mechanism. The specific steps are as follows: Step 5.1: In the numerical attention channel, the original numerical data is modeled through the self-attention mechanism to emphasize the key numerical information. The calculation formula is as follows: Where the query vector Q v and key value K v Represents the corresponding numerical sequence X∈R T×N×M The matrix vector Step 5.2: Concatenate the results of the value attention channel and the trend attention channel to form a global weighted representation of the original data. This comprehensive representation contains information from both the value and trend channels, allowing the model to more comprehensively understand the dynamic characteristics of time series data. The calculation formula is as follows: DCAM=Concatenate(TAM,ESAM) In the trend data attention channel, the sliding window technology is used to calculate the changes in the original numerical data, and the generated trend data is weighted through the attention mechanism to highlight the trend information with significant influence, which can be expressed as TAM. The specific process is described in step 4.3 above.

Citation Information

Cited By

  • Indoor air quality joint detection system fused with space-time diagram neural network

    CN120847348A

  • Indoor air quality joint detection system based on spatio-temporal graph neural network

    CN120847348B