Air quality prediction method and system based on multi-scale double-flow space-time diagram neural network and electronic equipment
By using a multi-scale dual-stream spatiotemporal graph neural network to fuse frequency domain information with spatiotemporal context, static and dynamic graph structures are constructed, which solves the problem of insufficient modeling of time-varying spatial dependence and multi-scale temporal patterns in air quality prediction, and achieves higher accuracy and robustness in air quality prediction.
Patent Information
- Application Number
- CN202511543180.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-27
- Publication Date
- 2026-01-20
AI Technical Summary
Existing air quality prediction models cannot capture time-varying spatial dependencies in static spatial modeling, and single-scale time series modeling is insufficient, making it difficult to effectively capture multi-scale time patterns in air quality data.
A multi-scale dual-stream spatiotemporal graph neural network is adopted. By fusing frequency domain information with spatiotemporal context, static and dynamic graph structures are constructed. By combining a gated multi-scale temporal convolution module and a static and dynamic dual-stream spatial graph convolution module, multi-scale temporal and spatial features are extracted and the information flow is dynamically adjusted.
It improves the accuracy and robustness of air quality forecasts, better captures time-varying spatial dependence and multi-scale characteristics, and demonstrates stronger generalization ability and adaptability to complex air quality changes.
Smart Images

Figure CN121365211A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of artificial intelligence and air quality prediction technology, in particular to an air quality prediction method and system based on a multi-scale double-flow space-time graph neural network and an electronic device. BACKGROUND
[0002] Air pollution is increasingly serious, posing a serious threat to public health and environmental sustainability. Among them, fine particulate matter (PM 2.5) is particularly concerned because it can penetrate deep into the human respiratory system and cause a variety of serious health problems. Therefore, being able to accurately predict the concentration of PM 2.5 is crucial for establishing an early warning system and implementing effective urban air quality management.
[0003] Air quality prediction technology aims to use historical monitoring data (such as pollutant concentrations, meteorological data, etc.) and related influencing factors to build models to predict the air quality conditions of one or more locations in the future. This technology is widely used in environmental protection, public health warning, urban planning, and other fields, and is a key component of smart cities and environmental management. Currently, the technical solutions for air quality prediction mainly fall into two categories: knowledge-driven methods and data-driven methods. Knowledge-driven methods: based on the basic principles of atmospheric physics and chemistry, mathematical models are constructed to simulate the generation, transformation, and diffusion processes of pollutants. Representative models include the Community Multiscale Air Quality (CMAQ) model, the Weather Research and Forecasting-Chemistry (WRF-Chem) model, etc. Data-driven methods: instead of directly simulating physical and chemical processes, these methods rely on historical monitoring data to learn the non-linear relationship between pollutant concentrations and related factors through statistical or machine learning techniques. Representative models include traditional statistical and machine learning methods (such as ARIMA, SVR), deep learning methods (such as LSTM, TCN), and space-time graph neural network methods (such as STGCN, DCRNN).
[0004] The existing solutions mainly have two core bottlenecks: one is the limitation of static spatial modeling: most models rely on predefined, static graph structures. However, the spatial diffusion of air pollutants is influenced by time-varying meteorological factors such as wind direction and speed, as well as human activities, resulting in dynamic or hidden correlations between sites. Static graphs cannot capture this time-varying spatial dependence. The second is the lack of single-scale time series modeling: air quality data contains multi-scale temporal patterns, including short-term fluctuations and long-term trends. Traditional LSTM, GRU, or single kernel size TCN cannot effectively capture these cross-scale complex temporal features at the same time. SUMMARY
[0005] In view of the deficiencies of the prior art, the present application provides an air quality prediction method and system based on a multi-scale double-flow space-time graph neural network and an electronic device, which improves the accuracy, robustness and generalization ability of air quality prediction by fusing frequency domain information and space-time context.
[0006] In a first aspect, the present application provides an air quality prediction method based on a multi-scale double-flow space-time graph neural network, comprising the following steps: S1), obtaining air quality data of a plurality of monitoring stations and performing data preprocessing to construct network input; S2), constructing static graph structure and dynamic graph structure to represent stable and changing spatial dependence relationship between monitoring stations; S3), constructing a multi-scale double-flow space-time graph neural network prediction model comprising a gated multi-scale time convolution module and a static-dynamic double-flow space graph convolution module; and training the multi-scale double-flow space-time graph neural network prediction model; S4), using the trained multi-scale double-flow space-time graph neural network prediction model to perform air quality prediction.
[0007] As a preferred, in step S1), the air quality data of a plurality of monitoring stations is obtained and data preprocessing is performed to construct network input, specifically comprising the following steps: S11), obtaining historical air quality data of a plurality of air monitoring stations in a continuous time period and the latitude and longitude coordinates of the monitoring stations; S12), missing value processing, for missing data caused by equipment failure or transmission anomaly, linear interpolation method is used in time dimension to fill in to ensure the integrity and continuity of data; S13), feature selection, the correlation between each input feature and the target variable PM2.5 is calculated by using the maximum information coefficient, and the threshold is set to select the features strongly related to PM2.5 and eliminate the features with weak correlation; S14), data standardization, the data is processed by using Z-Score standardization method; S15), data set division, the preprocessed data set is divided into training set, validation set and test set in time sequence in the ratio of 6:2:2, and sliding window is used to construct samples to obtain network input .
[0008] As a preferred, in step S1), the air quality data includes the concentration values of PM2.5, PM10, SO2, NO2, O3 and CO, air quality index AQI and 24-hour moving average of the above indexes.
[0009] As a preferred, in step S2), the static graph structure constructed is , wherein, to monitor a set of sites, denotes a set of edges connecting sites in a static graph structure; a static adjacency matrix; in particular, First, the latitude and longitude coordinates of each monitoring site are used to calculate the geographical distance between any two sites by the Haversine method to form a distance matrix D; Then, based on the Gaussian plume model, the distance matrix D is converted into a raw spatial similarity matrix by using the Gaussian kernel function; finally, the spatial similarity matrix is set to a threshold for sparse processing, filtering weak connections and retaining strong connections to obtain the final static adjacency matrix .
[0010] As preferred, in step S2), the dynamic graph structure constructed is wherein, denotes a dynamic adjacency matrix; in particular, The input air quality data is subjected to fast Fourier transform to extract its frequency domain amplitude features and normalize along the site dimension; The frequency domain features are spliced and fused with spatial node embedding and multi-dimensional time embedding containing hour, week, month and season information to generate a unified dynamic feature representation Based on the dynamic feature representation , the dynamic correlation between sites is calculated by bilinear transformation and nonlinear activation function, and the most relevant k neighbors are retained for each site to generate a dynamic adjacency matrix .
[0011] As preferred, in step S3), multi-scale time features are extracted by a gated multi-scale time convolution module GMTC, which uses multiple 1D convolution kernels of different sizes to perform convolution along the time axis simultaneously through a parallel multi-branch structure to capture time patterns of different scales; the output of multi-scale convolution is input into a gating unit through two parallel activation function paths of tanh and sigmoid to generate data streams F and gating signals G , which are multiplied element by element to dynamically select and adjust the time information.
[0012] As preferred, in step S3), the static and dynamic dual-flow spatial graph convolution module DGC processes static and dynamic spatial information in parallel and further processes the output obtained by the gated multi-scale time convolution module GMTC.
[0013] As preferred, in step S3), the static-dynamic dual-flow spatial graph convolution module DGC adopts static graph convolution in a static adjacency matrix The static graph convolutional stream output is obtained by performing the standard graph convolutional network operation above to extract stable spatial features determined by geographical location; The static-dynamic dual-flow spatial graph convolution module DGC adopts dynamic mixed jump graph convolution in a dynamic adjacency matrix plus self-loop and normalization and its transpose The mixed jump graph convolution is performed above respectively; The outputs of the two paths are summed to obtain the final output of the dynamic mixed jump graph convolution stream .
[0014] As preferred, in step S3), the multi-scale dual-flow spatio-temporal graph neural network prediction model further comprises an adaptive fusion module based on a gating mechanism, which is used to merge the output of the static graph convolutional stream and the output of the dynamic mixed jump graph convolutional stream The adaptive fusion module based on the gating mechanism learns a dynamic weight Z, which automatically weighs the contribution of static and dynamic spatial information at each spatio-temporal point according to the spatio-temporal features of the input data.
[0015] As preferred, in step S3), the outputs of multiple spatio-temporal processing layers of the multi-scale dual-flow spatio-temporal graph neural network prediction model are added through a skip connection to combine spatio-temporal feature information at different levels, and finally a two-layer convolutional layer is used to generate the final air quality prediction result.
[0016] In a second aspect, the embodiment provides a multi-scale dual-flow spatio-temporal graph neural network-based air quality prediction system, comprising: A data acquisition module acquires air quality data of multiple monitoring sites and performs data preprocessing; A static and dynamic graph structure construction module is used to construct static and dynamic graph structures to represent stable and changing spatial dependency relationships between monitoring sites; An air quality prediction module is used to predict air quality through a pre-trained multi-scale dual-flow spatio-temporal graph neural network prediction model.
[0017] As preferred, the multi-scale dual-flow spatio-temporal graph neural network prediction model comprises a gated multi-scale temporal convolution module, a static-dynamic dual-flow spatial graph convolution module, and an adaptive fusion module based on a gating mechanism.
[0018] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the air quality prediction method described above when executing the program.
[0019] The present application has the following advantages: 1. The present application introduces frequency domain feature analysis into the dynamic graph construction of the spatio-temporal graph neural network, and fuses it with multi-dimensional time information and spatial node embedding, so that the graph structure can not only reflect the time-varying nature, but also effectively capture the periodicity and potential long-range dependence of the data, and has stronger robustness to time domain noise; 2. The static graph stream of the present application captures geographical-based stable spatial relationships, and the dynamic graph stream captures time-varying and potential spatial relationships, which can more comprehensively and accurately model complex spatial dependencies than models that rely on single static graphs or dynamic graphs; 3. The present application uses a parallel multi-size convolution kernel structure to extract time features of different scales, and combines a gating mechanism to dynamically adjust the information flow, so that the model can better handle the non-stationary and multi-scale characteristics of the air quality sequence; 4. The present application shows stable and excellent performance on data from multiple regions with different pollution characteristics, climate conditions and economic structures, and outperforms existing advanced baseline models in multiple evaluation indicators, and does not depend on the data distribution of a specific region, has strong universality and practical application value; 5. The present application overcomes the defect that the traditional static graph cannot reflect the time-varying influence, and can resist noise and mine the implicit correlation between geographically remote stations better than methods that rely only on time domain information, so that the model has better modeling ability for complex scenarios such as cross-regional transmission of pollutants driven by meteorological conditions and other factors; 6. The gating multi-scale time convolution module of the present application can effectively capture and distinguish the change rules at different time scales, especially in medium and long-term prediction tasks that need to consider both long-term seasonal trends and short-term sudden pollution events, and has stronger robustness and accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0020] Figure 1 The flowchart of the method of the present application is shown; Figure 2 The structure diagram of the multi-scale double-flow spatio-temporal graph neural network prediction model of the present application is shown; Figure 3 The flowchart of constructing the static graph structure of the present application is shown; Figure 4 The flowchart of constructing the dynamic graph structure of the present application is shown. DETAILED DESCRIPTION
[0021] The specific embodiments of the present application are further described below with reference to the accompanying drawings: Embodiment 1 As shown in the figure, the embodiment provides an air quality prediction method based on a multi-scale double-flow space-time graph neural network, including the following steps: Figure 1 S1), Obtain air quality data of multiple monitoring stations and perform data preprocessing to construct network input; specifically including the following steps: S11), Obtain historical air quality data of multiple air monitoring stations in a continuous time period and the latitude and longitude coordinates of the monitoring stations; the air quality data includes the concentration values of PM2.5, PM10, SO2, NO2, O3 and CO, air quality index AQI and 24-hour moving average of the above indicators.
[0022] S12), Missing value processing, for missing data caused by equipment failure or transmission anomaly, linear interpolation method is used in time dimension to fill in to ensure the integrity and continuity of data; S13), Feature selection, the maximum information coefficient MIC is used to calculate the correlation between each input feature and the target variable PM2.5, and a threshold is set to select the features strongly related to PM2.5 and eliminate the features with weak correlation; wherein, is the grid division of the data scatter plot, is the mutual information value under the grid division, is a function of the sample size , , represent input feature variables and target variables respectively; , represent the number of grid division segments in the X direction and the number of grid division segments in the Y direction respectively.
[0023] S14), Data standardization, Z-Score standardization method is used to process the data; wherein, represents the mean; represents the variance; is the data after standardization processing, is the original data to be processed.
[0024] S15), Data set division, the preprocessed data set is divided into training set, validation set and test set in time sequence in the ratio of 6:2:2, and sliding window is used to construct samples.
[0025] S2)、constructing a static graph structure and a dynamic graph structure to represent the stable and changing spatial dependence relationship between monitoring sites; specifically comprising the following steps: S21)、constructing a static graph structure , wherein, is a set of monitoring sites, represents a set of edges connecting sites in the static graph structure; a static adjacency matrix; as shown, specifically comprising the following steps: Figure 3 S211)、firstly, using the latitude and longitude coordinates of each monitoring site , the geographic distance between any two sites is calculated by the Haversine method to form a distance matrix D; wherein, the geographic distance between site and site is represented as: ; ; wherein, is the radius of the earth; and are the differences in latitude and longitude, respectively; , are the latitude and longitude coordinates of site , respectively; , are the latitude and longitude coordinates of site , respectively.
[0026] S212)、based on the Gaussian plume model, the distance matrix is converted into the original space similarity matrix using the Gaussian kernel function; wherein, the scale parameter corresponds to the diffusion parameter in physics, and its value is adaptively calculated using the standard deviation of the distance data.
[0027] S213)、setting a threshold for the spatial similarity matrix to perform sparse processing, filtering weak connections, and retaining strong connections to obtain the final static adjacency matrix , that is: wherein, is the set threshold; represents the i Line number j List.
[0028] S22) Constructing a dynamic graph structure ,in, This represents the set of edges connecting stations in a dynamic graph structure. Represents a dynamic adjacency matrix; such as Figure 4 As shown, the specific steps include the following: S221) Input air quality data Perform a fast Fourier transform to extract its frequency domain amplitude features and normalize them along the station dimension; S222), frequency domain characteristics Embedded , and spatial node embedding And multi-dimensional time embedding that includes hourly, weekly, monthly, and seasonal information. The data is then spliced and merged to generate a unified dynamic feature representation. ; in, The learnable weight matrix for embedding fusion.
[0029] S223), based on dynamic feature representation The dynamic correlation between sites is calculated using bilinear transformation and nonlinear activation function. And retain the most relevant ones for each site k 10 neighbors, generate a dynamic adjacency matrix. .
[0030] in, The saturation rate of the activation function; Represents a linear rectified function; Represents the hyperbolic tangent activation function; Represents the learnable weight matrix; Indicates the first All relevance scores for each site Take before The site index corresponding to the maximum value; This indicates transpose.
[0031] S3) Construct a multi-scale dual-stream spatiotemporal graph neural network prediction model including a gated multi-scale temporal convolution module and a static and dynamic dual-stream spatial graph convolution module; and train the multi-scale dual-stream spatiotemporal graph neural network prediction model; likeFigure 2 As shown, this embodiment extracts multi-scale temporal features through a gated multi-scale temporal convolution module (GMTC). This GMTC uses a parallel multi-branch structure to simultaneously convolve multiple 1D convolutional kernels of different sizes along the time axis to capture temporal patterns at different scales. The output of the multi-scale convolution is input into the gated unit, and a data stream is generated through two parallel activation function paths: tanh and sigmoid. and gating signals The two are multiplied element by element, thereby achieving dynamic filtering and adjustment of time information, that is: ; ; in, This represents the convolution operation. Indicates the size of the convolution kernel. This represents the input to a multi-scale convolution; This represents the output of a multi-scale convolution; Represents the hyperbolic tangent activation function; express Activation function; Represents element-wise product; Indicates a data stream; Indicates a gating signal; This indicates the output of the GMTC module.
[0032] The static and dynamic dual-stream spatial graph convolution module (DGC) described in this embodiment processes static and dynamic spatial information in parallel, and further processes the output obtained from the gated multi-scale temporal convolution module (GMTC). The static / dynamic dual-stream spatial graph convolution module DGC described above uses static graph convolution on a static adjacency matrix. Performing standard graph convolutional network operations yields a static graph convolutional stream output. This is to extract stable spatial features determined by geographical location; that is: In the formula, This represents the output of the GMTC module, which is used as the input to the static graph convolutional stream; Indicates the first The node features of each static graph convolutional layer are used as the output of the last layer as the output of the static graph convolutional stream. .
[0033] The static and dynamic dual-stream spatial graph convolution module DGC employs dynamic hybrid jump graph convolution combined with a self-looping and normalized dynamic adjacency matrix. and its transpose The mixed graph convolution MGC is respectively performed on the up and down; this operation not only aggregates neighbor information, but also models the inflow and outflow directional propagation of the pollutants more finely by preserving part of the original features and mixing multi-hop information; the outputs of the two paths are summed to obtain the final output of the dynamic mixed graph convolution flow ; that is, wherein, represents the original feature contribution rate; represents the output of the GMTC module, which is taken as the input of the dynamic mixed graph convolution flow; represents the node feature of the i-th mixed graph convolution layer; represents the learnable weight matrix of the i-th mixed graph convolution layer; represents the output of the mixed graph convolution; represents the mixed graph convolution operation; the sum of the inflow and outflow two paths is taken as the final output of the dynamic mixed graph convolution flow . In the embodiment, the multi-scale dual-flow spatio-temporal graph neural network prediction model further comprises an adaptive fusion module based on a gating mechanism, which is used for merging the output of the static graph convolution flow and the output of the dynamic mixed graph convolution flow
[0034] ; the adaptive fusion module based on the gating mechanism learns a dynamic weight Z, and automatically weighs the contribution degree of the static and dynamic spatial information at each spatio-temporal point according to the spatio-temporal features of the input data.
[0035] wherein, represents a multi-layer perception; represents an adaptive dynamic weight; represents a sigmoid activation function; , respectively represent the learnable weight matrix of the static graph convolution flow output and the dynamic mixed graph convolution flow output ; represents a learnable bias; represents a preliminary fusion output; represents the final output of the adaptive fusion module; denotes an element-wise product.
[0036] The output of multiple spatiotemporal processing layers of the multi-scale dual-flow spatiotemporal graph neural network prediction model is added through a skip connection, and finally an air quality prediction result is generated through a two-layer convolution layer.
[0037] The embodiment trains the multi-scale dual-flow spatiotemporal graph neural network prediction model, and specifically includes the following steps: S31), input the air quality data training set processed in step S1) into the multi-scale dual-flow spatiotemporal graph neural network prediction model for training, perform parameter optimization, verify and adjust the hyperparameters on the validation set, and save the optimal parameters of the model; S32), test the trained multi-scale dual-flow spatiotemporal graph neural network prediction model on the test set, use multiple evaluation indexes to evaluate its prediction performance and generalization ability, and verify its effectiveness and stability in complex spatiotemporal environment.
[0038] S4), use the trained multi-scale dual-flow spatiotemporal graph neural network prediction model to predict air quality.
[0039] Embodiment 2 The embodiment provides an air quality prediction method based on a multi-scale dual-flow spatiotemporal graph neural network, comprising: A data acquisition module acquires air quality data of multiple monitoring stations and performs data preprocessing; specifically including the following steps: S11), acquire historical air quality data of multiple air monitoring stations in a continuous time period and the latitude and longitude coordinates of the monitoring stations; the air quality data includes the concentration values of PM2.5, PM10, SO2, NO2, O3 and CO, air quality index AQI and 24-hour moving average values of the above indexes.
[0040] S12), missing value processing, for missing data caused by equipment failure or transmission anomaly, linear interpolation method is used in time dimension to fill in, to ensure the integrity and continuity of data; S13), feature selection, the maximum information coefficient MIC is used to calculate the correlation between each input feature and the target variable PM2.5, and a threshold is set to select the features strongly correlated with PM2.5 and eliminate the features with weak correlation; wherein, is the grid division of the data scatter plot, is the mutual information value under the grid division, is a function of the sample size , respectively represent input feature variables and target variables; , respectively represent the number of division segments of the grid in the X direction and the number of division segments of the grid in the Y direction.
[0041] S14), data standardization, using Z-Score standardization method to process data; wherein, represents the mean value; represents the variance; is the standardized data, is the original data to be processed.
[0042] S15), data set division, dividing the preprocessed data set in time sequence into training set, validation set and test set in the ratio of 6:2:2, and using sliding window to construct samples.
[0043] A static and dynamic graph structure construction module is used to construct static and dynamic graph structures to represent the stable and changing spatial dependence relationship between monitoring stations. The static graph structure is represented as wherein, is a set of monitoring stations, represents a set of station connection edges in the static graph structure; a static adjacency matrix; as shown in the figure, it specifically comprises the following steps: Figure 3 S211), first, the latitude and longitude coordinates of each monitoring station are used to calculate the geographical distance between any two stations by Haversine method to form a distance matrix D; wherein, the geographical distance between station and station is represented as: ; ; wherein, is the radius of the earth; and are the difference values of latitude and longitude respectively; , are the latitude and longitude coordinates of station respectively; , are the latitude and longitude coordinates of station respectively.
[0044] S212)、Based on the Gaussian plume model, the distance matrix is converted into the original space similarity matrix using the Gaussian kernel function ; where the scale parameter corresponds to the diffusion parameter in physics, and its value is adaptively calculated using the standard deviation of the distance data.
[0045] S213)、The space similarity matrix is sparsified by setting a threshold, filtering weak connections, and retaining strong connections to obtain the final static adjacency matrix , that is: where is the set threshold; represents the i-th row and the j-th column. i j In this embodiment, the dynamic graph structure is represented as , where
[0046] represents the set of site connection edges in the dynamic graph structure; represents the dynamic adjacency matrix; as shown in the figure, it specifically includes the following steps: S221)、The input air quality data is subjected to fast Fourier transform to extract its frequency domain amplitude characteristics and normalize along the site dimension; Figure 4 S222)、The frequency domain characteristics are embedded to obtain , which is spliced and fused with the spatial node embedding and the multi-dimensional time embedding containing hour, week, month, and season information to generate a unified dynamic feature representation . where is the learnable weight matrix of embedding fusion. S223)、Based on the dynamic feature representation , the dynamic correlation between sites is calculated through bilinear transformation and a nonlinear activation function , and the most relevant
[0047] neighbors are retained for each site to generate a dynamic adjacency matrix . k
[0048] wherein, is the saturation rate of the activation function; represents a linear rectifier function; represents a hyperbolic tangent activation function; represents a learnable weight matrix; represents all the relevance scores of the first site; takes the site index corresponding to the first maximum value; represents a transpose.
[0049] The air quality prediction module is configured to predict air quality by using a pre-trained multi-scale dual-flow spatio-temporal graph neural network prediction model; the multi-scale dual-flow spatio-temporal graph neural network prediction model comprises a gated multi-scale time convolution module, a static and dynamic dual-flow spatial graph convolution module, and an adaptive fusion module based on a gating mechanism.
[0050] As shown in FIG. Figure 2 , the embodiment extracts multi-scale time features through a gated multi-scale time convolution module GMTC; the gated multi-scale time convolution module uses multiple 1D convolution kernels of different sizes to perform convolution along the time axis simultaneously through a parallel multi-branch structure, so as to capture time patterns of different scales; the output of the multi-scale convolution is input into a gating unit, and two parallel activation function paths of tanh and sigmoid are used to generate data streams and gating signals , which are multiplied element by element, so as to realize dynamic screening and adjustment of time information, that is, ; ; wherein, represents a convolution operation, represents the size of a convolution kernel, represents the input of multi-scale convolution; represents the output of multi-scale convolution; represents a hyperbolic tangent activation function; represents an activation function; represents an element-wise product; represents a data stream; represents a gating signal; represents the output of the GMTC module.
[0051] In this embodiment, the static and dynamic dual-stream spatial graph convolution module (DGC) processes static and dynamic spatial information in parallel, and further processes the output obtained from the gated multi-scale temporal convolution module (GMTC). The static and dynamic dual-stream spatial graph convolution module DGC described above uses static graph convolution on a static adjacency matrix. Performing standard graph convolutional network operations yields a static graph convolutional stream output. This is to extract stable spatial features determined by geographical location; that is: In the formula, This represents the output of the GMTC module, which is used as the input to the static graph convolutional stream; Indicates the first The node features of each static graph convolutional layer are used as the output of the last layer as the output of the static graph convolutional stream. .
[0052] The static and dynamic dual-stream spatial graph convolution module DGC employs dynamic hybrid jump graph convolution combined with a self-looping and normalized dynamic adjacency matrix. and its transpose Hybrid hop graph convolutions are performed on both paths; this operation not only aggregates neighbor information but also models the directional propagation of pollutants inflow and outflow more precisely by preserving some original features and mixing multi-hop information; the outputs of the two paths are summed to obtain the final output of the dynamic hybrid hop graph convolutional stream. ;Right now: in, Indicates the contribution rate of the original features; This represents the output of the GMTC module, which is used as the input to the dynamically mixed jump graph convolutional stream; Indicates the first Node features of a hybrid jump graph convolutional layer; Indicates the first The learnable weight matrix of a hybrid jump graph convolutional layer; This represents the output of the hybrid jump graph convolution; This represents a hybrid jump graph convolution operation; the sum of the inflow and outflow paths is used as the final output of the dynamic hybrid jump graph convolutional stream. .
[0053] In this embodiment, the multi-scale dual-stream spatiotemporal graph neural network prediction model further includes an adaptive fusion module based on a gating mechanism, used to merge the outputs of the static graph convolutional stream. and the output of the dynamic hybrid skip graph convolution stream The adaptive fusion module based on the gating mechanism learns a dynamic weight Z, and automatically weighs the contribution degrees of static and dynamic spatial information at each spatiotemporal point according to the spatiotemporal features of the input data, that is, ; ; ; wherein, represents a multi-layer perception; represents an adaptive dynamic weight; represents a sigmoid activation function; , respectively represent the learnable weight matrix of the output of the static graph convolution stream and the output of the dynamic hybrid skip graph convolution stream ; represents a learnable bias; represents a preliminary fusion output; represents the final output of the adaptive fusion module; represents an element-wise product.
[0054] The output of multiple spatiotemporal processing layers of the multi-scale dual-flow spatiotemporal graph neural network prediction model is added through a skip connection to combine spatiotemporal feature information at different levels, and finally a two-layer convolution layer is used to generate a final air quality prediction result.
[0055] The multi-scale dual-flow spatiotemporal graph neural network prediction model is trained in this embodiment, and the specific steps include the following steps: S31), input the air quality data training set processed in step S1) into the multi-scale dual-flow spatiotemporal graph neural network prediction model for training, perform parameter optimization, adjust hyperparameters on the validation set, and save the optimal parameters of the model; S32), test the trained multi-scale dual-flow spatiotemporal graph neural network prediction model on the test set, use multiple evaluation indexes to evaluate its prediction performance and generalization ability, and verify its effectiveness and stability in complex spatiotemporal environments.
[0056] Embodiment 3 This embodiment provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the air quality prediction method of embodiment 1 when executing the program.
[0057] In this embodiment, the memory can be implemented by any type of volatile or nonvolatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable read only memory (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk. The processor, coupled with the memory, is used to execute the computer program in the memory.
[0058] The computer program includes computer program code, which can be in the form of source code, object code, executable code, or some intermediate form.
[0059] The above embodiments and descriptions are only to illustrate the principles and the best mode of the present application, and various changes and improvements can be made to the present application without departing from the spirit and scope of the present application, and all these changes and improvements fall within the scope of the present application.
Claims
1. An air quality prediction method based on a multi-scale dual-stream spatiotemporal graph neural network, characterized in that, Includes the following steps: S1) Acquire air quality data from multiple monitoring stations, perform data preprocessing, and construct network input; S2) Construct static and dynamic graph structures to characterize the stable and changing spatial dependencies between monitoring stations; S3) Construct a multi-scale dual-stream spatiotemporal graph neural network prediction model including a gated multi-scale temporal convolution module and a static and dynamic dual-stream spatial graph convolution module; and train the multi-scale dual-stream spatiotemporal graph neural network prediction model; S4) Use a trained multi-scale dual-flow spatiotemporal neural network prediction model to predict air quality.
2. The air quality prediction method based on a multi-scale dual-stream spatiotemporal graph neural network according to claim 1, characterized in that: In step S2), the constructed static graph structure is as follows: ,in, For monitoring site collection, This represents the set of edges connecting stations in a static graph structure. Static adjacency matrix; specifically includes the following steps: S211) First, utilize each monitoring station The latitude and longitude coordinates are used to calculate the geographical distance between any two stations using the Haversine method, forming a distance matrix D; S212) Then, based on the Gaussian plume model, the distance matrix D is converted into the original spatial similarity matrix using the Gaussian kernel function. Finally, a threshold is set on the spatial similarity matrix to perform sparsification, filtering out weak connections and retaining strong connections, resulting in the final static adjacency matrix. .
3. The air quality prediction method based on a multi-scale dual-stream spatiotemporal graph neural network according to claim 2, characterized in that: In step S211), the site and sites Geographical distance between Represented as: ; ; in, The radius of the Earth; and These are the differences between latitude and longitude, respectively. , Sites The latitude and longitude coordinates; , Sites Latitude and longitude coordinates.
4. The air quality prediction method based on a multi-scale dual-stream spatiotemporal graph neural network according to claim 2, characterized in that: In step S2), the constructed dynamic graph structure is as follows: ,in, Representing a dynamic adjacency matrix; specifically including the following steps: S221) Input air quality data Perform a fast Fourier transform to extract its frequency domain amplitude features and normalize them along the station dimension; S222), frequency domain characteristics By splicing and fusing spatial node embeddings and multi-dimensional temporal embeddings containing hourly, weekly, monthly, and seasonal information, a unified dynamic feature representation is generated. ; S223), based on dynamic feature representation The dynamic correlation between sites is calculated using bilinear transformation and nonlinear activation function, and the most relevant site is retained for each site. k 10 neighbors, generate a dynamic adjacency matrix. .
5. The air quality prediction method based on a multi-scale dual-stream spatiotemporal graph neural network according to claim 1, characterized in that: In step S3), multi-scale temporal features are extracted using the gated multi-scale temporal convolution module (GMTC). Specifically, the GMTC uses a parallel multi-branch structure to perform convolutions simultaneously along the time axis using multiple 1D convolution kernels of different sizes. The output of the multi-scale convolution is then input into the gated unit, and a data stream is generated through two parallel activation function paths: tanh and sigmoid. F and gating signals G The two are multiplied element by element to achieve dynamic filtering and adjustment of time information.
6. The air quality prediction method based on a multi-scale dual-stream spatiotemporal graph neural network according to claim 5, characterized in that: The formula for extracting multi-scale temporal features using the gated multi-scale temporal convolution module GMTC is as follows: ; ; in, This represents the convolution operation. Indicates the size of the convolution kernel. This represents the input to a multi-scale convolution; This represents the output of a multi-scale convolution; Represents the hyperbolic tangent activation function; express Activation function; Represents element-wise product; Indicates a data stream; Indicates a gating signal; This indicates the output of the GMTC module.
7. The air quality prediction method based on a multi-scale dual-stream spatiotemporal graph neural network according to claim 6, characterized in that: In step S3), the static and dynamic dual-stream spatial graph convolution module DGC processes static and dynamic spatial information in parallel, and further processes the output obtained from the gated multi-scale temporal convolution module GMTC, specifically as follows: The static and dynamic dual-stream spatial graph convolution module DGC uses static graph convolution on a static adjacency matrix. Performing standard graph convolutional network operations yields a static graph convolutional stream output. To extract stable spatial features determined by geographical location; The static and dynamic dual-stream spatial graph convolution module DGC employs dynamic hybrid jump graph convolution combined with a self-looping and normalized dynamic adjacency matrix. and its transpose Perform hybrid jump graph convolution on each of the above; The outputs of the two paths are summed to obtain the final output of the dynamically hybrid jump graph convolutional flow. .
8. The air quality prediction method based on a multi-scale dual-stream spatiotemporal graph neural network according to claim 7, characterized in that: In step S3), the multi-scale dual-stream spatiotemporal graph neural network prediction model further includes an adaptive fusion module based on a gating mechanism. This adaptive fusion module is used to merge the outputs of the static graph convolutional streams. Output of dynamic hybrid jump graph convolutional stream The adaptive fusion module based on the gating mechanism learns a dynamic weight Z and automatically weighs the contribution of static and dynamic spatial information at each spatiotemporal point according to the spatiotemporal characteristics of the input data.
9. An air quality prediction system based on a multi-scale dual-stream spatiotemporal graph neural network, characterized in that, The system uses the method described in any one of claims 1-8 to predict air quality, and the system comprises: The data acquisition module acquires air quality data from multiple monitoring stations and performs data preprocessing. The static and dynamic graph structure construction module is used to construct static and dynamic graph structures to characterize the stable and changing spatial dependencies between monitoring stations. The air quality prediction module is used to predict air quality using a pre-trained multi-scale dual-stream spatiotemporal graph neural network prediction model. The multi-scale dual-stream spatiotemporal graph neural network prediction model includes a gated multi-scale temporal convolution module, a static and dynamic dual-stream spatial graph convolution module, and an adaptive fusion module based on a gating mechanism.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, it implements the air quality prediction method as described in any one of claims 1-8.