Multivariable time series data prediction method based on interactive two-dimensional convolution

By introducing frequency domain analysis and interactive two-dimensional convolution into the CNN method, the problem of local field of view limitation and multi-variable correlation capture is solved, and the accuracy and robustness of time series data prediction are improved.

CN118710933APending Publication Date: 2024-09-27HANGZHOU DIANZI UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410749741.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

Existing CNN methods have local field of view limitations in time series data prediction, are difficult to capture long-term time variables, and lack effective capture of correlations between multi-variable dimensions.

Method used

A global field of view compensation mechanism and two-dimensional convolution based on frequency domain analysis are used to obtain global features through Fourier transform, and interactive two-dimensional convolution is used to break the spatial continuity of variables to improve model robustness and prediction accuracy.

Benefits of technology

Effectively captures the correlation between long-term time variables and multi-variables, improving the accuracy of time series data prediction and the robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118710933A
    Figure CN118710933A
Patent Text Reader

Abstract

The invention discloses a multivariable time series data prediction method based on interactive two-dimensional convolution, and belongs to the field of time series data prediction.The method comprises the steps that firstly, time series data are recorded and collected regularly or continuously; and secondly, constructing a multivariable time series data prediction model, and inputting the collected time series data to obtain a prediction result. And finally, training and testing the multivariable time series data prediction model. The method effectively captures long-term time variables, improves prediction precision, breaks variable space continuity, helps to fully capture correlation between variables, improves model robustness, and is suitable for multivariable time series data prediction tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of time series data prediction, and in particular relates to a multivariate time series data prediction method based on interactive two-dimensional convolution. Background Art

[0002] With the advancement of digitalization and the widespread access of various IoT sensors in society, a large amount of time series data from different fields is constantly being generated at an astonishing rate. Time series data refers to time series data, which represents a data column recorded in chronological order with the same and unified indicators. Time series data prediction is a task that extrapolates time series to the future. It is usually defined as using a given lookback window of size T to predict a forecast window of size L. The importance of time series data prediction to modern society is self-evident, and it has many major application scenarios: such as commodity sales, traffic flow, energy consumption and supply, volatility in financial venture capital, and natural disaster analysis.

[0003] The current methods used for time series data prediction tasks are mainly based on deep learning, using appropriate machine deep learning models to predict time series data. The models used are mainly recurrent neural network (RNN), Transformer model and convolutional neural network (CNN) methods.

[0004] Among them, the recurrent neural network method has serious gradient vanishing and gradient explosion problems, and is difficult to train. It performs poorly in long-sequence time series prediction tasks. At the same time, the recurrent neural network method is a serial calculation, which leads to a huge consumption of memory during the training process; the self-attention mechanism of the Transformer model represents the global dependency through the interaction of attention scores, but the sorting invariance caused by its calculation method makes it easy to capture false time variable relationships and cause large computational overhead, which is not suitable for task scenarios with strict time requirements; convolutional neural networks benefit from the ability and efficiency of extracting local features by convolution operations, and have efficient processing capabilities for time series data. They can sense the changes in historical data for a period of time and make predictions based on the changes in this period of historical data. However, due to the size limit of its convolution kernel, it is difficult to have a global perspective and cannot capture long-term time variables well. At the same time, the existing methods mainly use one-dimensional convolution, which is difficult to capture the correlation between variables. Summary of the invention

[0005] The present invention aims to improve the defects of the existing CNN prediction method that it has only a local field of view, which makes it difficult to capture long-term time variables and lacks the capture of correlations between multivariate dimensions. According to a global field of view compensation mechanism based on frequency domain analysis and two-dimensional (2D) convolution in image mode, a multivariate time series data prediction method based on interactive two-dimensional convolution is proposed, which includes the following steps:

[0006] Step 1: Time series data collection:

[0007] Time series data is recorded and collected regularly or continuously using a variety of methods including sensors, observation equipment, etc.; the time series data includes multiple data items, and for each data item, its data value includes a corresponding unified timestamp and an observation value.

[0008] Step 2: Build a multivariate time series data prediction model, input the collected time series data, and obtain the prediction results.

[0009] Step 2.1: Model initialization:

[0010] Select the convolutional network according to the prediction task, and initialize the prediction model and corresponding hyperparameters; the hyperparameters include the number of frequency components K, the hidden layer feature size D, the number of layers L, etc. The number of frequency components indicates the number of frequencies retained when obtaining the global view, and the hidden layer size indicates the unified dimension of the tensor when participating in the calculation.

[0011] Step 2.2: Encode the input time series data of size T×F to obtain the time series features:

[0012] For the input time series data of size T×F, T represents the time dimension of the input data, and F represents the variable dimension size of the input data; the variable dimension size of the input data is mapped from F to D using value encoding, position encoding, and time encoding in sequence, where value encoding is convolution using a one-dimensional convolution kernel, position encoding is generating a position encoding matrix based on the relative position order, and time encoding is generating a corresponding mixed time embedding vector based on the timestamp of the input time series data feature; the input data is expanded out of the channel dimension, and the length of the time dimension is padded with zeros to T+P, where P represents the prediction length, and the time series feature is obtained with a size of 1×(T+P)×D.

[0013] Step 2.3: Obtain global features based on Fourier transform:

[0014] Eliminate the channel dimension of the input data and only retain the time dimension and variable dimension; use fast Fourier transform along the time dimension (only the first T time steps, excluding the prediction length P) to obtain the average frequency domain result; select K key frequency components with the largest amplitude for inverse Fourier transform, and obtain the corresponding time domain result (including the prediction length P) as the pre-result of the global vision, whose size is 1×(T+P)×1; use 1D convolution to increase the dimension of the pre-result to obtain the global feature, whose size is 1×(T+P)×D.

[0015] Step 2.4: Based on the time series features, extract the local time variable features through interactive two-dimensional convolution:

[0016] The convolutional network is used to perform two-dimensional convolution operations on the time series features to capture the local time variable features. The adjusted convolutional neural network model can reduce the variable dimension and increase the channel dimension while keeping the size of the time dimension unchanged, and obtain an intermediate feature size of D×(T+P)×1; then the channel dimension and variable dimension of the convolution result are exchanged. While keeping the time axis stable, the continuity of the multivariate time series data in the variable space is disrupted to a certain extent, which helps the subsequent extraction of local time variable features and improves the robustness of the model, and obtains the local time variable feature: 1×(T+P)×D.

[0017] Step 2.5: Add the global features obtained and the local time variable features obtained by two-dimensional interactive convolution to the corresponding position features as the current output to obtain the output feature: 1×(T+P)×D.

[0018] Step 2.6: Eliminate the channel dimension; use the fully connected layer to map the variable dimension size of the last layer output from D back to the original size F, and intercept the prediction window to obtain the final prediction result Prediction, with a size of P×F.

[0019] Step 3: Train and test the multivariate time series data prediction model.

[0020] Compared with the existing prediction method based on convolutional neural network, the advantages of the present invention are:

[0021] The present invention proposes a global view compensation mechanism based on frequency domain analysis to help effectively capture long-term time variables and improve prediction accuracy.

[0022] Two-dimensional convolution is used instead of one-dimensional convolution to model variables of different dimensions in an image processing mode, and interactive operations are used to break the spatial continuity of variables, which helps to fully capture the correlation between variables and improve the robustness of the model. It is suitable for multivariate time series data prediction tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1A flowchart of the overall architecture of the present invention;

[0024] Figure 2 Flow chart of the 2D convolution process of the present invention;

[0025] Figure 3 Flow chart of the global field of view compensation mechanism of the present invention. DETAILED DESCRIPTION

[0026] The following is a further description of a multivariate time series data prediction method based on interactive two-dimensional convolution proposed by the present invention in conjunction with the accompanying drawings.

[0027] like Figure 1 The figure shows the overall flow chart of the method of the present invention, wherein the input data is encoded through time series data, and its original variable dimension size is mapped to the hidden feature dimension size D; it passes through L processing layers stacked with a residual structure in sequence; each processing layer is provided with a frequency analysis module and a 2D convolution module, wherein the frequency analysis module obtains the global view by extracting K key frequency components, and the 2D convolution module captures the local correlation between multiple variables; depending on the complexity of the task, one or two independent convolution modules can be set to perform two convolution processes respectively; in each layer, the global view is obtained first and then the convolution operation is performed, and the obtained global view is added to the convolution result.

[0028] Taking the Electricity dataset as an example, a time series data prediction model is constructed. The dataset describes the electricity consumption of 321 users. The specific steps are as follows:

[0029] Step 1: According to the characteristics of the dataset and the complexity of the task, set the number of layers L = 3, the feature dimension D = 256, and the number of frequency components K = 5; set two ResNet18 convolutional backbone networks N1 and N2 for each layer to perform the first convolution and the second convolution respectively; set the input window length to 96 and the prediction window to 96, that is, use the data of the past 96 time steps to predict the situation of the next 96 time steps.

[0030] Step 2: For the given Input: 96×321, the original input is mapped using value encoding, position encoding, and time encoding, from the original 96×321 to 96×256; the value encoding is a one-dimensional convolution of the original data with a step size of 1 along the time axis; the position encoding is to construct an increasing matrix of (0,96) to represent the data position; the time encoding is to generate the corresponding mixed time embedding vector (year, month, week, day, hour, minute) according to the data timestamp; the channel dimension is expanded and the prediction window is expanded using the method of adding 0, so that the data changes from the original 96×321 to 1×192×256, where 1 is the channel dimension size, 192 is the time axis length, and 256 is the variable dimension size.

[0031] Step 3: Only retain the time dimension and variable dimension, and use fast Fourier transform along the time dimension (only the first 96 time steps, that is, the input window, excluding the prediction window) to obtain the corresponding average frequency domain results of the time domain input; the front part of the result is the low-frequency component, and the back part is the high-frequency component; take its absolute value to get the amplitude of each frequency component; select 5 key frequency components according to the amplitude, perform inverse Fourier transform and perform dimensionality increase processing, and the result is used as the global view (this time including the prediction window, the time axis length of the result is 192).

[0032] Step 4: Get the global view and perform convolution; for the input Input of the current layer: 1×192×256, perform step 3 to extract the global view Peek1; use the convolution backbone network N1 to convolve the Input. During the convolution process, the dimension of the input variable is reduced, the channel dimension is increased, and the time dimension is kept unchanged to obtain the output tensor Tensor: 256×192×1.

[0033] Step 5: Exchange the channel dimension and variable dimension of the Tensor obtained after convolution, disrupt the spatial continuity of the variable, and restore the original shape: 1×192×256; perform step 3 again, extract the global view Peek2, and add Peek1 to the result of the first convolution; use the convolution backbone network N2 to perform a second convolution on the result. Also in the convolution process, reduce the variable dimension and increase the channel dimension while keeping the time dimension unchanged to obtain the output Tensor: 256×192×1; exchange the channel dimension and variable dimension of the output Tensor to obtain the Tensor shape: 1×192×256, and add it to the global view Peek2 to obtain the current layer output.

[0034] Step 6: Repeat steps 4 to 5 until the number of layers L encountered is completed; eliminate the channel dimension of the last layer output, and use the fully connected layer to map the variable dimension size of the last layer output from D back to its original size 321; take the data of the last 96 time steps on the time axis, that is, the prediction window, as the prediction result. The experimental results are shown in Table 1.

[0035] Table 1 Module validity verification

[0036]

[0037] Among them, no global vision means deleting the frequency extraction module and only performing interactive two-dimensional convolution; two-dimensional convolution means retaining the frequency extraction module, but no interaction is performed during convolution; one-dimensional convolution means that both modules are deleted and only one-dimensional convolution is used.

[0038] Figure 2The shape change of the input data in the processing layer. As shown in the figure, the input data is executed in the processing layer in sequence: get global view-convolution-exchange-get global view-convolution-exchange. Its original shape is b×1×s×d, where b represents the batch size, 1 represents the number of channels, s represents the data length, and d represents the number of variables; after the input data is convolved, its number of channels will increase to d, the number of variables will decrease to 1, and the data length will remain unchanged; after the input data is exchanged, its channel dimension and variable dimension will be exchanged, so that the original variable dimension becomes the new channel dimension and the original channel dimension becomes the new variable dimension, breaking the continuity of the variable space while keeping the time axis stable, helping to effectively capture the correlation between variables, while restoring the original shape to make the processing coherent.

[0039] Figure 3 The flowchart for obtaining the global view is shown in the figure. As shown in the figure, the time domain representation of the input data is transformed by fast Fourier transform to obtain the corresponding frequency domain representation. The top-K key frequency components with the largest amplitude are selected for inverse Fourier transform to obtain the global view.

Claims

1. A multivariate time series data prediction method based on interactive two-dimensional convolution, characterized in that: The following steps are involved: Step 1: Record regularly or continuously to collect time series data; Step 2: Build a multivariate time series data prediction model, input the collected time series data, and obtain the prediction results; Step 3: Train and test the multivariate time series data prediction model.

2. The method for predicting multivariate time series data based on interactive two-dimensional convolution according to claim 1, characterized in that: In step 1, the time series data includes multiple data items, and for each data item, its data value includes a corresponding unified timestamp and an observed value.

3. The multivariate time series data prediction method based on interactive two-dimensional convolution according to claim 2 is characterized in that: Step 2: The specific process is as follows: Step 2.1: Select a convolutional network according to the prediction task, and initialize the prediction model and corresponding hyperparameters; Step 2.2: Encode the input time series data of size T×F to obtain time series features of size 1×(T+P)×D; Step 2.3: Obtain global features based on Fourier transform, with a size of 1×(T+P)×D; Step 2.4: Based on the temporal features, extract the local time variable features through interactive 2D convolution with a size of 1×(T+P)×D; Step 2.5: Add the global features and the corresponding position features of the local time variable features as the current output to obtain the output features with a size of 1×(T+P)×D; Step 2.6: Eliminate the channel dimension; use the fully connected layer to map the output variable dimension size from D back to F, and intercept the prediction window to obtain a prediction result of size P×F.

4. The method for predicting multivariate time series data based on interactive two-dimensional convolution according to claim 3, characterized in that: In the hyperparameters described in step 2.1, the number of frequency components K represents the number of frequencies retained when obtaining the global view, and the hidden layer size D represents the dimension of the variables of the unified tensor when participating in the calculation.

5. The method for predicting multivariate time series data based on interactive two-dimensional convolution according to claim 3, characterized in that: The specific process of obtaining the time series feature is as follows: for the input time series data Input: T×F, T represents the time dimension of the input data, and F represents the variable dimension size of the input data; the variable dimension size of the input data is mapped from F to D using value coding, position coding, and time coding in sequence, wherein the value coding is convolution using a one-dimensional convolution kernel, the position coding is generating a position coding matrix according to the relative position sequence, and the time coding is generating a corresponding mixed time embedding vector according to the timestamp of the input time series data feature; the input data is expanded out of the channel dimension, and the length of the time dimension is padded with zeros to T+P, wherein P represents the prediction length, and the time series feature is obtained, and the size is 1×(T+P)×D.

6. The method for predicting multivariate time series data based on interactive two-dimensional convolution according to claim 5, characterized in that: The specific process of obtaining the global features is as follows: eliminating the channel dimension of the input data and retaining only the time dimension and the variable dimension; using fast Fourier transform to obtain the average frequency domain result along the time dimension before zero padding; selecting K frequency components with the largest amplitude for inverse Fourier transform, and obtaining the corresponding time domain result as the pre-result of the global vision, whose size is 1×(T+P)×1; using 1D convolution to increase the dimension of the pre-result to obtain the global feature, whose size is 1×(T+P)×D.

7. The method for predicting multivariate time series data based on interactive two-dimensional convolution according to claim 6, characterized in that: The specific process of extracting local time variable features is as follows: using a convolutional network to perform a two-dimensional convolution operation on the time series features to capture local time variable features. The adjusted convolutional neural network model reduces the variable dimension and increases the channel dimension while keeping the size of the time dimension unchanged, and obtains an intermediate feature size of D×(T+P)×1; then the channel dimension and the variable dimension of the convolution result are exchanged to obtain a local time variable feature with a size of 1×(T+P)×D.

Citation Information

Patent Citations

  • Multivariable input and multivariable output time series prediction method and system

    CN112561704A

  • Multivariable time sequence prediction method and system based on multi-axis fusion

    CN118070214A