Traffic flow prediction method

By adopting a graph sampling aggregation network and a long and short-term memory network in traffic flow prediction, considering the impact of adjacent road sections in the road network, the problem of low accuracy of traffic flow prediction in the prior art is solved, and accurate prediction of future traffic flow is achieved, providing accurate data support for traffic governance and road planning.

CN119516771APending Publication Date: 2025-02-25CHONGQING CHENGTOU GOLD CARD INFORMATION IND GP CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411579437.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The existing technology has low accuracy in traffic flow prediction, ignoring the impact of adjacent sections in the road network on the current section, and cannot provide accurate data support for traffic governance and road planning.

Method used

The traffic flow prediction method based on graph sampling aggregation network and long and short-term memory network is adopted to consider the impact of adjacent sections in the road network where the current section is located. By constructing a traffic flow feature set and preprocessing historical traffic flow information, the prediction model is trained to predict future traffic flow.

Benefits of technology

Accurate prediction of traffic flow at the set time in the future is achieved, accurate data support is provided for traffic governance and road planning, and the accuracy of prediction is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119516771A_ABST
    Figure CN119516771A_ABST
Patent Text Reader

Abstract

The traffic flow prediction method provided by the invention comprises the following steps: acquiring historical traffic flow information of a target area road, and preprocessing the historical traffic flow information; constructing a traffic flow prediction model based on a graph sampling aggregation network and a long short-term memory network, and inputting the preprocessed historical traffic flow information into the traffic flow prediction model for training; and obtaining traffic flow information of one hour before the current moment, preprocessing the traffic flow information and taking the traffic flow information as prediction input information, and inputting the prediction input information into the trained traffic flow prediction model to obtain traffic flow information of a future target moment. According to the method, during traffic flow prediction, the influence of the historical traffic flow in the current target road section is considered, and the influence of the adjacent road sections in the road network where the current road section is located on the current road section is also considered, so that the traffic flow at the set moment in the future can be accurately predicted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a traffic flow prediction method, and in particular to a traffic flow prediction method based on a graph sampling aggregation network and a long short-term memory network. Background Art

[0002] Traffic flow is an extremely important parameter in the road network, providing accurate data basis for traffic scheduling and subsequent road network planning.

[0003] In the prior art, traffic flow is obtained by roughly estimating the traffic flow in the future period through the current traffic flow or historical traffic flow. However, this method has low accuracy and cannot provide accurate data support for subsequent traffic congestion management and related road network planning.

[0004] Of course, some traffic flow prediction methods have been proposed in the prior art, such as the Kalman filter algorithm, the support vector machine regression prediction model, etc. However, although these methods can make certain predictions on the current traffic flow of a certain road section, their accuracy is still insufficient, mainly because these methods ignore the influence of spatial factors. These methods mainly focus on the flow status of the current target road section, but ignore the influence of the adjacent intersections of the current road section in the road network.

[0005] Therefore, in order to solve the above technical problems, it is urgent to propose a new technical means. Summary of the invention

[0006] In view of this, the purpose of the present invention is to provide a traffic flow prediction method, which not only considers the impact of historical traffic flow in the current target section, but also considers the impact of adjacent sections in the road network where the current section is located on the current section, so as to accurately predict the traffic flow at a set time in the future, and provide accurate data support for subsequent traffic management and road planning.

[0007] The present invention provides a method for predicting traffic flow, comprising the following steps:

[0008] S1. Obtain historical traffic flow information of roads in the target area and preprocess the historical traffic flow information;

[0009] S2. Construct a traffic flow prediction model based on graph sampling aggregation network and long short-term memory network, and input the preprocessed historical traffic flow information into the traffic flow prediction model for training;

[0010] S3. Obtain the traffic flow information one hour before the current moment and pre-process it as prediction input information, and input the prediction input information into the trained traffic flow prediction model to obtain the traffic flow information at the future target moment.

[0011] Furthermore, in step S1, preprocessing the historical traffic flow information specifically includes:

[0012] The historical traffic flow information is divided according to the collection time window, including the hour interval window and the minute interval window, and the traffic flow information corresponding to each hour interval window and the traffic flow information corresponding to each minute window are recorded;

[0013] Construct traffic flow feature set:

[0014]

[0015] Where N represents the total number of road sections in the target area, T is the total number of traffic flow information collection times, and f i,j represents the traffic flow characteristics of road section i at the jth collection time, and: f i,j =(tf i,j h j m j ) T , tf i,j represents the traffic flow of road section i at the jth collection time, h j represents the hourly interval window corresponding to the jth collection time, m j Indicates the minute interval window corresponding to the jth collection moment;

[0016] The deviation normalization process is applied to each feature in the traffic flow characteristics.

[0017] Furthermore, preprocessing the historical traffic flow information also includes filling in the gaps in the actual traffic flow data, as follows:

[0018] Determine the collection time point corresponding to the missing information in the historical traffic flow information;

[0019] Obtaining a collection time point of the same characteristic time interval earlier than the collection time point;

[0020] Calculate the Euclidean distance between the collection time point corresponding to the missing information and the collection time point in the same characteristic time interval, and find the collection time point in the same characteristic time interval with the smallest Euclidean distance, and use the traffic flow information corresponding to this time point as the traffic flow at the collection time point corresponding to the confirmed information;

[0021] The same characteristic time interval refers to a weekly time period, the same Sunday and the same hour interval window.

[0022] Furthermore, the traffic flow prediction model based on the graph sampling aggregation network and the long short-term memory network specifically includes a first fully connected layer, a graph sampling aggregation network, a long short-term memory network and a second fully connected layer, the first fully connected layer is input with the preprocessed traffic flow information, the output end of the first fully connected layer is connected to the input end of the graph sampling aggregation network, the output end of the graph sampling aggregation network is connected to the input end of the long short-term memory network, the output end of the long short-term memory network is connected to the input end of the second fully connected layer, and the second fully connected layer outputs the prediction result.

[0023] Furthermore, the preprocessed traffic flow information is divided into sliding windows with a sampling time interval of 5 minutes, and the sliding window size is 13, where the 13th element is used as a label to train the traffic flow prediction model.

[0024] The beneficial effects of the present invention are as follows: Through the present invention, when predicting traffic flow, not only the impact of historical traffic flow in the current target section is considered, but also the impact of adjacent sections in the road network where the current section is located on the current section is considered, so that the traffic flow at a set time in the future can be accurately predicted, providing accurate data support for subsequent traffic management and road planning. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:

[0026] Figure 1 It is a flow chart of the present invention.

[0027] Figure 2 It is a schematic diagram of the traffic prediction model structure of the present invention. DETAILED DESCRIPTION

[0028] The present invention is further described in detail below:

[0029] The present invention provides a method for predicting traffic flow, comprising the following steps:

[0030] S1. Obtain historical traffic flow information of roads in the target area and preprocess the historical traffic flow information;

[0031] S2. Construct a traffic flow prediction model based on graph sampling aggregation network and long short-term memory network, and input the preprocessed historical traffic flow information into the traffic flow prediction model for training;

[0032] S3. Obtain the traffic flow information one hour before the current moment and pre-process it as prediction input information, and input the prediction input information into the trained traffic flow prediction model to obtain the traffic flow information at the future target moment. Through the above method, when predicting traffic flow, not only the impact of historical traffic flow in the current target section is considered, but also the impact of adjacent sections in the road network where the current section is located on the current section is considered, so that the traffic flow at the future set time can be accurately predicted, providing accurate data support for subsequent traffic management and road planning.

[0033] In this embodiment, in step S1, preprocessing the historical traffic flow information specifically includes:

[0034] The historical traffic flow information is divided according to the collection time window, including hour interval window and minute interval window, and the traffic flow information corresponding to each hour interval window and the traffic flow information corresponding to each minute window are recorded; the hour interval window is 1 hour long, and the minute interval window is 5 minutes long;

[0035] Construct traffic flow feature set:

[0036]

[0037] Where N represents the total number of road sections in the target area, T is the total number of traffic flow information collection times, and f i,j represents the traffic flow characteristics of road section i at the jth collection time, and: f i,j =(tf i,j h j m j ) T , tf i,j represents the traffic flow of road section i at the jth collection time, h j represents the hourly interval window corresponding to the jth collection time, m j Indicates the minute interval window corresponding to the jth collection moment;

[0038] The deviation normalization process is applied to each feature in the traffic flow characteristics.

[0039] In this embodiment, preprocessing the historical traffic flow information also includes filling in the gaps in the actual traffic flow data, as follows:

[0040] Determine the collection time point corresponding to the missing information in the historical traffic flow information;

[0041] Obtaining a collection time point of the same characteristic time interval earlier than the collection time point;

[0042] Calculate the Euclidean distance between the collection time point corresponding to the missing information and the collection time point in the same characteristic time interval, and find the collection time point in the same characteristic time interval with the smallest Euclidean distance, and use the traffic flow information corresponding to this time point as the traffic flow at the collection time point corresponding to the confirmed information;

[0043] Among them, the same feature time interval is a weekly time period, the same Sunday and the same hourly interval window. For example, if the data of a certain collection time point between 10 and 11 o'clock on Wednesday of the 20th week of a certain year is missing, then the collection time point of each Wednesday in the time period is found in the historical data before the 20th week of that year, and the Euclidean distance is calculated to find the collection time point with the minimum Euclidean distance. Then the traffic flow corresponding to the collection time point is used as the traffic flow information of a certain collection time point between 10 and 11 o'clock on Wednesday of the 20th week of that year. Through the above, the training data can be made complete, thereby effectively improving the accuracy of model training.

[0044] In this embodiment, the traffic flow prediction model based on the graph sampling aggregation network and the long short-term memory network specifically includes a first fully connected layer, a graph sampling aggregation network, a long short-term memory network and a second fully connected layer. The first fully connected layer is input with the preprocessed traffic flow information, the output end of the first fully connected layer is connected to the input end of the graph sampling aggregation network, the output end of the graph sampling aggregation network is connected to the input end of the long short-term memory network, the output end of the long short-term memory network is connected to the input end of the second fully connected layer, and the second fully connected layer outputs the prediction result.

[0045] When constructing the training dataset, you also need to construct an undirected road graph G in the target area:

[0046] This is because traffic roads intersect each other at intersections, and the one-way road formed between two intersections is a road section. Vehicles travel on one road section and transfer to another road section through the intersection, which causes changes in the traffic flow of the road section; the traffic flow of a road section is also affected by the number of vehicles entering and leaving the road section, that is, the dependence relationship between the two road sections is mutual.

[0047] G = {V, E, A}; where V represents a node set, V = {v1, v2, ..., v n}, which contains all one-way road segments in the target area, E represents the connection relationship between road segments, A represents the adjacency matrix, and the elements of the adjacency matrix are edge=1 means there is an edge between the road segments, that is, there is a connection relationship;

[0048] Among them, the first fully connected layer maps the 3D feature vector in the traffic flow characteristics at each moment into 8 dimensions and converts it into a high-dimensional feature representation, which is mapped as follows:

[0049] h = wx + b, where x is the input feature, w is the weight matrix, and b is an 8-dimensional vector. Both w and b are trainable parameters.

[0050] Then the adjacency matrix and the feature information processed by the fully connected layer are input into the value graph sampling aggregation network.

[0051] Graph Sampling and Aggregation Network (Graph SAGE) is a graph convolutional network that learns node spatial dependencies by sampling neighbor nodes and aggregating neighbor feature information.

[0052] For node v, a fixed number of neighbor nodes are selected and the neighbor feature nodes are aggregated using the GCN aggregator. The aggregation result is expressed as:

[0053]

[0054] Where N(v) is the set of neighboring nodes of node v. After averaging each dimension of the feature values ​​of the neighboring nodes, they are mapped to the target feature dimension through a linear transformation with parameter W, and then through a nonlinear activation function σ, a layer of GraphSAGE output is obtained.

[0055] The traffic flow information features and spatial relationship graphs at T moments are subjected to two layers of GraphSAGE operations, that is, the features of the two-hop neighboring nodes are aggregated for each node, and the features of each node are mapped to 64 dimensions. The final output data size is T×N×64.

[0056] Long Short-Term Memory (LSTM) is a time-recurrent neural network. Each LSTM unit consists of an input gate, a forget gate, and an output gate. The output data of GraphSAGE is reorganized into a sequence of (T, N×64), that is, the feature information of each road section node at each collection moment is concatenated into a vector and input into the features of the LSTM unit; the output of the long short-term memory network is processed by the second fully connected layer and the final prediction result is output.

[0057] The entire network uses the mean absolute error (MAE) to calculate the error between the output prediction value and the true value (i.e. as a loss function). The MAE calculation formula is as follows:

[0058]

[0059] Among them, y i is the true value, is the predicted value. The network is updated using the Adam optimizer with a learning rate of 10e-5.

[0060] Among them, the preprocessed traffic flow information is used as a sliding window with a sampling time interval of 5 minutes, and the sliding window size is 13, among which the 13th element is used as a label to train the traffic flow prediction model.

[0061] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.

Claims

1. A traffic flow prediction method, characterized in that: The following steps are involved: S1. Obtain historical traffic flow information of roads in the target area and preprocess the historical traffic flow information; S2. Construct a traffic flow prediction model based on graph sampling aggregation network and long short-term memory network, and input the preprocessed historical traffic flow information into the traffic flow prediction model for training; S3. Obtain the traffic flow information one hour before the current moment and pre-process it as prediction input information, and input the prediction input information into the trained traffic flow prediction model to obtain the traffic flow information at the future target moment.

2. The traffic flow prediction method according to claim 1, characterized in that: In step S1, preprocessing the historical traffic flow information specifically includes: The historical traffic flow information is divided according to the collection time window, including the hour interval window and the minute interval window, and the traffic flow information corresponding to each hour interval window and the traffic flow information corresponding to each minute window are recorded; Construct traffic flow feature set: Where N represents the total number of road sections in the target area, T is the total number of traffic flow information collection times, and f i,j represents the traffic flow characteristics of road section i at the jth collection time, and: f i,j =(tf i,j h j m j ) T , tf i,j represents the traffic flow of road section i at the jth collection time, h j represents the hourly interval window corresponding to the jth collection time, m j Indicates the minute interval window corresponding to the jth collection moment; The deviation normalization process is applied to each feature in the traffic flow characteristics.

3. The traffic flow prediction method according to claim 1, characterized in that: Preprocessing of historical traffic flow information also includes filling in the gaps in the actual traffic flow data, as follows: Determine the collection time point corresponding to the missing information in the historical traffic flow information; Obtaining a collection time point of the same characteristic time interval earlier than the collection time point; Calculate the Euclidean distance between the collection time point corresponding to the missing information and the collection time point in the same characteristic time interval, and find the collection time point in the same characteristic time interval with the smallest Euclidean distance, and use the traffic flow information corresponding to this time point as the traffic flow at the collection time point corresponding to the confirmed information; The same characteristic time interval refers to a weekly time period, the same Sunday and the same hour interval window.

4. The traffic flow prediction method according to claim 1, characterized in that: The traffic flow prediction model based on graph sampling aggregation network and long short-term memory network specifically includes a first fully connected layer, a graph sampling aggregation network, a long short-term memory network and a second fully connected layer. The first fully connected layer is input with preprocessed traffic flow information, the output end of the first fully connected layer is connected to the input end of the graph sampling aggregation network, the output end of the graph sampling aggregation network is connected to the input end of the long short-term memory network, the output end of the long short-term memory network is connected to the input end of the second fully connected layer, and the second fully connected layer outputs the prediction result.

5. The traffic flow prediction method according to claim 4, characterized in that: The preprocessed traffic flow information is used as a sliding window with a sampling time interval of 5 minutes, and the sliding window size is 13, where the 13th element is used as a label to train the traffic flow prediction model.

Citation Information

Cited By

  • Road traffic operation state prediction method, system and equipment

    CN121747331A