Traffic flow prediction system and method based on circulation independent mechanism
By introducing G-tRIM into the traffic flow prediction model, combining the cycle independent mechanism and graph attention network, the shortcomings of the existing models in capturing the space-time dependence relationship of traffic flow are solved, and more accurate and robust traffic flow prediction is achieved.
Patent Information
- Application Number
- CN202411855534.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-03-28
AI Technical Summary
The existing traffic flow prediction model has insufficient in capturing the spatiotemporal dependence of traffic flow, resulting in inaccurate predictions.
A traffic flow prediction system based on Graph Temporal Recurrent Independent Mechanisms (G-tRIM) is proposed. This system can more efficiently capture the time and space dependencies of traffic flow data through the fusion cycle independent mechanism (RIM) and graph attention network (GAT+LSTM).
The model can more accurately capture the complex timing characteristics and spatial dependencies of traffic flow, reduce prediction errors, improve the robustness and generalization capabilities of the model, and significantly improve the real-time decision-making capabilities of the traffic management system.
Smart Images

Figure CN119723876A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic big data, and in particular to a traffic flow prediction system and method based on a cyclic independence mechanism. Background Art
[0002] Traffic congestion is a problem faced by many cities. Accurate traffic flow prediction can effectively alleviate traffic congestion, thereby shortening people's commuting time and reducing environmental pollution. Traffic flow prediction belongs to the category of spatiotemporal data prediction. Whether it can effectively capture and utilize its spatiotemporal dependencies is the key to making accurate predictions, and it is also the difficulty of research.
[0003] The complexity of traffic flow prediction is reflected in the following aspects: (1) In terms of time dependence, the change of traffic flow is affected by the potential state. Different potential states determine the rise and fall of traffic flow, as well as the speed of rise or fall. The potential state of traffic flow changes with time. On the one hand, the traffic flow data as a whole shows a daily periodic law, and the data waveform is relatively similar every day, which reflects the regularity of the potential state of traffic flow; on the other hand, the traffic flow data changes almost at any time, and the change trend is dynamically affected by the traffic conditions and the traffic flow in the previous time period, which reflects the time-varying nature of the potential state of traffic flow. (2) In terms of spatial dependence, the traffic flow of each traffic node will be affected by the nearby traffic network, and the influence is also dynamically changing. For example, the traffic flow at the upstream location will affect the traffic flow at the downstream location; and each intersection will be affected from multiple different directions. In addition, the traffic flow is affected differently by different directions. Therefore, the spatial dependence of traffic flow is complex and diverse.
[0004] The development of traffic flow prediction models based on deep learning has evolved from traditional statistical methods and machine learning methods to convolutional neural networks (CNNs) and graph convolutional networks (GCNs). Although these methods have made progress in processing the spatiotemporal dependencies of traffic flow data, they still face challenges, such as the limited ability of CNN to process non-grid data and the lack of flexibility of GCN in allocating weights of neighboring nodes. In order to more accurately capture the spatiotemporal dependencies of traffic flow, this patent proposes a new model - Graph Temopral Recurrent Independent Mechanisms (G-tRIM). By integrating RIM (recurrent independent mechanism) and graph attention network, this model can more efficiently capture the temporal and spatial dependencies of traffic flow data, thereby making more accurate predictions. Summary of the invention
[0005] In view of the deficiencies of the prior art, the present invention provides a traffic flow prediction system and method based on a cyclic independence mechanism, which solves the problem of inaccurate prediction of complex traffic data.
[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions: a traffic flow prediction system based on a cyclic independence mechanism, comprising:
[0007] Data collection module, including real-time or historical traffic data collected by various traffic flow sensors, cameras, etc.;
[0008] The data preprocessing module is used to process missing values and abnormal values of the data collected in the data collection module to ensure the integrity and consistency of the data;
[0009] The traffic control module adjusts the actual traffic situation by predicting the flow of the next node. The traffic control module includes:
[0010] The prediction module uses the G-tRIM model to accurately predict traffic flow. The data will go through the input stage, conversion stage, and interaction stage;
[0011] The control module predicts the changes in traffic flow during peak and trough periods and the changes predicted by the prediction module, and formulates countermeasures in advance to reduce traffic congestion;
[0012] The public transportation dispatching module predicts the passenger flow in different time periods and areas, rationally arranges bus routes and vehicles, and reduces empty or overloaded situations.
[0013] Preferably, the prediction module includes two modules for respectively capturing the time dependency and the space dependency of the traffic flow data.
[0014] Preferably, in the temporal dependency modeling, tRIM uses the flow data and time step data of the central node to model the potential state of the central node, aggregates the information of neighboring nodes through GAT, and then inputs the aggregated results into LSTM to capture the spatial dependency of traffic flow data, and the temporal dependency of G-tRIM is captured by tRIM.
[0015] Preferably, the tRIM is a recurrent neural network composed of a plurality of sub-networks, each of which is an LSTM of the same size.
[0016] Preferably, at time n of the mth node, the input corresponding to the kth subnetwork is:
[0017]
[0018] h n,k is the hidden state of the kth sub-network at time n; de is the length of the vector used to generate the query; t n is the time information at moment n; Generate parameters for the query of the kth sub-network; W ke , W va , W ti The Key and Value parameters are generated based on the input.
[0019] Preferably, in the conversion stage, the activated sub-network uses the real flow value as the input of the current time step, and the remaining sub-networks use the 0 vector as the input of the current time step. Each sub-network is converted using the formula:
[0020]
[0021] S t Refers to the set of sub-networks activated at time step t; is the hidden state of the kth sub-network after receiving the input of time step t and completing the dynamic transformation; D k For dynamic conversion, are the parameters of the kth sub-network LSTM.
[0022] Preferably, in the interaction phase, each sub-network interacts sparsely with each other. The activated sub-network aggregates the information of all sub-networks using the attention mechanism to update its own hidden state. In addition to using valid input to update its own hidden state, the activated sub-network will also use the information of other sub-networks to update its hidden state again in the interaction phase:
[0023]
[0024] h t+1,k is the hidden state obtained by the k-th sub-network after sparse information interaction, is the sparse information interaction query parameter of the kth sub-network, and To generate the parameters of K and V, is K in formula (4) t,k As a result of the concatenation, in this process, the input received by each sub-network is different, so different function representations can be trained.
[0025] Preferably, GAT can be used to dynamically calculate the attention coefficient between the central node and its neighbors, and dynamically assign the weights of the neighbors. First, the data X of r neighbors is n ∈R r×τ Use GAT to aggregate into X n' ∈R τ , and then use LSTM to train X n'Processing is performed to obtain the spatial dependency relationship between the hidden state representation and the data. The expression for aggregating neighbor data using GAT is:
[0026]
[0027] Formula (7) is the process of generating Q (Query) based on the traffic flow data of the central node, and Formula (8) is the process of generating a single K based on the traffic flow data of a neighboring node. i (Key) process, Formula (9) is the process of GAT aggregating the traffic flow data of all neighbors of the central node, W q , W ke is a trainable parameter. Formula (10) shows the method of using the information of neighboring nodes to capture the spatial dependencies of the central node. is the traffic flow data sequence of the given central node; For X n A part of a row in is the data sequence of a specific neighbor.
[0028] Preferably, the potential state of traffic flow obtained by tRIM is connected in series with the hidden state of spatial dependency, and the predicted value of G-tRIM is obtained through a fully connected layer. The final expression is:
[0029]
[0030] The loss function of this model is:
[0031]
[0032] A traffic flow prediction method based on a cyclic independence mechanism, characterized by comprising the following steps:
[0033] S1. Data collection and preprocessing, collecting local traffic data, including traffic flow data;
[0034] S2.G-tRIM model construction, including tRIM module and GAT+LSTM module:
[0035] S3. Subnetwork settings: select and activate several subnetworks.
[0036] S4. Input stage: At each time step, the traffic flow data and the corresponding time information are projected to the specified space through the MLP layer and then connected in series to enter the attention layer, where they are matched with the hidden states of each sub-network and the most relevant sub-networks are selected for activation;
[0037] S5. In the conversion phase, the activated sub-network uses the real flow value as the input of the current time step, and the remaining sub-networks use the vector as the input of the current time step;
[0038] S6. In the interaction stage, the activated sub-network further optimizes the prediction effect of the model through the interaction mechanism.
[0039] The present invention provides a traffic flow prediction system and method based on a cyclic independence mechanism, which has the following beneficial effects:
[0040] 1. The traffic flow prediction model based on the cyclic independence mechanism of the present invention can better capture the complex time series characteristics of traffic flow, including periodicity and long-term dependence. By independently modeling different time periods or patterns, the model can reduce prediction errors, especially when traffic flow is affected by special events during certain periods. The cyclic independence mechanism can capture these changes more accurately.
[0041] 2. The model based on the cyclic independence mechanism of the present invention can enhance its robustness in processing irregular data by independently modeling periodic and non-periodic features. In addition, the independence mechanism can also reduce the overfitting problem of the model during the training process, making it more generalizable when facing new and unknown traffic conditions.
[0042] 3. The present invention can significantly improve the real-time decision-making ability of the traffic management system through accurate traffic flow prediction. By predicting traffic flow in real time, the traffic management department can formulate more effective traffic policies, such as signal light control, traffic congestion warning, etc. In the intelligent transportation system, the application of this model can optimize route planning, reduce congestion, and improve road use efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a schematic diagram of the G-tRIM model of the present invention;
[0044] Figure 2 It is a schematic diagram of the tRIM model of the present invention;
[0045] Figure 3 It is a schematic diagram of experimental data of the present invention;
[0046] Figure 4 It is a schematic diagram of the system of the present invention;
[0047] Figure 5 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the specification of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] Example:
[0050] See also Figure 4 The embodiment of the present invention provides a traffic flow prediction system based on a cyclic independent mechanism, including a data collection module, which includes real-time or historical traffic data collected by various traffic flow sensors, cameras, etc., and integrates external data sources such as weather, maps, events, etc. to provide more comprehensive input information for the model. The data collection module is electrically connected to a data preprocessing module, and the data preprocessing module is used to process missing values and abnormal values of the data collected in the data collection module to ensure the integrity and consistency of the data, and normalize or standardize the data to improve the efficiency and stability of model training, and extract features that are beneficial to traffic flow prediction, such as time features (hours, weeks, etc.). The data preprocessing module is electrically connected to a traffic control module, which includes a prediction module, a control module, and a public transportation scheduling module. The prediction module accurately predicts traffic flow, dynamically adjusts the cycle of traffic lights according to the prediction results, and optimizes the traffic smoothness and vehicle traffic efficiency at the intersection. The control module predicts the changes in traffic flow during peak and trough periods and the changes predicted by the prediction module, and formulates response measures in advance to reduce traffic congestion and improve the traffic capacity of the road; the public transportation scheduling module reasonably arranges bus routes and vehicles to reduce empty or overloaded situations by predicting passenger flow in different time periods and regions.
[0051] The traffic flow prediction of the prediction module focuses on capturing the temporal and spatial dependencies of traffic flow data. Two modules are used to respectively capture the temporal dependencies and spatial dependencies of traffic flow data, and the results of the two modules are integrated to make the final prediction.
[0052] In one embodiment:
[0053] Given a city traffic graph G = (V, E), where V = {v 1 ,v 2 ,...,v N} are all the nodes in the traffic graph, E is the edge between the nodes. Depending on the data set, the node can be a traffic intersection or a block area divided by longitude and latitude. The edge can be directed or undirected, depending on the acquired data set.
[0054] Given a traffic matrix X = (X 1 ,X 2 ,...,X N ) T ∈R N×P , X is the traffic flow sequence of N nodes in P time periods, where and Xi is the total traffic sequence of a node, X t is the traffic of all nodes at a certain moment.
[0055] Problem Definition
[0056] According to the given urban traffic graph G, the traffic flow tensor in the first τ period is {X t |t=1,2,...,τ}, the corresponding time series {t i |i∈{1,2,...,τ}}, predict the urban traffic flow in the next time period
[0057] The two modules respectively include time dependency modeling:
[0058] Based on the above ideas, Figure 1 As shown in the figure, the G-tRIM model mainly consists of two parts: tRIM and GAT+LSTM. Figure 1 In the first half, tRIM uses the flow data and time step data of the central node to model the potential state of the central node and capture the temporal dependency of the traffic flow data; Figure 1 The lower part aggregates the information of neighbor nodes through GAT, and then inputs the aggregated results into LSTM to capture the spatial dependency of traffic flow data. In the application of traffic flow prediction, the "daily periodicity" of traffic flow data is not utilized, and the potential state of traffic flow is not accurately captured. The temporal dependency of G-tRIM is captured by tRIM. Figure 2 The figure shows the process of one tRIMcell processing one time step input. Each time step uses one tRIMcell. tRIM is a recurrent neural network composed of several (four as shown in Figure (2)) sub-networks, each of which is an LSTM of the same size. In each time step, the data goes through the input stage, the conversion stage, and the interaction stage. In the input stage, the traffic flow and the corresponding time of the time step are projected to the specified space through the MLP (Multilayer Perceptron) layer and then connected in series to enter the attention layer, where they are matched with the hidden states of each sub-network, and the most relevant f sub-networks are selected for activation. Figure 2 The dashed box in the middle shows the process of calculating the two sub-networks most relevant to the input data at a single time step input stage, and uses gray boxes to represent the activated sub-networks. At the nth moment of the mth node, the input corresponding to the kth sub-network is:
[0059]
[0060] In formula (1): h n,k is the hidden state of the kth sub-network at time n; de is the length of the vector used to generate the query; t n is the time information at moment n; Generate parameters for the query of the kth sub-network; W ke , W va , W ti are the Key and Value parameters generated according to the input. In the conversion stage, the activated sub-network uses the real flow value as the input of the current time step, and the remaining sub-networks use the 0 vector as the input of the current time step. Each sub-network is converted using formula (2):
[0061]
[0062] In formula (2): S t Refers to the set of sub-networks activated at time step t; is the hidden state of the kth sub-network after receiving the input of time step t and completing the dynamic transformation; D k As a dynamic conversion method, the present invention selects LSTM; is the parameter of the kth sub-network LSTM. After receiving and processing the input, each sub-network updates its own hidden state. In the interaction phase, each sub-network interacts sparsely. The activated sub-network uses the attention mechanism to aggregate the information of all sub-networks to update its own hidden state. The transformation process and the interaction process are as follows: Figure 2 As shown outside the dotted box, the activated sub-network can not only update its own hidden state using valid input, but also update its hidden state again using the information of other sub-networks during the interaction phase.
[0063]
[0064] In formula (3), h t+1,k is the hidden state obtained by the kth sub-network after sparse information interaction. In formula (3), is the sparse information interaction query parameter of the kth sub-network. In formula (4) and formula (5), and To generate the parameters of K and V, in formula (6) is K in formula (4) t,k The result of concatenation. It can be seen that at time step t, only the activated sub-network can obtain the information of all sub-networks. At this point, the input processing of one time step is completed. In the last time step, tRIM obtains the potential state of traffic flow. In this process, the input received by each sub-network is different, so different function representations can be trained.
[0065] Modeling spatial dependencies:
[0066] Many models use CNN to model the spatial relationship of data. However, CNN is only applicable to Euclidean structured data and is not applicable to unstructured data. GCN uses the Laplacian matrix of the graph to perform convolution operations on the data on the graph, solving the problem that CNN cannot operate on unstructured data, but does not assign different weights to different neighbors. GAT calculates the attention coefficient between nodes and assigns different weights to different neighbors. In reality, at the same time, different central nodes are affected differently by neighboring nodes; at the same central node, the influence of neighboring nodes at different times is also different. Therefore, GAT can be used to dynamically calculate the attention coefficient between the central node and its neighbors, and dynamically assign the weights of neighbors. First, the data of r neighbors X are combined into a grid. n ∈R r×τ Use GAT to aggregate into X n' ∈R τ , and then use LSTM to train X n' Processing is performed to obtain the spatial dependency relationship between the hidden state representation and the data. The expression for aggregating neighbor data using GAT is:
[0067]
[0068] Formula (7) is the process of generating Q (Query) based on the traffic flow data of the central node, and Formula (8) is the process of generating a single K based on the traffic flow data of a neighboring node. i (Key) process, Formula (9) is the process of GAT aggregating the traffic flow data of all neighbors of the central node, W q , W ke is a trainable parameter. Formula (10) shows the method of using the information of neighboring nodes to capture the spatial dependencies of the central node. is the traffic flow data sequence of the given central node; For X n A part of a row in is the data sequence of a specific neighbor.
[0069] The potential state of traffic flow obtained by tRIM is connected in series with the hidden state of spatial dependency, and the predicted value of G-tRIM is obtained through the fully connected layer. The final expression is:
[0070]
[0071] Therefore, the loss function of this model is:
[0072]
[0073] The following is the model verification process. The G-tRIM model proposed in this invention is put into two real-world data sets for experimentation and compared with other benchmark methods to verify the performance of the model. The following are the two data sets:
[0074] Dataset 1: Guizhou Dataset. This dataset is a road map of a certain area in Guizhou. It also gives the traffic flow between each intersection for 8 consecutive days from 6 am to 8 pm. The traffic data is counted every 30 seconds. All data from all roads are used. Since there are too many zeros in the initial data, the data is aggregated into 10-minute statistics to reduce the sparsity of the data. The data from the first 5 days are selected as the training set, and the data from the last 3 days are selected as the test set.
[0075] Dataset 2: Beijing Dataset. This dataset divides Beijing into 1024 grids of 32×32 equally according to longitude and latitude, and counts the inflow and outflow of each grid once every 30 minutes. The recording time is from November 1, 2023 to April 10, 2024. The outflow data of the 256 grids of 16×16 in the center are selected for the experiment. The data of November and December 2023 and January 2024 are selected as the training set, and the data of February, March and April 2024 are selected as the test set. Because the data of the above two datasets have the characteristics of large differences in the flow values of similar traffic nodes, the flow is reduced to 1 / 50 of the original to reduce the difference between traffic nodes.
[0076] Comparative test:
[0077] The model of the comparative experiment is:
[0078] (1) Autoregressive Integrated Moving Average model (ARIMA): ARIMA is a classic parametric model that is suitable for linear data but is not very effective when dealing with nonlinear and highly complex data such as traffic flow.
[0079] Long Short-Term Memory (LSTM), LSTM is a recurrent neural network that uses a gating mechanism. The prediction effect of LSTM is better than ARIMA.
[0080] Recurrent Independent Mechanisms (RIM), RIM consists of multiple sub-networks, each of which has trained different modular functions and can more effectively extract effective information from the input data. Therefore, the prediction effect of RIM is better than that of LSTM.
[0081] (4) Spatio-Temporal Graph Convolutional Networks (STGCN): STGCN uses two consecutive spatio-temporal convolution blocks to capture the spatio-temporal dependencies of traffic flow. Each spatio-temporal convolution block contains one-dimensional time domain convolution and two-dimensional spatial domain convolution.
[0082] (5) Attention-Based Spatial-Temporal Graph Convolutional Networks (ASTGCN). ASTGCN uses three consistent structures to extract features from three levels of data. Each structure consists of a residual connection of a spatiotemporal convolutional block containing a spatiotemporal attention extraction module and a spatiotemporal convolution module.
[0083] Both STGCN and ASTGCN consider the spatial impact of traffic flow, but there are still the following two problems: (1) They ignore the fact that the potential state of traffic flow will change over time. They only input the traffic sequence without giving the corresponding time, which makes the model less accurate in judging the corresponding potential state; (2) they do not consider the dynamic changing characteristics of the spatial impact of traffic flow.
[0084] In response to the above two problems, this patent proposes the G-tRIM (Graph Temopral Recurrent Independent Mechanisms) model. When capturing the temporal dependency of traffic flow, G-tRIM inputs the traffic data of each time slice and the corresponding time data into tRIM, so that it can more accurately calculate the correlation between the input of the time step and each sub-network, and then select the sub-network for activation, so as to more accurately model the current potential state; when capturing spatial dependencies, GAT can dynamically assign different influence weights to neighbor information at different times, which is more in line with the modeling requirements of the spatial impact of the ever-changing traffic flow. Taking the mean square error MSE and the mean absolute error MAE as indicators, the G-tRIM model obtained the best results in the Guizhou and Beijing data sets. The experimental results are shown in the following table:
[0085]
[0086] Ablation experiment:
[0087] The G-RIM model is obtained by removing the time step information in the input data and only inputting the node data sequence and graph structure. This model uses RIM to capture the temporal dependency of traffic flow data and GAT to capture the spatial dependency of traffic flow data. Because the neighbor information is added, the spatial influence on the node can be captured, and its experimental results are better than RIM; however, RIM ignores the impact of time information on the potential state of traffic flow and only uses the time dependency of traffic flow captured by traffic flow data, so it is not as good as the experimental results of G-tRIM.
[0088] Neighbor information:
[0089] Remove the neighbor data from the input data and only input the node data and time step content to get the tRIM model. This model uses tRIM to capture the time dependency of traffic flow data and can more accurately capture the potential state of traffic flow. The experimental results of this scheme are better than RIM, but the lack of neighbor information makes it impossible to capture spatial influences, so it is not as good as the experimental results of GtRIM. The experimental results are shown in the following table:
[0090]
[0091]
[0092] In addition, the G-tRIM model proposed in the present invention has an important parameter that needs to be set, which is the number of sub-networks g in tRIM and the number of sub-networks activated each time f. Figure 3 In order to conduct experiments with MSE as an indicator in the Guizhou data set, the results under different experimental parameter settings show that the more subnetworks are selected, the better. When the number of subnetworks is too small, each subnetwork cannot train a sufficiently detailed pattern, and the model cannot fully model the potential state of traffic; when the number of subnetworks is too large, the functions of each subnetwork are repeated, which increases the difficulty of model training and reduces the prediction accuracy of the model. Figure 3 As shown in the figure, in the experimental results of the Guizhou dataset, the best is to select 4 sub-networks and activate 2 sub-networks each time. If 4 sub-networks (g=4) are selected, if 1 sub-network is selected for activation, the network will discard more content at each time step, and the result is poor; if 2 sub-networks are selected for activation, the amount of information obtained by the network is just right, and the best Loss is 0.129; if 3 sub-networks are selected for activation, the information received by the network contains unimportant information or even wrong information, which affects the experimental effect; if 4 sub-networks are selected for activation, it is impossible to achieve the effect of training different sub-networks to produce different effects.
[0093] Ablation experiments confirm the importance of time step information and neighbor information for traffic flow prediction; through parameter discussion experiments, appropriate hyperparameters are selected to enable the model to obtain the most accurate prediction results. G-tRIM uses tRIM and GAT to model the temporal dependency and spatial dependency of traffic flow data respectively. The experimental results are better than the comparison methods on both data sets, showing the superior performance of G-tRIM.
[0094] In order to solve the problem of how to accurately capture the spatiotemporal dependency of traffic flow data in traffic flow prediction, this patent proposes a G-tRIM model based on the cyclic independence mechanism RIM. This model uses the improved RIM to effectively integrate the flow data and time step data in the traffic flow data, accurately characterizes the potential state of the traffic flow data, and effectively captures the temporal dependency of the traffic flow data; it uses the graph attention network to dynamically assign different weights to each neighbor of the node, solves the problem of dynamic changes in traffic flow affected by space, and effectively captures the spatial dependency of traffic flow data. The model has obtained relatively accurate prediction results in experiments on two data sets.
[0095] See also Figure 5 ,A traffic flow prediction method based on a cycle-independent mechanism, comprising the following steps:
[0096] S1. Data collection and preprocessing, collecting local traffic data, including traffic flow data;
[0097] S2.G-tRIM model construction, including tRIM module: using the flow data and time step data of the central node to model the potential state of the central node and capture the temporal dependency of the traffic flow data; GAT+LSTM module: aggregating the information of neighboring nodes through GAT, and then inputting the aggregation results into LSTM to capture the spatial dependency of the traffic flow data.
[0098] S3. Subnetwork settings, select 4 subnetworks and activate 2 subnetworks at a time.
[0099] S4. Input stage: At each time step, the traffic flow data and the corresponding time information are projected to the specified space through the MLP layer and then connected in series to enter the attention layer, where they are matched with the hidden states of each sub-network and the most relevant sub-networks are selected for activation;
[0100] S5. In the conversion phase, the activated sub-network uses the real flow value as the input of the current time step, and the remaining sub-networks use the vector as the input of the current time step;
[0101] S6. In the interaction phase, the activated sub-network further optimizes the prediction effect of the model through the interaction mechanism
[0102] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A traffic flow prediction system based on a cyclic independence mechanism, characterized in that: Data collection module, including real-time or historical traffic data collected by various traffic flow sensors, cameras, etc.; The data preprocessing module is used to process missing values and abnormal values of the data collected in the data collection module to ensure the integrity and consistency of the data; The traffic control module adjusts the actual traffic situation by predicting the flow of the next node. The traffic control module includes: The prediction module uses the G-tRIM model to accurately predict traffic flow. The data will go through the input stage, conversion stage, and interaction stage; The control module predicts the changes in traffic flow during peak and trough periods and the changes predicted by the prediction module, and formulates countermeasures in advance to reduce traffic congestion; The public transportation dispatching module predicts the passenger flow in different time periods and areas, rationally arranges bus routes and vehicles, and reduces empty or overloaded situations.
2. A traffic flow prediction system based on a cycle-independent mechanism according to claim 1, characterized in that: The prediction module includes two modules to capture the time dependency and space dependency of traffic flow data respectively.
3. A traffic flow prediction system based on a cycle-independent mechanism according to claim 2, characterized in that: In temporal dependency modeling, tRIM uses the traffic data and time step data of the central node to model the potential state of the central node, aggregates the information of neighboring nodes through GAT, and then inputs the aggregated results into LSTM to capture the spatial dependency of traffic flow data. The temporal dependency of G-tRIM is captured by tRIM.
4. A traffic flow prediction system based on a cycle-independent mechanism according to claim 3, characterized in that: The tRIM is a recurrent neural network composed of several sub-networks, each of which is an LSTM of the same size.
5. A traffic flow prediction system based on a cycle-independent mechanism according to claim 3, characterized in that: At the nth moment of the mth node, the input corresponding to the kth subnetwork is: h n,k is the hidden state of the kth sub-network at time n; d e is the length of the query vector; t n is the time information at moment n; Generate parameters for the query of the kth sub-network; W ke , W va , W ti The Key and Value parameters are generated based on the input.
6. A traffic flow prediction system based on a cycle-independent mechanism according to claim 5, characterized in that: In the conversion stage, the activated sub-network uses the real flow value as the input of the current time step, and the remaining sub-networks use the 0 vector as the input of the current time step. Each sub-network is converted using the formula: S t Refers to the set of sub-networks activated at time step t; is the hidden state of the kth sub-network after receiving the input of time step t and completing the dynamic transformation; D k For dynamic conversion, are the parameters of the kth sub-network LSTM.
7. The traffic flow prediction system based on cycle independence mechanism according to claim 1 is characterized in that: In the interaction phase, each sub-network interacts sparsely with each other. The activated sub-network uses the attention mechanism to aggregate the information of all sub-networks to update its own hidden state. In addition to using valid input to update its own hidden state, the activated sub-network will also use the information of other sub-networks to update its hidden state again in the interaction phase: h t+1,k is the hidden state obtained by the k-th sub-network after sparse information interaction, is the sparse information interaction query parameter of the kth sub-network, and To generate the parameters of K and V, is K in formula (4) t,k As a result of the concatenation, in this process, the input received by each sub-network is different, so different function representations can be trained.
8. The traffic flow prediction system based on the cycle independence mechanism according to claim 2 is characterized in that: GAT can be used to dynamically calculate the attention coefficient between the central node and its neighbors. The expression for aggregating neighbor data using GAT is: Formula (7) is the process of generating Q (Query) based on the traffic flow data of the central node, and Formula (8) is the process of generating a single K based on the traffic flow data of a neighboring node. i (Key) process, Formula (9) is the process of GAT aggregating the traffic flow data of all neighbors of the central node, W q , W ke is a trainable parameter. Formula (10) shows the method of using the spatial dependency of the central node captured by the neighbor node information, where is the traffic flow data sequence of the given central node; For X n A part of a row in is the data sequence of a specific neighbor.
9. A traffic flow prediction system based on a cycle-independent mechanism according to claim 8, characterized in that: The potential state of traffic flow obtained by tRIM is connected in series with the hidden state of spatial dependency, and the predicted value of G-tRIM is obtained through the fully connected layer. The final expression is: The loss function of this model is:
10. A traffic flow prediction method based on a cyclic independence mechanism, based on the traffic flow prediction system according to any one of claims 1 to 9, characterized in that: The following steps are involved: S1. Data collection and preprocessing, collecting local traffic data, including traffic flow data; S2.G-tRIM model construction, including tRIM module and GAT+LSTM module: S3. Subnetwork settings, select and activate several subnetworks; S4. Input stage: At each time step, the traffic flow data and the corresponding time information are projected to the specified space through the MLP layer and then connected in series to enter the attention layer, where they are matched with the hidden states of each sub-network and the most relevant sub-networks are selected for activation; S5. In the conversion phase, the activated sub-network uses the real flow value as the input of the current time step, and the remaining sub-networks use the vector as the input of the current time step; S6. In the interaction stage, the activated sub-network further optimizes the prediction effect of the model through the interaction mechanism.
Citation Information
Cited By
Civil aviation passenger transport demand hierarchical prediction method and system based on multi-source heterogeneous data
CN121526176A
A Hierarchical Prediction Method and System for Civil Aviation Passenger Demand Based on Multi-Source Heterogeneous Data
CN121526176B