Ozone concentration prediction method and device based on spatio-temporal graph convolution network model, equipment and medium
By using a spatiotemporal graph convolutional network model, combined with network structures such as GCN, GAT, TCN, and RNN, the problem of insufficient capture of spatiotemporal dependencies in ozone concentration prediction by traditional methods is solved, and high-precision ozone concentration prediction is achieved.
Patent Information
- Application Number
- CN202411734987.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2044-11-29
AI Technical Summary
Traditional machine learning methods struggle to effectively capture complex spatiotemporal dependencies in ozone concentration prediction, resulting in limited prediction accuracy.
A spatiotemporal graph convolutional network model is adopted, which extracts spatial dependencies through GCN and GAT, and extracts temporal dependencies by combining TCN or RNN. The model is trained using the MSE loss function and Adam optimizer to predict future ozone concentrations.
It significantly improves the accuracy and generalization performance of ozone concentration prediction, better captures spatiotemporal dependencies, reduces information loss, and improves prediction accuracy.
Smart Images

Figure CN119578648B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of ozone concentration prediction, and in particular to an ozone concentration prediction method and device based on a spatio-temporal graph convolution network model, equipment and a medium. BACKGROUND
[0002] Ozone (O3) is one of the important components in the earth's atmosphere, which is divided into tropospheric ozone and stratospheric ozone. Tropospheric ozone is a major component of air pollution, which has important influence on human health and ecological environment. The change of ozone concentration is influenced by many factors, including meteorological conditions, pollutant emissions and chemical reactions. Accurate prediction of the change of ozone concentration is of great significance for air pollution prevention and public health protection.
[0003] In recent years, with the development of machine learning and deep learning technologies, more and more researchers have begun to apply these technologies to the field of environmental science, especially air pollution prediction. However, traditional machine learning methods have limitations in dealing with complex spatio-temporal data. For example, although traditional methods such as linear regression, support vector machine and random forest can achieve ozone concentration prediction to some extent, they are mainly based on statistical features and simple nonlinear mapping, and cannot effectively capture the complex spatio-temporal dependence of ozone concentration. These methods perform poorly when dealing with high-dimensional, nonlinear and time-varying features and large amounts of data, resulting in limited prediction accuracy.
[0004] The information disclosed in this BACKGROUND section is only intended to enhance the understanding of the general background of the application and should not be taken as an acknowledgment or any form of suggestion that this information forms prior art in the field. SUMMARY
[0005] The present application provides an ozone concentration prediction method and device based on a spatio-temporal graph convolution network model, effectively solving the problems in the background art.
[0006] In order to achieve the above purpose, the technical solution adopted by the present application is as follows: an ozone concentration prediction method based on a spatio-temporal graph convolution network model, comprising the following steps:
[0007] S10: obtaining historical ozone concentration data and corresponding meteorological data of a target area, standardizing and preprocessing the historical ozone concentration data and the meteorological data, and constructing training samples and prediction samples based on a sliding window method;
[0008] S20: establishing a spatial graph structure based on the geographical positions of each monitoring point in the training samples and the correlation coefficients therebetween, wherein the nodes in the spatial graph structure represent the monitoring points, and the edges represent the spatial correlation between the monitoring points, and an edge is established when the correlation coefficient between the monitoring points exceeds a preset threshold value;
[0009] S30: performing convolution operation on the spatial graph structure by using GCN and GAT, extracting spatial dependence between monitoring points, and obtaining time series data containing spatial features;
[0010] S40: based on the time series data containing spatial features, extracting time dependence features in the time series data by using a TCN or RNN model, and obtaining comprehensive representation containing spatio-temporal features;
[0011] S50: training the spatio-temporal graph convolution network model by using the training sample and the comprehensive representation containing spatio-temporal features, using MSE as a loss function in the training process, using Adam optimizer to adjust model parameters, and adjusting hyperparameter configuration according to the validation set performance to minimize prediction error;
[0012] S60: based on the trained spatio-temporal graph convolution network model, inputting the latest meteorological data of the target area and the historical ozone concentration data generated by the sliding window, and outputting the future ozone concentration prediction value of the area.
[0013] Further, in step S10, the historical ozone concentration data and the meteorological data are standardized and preprocessed, and the step includes:
[0014] S11: obtaining and organizing historical monitoring data in multiple data files, the data files are stored in a designated folder as a data source, wherein the historical ozone concentration data and the meteorological data contain relevant information in different time periods;
[0015] S12: based on the data source, loading all data files, extracting and cleaning the required historical ozone concentration data and meteorological data, filling missing values, detecting and correcting outliers of the loaded data, and standardizing and preprocessing the data to ensure that input data of different dimensions are within the same dimension range;
[0016] S13: merging the preprocessed data into a complete time series data set in a time-aligned manner, the data set contains historical ozone concentration data and corresponding meteorological data, and ensures the consistency of data timestamps for subsequent model training.
[0017] Further, in step S20, based on the geographical positions of each monitoring point in the training sample and the correlation coefficients therebetween, a spatial graph structure is established, wherein the nodes in the spatial graph structure represent monitoring points, and the edges represent the spatial correlation between monitoring points. When the correlation coefficient between monitoring points exceeds a preset threshold, an edge connection is established, and the step includes:
[0018] S21: Determine the geographical range of the target area according to the periodic variation characteristics of historical ozone concentration, and extract the ozone concentration data in the target area;
[0019] S22: Based on the extracted ozone concentration data in the target area, each latitude and longitude grid point in the target area is regarded as a node in a graph structure, which represents the ozone concentration value at a specific location and includes additional node features, including historical ozone concentration data and meteorological data at the corresponding location;
[0020] S23: Based on the historical concentration data and meteorological data, the correlation coefficient between each node is calculated, the correlation coefficient adopts Pearson correlation coefficient as the measurement standard, and is calculated based on the data in the historical time window corresponding to the node, and the length of the time window is determined according to the periodic variation characteristics of ozone concentration;
[0021] S24: According to the correlation coefficient and the preset correlation coefficient threshold value, when the correlation coefficient between two nodes exceeds the threshold value, an edge connection is established between the two nodes, and the threshold value is selected by historical data analysis or cross validation optimization, so as to construct a graph structure reflecting spatial correlation;
[0022] S25: Based on the graph structure, a graph data object is created, which includes a node feature matrix and an index of edges, wherein the node feature matrix contains historical ozone concentration data and meteorological data features, and the index of edges is used to represent the spatial connection relationship between nodes, which is used for subsequent graph neural network model training and prediction.
[0023] Further, in step S30, GCN and GAT are used to perform convolution operation on the spatial graph structure to extract the spatial dependence relationship between monitoring points, and time series data containing spatial features is obtained, wherein:
[0024] The calculation model of the GCN includes:
[0025] H (l+1) =σ(AH (l) W (l) );
[0026] In the formula, σ is an activation function, H (l) is the node feature representation of the lth layer, A is the adjacency matrix of the graph, and W (l) is the weight matrix of the lth layer;
[0027] The calculation model of the GAT includes:
[0028] H i (l+1) =σ(∑ j∈N(i) a ij Hj (l) W (l) );
[0029] wherein, N(i) is the neighbor node set of node i, a ij is the attention weight between node i and node j, H j (l) is the feature representation of node j in the l-th layer.
[0030] Further, in step S40, based on the time series data containing spatial features, a TCN or RNN model is used to extract time-dependent features in the time series data, to obtain a comprehensive representation containing spatio-temporal features, wherein:
[0031] When a TCN model is used, long-range dependencies in the time series are captured through multi-layer convolution operations, and the convolution operation of the TCN is represented as:
[0032] Y = Conv1D(X, K, d);
[0033] wherein, X is the input feature matrix, K is the convolution kernel size, and d is the dilation coefficient;
[0034] Or, when an RNN model is used, time features are further extracted through LSTM or GRU, and the update model of the RNN is:
[0035] h t = RNN(X t , h t-1 );
[0036] wherein, X t is the node feature representation at time step t, h t is the hidden state of the RNN, and h t-1 is the hidden state at the previous time step t-1.
[0037] Further, in step S50, the spatio-temporal graph convolution network model is trained using the training samples and the comprehensive representation containing spatio-temporal features, and the training process includes:
[0038] S51: According to the deviation between the predicted value and the actual value, the MSE is used as the loss function to measure the deviation between the predicted value and the actual value, and the calculation model of the MSE includes:
[0039]
[0040] wherein, y i is the actual value, is the predicted value, and N is the number of samples;
[0041] S52: Adjust the model parameters using the Adam optimizer based on the calculation results of the loss function, accelerate the optimization process through adaptive learning rate, and ensure that the model converges quickly during training;
[0042] S53: Dynamically adjust the hyperparameter configuration of the model, including learning rate, regularization parameter and network depth, based on the optimized model parameters and the training performance of the validation set, to minimize the prediction error and avoid overfitting or underfitting.
[0043] Further, in step S60, based on the trained spatio-temporal graph convolution network model, input the latest meteorological data of the target area and the historical ozone concentration data generated by the sliding window, and output the future ozone concentration prediction value of the area, the step includes:
[0044] S61: Based on the trained spatio-temporal graph convolution network model, input the latest meteorological data of the target area and the historical ozone concentration data generated by the sliding window as input, and construct the input feature matrix of the model;
[0045] S62: According to the input data of the target area, through the calculation of the spatio-temporal graph convolution network model, output the future ozone concentration prediction value of the target area, for short-term and long-term air quality monitoring and early warning;
[0046] S63: Based on the ozone concentration prediction value, relevant departments can take corresponding prevention and control measures in advance to reduce the harm of ozone pollution to public health and ecological environment.
[0047] The present application also includes an ozone concentration prediction device based on a spatio-temporal graph convolution network model, which uses the method as described above, including:
[0048] A data acquisition unit is configured to acquire historical ozone concentration data and corresponding meteorological data of a target area, standardize and preprocess the historical ozone concentration data and the meteorological data, and construct training samples and prediction samples based on a sliding window method;
[0049] A spatial graph structure construction unit is configured to establish a spatial graph structure based on the geographical positions of each monitoring point in the training samples and the correlation coefficients therebetween, wherein the nodes in the spatial graph structure represent the monitoring points, and the edges represent the spatial correlation between the monitoring points, and an edge is connected when the correlation coefficient between the monitoring points exceeds a predetermined threshold;
[0050] A spatial feature extraction unit is configured to perform convolution operation on the spatial graph structure using GCN and GAT, extract the spatial dependency relationship between the monitoring points, and obtain time series data containing spatial features;
[0051] The time feature extraction unit is configured to extract time-dependent features in the time series data based on the time series data containing spatial features by using a TCN or RNN model, and obtain a comprehensive representation containing spatio-temporal features.
[0052] The model training unit is configured to train the spatio-temporal graph convolution network model by using the training samples and the comprehensive representation containing spatio-temporal features, use MSE as a loss function in the training process, use an Adam optimizer to adjust model parameters, and adjust hyperparameter configurations according to the performance of a verification set to minimize prediction errors.
[0053] The prediction output unit is configured to input the latest meteorological data of a target region and the historical ozone concentration data generated by a sliding window into the trained spatio-temporal graph convolution network model, and output a prediction value of future ozone concentration in the region.
[0054] The application also includes a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method as described above when executing the computer program.
[0055] The application also includes a storage medium having a computer program stored thereon, wherein the computer program is executable on a processor to implement the method as described above.
[0056] The application has the following beneficial effects:
[0057] The time and space information are fused into a unified framework, fully combining the spatial feature extraction capability of a graph neural network (GCN, GAT) and the time feature extraction capability of a recurrent neural network (LSTM, GRU), a time convolution network (TCN), and other models. This comprehensive method can better capture the spatio-temporal dependence of ozone concentration, thereby significantly improving the prediction accuracy. Traditional prediction methods are often limited to a single type of neural network structure, while the application fuses multiple network structures such as GCN, GAT, LSTM, GRU, and TCN to achieve efficient processing of complex spatio-temporal data. The benefits of integrating time and space information into a model include integrated feature learning, which enables the model to more comprehensively understand data features, thereby improving the feature representation capability. In addition, by comprehensively processing time and space information, it is helpful to capture the complex relationship between spatio-temporal structures, improve the representation capability and generalization performance of the model, and at the same time, this comprehensive method can also reduce information loss, improve the understanding of data correlation by the model, and thus improve the prediction accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0058] In order to make the technical solutions in the embodiments of the present application or the prior art clearer, the accompanying drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the accompanying drawings in the description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort.
[0059] Figure 1 Flowchart of the ozone concentration prediction method based on the spatio-temporal graph convolution network model;
[0060] Figure 2 Flowchart of the ozone concentration prediction method based on the spatio-temporal graph convolution network model;
[0061] Figure 3 Spatio-temporal graph convolution network architecture based on RNN and GNN;
[0062] Figure 4 Spatio-temporal graph convolution network architecture based on TCN and GNN;
[0063] Figure 5 Structural schematic diagram of the ozone concentration prediction device based on the spatio-temporal graph convolution network model;
[0064] Figure 6 Structural schematic diagram of the computer device. DETAILED DESCRIPTION
[0065] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments.
[0066] As shown in Figure 1 , 2 : an ozone concentration prediction method based on a spatio-temporal graph convolution network model, comprising the following steps:
[0067] S10: obtaining historical ozone concentration data and corresponding meteorological data of a target area, performing standardization preprocessing on the historical ozone concentration data and the meteorological data, and constructing training samples and prediction samples based on a sliding window method;
[0068] In the data preprocessing stage, the ozone concentration data files are loaded from the specified folder, and the xarray library is used to read and merge these data files. The longitude and latitude range of the East China region is selected, and the ozone concentration data of this region is extracted. In order to better utilize the spatio-temporal characteristics of the data, we use the sliding window method to construct features and labels. Specifically, for each time point, we select the data of the previous N days as the feature, and the current time point ozone concentration as the label. Through standardization processing, the data is converted into a form suitable for model training.
[0069] S20: Based on the geographical location of each monitoring point in the training sample and the correlation coefficient between them, a spatial graph structure is established. In the spatial graph structure, the node represents the monitoring point, and the edge represents the spatial correlation between the monitoring points. When the correlation coefficient between the monitoring points exceeds the preset threshold, an edge connection is established.
[0070] In the graph structure construction stage, the longitude and latitude grid points of the East China region are regarded as the nodes of the graph, and the spatial correlation between the nodes is used to construct the edges of the graph. Specifically, we calculate the correlation coefficient between the features of each node. If the correlation coefficient exceeds the set threshold, an edge is established between the two nodes. In this way, we obtain a graph structure that reflects the spatial correlation. Assuming that the number of nodes of the graph is N, the edge set is E, and the node feature matrix is X, the graph can be represented as G=(V,E), where V is the node set and E is the edge set.
[0071] S30: GCN (graph convolutional network) and GAT (graph attention network) are used to perform convolution operation on the spatial graph structure to extract the spatial dependence relationship between the monitoring points and obtain time series data containing spatial features.
[0072] S40: Based on the time series data containing spatial features, TCN (temporal convolutional network) or RNN (recurrent neural network) model is used to extract the temporal dependence features in the time series data to obtain a comprehensive representation containing spatio-temporal features.
[0073] S50: The training sample and the comprehensive representation containing spatio-temporal features are used to train the spatio-temporal graph convolutional network model. The MSE (mean square error) is used as the loss function in the training process, and the Adam optimizer is used to adjust the model parameters. The hyperparameter configuration is adjusted according to the validation set performance to minimize the prediction error.
[0074] S60: Based on the trained spatio-temporal graph convolutional network model, the latest meteorological data of the target region and the historical ozone concentration data generated by the sliding window are input, and the future ozone concentration prediction value of the region is output.
[0075] A spatio-temporal graph convolutional network (STGCN) combining a graph neural network (GNN), a recurrent neural network (RNN) and a temporal convolutional network (TCN) is proposed. The graph neural network can effectively process data with a graph structure, capture the relationship between nodes through graph convolution operations, and extract spatial features. The recurrent neural network, especially the long short-term memory (LSTM) and the gated recurrent unit (GRU), performs well in processing time series data. By introducing a memory unit and a gating mechanism, the gradient vanishing and gradient explosion problems in long sequence data processing can be effectively solved. The temporal convolutional network can process time series data in parallel through convolution operations, and has high computational efficiency.
[0076] The innovative ozone concentration prediction method effectively captures the spatio-temporal features of ozone concentration changes by constructing a spatio-temporal graph convolutional network model, improving the prediction accuracy and generalization ability. Furthermore, in this method, the spatial and temporal dimensions are integrated into the same model, bringing multiple advantages: first, comprehensive feature learning enables the model to better understand the data features; second, information interaction helps to capture the relationship between spatial structure and temporal dynamics, while reducing information loss and improving prediction accuracy. This comprehensive processing method simplifies the model architecture, improves the generalization ability, and makes it more suitable for processing complex spatio-temporal data such as meteorological and traffic data, increasing the potential and possibility of spatio-temporal data analysis.
[0077] The model architecture of the invention processes spatial features including multiple layers of GCN (graph convolutional network) and GAT (graph attention network). These network layers extract spatial features. Each layer of the graph convolutional network aggregates node features with features of neighboring nodes to obtain new node feature representations. Through multiple layers of graph convolution operations, deeper spatial features can be captured. To process time series features, the invention proposes two methods: one combines RNN (recurrent neural network), and the other combines TCN (temporal convolutional network). RNN includes two variants of LSTM and GRU. These networks can effectively capture long-range dependencies in time series data. TCN can process time series data in parallel through multiple layers of dilated convolution and residual connection, with high computational efficiency.
[0078] Finally, the model maps the extracted spatio-temporal features to the predicted ozone concentration through a linear layer. Through repeated model training and validation, the model parameters are continuously optimized to improve the accuracy and stability of the prediction.
[0079] The model presented in the application integrates time and space information into a unified framework, fully combining the spatial feature extraction capabilities of graph neural networks (GCN, GAT) and the temporal feature extraction capabilities of recurrent neural networks (LSTM, GRU), TCN (temporal convolution network) and other models. This comprehensive approach can better capture the spatio-temporal dependence of ozone concentration, thereby significantly improving the prediction accuracy. Traditional prediction methods are often limited to a single type of neural network structure, while the application integrates multiple network structures such as GCN, GAT, LSTM, GRU and TCN to achieve efficient processing of complex spatio-temporal data. The benefits of integrating time and space information into a model include integrated feature learning, allowing the model to more comprehensively understand data features and improve feature representation capabilities. In addition, by comprehensively processing time and space information, it helps to capture complex relationships between spatio-temporal structures, improving the model's representation capabilities and generalization performance. At the same time, this comprehensive approach can also reduce information loss and improve the model's understanding of data correlation, thereby improving prediction accuracy.
[0080] The method of the application is not only applicable to ozone concentration prediction, but also has wide applicability and can be extended to other environmental data prediction fields. Its flexibility and scalability make it a powerful tool for processing various complex spatio-temporal data. By fully utilizing graph structure and time series information, the method of the application can achieve efficient computation on large-scale data sets and provide accurate prediction results, providing more accurate decision support for air pollution prevention and control. By accurately predicting the trend of ozone concentration, relevant departments can take appropriate prevention and control measures in advance to reduce the harm of ozone pollution to public health and the ecological environment. In addition, this method can also be applied to the prediction of other air pollutants, and has wide application prospects and important social value.
[0081] As a preferred embodiment of the above, in step S10, the historical ozone concentration data and meteorological data are standardized and preprocessed, and the step includes:
[0082] S11: Obtain and organize historical monitoring data in multiple data files, the data files are stored in a designated folder as a data source, wherein the historical ozone concentration data and meteorological data contain relevant information in different time periods;
[0083] S12: Based on the data source, load all data files, extract and clean the required historical ozone concentration data and meteorological data, fill missing values, detect and correct outliers in the loaded data, and perform standardized preprocessing on the data so that the input data of different dimensions are within the same unit of measurement.
[0084] S13: Merge the preprocessed data into a complete time series dataset according to time alignment. The dataset contains historical ozone concentration data and corresponding meteorological data, and ensures the consistency of data timestamps for subsequent model training.
[0085] By loading and merging historical monitoring data stored in multiple files into a single complete dataset, the problem of missing or inconsistent data caused by file fragmentation can be eliminated, thereby improving data integrity and consistency.
[0086] In step S10, the window size of the sliding window method is dynamically adjusted based on the statistical characteristics of historical data. The selection of the window size is based on the periodicity and trend of ozone concentration changes in the target area to improve the representativeness of the training samples. Specifically, the size of the sliding window is determined, for example, by selecting data from the past 90 days as a time window. For each time point, the data from the previous N days are selected as features, and the ozone concentration at the current time point is used as a label. The features include statistical measures such as the mean, standard deviation, minimum, and maximum values of the data within the window. These statistical measures can describe the changes in the data within the time window and provide rich feature information for the model.
[0087] In this embodiment, in step S20, a spatial graph structure is established based on the geographical locations of each monitoring point in the training samples and their correlation coefficients. In the spatial graph structure, nodes represent monitoring points, and edges represent the spatial correlation between monitoring points. When the correlation coefficient between monitoring points exceeds a preset threshold, an edge connection is established. The steps include:
[0088] S21: Based on the periodic variation characteristics of historical ozone concentration, determine the geographical range of the target area and extract ozone concentration data within the target area; the target area is a geographical region with a set latitude and longitude range. Determine the geographical range of the target area (e.g., East China), that is, the latitude and longitude range of the region. Extract ozone concentration data within the region from the loaded dataset to focus on data analysis of a specific area, avoid processing unnecessary global data, and improve computational efficiency;
[0089] S22: Based on the extracted ozone concentration data in the target area, each latitude and longitude grid point in the target area is regarded as a node in the graph structure, the node represents the ozone concentration value at a specific location, and includes additional node features, including historical ozone concentration data and meteorological data at the corresponding location; such as meteorological data (temperature, humidity, wind speed, etc.); The extracted features are standardized to have a mean of 0 and a standard deviation of 1, which can eliminate the dimensional differences between different features and prevent some features from having an excessive impact on the results during model training, thereby improving the stability and prediction accuracy of the model.
[0090] Each latitude and longitude grid point in the target area is regarded as a node in the graph, and each node represents an ozone concentration value at a specific location. This method structures the spatial data into graph data, which facilitates processing using a graph neural network.
[0091] S23: Based on the historical concentration data and meteorological data, the correlation coefficient between nodes is calculated, the correlation coefficient uses Pearson correlation coefficient as a measurement standard, and is calculated based on the data in the historical time window corresponding to the node, and the length of the time window is determined according to the periodic variation characteristics of the ozone concentration.
[0092] S24: According to the correlation coefficient and the preset correlation coefficient threshold, when the correlation coefficient between two nodes exceeds the threshold, an edge connection is established between the two nodes, the threshold is selected by historical data analysis or cross-validation optimization, to construct a graph structure reflecting spatial correlation; Specifically, the correlation coefficient between each node feature is calculated, and according to the set threshold, if the correlation coefficient between two nodes exceeds the threshold, an edge is established between the two nodes to form an adjacency matrix of the graph, which can construct a graph structure reflecting spatial correlation, and ensure that nodes at similar locations are connected by edges.
[0093] S25: Based on the graph structure, a graph data object is created, which includes a node feature matrix and an index of edges, wherein the node feature matrix contains historical ozone concentration data and meteorological data features, and the index of edges is used to represent the spatial connection relationship between nodes, which is used for subsequent graph neural network model training and prediction.
[0094] By defining the latitude and longitude grid points in the target area as nodes and calculating the correlation between monitoring points based on the Pearson correlation coefficient, the spatial dependence relationship between monitoring points can be accurately captured, providing more accurate spatial feature representation for subsequent model training. The use of historical data analysis or cross-validation method to optimize the correlation coefficient threshold can ensure that the threshold adapts to the characteristics of different data sets and regions, improving the ability of the graph structure to depict spatial correlation. According to the periodic variation characteristics of ozone concentration, the length of the time window is reasonably set to ensure the scientificity of the correlation coefficient calculation and reflect the periodic dynamic of ozone concentration when capturing spatial features. By constructing a complete graph data object including node feature matrix and edge index, high-quality spatial features are input into the graph neural network model, providing a solid foundation for subsequent spatio-temporal feature extraction and prediction. By setting the correlation coefficient threshold, the connection between nodes with low spatial correlation is filtered out, significantly reducing the computational complexity while retaining key spatial dependence information.
[0095] In step S30, GCN (graph convolutional network) and GAT (graph attention network) are used to perform convolution operation on the spatial graph structure to extract the spatial dependence relationship between monitoring points and obtain time series data containing spatial features, wherein:
[0096] The calculation model of GCN (graph convolutional network) includes:
[0097] H (l+1) (l) W (l) );
[0098] In the formula, σ is the activation function, H (l) is the node feature representation of the lth layer, A is the adjacency matrix of the graph, and W (l) is the weight matrix of the lth layer.
[0099] The calculation model of GAT (graph attention network) includes:
[0100] H i (l+1) = σ(∑ j∈N(i) a ij H j (l) W (l) );
[0101] In the formula, N(i) is the neighbor node set of node i, a ij is the attention weight between node i and node j, H j (l) is the feature representation of node j in the lth layer.
[0102] The multi-layer graph convolutional network and the graph attention network layer are constructed to extract the spatial features of the nodes. The graph convolutional network performs convolution operation on the node features through an adjacency matrix and a weight matrix to capture the relationship between the node and its neighbor nodes. The graph attention network further introduces an attention mechanism to assign different weights to each neighbor node to enhance the representation ability of the node features.
[0103] The efficient neighbor aggregation feature of GCN and the adaptive attention mechanism of GAT can accurately capture the spatial dependence relationship between the monitoring points, improve the feature extraction ability and prediction performance of the model. By combining the advantages of both, the calculation efficiency of the model is improved, and the adaptability and interpretability of the heterogeneous spatial data are enhanced, providing reliable technical support for high-precision ozone concentration prediction.
[0104] In the model construction stage, we propose two spatio-temporal models combined with graph neural networks, namely the STGCN model of TCN+GNN and the STGCN model of RNN+GNN.
[0105] As a preferred embodiment of the above, in step S40, based on the time series data containing spatial features, a TCN (Temporal Convolutional Network) or RNN (Recurrent Neural Network) model is used to extract the temporal dependence features in the time series data, and a comprehensive representation containing spatio-temporal features is obtained.
[0106] When using the TCN (Temporal Convolutional Network) model, long-range dependencies in the time series are captured through multi-layer convolution operations, as shown in Figure 4 The spatio-temporal graph convolutional network architecture based on TCN and GNN is shown in FIG. 1, and the convolution operation of TCN is represented as:
[0107] Y = Conv1D (X, K, d);
[0108] where X is the input feature matrix, K is the convolution kernel size, and d is the dilation coefficient.
[0109] Alternatively, when using the RNN (Recurrent Neural Network) model, the time features are further extracted through LSTM (Long Short-Term Memory Network) or GRU (Gated Recurrent Unit), as shown in Figure 3 The spatio-temporal graph convolutional network architecture based on RNN and GNN is shown in FIG. 2, and the update model of RNN is represented as:
[0110] h t = RNN (X t , h t-1 );
[0111] where X t is the node feature representation at time step t, h t is the hidden state of RNN, and h t-1The hidden state of the previous time step t-1.
[0112] By adopting the TCN or RNN model to extract time-dependent features, a high-quality comprehensive representation containing spatio-temporal features is provided for subsequent prediction.
[0113] The hidden state will be mapped to the predicted ozone concentration value through a linear layer, forming a comprehensive representation containing spatio-temporal features, converting the high-dimensional feature space into the target prediction value, and ensuring that the model output can be directly used for practical applications.
[0114] TCN can efficiently capture long-range dependencies in time series by expanding the receptive field through dilated convolution, while RNN effectively preserves historical information through memory mechanisms such as LSTM and GRU, achieving accurate extraction of complex time-dependent features; provide two options of TCN and RNN, according to the task characteristics (such as calculation efficiency priority or long-range dependence priority) to flexibly choose the time feature extraction method, adapt to different scene needs, and improve the universality of the method.
[0115] Two methods are adopted: recurrent neural network (RNN) and time convolution network (TCN), recurrent neural network processes time series data through hidden state, suitable for capturing long-range time dependence, time convolution network processes time features through multiple layers of dilated convolution, with parallel computing ability and high efficiency, through the operation of these layers, dynamic features in time series are extracted.
[0116] As a preferred embodiment of the above, in step S50, during the model training and verification phase, we divide the data into training set and test set, adopt training samples and comprehensive representation containing spatio-temporal features to train the spatio-temporal graph convolution network model, the training process includes:
[0117] S51: According to the deviation between the predicted value and the actual value, use MSE (Mean Square Error) as the loss function to measure the deviation between the predicted value and the actual value, the calculation model of MSE includes:
[0118]
[0119] In the formula, y i is the actual value, is the predicted value, and N is the number of samples;
[0120] S52: According to the calculation result of the loss function, use Adam optimizer to adjust the model parameters, accelerate the optimization process through adaptive learning rate, and ensure that the model converges quickly during training;
[0121] S53: Based on the optimized model parameters and the training performance of the validation set, dynamically adjust the hyperparameter configuration of the model, including learning rate, regularization parameter and network depth, etc., to minimize the prediction error and avoid overfitting or underfitting phenomenon.
[0122] By introducing the Adam optimizer, the adaptive learning rate is used to dynamically adjust the parameter update amplitude, which significantly speeds up the convergence of the model and improves the training efficiency. Using MSE as the loss function can effectively quantify the error between the predicted value and the actual value, providing an accurate target direction for parameter optimization, thereby improving the prediction accuracy of the model. By dynamically adjusting the hyperparameter configuration (including learning rate, regularization parameter and network depth, etc.) based on the performance of the validation set, the overfitting and underfitting phenomenon is effectively reduced, and the generalization ability of the model is improved.
[0123] By adjusting the learning rate and the number of training rounds, we can find the optimal model parameters. During the training process, we adjust the hyperparameters of the model based on the performance of the validation set to prevent overfitting.
[0124] Through the above model training, we can get a spatiotemporal graph convolutional network model that can accurately predict ozone concentration. In practical applications, we input the latest ozone concentration data, and the model can predict future ozone concentration based on historical data and spatial correlation. Not only can it be used for ozone concentration prediction, but it can also be extended to other air pollutant prediction, such as PM2.5 concentration prediction, sulfur dioxide concentration prediction, etc.
[0125] Divide the dataset into training set and test set according to a certain proportion (90% training set, 10% test set).
[0126] Iteratively train the model, each iteration step includes forward propagation, loss calculation, back propagation and weight update. Through repeated iteration, the model parameters are gradually optimized, and the loss value is continuously reduced. The performance of the model is adjusted based on the performance of the validation set to prevent overfitting.
[0127] Evaluate the prediction performance of the model on the test set, calculate the mean square error (MSE), root mean square error (RMSE) and mean absolute error (MAE) and other indicators to comprehensively evaluate the accuracy and stability of the model.
[0128] Input the latest ozone concentration data, and the model predicts future ozone concentration based on historical data and spatial correlation. The prediction results can be used for short-term and long-term air quality monitoring and early warning.
[0129] In this embodiment, in step S60, based on the trained spatiotemporal graph convolutional network model, input the latest meteorological data of the target area and the historical ozone concentration data generated by the sliding window, output the future ozone concentration prediction value of the area, the steps include:
[0130] S61: Based on the trained spatio-temporal graph convolution network model, the latest meteorological data of the target area and the historical ozone concentration data generated by the sliding window are taken as inputs to construct the input feature matrix of the model;
[0131] S62: According to the input data of the target area, the future ozone concentration prediction value of the target area is output through the calculation of the spatio-temporal graph convolution network model, which is used for short-term and long-term air quality monitoring and early warning;
[0132] S63: Based on the ozone concentration prediction value, relevant departments can take corresponding prevention and control measures in advance, including but not limited to pollution source control, public health protection and emergency plan implementation, to reduce the harm of ozone pollution to public health and ecological environment. The prediction results can be used to develop environmental protection policies and emergency plans, and improve the scientificity and effectiveness of environmental management.
[0133] By using the trained spatio-temporal graph convolution network model, the latest meteorological data and historical ozone concentration data are taken as inputs, and the time and space features are considered comprehensively, which significantly improves the accuracy and reliability of the prediction results. By outputting the future ozone concentration prediction value, data support is provided for short-term pollution event early warning and long-term air quality management, which facilitates relevant departments to develop scientific environmental governance strategies. The prediction value is directly applied to monitoring, early warning and prevention and control measures, which significantly improves the practicality of the technical scheme and provides an operable tool for environmental management departments.
[0134] The present application also includes an ozone concentration prediction device based on a spatio-temporal graph convolution network model, which uses the method as described above, as shown in Figure 5 , comprising:
[0135] A data acquisition unit is configured to acquire historical ozone concentration data and corresponding meteorological data of a target area, standardize and preprocess the historical ozone concentration data and meteorological data, and construct training samples and prediction samples based on a sliding window method;
[0136] A spatial graph structure construction unit is configured to establish a spatial graph structure based on the geographical positions of each monitoring point in the training samples and the correlation coefficients therebetween, wherein the nodes in the spatial graph structure represent the monitoring points, and the edges represent the spatial correlation between the monitoring points, and an edge is connected when the correlation coefficient between the monitoring points exceeds a preset threshold;
[0137] A spatial feature extraction unit is configured to perform convolution operation on the spatial graph structure by using GCN (graph convolution network) and GAT (graph attention network) to extract the spatial dependency relationship between the monitoring points and obtain time series data containing spatial features;
[0138] The time feature extraction unit is configured to extract time-dependent features in the time series data based on the time series data containing spatial features by using a TCN (Time Convolution Network) or RNN (Recurrent Neural Network) model, and obtain a comprehensive representation containing spatio-temporal features.
[0139] The model training unit is configured to train the spatio-temporal graph convolution network model by using training samples and the comprehensive representation containing spatio-temporal features, use MSE (Mean Square Error) as a loss function in the training process, use an Adam optimizer to adjust model parameters, and adjust hyperparameter configurations according to the performance of a verification set to minimize prediction errors.
[0140] The prediction output unit is configured to input the latest meteorological data of a target region and historical ozone concentration data generated by a sliding window into the trained spatio-temporal graph convolution network model, and output a future ozone concentration prediction value of the region.
[0141] See Figure 6 The computer device 400 provided by the embodiment of the present application includes a processor 410 and a memory 420. The memory 420 stores a computer program executable by the processor 410. The computer program is executed by the processor 410 to perform the method as above.
[0142] The embodiment of the present application further provides a storage medium 430, which stores a computer program. The computer program is run by the processor 410 to perform the method as above.
[0143] The storage medium 430 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk or an optical disk.
[0144] In the description of the application, the terms "first", "second", "third", etc. are used only for the purpose of description, and cannot be understood as indicating or implying relative importance or implying the number of the technical features indicated. Therefore, the features defined as "first", "second", etc. can be explicitly or implicitly included one or more of the features. The meaning of "a plurality of" is two or more, unless otherwise explicitly specified and limited.
[0145] In the present application, unless otherwise explicitly specified and limited, the terms "mounting", "connecting", "connecting", "fixing" and the like should be understood in a broad sense, for example, it can be fixedly connected, or it can be detachably connected, or it can be integrated; it can be mechanically connected, or it can be electrically connected; it can be directly connected, or it can be indirectly connected through an intermediate medium; it can be the internal communication of two elements or the interaction relationship between two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0146] In the description of the present application, the description of the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In the present application, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in the present application and the features of the different embodiments or examples without contradiction.
[0147] Any process or method descriptions in flow charts or otherwise described herein represent embodiments of examples that can be implemented by executable instructions. The computer-readable media of the preferred embodiments of the present application include additional executable instructions to implement additional or alternative embodiments of the process or method. Alternatively, the computer-readable media of the preferred embodiments of the present application include additional or different executable instructions to implement combined processes or methods from the processes or methods described in flow charts or otherwise described herein.
[0148] The logic and / or steps represented in flow diagrams or otherwise described herein, for example, can be considered as a sequence of instructions to implement logic functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device, such as a computer-based system, processor- containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. In the context of this specification, a "computer-readable medium" can be any means that can contain, store, communicate, propagate or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer-readable medium can be a machine-readable storage device (a machine-readable storage article), a machine-readable storage medium, a machine-readable storage unit, a machine-readable storage means, a machine-readable storage mechanism, or a machine-readable storage medium. More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electronic connection having one or more wires (electronic devices), a portable computer diskette (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium can even be paper or another suitable medium on which the program can be printed, because the program can be electronically obtained, for example, by optically scanning the paper or other medium, then
[0149] It should be understood that parts of the present application can be implemented in hardware, software, firmware or a combination thereof. In the above embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, and as in another embodiment, it can be implemented using any or a combination of the following technologies, which are well-known in the art: discrete logic circuitry having logic gates for implementing logic functions on data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), etc.
[0150] Those skilled in the art of the present technology can understand that all or part of the steps carried out by the above-mentioned embodiments can be completed by programs instructing related hardware, and the programs can be stored in a computer-readable storage medium, and when executed, include one or a combination of steps of the method embodiments.
[0151] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it should be understood that the above-mentioned embodiments are exemplary and cannot be understood as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above-mentioned embodiments within the scope of the present application.
Claims
1. A method for predicting ozone concentration based on a spatiotemporal graph convolution network model, characterized in that, The method comprises the following steps: S10: obtaining historical ozone concentration data and corresponding meteorological data of a target area, performing standardization preprocessing on the historical ozone concentration data and the meteorological data, and constructing training samples and prediction samples based on a sliding window method; S20: establishing a spatial graph structure based on the geographical positions of each monitoring point in the training samples and the correlation coefficients therebetween, wherein a node in the spatial graph structure represents a monitoring point, and an edge represents the spatial correlation between monitoring points, and an edge is connected when the correlation coefficient between monitoring points exceeds a preset threshold; S30: performing convolution operation on the spatial graph structure by using GCN and GAT to extract the spatial dependence relationship between monitoring points, and obtaining time series data containing spatial features; The calculation model of the GCN comprises: ; wherein is an activation function, is the layer's node feature representation, is the graph's adjacency matrix, is the layer's weight matrix; The calculation model of the GAT comprises: ; wherein, is a set of neighbor nodes of the node , is an attention weight between the node and the node , is a feature representation of the node in the l-th layer, is a feature of the node i in the l+1-th layer in the computation of the GAT. S40: based on the time series data containing spatial features, using a TCN or RNN model to extract the time dependence features in the time series data, and obtaining a comprehensive representation containing spatio-temporal features; When the TCN model is used, long-range dependence in the time series is captured through multi-layer convolution operation, and the convolution operation of the TCN is represented as: ; In the formula, is an input feature matrix, is a convolution kernel size, is an expansion coefficient, and Y is a TCN convolution result; Or, when the RNN model is used, the time features are further extracted by LSTM or GRU, and the update model of the RNN is: ; wherein is the node feature representation at time step , is the hidden state of the RNN, is the hidden state at the previous time step . S50: training a spatio-temporal graph convolution network model using the training samples and the comprehensive representation containing spatio-temporal features, wherein the training process uses MSE as a loss function, uses an Adam optimizer to adjust model parameters, and adjusts hyperparameter configurations according to the performance of a validation set to minimize prediction errors; S60: based on the trained spatio-temporal graph convolution network model, inputting the latest meteorological data of the target area and the historical ozone concentration data generated by the sliding window, and outputting the future ozone concentration prediction value of the target area.
2. The method of claim 1, wherein the method comprises: In step S10, the historical ozone concentration data and the meteorological data are standardized and preprocessed, and the steps include: S11: obtaining and organizing historical monitoring data in multiple data files, wherein the data files are stored in a designated folder as a data source, and the historical ozone concentration data and the meteorological data contain relevant information in different time periods; S12: based on the data source, loading all data files, extracting and cleaning the required historical ozone concentration data and meteorological data, performing missing value filling, anomaly detection and correction on the loaded data, and performing standardization preprocessing on the data to ensure that input data of different dimensions are within the same dimension range; S13: merging the standardized and preprocessed data into a complete time series data set in a time-aligned manner, wherein the data set contains historical ozone concentration data and corresponding meteorological data, and ensures the consistency of data timestamps for subsequent model training. 3.The method of claim 1, wherein, In step S20, based on the geographical positions of each monitoring point in the training sample and the correlation coefficients therebetween, a spatial graph structure is established, in which nodes represent monitoring points and edges represent spatial correlations between monitoring points. When the correlation coefficient between monitoring points exceeds a preset threshold, an edge connection is established. The step includes: S21: According to the periodic variation characteristics of historical ozone concentration, the geographical range of the target area is determined, and the ozone concentration data in the target area is extracted; S22: Based on the extracted ozone concentration data in the target area, each latitude and longitude grid point in the target area is regarded as a node in the graph structure, which represents the ozone concentration value at a specific location and includes additional node features, including historical ozone concentration data and meteorological data at the corresponding location; S23: Based on the historical ozone concentration data and meteorological data, the correlation coefficients between nodes are calculated, the correlation coefficients adopt Pearson correlation coefficient as the measurement standard, and are calculated based on the data in the historical time window corresponding to the node, the length of the historical time window is determined according to the periodic variation characteristics of ozone concentration; S24: According to the correlation coefficient and the preset correlation coefficient threshold, when the correlation coefficient between two nodes exceeds the threshold, an edge connection is established between the two nodes, the threshold is selected by historical data analysis or cross-validation optimization, to construct a graph structure reflecting spatial correlation; S25: Based on the graph structure, a graph data object is created, which includes a node feature matrix and an index of edges, wherein the node feature matrix contains historical ozone concentration data and meteorological data features, and the index of edges is used to represent the spatial connection relationship between nodes, which is used for subsequent graph neural network model training and prediction.
4. The method of claim 1, wherein the method comprises: In step S50, the training sample and the comprehensive representation containing spatio-temporal features are used to train the spatio-temporal graph convolution network model, and the training process includes: S51: According to the deviation between the predicted value and the actual value, the MSE is used as the loss function to measure the deviation between the predicted value and the actual value, and the calculation model of the MSE includes: ; wherein is the actual value, is the predicted value, is the number of samples; S52: According to the calculation result of the loss function, the model parameters are adjusted using the Adam optimizer, the adaptive learning rate is used to accelerate the optimization process, and the model is ensured to converge quickly during the training process; S53: Based on the optimized model parameters and the training performance of the validation set, the hyperparameter configuration of the model is dynamically adjusted, including learning rate, regularization parameter and network depth, to minimize the prediction error and avoid overfitting or underfitting phenomenon. 5.The method of claim 1, wherein, In step S60, based on the trained spatio-temporal graph convolution network model, the latest meteorological data of the target area and the historical ozone concentration data generated by the sliding window are input, and the future ozone concentration prediction value of the area is output, and the step includes: S61: Based on the trained spatio-temporal graph convolution network model, the latest meteorological data of the target area and the historical ozone concentration data generated by the sliding window are input as input feature matrix of the model; S62: According to the input data of the target area, the ozone concentration prediction value of the target area in the future is output through the calculation of the spatio-temporal graph convolution network model, which is used for short-term and long-term air quality monitoring and early warning; S63: Based on the ozone concentration prediction value, the relevant departments can take corresponding prevention and control measures in advance to reduce the harm of ozone pollution to public health and ecological environment.
6. An ozone concentration prediction device based on a spatio-temporal graph convolution network model, characterized by, The method comprises the following steps: a data acquisition unit configured to acquire historical ozone concentration data and corresponding meteorological data of a target area, standardize and preprocess the historical ozone concentration data and the meteorological data, and construct training samples and prediction samples based on a sliding window method; a spatial graph structure construction unit configured to establish a spatial graph structure based on geographical positions of each monitoring point in the training samples and correlation coefficients between the monitoring points, wherein nodes in the spatial graph structure represent monitoring points, and edges represent spatial correlations between the monitoring points, and an edge is established when the correlation coefficient between the monitoring points exceeds a preset threshold value; a spatial feature extraction unit configured to perform convolution operation on the spatial graph structure by using GCN and GAT, extract spatial dependency relationships between the monitoring points, and obtain time series data containing spatial features; a time feature extraction unit configured to extract time dependency features in the time series data containing spatial features by using a TCN or RNN model based on the time series data containing spatial features, and obtain comprehensive representation containing spatio-temporal features; a model training unit configured to train a spatio-temporal graph convolution network model by using the training samples and the comprehensive representation containing spatio-temporal features, wherein the training process uses MSE as a loss function, uses an Adam optimizer to adjust model parameters, and adjusts hyperparameter configurations according to the performance of a validation set to minimize prediction errors; a prediction output unit configured to input the latest meteorological data of the target area and the historical ozone concentration data generated by a sliding window into the trained spatio-temporal graph convolution network model, and output an ozone concentration prediction value of the target area in the future.
7. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the method of any one of claims 1-5.
8. A storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the method of any one of claims 1-5.
Citation Information
Patent Citations
Ozone concentration prediction method and system based on spatio-temporal data and statistical learning
CN107943928A
CNN-GRU ozone concentration prediction model building method fusing spatial and statistical characteristics, prediction method and model
CN114897250A