A traffic prediction method and system based on time series decomposition and attention map neural network
Patent Information
- Application Number
- CN202310852697.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-12
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2043-07-12
AI Technical Summary
但是,交通数据固有的时空复杂性、异质性和动态性使交通预测仍然面临着诸多挑战
[0053]有益效果:本发明提供的基于时序分解和注意力图神经网络的交通预测方法及系统,具有以下优点:采用MAE,MAPE,RMSE对方法效果进行评价,通过实验证明本发明方法所提出的基于时序分解和注意力图神经网络的交通预测方法比现有技术的交通预测方法(经典的DCRNN,STGCN,STSGCN,GraphWaveNet,ASTGCN)具有优越的性能。
Smart Images

Figure CN117831268B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a traffic prediction method and system based on temporal decomposition and attention graph neural networks, belonging to the field of machine learning technology. Background Technology
[0002] In recent years, with the rapid development of urban intelligence, Intelligent Transportation Systems (ITS) have played a crucial role in people's daily commutes, traffic management, and urban road planning, becoming increasingly intertwined with people's lives. As a core component of ITS, traffic forecasting uses historical traffic data to comprehensively consider multiple key factors influencing traffic, predicting traffic flow, speed, and density. The quality of these predictions directly affects the robustness and efficiency of ITS, making it a hot research topic in the field. However, the inherent spatiotemporal complexity, heterogeneity, and dynamism of traffic data still present numerous challenges for traffic forecasting. Summary of the Invention
[0003] Objective: To overcome the shortcomings of existing technologies, this invention provides a traffic prediction method and system based on temporal decomposition and attention graph neural networks.
[0004] In a first aspect, the present invention provides a traffic prediction method based on temporal decomposition and attention graph neural networks, comprising:
[0005] Acquire traffic data and transform it into a three-dimensional matrix containing time, space, and feature dimensions;
[0006] The three-dimensional matrix corresponding to the traffic data is input into the pre-trained traffic prediction model, and the traffic prediction result is determined based on the output of the model.
[0007] The traffic prediction model includes, in sequence, an input multilayer perceptron (MLP), an L-layer stacked spatiotemporal block, L convolutional neural network (CNN) layers, and an output multilayer perceptron (MLP). Each spatiotemporal block includes a dual-branch temporal decomposition convolutional neural network (DTDCNN), a multi-head interactive attention network (MIA), and a self-scaling dynamic diffusion graph neural network (SDDGNN). The L-layer stacked spatiotemporal block and the L CNN layers form a one-to-one structure, with one spatiotemporal block paired with one CNN.
[0008] Furthermore, the training method for the traffic prediction model includes:
[0009] Obtain a labeled traffic dataset and convert the traffic data in the dataset into a three-dimensional matrix containing time, space, and feature dimensions.
[0010] The pre-constructed traffic prediction model is trained using the three-dimensional matrix of the traffic dataset to obtain a trained traffic prediction model.
[0011] In some embodiments, traffic data is transformed into a three-dimensional matrix containing time, spatial, and feature dimensions, including:
[0012] The three-dimensional matrix representation of traffic data is as follows Where T is the time for capturing traffic signals, N is the number of nodes in the road network, F is the number of traffic features corresponding to each node, and represents traffic flow and / or traffic speed. Each element... Let N be the features captured at time t. Let n represent the traffic features captured by the nth sensor at time t, where n∈[1,N].
[0013] In some embodiments, the processing of the three-dimensional matrix corresponding to traffic data in the traffic prediction model includes:
[0014] The input multilayer perceptron is used to generate a three-dimensional matrix corresponding to the input traffic data. Mapping to a higher-dimensional space yields the mapped three-dimensional data. Where D is the dimension of the mapped traffic signal features;
[0015] Secondly, the mapped 3D data The spatiotemporal blocks are stacked sequentially through L layers, and the output of each spatiotemporal block is processed by the corresponding convolutional neural network (CNN) layer to obtain the output of each spatiotemporal block. The processing of each spatiotemporal block includes: Let the traffic data input to the l-th spatiotemporal block be... l∈[1,L], where It is obtained by performing a residual connection between the input and output of the (l-1)th spatiotemporal block; firstly, The result is obtained through a Time Decomposition Convolutional Neural Network (DTDCNN). Then, The input is fed into the Multi-Head Interactive Attention Network (MIA) to obtain... Finally, The input is fed into the self-scaling dynamic diffusion graph neural network SDDGNN and obtained
[0016] Finally, the result of stacking L spatiotemporal blocks and L convolutional neural network layers is passed through an output multilayer perceptron (MLP) to obtain the final predicted signal. The specific formula is as follows:
[0017]
[0018] Here, CNN(·) is the convolution operator.
[0019] In some embodiments, The result is obtained through a Time Decomposition Convolutional Neural Network (DTDCNN). The processing steps include:
[0020] The Decomposition of Temporal Sequences (DTDCNN) convolutional neural network consists of two parallel DTDCNN branches and fully connected (FC) layers. The two parallel DTDCNN branches are the first branch TDCNN-a and the second branch TDCNN-b. The first branch and the second branch process the input signal simultaneously. The signals processed by the first and second branches are concatenated and then passed through a fully connected layer (FC) to generate the output signal of DTDCNN.
[0021] TDCNN-a includes a time decomposition module TD-a, parallel convolutional neural network modules TCN-a1 and TCN-a2 that process periodic signals and trend signals respectively, an adder, and an activation function; TDCNN-b includes a time decomposition module TD-b, parallel convolutional neural network modules TCN-b1 and TCN-b2 that process periodic signals and trend signals respectively, an adder, and an activation function.
[0022] TD-a and TD-b are two time-series decomposition modules with the same function; the processing steps of TD-a and TD-b include: in order to eliminate the periodic fluctuations of traffic signals in time and highlight the long-term trend, a moving average algorithm is used to extract the signal. Trend information Secondly, the original signal With trend information Subtraction yields the corresponding periodic signal This enables the temporal decomposition of traffic signals:
[0023]
[0024]
[0025] Where AveragePool(·) is the moving average pooling function, and Pad(·) is the time series fill function. and These are the trend signal and periodic signal of layer l, respectively; the traffic signal is processed by two time-series decomposition modules TD-a and TD-b, which have the same function, and finally yield two sets of parallel trend signals and periodic signals: and and
[0026] The TD-a algorithm is learned using TCN-a1 and TCN-a2 from TDCNN-a. and The TD-b algorithm is learned using TCN-b1 and TCN-b2 from TDCNN-b. and Then an adder is used to... and and The learned traffic signals are summed to obtain the corresponding result. and The formula is as follows:
[0027]
[0028]
[0029] Will and The signals are processed by activation functions, concatenated, and then fully connected (FC) to obtain the output signal of DTDCNN. The formula is as follows:
[0030]
[0031] Here, FC(·) is the fully connected function, concat(·) is the concatenation operation, and g(·) and σ(·) are the activation functions, which are tanh(·) and sigmoid respectively.
[0032] In some embodiments, The input is fed into the Multi-Head Interactive Attention Network (MIA) to obtain... The processing steps include:
[0033] First, the signal input to the MIA The local enhancement processing is performed using the following formula:
[0034]
[0035] in, This is the input signal for the MIA. The new signal is obtained after local enhancement processing; MLP(·) is a multilayer perceptron. The potential learnable matrix that follows a standard normal distribution;
[0036] Secondly Traffic data processed by MIA is obtained using the following formula after the attention network is applied:
[0037]
[0038] Where softmax(·) is the normalization exponential function, and Q1 and K1 are... The query and key after one-dimensional convolution, Q2 and K2 are The query and key-value pairs after one-dimensional convolution, V is The value obtained after FC processing, where α is a hyperparameter.
[0039] In some embodiments, The input is fed into the self-scaling dynamic diffusion graph neural network SDDGNN and obtained The processing steps include:
[0040] First, the Dynamic Diffusion Graph Neural Network (DDGNN) is used to... The processing is as follows:
[0041]
[0042] Among them, W k1 W k2 For learnable weighted matrices, The input signal for SDDGNN, This is the output signal of the DDGNN. To scale and normalize the dynamic adjacency matrix, for transpose, It is a learnable dynamic adjacency matrix. For A apt The transpose of W k3 W k4 The weighted matrix is learnable; K is the accumulation count, E1, These are the learnable parameter matrices;
[0043] Secondly, regarding the obtained Perform self-scaling and obtain the final output of SDDGNN. As shown in the following formula:
[0044]
[0045]
[0046] Where σ(·) is the Sigmoid activation function, FC(·) is the fully connected function, and G is the adaptive scaling factor obtained from the output of DDGNN.
[0047] In a second aspect, the present invention provides a traffic prediction system based on temporal decomposition and attention graph neural networks, including a processor and a storage medium;
[0048] The storage medium is used to store instructions;
[0049] The processor is configured to operate according to the instructions to execute the method according to the first aspect.
[0050] Thirdly, the present invention provides an apparatus comprising: a memory, a processor, and a computer program;
[0051] The computer program is stored in the memory and configured to be executed by the processor to implement the method described in the first aspect above.
[0052] Fourthly, the present invention provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.
[0053] Beneficial Effects: The traffic prediction method and system based on temporal decomposition and attention graph neural network provided by this invention have the following advantages: The effectiveness of the method is evaluated using MAE, MAPE, and RMSE. Experiments have shown that the traffic prediction method based on temporal decomposition and attention graph neural network proposed in this invention has superior performance compared with existing traffic prediction methods (classical DCRNN, STGCN, STSGCN, GraphWaveNet, ASTGCN). Attached Figure Description
[0054] Figure 1 This is a network diagram illustrating a traffic prediction method according to an embodiment of the present invention;
[0055] Figure 2 This is a schematic diagram of a dual-branch temporal decomposition convolutional neural network framework according to an embodiment of the present invention;
[0056] Figure 3 This is a schematic diagram of a multi-head interactive attention network framework according to an embodiment of the present invention;
[0057] Figure 4 This is a schematic diagram of a self-scaling dynamic diffusion graph neural network framework according to an embodiment of the present invention;
[0058] Figure 5 This is a schematic diagram of traffic prediction visualization results according to an embodiment of the present invention. Detailed Implementation
[0059] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.
[0060] In the description of this invention, "several" means one or more, "multiple" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.
[0061] In the description of this invention, the terms "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0062] Example 1
[0063] Firstly, this embodiment provides a traffic prediction method based on temporal decomposition and attention graph neural networks, including:
[0064] Acquire traffic data and transform it into a three-dimensional matrix containing time, space, and feature dimensions;
[0065] The three-dimensional matrix corresponding to the traffic data is input into the pre-trained traffic prediction model, and the traffic prediction result is determined based on the output of the model.
[0066] The traffic prediction model includes, in sequence, an input multilayer perceptron (MLP), an L-layer stacked spatiotemporal block, L convolutional neural network (CNN) layers, and an output multilayer perceptron (MLP). Each spatiotemporal block includes a dual-branch temporal decomposition convolutional neural network (DTDCNN), a multi-head interactive attention network (MIA), and a self-scaling dynamic diffusion graph neural network (SDDGNN). The L-layer stacked spatiotemporal block and the L CNN layers form a one-to-one structure, with one spatiotemporal block paired with one CNN.
[0067] Furthermore, the training method for the traffic prediction model includes:
[0068] Obtain a labeled traffic dataset and convert the traffic data in the dataset into a three-dimensional matrix containing time, space, and feature dimensions.
[0069] The pre-constructed traffic prediction model is trained using the three-dimensional matrix of the traffic dataset to obtain a trained traffic prediction model.
[0070] like Figure 1 The diagram shows a network schematic of a traffic prediction method based on temporal decomposition and attention graph neural networks provided in this embodiment. The method includes: 1) reading traffic data and converting it into a matrix corresponding to three-dimensional traffic data containing time, space, and feature dimensions; 2) the system, according to the traffic data processing flow, includes an input multilayer perceptron (MLP), an L-layer stacked spatiotemporal block, L convolutional neural network layers (CNN), and an output multilayer perceptron (MLP). Each spatiotemporal block includes three parts: a dual-branch temporal decomposition convolutional neural network (DTDCNN), a multi-head interactive attention network (MIA), and a self-scaling dynamic diffusion graph neural network (SDDGNN). Experiments show that the proposed traffic prediction method and system based on temporal decomposition and attention graph neural networks have superior performance.
[0071] First, read the data from the traffic dataset and convert it into a three-dimensional matrix containing time, space, and feature dimensions. This is typically represented as a three-dimensional tensor. Where T is the time for capturing traffic signals, N is the number of nodes in the road network, and F is the number of traffic features corresponding to each node, which are generally traffic flow or traffic speed.
[18] Each element Let N be the features captured at time t. Let n represent the traffic features captured by the nth sensor at time t, where n∈[1,N].
[0072] Second, the obtained traffic data corresponding to a 3D matrix is sequentially passed through an input multilayer perceptron (MLP), an L-layer stacked spatiotemporal block, L graph convolutional neural network layers, and an output multilayer perceptron (MLP). The L-layer stacked spatiotemporal block and the L convolutional neural network layers form a one-to-one structure, meaning one spatiotemporal block is paired with one graph convolutional neural network. Specifically, the data processing flow is as follows:
[0073] First, the input MLP is used to input the original traffic signals. Mapping to a higher-dimensional space yields Where D is the dimension of the mapped traffic signal features;
[0074] Secondly, the obtained The spatiotemporal blocks are stacked sequentially through L layers. The output of each spatiotemporal block is processed by a CNN to obtain the output of each spatiotemporal block. Specifically, the process of processing the l-th spatiotemporal block is used as an example to illustrate the flow of each spatiotemporal block, where l∈[1,L]: Assume that the traffic data input to the l-th spatiotemporal block is... in It is obtained by performing a residual connection between the input and output of the (l-1)th spatiotemporal block. First, Obtained through the DTDCNN module Then, Input into the MIA module to get Finally, Input into the SDDGNN module and obtain
[0075] Finally, the result of stacking L spatiotemporal blocks and L convolutional neural network layers is passed through an output MLP layer to obtain the final predicted signal. The specific formula is as follows:
[0076]
[0077] Here, CNN(·) is the convolution operator.
[0078] Figure 2 This is a two-branch temporal decomposition convolutional neural network framework, through... Figure 2 It can be seen Obtained through the DTDCNN module The processing procedure is as follows:
[0079] The DTDCNN module includes two parallel Temporal Decomposition Convolutional Neural Network branches, namely TDCNN-a and TDCNN-b, which simultaneously process the traffic signals input to their respective branches. Subsequently, the new traffic signals obtained from the two branches are spliced together and passed through a fully connected layer (FC) to generate the final traffic signal of the DTDCNN module. TDCNN-a includes a time-series decomposition module TD-a, parallel convolutional neural network modules TCN-a1 and TCN-a2 that process periodic and trend signals respectively, an adder, and an activation function. Similarly, TDCNN-b includes a time-series decomposition module TD-b, parallel convolutional neural network modules TCN-b1 and TCN-b2 that process periodic and trend signals respectively, an adder, and an activation function.
[0080] TD-a and TD-b are two time-series decomposition modules with the same function. Taking TD-a as an example to explain its data processing, firstly, in order to eliminate the periodic fluctuations of traffic signals over time and highlight the long-term trend, the TD-a module uses the Moving Average (MA) algorithm to extract trend information from the traffic signals; secondly, the TD-a module subtracts the trend information from the original traffic signals to obtain the corresponding periodic signals, thereby realizing the time-series decomposition of traffic signals, as shown below:
[0081]
[0082]
[0083] Where AveragePool(·) is the moving average pooling function, and Pad(·) is the time series fill function. and These are the trend signal and periodic signal for layer l, respectively. The traffic signals are processed through two functionally identical time-series decomposition modules, TD-a and TD-b, ultimately yielding two sets of parallel trend and periodic signals: and and
[0084] Next, TCN-a1 and TCN-a2 from TDCNN-a are used to learn the TD-a obtained. and Simultaneously, TCN-b1 and TCN-b2 from TDCNN-b are used to learn the TD-b result. and Then an adder is used to... and and The learned traffic signals are summed to obtain the corresponding result. and The formula is as follows:
[0085]
[0086]
[0087] Then and After processing by activation functions, concatenation, and fully connected (FC) modules, the final result of the DTDCNN module is obtained, as shown in the following formula:
[0088]
[0089] Here, FC(·) is the fully connected function, concat(·) is the concatenation operation, and g(·) and σ(·) are the activation functions, which are tanh(·) and sigmoid respectively.
[0090] Figure 3 For a multi-head interactive attention network framework, through Figure 3 It can be seen that Input into the MIA module to get The processing procedure is as follows:
[0091] First, the traffic data input into the MIA module. The local enhancement processing is performed using the following formula:
[0092]
[0093] in, The input traffic signal for the MIA module. The signal obtained after LANet processing is a new signal, and MLP(·) is a multilayer perceptron. It is a potential learnable matrix that follows a standard normal distribution.
[0094] Secondly, the traffic data after MIA processing is obtained using the following formula:
[0095]
[0096] Where softmax(·) is the normalization exponential function, and Q1 and K1 are... The query and key after one-dimensional convolution, Q2 and K2 are The query and key-value pairs after one-dimensional convolution, V is The value obtained after FC processing, where α is a hyperparameter.
[0097] Figure 4 For a self-scaling dynamic diffusion graph neural network framework, through Figure 4 It can be seen that Input into the SDDGNN module and obtain The processing procedure is described in detail below:
[0098] First, a Dynamically Diffused Graph Neural Network (DDGNN) is used to... The processing is as follows:
[0099]
[0100] Among them, W k1 W k2 For learnable weighted matrices, The input signal for SDDGNN, This is the output signal of the DDGNN. To scale and normalize the dynamic adjacency matrix, for transpose, It is a learnable dynamic adjacency matrix. For A apt The transpose of W k3 W k4 The matrix is a learnable weighted matrix, where K is the number of accumulations, set to 3 here, E1, These are the learnable parameter matrices.
[0101] Secondly, regarding the obtained Perform self-scaling and obtain the final output of SDDGNN. As shown in the following formula:
[0102]
[0103]
[0104] Where σ(·)Sigmoid is the activation function, FC(·) is the fully connected function, and G is the adaptive scaling factor obtained from the output of DDGNN.
[0105] Figure 5 To visualize the traffic prediction results and provide a clear and intuitive evaluation of the invention's traffic prediction effectiveness, the predicted and actual values of the PEMS04 dataset are visualized using existing advanced prediction methods such as D2STGNN and Graph WaveNet. Figure 5 As shown. Figure 5 This is a visualization of the predicted and actual values for the first two days of data from node 50 of the PEMS04 traffic dataset, where green represents the actual value and blue represents the predicted value. Figure 5 As can be seen, there are two regions where the predicted values and actual values of this invention do not have a very high degree of fit, while Graph WaveNet has five regions with poor fit, and D2STGNN has seven regions with poor fit. In summary, the traffic prediction method and system based on temporal decomposition and attention graph neural networks proposed in this paper have the best performance.
[0106] Example 2
[0107] Secondly, based on Embodiment 1, this embodiment provides a traffic prediction system based on temporal decomposition and attention graph neural network, including a processor and a storage medium;
[0108] The storage medium is used to store instructions;
[0109] The processor is configured to operate according to the instructions to execute the method according to Embodiment 1.
[0110] Example 3
[0111] Thirdly, based on Embodiment 1, this embodiment provides a device, including,
[0112] Memory;
[0113] processor;
[0114] as well as
[0115] Computer programs;
[0116] The computer program is stored in the memory and configured to be executed by the processor to implement the method described in Embodiment 1.
[0117] Example 4
[0118] Fourthly, based on Embodiment 1, this embodiment provides a storage medium on which a computer program is stored, and when the computer program is executed by a processor, it implements the method described in Embodiment 1.
[0119] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0120] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0121] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0122] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0123] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A traffic prediction method based on temporal decomposition and attention graph neural networks, characterized in that, include: Acquire traffic data and transform it into a three-dimensional matrix containing time, space, and feature dimensions; The three-dimensional matrix corresponding to the traffic data is input into the pre-trained traffic prediction model, and the traffic prediction result is determined based on the output of the model. The traffic prediction model includes, in sequence, an input multilayer perceptron (MLP), an L-layer stacked spatiotemporal block, L convolutional neural network (CNN) layers, and an output multilayer perceptron (MLP). Each spatiotemporal block includes a dual-branch temporal decomposition convolutional neural network (DTDCNN), a multi-head interactive attention network (MIA), and a self-scaling dynamic diffusion graph neural network (SDDGNN). The L-layer stacked spatiotemporal block and the L CNN layers form a one-to-one structure, with one spatiotemporal block paired with one CNN. The processing of each spatiotemporal block includes: Let the traffic data input to the l-th spatiotemporal block be... , ,in It is obtained by performing a residual connection between the input and output of the (l-1)th spatiotemporal block; firstly, The result is obtained through a Time Decomposition Convolutional Neural Network (DTDCNN). Then, The input is fed into the Multi-Head Interactive Attention Network (MIA) to obtain... Finally, The input is fed into the self-scaling dynamic diffusion graph neural network SDDGNN and obtained ; Will The input is fed into the self-scaling dynamic diffusion graph neural network SDDGNN and obtained The processing steps include: First, the Dynamic Diffusion Graph Neural Network (DDGNN) is used to... The processing is as follows: ; in, , For learnable weighted matrices, The input signal for SDDGNN, This is the output signal of the DDGNN. To scale and normalize the dynamic adjacency matrix, for transpose, For learnable dynamic adjacency matrix, for transpose, , It is a learnable weighted matrix; To accumulate the number of times, These are the learnable parameter matrices; Secondly, regarding the obtained Perform self-scaling and obtain the final output of SDDGNN. As shown in the following formula: ; in, It is the Sigmoid activation function. It is a fully connected function. This is the adaptive scaling factor obtained from the DDGNN output.
2. The method according to claim 1, characterized in that, The training method for the traffic prediction model includes: Obtain a labeled traffic dataset and convert the traffic data in the dataset into a three-dimensional matrix containing time, space, and feature dimensions. The pre-constructed traffic prediction model is trained using the three-dimensional matrix of the traffic dataset to obtain a trained traffic prediction model.
3. The method according to claim 1 or 2, characterized in that, The traffic data is transformed into a three-dimensional matrix containing time, space, and feature dimensions, including: The three-dimensional matrix representation of traffic data is as follows ,in, To capture the timing of traffic signals, The number of nodes in the road network. The number of traffic features corresponding to each node, representing traffic flow and / or traffic speed, for each element. for Capture in real time The characteristics of each node, Indicates the first One sensor in Real-time traffic characteristics captured. .
4. The method according to claim 3, characterized in that, The processing of the three-dimensional matrix corresponding to traffic data in the traffic prediction model includes: The input multilayer perceptron is used to generate a three-dimensional matrix corresponding to the input traffic data. Mapping to a higher-dimensional space yields the mapped three-dimensional data. ,in The feature dimension of the mapped traffic signal; Secondly, the mapped 3D data The spatiotemporal blocks are stacked in L layers in sequence, and the output of each spatiotemporal block is processed by the corresponding convolutional neural network (CNN) layer to obtain the output of each spatiotemporal block. Finally, the result of stacking L spatiotemporal blocks and L convolutional neural network layers is passed through an output multilayer perceptron (MLP) to obtain the final predicted signal. The specific formula is as follows: ; in, It is a convolution operator.
5. The method according to claim 4, characterized in that, The result is obtained through a Time Decomposition Convolutional Neural Network (DTDCNN). The processing steps include: The Decomposition of Temporal Sequences (DTDCNN) convolutional neural network consists of two parallel DTDCNN branches and fully connected (FC) layers. The two parallel DTDCNN branches are the first branch TDCNN-a and the second branch TDCNN-b. The first branch and the second branch process the input signal simultaneously. The signals processed by the first and second branches are concatenated and then passed through a fully connected (FC) layer to generate the output signal of DTDCNN. ; TDCNN-a includes a time decomposition module TD-a, parallel convolutional neural network modules TCN-a1 and TCN-a2 that process periodic signals and trend signals respectively, an adder, and an activation function; TDCNN-b includes a time decomposition module TD-b, parallel convolutional neural network modules TCN-b1 and TCN-b2 that process periodic signals and trend signals respectively, an adder, and an activation function. TD-a and TD-b are two time-series decomposition modules with the same function; the processing steps of TD-a and TD-b include: in order to eliminate the periodic fluctuations of traffic signals in time and highlight the long-term trend, a moving average algorithm is used to extract the signal. Trend information Secondly, the original signal With trend information Subtraction yields the corresponding periodic signal This enables the temporal decomposition of traffic signals. ; in This is the moving average pooling function. Fill functions for time series data. and These are the trend signal and periodic signal of layer l, respectively; the traffic signal is processed by two time-series decomposition modules TD-a and TD-b, which have the same function, and finally yield two sets of parallel trend signals and periodic signals: and , and ; The TD-a algorithm is learned using TCN-a1 and TCN-a2 from TDCNN-a. and The TD-b algorithm is learned using TCN-b1 and TCN-b2 from TDCNN-b. and Then an adder is used to... and , and The learned traffic signals are summed to obtain the corresponding result. and The formula is as follows: ; Will and The signals are processed by activation functions, concatenated, and then fully connected (FC) to obtain the output signal of DTDCNN. The formula is as follows: ; in, It is a fully connected function. For splicing operations, and For the activation function, we select the following respectively: The function and the Sigmoid function.
6. The method according to claim 4, characterized in that, Will The input is fed into the Multi-Head Interactive Attention Network (MIA) to obtain... The processing steps include: First, the signal input to the MIA The local enhancement processing is performed using the following formula: ; in, This is the input signal for the MIA. This is the new signal obtained after local enhancement processing. It is a multilayer perceptron. The potential learnable matrix that follows a standard normal distribution; Secondly Traffic data processed by MIA is obtained using the following formula after the attention network is applied: ; in, For normalized exponential functions, and yes Query and key after one-dimensional convolution processing and yes Query and key-value pairs after one-dimensional convolution processing for The value obtained after FC processing This is a hyperparameter.
7. A traffic prediction system based on temporal decomposition and attention graph neural networks, characterized in that, Including processor and storage media; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to perform the method according to any one of claims 1 to 6.
8. A device, characterized in that, include: Memory, processor, and computer programs; The computer program is stored in the memory and configured to be executed by the processor to implement the method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, It stores a computer program thereon, which, when executed by a processor, implements the method described in any one of claims 1 to 6.