An adaptive spatio-temporal neural network traffic prediction model combined with multi-map fusion

CN117521721BActive Publication Date: 2026-09-11FUJIAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311494396.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-10
Publication Date
2026-09-11
Estimated Expiration
2043-11-10

AI Technical Summary

Technical Problem

因此,这些方法使得道路预测结果不够准确

Benefits of technology

[0088]相对于现有技术,本发明及其优选方案设计了一种融合多因素的方案,包括交通数据的距离关系、换乘关系和同路段关系等,更好地提取隐藏的空间依赖关系;(2)提出了两阶段交替训练矩阵生成方案,可以更好地控制参数的学习方向。(3)在训练过程中设计了改进的损失函数,并设计了多矩阵融合模块对学习矩阵进行加权融合,不断更新空间邻接矩阵,融合尽可能多的交通信息,以实现更准确的交通预测。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117521721B_ABST
    Figure CN117521721B_ABST
Patent Text Reader

Abstract

The application provides a self-adaptive space-time neural network traffic prediction model combined with multi-graph fusion. Firstly, three space-dependent relationships of DTS are considered to construct an initial adjacency matrix. Secondly, a method of alternately training a graph generation module and a prediction module is adopted, and a loss function with good performance is designed in the training process, so that the model can self-adjust. Finally, the application also adopts a fusion mechanism to fuse the learned matrix and generate an optimal adjacency matrix, which makes the prediction of road traffic more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of urban traffic condition prediction, spatiotemporal neural networks, graph convolutional networks and adaptive learning technologies, and in particular to an adaptive spatiotemporal neural network traffic prediction model that combines multi-graph fusion. Background Technology

[0002] Traffic forecasting plays a crucial role in intelligent transportation systems. Accurate road traffic forecasting facilitates dynamic route planning, avoids traffic congestion, reduces travel time, and enables efficient allocation of transportation resources. Traffic forecasting aims to estimate future traffic conditions (such as traffic flow and speed) for each road segment using historical traffic data. Forecasting methods can be broadly categorized into two types: time-dependent methods and spatiotemporal-dependent methods.

[0003] Prediction methods that only consider time dependencies, such as Autoregressive Integrated Moving Average (ARIMA) models and Bayesian models, primarily focus on modeling the temporal dependencies of time series, without considering the potential spatial dependencies between predicted road segments or nodes. However, with the development of deep learning methods, potential spatial dependencies between traffic networks have been taken into account. Early approaches divided the study area into regular grids, employing Convolutional Neural Networks (CNNs) and Recurrent Neural Networks (RNNs) to learn spatial relationships and extract valuable spatiotemporal information between these grids. With the successful application of Graph Neural Networks (GNNs) in processing graph topologies, Spatiotemporal Graph Neural Networks (ST-GNNs) have been developed, achieving satisfactory performance compared to grid-based methods. Compared to previous methods, ST-GNNs utilize predefined graphs, enabling more efficient learning of latent spatial features. In recent years, the training framework of ST-GNNs has been divided into two parts: a graph learning module and a prediction network module.

[0004] To better capture spatiotemporal patterns in urban traffic networks, a multi-view Geometric Network (GCN) has been proposed to capture multiple temporal correlations between sensors at different time intervals. With the emergence of attention mechanisms, an attention-based spatiotemporal GCN has been proposed to capture deep spatiotemporal correlations between sensors. Recently, graph learning modules have been used to acquire graph structures. Combining GCNs with dilated causal convolutional networks reduces computational costs when processing long sequences.

[0005] Furthermore, an adaptive adjacency matrix is ​​proposed to obtain more reliable spatial correlations between sensors. Considering the highly dynamic nature of urban traffic networks, an adaptive spatiotemporal graph convolutional neural network (Adap-STGCN) structure is used to predict traffic conditions on urban roads. By continuously updating the adaptive adjacency matrix during training, the prediction results are made more accurate.

[0006] With the development of technologies (such as public transportation systems and sensors), large amounts of spatiotemporal data are readily available, providing a solid data foundation for traffic prediction. For example, historical taxi trajectory data can be used to extract valuable spatial information through deep neural networks for road traffic prediction. By learning the potential spatial relationships between sensors, historical traffic data provided by sensors can be combined with an Adaptive Spatiotemporal Convolutional Network (Adap-STGCN) to predict traffic conditions for each sensor.

[0007] Traditional traffic forecasting methods require large amounts of labeled data to handle the nonlinearity, uncertainty, and anomalies in traffic data, and they neglect spatial correlations between different locations. Furthermore, the accuracy of traffic forecasting depends not only on the chosen forecasting method but also on the application and processing of various traffic data.

[0008] Prediction methods based on historical traffic trajectory data can effectively extract the spatiotemporal features of roads from traffic data. However, these methods tend to treat each road as standard grid data or node data, easily overlooking potentially important details. Furthermore, the predicted roads may lack sufficient detail and span relatively long distances. Moreover, these methods rely on the historical trajectories of specific vehicles to predict traffic conditions, exhibiting strong travel-related characteristics.

[0009] Prediction methods based on historical traffic data from sensors focus on using sensors on the road network as the research object to generate more detailed predictions and show good performance in predicting individual sensors. However, they do not consider the spatial dependencies between sensors on the same road segment. Specifically, the prediction results tend to prioritize the accuracy of individual sensor predictions rather than accurately predicting the traffic conditions of the road segment where the sensor is located. Therefore, these methods result in less accurate road predictions.

[0010] Current prediction methods fail to consider the importance of other spatial dependencies and cannot effectively control the direction of parameter learning during adaptive learning. Furthermore, it is evident that there are many shortcomings in the processing of traffic data. Summary of the Invention

[0011] To overcome the shortcomings and deficiencies of existing technologies, the goal of this invention is to provide a more refined traffic prediction model based on sensor data from traffic networks. Furthermore, the proposed model adaptively learns the most suitable adjacency matrix from spatial relationships within the traffic network, thereby enabling accurate prediction of traffic conditions on specific road segments based on the fusion and learning of multiple traffic information sources.

[0012] This invention primarily constructs an adaptive spatiotemporal graph rollup neural network traffic prediction model based on a graph rollup neural network. First, it considers three spatial dependencies of DTS (Direct Transaction System) to construct an initial adjacency matrix. Second, it employs an alternating training method between the graph generation module and the prediction module, and designs a high-performance loss function during training to enable the model to self-adjust. Finally, a fusion mechanism is used to integrate the learned matrices and generate an optimal adjacency matrix, resulting in more accurate road traffic predictions.

[0013] The main technical problems addressed by this invention include: (1) Graphs based on a single spatial relationship may ignore important factors, leading to an incorrect description of spatial relationships. This hinders the extraction of comprehensive spatial dependencies from traffic data. (2) Traditional end-to-end training methods lead to inter-module dependencies, making it challenging to determine the training direction of learnable parameters in each module. (3) The utilization of existing spatiotemporal data has certain limitations, resulting in poor data extraction and fusion.

[0014] The specific technical solution adopted is as follows:

[0015] An adaptive spatiotemporal neural network traffic prediction model incorporating multi-graph fusion includes:

[0016] DTS Relationship Matrix Generation Module: Used to input the position and distance data of various sensors on the road network, and generate distance relationship matrix, transfer relationship matrix and same road segment relationship matrix respectively;

[0017] The adjacency matrix predefinition module is used to construct an initial input matrix A from the three matrices obtained in the DTS relation matrix generation module, which is then used as the input to the prediction module.

[0018] The prediction module is used to predict the future traffic conditions of each road segment by inputting historical traffic data into an attention-based spatiotemporal GCN prediction neural network: the prediction neural network uses a loss function to iterate multiple times to highlight the relationship of traffic prediction for each road segment.

[0019] An adaptive matrix generation module; utilizing the training results of the prediction module, it continuously uses prior knowledge during the iteration process to generate new spatial dependency matrices;

[0020] Multi-matrix fusion module; the new spatial dependency matrix generated by the adaptive matrix generation module is input into the multi-matrix fusion module; the multi-matrix fusion module will convert N m The matrix fusion method weights the importance of different subgraphs using the prediction loss of the prediction model, and then uses these weights to fuse the different subgraphs to obtain the input matrix A for the next iteration of training. * .

[0021] Furthermore, in the DTS relation matrix generation module:

[0022] Let dist(i,j) be the distance between two sensors i and j in the road network. When there is one or more paths between them, the shortest distance between them is defined as follows:

[0023]

[0024] Where θ1 is a fixed parameter and k is a threshold;

[0025] This generates a distance relationship matrix;

[0026] Define the transition relation matrix W T Used to simulate the spatial transfer relationships of road networks:

[0027] First, the similarity matrix between the cross sensors is calculated using the Node2Vec algorithm. Since the traffic network is a directed unweighted graph, the cross sensors are sampled through biased random walks, as shown in the following formula:

[0028]

[0029] Where, the left side of the equation represents the probability of moving from the current intersection node v to the next intersection node x, E represents the set of all successor neighbor intersection nodes of the current intersection node v, and Z is the normalization constant;

[0030] Secondly, the transition probability is calculated using the following formula:

[0031] ∏ vx =α pq (t, x)•W vx

[0032]

[0033] Where t represents the previous node, W vx α represents the weight of an edge in a weighted graph. pq (t,x) represents the meta-transition probability, where p and q are parameters controlling the model's walking strategy; d tx =1 indicates a backflow from the current intersection node, i.e., t = x; d tx =1 indicates that t and x are directly connected; d tx =2 indicates that t and x are not connected;

[0034] Finally, the vector representations of all nodes are obtained through the above random walk strategy, and then a threshold T is determined based on the transition relationship. sim Calculate the similarity matrix, denoted as W. T This matrix represents the transition relationship and is calculated using the following formula:

[0035]

[0036]

[0037] Among them W T (i,j) represents the similarity between any two intersection sensor vectors; in order to make the transition relation matrix W T Further sparsity is achieved by redistributing W based on a threshold. T To obtain the final W T ;

[0038] The process of constructing the same road segment relationship matrix is ​​as follows:

[0039] First, the Euclidean distance between sensors on each lane is calculated based on the original spatial information to obtain the distance relationship matrix W. S ;

[0040] Secondly, define a set of fine-grained filters, denoted as {f m}, applied in W S superior, f m (.) represents a filter function; there are M such functions in total; W S It is divided into M fine-grained partition matrices, and the resulting partition matrices satisfy... Ensure W S Distributed across M fine-grained partitioning matrices, while retaining W S Distribution characteristics;

[0041] Finally, the m-th fine-grained partitioning matrix represents the probability that the relationship between any two sensors in the network belongs to the m-th relationship; the weight set W = {w1,...,w...} is used. m By combining the probability matrix and the weight set W, a relationship matrix is ​​constructed to quantify the level of mutual influence between sensors in each partition matrix; the value of M is determined based on cluster analysis; a Gaussian kernel filter is chosen to ensure smoothing of boundary values; the degree of mutual influence between sensors is expressed through matrix W. S The definition is as shown in the following formula:

[0042]

[0043]

[0044]

[0045] Among them G m (W S ) represents the result obtained after passing through a Gaussian kernel filter, r mθ1 represents the cluster centers obtained from cluster analysis, and θ2 is a hyperparameter.

[0046] Furthermore, in the adjacency matrix predefinition module, multiple matrices generated by the DTS relation matrix generation module are used to construct the initial matrix, which includes different types of spatial dependencies. The initial input matrix A is initialized according to the following formula:

[0047]

[0048]

[0049]

[0050]

[0051] in, k is used to refer to D, T, and S respectively; b[·] denotes a binary function, defined by the following formula:

[0052]

[0053] Furthermore, in the prediction module, the loss function is constructed as follows:

[0054] First, a matrix W of size N×S is generated by considering the distribution of sensors in the road segment. r The number of sensors in the network is represented by N, the number of road segments by S, and the matrix W. r It can be expressed by the following formula:

[0055]

[0056] Among them, V i ∈N represents the i-th sensor, S j ∈S represents the j-th road; if the i-th sensor is located on the j-th road, the corresponding matrix value is set to 1, otherwise it is 0; this is used to group the sensors according to the road.

[0057] Secondly, the actual value Y and the predicted value Pred are processed; the actual value Y for each road segment is obtained from the following equation. road and predicted value Pred road ;

[0058] Y road =Y·W r

[0059] Pred road =Pred·W r

[0060] An array C of length S is used to record the number of sensors in each road segment; in Y road and Pred road Additional processing is performed on the above; average actual value Y road and average predicted value Y road Obtained by the following formula;

[0061] Y road =Y road / C

[0062] Pred road =Pred road / C

[0063] Finally, minimizing the L1 loss between the predicted and actual values ​​of road segments is chosen as the training objective of the prediction module, as shown in the following formula:

[0064] L p (Y road Pred road )=|Y road -Pred road |

[0065] Furthermore, the working process of the adaptive matrix generation module is as follows:

[0066] First, an initial matrix is ​​generated based on the learnable parameters using the following formula:

[0067]

[0068] Where A1, A2∈R N×M M << N, A3 ∈ R N These are learnable parameters; Diag(A3) is the diagonalization of A3; since (A1A2-A2A1) is a skew-symmetric matrix; to enhance M init Due to the sparsity of the matrix, the ReLU activation function sets the diagonal and half of the matrix to 0; Diag(A3) is used to generate the weights for the diagonal positions.

[0069] Secondly, a convolution kernel is used to fuse the old matrix with the newly generated spatial dependency matrix; then, a non-linear activation function is used to obtain the weight matrix M. w According to the weight matrix M w The fusion matrix M is obtained using the following formula. fs :

[0070] M w =ReLU(c(M) init M old ))

[0071] M fs =M w *Minit +(1-M w )*M old

[0072] Where c represents one or more 1×1 convolutional layers, and * represents element-wise multiplication;

[0073] Finally, to facilitate computation, the fusion matrix is ​​adjusted; in this process, some elements with small values ​​are filtered out, and this is controlled by using the hyperparameter σ; in addition, by employing renormalization techniques, the newly generated matrix M is... new Obtained from the following formula:

[0074]

[0075]

[0076] Where D fs ,D' fs It is a diagonal matrix. σ∈(0,1) is a custom threshold.

[0077] Furthermore, in the multi-matrix fusion module:

[0078] First, the prediction module is used to calculate the prediction loss for all matrices in matrix set A, as shown in the following formula:

[0079] L k =L p (STnet(X, A) k ,θ)·W r / C, Y road )

[0080] Where STnet(·) is the prediction network; θ is the parameter that makes the best prediction; k refers to the k-th submatrix; calculate the predicted and actual values ​​of the road to obtain the prediction loss of the k-th submatrix; combine these prediction loss values ​​into a vector. Maximum value Then, determine whether the current number of matrices m is greater than the maximum capacity N. max If it exceeds, then remove. The matrix with the largest predicted loss value is shown in the following formula, and the maximum value Lmax is updated.

[0081]

[0082] Secondly, the weight vectors of all remaining matrices in A The calculation formula is as follows:

[0083]

[0084] in denoted as the average of the prediction losses of all matrices; g represents the normalization function, defined by the following formula:

[0085]

[0086] Finally, the input matrix for the next iteration is obtained through the multi-matrix fusion module, as shown in the following formula:

[0087]

[0088] Compared with existing technologies, this invention and its preferred scheme design a multi-factor fusion scheme, including distance relationships, transfer relationships and same-segment relationships of traffic data, to better extract hidden spatial dependencies; (2) a two-stage alternating training matrix generation scheme is proposed, which can better control the learning direction of parameters; (3) an improved loss function is designed during the training process, and a multi-matrix fusion module is designed to perform weighted fusion of the learning matrix, continuously update the spatial adjacency matrix, and fuse as much traffic information as possible to achieve more accurate traffic prediction. Attached Figure Description

[0089] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:

[0090] Figure 1 This is a model architecture diagram of an embodiment of the present invention;

[0091] Figure 2 This is a flowchart illustrating the model training process in an embodiment of the present invention.

[0092] Figures 3-8 These are the pseudocodes for the overall process of the embodiments of the present invention and the corresponding algorithms for each module. Detailed Implementation

[0093] To make the features and advantages of this patent more apparent and understandable, specific embodiments are provided below, along with accompanying drawings, for detailed explanation:

[0094] The DTS-adapSTNet model designed in this invention can be used to capture complex spatiotemporal correlations in urban traffic networks, thereby enabling accurate traffic prediction. First, a novel DTS relation matrix generation module is designed, which no longer only considers the Euclidean distance matrix but also comprehensively considers multiple spatial dependencies, fusing them to obtain an initial predefined graph. Second, a two-stage alternating training structure is proposed, allowing the adaptive matrix generation module and the prediction module to be trained alternately. Finally, sensor data can be used to more accurately predict traffic conditions on road segments. When dividing the traffic network into road segments, the topology of the entire network is considered, thus obtaining the sensors corresponding to each road segment. Furthermore, a carefully designed loss function is proposed to train the prediction module. By continuously fusing and updating the learned matrices, the optimal spatial adjacency matrix is ​​obtained, thereby predicting accurate road traffic conditions. The specific architecture is as follows: Figure 1 As shown, the DTS-adapSTNet model mainly consists of five parts: a DTS relation matrix generation module, an adjacency matrix predefined module, a prediction module based on an improved loss function, an adaptive matrix generation module, and a multi-matrix fusion module. The specific training process of the model is as follows: Figure 2 As shown.

[0095] The specific steps of the algorithm are as follows:

[0096] 1. DTS Relationship Matrix Generation Module

[0097] The complex traffic network in this invention is conceptualized using a multigraph, which enables a more accurate assessment of the spatial correlations between sensors within the road network, resulting in more accurate traffic predictions for road segments. To further enhance the modeling capability of potential spatial connections between sensors, three weights are introduced and defined: distance relationship, transfer relationship, and same-segment relationship. Combining these three spatial relationships ensures improved accuracy of the prediction results.

[0098] (1) Distance Relationship

[0099] Sensors exhibit a certain degree of correlation; generally, sensors that are closer together have a stronger correlation. To describe this relationship, distance measurements between sensors are used. The distance between two sensors i and j in a road network, denoted as dist(i,j), is defined as follows when one or more paths exist between them:

[0100]

[0101] Where θ1 is a fixed parameter and k is a threshold.

[0102] (2) Transfer Relationship

[0103] Transfer relationships can be used to describe the flow relationships between road segments. The flow at intersections in a network presents multiple possibilities. Accurately simulating the spatial transfer relationships between intersection sensors is crucial for prediction. Therefore, a transfer relationship matrix W is defined. T It is used to simulate the spatial transfer relationships of road networks.

[0104] First, the similarity matrix between the cross sensors is calculated using the Node2Vec algorithm. Since the traffic network is a directed unweighted graph, the cross sensors are sampled through biased random walks, as shown in the following formula:

[0105]

[0106] The left side of the equation represents the probability of progressing from the current intersection node v to the next intersection node x, while E represents the set of all successor neighboring intersection nodes of the current intersection node v. Z is a normalization constant, typically the total number of nodes.

[0107] Secondly, the transition probability is calculated using the following formula:

[0108] ∏ vx =α pq (t, x)·W vx

[0109]

[0110] Where t represents the previous node, W vx α represents the weight of an edge in a weighted graph. pq (t,x) is considered as the meta-transition probability, where p and q are parameters controlling the model's walking strategy. tx =1 indicates a backflow from the current intersection node, i.e., t = x; d tx =1 indicates that t and x are directly connected, which is the so-called breadth-first traversal. d tx =2 indicates that t and x are not connected, which is the so-called depth-first search.

[0111] Finally, the vector representations of all nodes are obtained using the above random walk strategy. Then, a threshold T is determined based on the transition relationships. sim Calculate the similarity matrix, denoted as W. T This matrix represents the transition relationship and is calculated using the following formula:

[0112]

[0113]

[0114] Among them W T (i,j) represents the similarity matrix between any two intersection sensor vectors. To make the transition relation matrix W... TFurther sparsity is achieved by redistributing W based on a threshold. T To obtain the final W T .

[0115] (3) Relationship within the same road segment

[0116] In urban road traffic networks, sensors located on the same road exhibit closer spatial dependencies. A better description of these spatial dependencies is crucial for predicting road conditions. Unlike previous works that simply replaced road networks with grid structures, this invention provides a more detailed description of road networks. In real-world networks, most roads consist of two or more lanes, making it inappropriate to simply classify them as a single road. Furthermore, the distances between sensors on the same road also need to be considered.

[0117] First, the Euclidean distance between sensors on each lane is calculated based on the original spatial information to obtain the distance relationship matrix W. S .

[0118] Secondly, define a set of fine-grained filters, denoted as {f m}, applied in W S superior, function f m (.) can be understood as a filter function, and there are a total of M such functions available. This means W S It is divided into M fine-grained partition matrices, and the resulting partition matrices satisfy... This ensures W S Distributed across M fine-grained partitioning matrices, while retaining W S Distribution characteristics.

[0119] Finally, the m-th fine-grained partitioning matrix represents the probability that the relationship between any two sensors in the network belongs to the m-th relationship. To facilitate this, a weight set W = {w1,...,w...} is designed. m By combining the probability matrix and the weight set W, a relation matrix can be constructed to quantify the level of interaction between sensors in each partition matrix. The value of M can be determined based on cluster analysis. A Gaussian kernel filter is chosen to ensure smooth handling of boundary values. The degree of interaction between sensors can be quantified by matrix W. S Defined as shown in the following formula:

[0120]

[0121]

[0122]

[0123] Among them Gm (W s ) represents the result obtained after passing through a Gaussian kernel filter, r m θ1 represents the cluster centers obtained from cluster analysis, and θ2 is a hyperparameter.

[0124] The three adjacency relationships between sensors in each road segment are calculated, and the resulting adjacency matrix can more directly reflect the relationship between sensors, which is beneficial for extracting the hidden spatial dependencies of road segments from traffic data.

[0125] 2. Adjacency Matrix Predefined Module

[0126] The initialization of the input matrix for the prediction module plays a crucial role in both the prediction and adaptive matrix generation modules. The accuracy and reliability of the initial relationships between sensors can significantly impact the optimization of the prediction module, thereby greatly affecting the overall model performance.

[0127] Therefore, this invention does not use a single relation matrix as the initial spatial relation matrix, nor does it randomly generate the initial spatial relation matrix. Instead, multiple matrices generated by the DTS relation matrix generation module are used to construct the initial matrix, which includes different types of spatial dependencies. The initial input matrix A can be initialized according to the following formula:

[0128]

[0129]

[0130]

[0131]

[0132] in, k represents D, T, and S. b[·] represents the binary function, defined by the following formula:

[0133]

[0134] A computational method that fuses different types of spatial dependencies to obtain the initial input matrix for training the model. The initial input matrix A is used as the predefined adjacency matrix A for the first input. * .

[0135] 3. Prediction module based on improved loss function

[0136] Graph Convolutional Spatiotemporal Neural Networks (GCNs) are a traffic flow prediction method. They take one or more adjacency matrices and historical time-series data as input. The goal is to capture the spatiotemporal features hidden within the historical data. The network typically consists of multiple spatiotemporal blocks. After information aggregation using a GCN model, each block captures the spatial dependencies of sensors in the road network. Simultaneously, a temporal attention module or GRU is combined to capture long-sequence dependencies, thus obtaining the temporal dependencies of the traffic flow data.

[0137] Training existing prediction modules typically focuses on designing loss functions to improve the accuracy of predicting individual sensor values, rather than prioritizing accurate predictions of road traffic conditions. This approach can lead to inaccurate predictions. This invention aims to obtain future traffic conditions for each road segment through prediction. Instead of directly calculating the loss function between the true value Y and the predicted value Pred of a single sensor, improvements should be made to design a loss function that optimizes the model's performance in predicting road traffic conditions.

[0138] First, a matrix W of size N×S should be generated. r This matrix is ​​obtained by considering the distribution of sensors in the road segments. The number of sensors in the network is represented by N, and the number of road segments is represented by S, and matrix W... r It can be expressed by the following formula:

[0139]

[0140] Where V i ∈N represents the i-th sensor, S j Let S represent the j-th road. If the i-th sensor is located on the j-th road, the corresponding matrix value is set to 1; otherwise, it is set to 0. In this way, the sensors are grouped according to the road.

[0141] Next, the actual value Y and the predicted value Pred are processed. The actual value Y for each road segment is obtained from the following equation. road and predicted value Pred road .

[0142] Y road =Y·W r

[0143] Pred road =Pred·W r

[0144] Calculate an array C of length S to record the number of sensors in each road segment. In Y... road and Pred road Additional processing is performed on the average actual value Y. road and average predicted value Y roadIt is obtained from the following formula.

[0145] Y road =Y road / C

[0146] Pred road =Pred road / C

[0147] Finally, minimizing the L1 loss between the predicted and actual values ​​of road segments is chosen as the training objective of the prediction module, as shown in the following formula:

[0148] L p (Y road Pred road )=|Y road -Pred road |

[0149] Through multiple iterations using this loss function, relationships beneficial to road segment traffic prediction are highlighted, while weaker correlations are gradually eliminated. The prediction modules in the experiment are all implemented based on multiple GCNs models, and the prediction results are good.

[0150] In this module, relation matrix A * The optimal input to the prediction module is used, and historical traffic data is incorporated to train the prediction network. The above loss function is employed to facilitate optimization. The parameter θ maximizes the likelihood estimate of the prediction model's goodness of performance. * In the current relation matrix A * The loss function is determined under certain conditions. Through multiple iterations, relationships favorable to traffic prediction for road segments are highlighted, while weaker correlations are gradually eliminated.

[0151] 4. Adaptive Matrix Generation Module

[0152] This module can generate matrices based on the DTS relation matrix generation module. Simultaneously, utilizing the training results of the prediction network, it continuously generates new spatial dependency matrices by incorporating prior knowledge during the iterative process. This allows the matrices to better represent the stronger dependencies between sensors.

[0153] First, an initial matrix is ​​generated based on the learnable parameters using the following formula:

[0154]

[0155] Where A1, A2∈R N×M (M << N), A3 ∈ R N These are learnable parameters. Diag(A3) diagonalizes A3. Since (A1A2-A2A1) is a skew-symmetric matrix, to enhance M... initDue to the sparsity of the matrix, the ReLU activation function can set the diagonal and half of the matrix to 0. Diag(A3) is used to generate the weights for the diagonal positions.

[0156] Secondly, a convolution kernel is used to fuse the old matrix with the newly generated spatial dependency matrix. Then, a non-linear activation function is used to obtain the weight matrix M. w According to the weight matrix M w The fusion matrix M is obtained using the following formula. fs :

[0157] M w =ReLU(c(M) init M old ))

[0158] M fs =M w *M init +(1-M w )*M old

[0159] Where C is one or more 1×1 convolutional layers, and * represents element-wise multiplication.

[0160] Finally, the fusion matrix is ​​adjusted for computational convenience. During this process, some elements with smaller values ​​are filtered out, and this is controlled using the hyperparameter σ. Furthermore, by employing renormalization techniques, the newly generated matrix M... new Obtained from the following formula:

[0161]

[0162]

[0163] Where D fs ,D' fs It is a diagonal matrix. σ∈(0,1) is a custom threshold.

[0164] In this module, the parameter values ​​for the prediction network are specified as θ. * This is obtained and kept fixed in the prediction module. The same prediction network is used for training purposes, thus allowing the adaptive matrix generation module to repeatedly generate the relation matrix. As a result, the relation matrix can be obtained with the current parameters θ. * The relationship matrix M for improving prediction results new Therefore, the spatial dependencies between sensors are reweighted by this matrix, ultimately leading to more accurate predictions.

[0165] Based on this, the two-stage alternating training matrix generation method, unlike the end-to-end learning method, can better control the learning direction of parameters.

[0166] 5. Multi-matrix fusion module

[0167] After passing through the adaptive matrix generation module, a new adjacency matrix will be generated. This adjacency matrix will then be input into the multi-matrix fusion module. For N in this module... m These matrices need to be merged to generate the input matrix A for the next iteration of the prediction module. * The main function of this module is to weight the importance of different subgraphs using the prediction loss of the prediction model, and then use these weights to fuse different subgraphs to obtain the input A for the next iteration of training. * .

[0168] First, the prediction module is used to calculate the prediction loss for all matrices in matrix set A, as shown in the following formula:

[0169] L k =L p (STnet(X,A k ,θ)·W r / C,Y road )

[0170] Where STnet(·) is the prediction network. θ represents the parameters that make the best prediction. k refers to the k-th submatrix, and W... r C and C are the matrices and arrays mentioned earlier. The predicted and actual values ​​of the road are calculated to obtain the prediction loss of the k-th submatrix. These prediction loss values ​​are then combined into a vector. Then take the maximum value. Then, it is necessary to determine whether the current number of matrices m is greater than the maximum capacity N. max If it exceeds the limit, it needs to be removed. The matrix with the largest predicted loss value is shown in the following formula. In addition, the maximum value Lmax is updated.

[0171]

[0172] Secondly, the weight vectors of all remaining matrices in A The calculation formula is as follows:

[0173]

[0174] in represents the average prediction loss of all matrices. g represents the normalization function, defined by the following formula:

[0175]

[0176] Finally, the input matrix for the next iteration can be obtained through the multi-matrix fusion module, as shown in the following formula:

[0177]

[0178] Use with A * The same normalization process.

[0179] In this module, the M generated by the adaptive matrix generation module new The matrices are merged into a set A within this module, which uses matrices generated by the DTS relation matrix generation module as its elements. The multi-matrix fusion module then calculates and assigns weights to all matrices in the set. Subsequently, these weights are fused with the new weights to obtain the optimal adjacency matrix, which replaces the original matrix A. * .

[0180] Before proceeding to the next round of training, a weighted fusion mechanism is used to weight and fuse the learned matrices. This training process makes full use of traffic information data to obtain the optimal input adjacency matrix for the next round of training, aiming to train sensor data to better predict traffic on road segments.

[0181] like Figures 3-8 The figures shown are the overall flow of the embodiments of the present invention and the pseudocode of the corresponding algorithms of each module.

[0182] 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.

[0183] 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.

[0184] 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.

[0185] 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.

[0186] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0187] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

[0188] This patent is not limited to the above-described preferred embodiment. Anyone can derive other forms of adaptive spatiotemporal neural network traffic prediction models that combine multi-graph fusion under the guidance of this patent. All equivalent changes and modifications made within the scope of this patent application shall fall within the scope of this patent.

Claims

1. An adaptive spatiotemporal neural network traffic prediction model combining multi-graph fusion, characterized in that, include: DTS Relationship Matrix Generation Module; It is used to input the position and distance data of various sensors on the road network, and generate distance relationship matrix, transfer relationship matrix and same road segment relationship matrix respectively; Adjacency matrix predefined module; This is used to construct the initial input matrix A from the three matrices obtained in the DTS relation matrix generation module. Used as input to the prediction module; The prediction module is used to predict the future traffic conditions of each road segment by inputting historical traffic data into an attention-based spatiotemporal GCN prediction neural network: the prediction neural network highlights the relationship of traffic prediction of road segments through multiple iterations of a loss function. Adaptive matrix generation module; Using the training results of the prediction module, new spatial dependency matrices are generated by continuously utilizing prior knowledge during the iteration process. Multi-matrix fusion module; the new spatial dependency matrix generated by the adaptive matrix generation module is input into the multi-matrix fusion module; The multi-matrix fusion module will The matrix fusion method weights the importance of different subgraphs using the prediction loss of the prediction model, and then uses these weights to fuse the different subgraphs to obtain the input matrix for the next training iteration. ; In the DTS relation matrix generation module: The distance between two sensors i and j in the road network is denoted as dist(i, j). When there is one or more paths between them, the shortest distance between them is defined as follows: in It is a fixed parameter, and k is the threshold; This generates a distance relationship matrix; Define the transition relation matrix W T Used to simulate the spatial transfer relationships of road networks: First, the similarity matrix between the cross sensors is calculated using the Node2Vec algorithm. Since the traffic network is a directed unweighted graph, the cross sensors are sampled through biased random walks, as shown in the following formula: Where, the left side of the equation represents the probability of moving from the current intersection node v to the next intersection node x, E represents the set of all successor neighbor intersection nodes of the current intersection node v, and Z is the normalization constant; Secondly, the transition probability is calculated using the following formula: Where t represents the previous node. This represents the weight of an edge in a weighted graph; Let be the meta-transition probability, where p and q are parameters controlling the model's walking strategy; This indicates the flow returning from the current intersection node, i.e., t=x; This indicates that t and x are directly connected; This indicates that t and x are not connected; Finally, the vector representations of all nodes are obtained using the above random walk strategy, and then a threshold is determined based on the transition relationships. Calculate the similarity matrix, represented as This matrix represents the transition relationship and is calculated using the following formula: in This represents the similarity between sensor vectors at any two intersections; to make the transition relation matrix... Further sparsity is achieved by redistributing based on a threshold. To obtain the final ; The process of constructing the same road segment relationship matrix is ​​as follows: First, the Euclidean distance between sensors on each lane is calculated based on the original spatial information to obtain the relationship matrix of the same road segment. ; Secondly, define a set of fine-grained filters, denoted as Applications in superior, ; There are M filter functions in total; It is divided into M fine-grained partition matrices, and the resulting partition matrices satisfy... ; to ensure Distributed across M fine-grained partitioning matrices, while retaining Distribution characteristics; Finally, the m-th fine-grained partitioning matrix represents the probability that the relationship between any two sensors in the network belongs to the m-th relationship; using a weight set By combining the probability matrix and the weight set W, a relation matrix is ​​constructed to quantify the level of mutual influence between sensors in each partition matrix; the value of M is determined based on cluster analysis; a Gaussian kernel filter is selected to ensure smoothing of boundary values; the degree of mutual influence between sensors is determined by the matrix. The definition is as shown in the following formula: in This represents the result obtained after applying the Gaussian kernel filter. These are the cluster centers obtained from cluster analysis. It's a hyperparameter.

2. The adaptive spatiotemporal neural network traffic prediction model combining multi-graph fusion according to claim 1, characterized in that: In the adjacency matrix predefinition module, multiple matrices generated by the DTS relation matrix generation module are used to construct the initial matrix, which includes different types of spatial dependencies. The initial input matrix A is initialized according to the following formula: in, , k is used to refer to D, T, and S respectively; b[·] represents the binary function, defined by the following formula: 。 3. The adaptive spatiotemporal neural network traffic prediction model combining multi-graph fusion according to claim 2, characterized in that: In the prediction module, the loss function is constructed as follows: First, by considering the distribution of sensors in the road segment, a size of [missing value] is generated. matrix The number of sensors in the network is represented by N, the number of road segments by S, and the matrix. It can be expressed by the following formula: in, Represents the i-th sensor. This represents the j-th road; if the i-th sensor is located on the j-th road, the corresponding matrix value is set to 1, otherwise it is 0; this is used to group the sensors according to the road. Secondly, the actual value Y and the predicted value Pred are processed; the actual values ​​for each road segment are obtained from the following equation. and predicted value ; Using a length of array Record the number of sensors in each road segment; and Additional processing is performed on the above; average actual value and average forecast value Obtained by the following formula; Finally, select the road segment with a difference between the predicted value and the actual value. Loss minimization is used as the training objective of the prediction module, as shown in the following formula: 。 4. The adaptive spatiotemporal neural network traffic prediction model combining multi-graph fusion according to claim 3, characterized in that: The working process of the adaptive matrix generation module is as follows: First, an initial matrix is ​​generated based on the learnable parameters using the following formula: in , These are learnable parameters; It is Diagonalization; due to It is a skew-symmetric matrix; in order to enhance sparsity, activation function Set the diagonal and other half of the matrix to 0; Weights used to generate diagonal positions; Secondly, a convolutional kernel is used to fuse the old matrix with the newly generated spatial dependency matrix; then, a non-linear activation function is used to obtain the weight matrix. According to the weight matrix The fusion matrix is ​​obtained using the following formula. : Where c is one or more 1×1 convolutional layers, It is element-wise multiplication; By using the renormalization technique, the newly generated matrix is obtained from the equation in It is a diagonal matrix. ; Custom threshold.

5. The adaptive spatiotemporal neural network traffic prediction model combining multi-graph fusion according to claim 4, characterized in that: In the multi-matrix fusion module: First, the matrix set is calculated using the prediction module. The prediction loss for all matrices is shown in the following formula: in It is a predictive network; It is the parameter that currently makes the best prediction; Refers to the first The nth submatrix; calculate the predicted and actual values ​​of the road to obtain the nth submatrix. The prediction loss of each submatrix; these prediction loss values ​​are combined into a vector. The maximum value is taken Then, determine the current number of matrices. Is it greater than the maximum capacity? ; If it exceeds, remove. The matrix with the largest predicted loss value is shown in the following formula, and the maximum value Lmax is updated; Second, weight vectors of all the remaining matrices The calculation formula is as follows: in This represents the average prediction loss of all matrices; The normalization function is defined by the following formula: Finally, the input matrix for the next iteration is obtained through the multi-matrix fusion module, as shown in the following formula: 。

Citation Information

Patent Citations

  • Public traffic passenger flow prediction method and system based on adaptive graph learning

    CN113537580A

  • Method for predicting traffic flow by using dynamic multi-graph fusion

    CN116975642A