A temperature prediction method integrating correlation weighting and spatiotemporal attention

Through the fusion method of correlation weighting and space-time attention, combined with the space-time attention module in deep learning neural network, the problem of difficult to capture the spatial-time correlation and influence of meteorological elements in the existing technology is solved, and the accuracy of temperature forecasting is improved and perception of temperature mutations.

CN114936691BActive Publication Date: 2025-02-11HEBEI ZEHUA WEIYE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210535440.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-06
Publication Date
2025-02-11
Estimated Expiration
2042-05-06

AI Technical Summary

Technical Problem

The existing temperature forecasting methods are difficult to fully consider the spatial and temporal correlation of temperature changes and the impact of geographical factors on temperature changes, and it is difficult to effectively capture the degree of influence of different meteorological factors on temperature changes and the sudden change in temperature.

Method used

The temperature forecast method that combines correlation weighting and space-time attention is adopted. By calculating the correlation between each meteorological element and temperature and weighting it, combined with the space-time attention module in the deep learning neural network, the space-time correlation of temperature changes is captured. and the influence of meteorological elements.

Benefits of technology

It improves the accuracy of temperature forecasts, can more effectively capture the spatial and temporal correlation of temperature changes and the influence of meteorological factors, and improves the ability to perceive temperature sudden changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114936691B_ABST
    Figure CN114936691B_ABST
Patent Text Reader

Abstract

The present invention is a temperature forecasting method integrating correlation weighting and spatiotemporal attention. First, a meteorological data set including temperature and multiple meteorological elements is obtained; then, the correlation between each meteorological element and temperature is calculated, the correlation is weighted, and all correlation weighted results are connected in the channel direction to obtain weighted meteorological spatiotemporal sequence data; finally, a temperature forecasting model is constructed based on a predictive recurrent neural network, and the temperature and weighted meteorological spatiotemporal sequence data are input into the temperature forecasting model for temperature forecasting in a local area at a future time; the temperature forecasting model includes n spatiotemporal attention layers, each of which includes several spatiotemporal attention modules, and the spatiotemporal attention modules use context interaction units to mutually correct input and context information to memorize short-term dependency information, and use spatiotemporal memory units to capture long-term dependencies of meteorological data. The method can capture temperature mutations and has higher forecast accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of temperature forecasting, and specifically is a temperature forecasting method integrating correlation weighting and spatiotemporal attention, which can be used for temperature prediction based on multi-factor spatiotemporal sequences in the field of temperature forecasting. Background Art

[0002] Temperature forecasting is a hot topic in the field of meteorological forecasting. Its purpose is to accurately forecast temperature changes in the future based on historical meteorological data. It is widely used in traffic control, infectious disease prevention, environmental monitoring, and disaster warning. The rapid development of automatic meteorological observation technology, remote sensing satellite engineering technology, and intelligent grid forecasting technology has provided rich data support for temperature forecasting research based on deep learning.

[0003] Traditional temperature forecasting methods are mainly based on physical numerical models, which require a lot of computing resources and time to obtain data and predict temperature. With the emergence of multi-source and massive meteorological data, data-driven models have emerged. Deep learning technology, especially convolutional neural networks and recurrent neural networks, has made milestone progress in the field of temperature forecasting, better simulating the nonlinear relationship of meteorological data and solving the problems of data dependence and complex mechanisms in temperature forecasting. However, recurrent neural networks tend to model time structures and lack the ability to capture spatial changes in temperature; convolutional neural networks pay more attention to changes in spatial appearance and have poor ability to capture the laws of temporal changes. In fact, the random behavior of temperature changes in a certain area is not only affected by the historical meteorological data of the area, but also by the spatiotemporal changes of meteorological elements in the surrounding areas. Therefore, the use of deep learning to predict temperature needs to consider long-distance spatiotemporal dependencies.

[0004] Although existing spatiotemporal series prediction algorithms can extract information from massive meteorological data efficiently and accurately, they usually model the spatiotemporal dimensions separately and use convolution operations to capture the spatial correlation of meteorological data. They do not fully consider the spatiotemporal correlation of temperature changes and the impact of geographical factors on temperature changes, ignore the degree of influence of different meteorological elements on temperature changes, and have difficulty in perceiving sudden temperature changes. Summary of the invention

[0005] In view of the deficiencies in the prior art, the technical problem that the present invention intends to solve is to provide a temperature forecasting method that integrates correlation weighting and spatiotemporal attention.

[0006] The technical solution adopted by the present invention to solve the technical problem is as follows:

[0007] A temperature prediction method integrating correlation weighting and spatiotemporal attention, characterized in that the method comprises the following steps:

[0008] The first step is to obtain a meteorological data set, which includes spatiotemporal series data including temperature and multiple meteorological elements;

[0009] The second step is to calculate the correlation between each meteorological element and temperature, weight the correlation between each meteorological element and temperature, and connect the weighted correlation results of each meteorological element in the channel direction to obtain the weighted meteorological time-space series data;

[0010] First, the temporal and spatial series data of temperature and various meteorological elements are standardized according to formula (1);

[0011]

[0012] Among them, X tj represents the spatiotemporal sequence of the jth meteorological element at time t, represents the standardized spatiotemporal sequence of the jth meteorological element at time t, μ j represents the mean value of the jth meteorological element in different regions calculated according to the time dimension, σ j represents the standard deviation of the jth meteorological element in different regions;

[0013] Secondly, the correlation coefficient between temperature and various meteorological elements is calculated;

[0014] Then, the correlation between each meteorological element and temperature is calculated according to formula (3);

[0015]

[0016] Among them, r j represents the correlation between the temperature in different regions and the jth meteorological element, ξ tj represents the correlation coefficient between the temperature of different regions at time t and the jth meteorological element, and T′ represents the length of the time series;

[0017] 2-5) Use formula (4) to perform weighted processing on the correlation degree, and connect the weighted results of the correlation degree of each meteorological element in the channel direction to obtain the weighted meteorological time-space series data;

[0018]

[0019] Among them, X′ tj It represents the weighted result of the correlation between the jth meteorological element and temperature at time t;

[0020] The weighted results of the correlation between all meteorological elements and temperature are connected in the channel direction to obtain the weighted meteorological time-space series data;

[0021] The third step is to build a temperature forecast model based on a deep learning neural network, input the temperature spatiotemporal series data and the weighted meteorological spatiotemporal series data into the temperature forecast model, and the temperature forecast model outputs the forecast result, that is, the spatiotemporal series temperature image of the local area at the future time;

[0022] The temperature prediction model is based on a predictive recurrent neural network. The temperature prediction model includes n spatiotemporal attention layers. Each spatiotemporal attention layer includes several spatiotemporal attention modules connected in sequence. The spatiotemporal attention modules at the same position in all spatiotemporal attention layers are connected in sequence, so that the memory state of the temperature prediction model flows through the entire network in a zigzag shape.

[0023] Each spatiotemporal attention module consists of two parts: a context interaction unit and a spatiotemporal memory unit. The context interaction unit includes three attention modules Attention1~Attention3, which are used to store the hidden state information of the lth spatiotemporal attention layer at time t-1. Hidden state information of the l-1th spatiotemporal attention layer at time t The spatiotemporal memory information of the l-1th spatiotemporal attention layer at time t Perform context-related updates to obtain the updated hidden state information of the lth spatiotemporal attention layer at time t-1 Hidden state information of the l-1th spatiotemporal attention layer at time t The spatiotemporal memory information of the l-1th spatiotemporal attention layer at time t

[0024] The spatiotemporal memory unit uses the convolutional long short-term memory unit to capture the time dimension information. At the same time, a self-attention module is added on the basis of the convolutional long short-term memory unit to capture the spatial dimension information, and then the captured spatiotemporal dimension information is fused through a joint mechanism;

[0025] To capture the time dimension information, firstly, according to the updated hidden state information of the l-1th spatiotemporal attention layer at time t, and the hidden state information of the lth spatiotemporal attention layer at time t-1 The temperature change information of the lth spatiotemporal attention layer in the time domain is obtained through the convolutional long short-term memory unit, and then the time memory information of the lth spatiotemporal attention layer at time t-1 is used Generate the temporal memory information of the lth spatiotemporal attention layer at time t The formula is as follows:

[0026]

[0027]

[0028]

[0029]

[0030] Among them, f t For the forget gate, i t is the input gate, g t is the input modulation gate, σ represents the sigmoid activation function, tanh represents the tanh activation function, ° represents the Hadamard product, W xf , W hf , W xi , W hi , W xg , W hg 、b f 、b i 、b g All are learnable parameters;

[0031] To capture spatial dimension information, first, based on the updated hidden state information of the l-1th spatiotemporal attention layer at time t, and the spatiotemporal memory information of the l-1th spatiotemporal attention layer at time t The convolutional long short-term memory unit is used to obtain the temperature change information of the current spatiotemporal attention layer, and then the spatiotemporal memory information of the l-1th spatiotemporal attention layer at time t is updated. Correction is performed to generate the updated spatiotemporal memory information of the lth spatiotemporal attention layer at time t Finally, the self-attention module is used to update the spatiotemporal memory information of the lth spatiotemporal attention layer at time t Pay attention to obtain the spatiotemporal memory information of the lth spatiotemporal attention layer at time t The formula is as follows:

[0032]

[0033]

[0034]

[0035]

[0036]

[0037] Among them, f t ′ is the forget gate, i′ t is the input gate, g′ t is the input modulation gate, SA(·) represents the self-attention module, and W′ xf , W′ xi , W′ xg , W mf , W mi , Wmg , b′ f , b′ i , b′ g All are learnable parameters;

[0038] The updated spatiotemporal memory information of the lth spatiotemporal attention layer at time t As the input of the self-attention module, the spatiotemporal memory information of the lth spatiotemporal attention layer at time t is updated First, convert it into query Q, key K and value V. The formula is as follows:

[0039]

[0040] in, is a trainable 1×1 convolution parameter matrix;

[0041] The output of the self-attention module is the spatiotemporal memory information of the lth spatiotemporal attention layer at time t. The formula is as follows:

[0042]

[0043] O=ATT(Q,K)V (25)

[0044] Among them, W o *O represents the self-attention feature map;

[0045] The model representation of the self-attention module is as follows:

[0046]

[0047] in, is the scale factor.

[0048] Furthermore, in the third step, the attention module Attention1 uses the hidden state information of the l-1th spatiotemporal attention layer at time t Correct and update the hidden state information of the lth spatiotemporal attention layer at time t-1 Thus, the hidden state information of the lth spatiotemporal attention layer at time t-1 is obtained. The formula is as follows:

[0049]

[0050] Specifically, firstly, the hidden state information of the lth spatiotemporal attention layer at time t-1 is Converted into query Q′, the hidden state information of the l-1th spatiotemporal attention layer at time t Converted to key K' and value V', the formula is as follows:

[0051]

[0052]

[0053] Among them, W′ Q is a learnable parameter, is a learnable 1×1 convolution parameter matrix;

[0054] Then, the attention graph is obtained using the query Q′ and key K′ according to formula (8);

[0055]

[0056] Among them, ATT(·) represents the attention operation, is the scale factor, T represents the matrix transpose;

[0057] Finally, according to equations (9) and (10), the updated hidden state information of the lth spatiotemporal attention layer at time t-1 is calculated:

[0058] O′=ATT(Q′,K′)V′ (9)

[0059]

[0060] Among them, (W′ O *O′) represents the attention feature map, through which the hidden state information of the lth spatiotemporal attention layer at time t-1 is obtained. To work, and finally achieved and association, that is, context association.

[0061] Furthermore, the meteorological elements include 2-meter temperature change, low cloud cover, total cloud cover, wind flux V component and 1000hpa wind speed.

[0062] Compared with the prior art, the advantages and beneficial effects of the present invention are:

[0063] 1. In the process of standardizing the spatiotemporal sequence of meteorological elements, the present invention fully considers the impact of the spatiotemporal changes of meteorological elements in the surrounding areas on the temperature of the target area. At the same time, the RWA module is proposed according to the characteristics that different meteorological elements have different degrees of influence on temperature changes, and the influence of each meteorological element on temperature changes is comprehensively considered.

[0064] 2. The spatiotemporal attention module of the present invention includes two parts: a context interaction unit and a spatiotemporal memory unit. The context interaction unit is used to correct and update the input information and context information, save short-term dependency information, and can effectively capture temperature mutations, solving the problem that the input and context in ConvLSTM cannot interact and update to capture temperature mutations. The unit implements context interaction correction and better captures the short-term dependency of meteorological data changes. The spatiotemporal memory unit models the spatiotemporal dimension information to capture the long-term dependency of meteorological data. In order to better capture the long-term dependency of spatial dimension context information, the spatiotemporal memory unit adds a self-attention module on the basis of ConvLSTM. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 It is the overall flow chart of the present invention;

[0066] Figure 2(a) is a spatiotemporal series diagram of the 2-meter temperature of the ECMWF multi-factor meteorological dataset;

[0067] Figure 2(b) is a spatiotemporal series diagram of 2-meter temperature variation of the ECMWF multi-factor meteorological dataset;

[0068] Figure 2(c) is a spatiotemporal series diagram of low cloud cover from the ECMWF multi-factor meteorological dataset;

[0069] Figure 2(d) is a spatiotemporal series diagram of total cloud cover from the ECMWF multi-factor meteorological dataset;

[0070] Figure 2(e) is a spatiotemporal series diagram of the wind flux V component of the ECMWF multi-factor meteorological dataset;

[0071] Figure 2(f) is a spatiotemporal series diagram of 1000 hPa wind speed from the ECMWF multi-factor meteorological dataset;

[0072] Figure 3 It is the overall architecture diagram of the temperature prediction model of the present invention;

[0073] Figure 4 Schematic diagram of the structure of the spatiotemporal attention module of the present invention;

[0074] Figure 5 A schematic diagram of the structure of the attention module of the context interaction unit of the present invention;

[0075] Figure 6 Schematic diagram of the structure of the self-attention module of the spatiotemporal memory unit of the present invention. DETAILED DESCRIPTION

[0076] The technical solution of the present invention is described in detail below in conjunction with the accompanying drawings and specific implementation methods, but the protection scope of the present application is not limited thereto.

[0077] The present invention is a temperature prediction method integrating correlation weighting and spatiotemporal attention (hereinafter referred to as method, see Figure 1-6 ), comprising the following steps:

[0078] The first step is to obtain a meteorological data set, which includes spatiotemporal series data of temperature and multiple meteorological elements;

[0079] Obtain a meteorological dataset, such as the ECMWF multi-factor meteorological dataset. Figure 2 is a subset of the ECMWF multi-factor meteorological dataset. The observation time is from 8:00 on January 1, 2017 to 5:00 on June 10, 2020, covering the longitude and latitude ranges of 105°E-116.25°E and 30°N-41.25°N, respectively. The spatial resolution is 0.25 degrees, the sampling frequency is 3 hours, and the size of the spatiotemporal series data is 45×45 pixels; Figure 2(a) is the spatiotemporal series data of 2-meter temperature. The five meteorological elements most related to the 2-meter temperature are selected for correlation analysis, namely 2-meter variable temperature, low cloud cover, total cloud cover, wind flux V component, and 1000 hpa wind speed. See Figures 2(b) to (f) for schematic diagrams of the spatiotemporal series data;

[0080] The second step is to use the Relevance Weighted Analysis (RWA) module to calculate the correlation between each meteorological element and temperature, weight the correlation between each meteorological element and temperature, and connect the weighted correlation results of each meteorological element in the channel direction to obtain the weighted meteorological spatiotemporal series data;

[0081] Since temperature changes are affected by different meteorological elements to different degrees, in order to fully consider the correlation between different meteorological elements and temperature changes and better guide the temperature forecast task, Grey Relation Analysis (GRA) is used to measure the correlation between temperature and other meteorological elements; GRA is a multi-factor statistical analysis method used to measure the correlation between the development trends of variable sequences. The basic idea of ​​GRA is: first, the original observation data is dimensionless, then the correlation coefficient and correlation degree between the sequences are calculated, and finally multiple factors are sorted according to the size of the correlation value; the specific implementation process is as follows:

[0082] 2-1) Determine the reference sequence and comparison sequence: The reference sequence is a data sequence that reflects the characteristics of the task behavior, and the comparison sequence is a data sequence composed of factors affecting the task behavior. This method considers the influence of different meteorological elements on temperature changes. Therefore, the reference sequence is the spatiotemporal sequence data of 2-meter temperature, and the comparison sequence is the spatiotemporal sequence data of the five meteorological elements of 2-meter temperature change, low cloud cover, total cloud cover, wind flux V component, and 1000hpa wind speed;

[0083] 2-2) Standardization of spatiotemporal series data: In order to make the characteristics of different meteorological elements comparable, the zero mean (Z-score) standardization is applied to standardize the 1000hpa wind speed, total cloud cover, 2-meter temperature change, wind flux V component and low cloud cover. The standardization process of 2-meter temperature is the same. The standardization formula is as follows:

[0084]

[0085] Among them, X tj represents the spatiotemporal sequence of the jth meteorological element at time t, where j = 1, 2, ..., 5, representing 1000 hPa wind speed, total cloud cover, 2-meter temperature change, wind flux V component and low cloud cover respectively; represents the standardized spatiotemporal sequence of the jth meteorological element at time t, μ j represents the mean value of the jth meteorological element in different regions calculated according to the time dimension, σ j represents the standard deviation of the jth meteorological element in different regions, X tj , μ j and σ j All are of size R C×H×W A tensor of , where R represents the tensor space, H represents the height, W represents the width, and C represents the number of channels, which is 1;

[0086] 2-3) Solve the correlation coefficient between the reference sequence and the comparison sequence:

[0087] The degree of association refers to the degree of difference in the geometric shapes between the curves. Therefore, the difference between the curves can be used as a measure of the degree of association. The correlation coefficient ξ of each comparison sequence and the reference sequence in different regions at different times is tj It can be expressed by the following formula:

[0088]

[0089] Among them, ξ tj It represents the correlation coefficient between the temperature in different regions and the jth meteorological element at time t. It represents the minimum difference between the temperature of different regions and the jth meteorological element in the entire time series. Indicates the maximum difference between the temperature of different regions and the jth meteorological element in the entire time series. and All are fixed values, all are R C×H×W Tensor; |·| represents absolute value operation, * represents multiplication operation, represents the space-time series of temperature at time t, represents the difference between the temperature of different regions at time t and the jth meteorological element, ξtj , All are of size R C×H×W ρ represents the resolution coefficient, which is between 0 and 1. The smaller ρ is, the greater the resolution is. In this embodiment, it is 0.5.

[0090] 2-4) Solve the correlation between each meteorological element and temperature:

[0091] Since the correlation coefficient is the correlation between temperature and various meteorological elements at different times, there is more than one value for the correlation, which will cause the calculated information to be too scattered and inconvenient for overall comparison. Therefore, the correlation coefficients at different times in different regions are averaged, and the average value is used to measure the correlation between temperature and various meteorological elements. The correlation calculation formula is as follows:

[0092]

[0093] Among them, r j It represents the correlation between the temperature in different regions and the jth meteorological element, and its size is R C×H×W Tensor of , T′ represents the length of the time series;

[0094] 2-5) Use formula (4) to perform weighted processing on the correlation degree, and connect the weighted correlation results of each meteorological element in the channel direction to obtain the weighted meteorological time-space series data;

[0095]

[0096] Among them, X′ tj It represents the weighted result of the correlation between the jth meteorological element and temperature at time t;

[0097] The weighted results of the correlation between all meteorological elements and temperature are connected in the channel direction to obtain the weighted meteorological spatiotemporal series data X′ t ;

[0098] The third step is to build a temperature forecast model based on a deep learning neural network, input the temperature spatiotemporal series data and the weighted meteorological spatiotemporal series data into the temperature forecast model, and the temperature forecast model outputs the forecast result, that is, the spatiotemporal series temperature image of the local area at the future time;

[0099] 3-1) Construct temperature prediction model: Figure 3 As shown in Figure 2, the temperature prediction model is based on the prediction recurrent neural network (PredRNN). The temperature prediction model includes n spatiotemporal attention layers ( Figure 3 Each spatiotemporal attention layer includes several spatiotemporal attention (STA) modules connected in sequence ( Figure 3The spatiotemporal attention modules at the same position in all spatiotemporal attention layers are connected in sequence, so that the memory state of the temperature prediction model flows through the entire network in a zigzag shape;

[0100] like Figure 4 As shown in the figure, each spatiotemporal attention module consists of two parts: a contextual interaction (CI) unit and a spatiotemporal memory (STM) unit. The contextual interaction unit is used to correct and update the input information and context information, save short-term dependency information, and capture temperature mutations; the spatiotemporal memory unit is used to simultaneously capture the correlation of spatiotemporal dimensions and use the global receptive field to model spatial information; when making temperature forecasts, the spatiotemporal attention module first uses the contextual interaction unit to mutually correct the input information and context information to memorize short-term dependency information, and then uses the spatiotemporal memory unit to model the spatiotemporal dimension information to capture the long-term dependency relationship of meteorological data;

[0101] The context interaction unit updates the input information and context information through the attention mechanism, and uses three attention modules Attention1~Attention3 to update the hidden state information of the lth spatiotemporal attention layer at time t-1. Hidden state information of the l-1th spatiotemporal attention layer at time t The spatiotemporal memory information of the l-1th spatiotemporal attention layer at time t Perform context-related updates to obtain the updated hidden state information of the lth spatiotemporal attention layer at time t-1 Hidden state information of the l-1th spatiotemporal attention layer at time t The spatiotemporal memory information of the l-1th spatiotemporal attention layer at time t

[0102] The internal structures of the three attention modules are the same, such as Figure 5 As shown, the attention module Attention1 uses the hidden state information of the l-1th spatiotemporal attention layer at time t Correct and update the hidden state information of the lth spatiotemporal attention layer at time t-1 Thus, the hidden state information of the lth spatiotemporal attention layer at time t-1 is obtained. The formula is as follows:

[0103]

[0104] Specifically, firstly, the hidden state information of the lth spatiotemporal attention layer at time t-1 is Converted into query Q′, the hidden state information of the l-1th spatiotemporal attention layer at time t Converted to key K' and value V', the formula is as follows:

[0105]

[0106]

[0107] Among them, W′ Q is a learnable parameter, is a learnable 1×1 convolution parameter matrix;

[0108] Then, the attention graph is obtained using the query Q′ and key K′ according to formula (8);

[0109]

[0110] Among them, ATT(·) represents the attention operation, is the scale factor, T represents the matrix transpose;

[0111] Finally, according to equations (9) and (10), the updated hidden state information of the lth spatiotemporal attention layer at time t-1 is calculated:

[0112] O′=ATT(Q′,K′)V′ (9)

[0113]

[0114] Among them, (W′ O *O′) represents the attention feature map, through which the hidden state information of the lth spatiotemporal attention layer at time t-1 is obtained. To work, and finally achieved and association, i.e. context association;

[0115] Similarly, the attention module Attention2 uses the hidden state information of the lth spatiotemporal attention layer at time t-1 Correct and update the hidden state information of the l-1th spatiotemporal attention layer at time t Get the updated hidden state information of the l-1th spatiotemporal attention layer at time t The formula is as follows:

[0116]

[0117] The attention module Attention3 uses the hidden state information of the l-1th spatiotemporal attention layer at time t Correct and update the spatiotemporal memory information of the l-1th spatiotemporal attention layer at time t Get the updated spatiotemporal memory information of the l-1th spatiotemporal attention layer at time t The formula is as follows:

[0118]

[0119] In the context interaction unit, when l = 1, X′ t represents the weighted meteorological spatiotemporal series at time t;

[0120] The spatiotemporal memory unit consists of three parts: time dimension modeling, space dimension modeling, and joint module. The formula is as follows:

[0121]

[0122] Among them, STM l represents the spatiotemporal memory unit of the lth spatiotemporal attention layer, Represents the temporal memory information of the lth spatiotemporal attention layer at time t-1; All are R in size C×H×W Tensor of ;

[0123] The spatiotemporal memory unit uses the convolutional long short-term memory unit (ConvLSTM) to model in the time dimension and capture the temporal correlation of temperature changes. In order to better capture the long-term dependency of spatial context information, the spatiotemporal memory unit adds a self-attention module (Self-Attention) on the basis of ConvLSTM. Finally, the captured spatiotemporal dimension information is fused through a joint mechanism to predict future temperature.

[0124] To capture the time dimension information, firstly, according to the updated hidden state information of the l-1th spatiotemporal attention layer at time t, and the hidden state information of the lth spatiotemporal attention layer at time t-1 The temperature change information of the lth spatiotemporal attention layer in the time domain is obtained through ConvLSTM, and then the time memory information of the lth spatiotemporal attention layer at time t-1 is used Generate the temporal memory information of the lth spatiotemporal attention layer at time t The formula is as follows:

[0125]

[0126]

[0127]

[0128]

[0129] Among them, ft For the forget gate, i t is the input gate, g t is the input modulation gate, σ represents the sigmoid activation function, tanh represents the tanh activation function, ° represents the Hadamard product, W xf , W hf , W xi , W hi , W xg , W hg , b f , b i , b g All are learnable parameters;

[0130] To capture spatial dimension information, first, based on the updated hidden state information of the l-1th spatiotemporal attention layer at time t, and the spatiotemporal memory information of the l-1th spatiotemporal attention layer at time t Use ConvLSTM to obtain the temperature change information of the current spatiotemporal attention layer, and then update the spatiotemporal memory information of the l-1th spatiotemporal attention layer at time t. Correction is performed to generate the updated spatiotemporal memory information of the lth spatiotemporal attention layer at time t Finally, the self-attention module is used to update the spatiotemporal memory information of the lth spatiotemporal attention layer at time t Pay attention to obtain the spatiotemporal memory information of the lth spatiotemporal attention layer at time t The formula is as follows:

[0131]

[0132]

[0133]

[0134]

[0135]

[0136] Among them, f t ′ is the forget gate, i′ t is the input gate, g′ t is the input modulation gate, SA(·) represents the self-attention module, and W′ xf , W′ xi , W′ xg , W mf , W mi , W mg , b′ f , b′ i , b′ gAll are learnable parameters;

[0137] like Figure 6 As shown, the spatiotemporal memory information of the lth spatiotemporal attention layer at time t is updated As the input of the self-attention module, the state of the output layer is constructed by paying attention to the state of the input layer; specifically, the spatiotemporal memory information of the lth spatiotemporal attention layer at time t is updated First, convert it into query Q, key K and value V. The formula is as follows:

[0138]

[0139] in, is a trainable 1×1 convolution parameter matrix;

[0140] The output of the self-attention module is the spatiotemporal memory information of the lth spatiotemporal attention layer at time t. The formula is as follows:

[0141]

[0142] O=ATT(Q,K)V (25)

[0143] Among them, W o *O represents the self-attention feature map;

[0144] The model representation of the self-attention module is as follows:

[0145]

[0146] in, is the scale factor;

[0147] The joint module uses a shared output gate to seamlessly combine the information of the context interaction unit and the spatiotemporal memory unit, that is, to connect the memory information from the horizontal and vertical directions, and then apply a 1×1 convolution layer for dimensionality reduction, so that the hidden state information of the lth spatiotemporal attention layer at time t Memory information with time Spatiotemporal memory information have the same dimensions; the formula for the joint module is as follows:

[0148]

[0149]

[0150] Among them, t represents the output gate, W xo , W ho , W co , W mo 、bo , W 1×1 All are learnable parameters;

[0151] 3-2) The temperature spatiotemporal series data in the meteorological data set obtained in step 1 and the weighted meteorological spatiotemporal series data obtained in step 2 are used as inputs of the temperature forecast model, and the temperature forecast model is trained to obtain a trained temperature forecast model; the trained temperature forecast model is used to predict the temperature of the local area at a future time, and the result is represented by a spatiotemporal series temperature image.

[0152] In order to verify the effect of this method, the ECMWF multi-factor dataset was used to perform temperature forecasting using the prediction recurrent neural network (PredRNN) and the temperature forecast model of this application, and the comparative experimental results shown in Table 1 were obtained.

[0153] Table 1 Comparative experimental results of different models on ECMWF multi-factor dataset

[0154]

[0155] The mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R 2 ) as the evaluation index. It can be seen from Table 1 that compared with PredRNN, the temperature forecast model of the present application has obvious improvements in the three evaluation indicators, indicating that the use of the self-attention module in the spatiotemporal memory unit to capture the correlation of the spatial dimension of meteorological data changes, the use of the context interaction unit to perceive temperature mutations, and the weighting of related meteorological elements are important for improving the multi-factor temperature forecast results and improving the prediction accuracy.

[0156] In order to analyze the influence of RWA module and CI unit on the multi-factor temperature forecast results, the RWA module and CI unit are respectively embedded in the self-attention joint spatiotemporal network model (SA-JSTN) on the ECMWF multi-factor dataset to test their performance. The experimental results are shown in Table 2. The self-attention joint spatiotemporal network model is based on the prediction recurrent neural network (PredRNN), and a self-attention module is added to the spatiotemporal memory unit of PredRNN.

[0157] Table 2 Ablation experimental results of RWA module and CI unit on SA-JSTN

[0158]

[0159] From the experimental results, it can be seen that the SA-JSTN model has achieved performance improvement after adding the RWA module or the CI unit. In addition, embedding the CI unit in the SA-JSTN model is more effective for the temperature forecast task than embedding the RWA module. It should be noted that the best performance is achieved when both the RWA module and the CI unit are embedded in the SA-JSTN model. The experimental results verify the effectiveness of the RWA module and the CI unit.

[0160] Any matters not described in the present invention are applicable to the prior art.

Claims

1. A temperature prediction method integrating correlation weighting and spatiotemporal attention, characterized in that: The method comprises the following steps: The first step is to obtain a meteorological data set, which includes spatiotemporal series data including temperature and multiple meteorological elements; The second step is to calculate the correlation between each meteorological element and temperature, weight the correlation between each meteorological element and temperature, and connect the weighted correlation results of each meteorological element in the channel direction to obtain the weighted meteorological time-space series data; First, the temporal and spatial series data of temperature and various meteorological elements are standardized according to formula (1); Among them, X tj represents the spatiotemporal sequence of the jth meteorological element at time t, represents the standardized spatiotemporal sequence of the jth meteorological element at time t, μ j represents the mean value of the jth meteorological element in different regions calculated according to the time dimension, σ j represents the standard deviation of the jth meteorological element in different regions; Secondly, the correlation coefficient between temperature and various meteorological elements is calculated; Then, the correlation between each meteorological element and temperature is calculated according to formula (3); Among them, r j represents the correlation between the temperature in different regions and the jth meteorological element, ξ tj represents the correlation coefficient between the temperature of different regions at time t and the jth meteorological element, and T' represents the length of the time series; 2-5) Use formula (4) to perform weighted processing on the correlation degree, and connect the weighted results of the correlation degree of each meteorological element in the channel direction to obtain the weighted meteorological time-space series data; Among them, X′ tj It represents the weighted result of the correlation between the jth meteorological element and temperature at time t; The weighted results of the correlation between all meteorological elements and temperature are connected in the channel direction to obtain the weighted meteorological time-space series data; The third step is to build a temperature forecast model based on a deep learning neural network, input the temperature spatiotemporal series data and the weighted meteorological spatiotemporal series data into the temperature forecast model, and the temperature forecast model outputs the forecast result, that is, the spatiotemporal series temperature image of the local area at the future time; The temperature prediction model is based on a predictive recurrent neural network. The temperature prediction model includes n spatiotemporal attention layers. Each spatiotemporal attention layer includes several spatiotemporal attention modules connected in sequence. The spatiotemporal attention modules at the same position in all spatiotemporal attention layers are connected in sequence, so that the memory state of the temperature prediction model flows through the entire network in a zigzag shape. Each spatiotemporal attention module consists of two parts: a context interaction unit and a spatiotemporal memory unit. The context interaction unit includes three attention modules Attention1~Attention3, which are used to store the hidden state information of the lth spatiotemporal attention layer at time t-1. Hidden state information of the l-1th spatiotemporal attention layer at time t The spatiotemporal memory information of the l-1th spatiotemporal attention layer at time t Perform context-related updates to obtain the updated hidden state information of the lth spatiotemporal attention layer at time t-1 Hidden state information of the l-1th spatiotemporal attention layer at time t The spatiotemporal memory information of the l-1th spatiotemporal attention layer at time t The spatiotemporal memory unit uses the convolutional long short-term memory unit to capture the time dimension information. At the same time, a self-attention module is added on the basis of the convolutional long short-term memory unit to capture the spatial dimension information, and then the captured spatiotemporal dimension information is fused through a joint mechanism; To capture the time dimension information, firstly, according to the updated hidden state information of the l-1th spatiotemporal attention layer at time t, and the hidden state information of the lth spatiotemporal attention layer at time t-1 The temperature change information of the lth spatiotemporal attention layer in the time domain is obtained through the convolutional long short-term memory unit, and then the time memory information of the lth spatiotemporal attention layer at time t-1 is used Generate the temporal memory information of the lth spatiotemporal attention layer at time t The formula is as follows: Among them, f t For the forget gate, i t is the input gate, g t is the input modulation gate, σ represents the sigmoid activation function, tanh represents the tanh activation function, represents the Hadamard product, W xf , W hf , W xi , W hi , W xg , W hg , b f , b i , b g All are learnable parameters; To capture spatial dimension information, first, based on the updated hidden state information of the l-1th spatiotemporal attention layer at time t, and the spatiotemporal memory information of the l-1th spatiotemporal attention layer at time t The convolutional long short-term memory unit is used to obtain the temperature change information of the current spatiotemporal attention layer, and then the spatiotemporal memory information of the l-1th spatiotemporal attention layer at time t is updated. Correction is performed to generate the updated spatiotemporal memory information of the lth spatiotemporal attention layer at time t Finally, the self-attention module is used to update the spatiotemporal memory information of the lth spatiotemporal attention layer at time t Pay attention to obtain the spatiotemporal memory information of the lth spatiotemporal attention layer at time t The formula is as follows: Among them, f′ t is the forget gate, i′ t is the input gate, g′ t is the input modulation gate, SA(·) represents the self-attention module, and W′ xf , W′ xi , W′ xg , W mf , W mi , W mg , b′ f , b′ i , b′ g All are learnable parameters; The updated spatiotemporal memory information of the lth spatiotemporal attention layer at time t As the input of the self-attention module, the spatiotemporal memory information of the lth spatiotemporal attention layer at time t is updated First, convert it into query Q, key K and value V. The formula is as follows: in, is a trainable 1×1 convolution parameter matrix; The output of the self-attention module is the spatiotemporal memory information of the lth spatiotemporal attention layer at time t. The formula is as follows: O=ATT(Q,K)V (25) Among them, W o *O represents the self-attention feature map; The model representation of the self-attention module is as follows: in, is the scale factor.

2. The temperature prediction method integrating correlation weighting and spatiotemporal attention according to claim 1 is characterized in that: In the third step, the attention module Attention1 uses the hidden state information of the l-1th spatiotemporal attention layer at time t Correct and update the hidden state information of the lth spatiotemporal attention layer at time t-1 Thus, the hidden state information of the lth spatiotemporal attention layer at time t-1 is obtained. The formula is as follows: Specifically, firstly, the hidden state information of the lth spatiotemporal attention layer at time t-1 is Converted into query Q′, the hidden state information of the l-1th spatiotemporal attention layer at time t Converted to key K' and value V', the formula is as follows: Among them, W′ Q is a learnable parameter, is a learnable 1×1 convolution parameter matrix; Then, the attention graph is obtained using the query Q′ and key K′ according to formula (8); Among them, ATT(·) represents the attention operation, is the scale factor, T represents the matrix transpose; Finally, according to equations (9) and (10), the updated hidden state information of the lth spatiotemporal attention layer at time t-1 is calculated: O′=ATT(Q′,K′)V′ (9) Among them, (W′ O *O′) represents the attention feature map, through which the hidden state information of the lth spatiotemporal attention layer at time t-1 is obtained. To work, and finally achieved and association, that is, context association.

3. The temperature prediction method integrating correlation weighting and spatiotemporal attention according to claim 1 is characterized in that: The meteorological elements include 2-meter temperature change, low cloud cover, total cloud cover, wind flux V component and 1000hpa wind speed.

Citation Information

Patent Citations

  • High-dimensional sequence data prediction method and system based on deep space-time memory network

    CN107958044A

  • A depth-learning air quality prediction method based on multi-model fusion

    CN109214592A