Rainfall prediction method based on dynamic graph convolutional network and dilated temporal convolution
By combining dynamic graph convolutional networks and dilated temporal convolutional networks, the problem of insufficient spatiotemporal dependency modeling in rainfall forecasting is solved, multi-scale temporal feature extraction and stable multi-step forecasting of meteorological data are achieved, and the accuracy and efficiency of rainfall forecasting are improved.
Patent Information
- Application Number
- CN202411939022.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-12-26
AI Technical Summary
Existing technologies lack the ability to model spatiotemporal dependencies in rainfall forecasting, the extraction of long-term dependency features of time series is limited, and the accumulation of multi-step forecast errors is serious, making it difficult to meet the real-time forecasting needs of sudden and complex precipitation in meteorological systems.
A method combining dynamic graph convolutional networks and dilated temporal convolutional networks is adopted to capture the dynamic spatial dependencies between meteorological stations by dynamically generating an adjacency matrix. Dilated convolution is used to extract multi-scale time-dependent features, and adaptive learning rate scheduling and gradient clipping strategies are combined for model training.
It achieves efficient and accurate multi-step rainfall prediction for meteorological data, improves the stability and convergence speed of the model, solves the problems of rigid spatial relationships and inefficient feature extraction due to long-term dependence, and provides flexible prediction capabilities.
Smart Images

Figure CN119862906B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of rainfall prediction, and in particular to a rainfall prediction method based on a dynamic graph convolutional network and dilated temporal convolution. Background Art
[0002] Accurate prediction models are crucial in meteorological forecasting tasks, especially rainfall forecasting tasks. Traditional physical modeling methods, such as numerical weather forecast models, are usually based on fluid dynamics and thermodynamics equations, using meteorological data as boundary conditions and initial conditions for iterative calculations. However, the accuracy of such models relies on a large amount of computing resources and it is difficult to effectively capture complex spatiotemporal dependencies in the short term. As a means of extreme weather warning, rainfall forecasting has strict requirements for the real-time prediction of sudden and localized precipitation phenomena, and traditional physical models often cannot meet this demand.
[0003] In recent years, deep learning-based spatiotemporal modeling methods have gained increasing attention in meteorological data processing and forecasting. Deep learning models, particularly convolutional neural networks and recurrent neural networks, have demonstrated remarkable performance in processing spatiotemporal series data. While typical time series forecasting models, such as long short-term memory networks and gated recurrent units, can capture temporal dependencies, they have significant limitations in modeling spatial dependencies. Furthermore, convolutional neural networks are primarily used for image data analysis and are unable to directly process the complex spatial dynamics found in meteorological data.
[0004] Most existing methods rely on fixed time windows to model time series. These window lengths are typically preset and difficult to flexibly adjust to accommodate dependencies at different time scales. Furthermore, recurrent networks, such as LSTMs, often encounter vanishing or exploding gradients when processing long-span data, resulting in insufficient ability to model long-range temporal dependencies. This limitation is particularly pronounced in meteorological systems, as variations in rainfall often involve the combined effects of both short-term and long-term factors. Summary of the Invention
[0005] In response to the shortcomings of the existing technology, the present invention provides a rainfall prediction method based on dynamic graph convolutional networks and dilated time series convolution, which solves the problems of insufficient spatiotemporal dependency modeling capabilities, limited long-term dependency feature extraction of time series, and serious accumulation of multi-step prediction errors in rainfall prediction technology.
[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions: a rainfall prediction method based on dynamic graph convolutional network and dilated temporal convolution, comprising the following steps;
[0007] S1. Data loading and preprocessing: Load and preprocess meteorological data to construct a three-dimensional data matrix containing multi-dimensional meteorological characteristics, time dimension and space dimension;
[0008] S2. Dynamic Graph Convolutional Network Construction: Modeling the spatial dynamic dependency of a three-dimensional data matrix through a dynamic graph convolutional network, wherein the dynamic graph convolutional network captures the dynamic spatial associations between different geographic nodes through a dynamically generated adjacency matrix;
[0009] S3. Construction of a dilated temporal convolutional network: Modeling the temporal dependency of spatially modeled data through a dilated temporal convolutional network. The dilated temporal convolutional network extracts multi-scale temporal dependency features through dilated convolution.
[0010] S4. Model training and verification: Model training is performed based on the spatiotemporal features jointly extracted by the dynamic graph convolutional network and the dilated temporal convolutional network;
[0011] S5. Model prediction and evaluation: Use the trained model to make multi-step rainfall predictions based on the input meteorological data.
[0012] Preferably, the step S1 specifically includes the following steps:
[0013] S1.1. Load various meteorological characteristics including rainfall, precipitation rate, water vapor content, temperature, humidity, wind speed, terrain height, cloud cover, etc. from the meteorological dataset;
[0014] S1.2. Perform temporal and spatial alignment on the loaded multi-dimensional meteorological characteristic data to construct a unified three-dimensional data matrix;
[0015] S1.3. Normalize the characteristic dimensions of the three-dimensional data matrix and adjust the numerical range of each meteorological characteristic to zero mean and unit variance;
[0016] S1.4. Generate input time window and prediction target window through sliding window method to form time series training samples and prediction targets.
[0017] Preferably, the step S2 specifically includes the following steps:
[0018] S2.1. Initialize an embedding vector for each geographic node and calculate the static adjacency matrix between nodes based on the embedding vector.
[0019] S2.2. Use the multi-head attention mechanism to dynamically adjust the adjacency matrix to capture the dynamic spatial associations between nodes in different time steps; S2.3. Perform convolution operations on node features based on the dynamic adjacency matrix to obtain the dynamic spatial features of geographic nodes.
[0020] Preferably, the multi-head attention mechanism specifically includes:
[0021] Mapping the geographic node embedding vector into a query vector, a key vector, and a value vector;
[0022] By calculating the weighted correlation between the query vector and the key vector, the dynamic correlation weight between nodes at each time step is obtained;
[0023] Generates a dynamic adjacency matrix based on dynamic relevance weights.
[0024] Preferably, the step S3 specifically includes the following steps:
[0025] S3.1. Perform convolution processing on time series data through dilated convolution, expand the temporal receptive field layer by layer, and capture the dependency features of different time scales;
[0026] S3.2, set different expansion rates to achieve multi-scale time-dependent modeling;
[0027] S3.3. Filter irrelevant information through the gating mechanism and retain important time series features.
[0028] Preferably, the dilated convolution sets the convolution kernel size and dilation rate in each layer, expands the temporal receptive field by increasing the dilation rate layer by layer, and extracts multi-scale temporal features within a fixed convolution kernel size range.
[0029] Preferably, the step S4 specifically includes the following steps:
[0030] S4.1. Use the time-windowed input data as training samples and use a combination of mean absolute error and Huber loss function to measure the prediction error.
[0031] S4.2. Dynamically adjust the learning rate during model training through adaptive learning rate scheduling;
[0032] S4.3. Use gradient clipping strategy to prevent gradient explosion during training.
[0033] Preferably, the gradient clipping limits the norm of the gradient to prevent excessive gradient updates, thereby improving the stability and convergence of the training process.
[0034] Preferably, the step S5 specifically includes the following steps:
[0035] S5.1. Generate rainfall prediction results for test data based on the trained dynamic graph convolutional network and dilated temporal convolutional network models.
[0036] S5.2. Support multi-step prediction mode, recursively taking the prediction result of the previous time step as the input of the next time step;
[0037] S5.3. Evaluate the prediction results using mean absolute error, root mean square error, and mean absolute percentage error.
[0038] Preferably, the joint feature extraction process of the dynamic graph convolutional network and the dilated temporal convolutional network directly transfers the features of each layer to the output layer through jump connections to enhance the feature expression ability and the convergence of model training.
[0039] The present invention provides a rainfall prediction method based on dynamic graph convolutional networks and dilated temporal convolution. It has the following beneficial effects:
[0040] 1. This invention utilizes a dynamic graph convolutional network (GCN) solution, dynamically generating an adjacency matrix through a multi-head attention mechanism to capture the dynamic spatial dependencies between meteorological stations in real time. This approach accurately reflects the interactive characteristics of geographic nodes over time. Compared to existing solutions that use static adjacency matrices but cannot reflect dynamic node relationships, this approach addresses the rigidity of spatial relationships in modeling.
[0041] 2. This invention employs a dilated temporal convolutional network to model temporal dependencies at multiple scales, using dilated convolutions to gradually expand the temporal receptive field. This effectively captures complex dependencies over long time spans. This improves upon the existing recurrent neural network approach, which suffers from limited receptive fields and high training costs, addressing its inefficiency in processing long-term dependencies.
[0042] 3. This invention effectively improves the stability and convergence speed of model training by combining adaptive learning rate scheduling with gradient clipping. Compared with the existing fixed learning rate training method, it solves the problem of model oscillation or training stagnation caused by excessively large or small gradients, ensuring the robustness of large-scale meteorological data modeling.
[0043] 4. By supporting recursive prediction and multi-step parallel prediction, this invention generates accurate rainfall forecasts and comprehensively evaluates the performance of multi-time-step predictions. Compared with traditional solutions that only support single-step predictions, this method addresses the problem of excessive error accumulation in long-term rainfall trend forecasts, providing more flexible forecasting capabilities for complex meteorological system analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 Flow chart of the method of the present invention. DETAILED DESCRIPTION
[0045] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the present specification. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0046] Please see the attached Figure 1 , an embodiment of the present invention provides a rainfall prediction method based on a dynamic graph convolutional network and dilated temporal convolution, comprising the following steps;
[0047] S1. Data loading and preprocessing: Load and preprocess meteorological data to construct a three-dimensional data matrix containing multi-dimensional meteorological characteristics, time dimension and space dimension;
[0048] In this embodiment, loading of meteorological data includes:
[0049] rainfall; rainfall data for each geographical location;
[0050] Precipitation rate; precipitation rate data for each geographical location;
[0051] Water vapor content; data on the total water vapor content in the atmosphere;
[0052] Temperature; Temperature data of each layer of the atmosphere;
[0053] Humidity; relative humidity data of each layer of the atmosphere;
[0054] Wind speed; atmospheric wind speed and direction at different altitudes;
[0055] Terrain height; Terrain height data for each layer of the atmosphere;
[0056] Cloud cover; cloud cover in various layers of the atmosphere;
[0057] Rainfall is a key parameter that directly characterizes precipitation intensity, while water vapor content reflects the potential for precipitation in a meteorological system. Humidity, temperature, and wind speed are important factors that affect air mass movement and cloud formation.
[0058] Specifically, for meteorological features with inconsistent temporal distribution, interpolation methods are used to supplement the data of missing time steps to ensure that all feature data have observations at the same time step. Spatial alignment is achieved through interpolation and resampling to integrate data of different resolutions into a unified spatial grid.
[0059] All read data are stacked into a three-dimensional array data with the shape of (time, longitude and latitude, parameters). This allows the model to input meteorological parameters at different time steps and different geographical locations as a whole, thereby capturing spatiotemporal dependencies and stacking the time series data of the file according to the parameter dimension to form X∈R N×M×F A three-dimensional matrix;
[0060] in;
[0061] T represents the number of time steps;
[0062] M represents the number of geographical nodes;
[0063] F represents the number of meteorological features;
[0064] The generated three-dimensional matrix X is used as the input data matrix of the rainfall prediction model, which contains the multidimensional meteorological characteristic data of each node at each time step;
[0065] For meteorological features, StandardScaler normalization is performed on a column-by-column (time dimension) basis, converting the data to a mean of 0 and a standard deviation of 1. The goal is to make the numerical scales of different features similar, thereby improving the stability of model training;
[0066] Normalization is done by adjusting the range of values of each meteorological characteristic to zero mean and unit variance. Specifically, the normalization formula is:
[0067]
[0068] in;
[0069] X is the original eigenvalue;
[0070] μ represents the mean of the feature;
[0071] σ represents the standard deviation of the feature;
[0072] After normalization, the eigenvalues of the meteorological data matrix are in the same numerical range, reducing the training instability caused by the numerical fluctuations between different eigenvalues;
[0073] By using a sliding window approach, continuous time series data is split into multiple input-output pairs, allowing the model to learn the mapping relationship from historical data to future data;
[0074] Set the window length to W, then take the data of W consecutive time steps as input, and select the data of the next H time steps as the prediction target;
[0075] Specifically, the input time window can be expressed as;
[0076] X input={X t ,X t+1 ,…,X t+W-1}
[0077] The corresponding prediction targets are:
[0078] Y target ={X t+W ,X t+W+1 ,…,X t+W+H-1}
[0079] in;
[0080] t represents the starting position of the time step;
[0081] W is the input window length;
[0082] H is the prediction target window length;
[0083] The specific values of the window length W and the prediction step length H are determined according to the requirements of rainfall prediction. For short-term prediction, W = 6 and H = 2 (in hours), while for long-term prediction, W = 24 and H = 6 (in days) can be selected.
[0084] Feature data is stored in the form of (T, M, F), where the data at each time step t is represented as an M × F two-dimensional matrix containing the multidimensional feature values of all geographic nodes;
[0085] Through the above steps, the present invention realizes the complete conversion of meteorological data from original observations to a unified spatiotemporal format, providing a solid data foundation for the efficient training of subsequent dynamic graph convolutional networks and dilated temporal convolutional networks.
[0086] S2. Dynamic Graph Convolutional Network Construction: Modeling the spatial dynamic dependency of a three-dimensional data matrix through a dynamic graph convolutional network, wherein the dynamic graph convolutional network captures the dynamic spatial associations between different geographic nodes through a dynamically generated adjacency matrix;
[0087] In this embodiment, a method of using a dynamic graph convolutional network is proposed in step S2 to accurately model spatial dynamic dependencies by dynamically generating an adjacency matrix, thereby providing more accurate input features for subsequent temporal dependency modeling.
[0088] In this embodiment, the dynamic adjacency matrix is generated by node embedding, and the geographic node is initially represented as an embedding vector h of fixed dimension. i Node embeddings can be randomly initialized or assigned by geographical features. These embedding vectors are used to calculate the static adjacency matrix A static ,Specifically, the initial relationship weights of nodes i and j are given by the formula;
[0089]
[0090] in;
[0091] h i and h j is the embedding vector of nodes i and j; represents the inner product operation;
[0092] The multi-head attention mechanism achieves dynamic feature modeling by mapping node embeddings into query, key, and value vectors. The formula is as follows:
[0093] Q=W q ·h i ,K=W k ·h j ,V=W v ·h j
[0094] Among them; W q 、W k 、W v is a mapping matrix used to generate query, key and value representations respectively;
[0095] Specifically, the dynamic relevance weight A dynamic,ij It is calculated by weighting the query vector and the key vector;
[0096]
[0097] Among them; d k is a scaling factor equal to the dimension of the embedding vector, used to prevent gradient explosion;
[0098] The dynamic adjacency matrix can be dynamically adjusted at a time step to reflect changes in meteorological conditions at the current time step;
[0099] In the dynamic graph convolutional network, the convolution operation is performed through the adjacency matrix A dynamic Aggregate node features, the formula is as follows;
[0100] H (l+1) =σ(A dynamic ·H (l) W (l) )
[0101] in;
[0102] H (l) is the feature matrix of the l-th layer node;
[0103] W (l) is the weight matrix;
[0104] σ is a nonlinear activation function. Through convolution operations, the dynamic features of meteorological nodes can be propagated and integrated layer by layer in the spatial dimension.
[0105] The dimension of the node feature matrix H is M×F, where M is the number of nodes and F is the number of features. After multiple layers of convolution, the feature vector of the node is enhanced into a high-dimensional feature that contains dynamic information about the surrounding nodes.
[0106] The skip connection transfers the low-level features directly to the high-level layers. Specifically, the output features of the convolution are added to the features of the previous layer through the residual connection. The formula is:
[0107] H (l+1) =σ(A dynamic ·H (l) W (l) )+H (l)
[0108] It can enhance feature expression capabilities, alleviate the gradient vanishing problem, and improve training stability;
[0109] To ensure the consistency of the eigenvalue range, the adjacency matrix is normalized before convolution. The normalization formula is:
[0110]
[0111] Where; D is the adjacency matrix A dynamic The degree matrix is used to balance the feature propagation of nodes;
[0112] Through the above steps, the dynamic graph convolutional network realizes the dynamic spatial modeling of meteorological data. The characteristics of each node not only reflect its own information, but also capture the dynamic relationship with its related nodes.
[0113] S3. Construction of a dilated temporal convolutional network: Modeling the temporal dependency of spatially modeled data through a dilated temporal convolutional network. The dilated temporal convolutional network extracts multi-scale temporal dependency features through dilated convolution.
[0114] In this embodiment, the dilated temporal convolutional network is combined with dilated convolution and multi-scale modeling to solve the problem of time dimension feature extraction, laying a key foundation for the final rainfall prediction.
[0115] By introducing the dilation rate d between the convolution kernels, the time step range covered by the receptive field is increased;
[0116] Specifically, the output of dilated convolution can be expressed as;
[0117]
[0118] in;
[0119] y[i] is the output of the i-th time step;
[0120] x[i] is the input time series;
[0121] w[k] is the weight of the convolution kernel;
[0122] K is the convolution kernel size;
[0123] d is the expansion rate;
[0124] By adjusting the expansion rate d, the receptive field can be flexibly expanded to capture features with a longer time span;
[0125] The dilated temporal convolutional network consists of multiple convolutional layers, each using a different dilation rate. The first convolutional layer is responsible for extracting short-term temporal dependency features, while subsequent layers gradually capture features over longer time ranges.
[0126] Specifically, the design formula for multi-layer convolution is:
[0127]
[0128] in;
[0129] H (l) is the input feature of the lth layer;
[0130] W (l) is the corresponding convolution kernel weight;
[0131] The expansion rate is d l Convolution operation;
[0132] σ is the activation function;
[0133] Through multi-layer superposition, features at different time scales are integrated into the same network;
[0134] Based on the dilated convolution, the network introduces a gating unit to select important temporal features. The gating mechanism consists of two parts: one part generates the filter, and the other part generates the gating signal. The specific formula is as follows;
[0135] z[i]=tanh(f(x[i]))·sigmoid(g(x[i]))
[0136] in;
[0137] f(x[i]) and g(x[i]) are the filter signal and gate signal generated by the convolution operation respectively;
[0138] Tanh and sigmoid are activation functions;
[0139] The final output z[i] is the filtered time feature, which can avoid the interference of irrelevant information on the prediction results;
[0140] By directly connecting the input of each convolution layer to the output, the underlying features are fully utilized in the network. The specific formula is:
[0141] H (l+1) =F(H (l) )+H (l)
[0142] Among them, F(H (l) ) is the output of the current convolutional layer, H (l) is the input feature of the previous layer;
[0143] Layer normalization is used to standardize the output of each convolution layer to make the numerical range more stable. Layer normalization is done through the following formula;
[0144]
[0145] Among them, μ and σ are the mean and standard deviation of the output features respectively. The standardized features can accelerate the training process and improve the convergence of the network.
[0146] By expanding the temporal convolutional network, the present invention achieves multi-scale modeling capabilities from short-term to long-term in the time dimension, providing comprehensive temporal feature input for subsequent rainfall forecasts. Combined with dynamic spatial features, the present invention can provide efficient and accurate rainfall forecasts under complex meteorological conditions.
[0147] S4. Model training and verification: Model training is performed based on the spatiotemporal features jointly extracted by the dynamic graph convolutional network and the dilated temporal convolutional network;
[0148] In this embodiment, step S4 optimizes the model parameters through a carefully designed training and validation strategy to maximize the feature expression potential of the data while ensuring the stability and generalization ability of the model training. This step includes multiple optimization measures, including loss function design, learning rate scheduling, gradient clipping, and dynamic evaluation of the validation process.
[0149] The loss function adopts the combination of mean absolute error and Huber loss. MAE can measure the overall error of the prediction well. Its formula is as follows;
[0150]
[0151] in;
[0152] y i is the i-th true value;
[0153] is the corresponding predicted value;
[0154] N is the sample size;
[0155] Huber loss is a smooth loss function suitable for noisy data. Its formula is:
[0156]
[0157] The Huber loss treats small errors similarly to the mean square error, while it exhibits anti-interference ability similar to MAE for large errors;
[0158] L total =α·L MAE +β·L Huber
[0159] Among them, α and β are weight coefficients used to balance the impact of the two losses;
[0160] A fixed learning rate may cause oscillations or premature convergence during training. To address this problem, the present invention adopts the ReduceLROnPlateau strategy. When the validation set loss stops decreasing after several rounds of training, the learning rate will be automatically reduced. The initial learning rate is set to lr0, and each adjustment is multiplied by the decay factor γ.
[0161] The specific update rules are as follows;
[0162] lr t+1 =lr t ·γ,if validation loss does not improve
[0163] Among them, lr t represents the learning rate of the tth iteration, γ is usually set to 0.1 or 0.5;
[0164] The gradient of the neural network may be too large at some levels, resulting in unstable model parameter updates. Gradient clipping limits the norm of the gradient to ensure that the amplitude of each update does not exceed the preset threshold.
[0165] Specifically, the operation of gradient clipping can be expressed as;
[0166]
[0167] in;
[0168] g is the original gradient;
[0169] τ is the threshold for gradient clipping;
[0170] ‖g‖2 is the second norm of the gradient;
[0171] When the gradient norm exceeds the threshold, the gradient will be scaled to the range of τ;
[0172] The data distribution of the validation set and the training set must be consistent to ensure the reliability of the evaluation results. After each round of training, the prediction error of the model is calculated using the validation set, and the validation loss value is recorded;
[0173] The verification process includes the following steps:
[0174] Input the validation set data to generate rainfall prediction results;
[0175] Calculate the error between the predicted value and the true value, using the above loss function for measurement;
[0176] Record the current validation loss value and compare it with the historical minimum value. If the validation loss is further reduced, update the optimal model parameters.
[0177] In this embodiment, a stable and efficient model training process is achieved, which provides reliable network parameters for the subsequent prediction stage. Based on the actual needs of the rainfall prediction task, it is ensured that the model can fully adapt to the changes in the complex meteorological system.
[0178] S5. Model prediction and evaluation: Use the trained model to perform multi-step rainfall prediction on the input meteorological data. In this embodiment, the trained dynamic graph convolutional network and dilated temporal convolutional network are used to perform multi-step rainfall prediction on the meteorological data, and the performance of the model is comprehensively evaluated.
[0179] The initial input window contains data from the past W time steps, which serves as the basis for prediction. Let the input time series be X input , contains multiple time steps, geographic nodes and features, in the form of Where W represents the number of time steps in the input window, M represents the number of geographic nodes, and F represents the number of meteorological features;
[0180] Specifically, the input window is extracted from the meteorological observation data of the test set. The input window can be adjusted according to the different requirements of the prediction task. For short-term rainfall prediction, the value of W can be set to a smaller value; for long-term rainfall trend analysis, it is recommended to choose a larger W.
[0181] The model generates rainfall forecast results for the next H time steps, assuming that the initial input window is X input The model generates the predicted value of the first time step through the joint feature extraction of dynamic graph convolutional network and dilated temporal convolutional network The formula is as follows;
[0182]
[0183] Where f(·) represents the trained prediction model;
[0184] The prediction of subsequent time steps can be done recursively, that is, the prediction result of the previous time step is used as input and the prediction range is gradually expanded;
[0185] Specifically, the prediction formula for the tth time step is;
[0186]
[0187] Among them, X recursive is the input window, which contains the data of W-1 historical time steps and the t-1th predicted value To improve the efficiency and accuracy of prediction, a multi-step parallel prediction method can be combined, that is, by expanding the features of the input window; directly generating the prediction results of H time steps, the formula is as follows;
[0188]
[0189] Error indicators include mean absolute error, root mean square error, and mean absolute percentage error. The formula for MAE is:
[0190]
[0191] in;
[0192] N represents the number of test samples;
[0193] is the predicted value;
[0194] Y i is the true value;
[0195] As an alternative, RMSE is suitable for measuring the impact of outliers on model predictions, and its formula is;
[0196]
[0197] Specifically, MAPE is used to evaluate the relative proportion of forecast errors, and the formula is as follows;
[0198]
[0199] If the true value Y i In the case of zero values, the data can be smoothed to avoid zero division problems in calculations;
[0200] The prediction results are saved as a time series file in the form of an npy file or a csv file. The file contains the predicted time step, geographical location and rainfall value for subsequent analysis.
[0201] The model prediction and evaluation phase completes the entire process from data input to output. Recursive prediction methods, combined with various error assessment methods, provide comprehensive technical support for rainfall forecasting. Furthermore, multi-format storage and visualization further enhance the interpretability and practicality of the results.
[0202] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A rainfall prediction method based on dynamic graph convolutional network and dilated temporal convolution, characterized by: The following steps are included: S1. Data loading and preprocessing: Load and preprocess meteorological data to construct a three-dimensional data matrix containing multi-dimensional meteorological characteristics, time dimension and space dimension; S2. Dynamic Graph Convolutional Network Construction: Modeling the spatial dynamic dependency of a three-dimensional data matrix through a dynamic graph convolutional network, wherein the dynamic graph convolutional network captures the dynamic spatial associations between different geographic nodes through a dynamically generated adjacency matrix; S3. Construction of a dilated temporal convolutional network: Modeling the temporal dependency of spatially modeled data through a dilated temporal convolutional network. The dilated temporal convolutional network extracts multi-scale temporal dependency features through dilated convolution. S4. Model training and verification: Model training is performed based on the spatiotemporal features jointly extracted by the dynamic graph convolutional network and the dilated temporal convolutional network; The Huber loss function and ReduceLROnPlateau strategy are used in training; S5. Model prediction and evaluation: Use the trained model to perform multi-step rainfall prediction on the input meteorological data. Multi-step prediction involves taking the prediction result of the previous time step as input and gradually expanding the prediction range to obtain multi-step prediction results. Wherein, the step S2 specifically includes the following steps: S2.
1. Initialize an embedding vector for each geographic node and calculate the static adjacency matrix between nodes based on the embedding vector. S2.
2. Use the multi-head attention mechanism to dynamically adjust the adjacency matrix to capture the dynamic spatial correlation between nodes at different time steps; S2.
3. Perform convolution operations on node features based on the dynamic adjacency matrix to obtain dynamic spatial features of geographic nodes; The step S3 specifically includes the following steps: S3.
1. Perform convolution processing on time series data through dilated convolution, expand the temporal receptive field layer by layer, and capture the dependency features of different time scales; S3.2, set different expansion rates to achieve multi-scale time-dependent modeling; S3.
3. Filter irrelevant information through the gating mechanism and retain important time series features.
2. The rainfall prediction method based on dynamic graph convolutional network and dilated temporal convolution according to claim 1 is characterized in that: Specifically in step S1 The following steps are included: S1.
1. Load multiple meteorological characteristics including rainfall, precipitation rate, water vapor content, temperature, humidity, wind speed, and cloud cover from the meteorological dataset; S1.
2. Perform temporal and spatial alignment on the loaded multi-dimensional meteorological characteristic data to construct a unified three-dimensional data matrix; S1.
3. Normalize the characteristic dimensions of the three-dimensional data matrix and adjust the numerical range of each meteorological characteristic to zero mean and unit variance; S1.
4. Generate input time window and prediction target window through sliding window method to form time series training samples and prediction targets.
3. The rainfall prediction method based on dynamic graph convolutional network and dilated temporal convolution according to claim 1 is characterized in that: The multi-head attention mechanism specifically includes: Mapping the geographic node embedding vector into a query vector, a key vector, and a value vector; By calculating the weighted correlation between the query vector and the key vector, the dynamic correlation weight between nodes at each time step is obtained; Generates a dynamic adjacency matrix based on dynamic relevance weights.
4. The rainfall prediction method based on dynamic graph convolutional network and dilated temporal convolution according to claim 1, characterized in that: The dilated convolution sets the convolution kernel size and dilation rate in each layer, expands the temporal receptive field by increasing the dilation rate layer by layer, and extracts multi-scale temporal features within a fixed convolution kernel size range.
5. The rainfall prediction method based on dynamic graph convolutional network and dilated temporal convolution according to claim 1, characterized in that: Specifically in step S4 The following steps are included: S4.
1. Use the time-windowed input data as training samples and use a combination of mean absolute error and Huber loss function to measure the prediction error. S4.
2. Dynamically adjust the learning rate during model training through adaptive learning rate scheduling; S4.
3. Use gradient clipping strategy to prevent gradient explosion during training.
6. The rainfall prediction method based on dynamic graph convolutional network and dilated temporal convolution according to claim 5, characterized in that: Gradient clipping limits the norm of the gradient to prevent excessive gradient updates and improve the stability and convergence of the training process.
7. The rainfall prediction method based on dynamic graph convolutional network and dilated temporal convolution according to claim 1, characterized in that: The step S5 specifically includes the following steps: S5.
1. Generate rainfall prediction results for test data based on the trained dynamic graph convolutional network and dilated temporal convolutional network models. S5.
2. Support multi-step prediction mode, recursively taking the prediction result of the previous time step as the input of the next time step; S5.
3. Evaluate the prediction results using mean absolute error, root mean square error, and mean absolute percentage error.
8. The rainfall prediction method based on dynamic graph convolutional network and dilated temporal convolution according to claim 1, characterized in that: The joint feature extraction process of the dynamic graph convolutional network and the dilated temporal convolutional network directly transfers the features of each layer to the output layer through skip connections to enhance the feature expression ability and the convergence of model training.
Citation Information
Patent Citations
Traffic flow prediction method of space-time convolution fusion probability sparse attention mechanism
CN117290706A
Dynamic self-adaptive multi-view fusion recommendation system based on extended mask convolution
CN117611298A