Multi-directional traffic flow prediction method based on spatiotemporal residual neural network of interest points

Through a multi-directional traffic flow prediction method based on the space-time residual neural network of the point of interest, the traffic flow data of electric bicycles is processed using a fully connected neural network and a residual convolutional network, the challenging problem of traffic flow prediction of electric bicycles is solved and improved Prediction accuracy and feature capture capability.

CN114154740BActive Publication Date: 2025-01-17HANGZHOU DIANZI UNIVERSITY SHANGYU INSTITUTE OF SCIENCE & ENGINEERING CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111510019.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-10
Publication Date
2025-01-17
Estimated Expiration
2041-12-10

AI Technical Summary

Technical Problem

Traffic flow prediction of electric bicycles is challenging. Due to spatial correlation, temporal correlation, geographical environment and heterogeneity, the prior art is difficult to predict accurately, and traditional methods fail to effectively utilize time signals and point-of-interest information.

Method used

The multi-directional traffic flow prediction method based on the spatial and temporal residual neural network of the point of interest is adopted. By obtaining historical traffic data, the time signal and point of interest signal are extracted, and the fully connected neural network, residual convolution network and remediation are used. The correction layer performs feature fusion to predict traffic flow.

Benefits of technology

The accuracy of traffic flow prediction of electric bicycles is improved, and the trend of traffic flow changes is described through four moving states, and the time signal and interest attention mechanism are integrated into the gradient vanishing problem, which solves the temporal and spatial feature capture ability of the data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114154740B_ABST
    Figure CN114154740B_ABST
Patent Text Reader

Abstract

The present invention discloses a multi-directional traffic flow prediction direction based on a spatiotemporal residual neural network of interest points. The method is based on short-term vehicle trajectory data, and enhances spatiotemporal features by adding time signals and interest point signals. 3D CNN is used to extract the spatiotemporal features of traffic flow changes over time, and residual neural networks are combined to avoid model overfitting. Finally, the information with spatiotemporal features is weighted compressed, and a traffic flow distribution matrix with mobile status is output, thereby realizing the prediction of regional traffic flow. The method of the present invention well correlates the characteristics of the spatial distribution of traffic flow changing over time, and integrates the relationship between time signals and interest point signals. It has the characteristics of high accuracy and strong practicality, and can provide decision support for public facility deployment, traffic diversion, land use planning, etc.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of traffic flow prediction, and in particular to a multi-directional traffic flow prediction method based on a point-of-interest spatiotemporal residual neural network. Background Art

[0002] Traffic data, as a ubiquitous spatiotemporal data type, shows correlation in both time and space dimensions. In addition, traffic forecasting research in the past few decades has mainly focused on taxis, private cars and shared bicycles, while research on electric bicycles is relatively rare. In addition, due to the short driving time and short driving distance of electric bicycles, the periodicity of the driving trajectory data of electric bicycles is not obvious. For many reasons, the prediction of electric bicycles is more challenging than traditional traffic forecasting. In recent years, electric bicycles have gradually become an indispensable means of transportation in people's daily lives due to their low price and small size. According to statistics, there are nearly 300 million electric bicycles in my country, and almost every household owns at least one electric bicycle. A large number of electric bicycles will cause many traffic problems, such as congestion in non-motor vehicle lanes. Therefore, the prediction of electric bicycle traffic flow has become a valuable topic for solving some traffic problems. In addition, the real-time prediction of electric bicycle traffic can also provide a lot of data support for various transportation services: 1) improve the navigation accuracy of electric bicycles; 2) implement mobile charging piles; 3) provide passengers with more detailed traffic information so that passengers can make better travel plans.

[0003] In summary, accurately predicting the flow of electric bicycles is very challenging and is mainly affected by the following four factors:

[0004] 1. Spatial correlation: Due to the local correlation in space, the observations obtained at adjacent locations are correlated with each other.

[0005] 2. Temporal correlation: The observations obtained at consecutive time intervals are highly correlated, i.e., if an upward trend is detected from the observations in the last few consecutive time intervals, there is a high probability that the observations at the next moment will increase.

[0006] 3. Geographical environment: The geographical environment has a significant impact on the prediction of electric bicycle flow, that is, shopping malls and company clusters have greater attraction during the morning peak hours, while residential clusters have greater repulsion during the morning peak hours.

[0007] 4. Heterogeneity: Traffic data exhibits heterogeneity in both spatial and temporal dimensions, i.e. the mutual influence between two locations varies with distance and geographical context. Similarly, the intensity of temporal influence also varies from region to region. Summary of the invention

[0008] In order to overcome the above-mentioned shortcomings of the prior art, the present invention provides a method for predicting battery vehicle flow based on a spatiotemporal residual neural network of interest points, which can effectively solve the above-mentioned problems. The specific technical solutions adopted by the present invention are as follows:

[0009] A multi-directional traffic flow prediction method based on interest point spatiotemporal residual neural network includes the following steps:

[0010] S1. Acquire historical traffic flow data before a time to be predicted in the area to be predicted, wherein the historical traffic flow data includes positions of different vehicles in the area to be predicted at different times and vehicle travel directions; extract a plurality of traffic flow data time slices from the historical traffic flow data according to a preset time slice interval;

[0011] S2. The area to be predicted is rasterized to be divided into a series of grids. The vehicles in each time slice of traffic data are mapped to the corresponding grids of the area to be predicted according to their coordinates, and the vehicle driving direction is defined as the moving state of the vehicle in the grid. The moving states include upward, downward, left, and right. The total number of vehicles in each moving state contained in each grid in each time slice is counted and used as the grid value, and the grid value is mapped to a matrix element, so as to construct a two-dimensional traffic matrix for different moving states in each time slice, and the two-dimensional traffic matrices of each moving state in all time slices are superimposed according to the time dimension to form a three-dimensional traffic matrix.

[0012] S3, extracting the hour field and the minute field from the time to be predicted, and concatenating them to form a binary time signal vector;

[0013] S4, obtaining the spatial geographic location of all points of interest (POIs), and mapping the points of interest of different functional categories to the grid of the area to be predicted, counting the total number of points of interest of each group of functional categories in each grid and using them as grid values, mapping the grid values ​​to matrix elements, thereby constructing a two-dimensional matrix-formed point of interest slice for each group of functional categories of points of interest, and superimposing the point of interest slices of all functional categories to form a three-dimensional tensor-formed point of interest signal;

[0014] S5. Use the three-dimensional matrix of traffic flow, the time signal vector and the point of interest signal as inputs of a trained multi-directional traffic flow prediction model, wherein the multi-directional traffic flow prediction model comprises a first fully connected neural network, a second fully connected neural network, a three-dimensional residual convolutional network and a recalibration layer. The first fully connected neural network outputs a time signal matrix according to the time signal vector, the second fully connected neural network outputs a point of interest signal matrix according to the point of interest signal, and the three-dimensional residual convolutional network outputs a result matrix according to the fusion features of the three-dimensional matrix of traffic flow, the point of interest signal matrix and the time signal matrix. Finally, the result matrix is ​​subjected to a weighted compression operation in the recalibration layer to obtain a multi-directional traffic flow prediction result.

[0015] Preferably, in S1, the area to be predicted is a rectangular area; the time span of the historical traffic flow data is [t, t+(m-1)*τ], and m traffic flow data time slices are extracted at intervals of τ minutes.

[0016] Furthermore, the specific implementation steps of S2 are as follows:

[0017] S21, the area to be predicted is rasterized and divided into I*J grids, the grid of the i-th row and j-th column is P ij ;

[0018] S22, each vehicle in each time slice of the traffic data is mapped to the corresponding grid of the area to be predicted according to its coordinates, and the vehicle driving direction is defined as the moving state of the vehicle in the grid, and the moving state includes four types: upward, downward, left, and right;

[0019] S23, count the total number of vehicles in each mobile state contained in each grid in each time slice, and calculate the number of vehicles in each grid P in time slice t. ij The vehicle flow in the moving state d is recorded as All I*J grids corresponding to Constructed as a two-dimensional matrix of vehicles with a moving state of d in the entire area to be predicted within time slice t Traffic 2D Matrix The value of the element in row i and column j is

[0020] S24, the traffic flow two-dimensional matrix of all m traffic flow data time slices Splicing by time dimension to form a three-dimensional matrix of traffic flow

[0021] Furthermore, the specific implementation steps of S3 are as follows:

[0022] The time to be predicted t pred Convert to contain hour field tpred_hour and minute field t pred_minute The two-element time signal vector h t =[t pred_hour ,t pred_minute ].

[0023] Preferably, the specific implementation steps of S4 are as follows:

[0024] S41, obtaining the spatial geographic locations of all points of interest, and mapping all points of interest to the P nodes of the area to be predicted according to their locations. ij In the grid;

[0025] S42, divide all points of interest into n groups according to different functional categories, and count the number of points of interest in each group g on the grid P ij The number of points of interest within the grid P ij The grid value of The grid values ​​of all grids corresponding to each interest point group g Construct the interest point slice Y corresponding to the interest point group g g , Υ g The size is I*J;

[0026] S43, concatenate the interest point slices corresponding to all n interest point groups, and obtain the interest point signal Ψ=[Υ1, Υ2, ..., Υ n ], whose size is n*I*J.

[0027] Preferably, the specific implementation steps of S5 are as follows:

[0028] S51: The three-dimensional matrix of traffic flow The time signal vector h t and the point of interest signal Ψ are input into a trained multi-directional traffic flow prediction model, wherein the multi-directional traffic flow prediction model includes a first fully connected neural network, a second fully connected neural network, a three-dimensional residual convolutional network and a recalibration layer;

[0029] S52, the time signal h t is input to the ts In the first fully connected neural network of the cascade of fully connected layers, the input of the first fully connected layer is the time signal h t , the input of the next fully connected layer is the output of the previous fully connected layer, and the output of the last fully connected layer is Will The vector is mapped element by element to a matrix of size (I*J), resulting in a time signal matrix H of size (I,J) t ;

[0030] S53, the point of interest signal Ψ=[Υ1, Υ2, ..., Υ n ]After input, slice each point of interest g Get its average self-weight z g :

[0031]

[0032] The average self-weight matrix Z of the interest point signal Ψ is obtained as follows: n}, where n represents the number of interest point groups;

[0033] Then the average self-weight matrix Z is input into the L ps The second fully connected neural network of the cascaded fully connected layers is calculated layer by layer, where the input of the first fully connected layer is the average self-weight matrix Z, the input of the next fully connected layer is the output of the previous fully connected layer, and the output of the last fully connected layer is

[0034] Then, the gate mechanism is used to output Mapped to a variable between 0 and 1, the calculation process is as follows:

[0035]

[0036] where f si is the activation function;

[0037] Finally, the interest point signal matrix is ​​obtained by calculation

[0038]

[0039] Among them, ⊙ represents matrix dot product;

[0040] S54, the traffic flow three-dimensional matrix Point of Interest Signal Matrix and the time signal matrix H t Perform feature fusion, The fusion features of the kth time slice of traffic data in The calculation formula is as follows:

[0041]

[0042] in, and are all trainable parameters, m is The number of time slices of traffic data in the middle;

[0043] Finally, the fused traffic matrix is ​​obtained

[0044] S55, the fused traffic matrix X Γ Input contains L c The three-dimensional residual convolution network with three-dimensional residual convolution layers is calculated layer by layer, where the input traffic matrix X of the first three-dimensional residual convolution layer is Γ The result of each 3D residual convolution layer after the 3D residual convolution operation is used as the input of the next 3D residual convolution layer. The output of all 3D residual convolution layers in the 3D residual convolution network is concatenated to form the final result matrix X ST ; For any l-th three-dimensional residual convolution layer, the three-dimensional residual convolution operation performed is as follows:

[0045] First, perform a three-dimensional convolution operation on the input of the current three-dimensional residual convolution layer to obtain the convolution result:

[0046]

[0047] Among them, Cov3D represents the three-dimensional convolution operation, represents the output of the l-1th three-dimensional residual convolution layer, where and is the trainable parameter in the l-th layer 3D convolution operation, f c is the activation function;

[0048] Then, the convolution result of the three-dimensional convolution operation output is Perform batch normalization on each element in to get the batch normalization result

[0049] Finally, the batch regularization results Then compare it with the output matrix of the previous layer Add together to get the output matrix of the lth three-dimensional residual convolution layer The formula is:

[0050]

[0051] S56, in the recalibration layer, the final output result matrix X ST All dimensions in the matrix are weighted compressed to obtain the prediction results. The calculation formula is as follows:

[0052]

[0053] in is the learnable parameter matrix.

[0054] Preferably, the multi-directional traffic flow prediction model is pre-trained using training data, and the prediction results are continuously iterated using a loss function during the training process. The loss value between the actual result Φ and the actual result Φ is calculated. When the iteration termination condition is reached, the multi-directional traffic flow prediction model is output for actual prediction.

[0055] Preferably, the loss function Loss formula of the multi-directional traffic flow prediction model is:

[0056]

[0057] in For the matrix The values ​​of each element in is the value of each element in the matrix Φ, and M is the number of training samples.

[0058] Preferably, the value of m is 5 and the value of the time slice interval τ is 4.

[0059] Preferably, the moving state of the vehicle in the grid is determined according to the driving direction of the vehicle when the vehicle driving trajectory passes through the grid.

[0060] The prediction model proposed in this invention extracts traffic flow change information from both spatial and temporal perspectives, and adds time signals and interest point signals to improve the accuracy of prediction. Compared with traditional traffic flow prediction methods, this method has the following benefits: 1. Four new movement states are used to describe the changing trend of battery vehicle flow; 2. Time signals are incorporated to enhance the temporal characteristics of the data; 3. The interest point attention mechanism is used to adaptively capture the impact of different interest points on traffic flow changes, further enhancing the spatial geographic characteristics of the data; 4. The residual network is used to solve the gradient vanishing problem. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 It is a flowchart of a multi-directional traffic flow prediction method based on interest point spatiotemporal residual neural network;

[0062] Figure 2 This is a schematic diagram of the vehicle flow rasterization calculation method used in the present invention. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0064] On the contrary, the present invention covers any substitution, modification, equivalent method and scheme made on the essence and scope of the present invention as defined by the claims. Further, in order to make the public have a better understanding of the present invention, some specific details are described in detail in the detailed description of the present invention below. Those skilled in the art can fully understand the present invention without the description of these details.

[0065] As a preferred implementation form of the present invention, a multi-directional traffic flow prediction method based on a spatiotemporal residual neural network of interest points is provided, comprising the following steps:

[0066] S1. Acquire historical traffic flow data before a time to be predicted in the area to be predicted, wherein the historical traffic flow data includes positions of different vehicles in the area to be predicted at different times and vehicle travel directions; extract a plurality of traffic flow data time slices from the historical traffic flow data according to preset time slice intervals.

[0067] In the preferred implementation form, in S1, the area to be predicted is a rectangular area; the time span of the historical traffic flow data is [t, t+(m-1)*τ], and m traffic flow data time slices are extracted at intervals of τ minutes.

[0068] S2. The area to be predicted is rasterized to be divided into a series of grids. The vehicles in each time slice of traffic data are mapped to the corresponding grids of the area to be predicted according to their coordinates, and the vehicle driving direction is defined as the moving state of the vehicle in the grid. The moving state includes four types: upward, downward, left, and right. The total number of vehicles in each moving state contained in each grid in each time slice is counted and used as the grid value, and the grid value is mapped to the matrix element, so as to construct a two-dimensional traffic matrix for different moving states in each time slice. The two-dimensional traffic matrices of each moving state in all time slices are superimposed according to the time dimension to form a three-dimensional traffic matrix. Among them, the moving state of the vehicle in the grid can be determined according to the driving direction of the vehicle when the vehicle driving trajectory passes through the grid.

[0069] In the preferred implementation form, the specific implementation steps of S2 are as follows:

[0070] S21, the area to be predicted is rasterized and divided into I*J grids, the grid of the i-th row and j-th column is p ij ;

[0071] S22, each vehicle in each time slice of the traffic data is mapped to the corresponding grid of the area to be predicted according to its coordinates, and the vehicle driving direction is defined as the moving state of the vehicle in the grid, and the moving state includes four types: upward, downward, left, and right;

[0072] S23, count the total number of vehicles in each mobile state contained in each grid in each time slice, and calculate the number of vehicles in each grid P in time slice t. ij The vehicle flow in the moving state d is recorded as All I*J grids corresponding to Constructed as a two-dimensional matrix of vehicles with a moving state of d in the entire area to be predicted within time slice t Traffic 2D Matrix The value of the element in row i and column j is

[0073] S24, the traffic flow two-dimensional matrix of all m traffic flow data time slices Splicing by time dimension to form a three-dimensional matrix of traffic flow

[0074] S3. Extract the hour field and minute field from the time to be predicted, and concatenate them to form a binary time signal vector.

[0075] In the preferred implementation form, the specific implementation steps of S3 are as follows:

[0076] The time to be predicted t pred Convert to contain hour field t pred_hour and minute field t pred_minute The two-element time signal vector h t =[t pred_hour ,t pred_minute ].

[0077] S4. Obtain the spatial geographic locations of all points of interest, and map the points of interest of different functional categories to the grid of the area to be predicted, count the total number of points of interest of each group of functional categories in each grid and use them as grid values, map the grid values ​​to matrix elements, and thus construct a two-dimensional matrix form of interest point slices for each group of functional categories of interest points, and superimpose the interest point slices of all functional categories to form a three-dimensional tensor form of interest point signals.

[0078] In the preferred implementation form, the specific implementation steps of S4 are as follows:

[0079] S41, obtaining the spatial geographic locations of all points of interest, and mapping all points of interest to the P nodes of the area to be predicted according to their locations. ij In the grid;

[0080] S42, divide all points of interest into n groups according to different functional categories, and count the number of points of interest in each group g on the grid P ij The number of points of interest within the grid P ij The grid value of The grid values ​​of all grids corresponding to each interest point group g Construct the interest point slice Y corresponding to the interest point group g g , Υ g The size is I*J;

[0081] S43, concatenate the interest point slices corresponding to all n interest point groups, and obtain the interest point signal Ψ=[Υ1, Υ2, ..., Υ n ], whose size is n*I*J.

[0082] S5. Use the three-dimensional matrix of traffic flow, the time signal vector and the point of interest signal as inputs of a trained multi-directional traffic flow prediction model, wherein the multi-directional traffic flow prediction model comprises a first fully connected neural network, a second fully connected neural network, a three-dimensional residual convolutional network and a recalibration layer. The first fully connected neural network outputs a time signal matrix according to the time signal vector, the second fully connected neural network outputs a point of interest signal matrix according to the point of interest signal, and the three-dimensional residual convolutional network outputs a result matrix according to the fusion features of the three-dimensional matrix of traffic flow, the point of interest signal matrix and the time signal matrix. Finally, the result matrix is ​​subjected to a weighted compression operation in the recalibration layer to obtain a multi-directional traffic flow prediction result.

[0083] In the preferred implementation form, the specific implementation steps of S5 are as follows:

[0084] S51: The three-dimensional matrix of traffic flow The time signal vector h t and the point of interest signal Ψ are input into a trained multi-directional traffic flow prediction model, wherein the multi-directional traffic flow prediction model includes a first fully connected neural network, a second fully connected neural network, a three-dimensional residual convolutional network and a recalibration layer;

[0085] S52, the time signal h t is input to the ts In the first fully connected neural network of the cascade of fully connected layers, the input of the first fully connected layer is the time signal h t , the input of the next fully connected layer is the output of the previous fully connected layer, and the output of the last fully connected layer is Will The vector is mapped element by element to a matrix of size (I*J), resulting in a time signal matrix H of size (I,J) t ;

[0086] S53, the point of interest signal Ψ=[Υ1, Υ2, ..., Υ n ]After input, slice each point of interest g Get its average self-weight zg :

[0087]

[0088] The average self-weight matrix Z of the interest point signal Ψ is obtained as follows: n}, where n represents the number of interest point groups;

[0089] Then the average self-weight matrix z is input into the L ps The second fully connected neural network of the cascaded fully connected layers is calculated layer by layer, where the input of the first fully connected layer is the average self-weight matrix Z, the input of the next fully connected layer is the output of the previous fully connected layer, and the output of the last fully connected layer is

[0090] Then, the gate mechanism is used to output Mapped to a variable between 0 and 1, the calculation process is as follows:

[0091]

[0092] where f si is the activation function;

[0093] Finally, the interest point signal matrix is ​​obtained by calculation

[0094]

[0095] Among them, ⊙ represents matrix dot product;

[0096] S54, the traffic flow three-dimensional matrix Point of Interest Signal Matrix and the time signal matrix H t Perform feature fusion, The fusion features of the kth time slice of traffic data in The calculation formula is as follows:

[0097]

[0098] in, and are all trainable parameters, m is The number of time slices of traffic data in the middle;

[0099] Finally, the fused traffic matrix is ​​obtained

[0100] S55, the fused traffic matrix X Γ Input contains L cThe three-dimensional residual convolution network with three-dimensional residual convolution layers is calculated layer by layer, where the input traffic matrix X of the first three-dimensional residual convolution layer is Γ The result of each 3D residual convolution layer after the 3D residual convolution operation is used as the input of the next 3D residual convolution layer. The output of all 3D residual convolution layers in the 3D residual convolution network is concatenated to form the final result matrix X ST ; For any l-th three-dimensional residual convolution layer, the three-dimensional residual convolution operation performed is as follows:

[0101] First, perform a three-dimensional convolution operation on the input of the current three-dimensional residual convolution layer to obtain the convolution result:

[0102]

[0103] Among them, Cov3D represents the three-dimensional convolution operation, represents the output of the l-1th three-dimensional residual convolution layer, where and is the trainable parameter of the lth three-dimensional convolution layer (i.e., the aforementioned three-dimensional convolution operation Cov3D), f c is the activation function;

[0104] Then, the convolution result of the three-dimensional convolution layer output Perform batch normalization on each element in to get the batch normalization result The formula is as follows:

[0105]

[0106] Among them, E[x] represents the mean of each dimension matrix, Var[x] is the variance of each dimension matrix, ∈ is a constant set to prevent the variance from being zero, and Υ and β are learnable parameters;

[0107] Finally, the batch regularization results Then compare it with the output matrix of the previous layer Add together to get the output matrix of the lth three-dimensional residual convolution layer The formula is:

[0108]

[0109] S56, in the recalibration layer, the final output result matrix X ST All dimensions in the matrix are weighted compressed to obtain the prediction results. The calculation formula is as follows:

[0110]

[0111] in is the learnable parameter matrix.

[0112] It should be noted that in the above S5, the multi-directional traffic flow prediction model is pre-trained with training data, and the prediction results are continuously iterated through the loss function during the training process. The loss value between the actual result Φ and the actual result Φ is calculated. When the iteration termination condition is reached, the multi-directional traffic flow prediction model is output for actual prediction.

[0113] As an implementation form of the loss function Loss of a multi-directional traffic flow prediction model, its formula is:

[0114]

[0115] in For the matrix The values ​​of each element in is the value of each element in the matrix Φ, and M is the number of training samples.

[0116] The multi-directional traffic flow prediction method based on the interest point spatiotemporal residual neural network described in S1 to S5 above is applied to a specific example, and its technical effect is further demonstrated through an embodiment.

[0117] Example

[0118] The original data used in this embodiment is a real battery vehicle trajectory data set in Zhengzhou. Through preprocessing, each battery vehicle trajectory record retains the five fields of vehicle number, longitude, latitude, direction and time. So far, many data σ=<vehicle number, longitude, latitude, direction, time> are formed, and the time unit is minutes. Map each σ to the map of each time according to time. Rasterize the map according to the size of 400 meters * 400 meters per square. Count the sum of all vehicles under the same driving state in each grid, and then count the sum of points of interest under the same group in each grid, generate the traffic matrix and point of interest signal respectively, and then process the time to be predicted into a time signal. Finally, the traffic matrix, point of interest signal and time signal are input into the model for training according to the above method, and the trained model is used to predict the results. As shown in Figure 1, the multi-directional traffic flow prediction method based on the spatiotemporal residual neural network of points of interest in this embodiment specifically includes the following steps:

[0119] Step 1) Define the area to be predicted: define the area to be predicted as a rectangular area with a side length of I*J;

[0120] Step 2) Define the moving state of the vehicle flow: distinguish the states of all moving vehicles in the prediction area, and the moving state of each vehicle is represented as d, which includes four moving states: upward, downward, leftward, and rightward. That is, the moving state d takes four states: Leftward, Rightward, Upward, and Downward;

[0121] Step 3) Rasterize the traffic flow: Place the origin of the coordinate system of the area to be predicted in the two-dimensional coordinate system, and divide the area to be predicted according to the I*J grid. The grid numbers in the x-axis and y-axis directions are i and j respectively, and the grid is recorded as P ij ;

[0122] Step 4) Assign a traffic flow value to each grid and calculate the two-dimensional matrix of regional traffic flow: divide the time range into multiple time slices of length ξ, distinguish and sum the movement states of all vehicles contained in each grid within the time slice t, that is, each grid P within the time slice t ij The vehicle flow in the moving state d is recorded as The two-dimensional matrix of vehicle flow with moving state d in the area to be predicted within time slice t is recorded as The size is (I*J);

[0123] Step 5) Obtain the three-dimensional matrix of regional traffic flow: Perform steps 2 to 6 m times at intervals of τ minutes for the traffic flow data m*τ minutes before the prediction time, and obtain m I*J time slices, which are recorded as the three-dimensional matrix of traffic flow The size is (m*I*J), such as Figure 2 As shown;

[0124] Step 6) Obtain the time signal: Set the predicted time t pred Transformed into a time signal with two elements, represented by h t =[t pred_hour ,t pred_minute ];

[0125] Step 7) Obtaining the interest point signal, specifically including the following sub-steps:

[0126] Step 71) Obtain the spatial geographic locations of all points of interest, map the points of interest onto a plane, and then divide the plane into grids as in step 3, and record the grids as P ij ;

[0127] Step 72) Divide the points of interest into n groups according to their functionality, group the points of interest into g groups, and calculate the grid P ij The number of points of interest within and the grid value obtained After performing the sum operation on each grid in turn, the interest point slice Y of the g-th group of interest points is obtained. g , whose size is I*J;

[0128] Step 73) Iterate step 72) for each group in the interest point group to obtain n I*J interest point slices, which are recorded as interest point signal Ψ = [Υ1, Υ2, ..., Υ n ], whose size is (n*I*J);

[0129] Step 8) Training a multi-directional traffic flow prediction model, specifically including the following sub-steps:

[0130] Step 81) obtaining a time signal matrix, comprising the following sub-steps:

[0131] Step 811) First, the time signal h t Iterate the input to include L ts The first fully connected neural network with 1 fully connected layer, where the input of the next fully connected layer is the output of the previous fully connected layer. The formula for calculating the network layer by layer is as follows:

[0132]

[0133] Where L ts is the number of fully connected layers in the first fully connected neural network, and Represent the outputs of the l-1th layer and the lth layer respectively, and are two learnable parameters of layer l, f ts Represents the activation function, the first layer input of the fully connected layer is the time signal h t , the output of the last fully connected layer is

[0134] Step 812) The vector is mapped element by element to a matrix of size (I*J) to obtain the time signal matrix H t , whose size is (I*J); this element-by-element mapping process is actually equivalent to The elements of The first J elements of are used as the first row of the matrix, the first J+1 to 2J elements are used as the second row of the matrix, and so on, thus forming a time signal matrix H of size I*J t .

[0135] Step 82) Obtaining the interest point signal matrix, including the following sub-steps:

[0136] Step 821) Input point of interest signal Ψ=[Υ1, Υ2, ..., Υ n ], for each interest point slice Y g , get its average self-weight z g:

[0137]

[0138] Perform the above operation on all interest point slices to obtain the average self-weight matrix Z = {z1,z2,…,z n}, where n represents the number of interest point groups;

[0139] Step 822) Input the average self-weight matrix Z into the L ps The second fully connected neural network has a fully connected layer, where the input of the next fully connected layer is the output of the previous fully connected layer. The formula for calculating the network layer by layer is:

[0140]

[0141] Where L ps is the number of fully connected layers in the second fully connected neural network, and Represent the outputs of the l-1th layer and the lth layer respectively, and are two learnable parameters of layer l, f ps Represents the activation function, the input of the first fully connected layer is the average self-weight matrix Z, and the output of the last fully connected layer is

[0142] Step 823) uses a gate mechanism to connect the output of the second fully connected neural network in step 822) Mapped to a variable between 0 and 1, the calculation process is as follows:

[0143]

[0144] where f si is the activation function;

[0145] Step 824) Obtain the interest point signal matrix The process is:

[0146]

[0147] Among them, ⊙ represents matrix dot product, Υ g An interest point slice representing the g-th group of interest points;

[0148] Step 83) Transform the traffic flow three-dimensional matrix Point of Interest Signal Matrix and the time signal matrix H t Perform feature fusion to The fusion process of each time slice in The fusion features of the kth time slice of traffic data in The calculation formula is as follows:

[0149]

[0150] in, and are all trainable parameters, m is The number of time slices in the

[0151] Finally, the fused traffic matrix is ​​obtained

[0152] Step 84) The fused traffic matrix X Γ Enter the L c The final result matrix X is obtained by using a three-dimensional residual convolution network with three-dimensional residual convolution layers. ST , the specific process is as follows:

[0153] Step 841) X Γ Input the lth 3D residual convolution layer to perform 3D convolution operation, and the calculation formula of the convolution result is as follows:

[0154] (l needs to be initialized to 1)

[0155] Among them, Cov3D represents the three-dimensional convolution operation, represents the output of the l-1th 3D residual convolution layer, and is the trainable parameter of the lth layer, f c is the activation function Sigmoid.

[0156] Step 842) then Each element in is batch normalized, and the formula is as follows:

[0157]

[0158] Among them, E[x] represents the mean of each dimension matrix, Var[x] is the variance of each dimension matrix, ∈ is a constant set to prevent the variance from being zero, and Υ and β are learnable parameters;

[0159] Step 843) Finally, the result after the batch regularization function is The output result of the previous layer Add together to get the output matrix of the three-dimensional residual convolution layer The formula is:

[0160]

[0161] in and Respectively represent the output matrices obtained after the outputs of the l-th three-dimensional residual convolution layer and the l-1-th three-dimensional residual convolution layer are operated in step 842) and step 843);

[0162] Step 844) For the remaining L c -1 three-dimensional residual convolution layer, continuously executing L c -1 times step 841) to step 843), where the input of the next three-dimensional residual convolution layer is the output of the previous three-dimensional residual convolution layer, and finally after completing the feature extraction of all three-dimensional residual convolution layers, L c The output matrix of the 3D residual convolution layer The final output matrix is ​​recorded as X ST ;

[0163] Step 85) For the result matrix X ST Perform weighted compression operation to obtain prediction results The calculation formula is as follows:

[0164]

[0165] in is a learnable parameter matrix;

[0166] Step 86) Continuously iterate the prediction results through the loss function The loss value between the actual result Φ and the actual result Φ. When the iteration termination condition is reached, the multi-directional traffic flow prediction model is output.

[0167] The loss function Loss formula of the model in this embodiment is:

[0168]

[0169] in For the matrix The values ​​of each element in is the value of each element in the matrix Φ, and M is the total number of training samples.

[0170] In this embodiment, Adam is used as the optimizer, and the multi-directional traffic flow prediction model The iteration termination condition can be set to 10 iterations or the loss function value is less than 0.1%.

[0171] Step 9) Prediction results: In the inference stage, the operations are consistent with steps 5), 6) and 7), and the traffic flow matrix, time signal vector and point of interest signal matrix m*τ minutes before the predicted time are obtained respectively, and input into the multi-directional traffic flow prediction model Then we get the traffic flow prediction result matrix

[0172] In this embodiment, the duration ξ is 1 minute. m is 5, and the interval τ of the time slice is 4 minutes. In the first fully connected network, the number of fully connected layers L ts Take 2, activation function f ts Take ReLU. In the second fully connected network, the number of fully connected layers is L ps Take 2, activation function f ps Take ReLU. In the three-dimensional residual convolution network, the number of three-dimensional residual convolution layers is L c Take 32, activation function f c Take ReLU.

[0173] In addition, POIs are geographical entities that realize urban functions and reflect the impact of different departure and destination locations on changes in traffic volume. For example, restaurant POIs affect traffic volume in surrounding areas during lunch and dinner time, while tourist attraction POIs mainly affect traffic volume on weekends and holidays. In this embodiment, the number of POI groupings n is 9, and the specific category form is shown in Table 1.

[0174] Table 1. Details of interest points and their categories.

[0175]

[0176] In order to facilitate the comparison of the effects of the present invention, the method of the present invention (MDSTN for short) is compared with several traditional prediction methods in this embodiment. The prediction methods used as controls are: (1) HA: using the average value of the historical data with the most recent corresponding time as the prediction value; (2) ARIMA: differential integrated moving average autoregressive model, also known as integrated moving average autoregressive model; (3) LSTM: long short memory neural network, a variant of recurrent neural network. (4) GRU: gated recurrent unit, a variant of recurrent neural network. (5) ConvLSTM: convolutional long short-term memory neural network, an enhanced LSTM that can capture spatiotemporal correlation. (6) ST-ResNet: a deep neural network model that integrates convolution operations and residual units. (7) ST-3DNets: an improved deep neural network model that uses three-dimensional convolution and residual units to explore spatiotemporal correlation. This embodiment uses mean square error (MSE) and mean percentage error (MAPE) as prediction accuracy indicators, which are specifically defined as follows:

[0177]

[0178]

[0179] in is the true value, is the predicted value, ij represents the area, t represents the time, and m is the number of samples.

[0180] Table 1 Comparison of prediction results

[0181]

[0182] The experimental results are shown in the table. The results show that the prediction accuracy (MSE, MAPE) of the method proposed in the present invention is significantly better than that of traditional mathematical methods and machine learning related methods, which proves the effectiveness of the method of the present invention.

[0183] The above-described embodiment is only a preferred solution of the present invention, but it is not intended to limit the present invention. A person skilled in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.

Claims

1. A multi-directional traffic flow prediction method based on interest point spatiotemporal residual neural network, characterized in that: The following steps are involved: S1. Acquire historical traffic flow data before a time to be predicted in the area to be predicted, wherein the historical traffic flow data includes positions of different vehicles in the area to be predicted at different times and vehicle driving directions; extract a plurality of traffic flow data time slices from the historical traffic flow data according to a preset time slice interval; S2. The area to be predicted is rasterized to be divided into a series of grids. The vehicles in each time slice of traffic data are mapped to the corresponding grids of the area to be predicted according to their coordinates, and the vehicle driving direction is defined as the moving state of the vehicle in the grid. The moving states include upward, downward, left, and right. The total number of vehicles in each moving state contained in each grid in each time slice is counted and used as the grid value, and the grid value is mapped to a matrix element, so as to construct a two-dimensional traffic matrix for different moving states in each time slice, and the two-dimensional traffic matrices of each moving state in all time slices are superimposed according to the time dimension to form a three-dimensional traffic matrix. S3, extracting the hour field and the minute field from the time to be predicted, and concatenating them to form a binary time signal vector; S4, obtaining the spatial geographic locations of all points of interest, and mapping the points of interest of different functional categories to the grid of the area to be predicted, counting the total number of points of interest of each group of functional categories in each grid and using them as grid values, mapping the grid values ​​to matrix elements, thereby constructing a two-dimensional matrix-formed point of interest slice for each group of functional categories of points of interest, and superimposing the point of interest slices of all functional categories to form a three-dimensional tensor-formed point of interest signal; S5, taking the three-dimensional matrix of traffic flow, the time signal vector and the point of interest signal as the input of a trained multi-directional traffic flow prediction model, wherein the multi-directional traffic flow prediction model comprises a first fully connected neural network, a second fully connected neural network, a three-dimensional residual convolution network and a recalibration layer, wherein the first fully connected neural network outputs a time signal matrix according to the time signal vector, the second fully connected neural network outputs a point of interest signal matrix according to the point of interest signal, and the three-dimensional residual convolution network outputs a result matrix according to the fusion features of the three-dimensional matrix of traffic flow, the point of interest signal matrix and the time signal matrix, and finally obtaining a multi-directional traffic flow prediction result after the result matrix is ​​subjected to a weighted compression operation in the recalibration layer; The specific implementation steps of S2 are as follows: S21, the area to be predicted is rasterized and divided into I*J grids, the grid of the i-th row and j-th column is P ij ; S22, each vehicle in each time slice of the traffic flow data is mapped to the corresponding grid of the area to be predicted according to its coordinates, and the vehicle driving direction is defined as the moving state of the vehicle in the grid, and the moving state includes four types: upward, downward, left, and right; S23, count the total number of vehicles in each mobile state contained in each grid in each time slice, and calculate the number of vehicles in each grid P in time slice t. ij The vehicle flow in the moving state d is recorded as All I*J grids corresponding to Constructed as a two-dimensional matrix of vehicles with a moving state of d in the entire area to be predicted within time slice t Traffic 2D Matrix The value of the element in row i and column j is S24, the traffic flow two-dimensional matrix of all m traffic flow data time slices Splicing by time dimension to form a three-dimensional matrix of traffic flow The specific implementation steps of S3 are as follows: The time to be predicted t pred Convert to contain hour field t pred_hour and minute field t pred_minute The two-element time signal vector h t =[t pred_hour ,t pred_minute ]; The specific implementation steps of S4 are as follows: S41, obtaining the spatial geographic locations of all points of interest, and mapping all points of interest to the P nodes of the area to be predicted according to their locations. ij In the grid; S42, divide all points of interest into n groups according to different functional categories, and count the number of points of interest in each group g on the grid P ij The number of points of interest within the grid P ij The grid value of The grid values ​​of all grids corresponding to each interest point group g Construct the interest point slice γ corresponding to the interest point group g g , γ g The size is I*J; S43, concatenate the interest point slices corresponding to all n interest point groups, and obtain the interest point signal Ψ=[γ1,γ2,…,γ n ], whose size is n*I*J; The specific implementation steps of S5 are as follows: S51: The three-dimensional matrix of traffic flow The time signal vector h t and the interest point signal ψ are input into a trained multi-directional traffic flow prediction model, wherein the multi-directional traffic flow prediction model comprises a first fully connected neural network, a second fully connected neural network, a three-dimensional residual convolutional network and a recalibration layer; S52, the time signal h t is input to the ts In the first fully connected neural network of the cascade of fully connected layers, the input of the first fully connected layer is the time signal h t , the input of the next fully connected layer is the output of the previous fully connected layer, and the output of the last fully connected layer is Will The vector is mapped element by element to a matrix of size (I*J), resulting in a time signal matrix H of size (I,J) t ; S53, the interest point signal Ψ=[γ1,γ2,…,γ n ]After input, first slice each interest point γ g Get its average self-weight z g : The average self-weight matrix Z of the interest point signal Ψ is obtained as follows: n }, where n represents the number of interest point groups; Then the average self-weight matrix Z is input into the L ps The second fully connected neural network of the cascaded fully connected layers is calculated layer by layer, where the input of the first fully connected layer is the average self-weight matrix Z, the input of the next fully connected layer is the output of the previous fully connected layer, and the output of the last fully connected layer is Then, the gate mechanism is used to output Mapped to a variable between 0 and 1, the calculation process is as follows: where f si is the activation function; Finally, the interest point signal matrix is ​​obtained by calculation Among them, ⊙ represents matrix dot product; S54, the traffic three-dimensional matrix L, the interest point signal matrix and the time signal matrix H t Perform feature fusion, The fusion features of the kth time slice of traffic data in The calculation formula is as follows: in, and are all trainable parameters, m is The number of time slices of traffic data in the middle; Finally, the fused traffic matrix is ​​obtained S55, the fused traffic matrix X Γ Input contains L c The three-dimensional residual convolution network with three-dimensional residual convolution layers is calculated layer by layer, where the input traffic matrix X of the first three-dimensional residual convolution layer is Γ The result of each 3D residual convolution layer after the 3D residual convolution operation is used as the input of the next 3D residual convolution layer. The output of all 3D residual convolution layers in the 3D residual convolution network is concatenated to form the final result matrix X ST ; For any l-th three-dimensional residual convolution layer, the three-dimensional residual convolution operation performed is as follows: First, perform a three-dimensional convolution operation on the input of the current three-dimensional residual convolution layer to obtain the convolution result: Among them, Cov3D represents the three-dimensional convolution operation, represents the output of the l-1th three-dimensional residual convolution layer, where and is the trainable parameter in the l-th layer 3D convolution operation, f c is the activation function; Then, the convolution result of the three-dimensional convolution operation output is Perform batch normalization on each element in to get the batch normalization result Finally, the batch regularization results Then compare it with the output matrix of the previous layer Add together to get the output matrix of the lth three-dimensional residual convolution layer The formula is: S56, in the recalibration layer, the final output result matrix X ST All dimensions in the matrix are weighted compressed to obtain the prediction results. The calculation formula is as follows: in is the learnable parameter matrix.

2. The multi-directional traffic flow prediction method based on interest point spatiotemporal residual neural network as claimed in claim 1, characterized in that: In S1, the area to be predicted is a rectangular area; the time span of the historical traffic flow data is [t, t+(m-1)*τ], and m traffic flow data time slices are extracted at intervals of τ minutes.

3. The multi-directional traffic flow prediction method based on interest point spatiotemporal residual neural network as claimed in claim 1, characterized in that: The multi-directional traffic flow prediction model is pre-trained using training data, and the prediction results are continuously iterated using a loss function during the training process. The loss value between the actual result Φ and the actual result Φ is calculated. When the iteration termination condition is reached, the multi-directional traffic flow prediction model is output for actual prediction.

4. The multi-directional traffic flow prediction method based on interest point spatiotemporal residual neural network as claimed in claim 1, characterized in that: The loss function Loss formula of the multi-directional traffic flow prediction model is: in For the matrix The values ​​of each element in is the value of each element in the matrix Φ, and M is the number of training samples.

5. The multi-directional traffic flow prediction method based on interest point spatiotemporal residual neural network as claimed in claim 2, characterized in that: The value of m is 5, and the value of the time slice interval τ is 4.

6. The multi-directional traffic flow prediction method based on interest point spatiotemporal residual neural network as claimed in claim 1, characterized in that: The moving state of the vehicle in the grid is determined according to the driving direction of the vehicle when the vehicle driving track passes through the grid.