A Deep Learning-Based Multi-Task Traffic Prediction Method and System for Highway Networks

By constructing multi-dimensional features and deep learning models, the problems of insufficient spatiotemporal correlation and lack of consideration of external factors in highway network traffic prediction are solved, realizing the collaborative prediction of inbound and outbound traffic and improving the accuracy and precision of prediction.

CN118212778BActive Publication Date: 2025-11-14CENT SOUTH UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410315580.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-19
Publication Date
2025-11-14
Estimated Expiration
2044-03-19

AI Technical Summary

Technical Problem

Existing traffic flow prediction methods are insufficient in extracting spatiotemporal correlations in highway networks, fail to fully consider the influence of external factors such as weather and temperature, and fail to effectively coordinate the prediction of the dynamic spatiotemporal correlation between inbound and outbound traffic, resulting in inaccurate predictions.

Method used

Multi-dimensional features are constructed, including temporal, spatial, and external features. By combining the temporal convolution module, spatial attention module, and multi-task prediction module in the deep learning model, common features of inbound and outbound traffic are extracted through multi-task learning techniques to achieve collaborative prediction.

Benefits of technology

It improves the accuracy and reliability of traffic flow forecasting for highway networks, fully explores the spatiotemporal correlation and the influence of external factors, realizes the coordinated forecasting of inbound and outbound traffic, and enhances the accuracy and precision of forecasting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118212778B_ABST
    Figure CN118212778B_ABST
Patent Text Reader

Abstract

This invention relates to the field of traffic flow prediction technology, and in particular to a multi-task traffic flow prediction method and system for highway networks based on deep learning. This invention focuses on the correlation and temporal similarity between inbound and outbound traffic flow, using multi-task learning technology to characterize their common features. These common features are then used as input for feature fusion, enabling multi-task collaborative prediction of inbound and outbound traffic flow at target stations on highway networks. By employing a deep learning traffic prediction model, the invention delves into the spatiotemporal correlation characteristics of highway network traffic and the changing patterns of the influence of different external factors, thereby improving the accuracy of traffic flow prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic flow prediction technology, and in particular to a multi-task traffic flow prediction method and system for highway networks based on deep learning. Background Technology

[0002] The rapid development of highway networks has brought convenience to people, but the surge in traffic has also caused a series of problems, such as reduced travel efficiency and difficulties in traffic management. Accurate highway traffic forecasting is crucial for understanding future traffic conditions in advance, enabling highway management departments to allocate resources and deploy personnel ahead of time, traffic enforcement departments to allocate resources, manage traffic more effectively, and provide scientific guidance, and highway travelers to plan their trips in advance, avoid congested times and sections, and choose appropriate toll stations and routes.

[0003] Currently, deep learning algorithms are favored over statistical theory and traditional machine learning algorithms in the field of traffic flow prediction because deep learning has the ability to automatically extract features and offers excellent performance. However, current traffic flow prediction methods have some limitations. First, there is relatively little research on traffic flow prediction for highway networks, especially at toll stations. Second, these studies fail to capture the spatiotemporal correlation of dynamic changes in highway networks, relying solely on attention mechanisms or single deep learning models, which cannot fully extract the nonlinear dynamic changes in spatiotemporal dimensions. Furthermore, the characteristics affecting highway network traffic flow are not comprehensively considered; for example, the impact of external factors such as weather, temperature, and holidays is not taken into account. Simultaneously, related studies often focus only on the individual prediction of inbound or outbound traffic at highway toll stations, neglecting the correlation and temporal similarity between inbound and outbound traffic, and lacking effective methods for the collaborative prediction of inbound and outbound traffic at highway toll stations. Summary of the Invention

[0004] This invention relates to a deep learning-based multi-task traffic flow prediction method and system for highway networks. The method aims to address the problems of current traffic flow prediction methods, such as insufficient extraction of spatiotemporal correlations, inadequate consideration of external features like weather, and failure to simultaneously consider the dynamic spatiotemporal correlations of inbound and outbound traffic at toll stations within a single model, leading to inaccurate predictions.

[0005] To solve the above-mentioned technical problems, the technical solution proposed by this invention is as follows:

[0006] A deep learning-based multi-task traffic prediction method for highway networks includes the following steps:

[0007] S1 constructs multi-dimensional features, including multi-dimensional temporal features, spatial features, and external features.

[0008] The multi-dimensional temporal features include temporal proximity features, temporal periodic features, and temporal trend features of highway network inbound and outbound traffic flow, to characterize the short-to-medium-term correlation, periodicity, and long-term correlation between the predicted traffic flow and historical traffic flow. The temporal proximity feature is constructed from traffic values ​​at adjacent time steps on the time axis; the temporal periodic feature is constructed from traffic values ​​at the same hour of each day preceding the predicted time; and the temporal trend feature is constructed from traffic values ​​at the corresponding hour of each day of each week preceding the predicted time. The temporal proximity features of highway network inbound and outbound traffic flow are obtained using the above methods. and Time cycle characteristics and Time trend characteristics and .

[0009] The spatial features are constructed only for outbound traffic on the highway network. For each predicted station (i.e., the target station), the traffic from the source stations of the target station's outbound traffic is calculated and sorted. The top n stations are selected based on their contribution as the key source stations for that target station, and the average travel time from each key source station to the target station is calculated. tracing back to the time before the prediction Inbound traffic from key source sites within a given time period is concatenated into a longer sequence to construct inbound traffic characteristics. .

[0010] The external features include time attribute features, weather features, and temperature features. The time attribute features include four attributes: time of day (24 hours), day of week (7 days), whether it is a weekend (yes or no), and whether it is a holiday (yes or no). The weather features categorize common weather conditions into three types based on their impact on traffic: Category 1 includes sunny, cloudy, and overcast weather; Category 2 includes light rain, showers, and thunderstorms; and Category 3 includes light snow, heavy rain, sleet, fog, dust storms, and blowing sand. The impact of weather on traffic gradually increases from Category 1 to Category 3. The temperature features are continuous features, divided into three temperature ranges: low temperature (below 0°C), normal temperature (0°C-35°C), and high temperature (above 35°C). The external features are obtained by concatenating the time attribute features, weather features, and temperature features using the `Concat` keyword. .

[0011] S2 constructs a deep learning-based multi-task traffic prediction model, which includes a temporal convolution module, a spatial attention module, an external feature extraction module, and a multi-task prediction module.

[0012] The temporal convolution module includes a first-layer CNN convolutional block, a residual neural network, a second-layer CNN convolutional block, and a temporal feature fusion block. The input is the multi-dimensional temporal features constructed by S1, and the output is the temporal features of the inbound traffic. Temporal characteristics of outbound traffic The specific implementation steps are as follows:

[0013] For inbound traffic, the time proximity characteristics of the inbound traffic will be considered. Time cycle characteristics and time trend characteristics The first CNN convolutional block, containing three non-shared CNN convolutional blocks, is used to extract features from the inbound traffic flow. These extracted features are then fed into a residual neural network to prevent overfitting. The output of the residual neural network is used as the input to the second CNN convolutional block, which also contains three non-shared CNN convolutional blocks, yielding three different time-related features. , and Finally, in the time feature fusion module, the three output time features are combined. , and The input is multiplied by the three weight matrices using the Hadamard product. These weight matrices are randomly initialized and continuously learned and updated during model training. The three outputs are then summed to obtain the inbound flow time feature vector. For outbound traffic, the time feature vector of outbound traffic is also obtained through the aforementioned time convolution module. .

[0014] The spatial attention module includes a temporal embedding module, a location embedding module, and a multi-head self-attention module. The input is the inbound traffic features constructed by S1. The output is a spatial feature vector. The specific implementation steps are as follows:

[0015] The time embedding module consists of a one-hot coding layer and a fully connected layer. The one-hot coding layer encodes the hour of the day, the day of the week, whether it is a weekend, and whether it is a holiday. Then, the time embedding vector is obtained in the fully connected layer. .

[0016] The location embedding module performs fixed-position encoding on each station using sine and cosine functions to obtain a location embedding vector. .

[0017] The time embedding vector obtained by the above time embedding module The position embedding vector obtained by the position embedding module Perform concatenation to obtain the time-location embedding vector. .

[0018] The multi-head self-attention module comprises a multi-head attention structure and a fully connected layer. The multi-head attention structure consists of multiple self-attention blocks, and the input is the aforementioned temporal position embedding vector. and the inbound traffic characteristics constructed in S1 First, concatenate them using Concat to obtain the combined vector. This serves as the input to each self-attention block in the multi-head attention structure. Within each self-attention block, the combined vector is used... The query, key, and value are multiplied by three different weight matrices, which are randomly initialized and continuously learned and updated during model training. The multiplication results are query, key, and value, respectively. Then, the key is transposed and multiplied by the query to obtain the attention score matrix, which is then normalized using Softmax to obtain the normalized attention score matrix. This normalized attention score matrix is ​​then multiplied by the value to obtain the output of the current self-attention block. Since the multi-head self-attention structure contains multiple self-attention blocks, there will be multiple output results. Concat is used to concatenate the outputs of all self-attention blocks and multiply them by the weight matrix, which is randomly initialized and continuously learned and updated during model training. The output vector is then input into a fully connected layer to obtain the spatial feature vector of the spatial attention module. .

[0019] The external feature extraction module includes a one-hot encoding layer and a fully connected layer, with the external features constructed by S1 as input. The output is the external feature vector. The specific implementation steps are as follows:

[0020] External features constructed by S1 By using a one-hot encoding layer, the categorical variables are converted into binary vectors, resulting in the external feature embedding vector. Subsequently, the final extracted external feature vector is obtained through processing by a fully connected layer. .

[0021] The multi-task prediction module includes a multi-task learning block and a multi-feature fusion block, which obtains the inbound traffic time feature vector from the temporal convolution module. and outbound flow time feature vector A common feature representation is learned through multi-task learning blocks, and then a multi-feature fusion block is used to achieve joint prediction of inbound and outbound traffic, thereby improving the prediction performance of individual tasks. The specific implementation steps are as follows:

[0022] The multi-task learning block contains two separate convolutional layers. The temporal convolutional module outputs the temporal feature vector of the inbound traffic. and outbound flow time feature vector As input to the multi-task learning block, the input feature vectors are first fused using the Concat concatenation method to obtain a time feature fusion matrix that simultaneously contains the time features of both inbound and outbound traffic. Next The input is fed into two separate convolutional layers, where feature extraction and feature dimension adjustment are performed separately to obtain two feature matrices. and These serve as common time features for both inbound and outbound traffic forecasts.

[0023] The multi-feature fusion block contains convolutional layers and a Tanh activation function, used to predict outbound and inbound traffic, respectively. The specific steps are as follows:

[0024] For outbound traffic prediction, the common temporal features of the outbound traffic prediction output by the multi-task learning block are represented. Spatial feature vectors output by the spatial attention module and the external feature vector output by the external feature extraction module As input to the multi-feature fusion block, a convolutional layer is used for fusion, and the final outbound traffic prediction value is obtained through the Tanh activation function.

[0025] For inbound traffic prediction, since inbound traffic does not contain spatial features, only the common temporal features of the inbound traffic prediction output by the multi-task learning block are represented. and the external feature vector output by the external feature extraction module As input to the multi-feature fusion block, it is fused using a convolutional layer and also passes through the Tanh activation function to obtain the final inbound traffic prediction value.

[0026] S3 uses traffic data from highway network stations for model training and prediction.

[0027] S3.1 Before model training, historical inbound and outbound traffic data for all sites are divided into training and testing datasets according to a set ratio. This ratio is adjusted based on actual application requirements; for example, the ratio of training to testing datasets is 8:2. During the model training phase, the traffic data in the training dataset is used to construct multi-dimensional features according to the steps described in S1. These features are then used as input to the model constructed in S2. The model is then trained to obtain a trained deep learning-based multi-task traffic prediction model.

[0028] In the model prediction stage, S3.2 First, the traffic data in the test dataset is used to construct multi-dimensional features according to the steps described in S1. Then, the multi-dimensional features and the traffic data in the test dataset are input into the trained deep learning multi-task traffic prediction model to obtain the inbound and outbound traffic of the target site at the prediction time.

[0029] The present invention also proposes a computer system based on the above method, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above method.

[0030] The present invention has the following beneficial effects:

[0031] 1. This invention focuses on the correlation and temporal similarity between inbound and outbound traffic flow. It employs multi-task learning techniques to characterize their common features, which serve as input for feature fusion. This enables multi-task collaborative prediction of inbound and outbound traffic flow at target stations on highway networks. This scheme simultaneously promotes mutual reinforcement in the prediction of inbound and outbound traffic flow, improving the accuracy and reliability of the predictions.

[0032] 2. This invention utilizes deep learning technologies to design a highway network traffic prediction model based on attention mechanisms and convolutional neural networks. It fully learns the dynamic spatiotemporal correlation between the target station and historical traffic data at the prediction time, as well as the impact of external factors on inbound and outbound traffic. By deeply exploring the characteristics of the spatiotemporal correlation of highway network traffic and the changing patterns of the influence of different external factors, the accuracy of traffic prediction is improved.

[0033] 3. This invention analyzes highway network traffic flow from multiple dimensions to uncover its temporal characteristics, dynamic spatial correlations between stations, and the impact of external factors such as holidays and weather. The model design fully considers these influencing factors and extracts the full characteristics of highway network traffic flow, thereby improving the accuracy of traffic flow prediction. Attached Figure Description

[0034] The accompanying drawings, which form part of this application, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:

[0035] Figure 1 This is a framework diagram of the highway network inbound and outbound traffic prediction model (AST-MTP) in an embodiment of the present invention.

[0036] Figure 2 This is a performance comparison chart of the system outbound traffic prediction results of the AST-MTP model in this embodiment of the invention with other baselines.

[0037] Figure 3 This is a performance comparison chart of the system inbound traffic prediction results of the AST-MTP model in this embodiment of the invention with other baselines.

[0038] Figure 4 This is a comparison chart of the cumulative distribution function (CDF) of the MAE index of various forecasting methods on weekdays in an embodiment of the present invention.

[0039] Figure 5 This is a comparison chart of the cumulative distribution function (CDF) of the MAE index of various prediction methods at the weekend in an embodiment of the present invention.

[0040] Figure 6 This is a comparison chart of the cumulative distribution function (CDF) of the MAE performance of outbound traffic at various stations in the embodiments of the invention.

[0041] Figure 7 This is a comparison chart of the cumulative distribution function (CDF) of the MAE performance of the inbound traffic of each site in the embodiments of the invention. Detailed Implementation

[0042] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings, but the present invention can be implemented in many different ways as defined and covered by the claims.

[0043] Example 1:

[0044] This embodiment discloses a multi-task traffic prediction method for highway networks based on deep learning, including the following steps:

[0045] Multidimensional features are constructed, including multidimensional temporal features, spatial features, and external features. The multidimensional temporal features focus on the correlation between the predicted time of inbound and outbound traffic and the hourly inbound traffic value of historical time steps, the hourly inbound traffic value corresponding to each day of historical days, and the hourly inbound traffic value corresponding to each day of historical weeks. The spatial features include the inbound traffic features of key source stations of the target stations of the highway network. The external features include time, weather, and temperature.

[0046] A deep learning-based multi-task traffic prediction model for highway networks is constructed, and training data from the training sample set is used to train the model. This model learns the spatiotemporal correlation between the target station and historical traffic data at the prediction time, as well as the influence of external factors. It learns the common temporal traffic feature representation of inbound and outbound traffic, and fuses the learned features to predict inbound and outbound traffic at the target station, thereby achieving collaborative prediction of inbound and outbound traffic for the highway network.

[0047] Furthermore, this embodiment also discloses a computer system, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of the above method are implemented when the processor executes the computer program.

[0048] This invention can fully utilize the learned dynamic temporal and spatial correlations and external feature influencing factors through the construction and learning of multi-dimensional features, and combine the common temporal flow characteristics of inbound and outbound traffic to perform feature fusion, ultimately achieving multi-task collaborative prediction of inbound and outbound traffic on highway networks. At the same time, the prediction of the two types of traffic promotes each other and can improve the common prediction accuracy.

[0049] Example 2:

[0050] Example 2 is a preferred embodiment of Example 1, focusing on solving the problem of inaccurate traffic flow prediction at toll stations on a provincial highway in a real-world scenario. Based on a deep learning-based multi-task traffic flow prediction method for highway networks, this example extends the specific implementation steps to better adapt to real-world needs.

[0051] Specifically, this example constructs multi-dimensional temporal, spatial, and external features, and employs techniques such as convolutional neural networks, multi-head attention mechanisms, and multi-task learning to extract the dynamic spatiotemporal correlation between highway inbound and outbound traffic in a more comprehensive way. Simultaneously, it learns the common temporal traffic characteristics of both inbound and outbound traffic. This method effectively improves the accuracy of the joint prediction of inbound and outbound traffic while achieving collaborative prediction of inbound and outbound traffic.

[0052] In this embodiment, a deep learning-based multi-task traffic prediction method for highway networks is applied to predict inbound and outbound traffic flow in highway networks, specifically including the following steps:

[0053] I. Data Preprocessing

[0054] This example uses a provincial highway toll station vehicle passage record dataset. This dataset contains passage records of vehicles using ETC and MTC at toll stations, covering a period of 19 months from June 2018 to December 2019, involving approximately 24 million vehicles and over 1 billion passage records. It includes 465 stations across the province, covering 38 highways with a total length of over 6,800 kilometers.

[0055] Data preprocessing mainly includes two aspects:

[0056] Firstly, the aforementioned highway vehicle traffic dataset requires preprocessing such as data cleaning and merging because ETC and MTC data are recorded separately and some records have missing fields. Each record in the preprocessed highway network vehicle traffic data includes the following fields: license plate number, vehicle type, entry toll station ID, exit toll station ID, departure city, destination city, entry time, and departure time.

[0057] Secondly, there is a fine-grained meteorological dataset for each city in the province. Since this example requires the use of fine-grained weather information for the corresponding region, the meteorological dataset needs to be converted into hourly meteorological data, where each record includes city, weather time, weather, temperature, and wind force.

[0058] In this example, the dataset is divided according to the following ratio, with the ratio of training set, validation set and test set being 6:2:2.

[0059] II. Construction of Multidimensional Temporal Features

[0060] Traffic flows on highway networks exhibit correlations not only in the short term but also on longer time scales, such as days or weeks. Furthermore, within specific time periods (e.g., days), traffic flow shows significant periodic variations. To more comprehensively consider these multi-dimensional temporal characteristics, this example constructs multi-dimensional temporal features. For the inbound traffic flow of the highway network, the inbound traffic flow values ​​of the p time steps (e.g., hours) preceding the prediction time T are used to construct the temporal proximity feature. The inbound traffic values ​​for each hour of the q days preceding the predicted time T are used to construct a time-period feature. The inbound traffic values ​​for the corresponding days and hours of each week in the r weeks preceding the predicted time T are used to construct a time trend feature. ;

[0061] For the outbound traffic flow of the expressway network, key time steps are also selected to construct its multi-dimensional temporal characteristics, including the time proximity characteristics of outbound traffic flow. Outbound traffic time cycle characteristics and the time trend characteristics of outbound traffic .

[0062] By constructing multidimensional time features of inbound and outbound traffic, we can include short-term correlation, long-term correlation, and periodic information of highway network traffic.

[0063] III. Spatial Feature Construction

[0064] Spatial correlation varies between sites and changes dynamically over time. Therefore, spatial correlation between sites needs to be considered when predicting outbound traffic. This example uses historical interaction traffic data between sites to identify key source sites for the target site and constructs inbound traffic characteristics for these key source sites.

[0065] Specifically, in At any given moment, for a target site If a site exists arrive Traffic, i.e., the interactive traffic between two sites. Then it is called For target site The source sites, all source sites constitute the target site. Source site collection The total number of source sites is Target site exist Outbound traffic at any time It is the sum of the interactive traffic between all source sites of the target site, i.e. .

[0066] Definitions originate from the source site Interactive traffic Occupy target site Outbound traffic The proportion is For the target site All source sites Calculate separately from each Traffic share Then all of them Sort in descending order; the higher the ranking, the greater the contribution of that source site to the target site's outbound traffic. Then, calculate the traffic percentage. Ranked in the top All source sites Considered as the target site Key source sites; all key source sites constitute the target site. Key source site collection ,Right now ,in For the sorted number Traffic share from major source sites .for Calculate from the source site To the target site Average travel time Let the target time for prediction be... Considering the travel time, the stations are traced from historical traffic data. In time Inbound traffic This is due to the target site exist Outbound traffic at any given time originates from the site The portion mainly consists of its source sites. exist Inbound traffic at any time All key source sites The inbound traffic data, when pieced together, constitutes the key source site's inbound traffic characteristics for the target site.

[0067]

[0068] IV. External Feature Construction

[0069] Traffic flow on highways is affected by external factors such as weekends, holidays, weather, and temperature. Therefore, this example will consider the influence of time, weather, and temperature.

[0070] Traffic flow on highways varies significantly across different time periods. For example, traffic is high during rush hour and significantly lower in the early morning. Furthermore, highway traffic flow patterns differ across days of the week, with weekends and holidays also influencing traffic volume. To describe these characteristics, time-related attributes are defined. ,in , representing the first day of each day Hours; , representing the first of the week sky; , This means that it was a weekend; Represents working days, , The representative is holidays. This represents non-holidays.

[0071] Different weather conditions and temperatures also affect highway traffic flow. For example, severe weather such as heavy fog and sleet significantly reduces visibility, resulting in a marked decrease in traffic volume compared to the same time period with good weather conditions. Therefore, this example categorizes the weather into three types: Category 1 includes sunny, cloudy, and overcast weather; Category 2 includes light rain, showers, and thunderstorms; and Category 3 includes light snow, heavy rain, sleet, fog, dust storms, and blowing dust. For temperature, since it is a continuous characteristic, it is divided into three intervals based on temperature range. Let the temperature be t, then... This refers to interval 1, i.e., the low-temperature interval. The range is 2, i.e., the normal temperature range. This refers to interval 3, i.e., the high-temperature interval. For time... Let the weather attribute at that moment be... ,in Let and represent the three weather categories mentioned above, and let the temperature attribute characteristic at this moment be . ,in , respectively representing low temperature, normal temperature and high temperature range.

[0072] Assuming time The time attribute features are Weather category is The temperature range is ,Will Temporal attribute characteristics of a moment The weather and temperature attributes are concatenated using a concatenation function to obtain the external feature vector at that moment. .

[0073] V. Temporal Convolution Module

[0074] For inbound traffic, the temporal convolution module will construct temporal proximity features of the inbound traffic. Time cycle characteristics and time trend characteristics Input three non-shared CNN convolutional blocks respectively, i.e. Figure 1 The first "Conv" in the temporal convolution module extracts features from the traffic data through convolution. The resulting features are then embedded and fed into a residual neural network, i.e. Figure 1 The "ResUnit" function in the temporal convolution module is used to prevent overfitting. Then, feature extraction is performed again through CNN convolutional blocks. Figure 1 The second "Conv" in the temporal convolution module outputs three temporal features respectively. , and Finally, the extracted multi-dimensional time features are fused through multi-feature fusion to obtain the final output of the inbound traffic time features.

[0075]

[0076] in , and All are learnable parameter matrices, representing respectively , and The contribution of three different traffic temporal characteristics, It is the product of Hadama.

[0077] Similarly, for outbound traffic, after passing through the temporal convolution module, the temporal feature output of the outbound traffic is obtained. for

[0078]

[0079] in , and All are learnable parameter matrices, representing respectively , and The degree of contribution of the three time features.

[0080] VI. Spatial Attention Module

[0081] The outbound traffic flow of a highway network is influenced by the inbound traffic flow from its various source stations, and this spatial correlation changes dynamically over time. To fully capture the dynamic nature of the spatial correlation between traffic flows at different stations, this example uses a spatial attention module to learn this spatial correlation. This module mainly consists of two parts: temporal location embedding and multi-head self-attention. Figure 1 Spatial attention module in model learning and prediction.

[0082] Temporal-location embedding includes both location embedding and temporal embedding.

[0083] Position embedding is achieved by constructing a position vector. As a location code, it is added to the original input vector and fed into the self-attention mechanism, thereby adding location information during the self-attention computation. This example uses a fixed location code based on sine and cosine functions, with the original key source site inbound traffic features as input to the spatial attention module. ,in Representative includes Each site has [number] sites. 3D feature embedding representation. When performing position encoding, the position vector... and Having the same shape, position embedding is obtained. .

[0084] Temporal embedding is similar to the method for constructing temporal attribute features in external feature construction. It uses temporal features such as the hour of the day, the day of the week, whether it is a weekend, and whether it is a holiday to obtain the temporal attribute features corresponding to the prediction time through temporal embedding. Specifically, the constructed time feature vector is first encoded using one-hot encoding. Convert to embedded features Then, a fully connected layer is used to extract the temporal features, resulting in a temporal embedding feature vector. As the output of the temporal embedding layer, the calculation process is as follows:

[0085]

[0086]

[0087] Finally, by embedding the time vector and position embedding vector The vectors are concatenated to obtain the time-location embedding vector.

[0088]

[0089] Multi-head attention mechanisms can improve the stability of the overall learning process, with self-attention mechanisms adaptively learning the spatial correlation between sites from historical traffic data. First, the inbound traffic characteristics of key source sites are obtained... With time location embedding vector Concatenation yields a combined vector. This serves as the input to the spatial attention module. For each self-attention mechanism block, the query, key, and value of the input combination vector are calculated, matrix multiplication is used to generate an attention score matrix, and softmax normalization is applied. The final output of the self-attention block is then obtained. Then output all self-attention heads. The vectors are concatenated and multiplied with the learnable parameter matrix to obtain the output of the multi-head attention block. Finally, the output vector of the multi-head attention module is input into a fully connected layer to obtain the final output of the spatial attention block. .

[0090] VII. External Feature Extraction Module

[0091] This module corresponds to Figure 1 The external feature extraction module in model learning and prediction. For the external features constructed above... First, one-hot encoding is performed to obtain the external feature embedding vector. Subsequently, the final extracted external feature vector is obtained through a fully connected layer. The calculation process is as follows:

[0092]

[0093] VIII. Multi-task prediction module

[0094] Multi-task learning can learn common feature representations from inbound and outbound traffic prediction, thereby learning more useful knowledge, achieving joint prediction of inbound and outbound traffic, and improving the prediction performance of individual tasks.

[0095] Regarding temporal features, the inbound traffic time matrix has been obtained through the temporal convolution module. and outbound traffic time feature matrix .like Figure 1 As shown in the multi-task prediction module of the model learning and prediction, firstly... and Performing concat feature fusion yields a time feature fusion matrix that simultaneously includes inbound and outbound traffic time features.

[0096]

[0097] Next The input is fed into two separate convolutional layers for further feature extraction and feature dimension adjustment, and the output is obtained. and The two feature matrices serve as the common temporal feature representations learned from the temporal fusion features for both inbound and outbound traffic prediction.

[0098] For external features, the inbound and outbound traffic prediction parts share the same external feature extraction module. After passing through this module, a learned common external feature vector is obtained. .

[0099] For outbound traffic prediction, after passing through the temporal convolution module, spatial attention module, external feature extraction module, and multi-task prediction module, the model obtains the learned multi-dimensional temporal features. Spatial features and external features Here, the convolutional layer fuses multi-dimensional features and obtains the final outbound traffic prediction value through an activation function.

[0100]

[0101] Similarly, for inbound traffic prediction, since it does not include spatial features, it only learns temporal features. and external features The final predicted inbound traffic value is

[0102]

[0103] IX. Model Performance Evaluation

[0104] To verify the prediction performance of the proposed high-speed network multi-task traffic prediction model (AST-MTP) based on attention mechanism and convolutional neural network, five methods were selected as the experimental baseline: historical mean (HA), differential autoregressive moving average (ARIMA), support vector regression (SVR), long short-term memory network (LSTM), temporal graph convolutional network (T-GCN), and spatiotemporal graph convolutional neural network (STGCN).

[0105] The historical mean method is a simple model that uses the average of past observations as the basis for prediction.

[0106] The differential autoregressive moving average model uses the differencing, autoregressive, and moving average components of time series data to model the data, and is suitable for stable, non-seasonal data.

[0107] Support vector regression uses the idea of ​​support vector machines to perform regression analysis by constructing a hyperplane, and is suitable for data with non-linear relationships.

[0108] Long Short-Term Memory (LSTM) networks are a variant of recurrent neural networks specifically designed to process sequential data and capture long-term dependencies.

[0109] Time-graph convolutional networks utilize graph convolutional networks to process time-series data, taking into account the temporal relationships between nodes, and are suitable for modeling time-series graph data.

[0110] Spatiotemporal graph convolutional neural networks are graph convolutional networks that combine spatiotemporal information, and are suitable for processing complex data with close spatiotemporal relationships, such as traffic flow prediction.

[0111] The three evaluation indicators selected are as follows:

[0112]

[0113]

[0114]

[0115] in, Representing the A real traffic flow value, Representing the One traffic flow forecast value, This represents the total predicted number.

[0116] The performance of the model proposed in this example will be verified and compared from multiple perspectives, including the following experimental results:

[0117] (1) Baseline performance comparison

[0118] The AST-MTP model proposed in this example was tested on real inbound and outbound traffic data of all stations on a provincial expressway network. The performance of the model proposed in this example was compared with that of other baseline predictions, including three evaluation indicators: MAE, RMSE and MAPE. Figure 2 and Figure 3 The figures show a comparison of the AST-MTP model's prediction results for system outbound / inbound traffic with other baselines and various performance indicators. It can be seen that the AST-MTP model has improved performance in MAE, RMSE, and MAP evaluation indicators compared to other baselines.

[0119] (2) Performance verification of the multi-task prediction module

[0120] To verify the effectiveness of the multi-task prediction module, the prediction results of the proposed multi-task prediction model AST-MTP are compared with the single-task prediction model for entry / exit based on AST-MTP (AST-IN / AST-OUT) and the model without common feature representation components (AST-MTP-LCFD).

[0121]

[0122] As can be seen from Table 1, the proposed high-speed network multi-task prediction model (AST-MTP) in this example not only achieves the joint prediction of the inbound and outbound traffic of the high-speed network through a single model, but also improves the prediction performance compared with single-task prediction of inbound / outbound traffic, without decreasing the prediction performance.

[0123] (3) Comparison of prediction performance in the time dimension

[0124] The predictive performance was analyzed through experiments on weekdays and weekends. Figure 4 and Figure 5 The cumulative distribution function (CDF) of the prediction effects (MAE) for each method is shown in the graphs for weekdays and weekends. The graphs reveal that the AST-MTP model significantly outperforms other baseline methods on both weekdays and weekends, further demonstrating the robustness of the AST-MTP model.

[0125] (4) Comparison of spatial dimension prediction performance

[0126] Regarding the predictive performance in the spatial dimension, the distribution of predictive performance across all stations in the highway network was analyzed. Figure 6 and Figure 7 The CDF comparison results of MAE performance at each site under different prediction methods are shown. Figure 6 For outbound traffic, Figure 7 This represents inbound traffic. As can be seen from the graph, the model performs robustly across different websites.

[0127] (5) Ablation test

[0128] To further verify the effectiveness of each component of the AST-MTP model, this example conducts ablation experiments on each component. Specifically, six components—external feature extraction module, temporal location embedding feature, spatial attention module, temporal proximity feature, temporal periodicity feature, and temporal trend feature—were selected for ablation experiments to verify their effectiveness. Table 2 shows the ablation experiment results for each component. The results in the table demonstrate that removing any of these components leads to a decrease in the overall predictive performance of the model, thus illustrating the effectiveness of these components in the AST-MTP model.

[0129]

Claims

1. A multi-task traffic prediction method for highway networks based on deep learning, characterized in that, This method consists of the following steps: S1 constructs multi-dimensional features, including multi-dimensional temporal features, spatial features, and external features; The multi-dimensional temporal features include temporal proximity features, temporal periodic features, and temporal trend features of inbound and outbound traffic on the highway network, to characterize the short-to-medium-term correlation, periodicity, and long-term correlation between the predicted traffic flow and historical traffic. The temporal proximity feature is constructed from traffic values ​​at adjacent time steps on the time axis. The temporal periodic feature is constructed from traffic values ​​at the same hour each day before the predicted time. The temporal trend feature is constructed from traffic values ​​at the corresponding hour of the corresponding day each week before the predicted time. The temporal proximity features of inbound and outbound traffic on the highway network are obtained through the above methods. and Time cycle characteristics and Time trend characteristics and ; The spatial features are constructed only for outbound traffic on the highway network. For each predicted station (i.e., the target station), the traffic from the source stations of the target station's outbound traffic is calculated and sorted. The top n stations are selected based on their contribution as the key source stations for that target station, and the average travel time from each key source station to the target station is calculated. tracing back to the time before the prediction Inbound traffic from key source sites within a given time period is concatenated into a longer sequence to construct inbound traffic features. ; The external features include time attribute features, weather features, and temperature features. The time attribute features include four attributes: time of day, day of the week, whether it is a weekend, and whether it is a holiday. The weather features categorize common weather conditions into three types based on their impact on traffic: Category 1 includes sunny, cloudy, and overcast weather; Category 2 includes light rain, showers, and thunderstorms; and Category 3 includes light snow, heavy rain, sleet, fog, dust storms, and blowing sand. The impact of weather on traffic gradually increases from Category 1 to Category 3. The temperature features are continuous features, divided into three temperature ranges: low temperature, normal temperature, and high temperature. The external features are obtained by concatenating the time attribute features, weather features, and temperature features using the Concat method. ; S2 constructs a deep learning-based multi-task traffic prediction model, which includes a temporal convolution module, a spatial attention module, an external feature extraction module, and a multi-task prediction module. The temporal convolution module includes a first-layer CNN convolutional block, a residual neural network, a second-layer CNN convolutional block, and a temporal feature fusion block. The input is the multi-dimensional temporal features constructed by S1, and the output is the temporal features of the inbound traffic. Temporal characteristics of outbound traffic The specific implementation steps are as follows: For inbound traffic, the time proximity characteristics of the inbound traffic will be considered. Time cycle characteristics and time trend characteristics The first CNN convolutional block, containing three non-shared CNN convolutional blocks, is used to extract features from the inbound traffic flow. These extracted features are then fed into a residual neural network to prevent overfitting. The output of the residual neural network serves as the input to the second CNN convolutional block, which also contains three non-shared CNN convolutional blocks, yielding three different time-related features. , and Finally, in the time feature fusion module, the three output time features are combined. , and The input is multiplied by the three weight matrices using the Hadamard product. These weight matrices are randomly initialized and continuously learned and updated during model training. The three outputs are then summed to obtain the inbound flow time feature vector. ; For outbound traffic, the time feature vector of outbound traffic is also obtained through the aforementioned time convolution module. ; The spatial attention module includes a temporal embedding module, a location embedding module, and a multi-head self-attention module. The input is the inbound traffic features constructed by S1. The output is a spatial feature vector. The specific implementation steps are as follows: The time embedding module consists of a one-hot coding layer and a fully connected layer. The one-hot coding layer encodes the hour of the day, the day of the week, whether it is a weekend, and whether it is a holiday. Then, the time embedding vector is obtained in the fully connected layer. ; The location embedding module performs fixed-position encoding on each station using sine and cosine functions to obtain a location embedding vector. ; The time embedding vector obtained by the above time embedding module The position embedding vector obtained by the position embedding module Perform concatenation to obtain the time-location embedding vector. ; The multi-head self-attention module comprises a multi-head attention structure and a fully connected layer. The multi-head attention structure consists of multiple self-attention blocks, and the input is the aforementioned temporal position embedding vector. and the inbound traffic characteristics constructed in S1 First, the combined vector is obtained by concatenating the vectors using Concat. This is used as the input to each self-attention block in the multi-head attention structure; within each self-attention block, the combined vector is used... The query, key, and value are multiplied by three different weight matrices, which are randomly initialized and continuously learned and updated during model training. The results of these multiplications are query, key, and value, respectively. Then, the key is transposed and multiplied by the query to obtain the attention score matrix, which is then normalized using Softmax to obtain the normalized attention score matrix. This normalized attention score matrix is ​​then multiplied by the value to obtain the output of the current self-attention block. Since the multi-head self-attention structure contains multiple self-attention blocks, there will be multiple outputs. Concat is used to concatenate the outputs of all self-attention blocks and multiply them by the weight matrix, which is randomly initialized and continuously learned and updated during model training. The output vector is then input into a fully connected layer to obtain the spatial feature vector of the spatial attention module. ; The external feature extraction module includes a one-hot encoding layer and a fully connected layer, with the external features constructed by S1 as input. The output is the external feature vector. The specific implementation steps are as follows: External features constructed by S1 By using a one-hot encoding layer, the categorical variables are converted into binary vectors, resulting in the external feature embedding vector. Subsequently, the extracted external feature vector is obtained through processing by a fully connected layer. ; The multi-task prediction module includes a multi-task learning block and a multi-feature fusion block, which obtains the inbound traffic time feature vector from the temporal convolution module. and outbound flow time feature vector A common feature representation is learned through multi-task learning blocks, and then a multi-feature fusion block is used to achieve joint prediction of inbound and outbound traffic, thereby improving the prediction performance of individual tasks. The specific implementation steps are as follows: The multi-task learning block contains two separate convolutional layers; the temporal convolutional module outputs the inbound traffic temporal feature vector. and outbound flow time feature vector As input to the multi-task learning block, the input feature vectors are first fused using the Concat concatenation method to obtain a time feature fusion matrix that simultaneously contains the time features of both inbound and outbound traffic. Next The input is fed into two separate convolutional layers, where feature extraction and feature dimension adjustment are performed separately to obtain two feature matrices. and These serve as common time features for both inbound and outbound traffic forecasts, respectively. The multi-feature fusion block contains convolutional layers and a Tanh activation function, used to predict outbound and inbound traffic flows, respectively; the specific steps are as follows: For outbound traffic prediction, the common temporal features of the outbound traffic prediction output by the multi-task learning block are represented. Spatial feature vectors output by the spatial attention module and the external feature vector output by the external feature extraction module As input to the multi-feature fusion block, a convolutional layer is used for fusion, and the final outbound traffic prediction value is obtained through the Tanh activation function; For inbound traffic prediction, since inbound traffic does not contain spatial features, only the common temporal features of the inbound traffic prediction output by the multi-task learning block are represented. and the external feature vector output by the external feature extraction module As input to the multi-feature fusion block, it is fused using a convolutional layer and also passes through the Tanh activation function to obtain the final inbound traffic prediction value. S3 uses traffic data from highway network stations for model training and prediction; S3.1 Before model training, the historical inbound and outbound traffic data of all sites are divided into training dataset and test dataset according to the proportion. During the model training stage, the traffic data in the training dataset is used to construct multi-dimensional features according to the steps in S1, which are used as inputs to the model constructed in S2. Then the model is trained to obtain a trained multi-task traffic prediction model based on deep learning. S3.2 In the model prediction stage, first construct multi-dimensional features from the traffic data in the test dataset according to step S1, and then input the multi-dimensional features and the traffic data in the test dataset into the trained deep learning multi-task traffic prediction model to obtain the inbound and outbound traffic of the target site at the prediction time.

2. A method for multi-task traffic prediction of highway networks based on deep learning according to claim 1, characterized in that: In S3.1, the ratio of training dataset to test dataset is adjusted according to actual application requirements.

3. A method for multi-task traffic prediction of highway networks based on deep learning according to claim 2, characterized in that: In S3.1, the ratio of the training dataset to the test dataset is 8:

2.

4. A computer system based on the deep learning-based multi-task traffic prediction method for highway networks as described in any one of claims 1 to 3, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method of claim 1.

Citation Information

Patent Citations

  • Method of detecting exception of toll station traffic flow

    CN109255956A

  • Highway website point flow prediction method and system based on space-time attention mechanism

    CN113821929A