Search

CN-121505880-B - Traffic flow prediction method based on convolution of double-attention and depth separable graphs

CN121505880BCN 121505880 BCN121505880 BCN 121505880BCN-121505880-B

Abstract

The invention relates to the technical field of intelligent traffic and discloses a traffic flow prediction method based on convolution of a double-attention and depth separable graph. The method comprises the steps of representing road network traffic data obtained through historical observation in a graph structure mode to obtain a road network node set and an adjacent matrix, representing historical observation values of all nodes of a road network by a signal matrix, intercepting an input signal matrix from the road network signal matrix according to a preset time step, preprocessing the input signal matrix and the adjacent matrix to generate a feature aggregation matrix, obtaining a double-attention force diagram from the feature aggregation matrix through a double-attention mechanism, obtaining a depth separable graph from the feature aggregation matrix through a depth separable graph convolution, carrying out weighted fusion on the double-attention force diagram, the depth separable graph and the feature aggregation matrix to obtain a final embedded graph, and calculating and generating traffic flow prediction data through the final embedded graph. The invention realizes high-precision flow prediction through a dual-attention mechanism and depth separable graph convolution.

Inventors

  • WEI ZHENCHUN
  • ZHAO SEN
  • Lv Zengwei
  • SHI LEI
  • QIAO YAN
  • WANG QINGSHAN
  • ZHANG CHI
  • FAN YUQI

Assignees

  • 合肥工业大学

Dates

Publication Date
20260508
Application Date
20260114

Claims (10)

  1. 1. A traffic flow prediction method based on convolution of dual-attention and depth separable graphs, comprising the steps of: s1, representing the road network traffic data of historical observation in a form of a graph structure to obtain a node set and an adjacent matrix of the road network, representing the historical observation values of all nodes in a signal matrix, and intercepting an input signal matrix from the signal matrix according to a preset time step; S2, performing feature extraction and nonlinear activation on an input signal matrix to obtain node feature representation, constructing an asymmetric interaction matrix between the node feature representations, performing nonlinear activation and ReLU activation on the asymmetric interaction matrix to obtain node embedded features, indexing each node in an adjacent matrix to obtain an index set of each node, and setting the connection weights of all neighbor nodes except the index set of each node to be zero to obtain a sparse adjacent matrix; S3, respectively executing a spatial attention mechanism and a channel attention mechanism on the feature aggregation matrix, outputting and fusing the spatial attention matrix and the channel attention matrix, and generating a double-attention force diagram; S4, calibrating the feature aggregation matrix to generate a plurality of two-dimensional tensors, respectively executing kernel combination processing and feature combination processing on the plurality of two-dimensional tensors, outputting and fusing the kernel combination matrix and the feature combination matrix to generate a depth separable graph; s5, fusing the double-attention graph, the depth separable graph and the feature aggregation matrix to generate a final embedded graph; And S6, calculating and generating traffic flow prediction data through the final embedded graph.
  2. 2. The traffic flow prediction method based on convolution of dual-attention and depth separable graphs according to claim 1, wherein the spatial attention matrix and the channel attention matrix are fused by stitching to generate a dual-attention map; The kernel combination matrix and the feature combination matrix are subjected to weighted fusion to generate a depth separable graph; and the dual-attention force diagram, the depth separable diagram and the feature aggregation matrix are combined through weighting to generate a final embedded diagram.
  3. 3. The traffic flow prediction method based on the convolution of the dual-attention and depth separable graph according to claim 1, wherein the specific process of step S1 is as follows: S11, representing the road network traffic data obtained by historical observation in the form of a graph structure to obtain a graph structure B= (V, E, A), wherein V represents a node set of the road network, E represents an edge set of the road network, A represents an adjacent matrix of the road network, and When a ji =1, it indicates that two nodes j and i are in a connected state, when a ji =0, it indicates that two nodes j and i are not connected, where j e {1, 2..and N }, i e {1, 2..and N }, a ji indicates elements of the j-th row and i-th column in the adjacency matrix a, N represents the number of nodes in the road network, the number of the nodes in the road network is the same as the number of the sensors in the road network, and each node on the road network has an observation value with the number of D; S12, representing the historical observation values of all nodes in the road network by using a signal matrix to obtain the signal matrix of the road network Wherein T zong is the total time step of historical observation, and when predicting the future traffic flow at time T, the historical observation data of the last T continuous time steps are taken to construct an input signal matrix Wherein c=t×d, T is the time dimension, D is the feature dimension, and ; , wherein, The feature vector representing node v at time t, v e {1, 2..sup.N }.
  4. 4. The traffic flow prediction method based on the convolution of the dual-attention and depth separable graph according to claim 1, wherein the specific process of step S2 is as follows: s21, matrix of input signals Initializing to obtain node embedded features Wherein, C=T×D, T is the time dimension, D is the feature dimension, N is the number of nodes in the road network, the number of nodes in the road network is the same as the number of sensors in the road network, and each node on the road network has an observation value with the number of D; S211, matrix input signals Performing feature extraction and nonlinear activation to obtain node feature representation : ; ; Wherein, tan h is hyperbolic tangent activation function, and tan h is nonlinear activation function, Representing the training parameters of the model, Is a super parameter and is used for controlling an activation function; S212, constructing an asymmetric interaction matrix between J 1 and J 2 , wherein, Respectively is Is a transpose of (2); s213, pair of Nonlinear activation and ReLU activation are carried out to obtain node embedded characteristics : ; Wherein, the Is a super parameter; S22, adjacent matrix Performing sparsification treatment to obtain a sparse adjacent matrix ; S221, indexing each node in the adjacency matrix: ; s222, searching index sets adx of the first h neighbor nodes with the largest connection weights in all neighbor nodes of the node a, wherein a is {1, 2..N }, h is {1, 2..N }; ; s223, keeping the connection weights of the neighbor nodes in the index set adx of the node a unchanged, and setting the connection weights of all the neighbor nodes except the index set adx of the node a to zero: ; After indexing each node, a sparse adjacent matrix is obtained Wherein, -adx is the index set of all neighbor nodes of node a except the index set; s23, based on the sparse adjacency matrix The characterized graph topology structure embeds features into nodes Feature aggregation is carried out, and feature aggregation is carried out on each node and the neighboring nodes of the node aiming at each node to obtain a feature aggregation matrix Wherein c=t×d, aggregating features into a matrix Remodelling into 。
  5. 5. The traffic flow prediction method based on the convolution of the dual-attention and depth separable graph according to claim 1, wherein the specific operation steps of the spatial attention mechanism in step S3 are as follows: S301, aggregating the characteristics into a matrix Is input into a convolution layer to generate a feature map b and a feature map c, wherein, T is a time dimension, D is a feature dimension, N is the number of nodes in the road network, and each node on the road network has an observation value with the number of D; S302, performing a remolding operation on the feature map b and the feature map c to obtain a remolded feature map And a remodeled profile , Where m=t×d, M is the number of time series data; s303, the remodeled characteristic diagram Transposed to obtain a transposed feature map ; S304, transposed feature graphs And a remodeled profile Performing matrix multiplication to obtain a matrix Matrix ; S305, inputting the matrix L1 into the Softmax layer to obtain a spatial attention map ; S306, aggregating the characteristics into a matrix Input into a convolution layer to generate a feature map ; S307, performing a remolding operation on the feature map e to obtain a remolded feature map Wherein ; S308, transpose the spatial attention map S to obtain a transposed spatial attention map ; S309, for the remodeled characteristic map And transposed spatial attention diagram Performing matrix multiplication to obtain a matrix Matrix ; S310, remolding the matrix L2 to obtain a remolded matrix ; S311, remodelling the matrix Multiplying a scale parameter lambda and aggregating matrix with features Adding elements by elements to obtain a space attention moment array 。
  6. 6. The traffic flow prediction method based on the convolution of the dual attention and depth separable graph according to claim 1, wherein the specific operation steps of the channel attention mechanism in step S3 are as follows: s321, feature aggregation matrix Performing remodeling to obtain a remolded characteristic polymerization matrix Wherein, M=T×D, M is the number of time sequence data, T is the time dimension, D is the feature dimension, N is the number of nodes in the road network, each node on the road network has the observation value with the number of D; s322, the remodeled characteristic polymerization matrix Transposing to obtain transposed feature aggregation matrix ; S323, the remodeled characteristic aggregation matrix And transposed feature aggregation matrix Performing matrix multiplication to obtain a matrix And matrix ; S324, inputting the matrix L3 into the Softmax layer to obtain a channel attention map ; S325, transpose the channel attention map G to obtain a transposed channel attention map ; S326, the transposed channel attention is tried And a remodeled feature aggregation matrix Performing matrix multiplication to obtain a matrix And matrix ; S327, remolding the matrix L4 to obtain a remolded matrix And (2) and ; S328, remodelling the matrix Multiplying a scale parameter beta and aggregating matrix with features Adding elements by elements to obtain a channel attention moment array 。
  7. 7. The traffic flow prediction method based on double-attention and depth separable graph convolution according to claim 1, wherein the specific operation steps of step S4 are as follows: s41, processing the feature aggregation matrix in a sliding window mode And applying a set of convolution kernels at each window position, treating each window as a two-dimensional tensor Obtaining a plurality of two-dimensional tensors , wherein, Is the number of channels of the input feature map, Depth separable graph convolution includes a trainable convolution kernel as And a trainable convolution kernel as , wherein, Is the number of channels of the output feature map, As a depth multiplier, the depth multiplier is set, T is a time dimension, D is a feature dimension, N is the number of nodes in the road network, and each node on the road network has an observation value with the number of D; s42, for a plurality of two-dimensional tensors The method comprises the steps of performing kernel combination processing, namely fusing two trainable kernels Q, K contained in depth separable convolution into a standard convolution kernel, performing convolution operation on a plurality of two-dimensional tensors P through the standard convolution kernel to obtain a plurality of kernel combination vectors, and performing the following operation on each of the plurality of two-dimensional tensors: s421, for trainable convolution kernels And a trainable convolution kernel Performing a deep convolution operation to obtain a standard convolution kernel , ; Wherein the trainable convolution kernel Is a trainable convolution kernel Transposed on the first and second axes; Is a deep convolution operator; s422, for standard convolution kernel And a two-dimensional tensor Performing common convolution operation to obtain a kernel combination vector And (2) and Wherein, the method comprises the steps of, Is a common convolution operator; S43, for a plurality of two-dimensional tensors Feature combination processing of multiple two-dimensional tensors Performing a depth convolution to obtain a plurality of features after the depth convolution, performing a common convolution on the plurality of features after the depth convolution to obtain a plurality of feature combination vectors, and performing the following operations on each of the plurality of two-dimensional tensors: S431, for trainable convolution kernels And a two-dimensional tensor Performing depth separable convolution operation to obtain features after depth convolution And (2) and ; S432, for trainable convolution kernels Features after depth convolution Performing common convolution operation to obtain feature combination vector And (2) and ; S44, combining a plurality of cores into a vector Performing weighted fusion to generate a kernel combination representation Combining a plurality of feature vectors Weighted fusion is performed to generate a feature combination representation ; S45, representing the kernel combination by 1X 1 convolution, batch normalization and ReLU activation Remodelling into a core-matrix Representing the feature combinations Remodelling into feature combination matrix ; S46, combining the kernels into a matrix And feature combination matrix And carrying out weighted fusion to generate a depth separable graph.
  8. 8. The traffic flow prediction method based on convolution of dual-attention and depth separable graphs as claimed in claim 1, wherein in step S5, the dual-attention separable graph is obtained by weighted fusion of the dual-attention force graph and the depth separable graph, and then the dual-attention separable graph and the feature aggregation matrix are combined Weighting and fusing to obtain a final embedded graph Wherein T is a time dimension, D is a feature dimension, N is the number of nodes in the road network, and each node on the road network has an observation value with the number of D.
  9. 9. The traffic flow prediction method based on double-attention and depth separable graph convolution according to claim 1, wherein the specific operation steps of step S6 are as follows: S61, from the final embedded graph Extracting time characteristic sequences of each node Wherein T is a time dimension, D is a feature dimension, N is the number of nodes in the road network, and each node on the road network has an observation value with the number of D; S62, multi-scale convolution, namely checking the same time feature sequence r by adopting convolution with different sizes to extract features in parallel, and splicing and fusing the extracted features to obtain multi-scale fusion features : ; S63, adopting a gating mechanism to fuse the characteristics of multiple scales Convolving to obtain traffic flow prediction data y, wherein: ; Wherein, the And Is a one-dimensional convolution kernel with a learning characteristic, and And The differences are not the same and, Representing an element-wise multiplication operator, tanh being a hyperbolic tangent activation function, σ being sigmod activation functions; Representing a convolution operator; The convolution operation in the multi-scale convolution and gating mechanism adopts the expansion convolution to operate, and the mathematical operation of the expansion convolution is defined as follows, namely, for a time characteristic sequence r of a node and a trainable one-dimensional convolution kernel The convolution output value at time t is: ; Wherein T is the time, s is the position index in the convolution kernel, k is the convolution kernel size, d is the expansion factor, kxd=t; at time for inputting sequence Is a value of (2); the weight parameter of the convolution kernel at the s-th position of the input sequence; in order to obtain an output value, the sequence r is convolved at the time t by using a convolution kernel f with the size k and the expansion rate d.
  10. 10. A traffic flow prediction system based on convolution of dual-attention and depth separable graphs, which is suitable for the traffic flow prediction method based on convolution of dual-attention and depth separable graphs as claimed in any one of claims 1 to 9, and comprises: The diagram structure construction module is used for representing the road network traffic data of the historical observation in a diagram structure mode to obtain a node set and an adjacent matrix of the road network, representing the historical observation value of each node in a signal matrix, and intercepting an input signal matrix from the signal matrix according to a preset time step; the graph rolling module is used for initializing an input signal matrix to obtain node embedded features, carrying out sparsification on an adjacent matrix to obtain a sparse adjacent matrix, and carrying out feature aggregation on the node embedded features based on a graph topological structure represented by the sparse adjacent matrix to generate a feature aggregation matrix; the dual-attention module is used for respectively executing a spatial attention mechanism and a channel attention mechanism on the feature aggregation matrix to obtain a spatial attention matrix and a channel attention matrix, and performing splicing and fusion on the spatial attention matrix and the channel attention matrix to obtain a dual-attention force diagram; The depth separable graph rolling module is used for calibrating the feature aggregation matrix to generate a plurality of two-dimensional tensors, respectively executing kernel combination and feature combination on the plurality of two-dimensional tensors, outputting and fusing the kernel combination matrix and the feature combination matrix to generate a depth separable graph; the data processing module is used for carrying out weighted fusion on the double-attention graph, the depth separable graph and the feature aggregation matrix to obtain a final embedded graph; and the time convolution module is used for calculating and generating traffic flow prediction data through the final embedded graph.

Description

Traffic flow prediction method based on convolution of double-attention and depth separable graphs Technical Field The invention relates to the technical field of intelligent traffic, in particular to a traffic flow prediction method based on convolution of a double-attention and depth separable graph. Background The traffic flow prediction is used as a core support task of the intelligent traffic system, and the accuracy of the traffic flow prediction directly influences the effectiveness of downstream applications such as road network management control, travel guidance and the like. Because the traffic network has topological relevance naturally, a prediction method based on a Graph Neural Network (GNN) abstracts a road network into a graph structure, and the road network can be more attached to the spatial characteristics of a traffic system through node-side association modeling road section topological relation, so that the traffic network has become a main stream research direction in the field. However, in the face of the complexity of actual traffic scenes, such as long-range congestion diffusion, multi-feature coupling and variable space-time scales, the conventional GNN has significant limitations in the traffic prediction task, and the improvement of prediction performance and scene suitability is restricted. Firstly, at the space correlation modeling level, the traditional GNN relies on a fixed adjacent matrix constructed based on road physical connection, but only can capture local or preset space correlation of nodes, but can not effectively describe long-range space dependence among non-adjacent road segments, and in actual traffic, such long-range correlation, such as flow linkage of a cross-regional road network and chain diffusion of congestion, is crucial to the accuracy of a prediction result, secondly, at the characteristic channel utilization level, the traditional GNN regards multi-dimensional characteristics of traffic flow as equally important inputs, such as flow, speed and occupancy, the differential prediction value of different characteristic channels is not mined, redundant characteristic interference key information is easily caused, the characteristic utilization efficiency is reduced, and in the complex characteristic extraction and scene adaptation level, the convolution operation of the traditional GNN is limited by limited parameter scale, only single-scale traffic characteristics can be extracted, and short-time sudden fluctuation and long-time period trend, local road change and global road network linkage multi-scale characteristic requirements are difficult to be considered. Disclosure of Invention The invention provides a traffic flow prediction method and a system based on convolution of a double-attention and depth separable graph, which are used for solving the technical problems that the traditional traffic flow prediction method is easy to be interfered by redundant features, is limited by limited parameter scale, can only extract traffic features of a single scale, and is difficult to consider the requirements of multi-scale features of short-time sudden fluctuation, long-time period trend, local road section change and global road network linkage. In order to achieve the above purpose, the present invention adopts the following technical scheme, including: a traffic flow prediction method based on convolution of dual-attention and depth separable graphs, comprising the steps of: s1, representing the road network traffic data of historical observation in a form of a graph structure to obtain a node set and an adjacent matrix of the road network, representing the historical observation values of all nodes in a signal matrix, and intercepting an input signal matrix from the signal matrix according to a preset time step; S2, initializing an input signal matrix to generate node embedded features, thinning an adjacent matrix to generate a sparse adjacent matrix, and performing feature aggregation on the node embedded features based on a graph topological structure represented by the sparse adjacent matrix to generate a feature aggregation matrix; S3, respectively executing a spatial attention mechanism and a channel attention mechanism on the feature aggregation matrix, outputting and fusing the spatial attention matrix and the channel attention matrix, and generating a double-attention force diagram; S4, calibrating the feature aggregation matrix to generate a plurality of two-dimensional tensors, respectively executing kernel combination processing and feature combination processing on the plurality of two-dimensional tensors, outputting and fusing the kernel combination matrix and the feature combination matrix to generate a depth separable graph; s5, fusing the double-attention graph, the depth separable graph and the feature aggregation matrix to generate a final embedded graph; And S6, calculating and generating traffic flow prediction data through the final