Method for traffic flow prediction by using space-time network guided by curriculum learning

Through the course learning module evaluation and training scheduler, the difficulty of node training is gradually introduced, as well as the multi-head spatiotemporal attention and inter-layer residual scaling technology of the global spatiotemporal encoder, the existing traffic flow prediction model is solved in dealing with complex spatiotemporal correlation and node prediction difficulty, and improves prediction accuracy and robustness.

CN119516781APending Publication Date: 2025-02-25FUZHOU UNIV
View PDF 0 Cites 2 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing traffic flow prediction models perform poorly when dealing with complex nonlinear spatiotemporal correlations, especially in the problems of different node prediction difficulties and dilution of original semantic information.

Method used

The spatiotemporal network model guided by course learning is adopted to evaluate the difficulty of node prediction by introducing course learning modules, and gradually introduce training nodes from easy to difficult using training schedulers. At the same time, a global spatiotemporal encoder is designed, and a multi-head spatiotemporal attention mechanism and inter-layer residual scaling technology are used to alleviate semantic information dilution and capture the global spatiotemporal correlation of nodes.

Benefits of technology

It improves the accuracy of traffic flow prediction and the robustness of the model, effectively solving the problems of different prediction difficulties and semantic information dilution of nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119516781A_ABST
    Figure CN119516781A_ABST
Patent Text Reader

Abstract

The invention provides a method for traffic flow prediction through a course learning guided space-time network, and the method comprises the steps: employing a space-time network model, introducing a course learning module to evaluate the prediction difficulty of nodes in a traffic network, employing a training scheduler to gradually introduce training nodes from easy to difficult for the space-time network model, so as to improve the prediction capability; and then, a global space-time encoder with multiple space-time attention mechanisms is adopted, and the problem that original semantic information is diluted in a layer-by-layer transmission process is relieved through an interlayer residual scaling technology, so that global space-time correlation of nodes is captured, and traffic flow prediction is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of intelligent transportation systems, and in particular relates to a method for using a spatiotemporal network guided by curriculum learning to predict traffic flows. Background Art

[0002] Traffic flow prediction is an important component of intelligent transportation systems and plays an important role in the development of smart cities. Accurate traffic flow prediction provides necessary guidance for urban planning and traffic management, such as reducing vehicle emissions, optimizing lane allocation, alleviating traffic congestion, and improving urban commuting efficiency.

[0003] Traffic flow prediction aims to predict future traffic flow using traffic data collected by traffic networks and sensors. In essence, traffic flow prediction is defined as a spatiotemporal graph modeling problem, that is, traffic data has complex and nonlinear spatiotemporal correlations. Early traffic flow prediction usually uses traditional linear time series models, such as autoregressive integrated moving average models and vector autoregression models. However, these models fail to perform well when dealing with complex nonlinear spatiotemporal correlations. In recent years, deep learning models have been widely used in the field of traffic flow prediction due to their powerful learning ability. These models mainly include the following three types: (1) Using Graph Convolutional Network (GCN) to capture spatial correlation and Recurrent Neural Network (RNN) to capture temporal correlation. (2) Using GCN to capture spatial correlation, but in terms of capturing temporal correlation, the dilated convolution in Temporal Convolutional Network (TCN) is used to capture long-range temporal dependencies, and can alleviate the gradient vanishing problem in RNN. (3) Based on the self-attention mechanism to capture local and global spatiotemporal correlations.

[0004] However, although these models have achieved excellent results in the field of traffic flow prediction, there are two problems that are rarely solved. The first problem is how to solve the problem of different prediction difficulties of nodes in the traffic network. This is because the geographical location and traffic flow of different nodes in the traffic system are significantly different. Figure 1 As shown in the figure, node 1 is the central node of the traffic network, and node 7 is the edge node. Figure 2As shown in Figure 1, the traffic flow of node 1 is sometimes greater than that of node 7 and sometimes less than that of node 7. These differences can lead to changes in the difficulty of predicting different nodes. For example, nodes with high centrality and high traffic are more challenging to predict than nodes with low centrality and low traffic, which may cause the model to predict simple nodes well and difficult nodes poorly. The second question is how to reduce the dilution of the original semantic information when passing layer by layer, so as to capture global dependencies more effectively. This is because when capturing the global spatiotemporal correlation of nodes, the original semantic information is gradually diluted with the superposition of layers, which may lead to the loss of important local information, making the model more sensitive to small changes in the input and reducing the robustness of the model. Existing methods use static residual links to alleviate this problem. For example, some works use intra-layer residuals to preserve the output information of the previous layer, but the original semantic information is still not well preserved. Some works impose residual connections with a weight of 1 on the original information, but this may not adapt well to changes in input data. Summary of the invention

[0005] Therefore, in view of the defects and shortcomings of the prior art, the present invention considers whether residual scaling of the original semantic information between layers can better learn global dependencies and improve the prediction performance of the model. The present invention proposes a method for using a spatiotemporal network guided by curriculum learning for traffic flow prediction. By introducing a curriculum learning module, four indicators are defined from multiple perspectives to evaluate the prediction difficulty of nodes in the traffic network, and a training scheduler is used to gradually introduce training nodes from easy to difficult to the model to improve the prediction ability. In addition, the present invention designs a global spatiotemporal encoder, adopts a multi-head spatiotemporal attention mechanism, and uses inter-layer residual scaling technology to alleviate the problem of the original semantic information being diluted during the layer-by-layer transmission process, so as to better capture the global spatiotemporal correlation of the nodes. The present invention uses curriculum learning for the first time to solve the problem of different prediction difficulties of nodes, which can effectively improve the accuracy of traffic flow prediction.

[0006] The technical solution specifically adopted by the present invention to solve the technical problem is:

[0007] A method for using a curriculum learning-guided spatiotemporal network for traffic flow prediction: the adopted spatiotemporal network model introduces a curriculum learning module to evaluate the prediction difficulty of nodes in the traffic network, and uses a training scheduler to gradually introduce training nodes from easy to difficult to the spatiotemporal network model to improve the prediction ability; then a global spatiotemporal encoder with a multi-head spatiotemporal attention mechanism is used to alleviate the problem of dilution of original semantic information in the layer-by-layer transmission process through inter-layer residual scaling technology, so as to capture the global spatiotemporal correlation of nodes, thereby realizing traffic flow prediction.

[0008] Furthermore, the input of the spatiotemporal network model is the traffic network and historical traffic data. First, the multi-perspective difficulty meter in the course learning module is used to calculate four difficulty index values ​​for each node in the traffic network, and weighted fusion is performed to obtain the prediction difficulty of each node. The nodes are sorted in ascending order according to the node difficulty, and a training node subset from easy to difficult is generated for each training iteration through the training scheduler module; for each training node subset, the local spatiotemporal dependency is learned through the local spatiotemporal encoder, and the global spatiotemporal dependency is learned through the global spatiotemporal encoder, and the prediction result is subjected to loss calculation and back-propagation optimization model at the output layer to improve the prediction ability of the model.

[0009] Furthermore, the multi-view difficulty meter evaluates the node prediction difficulty through the following four indicators:

[0010] 1) Node degree: the number of edges directly connected to node i in the transportation network, denoted by D0(i);

[0011] 2) Average neighbor degree: The average degree of neighboring nodes of a given node i in the transportation network, denoted by D1(i), is calculated as follows:

[0012]

[0013] Among them, N i represents the neighbor set of node i, d j represents the degree of node j;

[0014] 3) Katz centrality: It evaluates the relative influence of node i in the network by considering the number of node pairs and the paths between them, denoted by D2(i), and the calculation formula is as follows:

[0015]

[0016] Among them, β is used to control the initial value of centrality, η<1 / λ max ,λ max is the maximum eigenvalue of the adjacency matrix A;

[0017] 4) Traffic flow: The total number of vehicles passing through a given node i, denoted by D3(i), is calculated as follows:

[0018]

[0019] in, represents the number of vehicles passing through node i at time step t.

[0020] Furthermore, the weighted fusion to obtain the prediction difficulty of each node is specifically to adopt a direct weighted fusion strategy to obtain the prediction difficulty of each node i, represented by D(i); in order to prevent overfitting during the training process, for each tensor Dr Normalized, expressed as follows:

[0021]

[0022] D(i)=α0D0(i)+α1D1(i)+α2D2(i)+α3D3(i),

[0023] Among them, α r Used to control the weight of each difficulty indicator, and The value of subscript r is 0, 1, 2, 3, which refers to one of the four indicators to evaluate the difficulty of node prediction;

[0024] The training scheduler module generates a subset of training nodes from easy to difficult for each training iteration: K represents the number of training iterations; the training scheduler includes a pace function, and the fitting curve formula is as follows:

[0025]

[0026] Where c0 represents the initial value, p is used to adjust the speed of node introduction; for each iteration k, a mapping value c is generated k , which indicates the ratio of the current number of training nodes to the total number of nodes.

[0027] Furthermore, the local spatiotemporal encoder includes a stacked adaptive graph convolution cycle unit AGCRU, expressed as:

[0028]

[0029] h t =(1-u t )⊙h t-1 +u t ⊙h′ t ,

[0030] in, represents the learned normalized adjacency matrix, X t and h t are the input and output of time step t; || represents the connection operation, u t and r t The update gate and reset gate corresponding to time step t; σ is the sigmoid activation function, ⊙ is the Hadamard product; E, Θ u ,Θ r ,Θ h′ ,b u ,b r ,b h′ These are all learnable parameters.

[0031] Furthermore, the global space-time encoder is used to convert the output of the local space-time encoder As input, position encoding is used to provide relative position information for all time steps in H, as shown below;

[0032] PE (pos,2m) =sin(pos / 10000 2m / d ),

[0033] PE (pos,2m+1) =cos(pos / 10000 2m / d ),

[0034]

[0035] Among them, pos∈[1,T] represents the position index of the time step, and m represents the index of the hidden dimension;

[0036] The position-encoded features are input into the multi-head spatiotemporal attention module;

[0037] The multi-head spatiotemporal attention module includes a spatial self-attention module, a temporal self-attention module and an attention fusion module.

[0038] Furthermore, the spatial self-attention module SSAM is used to capture the dynamic global spatial correlation of nodes. The specific process is as follows:

[0039] 1) At time step t, first obtain the Q, K, V matrices:

[0040]

[0041] in, is the learnable weight matrix, is the learnable bias matrix; D′ represents the dimension of each spatiotemporal head;

[0042] 2) Calculate the spatial attention between different nodes:

[0043]

[0044] 3) Update node representation:

[0045]

[0046] The temporal self-attention module TSAM is used to capture the dynamic global temporal correlation of nodes. The specific process is as follows:

[0047] 1) For each node n, obtain the Q, K, V matrices:

[0048]

[0049] 2) Calculate the temporal attention of each node at different time steps:

[0050]

[0051] 3) Update the representation of the node in time:

[0052]

[0053] The attention fusion module uses multi-head attention to calculate the spatial self-attention module and the temporal self-attention module, and captures the dynamic global spatiotemporal correlation of nodes by fusing spatial correlation and temporal correlation:

[0054]

[0055] Among them, h s and h t denote the number of spatial heads and the number of temporal heads respectively; and Represents the output of each head in the spatial self-attention module and the temporal self-attention module respectively; and are the concatenation results of the spatial header and the temporal header respectively; || is the concatenation operation, W o is a learnable projection matrix;

[0056] The spatial self-attention module and the temporal self-attention module have d'=d / (h s +h t ).

[0057] Furthermore, the global spatiotemporal encoder uses a multi-layer perceptron to further capture H l The abstract representation of to get the output of the lth layer:

[0058] H' l =MLP(H l )=σ(H l W1+B1)w2+b2.

[0059] Next, the inter-layer residual scaling module is constructed by scaling the output H′ of the previous layer l-1 and the weighted original semantic information Add them together as the input of the current layer:

[0060]

[0061] Where ω represents the scaling factor;

[0062] Finally, in order to generate predictions for the next P time steps at the same time, the last time step of the model output Perform a linear transformation:

[0063]

[0064] Prediction results to indicate; to use As a loss function:

[0065]

[0066] in and is a learnable parameter; Y t and They represent the predicted values ​​and true values ​​of all nodes at the t-th time step respectively; |·| represents the absolute value operation.

[0067] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the method for using a spatiotemporal network guided by curriculum learning for traffic flow prediction are implemented as described above.

[0068] A non-transitory computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for using a curriculum-guided spatiotemporal network for traffic flow prediction as described above.

[0069] Compared with the prior art, the present invention and its preferred solution have at least the following outstanding design features:

[0070] 1. A multi-perspective difficulty meter is designed, which defines four indicators to evaluate node difficulty and combines it with the training scheduler to gradually introduce training nodes from easy to difficult to the model to improve the prediction ability of the model, thereby solving the problem of different prediction difficulties of nodes.

[0071] 2. A global spatiotemporal encoder is designed that integrates a multi-head spatiotemporal self-attention mechanism and inter-layer residual scaling to better learn the global spatiotemporal correlation of nodes while reducing the dilution of the original semantic information passed layer by layer. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:

[0073] Figure 1 It is a schematic diagram of the transportation network.

[0074] Figure 2 It is a schematic diagram of node traffic conditions.

[0075] Figure 3: is a schematic diagram of a model provided by an embodiment of the present invention. In which, (1) indicates that the model is trained from the first iteration to the Kth iteration; (2) indicates that a training node subset of the model is generated for each iteration; (3) indicates that a local spatiotemporal encoder and a global spatiotemporal encoder are used to train each training node subset; (4) indicates that a prediction loss is calculated for each training node subset and back propagation is performed.

[0076] Figure 4 Schematic diagram of the step function of an embodiment of the present invention.

[0077] Figure 5 It is a schematic diagram of a global space-time encoder according to an embodiment of the present invention. DETAILED DESCRIPTION

[0078] In order to make the features and advantages of the present invention more clearly understood, the following embodiments are specifically described in detail as follows:

[0079] It should be noted that the following detailed descriptions are illustrative and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used in this specification have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.

[0080] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0081] 1. Model Overview:

[0082] The model structure provided by the embodiment of the present invention is as follows Figure 3 As shown. It receives two inputs: traffic network and historical traffic data. First, the multi-view difficulty meter in the course learning module calculates four difficulty index values ​​for each node in the traffic network, and weighted fusion is performed to obtain the prediction difficulty of each node. The nodes are sorted in ascending order according to the node difficulty. Then, the training scheduler module generates a subset of training nodes from easy to difficult for each training iteration. For each subset of training nodes, the local spatiotemporal dependency is learned through the local spatiotemporal encoder, and the global spatiotemporal dependency is learned through the global spatiotemporal encoder. The prediction results are calculated and back-propagated at the output layer to optimize the model to improve the prediction ability of the model.

[0083] 2. Course learning module

[0084] First, the embodiment of the present invention uses a course learning module to use a multi-perspective difficulty meter to evaluate the node difficulty. Specifically, four indicators are defined from the perspective of graph structure and traffic data to evaluate the node prediction difficulty, which are defined as follows:

[0085] 1) Node degree: the number of edges directly connected to node I in the transportation network, denoted by d0(I).

[0086] 2) Average neighbor degree: The average degree of neighboring nodes of a given node i in the transportation network, denoted by D1(i), is calculated as follows:

[0087]

[0088] Among them, N i represents the neighbor set of node i, d j represents the degree of node j.

[0089] 3) Katz centrality: It evaluates the relative influence of node i in the network by considering the number of node pairs and the paths between them, denoted by D2(i), and the calculation formula is as follows:

[0090]

[0091] Among them, β is used to control the initial value of centrality, η<1 / λ max ,λ max is the largest eigenvalue of the adjacency matrix A.

[0092] 4) Traffic flow: The total number of vehicles passing through a given node i, denoted by D3(i), is calculated as follows:

[0093]

[0094] in, represents the number of vehicles passing through node i at time step t.

[0095] In order to consider both the graph structure and traffic flow perspectives, a direct weighted fusion strategy is adopted for the above four indicators to obtain the prediction difficulty of each node i, represented by D(i). In addition, in order to prevent overfitting during training, for each tensor D r These processes are expressed by the following formulas:

[0096]

[0097] D(i)=α0D0(i)+α1D1(i)+α2D2(i)+α3D3(i), (5)

[0098] Among them, α r Used to control the weight of each difficulty indicator, and

[0099] The subscript r ranges from 0, 1, 2, and 3, representing four evaluation indicators respectively.

[0100] After evaluating the difficulty of each node in the traffic network, the course learning module uses the training scheduler to generate a series of courses from easy to difficult, namely the training node set Here K represents the number of training iterations. The core of the training scheduler lies in the pace function, such as Figure 4 As shown, the fitting curve formula is as follows:

[0101]

[0102] Where c0 represents the initial value, and p is used to adjust the speed of node introduction. It can be seen that for each iteration k, a mapping value c is generated. k , which indicates the ratio of the current number of training nodes to the total number of nodes. This means that the model will learn fewer simple nodes at the beginning, and as the iterations proceed, it will gradually learn more and more complex nodes, which is similar to the human cognitive process. This can improve the learning ability of the model to a certain extent, thereby improving the prediction accuracy.

[0103] 3. Local Spatiotemporal Encoder

[0104] In order to enable nodes to learn local spatiotemporal correlations, such as Figure 3 As shown, the embodiment of the present invention introduces a local spatiotemporal encoder, which is composed of stacked adaptive graph convolutional recurrent units (AGCRU), and each AGCRU can be expressed by the following formula:

[0105]

[0106] in, represents the learned normalized adjacency matrix, X t and h t are the input and output of time step t. || represents the connection operation, u t and r t The update gate and reset gate corresponding to time step t. σ is the sigmoid activation function, ⊙ is the Hadamard product. E,Θ u ,Θ r ,Θ h′ ,b u ,b r ,b h′ These are all learnable parameters.

[0107] 4. Global Space-Time Encoder

[0108] The specific structure of the global spatiotemporal encoder used in the embodiment of the present invention is as follows: Figure 5 It converts the output of the local spatiotemporal encoder (using The position encoding is used to provide relative position information for all time steps in H, as shown in formula (8) and formula (9).

[0109]

[0110] Among them, pos∈[1,T] represents the position index of the time step and m represents the index of the hidden dimension.

[0111] Subsequently, the position-encoded features will pass through the multi-head spatiotemporal attention module, which mainly includes three sub-modules: spatial self-attention module (SSAM), temporal self-attention module (TSAM) and attention fusion. The SSAM module is mainly used to capture the dynamic global spatial correlation of nodes. The specific process is as follows:

[0112] 1) At time step t, first use formula (10) to obtain the Q, K, and V matrices:

[0113]

[0114] in, is the learnable weight matrix, is a learnable bias matrix. d′ represents the dimension of each spatiotemporal head, which will be introduced in the attention fusion module.

[0115] 2) Calculate the spatial attention between different nodes, as shown in formula (11):

[0116]

[0117] 3) Update the node representation using formula (12):

[0118]

[0119] The TSAM module is mainly used to capture the dynamic global time correlation of nodes. The specific process is similar to SSAM, and the process is as follows:

[0120] 1) For each node n, first use formula (13) to obtain the Q, K, and V matrices:

[0121]

[0122] 2) Calculate the temporal attention of each node at different time steps, as shown in formula (14):

[0123]

[0124] 3) Update the representation of the node in time, as shown in formula (15):

[0125]

[0126] The attention fusion module mainly uses multi-head attention to calculate SSAM and TSAM to enhance the representation ability of the model, and captures the dynamic global spatiotemporal correlation of nodes by fusing spatial correlation and temporal correlation. It can be expressed as follows:

[0127]

[0128] Among them, h s and h t Represent the number of spatial heads and the number of temporal heads respectively. and Represents the output of each header in SSAM and TSAM respectively. and are the concatenation results of the spatial header and the temporal header respectively. || is the concatenation operation, W o is the learnable projection matrix. d'=d / (h s +h t ).

[0129] Multilayer Perceptron (MLP) is used to further capture H l The abstract representation of is used to obtain the output of the lth layer, as shown in formula (17):

[0130] H′ l =MLP(H l )=σ(H l W1+b1)W2+b2. (17)

[0131] Next, the inter-layer residual scaling module is constructed by scaling the output H′ of the previous layer l-1 and the weighted original semantic information (i.e., ) is added as the input of the current layer, as shown in formula (18):

[0132]

[0133] Here, ω represents the scaling factor.

[0134] Finally, in order to generate predictions for the next P time steps at the same time, the last time step output by the model (i.e. ) is linearly transformed, as shown in formula (19), and the prediction result is expressed as Indicates. Use As the loss function, it can be defined as formula (20).

[0135]

[0136] in and is a learnable parameter. t and Respectively represent the predicted value and true value of all nodes at the tth time step. |·| represents the absolute value operation.

[0137] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0138] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0139] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0140] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0141] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0142] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.

[0143] The present invention is not limited to the above-mentioned optimal implementation mode. Anyone can derive other various forms of a method for using a spatiotemporal network guided by course learning for traffic flow prediction under the inspiration of the present invention. All equal changes and modifications made within the scope of the invention application of the present invention should fall within the scope of the present invention.

Claims

1. A method for traffic flow prediction using a spatiotemporal network guided by curriculum learning, characterized in that: The adopted spatiotemporal network model introduces a curriculum learning module to evaluate the prediction difficulty of nodes in the traffic network, and uses a training scheduler to gradually introduce training nodes from easy to difficult to the spatiotemporal network model to improve the prediction ability; then a global spatiotemporal encoder with a multi-head spatiotemporal attention mechanism is used to alleviate the problem of dilution of original semantic information in the layer-by-layer transmission process through inter-layer residual scaling technology, so as to capture the global spatiotemporal correlation of nodes, thereby realizing traffic flow prediction.

2. The method for traffic flow prediction based on a spatiotemporal network guided by curriculum learning according to claim 1, characterized in that: The input of the spatiotemporal network model is the traffic network and historical traffic data. First, the multi-perspective difficulty meter in the course learning module is used to calculate four difficulty index values ​​for each node in the traffic network, and weighted fusion is performed to obtain the prediction difficulty of each node. The nodes are sorted in ascending order according to the node difficulty, and a training node subset from easy to difficult is generated for each training iteration through the training scheduler module; for each training node subset, the local spatiotemporal dependency is learned through the local spatiotemporal encoder, and the global spatiotemporal dependency is learned through the global spatiotemporal encoder, and the prediction result is subjected to loss calculation and back-propagation optimization model at the output layer to improve the prediction ability of the model.

3. The method for traffic flow prediction using a spatiotemporal network guided by curriculum learning according to claim 2, characterized in that: The multi-view difficulty meter evaluates the node prediction difficulty through the following four indicators: 1) Node degree: the number of edges directly connected to node i in the transportation network, denoted by D0(i); 2) Average neighbor degree: The average degree of neighboring nodes of a given node i in the transportation network, denoted by D1(i), is calculated as follows: Among them, N i represents the neighbor set of node i, d j represents the degree of node j; 3) Katz centrality: It evaluates the relative influence of node i in the network by considering the number of node pairs and the paths between them, denoted by D2(i), and the calculation formula is as follows: Among them, β is used to control the initial value of centrality, η<1 / λ max ,λ max is the maximum eigenvalue of the adjacency matrix A; 4) Traffic flow: The total number of vehicles passing through a given node i, denoted by D3(i), is calculated as follows: in, represents the number of vehicles passing through node i at time step t.

4. The method for using a spatiotemporal network guided by curriculum learning for traffic flow prediction according to claim 3, characterized in that: The weighted fusion method is specifically used to obtain the prediction difficulty of each node by adopting a direct weighted fusion strategy to obtain the prediction difficulty of each node i, represented by D(i); in order to prevent overfitting during the training process, for each tensor D r Normalized, expressed as follows: D(i)=α0D0(i)+α1D1(i)+α2D2(i)+α3D3(i), Among them, α r Used to control the weight of each difficulty indicator, and The value of subscript r is O, 1, 2, 3, which refers to one of the four indicators to evaluate the difficulty of node prediction; The training scheduler module generates a subset of training nodes from easy to difficult for each training iteration: K represents the number of training iterations; the training scheduler includes a pace function, and the fitting curve formula is as follows: Where c0 represents the initial value, p is used to adjust the speed of node introduction; for each iteration K, a mapping value c is generated k , which indicates the ratio of the current number of training nodes to the total number of nodes.

5. The method for using a spatiotemporal network guided by curriculum learning for traffic flow prediction according to claim 2, characterized in that: The local spatiotemporal encoder includes a stacked adaptive graph convolutional cycle unit AGCRU, which is expressed as: ht=(1-u t )⊙h t-1 +in t ⊙h′ t , in, represents the learned normalized adjacency matrix, X t and h t are the input and output of time step t; || represents the connection operation, u t and r t The update gate and reset gate corresponding to time step t; σ is the sigmoid activation function, ⊙ is the Hadamard product; E, Θ u , Θ r , Θ h′ , b u , b r , b h′ These are all learnable parameters.

6. The method for traffic flow prediction using a spatiotemporal network guided by curriculum learning according to claim 2, characterized in that: The global space-time encoder is used to convert the output of the local space-time encoder As input, position encoding is used to provide relative position information for all time steps in H, as shown below; ON (pos,2m) =sin(pos / 10000 2m / d ), ON (pos,2m+1) =cos(pos / 10000 2m / d ), Among them, pos∈[1,T] represents the position index of the time step, and m represents the index of the hidden dimension; The position-encoded features are input into the multi-head spatiotemporal attention module; The multi-head spatiotemporal attention module includes a spatial self-attention module, a temporal self-attention module and an attention fusion module.

7. The method for using a spatiotemporal network guided by curriculum learning for traffic flow prediction according to claim 6, characterized in that: The spatial self-attention module SSAM is used to capture the dynamic global spatial correlation of nodes. The specific process is as follows: 1) At time step t, first obtain the Q, K, V matrices: in, is the learnable weight matrix, is the learnable bias matrix; d′ represents the dimension of each spatiotemporal head; 2) Calculate the spatial attention between different nodes: 3) Update node representation: The temporal self-attention module TSAM is used to capture the dynamic global temporal correlation of nodes. The specific process is as follows: 1) For each node n, obtain the Q, K, V matrices: 2) Calculate the temporal attention of each node at different time steps: 3) Update the representation of the node in time: The attention fusion module uses multi-head attention to calculate the spatial self-attention module and the temporal self-attention module, and captures the dynamic global spatiotemporal correlation of nodes by fusing spatial correlation and temporal correlation: Among them, h s and h t denote the number of spatial heads and the number of temporal heads respectively; and Represents the output of each head in the spatial self-attention module and the temporal self-attention module respectively; and are the concatenation results of the spatial header and the temporal header respectively; || is the concatenation operation, W o is a learnable projection matrix; The spatial self-attention module and the temporal self-attention module have d′=d / (h s +h t ).

8. The method for traffic flow prediction using a spatiotemporal network guided by curriculum learning according to claim 7, characterized in that: A multi-layer perceptron is used in the global spatiotemporal encoder to further capture the abstract representation of H, to obtain the output of the lth layer: H l =MLP(H l )=σ(H l W1+b1)W2+b2. Next, the inter-layer residual scaling module is constructed by scaling the output H′ of the previous layer l-1 and the weighted original semantic information Add them together as the input of the current layer: Where ω represents the scaling factor; Finally, in order to generate predictions for the next P time steps at the same time, the last time step of the model output Perform a linear transformation: Prediction results to indicate; to use As a loss function: in and is a learnable parameter; Y t and Respectively represent the predicted values ​​and true values ​​of all nodes at the t-th time step; |@| represents the absolute value operation.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for using a curriculum-guided spatiotemporal network for traffic flow prediction as described in any one of claims 1 to 8 are implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for using a curriculum-guided spatiotemporal network for traffic flow prediction as described in any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Dynamic space-time diagram flow prediction method and system based on course learning

    CN121860159A

  • A dynamic spatio-temporal graph traffic prediction method and system based on curriculum learning

    CN121860159B