A correction method for sub-seasonal temperature forecast based on 3D-TimesNet

Through the 3D-TimesNet model, combined with Fourier transform and convolutional neural network, the periodic characteristics of temperature data were extracted and revised, which solved the problem of large errors in temperature forecasts in the second season and improved the forecast accuracy and calculation efficiency.

CN118735082BActive Publication Date: 2024-12-06NANJING UNIV OF INFORMATION SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411225933.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2024-12-06
Estimated Expiration
2044-09-03

AI Technical Summary

Technical Problem

The second season's temperature forecast error is large and the accuracy is low. The traditional numerical weather forecast model has high calculation cost and is difficult to capture complex nonlinear relationships. The existing TimesNet neural network model cannot process multi-dimensional meteorological data.

Method used

Using a 3D-TimesNet model combining Fourier transform and convolutional neural network, a neural network is constructed through three-dimensional time blocks and multi-scale two-dimensional convolutional blocks, the periodic characteristics of temperature data are extracted and corrected, and the optimized model is used for Correction of forecast results.

Benefits of technology

It significantly improves the accuracy of sub-seasonal temperature forecasts, can more fully capture complex nonlinear relationships and spatial characteristics, reduces calculation costs, and is suitable for correcting sub-seasonal forecast results for in-plane temperatures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118735082B_ABST
    Figure CN118735082B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for correcting sub-seasonal temperature forecast based on 3D-TimesNet, comprising: using a three-dimensional time block 3D-TimesBlock combining Fourier transform and convolutional neural network, constructing a 3D-TimesNet neural network optimization model integrating sub-seasonal temperature forecast results and historical temperature data, and using sub-seasonal temperature forecast result data sets and historical temperature data sets for training; optimizing and accelerating the trained model; using the optimized model, inputting the sub-seasonal temperature forecast results to be corrected and the historical temperature data for the target time, de-standardizing the model output data, and obtaining the temperature forecast results for the corrected target time. The present invention can effectively extract the periodic variation law and spatial relationship of temperature, has unique applicability and significant advantages in the forecast of sub-seasonal temperature, and promotes the advancement of the field of meteorological forecasting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a weather forecast correction method, in particular to a sub-seasonal temperature forecast correction method based on 3D-TimesNet. Background Art

[0002] Sub-seasonal weather forecasting, which is the prediction of weather conditions 10 to 30 days in the future, is a relatively new research field in meteorology, which faces a series of challenges. The atmosphere is a highly nonlinear and chaotic dynamic system, in which small initial condition errors will be rapidly amplified over time. This phenomenon is particularly significant in sub-seasonal forecasting, making it extremely challenging to accurately predict sub-seasonal weather.

[0003] Traditional numerical weather forecast models are based on simplified physical models and parameterization schemes, which results in an inaccurate description of real atmospheric processes. Slight physical process deviations will gradually accumulate as the calculation time progresses. Especially in long-term forecasts, such deviations will increase significantly, making it difficult to guarantee the accuracy of long-term forecasts. In addition, the computational cost of traditional numerical weather forecast models is usually high, requiring a lot of computing resources and time to complete a forecast. At the same time, for some extreme weather events, such as rare rainstorms and hurricanes, traditional numerical weather forecast models often fail to give accurate and timely forecasts due to insufficient understanding of these special processes or imperfect parameterization schemes.

[0004] Traditional statistical correction methods adjust the output of numerical weather forecasts by analyzing the systematic deviations between historical forecast errors and actual observations. Although this method can improve the accuracy of forecasts in some cases, it is usually difficult to capture complex nonlinear relationships and relies on the availability of a large amount of high-quality historical data. In addition, although three-dimensional variational and four-dimensional variational assimilation techniques can improve the initial state of the model by combining observational data, they have lags and often cannot completely correct all initial errors during the data assimilation process.

[0005] As a subfield of machine learning, deep learning has made rapid progress in recent years. It is well-known for its powerful function approximation ability and ability to handle complex data sets, which makes deep learning have potential in extracting patterns and regularities from large amounts of historical data. However, the performance of deep learning models depends largely on the design of the network structure and how to effectively capture the dynamic features in time series data. Recurrent neural networks (RNNs) are theoretically capable of processing time series data, but in practice they often have difficulty capturing long-term dependencies due to the problem of gradient vanishing or exploding. Long short-term memory networks (LSTMs) and gated recurrent units (GRUs), as variants of RNNs, alleviate this problem by introducing gating mechanisms, but they still face challenges when processing very long sequences and have high computational costs. Attention mechanisms provide an alternative way to capture long-term dependencies by focusing on key information in a sequence, but how to effectively define and utilize these dependencies in meteorological applications remains an open problem. To this end, a TimesNet neural network model was proposed, which achieved good results in processing one-dimensional time series data. However, weather forecast data often involves multiple dimensions such as time, latitude, and longitude, and the existing TimesNet neural network model cannot handle such multi-dimensional meteorological data. Summary of the invention

[0006] Purpose of the invention: The purpose of the present invention is to provide a sub-seasonal temperature forecast correction method based on the 3D-TimesNet model to solve the problems of large error and low accuracy of sub-seasonal forecast.

[0007] Technical solution: The method of the present invention comprises the following steps:

[0008] The 3D-TimesBlock, which combines Fourier transform and convolutional neural network, is used to construct a 3D-TimesNet neural network optimization model that integrates sub-seasonal temperature forecast results and historical temperature data, and is trained using the sub-seasonal temperature forecast result dataset and the historical temperature dataset. The trained model is optimized and accelerated. The optimized model is used to input the sub-seasonal temperature forecast results to be revised and the historical temperature data for the target time, and the model output data is de-normalized to obtain the revised temperature forecast results for the target time.

[0009] The 3D-TimesNet neural network optimization model includes M three-dimensional time blocks 3D-TimesBlock and M multi-scale two-dimensional convolution blocks Inception_2D Block; the M three-dimensional time blocks are connected in series, and the input of the first three-dimensional time block is the historical temperature dataset, and the input of the second three-dimensional time block is the historical temperature dataset. The input of the three-dimensional time block is The input and output of the three-dimensional time block are connected by residual connection; M multi-scale two-dimensional convolution blocks are connected in series, and the input of the first multi-scale two-dimensional convolution block is the combination of the sub-seasonal temperature forecast result dataset and the input and output of the first three-dimensional time block. The input of the multi-scale 2D convolutional block is The residual connections between the input and output of the multi-scale 2D convolutional blocks are connected to the The combination of the residual connection of the input and output of the three-dimensional time block continuously adds the periodic features extracted from the three-dimensional time block to the existing sub-seasonal forecast, corrects the forecast, and finally outputs the corrected temperature forecast result.

[0010] Furthermore, the sub-seasonal temperature forecast result dataset and the historical temperature dataset used for training the model are pre-processed by data cleaning and standardization. The specific process of data cleaning and standardization pre-processing is as follows:

[0011] First, identify and eliminate incomplete, incorrect, inaccurate or irrelevant parts of sub-seasonal temperature forecast results and historical temperature data;

[0012] Then, the cleaned sub-seasonal temperature forecast results and historical temperature data are further standardized and preprocessed, and the calculation method is:

[0013] ,

[0014] ,

[0015] in, is the standardized sub-seasonal temperature forecast result, This is the sub-seasonal temperature forecast result after cleaning. and They are The mean and standard deviation of is the standardized historical temperature data matrix, is the historical temperature data matrix, and They are The mean and standard deviation of .

[0016] Furthermore, the three-dimensional time block 3D-TimesBlock includes: a fast Fourier transform module, a multi-scale attention three-dimensional convolution block AttentionInception_3D Block and a weighted summation module. First, the frequency components of the time series of the historical temperature dataset are analyzed by fast Fourier transform, the most significant frequency components are selected, and the one-dimensional time series is reconstructed into multiple sequence sets with period length and number of periods according to these frequency components; then a multi-scale attention three-dimensional convolution block AttentionInception_3D Block composed of multiple three-dimensional convolution kernels of different sizes and attention modules is used to capture the features within and between periods, and then the calculation results are reconstructed back into the time series, and weights are assigned to each result according to the amplitude calculated by the previous fast Fourier transform, and the output result is obtained by weighted summation.

[0017] Furthermore, the fast Fourier transform formula is:

[0018] ,

[0019] in, is the frequency in the time dimension, is the frequency The corresponding spectrum contains amplitude and phase information, It is standardized Historical temperature data at the time, Represents the time index, Is a sequence The length, that is, time, is an imaginary unit, is the base of natural logarithms;

[0020] Then calculate the average amplitude of the frequency, the formula is as follows:

[0021] ,

[0022] in, A is the average amplitude of the frequencies, N is the number of spatial points in the latitude and longitude plane, It is n The spectrum of each spatial point is then removed, and the DC component is removed. Then the average amplitude is sorted from large to small and the first one is taken. k The frequency corresponding to the average amplitude is calculated, and the cycle length is calculated based on the frequency. The formula is as follows:

[0023] ,

[0024] in, is the calculated The cycle length, It is The frequency corresponding to the maximum average amplitude, and then the data of each frequency Perform three-dimensional convolution operations respectively, Indicates latitude, Represents longitude; the output is calculated as follows:

[0025] ,

[0026] in, It is the calculation result obtained after two multi-scale attention 3D convolution blocks. AttentionInception_3D is the multi-scale attention 3D convolution block operation. GELU is the activation function. express Corresponding data;

[0027] Finally, the calculated k Group The time dimension is restored to one dimension, and the output result consistent with the dimension size of the input historical temperature data is obtained by weighted summation according to its average amplitude.

[0028] Furthermore, the multi-scale attention three-dimensional convolution block AttentionInception_3D Block first uses three branches to calculate the data, one of which uses a convolution operation once, and the other two branches use two consecutive convolution operations respectively. The calculation results of the three branches are then averaged, and the multi-branch calculation is used to enhance the ability to capture spatial features; after two branch averaging operations, the channel attention module and the spatial attention module are connected to calculate the weights of each point in space and time, and adjust the calculation results.

[0029] Furthermore, the periodic features extracted from the three-dimensional time blocks are continuously added to the existing sub-seasonal forecast to correct the forecast. The expression is:

[0030] ,

[0031] ,

[0032] ,

[0033] in, It is The input of a multi-scale two-dimensional convolution block, Concatenate is a data concatenation operation, It is The result of the residual connection between the input and output of the three-dimensional time block, It is The result of connecting the output of a multi-scale two-dimensional convolutional block with the input residual, where hour The temperature forecast for this season is: It is The output of a multi-scale two-dimensional convolution block, GELU is the activation function, Inception_2D is a multi-scale two-dimensional convolution operation, It is The result after the output of a multi-scale two-dimensional convolution block is connected with the input residual. After multiple Inception_2D operations, the output layer gradually reduces the number of channels through convolution operations to obtain the prediction result.

[0034] Furthermore, when training the model, the loss function is used MSELoss , and use the gradient descent method to update the model parameters. The specific parameter update rules are as follows:

[0035] ,

[0036] in, is the parameter after one round of learning, Represents the original parameters of the 3D-TimesNet neural network optimization model, is the learning rate;

[0037] The optimizer Adam is used to optimize and accelerate the model.

[0038] A system corresponding to the method of the present invention comprises:

[0039] A model building and training unit, which is used to build a 3D-TimesNet neural network optimization model that integrates sub-seasonal temperature forecast results and historical temperature data by using a three-dimensional time block 3D-TimesBlock that combines Fourier transform and convolutional neural network, and uses the sub-seasonal temperature forecast result data set and the historical temperature data set for training;

[0040] Optimization processing unit, used to optimize and accelerate the trained model;

[0041] The forecasting unit is used to use the optimized model, input the sub-seasonal temperature forecast result to be corrected and the historical temperature data for the target time, de-standardize the model output data, and obtain the corrected temperature forecast result for the target time;

[0042] The 3D-TimesNet neural network optimization model includes M three-dimensional time blocks 3D-TimesBlock and M multi-scale two-dimensional convolution blocks Inception_2D Block; the M three-dimensional time blocks are connected in series, and the input of the first three-dimensional time block is the historical temperature dataset, and the input of the second three-dimensional time block is the historical temperature dataset. The input of the three-dimensional time block is The input and output of the three-dimensional time block are connected by residual connection; M multi-scale two-dimensional convolution blocks are connected in series, and the input of the first multi-scale two-dimensional convolution block is the combination of the sub-seasonal temperature forecast result dataset and the input and output of the first three-dimensional time block. The input of the multi-scale 2D convolutional block is The residual connections between the input and output of the multi-scale 2D convolutional blocks are connected to the The combination of the residual connection of the input and output of the three-dimensional time block continuously adds the periodic features extracted from the three-dimensional time block to the existing sub-seasonal forecast, corrects the forecast, and finally outputs the corrected temperature forecast result.

[0043] Based on the same inventive concept, an electronic device of the present invention includes:

[0044] A memory storing executable program code;

[0045] a processor coupled to the memory;

[0046] The processor calls the executable program code stored in the memory to execute the steps of the above-mentioned sub-seasonal temperature forecast correction method based on 3D-TimesNet.

[0047] Based on the same inventive concept, a computer-readable storage medium of the present invention stores computer instructions, and when the computer instructions are called, they are used to execute the steps of a sub-seasonal temperature forecast correction method based on 3D-TimesNet as described above.

[0048] Beneficial effects: Compared with the prior art, the significant technical effects of the present invention are as follows: (1) Based on an advanced deep learning scheme, the periodic variation law of temperature is effectively extracted from the historical temperature data and used for the correction of sub-seasonal scale forecasts. Compared with the traditional statistical correction method and variational assimilation method, the data mining is more comprehensive, more complex nonlinear relationships can be considered, and the correction effect is better; (2) The discrete Fourier transform is used to analyze the time series of temperature. By selecting the most significant frequency components, the time series is divided into periods. Then, the convolution kernel can well capture the intra-periodic and inter-periodic changes of temperature, which greatly improves the ability to capture time characteristics and has strong application value; (3) On the basis of the original TimesNet neural network model, the input is expanded from two dimensions to three dimensions, and the convolution kernel is upgraded from a two-dimensional convolution kernel to a three-dimensional convolution kernel, so that the obtained 3D-TimesNet neural network model can further capture the relationship between different spatial points on the basis of the original capture of the time relationship, and add the spatial attention mechanism and the channel attention mechanism to introduce more nonlinear relationships, which greatly improves the forecast effect, and is particularly suitable for correcting the sub-seasonal forecast results of the temperature in the plane. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 is a flow chart of the method of the present invention;

[0050] Figure 2 Optimize the model structure diagram for the 3D-TimesNet neural network;

[0051] Figure 3 It is the structure diagram of 3D-TimesBlock;

[0052] Figure 4 It is the structure diagram of the multi-scale two-dimensional convolution block Inception_2D Block;

[0053] Figure 5 This is the structure diagram of the multi-scale attention three-dimensional convolution block AttentionInception_3D Block. DETAILED DESCRIPTION

[0054] The technical solution of the present invention is further described below in conjunction with the accompanying drawings.

[0055] The method for correcting sub-seasonal temperature forecast based on 3D-TimesNet provided by the present invention has the following process: Figure 1 As shown, the specific steps include:

[0056] Step 1, obtain the sub-seasonal temperature forecast results, and obtain the historical temperature data for the start date and the preset time period before the forecast target area. For example, to revise the temperature forecast results for the 15th to 21st days with the start date of February 1, it is necessary to collect the temperature forecast results for the 15th to 21st days after February 1st in the target area. At the same time, it is necessary to obtain the historical temperature data for the preset time period on February 1st and before. Longer historical temperature data is more conducive to the extraction of time period characteristics. After that, data cleaning and standardization preprocessing are performed. The specific method is: after identifying and eliminating incomplete, incorrect, inaccurate or irrelevant parts in the sub-seasonal temperature forecast results and historical temperature data, the cleaned sub-seasonal temperature forecast results and historical temperature data are further standardized and preprocessed. The calculation method is:

[0057] ,

[0058] ,

[0059] in, This is the sub-seasonal temperature forecast result after cleaning. and They are The mean and standard deviation of is the standardized sub-seasonal temperature forecast result; is the historical temperature data matrix, and They are The mean and standard deviation of is the standardized historical temperature data matrix.

[0060] Subsequently, the standardized sub-seasonal temperature forecast results and the historical temperature data matrix are divided into training set, validation set and test set according to a certain ratio.

[0061] Step 2: Using the 3D-TimesBlock that combines Fourier transform and convolutional neural network, a 3D-TimesNet neural network optimization model that integrates sub-seasonal temperature forecast results and historical temperature data is constructed, and model training is carried out; the 3D-TimesNet neural network optimization model is as follows: Figure 2As shown in the figure, it mainly includes an input layer, M three-dimensional time blocks (3D-TimesBlock), M multi-scale two-dimensional convolution blocks (Inception_2D Block) and an output layer. M should be no less than 6 to ensure that the 3D-TimesNet neural network optimization model has sufficient expression ability; the input in the input layer is the standardized sub-seasonal temperature forecast result and the historical temperature data matrix obtained in step 1; the M three-dimensional time blocks (3D-TimesBlock) are connected in series, and the input of the first three-dimensional time block (3D-TimesBlock) is the standardized historical temperature data matrix, and the input of the second three-dimensional time block (3D-TimesBlock) is the standardized historical temperature data matrix. The input of the three-dimensional time block is The input and output of the three-dimensional time block are connected by residual connection; M multi-scale two-dimensional convolution blocks are connected in series, and the input of the first multi-scale two-dimensional convolution block (Inception_2D Block) is the combination of the standardized sub-seasonal temperature forecast result and the residual connection of the input and output of the first three-dimensional time block. The input of the multi-scale 2D convolutional block is The residual connections between the input and output of the multi-scale 2D convolutional blocks are connected to the The combination of the residual connection of the input and output of the three-dimensional time block continuously adds the periodic features extracted from the three-dimensional time block to the existing sub-seasonal forecast, corrects the forecast, and finally outputs the corrected temperature forecast result.

[0062] The 3D-TimesBlock is a 3D time series calculation module, including the Fast Fourier Transform module, the Multi-scale Attention Inception 3D Convolution Block (AttentionInception_3D Block) and the Weighted Sum module, such as Figure 3 As shown. In the 3D-TimesBlock, the frequency components of the time series of the historical temperature data set are first analyzed by fast Fourier transform, and the most significant frequency components are selected. Based on these frequency components, the one-dimensional time series is reconstructed into a set of multiple sequences with specific cycle lengths and numbers of cycles. Then, a multi-scale attention 3D convolution block (AttentionInception_3D Block) consisting of multiple 3D convolution kernels of different sizes and attention modules is used to capture the intra-cycle and inter-cycle features. After that, the calculation results are reconstructed back into the time series, and weights are assigned to each result according to the amplitude calculated by the previous fast Fourier transform. The output result is obtained by weighted summation.

[0063] The structure of the multi-scale two-dimensional convolution block (Inception_2D Block) is as follows Figure 4As shown in Figure 2, the input data is calculated with 1×1, 3×3, 5×5, 7×7, 9×9, and 11×11 convolution kernels respectively to capture features in different spatial ranges, and the calculation results are averaged to obtain the output of the multi-scale two-dimensional convolution block.

[0064] The structure of the multi-scale attention three-dimensional convolution block (AttentionInception_3D Block) is as follows Figure 5 As shown in the figure, first three branches are used to calculate the data, one of which uses a 1×1×1 convolution kernel, and the other two branches are connected to 3×3×3 and 5×5×5 convolution kernels after the 1×1×1 convolution kernel, respectively. Then the calculation results of the three branches are averaged. The calculation of multiple branches can enhance the ability to capture spatial features. After two of the above operations, the channel attention module and the spatial attention module are connected to obtain the output result of the multi-scale attention three-dimensional convolution block.

[0065] The specific process of building the 3D-TimesNet neural network optimization model is as follows:

[0066] Step 2.1 introduces the 3D-TimesBlock, which combines the advantages of Fourier transform and convolutional neural network. It upgrades the original 2D convolution kernel in TimesNet to a 3D convolution kernel and redesigns the structure within the module to enable it to capture more complex nonlinear relationships in space. The specific structure is as follows: Figure 3 First, the standardized historical temperature data is fast Fourier transformed along the time dimension for each point in the spatial plane, and the formula is as follows:

[0067] ,

[0068] in, is the frequency in the time dimension, is the frequency The corresponding spectrum contains amplitude and phase information, It is standardized Historical temperature data at all times, Represents the time index, Is a sequence The length, that is, time, is an imaginary unit, is the base of the natural logarithm. Then calculate the frequency in the longitude and latitude plane The corresponding average amplitude is as follows:

[0069] ,

[0070] in, A is the average amplitude of the frequencies, Nis the number of spatial points in the latitude and longitude plane, It is n The spectrum of each spatial point. Then the DC component is removed ( The corresponding amplitude A 0), then sort the average amplitudes from large to small and take the top k ( k The corresponding frequency of the average amplitude is not less than 6), and the length of the time period is calculated according to the frequency. The formula is as follows:

[0071] ,

[0072] in, is the calculated The length of the time period, It is The frequency corresponding to the maximum average amplitude. After Fourier transform, the array dimension is changed from the original becomes , Indicates the length of the time period, Indicates latitude, Indicates longitude. Then for each frequency data Perform three-dimensional convolution operations separately, and the output calculation is as follows:

[0073] ,

[0074] in, express The corresponding data, is the result of two multi-scale attention 3D convolution blocks. GELU is the activation function, AttentionInception_3D is the multi-scale attention 3D convolution block operation, and the structure of the multi-scale attention 3D convolution block (AttentionInception_3D Block) is as follows Figure 5 As shown in the figure, first three branches are used to calculate the data, one of which uses a 1×1×1 convolution kernel, and the other two branches are connected to 3×3×3 and 5×5×5 convolution kernels after the 1×1×1 convolution kernel, respectively. Then the calculation results of the three branches are averaged. The calculation of multiple branches can enhance the ability to capture spatial features. After two of the above operations, the channel attention module and the spatial attention module are connected to obtain the output result of the multi-scale attention three-dimensional convolution block.

[0075] Finally, the k groups after operation are The time dimension is restored to one dimension, and according to its average amplitude The weighted summation obtains an output result that is consistent with the dimension size of the input historical temperature data.

[0076] Step 2.2, input the standardized historical temperature data into the three-dimensional time block, connect the output result of each time with the input through residual connection to alleviate the gradient vanishing problem, and perform layer normalization to accelerate model training, such as Figure 2 As shown. First, the output of each 3D-TimesBlock is first connected to the input residual. The output of the first 3D-TimesBlock is connected to the input residual and then spliced ​​with the sub-seasonal temperature forecast result. After splicing, it is input into the first Inception_2D Block. After each calculation, the output of the Inception_2D Block is first connected to the input residual, and the data after the second 3D-TimesBlock output is connected to the input residual is added. The calculation continues, and the periodic features extracted by the 3D-TimesBlock are continuously added to the existing sub-seasonal forecast to correct the forecast. The calculation process is as follows:

[0077] ,

[0078] ,

[0079] ,

[0080] in, It is The input of a multi-scale 2D convolutional block, It is The result of the residual connection between the input and output of the three-dimensional time block, It is The result of connecting the output of a multi-scale two-dimensional convolutional block with the input residual, where hour The temperature forecast for this season is: It is The output of a multi-scale 2D convolutional block, It is The result after the output of a multi-scale two-dimensional convolution block is connected with the input residual. After multiple Inception_2D Block operations, the output layer gradually reduces the number of channels through convolution operations (3×3 convolution kernels) to obtain the prediction result.

[0081] Step 2.3, train the model constructed in step 2.2 to ensure that it can effectively perform long-term predictions. In order to prevent the model from overfitting, the early stopping mechanism is used in this embodiment to improve the generalization performance of the model. The specific training process is as follows.

[0082] First, initialize the model, build the model and move it to the GPU, and select the optimizer Adam and loss function MSELoss .

[0083] Set the total number of training rounds (epochs) and the number of training steps (steps) for each round. In each training round, the model enters training mode. For each batch of data, first move the input data and label data to the device, then perform forward propagation, pass the input data through the model to get the prediction result. Then, use the loss function MSELoss Calculate the error between the predicted result and the true label. Through back propagation, calculate the gradient of the loss function with respect to the model parameters, and use the gradient descent method to update the model parameters. The specific parameter update rules are as follows:

[0084] ,

[0085] in, Represents the original parameters of the 3D-TimesNet neural network optimization model, is the parameter after one round of learning, is the learning rate. At the end of each batch, print the loss value and training speed of the current batch.

[0086] After each training round, the validation set data is used to evaluate the performance of the model, the loss value on the validation set is calculated, and compared with the loss value on the training set. If the loss value on the validation set no longer decreases, the early stopping mechanism is triggered and the training ends early. After each training round, the parameters of the current model are saved. If the loss value on the validation set reaches a new minimum value, the saved best model parameters are updated. Finally, the test set data is used to evaluate the final trained model, and the prediction results and evaluation indicators Root Mean Square Error (RMSE) and Time Correlation Coefficient (TCC) are calculated and saved.

[0087] Step 3, according to the neural network model trained in step 2, for the target time, input the sub-seasonal temperature forecast result to be revised and the historical temperature data, de-standardize the model output data, and obtain the revised temperature forecast result for the target time.

[0088] A system corresponding to the method of the present invention comprises:

[0089] A model building and training unit, which is used to use the three-dimensional time block 3D-TimesBlock that combines Fourier transform and convolutional neural network to build a 3D-TimesNet neural network optimization model that integrates sub-seasonal temperature forecast results and historical temperature data, and uses the sub-seasonal temperature forecast result data set and the historical temperature data set for training;

[0090] Optimization processing unit, used to optimize and accelerate the trained model;

[0091] The forecasting unit is used to use the optimized model, input the sub-seasonal temperature forecast result to be corrected and the historical temperature data for the target time, de-standardize the model output data, and obtain the corrected temperature forecast result for the target time;

[0092] The 3D-TimesNet neural network optimization model includes M three-dimensional time blocks 3D-TimesBlock and M multi-scale two-dimensional convolution blocks Inception_2D Block; the M three-dimensional time blocks are connected in series, and the input of the first three-dimensional time block is the historical temperature dataset, and the input of the second three-dimensional time block is the historical temperature dataset. The input of the three-dimensional time block is The input and output of the three-dimensional time block are connected by residual connection; M multi-scale two-dimensional convolution blocks are connected in series, and the input of the first multi-scale two-dimensional convolution block is the combination of the sub-seasonal temperature forecast result dataset and the input and output of the first three-dimensional time block. The input of the multi-scale 2D convolutional block is The residual connections between the input and output of the multi-scale 2D convolutional blocks are connected to the The combination of the residual connection of the input and output of the three-dimensional time block continuously adds the periodic features extracted from the three-dimensional time block to the existing sub-seasonal forecast, corrects the forecast, and finally outputs the corrected temperature forecast result.

[0093] Based on the same inventive concept, an electronic device of the present invention includes:

[0094] A memory storing executable program code;

[0095] a processor coupled to the memory;

[0096] The processor calls the executable program code stored in the memory to execute the steps of the above-mentioned sub-seasonal temperature forecast correction method based on 3D-TimesNet.

[0097] Based on the same inventive concept, a computer-readable storage medium of the present invention stores computer instructions, and when the computer instructions are called, they are used to execute the steps of a sub-seasonal temperature forecast correction method based on 3D-TimesNet as described above.

Claims

1. A sub-seasonal temperature forecast correction method based on 3D-TimesNet, characterized in that: The following steps are involved: The 3D-TimesBlock, which combines Fourier transform and convolutional neural network, is used to build a 3D-TimesNet neural network optimization model that integrates sub-seasonal temperature forecast results and historical temperature data. The sub-seasonal temperature forecast result dataset and historical temperature dataset are used for training. The trained model is optimized and accelerated. Using the optimized model, the sub-seasonal temperature forecast results to be revised and historical temperature data are input for the target time, and the model output data is de-standardized to obtain the revised temperature forecast results for the target time; The 3D-TimesNet neural network optimization model includes M three-dimensional time blocks 3D-TimesBlock and M multi-scale two-dimensional convolution blocks Inception_2D Block; the M three-dimensional time blocks are connected in series, and the input of the first three-dimensional time block is the historical temperature dataset, and the input of the second three-dimensional time block is the historical temperature dataset. The input of the three-dimensional time block is The input and output of the three-dimensional time block are connected by residual connection; M multi-scale two-dimensional convolution blocks are connected in series, and the input of the first multi-scale two-dimensional convolution block is the combination of the sub-seasonal temperature forecast result dataset and the input and output of the first three-dimensional time block. The input of the multi-scale 2D convolutional block is The residual connections between the input and output of the multi-scale 2D convolutional blocks are connected to the The residual connection of the input and output of the three-dimensional time block is combined to continuously add the periodic features extracted from the three-dimensional time block to the existing sub-seasonal forecast, correct the forecast, and finally output the corrected temperature forecast result; The 3D-TimesBlock includes: a fast Fourier transform module, a multi-scale attention 3D convolution block AttentionInception_3D Block and a weighted summation module. First, the frequency components of the time series of the historical temperature data set are analyzed by fast Fourier transform, and the most significant frequency components are selected. According to these frequency components, the one-dimensional time series is reconstructed into a plurality of sequence sets with period length and number of periods. Then, a multi-scale attention 3D convolution block AttentionInception_3D Block composed of a plurality of 3D convolution kernels of different sizes and an attention module is used to capture the features within and between periods. After that, the calculation results are reconstructed back into the time series, and a weight is assigned to each result according to the amplitude calculated by the previous fast Fourier transform. The output result is obtained by weighted summation. The fast Fourier transform formula is: , in, is the frequency in the time dimension, is the frequency The corresponding spectrum contains amplitude and phase information, It is standardized Historical temperature data at the time, Represents the time index, Is a sequence The length, that is, time, is an imaginary unit, is the base of natural logarithms; Then calculate the average amplitude of the frequency, the formula is as follows: , in, A is the average amplitude of the frequencies, N is the number of spatial points in the latitude and longitude plane, It is n The spectrum of each spatial point is then removed, and the DC component is removed. Then the average amplitude is sorted from large to small and the first one is taken. k The frequency corresponding to the average amplitude is calculated, and the cycle length is calculated based on the frequency. The formula is as follows: , in, is the calculated The cycle length, It is The frequency corresponding to the maximum average amplitude, and then the data of each frequency Perform three-dimensional convolution operations respectively, Indicates latitude, Represents longitude; the output is calculated as follows: , in, It is the calculation result obtained after two multi-scale attention 3D convolution blocks. AttentionInception_3D is the multi-scale attention 3D convolution block operation. GELU is the activation function. express Corresponding data; Finally, the calculated k Group The time dimension of is restored to one dimension, and the weighted sum is taken according to the average amplitude to obtain the output result consistent with the dimension of the input historical temperature data; The multi-scale attention 3D convolution block AttentionInception_3D Block first uses three branches to calculate the data, one of which uses a convolution operation once, and the other two branches use two consecutive convolution operations respectively. Then the calculation results of the three branches are averaged. The calculation of multiple branches is used to enhance the ability to capture spatial features. After two branch averaging operations, the channel attention module and the spatial attention module are connected to calculate the weight of each point in space and time, and adjust the calculation results. The forecast is corrected, and the expression is: , , , in, It is The input of a multi-scale two-dimensional convolution block, Concatenate is a data concatenation operation, It is The result of the residual connection between the input and output of the three-dimensional time block, It is The result of connecting the output of a multi-scale two-dimensional convolutional block with the input residual, where hour The temperature forecast for this season is: It is The output of a multi-scale two-dimensional convolution block, GELU is the activation function, Inception_2D is a multi-scale two-dimensional convolution operation, It is The result after the output of a multi-scale two-dimensional convolution block is connected with the input residual. After multiple Inception_2D operations, the output layer gradually reduces the number of channels through convolution operations to obtain the prediction result.

2. The method for correcting sub-seasonal temperature forecast based on 3D-TimesNet according to claim 1, characterized in that: The sub-seasonal temperature forecast result dataset and historical temperature dataset used for training the model are pre-processed by data cleaning and standardization. The specific process of data cleaning and standardization pre-processing is as follows: First, identify and eliminate incomplete, incorrect, inaccurate or irrelevant parts of sub-seasonal temperature forecast results and historical temperature data; Then, the cleaned sub-seasonal temperature forecast results and historical temperature data are further standardized and preprocessed, and the calculation method is: , , in, is the standardized sub-seasonal temperature forecast result, This is the sub-seasonal temperature forecast result after cleaning. and They are The mean and standard deviation of is the standardized historical temperature data matrix, is the historical temperature data matrix, and They are The mean and standard deviation of .

3. The method for correcting sub-seasonal temperature forecast based on 3D-TimesNet according to claim 1, characterized in that: When training the model, the loss function is used MSELoss , and use the gradient descent method to update the model parameters. The specific parameter update rules are as follows: , in, is the parameter after one round of learning, Represents the original parameters of the 3D-TimesNet neural network optimization model, is the learning rate; The optimizer Adam is used to optimize and accelerate the model.

4. A sub-seasonal temperature forecast correction system based on 3D-TimesNet, characterized in that: include: A model building and training unit, which is used to build a 3D-TimesNet neural network optimization model that integrates sub-seasonal temperature forecast results and historical temperature data by using a three-dimensional time block 3D-TimesBlock that combines Fourier transform and convolutional neural network, and uses the sub-seasonal temperature forecast result data set and the historical temperature data set for training; Optimization processing unit, used to optimize and accelerate the trained model; The forecasting unit is used to use the optimized model, input the sub-seasonal temperature forecast result to be corrected and the historical temperature data for the target time, de-standardize the model output data, and obtain the corrected temperature forecast result for the target time; The 3D-TimesNet neural network optimization model includes M three-dimensional time blocks 3D-TimesBlock and M multi-scale two-dimensional convolution blocks Inception_2D Block; the M three-dimensional time blocks are connected in series, and the input of the first three-dimensional time block is the historical temperature dataset, and the input of the second three-dimensional time block is the historical temperature dataset. The input of the three-dimensional time block is The input and output of the three-dimensional time block are connected by residual connection; M multi-scale two-dimensional convolution blocks are connected in series, and the input of the first multi-scale two-dimensional convolution block is the combination of the sub-seasonal temperature forecast result dataset and the input and output of the first three-dimensional time block. The input of the multi-scale 2D convolutional block is The residual connections between the input and output of the multi-scale 2D convolutional blocks are connected to the The combination of the residual connection of the input and output of the three-dimensional time block continuously adds the periodic features extracted from the three-dimensional time block to the existing sub-seasonal forecast, corrects the forecast, and finally outputs the corrected temperature forecast result.

5. An electronic device, characterized in that: The device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the steps of a sub-seasonal temperature forecast correction method based on 3D-TimesNet as described in any one of claims 1-3.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which, when called, are used to execute the steps of a sub-seasonal temperature forecast correction method based on 3D-TimesNet as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Sea surface temperature numerical prediction deviation correction method based on attention mechanism

    CN114936620A

  • Medium-term rainfall forecast post-processing correction method based on spatial multi-scale convolutional neural network

    CN115641498A