Expressway traffic flow prediction method and system based on space-time attention mechanism

By constructing the MDAN model and combining graph neural networks and temporal convolutional networks, the problem of traffic flow prediction accuracy during highway reconstruction and expansion was solved, achieving higher prediction accuracy and robustness, and making it suitable for accurate traffic flow prediction in complex traffic environments.

CN118942054AActive Publication Date: 2024-11-12JIANGXI GANYUE EXPRESSWAY +1

Patent Information

Application Number
CN202410985950.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-11-12
Estimated Expiration
2044-07-23

AI Technical Summary

Technical Problem

Existing methods for predicting highway traffic flow are unable to accurately capture complex traffic changes during reconstruction and expansion. Traditional models ignore the differences in gantry data distribution, resulting in large prediction errors. Furthermore, mainstream neural network methods are insufficient in extracting spatiotemporal information.

Method used

We employ the MDAN model based on a spatiotemporal attention mechanism, combining graph neural networks and temporal convolutional networks. Through a multi-dimensional attention mechanism and a multi-task learning architecture, we extract spatiotemporal features and balance the traffic prediction tasks of different gantries. We use diffusing convolutional networks and temporal convolutional networks to fuse features, introduce an external attention layer, and optimize the loss function to enhance the model's generalization ability.

Benefits of technology

It improves the accuracy and robustness of traffic flow forecasting, can accurately capture traffic flow characteristics in complex traffic environments, provides more accurate and reliable forecast results, reduces forecast errors, and is suitable for highway management during reconstruction and expansion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118942054A_ABST
    Figure CN118942054A_ABST
Patent Text Reader

Abstract

The invention discloses an expressway traffic flow prediction method and system based on a space-time attention mechanism. According to the method, on the basis of portal data, an expressway traffic flow prediction model MDAN is constructed based on deep learning. The model mainly comprises the following steps: fusing a diffusion convolution network and a time convolution network, and extracting spatial features and time features at the same time; the importance degrees of different features, different spatial positions and different moments are identified from a plurality of dimensions by using an attention mechanism in the model, so that the prediction performance of the model is improved; a multi-task learning framework is adopted, flow prediction of each portal is regarded as an independent task, different tasks are balanced through a loss function based on same variance uncertainty, common learning is carried out to overcome the problem that data characteristics of different portals are greatly different, and the generalization ability and robustness of the model are improved. According to the method, multiple key technologies and components are fused, key information in spatio-temporal data can be fully mined, and efficient and accurate feature extraction is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of transportation, and in particular to a method and system for predicting highway traffic flow based on a spatiotemporal attention mechanism. Background Art

[0002] Highway traffic is an important part of the comprehensive three-dimensional transportation network, and expressways play a role as a collection and distribution channel and a link between transportation hubs in promoting the construction of an integrated transportation system. The operation status information of expressway traffic flow is the basis and key to expressway control. In terms of information perception and status analysis, there are currently common problems such as single monitoring means, low coverage of monitoring equipment, few types of information feedback, simple perception of abnormal traffic events, and insufficient ability to proactively predict road network operation risks, which affect the timeliness and correctness of the implementation of expressway control measures.

[0003] It can be seen that traffic flow prediction on highways has become the basis of smart highway management. However, for complex prediction problems such as short-term traffic flow, it is difficult for classical theoretical methods to achieve satisfactory results. Especially for highways during reconstruction and expansion, regional traffic conditions are constantly changing with the progress of the project, and this change is difficult to be perceived by traditional prediction models. For the current mainstream neural network-based methods, they often focus on the extraction of spatiotemporal information, integrate the prediction results of all gantries together and output them, ignoring the differences in the data distribution of each gantry, resulting in large prediction errors on some gantries. Therefore, on the basis of considering the differences in data from different gantries, studying more accurate and feasible methods to make accurate predictions of future traffic flows is of great significance for the formulation of smart highway organization and control plans. Summary of the invention

[0004] Purpose of the invention: In view of the limitations of existing highway traffic flow prediction methods, the purpose of the present invention is to propose a highway traffic flow prediction method and system based on the spatiotemporal attention mechanism. Based on the gantry data, a highway traffic flow prediction model MDAN (Multi-Dimensional Attention Network) is constructed based on deep learning, and graph neural networks and temporal convolutional networks are used to extract spatial and temporal features. At the same time, key information is captured through a multi-dimensional attention mechanism to improve the accuracy and reliability of the prediction.

[0005] Technical solution: The present invention is implemented by the following technical solution: A highway traffic flow prediction method based on spatiotemporal attention mechanism, comprising the following steps:

[0006] Step 1: Obtain highway gantry data, clean the data and construct a spatiotemporal information data feature matrix, including the traffic flow of each gantry in each time slice. Apply the Gaussian kernel function to integrate the distance information between the gantries into an adjacency matrix. The farther the distance between the gantries, the smaller the value marked in the adjacency matrix.

[0007] Step 2: Build a highway traffic flow prediction model MDAN based on deep learning. The model includes the following:

[0008] The MDAN model combines the Diffusion Convolution Network (DCN) with the Temporal Convolution Network.

[0009] (Time Convolution Network, TCN) is used for fusion, and spatial and temporal features are extracted at the same time;

[0010] The MDAN model uses the attention mechanism in the model from multiple dimensions to identify the importance of different features, different spatial positions, and different times, thereby improving the prediction performance of the model.

[0011] The MDAN model adopts a multi-task learning architecture, treating the traffic prediction of each gantry as a separate task, and balancing different tasks through a loss function based on the uncertainty weight. It learns together to overcome the problem of large differences in data features of different gantry and improves the generalization ability and robustness of the model.

[0012] Step 3: Input the spatiotemporal information data of the highway gantry into the trained MDAN network to predict the flow rate of each gantry.

[0013] Furthermore, the MDAN model combines the diffusion convolutional network with the temporal convolutional network, and extracts both spatial and temporal features, including:

[0014] The MDAN model uses the diffuse convolutional network (DCN), a convolution operation suitable for directed graphs. Through the diffuse convolutional network, MDAN can effectively capture the spatial dependencies between nodes, thereby better understanding the associations and structural features between nodes when processing graph structured data.

[0015] The MDAN model uses the time convolution network (TCN) as the core component for time series data processing. Compared with traditional recurrent neural networks, TCN has higher computational efficiency and better parallelism, and can more effectively capture the time dependencies within the time series. MDAN can more accurately understand the characteristics of time series data through TCN, providing a solid foundation for spatiotemporal feature extraction.

[0016] During the feature extraction process, the MDAN model also uses the LeakyReLU activation function to introduce nonlinearity and enhance the expressiveness of the model.

[0017] The MDAN model uses the channel attention layer to identify the importance of different features, which helps to improve the distinguishability of features. In the channel attention layer, the input spatiotemporal features are firstly subjected to maximum pooling and average pooling in the spatiotemporal dimension, and then the information is transformed through a shared multi-layer perceptron, the results are added, and the final attention representation is obtained after passing through the Sigmoid activation function.

[0018] Furthermore, the MDAN model introduces attention mechanisms into the model from multiple dimensions, including:

[0019] The spatiotemporal attention module is used to identify key spatiotemporal nodes from both temporal and spatial perspectives. The spatiotemporal attention module includes:

[0020] The spatial attention layer mainly includes pooling and GraphSAGE structures, which are used to extract important features between nodes in the graph structure. In the spatial attention layer, the input spatiotemporal features are firstly subjected to maximum pooling and average pooling in the time dimension, and then the results of the two poolings are concatenated, and the spatial dependencies between adjacent nodes are extracted through the GraphSAGE network. Then, the information is nonlinearly transformed through the multi-layer perceptron and the Sigmoid activation function is used to obtain the final spatial attention representation.

[0021] The temporal attention layer mainly includes pooling and BiLSTM structures, which are used to capture key information in time series. In the temporal attention layer, the input spatiotemporal features are firstly subjected to maximum pooling and average pooling in the spatial dimension, and then the results of the two poolings are concatenated, and the information in the time series is extracted through the BiLSTM network. Then, the information is nonlinearly transformed through the multi-layer perceptron and the Sigmoid activation function is used to obtain the final temporal attention representation.

[0022] The time dimension is skimmed off by an average pooling operation.

[0023] An external attention layer is introduced to store external memory units to identify the relationship between nodes, thereby enhancing the generalization ability of the model.

[0024] Furthermore, the MDAN model uses a multi-task learning architecture to treat the flow prediction of each gantry as a separate task. The specific steps include:

[0025] Firstly, a multi-layer perceptron is designed for each gantry to input the spatiotemporal hidden state representation of the gantry and output the traffic flow prediction result of the gantry.

[0026] The loss function based on homoscedastic uncertainty is used to balance different tasks and learn together to improve the generalization and robustness of the model. This loss function takes into account the homoscedastic uncertainty of each task and weights the loss functions of multiple tasks. Homoscedastic uncertainty is task-specific; the higher the uncertainty, the more noise there is in the task-related output, making the learning of the task more challenging. During the training process of the multi-task model, the weights of tasks with higher uncertainty are reduced, making the overall training of the multi-task model smoother and more efficient. Specifically, the loss function based on homoscedastic uncertainty is expressed as:

[0027]

[0028] Among them, T is the set of all gantry prediction tasks, is the mean square error loss of the t-th gantry prediction task, σ t is a learnable parameter used to measure the uncertainty of the t-th gantry prediction task, σ t The smaller it is, the lower the uncertainty of the task.

[0029] Based on the same inventive concept, the present invention provides a highway traffic flow prediction system based on a spatiotemporal attention mechanism, comprising:

[0030] The preprocessing module is used to obtain highway gantry data, clean the data and then construct a spatiotemporal information data feature matrix, including the traffic flow of each gantry in each time slice. The distance information between the gantries is integrated into the adjacency matrix using the Gaussian kernel function. The farther the distance between the gantries, the smaller the value marked in the adjacency matrix.

[0031] The model building and training module is used to build a highway traffic flow prediction model MDAN based on deep learning. The MDAN model integrates the diffusion convolutional network DCN and the temporal convolutional network TCN, extracts spatial features and temporal features at the same time, and introduces the attention mechanism in the model from multiple dimensions to identify the importance of different features, different spatial locations and different moments. The MDAN model adopts a multi-task learning architecture, treats the traffic flow prediction of each gantry as a separate task, and balances different tasks through a loss function based on homoscedastic uncertainty.

[0032] The traffic prediction module is used to input the spatiotemporal information data of the highway gantry into the trained MDAN network to predict the traffic flow of each gantry.

[0033] Based on the same inventive concept, the present invention provides a computer system, including a memory, a processor, and a computer program / instructions stored in the memory and executable on the processor. When the computer program / instructions are executed by the processor, the steps of the highway traffic flow prediction method based on the spatiotemporal attention mechanism are implemented.

[0034] Based on the same inventive concept, the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the highway traffic flow prediction method based on the spatiotemporal attention mechanism.

[0035] Beneficial effects: Compared with the prior art, the present invention has the following advantages: The MDAN model constructed by the present invention effectively extracts the spatiotemporal characteristics of traffic data by fusing graph neural networks and temporal convolutional networks, and is particularly suitable for processing traffic changes during reconstruction and expansion. The model introduces a multi-dimensional attention mechanism, which enhances the model's recognition of key information and improves the accuracy of prediction. In addition, the multi-task learning architecture enables the model to take into account the differences between different gantries and make more detailed traffic predictions. The external attention layer and the optimized loss function increase the generalization and robustness of the model, allowing it to remain efficient in the face of complex and atypical traffic conditions. These advantages work together to enable the MDAN model to have a strong adaptability to dynamically changing and complex traffic environments in the scenario of highway reconstruction and expansion, and can accurately capture traffic flow characteristics, provide more accurate and reliable traffic flow predictions, and provide strong data support for traffic management and planning. The present invention verifies the accuracy of the model by comparing it with multiple benchmark models, and the prediction error MAE on the test set reaches 6.825. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 is a flow chart of an embodiment of the present invention.

[0037] Figure 2 This is the entire flow chart of MDAN.

[0038] Figure 3 It is a flow chart of the channel attention mechanism.

[0039] Figure 4 It is a flowchart of the temporal attention mechanism.

[0040] Figure 5 It is a flowchart of the spatial attention mechanism.

[0041] Figure 6 It is a flowchart of the external attention mechanism.

[0042] Figure 7 It is a diagram showing the prediction results of the embodiment. DETAILED DESCRIPTION

[0043] The implementation process of the present invention is described in detail below in conjunction with the embodiments and the accompanying drawings.

[0044] like Figure 1 As shown, a highway traffic flow prediction method based on a spatiotemporal attention mechanism disclosed in an embodiment of the present invention includes the following steps:

[0045] Step 1: Obtain highway gantry data. In this embodiment, the vehicle passing data is collected from 24 ETC gantries in both directions of Jiangxi Zhangji Expressway. The data collection time is from September 1 to September 7, 2023, with a time span of one week.

[0046] Step 2: Clean the collected ETC gantry data to remove duplicate data and erroneous data.

[0047] Step 3: Based on step 2, construct temporal and spatial features for ETC gantry data, which is implemented by the following steps:

[0048] Step 3.1: Construct spatiotemporal information data. In this embodiment, based on the ETC gantry data, the traffic flow of each gantry in each time slice is counted to generate a spatiotemporal information data feature matrix, where each row represents a time slice and each column represents a gantry. The date information is input into the model as external information by establishing a relationship table between the time slice number and the specific timestamp.

[0049] Step 3.2: Construct an adjacency matrix. In this embodiment, the distribution of the 24 door frames in space is regarded as a curve. The Gaussian kernel function is applied to integrate the distance information between the door frames into an adjacency matrix. Each element in the adjacency matrix is ​​a floating point number between [0,1]. The farther the door frames are apart, the weaker the connection between them, and the smaller the value marked in the adjacency matrix. The Gaussian kernel function will realize the mapping of spatial distance to the value of the adjacency matrix element. It can measure the similarity between two vectors. The greater the similarity, the greater the value of the function. The Gaussian kernel function is expressed as follows:

[0050]

[0051] In the formula, x i ,x j represents the coordinate vector of the gantry i and j, σ is the bandwidth of the Gaussian kernel, and the smaller σ is, the narrower the Gaussian distribution is. In this embodiment, the parameter σ of the Gaussian kernel function is 2 is set to 500.

[0052] Step 4: Basis Figure 2The highway traffic flow prediction model MDAN constructed as shown imports the spatiotemporal information data obtained in step 3 into the spatiotemporal feature extraction module. The specific steps are as follows:

[0053] Step 4.1: Extract spatial features. The graph structure data is processed by the Diffusion Convolution Network (DCN), capturing the spatial dependencies between nodes and understanding the associations and structural features between nodes. The adjacency matrix is ​​used as a constant parameter in the Diffusion Convolution Network to assist in extracting spatial features.

[0054] Step 4.2: Extract time features. The Time Convolution Network (TCN) is used as the core component for time series data processing to capture the time dependencies within the time series and understand the characteristics of the time series data.

[0055] Step 4.3: Use the output of step 4.2 as input and use the LeakyReLU activation function to introduce nonlinearity to enhance the model's expressiveness.

[0056] Step 4.4: Input channel attention layer (Channel Attention). Figure 3 As shown in the figure, in the channel attention layer, the input spatiotemporal features are firstly subjected to maximum pooling and average pooling in the spatiotemporal dimension, and then the information is transformed through a shared multi-layer perceptron, the results are added together, and the final attention representation is obtained after passing through the Sigmoid activation function.

[0057] Step 5: Import the spatiotemporal information data processed in step 4 into the spatiotemporal attention module. The specific steps in the module are as follows:

[0058] Step 5.1: Input the spatial attention layer, such as Figure 5 As shown in the figure, the input spatiotemporal features are first subjected to maximum pooling and average pooling in the time dimension, and then the results of the two pooling are concatenated. The spatial dependencies between adjacent nodes are extracted through the GraphSAGE network, and then the information is nonlinearly transformed through a multi-layer perceptron and passed through a Sigmoid activation function to obtain the final spatial attention representation.

[0059] Step 5.2: Input the temporal attention layer, such as Figure 4As shown in the figure, the input spatiotemporal features are first subjected to maximum pooling and average pooling in the spatial dimension, and then the two pooling results are concatenated. The information in the time series is extracted through the BiLSTM network, and then the information is nonlinearly transformed through the multi-layer perceptron and passed through the Sigmoid activation function to obtain the final temporal attention representation.

[0060] Step 6: Perform an average pooling operation on the spatiotemporal information data processed in step 5 to remove the time dimension.

[0061] Step 7: Input the average pooled spatiotemporal information data into the external attention layer to store external memory units to identify the relationship between nodes and enhance the generalization ability of the model. Figure 6 As shown, M in the figure k and M v An external memory unit that represents keys and values.

[0062] Step 8: Treat the data prediction of each gantry as a separate task and use a multi-task model to complete the training. The input of the multi-task model is the spatiotemporal information of the entire traffic network. After extracting the spatiotemporal information, the hidden state representation corresponding to each node is branched to a single task. The output of each task is the future traffic flow of the corresponding gantry. Specifically, a loss function based on homoscedastic uncertainty is used to balance different tasks and learn together. The loss function is expressed as follows:

[0063]

[0064] Where T is the set of all gantry prediction tasks, is the mean square error loss of the t-th gantry prediction task, σ t is a learnable parameter used to measure the uncertainty of the t-th gantry prediction task, σ t The smaller it is, the lower the uncertainty of the task.

[0065] Step 9: A multi-layer perceptron is set up for each gantry to output the prediction results.

[0066] The following is a verification experiment of this embodiment:

[0067] The S69 Zhangji Expressway was selected as the research object. The research scope is from Zhangshu Hub (excluding) to Ji'an South Hub (excluding). There are 5 entrance and exit interchanges and 1 hub interchange along the line, and the expressway is divided into 7 sections. Traffic flow data was collected from 12 pairs of 24 gantries along the line, including 7 pairs of mainline gantries located in 7 sections and 5 pairs of toll station gantries located at 5 entrances and exits. The data collection time is from September 1 to September 7, 2023, with a time span of one week. The indicators for model evaluation are MAE and RMSE, and the benchmark models used for comparison are as follows:

[0068] 1) History Average (HA)

[0069] The average traffic flow within the historical time window is used as the predicted traffic flow at the next moment.

[0070] 2) Support Vector Regression Model (SVR)

[0071] A regression model based on support vector machines fits the input-output relationship in the training data by finding an optimal hyperplane in high-dimensional space.

[0072] 3) Graph Convolutional Network Model (GCN)

[0073] Without considering time feature extraction, the adjacency matrix and feature matrix are input and the prediction results are output.

[0074] 4) Gated Recurrent Unit Model (GRU)

[0075] A variant of the LSTM model that only considers temporal features and ignores spatial features.

[0076] 5) Temporal Graph Convolutional Network Model (T-GCN)

[0077] A deep learning model that combines GCN and GRU.

[0078] The MDAN model and multiple benchmark models were trained on the training set and verified on the test set. The prediction accuracy of each model is shown in the following table.

[0079] Table 1 Prediction accuracy of each model

[0080]

[0081] As shown in Table 1, the traditional HA model performs generally in terms of RMSE and MAE, which are 14.743 and 8.778 respectively. The SVR model has slightly improved in these two indicators, which are 12.404 and 7.754 respectively. However, the performance of the GCN model based on graph neural network is not ideal, with RMSE and MAE of 27.828 and 22.122 respectively, which are much higher than other models. In contrast, the GRU and T-GCN models are relatively close in prediction accuracy, with RMSE of 11.016 and 10.854, and MAE of 7.305 and 7.264 respectively. The MDAN model we proposed performs best among all models, with an RMSE of 10.523 and a MAE of only 6.825, which shows that the MDAN model has higher accuracy and reliability in the task of highway traffic flow prediction.

[0082] Visualize the prediction results of each gantry, such as Figure 7 As shown in the figure, the model can predict the trend of traffic flow changes well and can accurately perceive sudden changes in traffic flow. These visualization results further verify the effectiveness and robustness of the model in actual traffic flow prediction and provide an important reference for traffic management decisions.

[0083] Based on the same inventive concept, an embodiment of the present invention discloses a highway traffic flow prediction system based on a spatiotemporal attention mechanism, including: a preprocessing module, used to obtain highway gantry data, and construct a spatiotemporal information data feature matrix after data cleaning, including the traffic flow of each gantry in each time slice, and apply a Gaussian kernel function to integrate the distance information between the gantries into an adjacency matrix. The farther the distance between the gantries is, the smaller the value marked in the adjacency matrix; a model construction and training module, used to construct a highway traffic flow prediction model MDAN based on deep learning. The MDAN model integrates the diffusion convolution network DCN and the temporal convolution network TCN, extracts spatial features and temporal features at the same time, and introduces an attention mechanism into the model from multiple dimensions to identify the importance of different features, different spatial positions and different times; the MDAN model adopts a multi-task learning architecture, regards the flow prediction of each gantry as a separate task, and balances different tasks through a loss function based on homoscedastic uncertainty; a flow prediction module, used to input the spatiotemporal information data of the highway gantry into the trained MDAN network to predict the flow of each gantry.

[0084] Based on the same inventive concept, an embodiment of the present invention discloses a computer system, including a memory, a processor, and a computer program / instructions stored in the memory and executable on the processor. When the computer program / instructions are executed by the processor, the steps of the highway traffic flow prediction method based on the spatiotemporal attention mechanism are implemented.

[0085] Based on the same inventive concept, an embodiment of the present invention discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the highway traffic flow prediction method based on the spatiotemporal attention mechanism.

Claims

1. A highway traffic flow prediction method based on spatiotemporal attention mechanism, characterized in that: The steps include: Obtain highway gantry data, clean the data, and then construct a spatiotemporal information data feature matrix, including the traffic flow of each gantry in each time slice. Apply the Gaussian kernel function to integrate the distance information between the gantries into an adjacency matrix. The farther the distance between the gantries, the smaller the value marked in the adjacency matrix. Based on deep learning, a highway traffic flow prediction model MDAN is constructed. The MDAN model integrates the diffusion convolutional network DCN and the temporal convolutional network TCN, extracts spatial features and temporal features at the same time, and introduces the attention mechanism in the model from multiple dimensions to identify the importance of different features, different spatial locations and different moments. The MDAN model adopts a multi-task learning architecture, treats the traffic flow prediction of each gantry as a separate task, and balances different tasks through a loss function based on homoscedastic uncertainty. The spatiotemporal information data of the highway gantries are input into the trained MDAN network to predict the flow of each gantry.

2. The highway traffic flow prediction method based on spatiotemporal attention mechanism according to claim 1 is characterized in that: The MDAN model uses the diffuse convolutional network DCN to process graph structure data, capture the spatial dependencies between nodes, and understand the associations and structural features between nodes. The MDAN model uses the temporal convolutional network TCN as the core component for time series data processing to capture the temporal dependencies within the time series and understand the features of the time series data. In the feature extraction process, the MDAN model uses the LeakyReLU activation function to introduce nonlinearity and enhance the expressive power of the model, and uses the channel attention layer to identify the importance of different features and improve the feature discrimination. The channel attention layer performs maximum pooling and average pooling on the input spatiotemporal features in the spatiotemporal dimension, and then transforms the information through a shared multi-layer perceptron, adds the results, and passes through the Sigmoid activation function to obtain the final attention representation.

3. The highway traffic flow prediction method based on spatiotemporal attention mechanism according to claim 1 is characterized in that: The MDAN model extracts important features between nodes in the graph structure through the spatial attention layer. The spatial attention layer performs maximum pooling and average pooling on the input spatiotemporal features in the time dimension, then concatenates the results of the two poolings, extracts the spatial dependencies between adjacent nodes through the GraphSAGE network, and then performs nonlinear transformation on the information through a multi-layer perceptron and passes through a Sigmoid activation function to obtain the final spatial attention representation.

4. The highway traffic flow prediction method based on spatiotemporal attention mechanism according to claim 1 is characterized in that: The MDAN model captures key information in the time series through the temporal attention layer. The temporal attention layer performs maximum pooling and average pooling on the input spatiotemporal features in the spatial dimension, then concatenates the results of the two poolings, extracts information from the time series through the BiLSTM network, and then performs nonlinear transformation on the information through a multi-layer perceptron and passes through a Sigmoid activation function to obtain the final temporal attention representation.

5. The highway traffic flow prediction method based on spatiotemporal attention mechanism according to claim 1 is characterized in that: The MDAN model performs an average pooling operation on the spatiotemporal features processed by the spatial attention mechanism and the temporal attention mechanism to remove the time dimension, and inputs them into the external attention layer to identify the relationship between nodes.

6. The highway traffic flow prediction method based on spatiotemporal attention mechanism according to claim 1 is characterized in that: The MDAN model designs a multi-layer perceptron for each gantry, which is used to input the spatiotemporal hidden state representation of the gantry and output the traffic flow prediction result of the gantry.

7. The highway traffic flow prediction method based on spatiotemporal attention mechanism according to claim 1 is characterized in that: The loss function based on homoscedastic uncertainty is expressed as: Among them, T is the set of all gantry prediction tasks, is the mean square error loss of the t-th gantry prediction task, σ t is a learnable parameter used to measure the uncertainty of the t-th gantry prediction task, σ t The smaller it is, the lower the uncertainty of the task.

8. A highway traffic flow prediction system based on spatiotemporal attention mechanism, characterized in that: include: The preprocessing module is used to obtain highway gantry data, clean the data and then construct a spatiotemporal information data feature matrix, including the traffic flow of each gantry in each time slice. The distance information between the gantries is integrated into the adjacency matrix using the Gaussian kernel function. The farther the distance between the gantries, the smaller the value marked in the adjacency matrix. The model building and training module is used to build a highway traffic flow prediction model MDAN based on deep learning. The MDAN model integrates the diffusion convolutional network DCN and the temporal convolutional network TCN, extracts spatial features and temporal features at the same time, and introduces the attention mechanism in the model from multiple dimensions to identify the importance of different features, different spatial locations and different moments. The MDAN model adopts a multi-task learning architecture, treats the traffic flow prediction of each gantry as a separate task, and balances different tasks through a loss function based on homoscedastic uncertainty. The traffic prediction module is used to input the spatiotemporal information data of the highway gantry into the trained MDAN network to predict the traffic flow of each gantry.

9. A computer system comprising a memory, a processor, and a computer program / instruction stored in the memory and executable on the processor, characterized in that: When the computer program / instructions are executed by a processor, the steps of the highway traffic flow prediction method based on the spatiotemporal attention mechanism according to any one of claims 1 to 7 are implemented.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the highway traffic flow prediction method based on the spatiotemporal attention mechanism according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Road section vehicle speed detection method and system

    CN112419712A

  • Traffic prediction method, intelligent terminal and computer readable storage medium

    CN112766551A

  • Method for predicting traffic flow by using spatial dynamic graph convolutional network

    CN115482656A

  • Traffic operation situation prediction method and system based on cellular automaton

    CN116311922A

  • Fine-grained traffic state estimation method based on ETC portal data

    CN117392845A

Cited By

  • Traffic flow prediction method, device, equipment and product

    CN121811640A