[go: up one dir, main page]

CN120260263A - An adaptive traffic flow prediction method based on multi-time step graph - Google Patents

An adaptive traffic flow prediction method based on multi-time step graph Download PDF

Info

Publication number
CN120260263A
CN120260263A CN202510224957.2A CN202510224957A CN120260263A CN 120260263 A CN120260263 A CN 120260263A CN 202510224957 A CN202510224957 A CN 202510224957A CN 120260263 A CN120260263 A CN 120260263A
Authority
CN
China
Prior art keywords
time
graph
prediction
node
adaptive
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202510224957.2A
Other languages
Chinese (zh)
Inventor
肖潇
杨玉慧
彭紫妍
王丽雯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xidian University
Original Assignee
Xidian University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xidian University filed Critical Xidian University
Priority to CN202510224957.2A priority Critical patent/CN120260263A/en
Publication of CN120260263A publication Critical patent/CN120260263A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/0104Measuring and analyzing of parameters relative to traffic conditions
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/10Pre-processing; Data cleansing
    • G06F18/15Statistical pre-processing, e.g. techniques for normalisation or restoring missing data
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/042Knowledge-based neural networks; Logical representations of neural networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • G06N3/0442Recurrent networks, e.g. Hopfield networks characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • G06N3/0455Auto-encoder networks; Encoder-decoder networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/092Reinforcement learning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/0985Hyperparameter optimisation; Meta-learning; Learning-to-learn
    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/0104Measuring and analyzing of parameters relative to traffic conditions
    • G08G1/0125Traffic data processing
    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/0104Measuring and analyzing of parameters relative to traffic conditions
    • G08G1/0137Measuring and analyzing of parameters relative to traffic conditions for specific applications
    • G08G1/0145Measuring and analyzing of parameters relative to traffic conditions for specific applications for active traffic flow control
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Probability & Statistics with Applications (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明涉及一种基于多时间步长图的交通流量自适应预测方法,属于智能交通与数据挖掘分析技术领域,本发明的基于多时间步长图的交通流量自适应预测方法,通过融合距离图、时变边权拓扑图和多时间步长图得到自适应拓扑图网络,并引入转注意力机制,利用强化学习控制模块,设计联合注意力机制与自适应拓扑图网络的预测技术,实现对时空动态特性的全面捕获、预测误差的有效缓解及最优预测时刻的自适应确定,从而在保证预测准确性的同时,显著提升预测的及时性和可靠性。

The present invention relates to a traffic flow adaptive prediction method based on a multi-time-step graph, and belongs to the technical field of intelligent transportation and data mining and analysis. The traffic flow adaptive prediction method based on the multi-time-step graph of the present invention obtains an adaptive topological graph network by fusing a distance graph, a time-varying edge weight topological graph and a multi-time-step graph, introduces a transfer attention mechanism, and utilizes a reinforcement learning control module to design a prediction technology that combines the attention mechanism with the adaptive topological graph network, thereby achieving comprehensive capture of spatiotemporal dynamic characteristics, effective mitigation of prediction errors and adaptive determination of the optimal prediction moment, thereby significantly improving the timeliness and reliability of the prediction while ensuring the accuracy of the prediction.

Description

Traffic flow self-adaptive prediction method based on multi-time step map
Technical Field
The invention belongs to the technical field of intelligent traffic and data mining analysis, and particularly relates to a traffic flow self-adaptive prediction method based on a multi-time step diagram.
Background
With the acceleration of the urban process and the increasing traffic demand, urban traffic systems face increasingly severe congestion problems. The traffic flow prediction is used as one of the core tasks of the intelligent traffic system, and has important significance in optimizing traffic resource allocation, reducing congestion and improving traffic efficiency.
Conventional traffic flow prediction techniques face the following major technical challenges. Firstly, the dynamic characteristics of space-time data, traffic flow has obvious space-time dynamic characteristics, a traditional prediction model based on a static diagram or a single time sequence is difficult to capture a complex space-time association relation, secondly, the problem of timely prediction and accuracy balance is solved, in traffic management, timely prediction can provide support for early decision, but early prediction can lead to accuracy reduction, and too late prediction can miss the best opportunity for taking intervention measures, thirdly, the accumulation effect of prediction errors is that in multi-step prediction tasks, the prediction errors gradually accumulate along with the advancement of time, the reliability of prediction results is reduced, and the method has negative influence on timely and accurate traffic management decisions.
The traditional space-time diagram convolution network is excellent in capturing complex space-time dependency, but generally depends on fixed prediction time or a single static diagram structure, cannot fully adapt to a dynamically changeable traffic flow mode in an actual scene, lacks adaptive optimization capability for the prediction time, cannot flexibly cope with real-time change requirements of different areas, and is quite unfavorable for adaptively predicting traffic flow and avoiding congestion accidents. Therefore, a traffic flow adaptive prediction method is needed to improve timeliness and reliability of prediction while ensuring prediction accuracy.
Disclosure of Invention
In order to solve the problems in the prior art, the invention provides a traffic flow self-adaptive prediction method based on a multi-time step diagram. The technical problems to be solved by the invention are realized by the following technical scheme:
the invention provides a traffic flow self-adaptive prediction method based on a multi-time step diagram, which comprises the following steps:
Acquiring traffic sensor data, and respectively constructing a distance graph, a time-varying side weight topological graph and a multi-time step graph to respectively extract time features and space features;
The distance map, the time-varying side weight topological map and the multi-time step map are fused to obtain an adaptive topological map, wherein the adaptive topological map is used as an encoder to encode the extracted time features and the spatial features;
Performing space-time embedded modeling on the coded time features and the spatial features to obtain comprehensive space-time features;
Constructing a decoder, decoding the comprehensive space-time characteristics through the decoder to obtain a preliminary prediction result, and weighting and fusing the characteristic information of the encoder and the decoder by adopting a distraction mechanism to establish a mapping relation of the space-time characteristics between the encoder and the decoder;
The optimal prediction time of each node in the self-adaptive topological graph is self-adaptively determined through a reinforcement learning control module, a prediction motion vector is generated, and a prediction result is obtained according to the prediction motion vector and the preliminary prediction result;
And combining the performance loss function, the controller loss function and the early loss function to obtain a weighted total loss function, optimizing a training model, and outputting an accurate prediction result of traffic flow.
In one embodiment of the present invention, the obtaining traffic sensor data, respectively constructing a distance graph, a time-varying side-weight topology graph and a multi-time-step graph, to extract temporal features and spatial features, respectively, includes:
Acquiring traffic sensor data, wherein the traffic sensor data comprises time information and space information;
Constructing a graph structure, wherein the graph structure comprises a plurality of nodes;
quantizing the spatial relationship between the nodes by adopting a distance matrix to generate a distance graph;
introducing self-loop connection into each node, integrating node information and adjacent node information thereof, wherein the expression is as follows:
Wherein, the The method is based on the output characteristics of the nodes after convolution fusion calculation processing of the distance graph, wherein W d is a weight matrix capable of learning, and H in is the input node characteristics; a degree matrix which is a diagonal matrix calculated according to the distance matrix, wherein the elements on the diagonal line are the degree matrix Is the degree of the node i, namely the sum of the weights of the edges directly connected with the node i, byCarrying out normalization processing to balance the influence of the degree difference of different nodes on feature propagation; Beta 1 and beta 2 are super parameters which respectively represent the importance of the characteristics of the node itself and the characteristics of the adjacent nodes in the output characteristics;
constructing a time-varying side weight topological graph, wherein the expression is as follows:
Wherein, the Is a time-varying side weight topological graph; the ReLU function is a function for ensuring that the elements of the output matrix are non-negative values, the tanh function is a function for carrying out standardization processing on the matrix element values, alpha is a super parameter for adjusting the saturation of an activation function, X se is a dynamic embedded vector of a source node, and X te is a dynamic embedded vector of a target node; transpose of the dynamic embedded vector for the target node;
Generating a multi-time step diagram by using a dynamic time-warping method to calculate similarity between time sequences, wherein the expression is as follows:
Wherein, the The method is characterized by comprising the steps of calculating a distance for a multi-time step chart, calculating a distance for a similarity measure between traditional time sequences by using DTW, and controlling the attenuation rate of a dynamic time warping distance by using a parameter kappa.
In one embodiment of the present invention, fusing the distance map, the time-varying side weight topology map, and the multi-time step map to obtain an adaptive topology map includes:
and fusing the distance map and the time-varying side weight topological map through a weighted fusion strategy, wherein the expression is as follows:
Wherein, the The distance map and the variable-edge-weight topological map are fused; a degree matrix for the time-varying side weight topology map; The whole weighted fusion process is regulated through super parameter beta 123, beta 123 is super parameter, and the contribution degree of the self-loop connection, the distance graph and the time-varying side weight topological graph in the output characteristic representation is represented respectively; A time-varying side weight topological graph at a time t;
Introducing super parameter beta 4, representing the contribution degree of the multi-time step diagram to the final fusion diagram characteristic representation, and obtaining a self-adaptive topological diagram, wherein the expression is as follows:
wherein H out is an adaptive topological graph, and H t is a hidden state at time t.
In one embodiment of the present invention, performing space-time embedding modeling on the encoded temporal feature and the spatial feature to obtain a comprehensive space-time feature, including:
Performing result conversion on the encoded time features and the encoded space features by utilizing single-heat encoding to generate time embedding and space embedding respectively;
Integrating the time embedding and the space embedding to obtain comprehensive space-time characteristics, wherein the expression is as follows:
Wherein, the Is a comprehensive space-time feature; is space embedded; Is time embedded.
In one embodiment of the present invention, constructing a decoder, decoding the integrated space-time feature by the decoder to obtain a preliminary prediction result, weighting and fusing feature information of the encoder and the decoder by using a attention turning mechanism to establish a mapping relationship of space-time features between the encoder and the decoder, including:
Constructing a decoder, and decoding the comprehensive space-time characteristics through the decoder to obtain a preliminary prediction result;
Modeling the connection between the encoder and the decoder by adopting a distraction mechanism, wherein the expression is as follows:
Wherein ε i,t(t1,t2) is the attention score, e i,t′ is the space-time embedding processed by the ReLU activation function, t 1 and t 2 are both time nodes, W is the weight, b is the deviation parameter, and [ in ], [ in ] is the vector inner product; Is a scaling factor;
the decoder performs weighted summation on the hidden states of the previous time points according to the attention score, and the expression is as follows:
wherein T 2 = t..a.t-1, σ (·) is a normalized exponential function, W h is a weight parameter of the network in the decoder, b h is a bias parameter, ε t is an attention score; Is the hidden state at time t 1.
In one embodiment of the present invention, adaptively determining, by a reinforcement learning control module, an optimal prediction time of each node in the adaptive topology map, generating a predicted motion vector, and obtaining a predicted result according to the predicted motion vector and the preliminary predicted result, including:
the optimal prediction time of each node in the self-adaptive topological graph is self-adaptively determined through a reinforcement learning control module;
optimizing a prediction strategy based on the current state and the current strategy by the reinforcement learning control module, wherein the expression is as follows:
pt=σ(WcSt+bc);
at=π(St);
Wherein p t is the pause probability, W c is the weight parameter of the reinforcement learning control module, sigma is the activation function, b c is the deviation parameter of the reinforcement learning control module, S t is the current state, a t is the predicted motion vector indicating the optimal predicted time, pi is the current strategy;
multiplying the prediction motion vector by the nonlinear transformation result of the hidden state element by element to obtain a prediction result, wherein the expression is as follows:
Wherein, the W p is weight, b p is deviation parameter; the decoder outputs a hidden state for each time step t.
In one embodiment of the present invention, if the predicted motion vector of a node i in all time steps is 0, the optimal predicted time of the node is defaulted to T-1, and a predicted result is obtained
In one embodiment of the present invention, combining the performance loss function, the controller loss function, and the early loss function to obtain a weighted total loss function, optimizing a training model, and outputting an accurate prediction result of traffic flow, including:
calculating the average absolute error between the predicted result and the true value to obtain a performance loss function, wherein the expression is as follows:
Wherein L p is a performance loss function, N is the number of nodes, and X T,i is a true value;
and calculating negative logarithm pause probability to obtain an early loss function, wherein the expression is as follows:
wherein L e is the early loss function; for each node i, calculating by a strategy pi to obtain the optimal prediction time;
Using the prize tensor, maximizing the desired prize to improve the prediction accuracy, and obtaining a controller loss function, the expression of which is:
Wherein L c is a controller loss function, E represents the desire of the bracket interior, b t′ is a base line, S t is a hidden state, r t' is updated rewards, r is an overall rewards;
and obtaining a weighted loss function through a super parameter according to the performance loss function, the early loss function and the controller loss function, wherein the expression is as follows:
L=Lp1Lc2Le;
Wherein L is a weighted loss function, and omega 1 and omega 2 are super parameters;
And optimizing the training model according to the weighted loss function to enable the model training to be converged, and obtaining the accurate prediction result of the traffic flow after the training is completed and outputting.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the traffic flow self-adaptive prediction method based on the multi-time step map when executing the computer program.
The invention also provides a computer readable storage medium, on which a computer program is stored, which when being executed by a processor, implements the traffic flow adaptive prediction method based on multiple time step diagrams.
Compared with the prior art, the invention has the beneficial effects that:
According to the traffic flow self-adaptive prediction method based on the multi-time step diagram, a self-adaptive topological diagram network is obtained by fusing a distance diagram, a time-varying side weight topological diagram and a multi-time step diagram, a attention turning mechanism is introduced, a prediction technology combining the attention turning mechanism and the self-adaptive topological diagram network is designed by utilizing a reinforcement learning control module, comprehensive capture of time-space dynamic characteristics, effective alleviation of prediction errors and self-adaptive determination of optimal prediction time are realized, and therefore, the timeliness and reliability of prediction are remarkably improved while the prediction accuracy is ensured.
The invention inputs the real-time data sample collected by the sensor into the model, the self-adaptive topological graph network is used as an encoder to extract data characteristics, the output of the encoder is used for initializing the decoder, the reinforcement learning control module judges whether the current moment meets the condition of the optimal step length according to the network hiding state output by the decoder, if so, a prediction result is generated and is used as a final prediction result, namely, the number of vehicles passing in each sensor area in a future time period. Through the steps, the method can effectively improve the prediction accuracy and timeliness of traffic flow, and particularly when complex urban traffic data is processed, the method has higher prediction accuracy and flexibility than the traditional method.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention, as well as the preferred embodiments thereof, together with the following detailed description of the invention, given by way of illustration only, together with the accompanying drawings.
Drawings
FIG. 1 is an overall frame diagram of a traffic flow adaptive prediction method based on multiple time step diagrams provided by an embodiment of the present invention;
fig. 2 is a flowchart of a traffic flow adaptive prediction method based on a multi-time step chart according to an embodiment of the present invention.
Detailed Description
In order to further explain the technical means and effects adopted by the invention to achieve the preset aim, the following describes in detail a traffic flow self-adaptive prediction method based on a multi-time step chart according to the invention with reference to the attached drawings and the specific embodiments.
The foregoing and other features, aspects, and advantages of the present invention will become more apparent from the following detailed description of the preferred embodiments when taken in conjunction with the accompanying drawings. The technical means and effects adopted by the present invention to achieve the intended purpose can be more deeply and specifically understood through the description of the specific embodiments, however, the attached drawings are provided for reference and description only, and are not intended to limit the technical scheme of the present invention.
Example 1
The traditional space-time diagram convolution network is excellent in capturing complex space-time dependency, but generally depends on fixed prediction time or a single static diagram structure, cannot be fully suitable for a dynamically changeable traffic flow mode in an actual scene, particularly lacks adaptive optimization capability for the prediction time, is difficult to flexibly cope with real-time change requirements of different areas, and is very unfavorable for adaptively predicting traffic flow and avoiding congestion accidents. The invention provides a traffic flow self-adaptive prediction method based on a multi-time step map, which aims to solve the problem of insufficient dynamic data capture of a time sequence in the existing traffic flow prediction, in particular to short-time high-frequency fluctuation and long-time trend change.
As shown in fig. 1 and fig. 2, fig. 1 is an overall frame diagram of a traffic flow adaptive prediction method based on a multi-time step diagram according to an embodiment of the present invention, and fig. 2 is a flowchart of a traffic flow adaptive prediction method based on a multi-time step diagram according to an embodiment of the present invention.
In this embodiment, the traffic flow adaptive prediction method based on the multiple time step graphs includes the steps of:
And step 1, acquiring traffic sensor data, and respectively constructing a distance graph, a time-varying side weight topological graph and a multi-time step graph to respectively extract time characteristics and space characteristics.
In an alternative embodiment, step 1 comprises:
step 1.1, acquiring traffic sensor data, wherein the traffic sensor data comprises time information and space information;
and 1.2, constructing a graph structure which comprises a plurality of nodes.
Specifically, the graph structure is definedThe graph comprises N nodes V i epsilon V, wherein V is a vertex set and E is an edge set, and the relation between the nodes (namely the edge (V i,vj) epsilon E in the graph structure) is determined according to the relevance between the nodes. In order to quantify the connection strength between these nodes, the edge data is represented by a matrix A εR N×N, R being a real set, meaning that each element in the matrix is real, and each node information at time t is recorded by node data X t∈RN.
And 1.3, quantifying the spatial relationship among the nodes by adopting a distance matrix to generate a distance graph.
Specifically, a distance matrix is adoptedQuantifying the spatial relationship between nodes, and the expression of the distance matrix is:
Where d ij is the distance between nodes v i,vj, each element Representing the correlation between node i and node j based on distance computation, exp is an exponential function, for undirected graph,The method is a symmetric matrix, eta is an attenuation parameter used for adjusting the range of distance influence, and through an attenuation function, the correlation of space dimension among nodes can be considered as long as the geographic distance is within a certain range even though the nodes are relatively far away.
Step 1.4, introducing self-loop connection into each node, integrating node information and adjacent node information thereof, wherein the expression is as follows:
Wherein, the The method is based on the output characteristics of the nodes after convolution fusion calculation processing of the distance graph, wherein W d is a weight matrix capable of learning, and H in is the input node characteristics; a degree matrix which is a diagonal matrix calculated according to the distance matrix, wherein the elements on the diagonal line are the degree matrix Is the degree of the node i, namely the sum of the weights of the edges directly connected with the node i, byCarrying out normalization processing to balance the influence of the degree difference of different nodes on feature propagation; And beta 1 and beta 2 are super parameters, and respectively represent the importance of the characteristics of the node itself and the characteristics of the adjacent nodes in the output characteristics.
Specifically, the self-loop connection is introduced into each node, the characteristic information of the node is maintained, the influence of adjacent nodes is considered while the characteristic is updated, and therefore the information of the node and the information of adjacent nodes are integrated.
Step 1.5, constructing a time-varying side weight topological graph, wherein the expression is as follows:
Wherein, the The matrix element values are mapped between-1 and 1 to control the output intensity of an activation function, alpha is a super parameter used for adjusting the saturation of the activation function to control the sensitivity of a model to the connection intensity between nodes in a graph structure, X se is a dynamic embedded vector of a source node, and X te is a dynamic embedded vector of a target node; is a transpose of the dynamic embedded vector of the target node.
Specifically, at time t, the hidden state H t-1 and the current node value X t are spliced, the integrated characteristic representation obtained after splicing is used as input, after the integrated characteristic representation is sent into a graph convolution neural network, the output of the neural network and the learnable distance graph node embedding vector subjected to random initialization are subjected to bit multiplication operation, and dynamic node embedding with the dimension of N is generated. The time-varying edge topology node embedding operation has X se for the source node and X te for the target node. Then obtaining the adjacency matrix of the time-varying side weight topological graph through the similarity between node embedding of the time-varying side weight topological graph
Step 1.6, generating a multi-time step diagram by using a dynamic time regularization method to calculate similarity between time sequences, wherein the expression is as follows:
Wherein, the The method is characterized by comprising the steps of calculating a distance for a multi-time step chart, calculating a distance for a similarity measure between traditional time sequences by using DTW, and controlling the attenuation rate of a dynamic time warping distance by using a parameter kappa.
Specifically, for each time step, a multi-time step similarity matrix is created, which is expressed at the current time step asThe matrix (i.e., a multi-time-step graph) is used to calculate the similarity between each node from the time beginning to the current time step t, and for each element (i, j) in the matrix, calculate the similarity between nodes v i and v j at each time step t '(0. Ltoreq.t'. Ltoreq.t).
It will be appreciated that Dynamic Time Warping (DTW) is a method of measuring the similarity of two time series, and is particularly well suited to deal with differences due to time offsets or long dyssynchrony. The basic principle is to evaluate the similarity of two time series by non-linearly aligning them and finding the best matching path between them. Dynamic time warping allows the time series to be non-linearly deformed on the time axis, stretching or compressing certain parts so that the two time series can be better aligned. The distances between each time point are calculated recursively and accumulated to finally find a shortest matching path. The accumulated distance corresponding to the path reflects the similarity between the two sequences, and a smaller distance indicates a higher similarity.
And 2, fusing the distance map, the time-varying side weight topological map and the multi-time step map to obtain an adaptive topological map, wherein the adaptive topological map is used as an encoder to encode the extracted time features and the extracted space features.
In an alternative embodiment, step 2 comprises:
Step 2.1, fusing the distance map and the time-varying side weight topological map through a weighted fusion strategy, wherein the fusion process has the expression:
Wherein, the The distance map and the variable-edge-weight topological map are fused; a degree matrix for the time-varying side weight topology map; The whole weighted fusion process is regulated through super parameter beta 123, beta 123 is super parameter, and the contribution degree of the self-loop connection, the distance graph and the time-varying side weight topological graph in the output characteristic representation is represented respectively; is a time-varying side weight topology graph at time t.
Step 2.2, introducing super parameter beta 4, representing the contribution degree of the multi-time step diagram to the final fusion diagram characteristic representation, and obtaining a self-adaptive topological diagram, wherein the expression is as follows:
wherein H out is an adaptive topological graph, and H t is a hidden state at time t.
So far, the modeling of the self-adaptive topological graph for representing the final characteristic representation after the multi-graph fusion operation is completed, which can be simply described as:
Further, the matrix multiplication operation in the conventional gate-controlled loop unit (GRU) can be replaced by the multi-graph fusion calculation operation in the above steps, and the calculation formula is as follows:
Wherein, the AndRepresenting multiple graph fusion operations applied in different gating and state updating processes, respectively, specifically, changing matrix operation items of 'following new gate', 'resetting gate' and 'current hidden state' in a traditional gating circulation unit into the three graph fusion operation itemsAnd
The method comprises the steps of defining a basic graph structure comprising node sets and edge sets, using a matrix to represent weights of edges, recording space relations among nodes, generating a distance graph adjacent matrix based on an exponential decay function of node geographic distances to obtain a constructed distance graph structure quantifying space relations among nodes, introducing self-loop connection to the graph structure to reserve self characteristics, integrating information of the nodes and adjacent nodes through graph fusion convolution calculation operation, and obtaining preliminary space-time characteristic representation of the nodes.
The method comprises the steps of establishing a preliminary fusion graph of a distance graph and a time-varying side weight topological graph, combining a hidden state at the previous moment with a current node value at each time step, inputting a graph convolution neural network, embedding and calculating an adjacent matrix of the time-varying side weight topological graph based on the time-varying side weight topological graph nodes, normalizing similarity among nodes by using an activation function, adjusting sensitivity of a model to connection strength in the graph, combining characteristic information of the distance graph and the time-varying side weight topological graph, and generating a preliminary fusion graph representation through a weighted fusion strategy, wherein weight is adjusted by super parameters.
And 3, performing space-time embedded modeling on the coded time features and the spatial features to obtain comprehensive space-time features.
In an alternative embodiment, step 3 comprises:
Step 3.1, performing result conversion on the encoded time characteristics and space characteristics by utilizing single-heat encoding to generate time embedding and space embedding respectively;
and 3.2, integrating time embedding and space embedding to obtain comprehensive space-time characteristics, wherein the expression is as follows:
Wherein, the To integrate the space-time characteristics, a result tensor is embedded in real time space; is space embedded; Is time embedded.
Specifically, by using one-hot encoding (one-hot), the encoding result is converted through a two-layer fully connected neural network to generate an embedded result vector in the time dimensionWherein D represents the embedded dimension. The spatial data of node v i at time t is processed through a similar neural network to produce an embedded result vector in the spatial dimensionIntegrating the embedded vector in the time dimension with the embedded vector in the space dimension to obtain a space-time embedded result tensor after integrating the two dimensions
And 4, constructing a decoder, decoding the comprehensive space-time characteristics through the decoder to obtain a preliminary prediction result, and weighting and fusing the characteristic information of the encoder and the decoder by adopting a turning attention mechanism so as to establish a mapping relation of the space-time characteristics between the encoder and the decoder.
In an alternative embodiment, step 4 includes:
Step 4.1, constructing a decoder, and decoding the comprehensive space-time characteristics through the decoder to obtain a preliminary prediction result;
Modeling the connection between the encoder and the decoder by adopting a distraction mechanism, wherein the expression is as follows:
Wherein ε i,t(t1,t2) is the attention score, e i,t′ is the space-time embedding processed by the ReLU activation function, t 1 and t 2 are both time nodes, W is the weight, b is the deviation parameter, and [ in ], [ in ] is the vector inner product; For scaling factors, by scaling factors The effect of the increase in dimension is controlled to prevent the model from entering the low gradient region.
In particular, a transition-Attention mechanism (transition) is used to model the link between the encoder (recorded values) and the decoder (predicted results). For node i at time t, a similarity score between times t 1 and t 2 is calculated according to the turn attention mechanism to model the feature internal relationship.
Step 4.3, the decoder performs weighted summation on the hidden states of the previous time points according to the attention score, and the expression is as follows:
Wherein, T 2 = t..a., T-1; σ (·) is a normalized exponential function, and the attention score is normalized by the normalized exponential function to ensure that the score sum is 1;W h as a weight parameter of the network in the decoder, b h as a bias parameter, ε t as an attention score; Is the hidden state at time t 1.
The method is based on the principle that space-time embedding modeling is firstly carried out on nodes based on time and space data to generate space-time tensors, wherein a transfer meaning mechanism (transducer-attention) is used for establishing a mapping relation of space-time characteristics between an encoder and a decoder, similarity scores between time steps are calculated, weighted summation is carried out on hidden states of the decoder, and finally weighted prediction information in two dimensions of space and time is generated.
And 5, adaptively determining the optimal prediction time of each node in the adaptive topological graph through the reinforcement learning control module, generating a prediction motion vector, and obtaining a prediction result according to the prediction motion vector and the preliminary prediction result.
In an alternative embodiment, step 5 comprises:
Step 5.1, adaptively determining the optimal prediction time of each node in the adaptive topological graph through the reinforcement learning control module, wherein the optimal prediction time can be expressed as
Specifically, the optimal prediction time is an earlier prediction time which can give consideration to both the accuracy and timeliness of prediction, so that not only can the preparation for treatment be made in advance, but also the high accuracy of the prediction result can be ensured.
And 5.2, optimizing a prediction strategy based on the current state and the current strategy by a reinforcement learning control module, wherein the expression is as follows:
pt=σ(WcSt+bc) (12);
at=π(St) (13);
Wherein p t is the pause probability, W c is the weight parameter of the reinforcement learning control module, sigma is the activation function, b c is the deviation parameter of the reinforcement learning control module, S t is the current state, S t∈RN×(H+1);at is the predicted motion vector indicating the optimal predicted time, and pi is the current strategy.
Further, the epsilon greedy strategy can be applied to continue optimizing the prediction strategy after the step 5.2, and the expression is as follows:
In particular, the greedy strategy follows the greedy strategy (i.e., the current optimal action is selected) in most cases, but a random action is selected with a small probability ε to ensure a certain exploration. The epsilon greedy strategy can avoid sinking into local optimum, and gradually explore larger state space, so that a better strategy is found.
And 5.3, multiplying the prediction motion vector and the nonlinear transformation result of the hidden state element by element to obtain a prediction result, wherein the expression is as follows:
Wherein, the W p is weight, b p is deviation parameter; Generating prediction results by a linear rectifying unit (ReLU activation function) for processing decoder output hidden states for each time step t
Further, if the predicted motion vector of a node i in all time steps is 0, the optimal predicted time of the node i is defaulted to be T-1, and a predicted result is obtainedNamely, when the maximum time window is reached, if no action is triggered, the time T-1 is taken as the optimal prediction time to obtain a prediction result
The method is based on the principle that a reinforcement learning control module calculates an action vector of the optimal prediction moment based on the current state and a strategy, an epsilon greedy strategy is applied to balance between exploration and utilization, prediction moment is determined, and a prediction value of each time step is calculated according to the decision of the reinforcement learning control module and the output of a decoder, so that the optimization of the prediction moment is realized.
And 6, combining the performance loss function, the controller loss function and the early loss function to obtain a weighted total loss function, optimizing a training model, and outputting an accurate prediction result of the traffic flow.
In an alternative embodiment, step 6 includes:
And 6.1, calculating the average absolute error between the predicted result and the true value to obtain a performance loss function, wherein the expression is as follows:
Wherein L p is a performance loss function, N is the number of nodes; X T,i is a true value;
And 6.2, calculating negative logarithm pause probability to obtain an early loss function, wherein the expression is as follows:
wherein L e is the early loss function; for each node i, calculating by a strategy pi to obtain the optimal prediction time;
And 6.3, maximizing expected rewards by using the rewards tensor to improve prediction accuracy, and obtaining a controller loss function, wherein the expression is as follows:
Wherein L c is a controller loss function, E represents the desire of the bracket interior, b t′ is a base line, the base line b t′ is obtained by minimizing the mean square error learning between the base line b t′ and the integral rewards r depending on the hidden state S t of the controller, S t is a hidden state, r t' is an updated rewards, r is an integral rewards;
And 6.4, obtaining a weighted loss function through the super parameters according to the performance loss function, the early loss function and the controller loss function, wherein the expression is as follows:
L=Lp1Lc2Le (21);
Wherein L is a weighted loss function, and omega 1 and omega 2 are super parameters;
and 6.5, optimizing the training model according to the weighted loss function to enable the model training to converge, and obtaining the accurate prediction result of the traffic flow after the training is completed.
Specifically, combining the performance, timeliness and controller loss, and calculating to obtain a weighted loss function L through super parameters omega 1 and omega 2:
The expression of the mean absolute error MAE is:
The expression of the root mean square error RMSE is:
The expression for the mean absolute percentage error MAPE is:
Specifically, training and optimizing the model by considering the prediction precision, the prediction timeliness and the comprehensive loss function formed by the rewards multiple aspects generated by the control module until the model converges to obtain a prediction output result.
The method is based on the principle that model performance loss, early prediction loss and controller loss are modeled, the three loss functions are integrated into a total loss function in a weighting mode, wherein the weight is controlled by super parameters, then the super parameters such as initial learning rate, batch size and node embedding dimension are set through an adaptive moment estimation optimizer (Adam) training model, finally verification set errors are monitored by adopting an early stopping mechanism until the model converges, and a model capable of carrying out traffic flow adaptive prediction output in a complex traffic scene is obtained, so that model training and optimization are realized.
It can be understood that by adopting the traffic flow self-adaptive prediction method based on the multi-time step diagram, other model training methods, such as gradient descent optimization training, small batch training, RMSProp self-adaptive optimization training and the like, can be used after the prediction model is obtained, so that the training optimization process of the model is not limited in the invention.
For example, the initial learning rate is configured to be 0.001, the convolution layer depth of the multi-map fusion is 1, the hidden state H is set to 32, the node embedding dimension D is set to 40, the batch size is set to 32, the maximum observation window length T is selected to be 12, the super-parameters β 1234 are set to 0.05,0.95,0.95 and 0.95, respectively, and the loss function weight super-parameter ω 12 is set to 1 and between 0 and 0.1, respectively. The training process adopts an advanced stopping mechanism, an adaptive moment estimation optimizer (Adam) is selected as a model training tool, and training is performed on an Injettia GeForce RTX 3070Ti high-performance computing platform. And when the model training converges, obtaining a model with the final training completed, and outputting a traffic flow prediction result.
The data adopted by the simulation experiment of the invention is a public transportation speed data set collected by a los Angeles highway annular detector, and the data collected by 207 selected sensors is included, and the sampling rate is 5 minutes. The time span is from 3 months in 2012 to 1 month in 2012 to 30 months in 6 years, providing insight into the traffic patterns and congestion conditions in los Angeles areas, and being an ideal choice for evaluating the model in terms of traffic flow prediction accuracy. The results are shown in table 1 by comparing the frame of the present invention with the following baselines.
TABLE 1 Performance indicators of different models on datasets
Table 1 shows the prediction based on the present invention and other comparative baselines on the public transportation speed dataset collected by the los angeles circular detector, i.e. the comparison result of three indexes of average absolute error, root mean square error and average absolute percentage error at the same average optimal prediction time. As can be seen from the prediction results of the table 1, the traffic flow self-adaptive prediction method based on the multi-time step diagram can accurately realize the traffic flow prediction of the public traffic speed data set acquired by the los Angeles expressway annular detector, so that the optimal performance with statistical significance can be obtained in all evaluation indexes by adopting the traffic flow self-adaptive prediction model based on the multi-time step diagram.
The traffic flow self-adaptive prediction method based on the multi-time step diagram also has the following advantages:
(1) Dynamic space-time feature capturing capability the model of the invention realizes the effective modeling of space-time features by combining a distance graph and a time-varying side weight topological graph through a multi-graph fusion convolution calculation module. Compared with other prior art, the time-varying side weight topological graph has the advantages that the relationship among nodes is updated in real time, so that complex time-space association in traffic flow data is more easily captured compared with a single graph structure, and the time-varying side weight topological graph is particularly suitable for scenes with rapid traffic flow changes.
(2) The self-adaptive prediction time is determined, namely, the model can self-adaptively determine the optimal prediction time for each node through the reinforcement learning control module. Compared with the traditional method of fixed prediction time, the adaptive strategy is adopted to effectively reduce the prediction error caused by data delay, and the timeliness of prediction is superior to that of the prior art.
(3) The error propagation suppressing mechanism establishes strong correlation between the encoder and the decoder by using a distraction mechanism, and effectively relieves the problem of error accumulation in long-time sequence prediction by weighting and calculating important characteristics, so that compared with the technology in the field, the method and the device can fully guarantee and enhance the stability and the accuracy of prediction.
(4) And the multi-graph depth fusion is realized by a multi-level fusion mechanism of a distance graph, a time-varying side weight topological graph and a multi-time step graph, so that the model can be flexibly adapted to the characteristics of different time nodes and space positions. The method and the device can not be realized by a single graph structure, and the self-adaptive topological graph after multi-graph fusion can realize good balance between global structural stability and local dynamic change by self-adaptively adjusting the weights of the distance graph and the time-varying side weight topological graph through the super-parameters, so that hidden characteristic information between multiple nodes and multiple time step graphs can be more fully utilized, which is neglected in the prior art.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the traffic flow self-adaptive prediction method based on the multi-time step map when executing the computer program.
The invention also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a traffic flow adaptive prediction method based on a multi-time step map.
According to the traffic flow self-adaptive prediction method based on the multi-time step diagram, a self-adaptive topological diagram network is obtained by fusing a distance diagram, a time-varying side weight topological diagram and a multi-time step diagram, a attention turning mechanism is introduced, a prediction technology combining the attention turning mechanism and the self-adaptive topological diagram network is designed by utilizing a reinforcement learning control module, comprehensive capture of time-space dynamic characteristics, effective alleviation of prediction errors and self-adaptive determination of optimal prediction time are realized, and therefore, the timeliness and reliability of prediction are remarkably improved while the prediction accuracy is ensured.
The invention inputs the real-time data sample collected by the sensor into the model, the self-adaptive topological graph network is used as an encoder to extract data characteristics, the output of the encoder is used for initializing the decoder, the reinforcement learning control module judges whether the current moment meets the condition of the optimal step length according to the network hiding state output by the decoder, if so, a prediction result is generated and is used as a final prediction result, namely, the number of vehicles passing in each sensor area in a future time period. Through the steps, the method can effectively improve the prediction accuracy and timeliness of traffic flow, and particularly when complex urban traffic data is processed, the method has higher prediction accuracy and flexibility than the traditional method.
It should be noted that in this document relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that an article or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in an article or apparatus that comprises the element. The terms "connected" or "connected," and the like, are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The orientation or positional relationship indicated by "upper", "lower", "left", "right", etc. is based on the orientation or positional relationship shown in the drawings, and is merely for convenience of description and to simplify the description, and is not indicative or implying that the apparatus or elements referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as limiting the invention.
The foregoing is a further detailed description of the invention in connection with the preferred embodiments, and it is not intended that the invention be limited to the specific embodiments described. It will be apparent to those skilled in the art that several simple deductions or substitutions may be made without departing from the spirit of the invention, and these should be considered to be within the scope of the invention.

Claims (10)

1.一种基于多时间步长图的交通流量自适应预测方法,其特征在于,包括:1. A traffic flow adaptive prediction method based on a multi-time step graph, characterized by comprising: 获取交通传感器数据,分别构建距离图、时变边权拓扑图及多时间步长图,以分别提取时间特征与空间特征;Obtain traffic sensor data, and construct distance graph, time-varying edge weight topology graph, and multi-time step graph to extract temporal and spatial features respectively; 融合所述距离图、所述时变边权拓扑图及所述多时间步长图得到自适应拓扑图,其中,通过自适应拓扑图作为编码器对提取的所述时间特征与所述空间特征进行编码;The distance graph, the time-varying edge weight topology graph and the multi-time step graph are integrated to obtain an adaptive topology graph, wherein the extracted time features and the extracted spatial features are encoded by using the adaptive topology graph as an encoder; 对编码后的所述时间特征与所述空间特征进行时空嵌入建模,得到综合时空特征;Performing spatiotemporal embedding modeling on the encoded temporal features and the spatial features to obtain comprehensive spatiotemporal features; 构建解码器,通过所述解码器对所述综合时空特征进行解码,得到初步预测结果,采用转注意力机制加权融合所述编码器与所述解码器的特征信息,以在所述编码器与所述解码器之间建立时空特征的映射关系;Constructing a decoder, decoding the comprehensive spatiotemporal features through the decoder to obtain a preliminary prediction result, and using a transfer attention mechanism to weightedly fuse the feature information of the encoder and the decoder to establish a mapping relationship between the spatiotemporal features between the encoder and the decoder; 通过强化学习控制模块,自适应确定所述自适应拓扑图中每个节点的最佳预测时刻,生成预测动作向量,并根据所述预测动作向量与所述初步预测结果得到预测结果;Adaptively determine the best prediction moment for each node in the adaptive topology graph through a reinforcement learning control module, generate a prediction action vector, and obtain a prediction result based on the prediction action vector and the preliminary prediction result; 结合性能损失函数、控制器损失函数及早期损失函数得到加权总损失函数,优化训练模型,输出交通流量的精确预测结果。The performance loss function, controller loss function and early loss function are combined to obtain the weighted total loss function, optimize the training model, and output accurate prediction results of traffic flow. 2.根据权利要求1所述的基于多时间步长图的交通流量自适应预测方法,其特征在于,所述获取交通传感器数据,分别构建距离图、时变边权拓扑图及多时间步长图,以分别提取时间特征与空间特征,包括:2. The method for adaptively predicting traffic flow based on a multi-time-step graph according to claim 1 is characterized in that the acquisition of traffic sensor data, respectively constructing a distance graph, a time-varying edge weight topology graph and a multi-time-step graph to extract temporal features and spatial features respectively, comprises: 获取交通传感器数据,所述交通传感器数据包括时间信息和空间信息;Acquiring traffic sensor data, wherein the traffic sensor data includes time information and space information; 构建图结构,所述图结构中包含若干个节点;Constructing a graph structure, wherein the graph structure includes a plurality of nodes; 采用距离矩阵量化所述节点之间的空间关系,以生成距离图;A distance matrix is used to quantify the spatial relationship between the nodes to generate a distance graph; 将自环连接引入每个节点,整合节点信息及其邻接节点信息,其表达式为:Introduce self-loop connections into each node, integrate node information and its adjacent node information, and the expression is: 其中,是基于距离图的卷积融合计算处理后节点的输出特征;Wd是可学习的权重矩阵;Hin是输入的节点特征;为度矩阵,度矩阵为根据距离矩阵计算得到的对角矩阵,其对角线上的元素为节点i的度数,即与节点i直接相连的边的权重之和;通过进行归一化处理,平衡不同节点的度数差异对特征传播的影响;As表示节点之间基于距离计算的相关性;β1和β2为超参数,分别表示节点自身特征与邻近节点特征在输出特征中的重要性;in, is the output feature of the node after the convolution fusion calculation based on the distance graph; Wd is the learnable weight matrix; Hin is the input node feature; is the degree matrix, which is a diagonal matrix calculated based on the distance matrix, and its diagonal elements is the degree of node i, that is, the sum of the weights of the edges directly connected to node i; Normalization is performed to balance the impact of degree differences of different nodes on feature propagation; As represents the correlation between nodes based on distance calculation; β1 and β2 are hyperparameters, which respectively represent the importance of node features and neighboring node features in the output features; 构建时变边权拓扑图,其表达式为:Construct a time-varying edge weight topology graph, whose expression is: 其中,为时变边权拓扑图;ReLU函数为确保输出矩阵的元素为非负值的函数;tanh函数为将矩阵元素值进行标准化处理的函数;α为超参数,用于调节激活函数的饱和度;Xse为源节点的动态嵌入向量;Xte为目标节点的动态嵌入向量;为目标节点的动态嵌入向量的转置;in, is a time-varying edge weight topology graph; the ReLU function is a function that ensures that the elements of the output matrix are non-negative; the tanh function is a function that standardizes the values of matrix elements; α is a hyperparameter used to adjust the saturation of the activation function; Xse is the dynamic embedding vector of the source node; Xte is the dynamic embedding vector of the target node; is the transpose of the dynamic embedding vector of the target node; 使用动态时间规整方法生成多时间步长图,以计算时间序列间的相似性,其表达式为:The dynamic time warping method is used to generate a multi-time step graph to calculate the similarity between time series. The expression is: 其中,为多时间步长图;DTW为传统时间序列间的相似性度量计算距离;参数κ用于控制动态时间规整距离的衰减速率。in, is a multi-time step graph; DTW is a similarity measure between traditional time series to calculate the distance; the parameter κ is used to control the decay rate of the dynamic time warping distance. 3.根据权利要求1所述的基于多时间步长图的交通流量自适应预测方法,其特征在于,融合所述距离图、所述时变边权拓扑图及所述多时间步长图得到自适应拓扑图,包括:3. The method for adaptive traffic flow prediction based on a multi-time-step graph according to claim 1, characterized in that the adaptive topological graph is obtained by fusing the distance graph, the time-varying edge weight topological graph and the multi-time-step graph, comprising: 通过加权融合策略融合所述距离图和所述时变边权拓扑图,其表达式为:The distance graph and the time-varying edge weight topology graph are fused by a weighted fusion strategy, and the expression is: 其中,为融合后的所述距离图和所述变边权拓扑图;为时变边权拓扑图的度矩阵;为距离图的度矩阵,进行了归一化处理;整个加权融合过程通过超参数β123进行调节,β123均为超参数,分别代表自环连接、距离图和时变边权拓扑图在输出的特征表示中的贡献度;I为单位矩阵;为时刻t处的时变边权拓扑图;in, The distance graph and the variable edge weight topological graph are fused; is the degree matrix of the time-varying edge weight topological graph; is the degree matrix of the distance graph, which is normalized. The whole weighted fusion process is adjusted by hyperparameters β 1 , β 2 , β 3. β 1 , β 2 , β 3 are all hyperparameters, representing the contribution of self-loop connection, distance graph and time-varying edge weight topology graph in the output feature representation respectively. I is the unit matrix. is the time-varying edge weight topological graph at time t; 引入超参数β4,表征所述多时间步长图对最终融合图特征表示的贡献度,得到自适应拓扑图,其表达式为:A hyperparameter β 4 is introduced to characterize the contribution of the multi-time step graph to the feature representation of the final fusion graph, and an adaptive topology graph is obtained, which is expressed as: 其中,Hout为自适应拓扑图;Ht为时刻t的隐藏状态。Among them, H out is the adaptive topology map; H t is the hidden state at time t. 4.根据权利要求1所述的基于多时间步长图的交通流量自适应预测方法,其特征在于,对编码后的所述时间特征与所述空间特征进行时空嵌入建模,得到综合时空特征,包括:4. The method for adaptive traffic flow prediction based on a multi-time step graph according to claim 1 is characterized in that the encoded time features and the spatial features are subjected to spatiotemporal embedding modeling to obtain comprehensive spatiotemporal features, including: 利用独热编码,对编码后的所述时间特征与所述空间特征进行结果转换,分别生成时间嵌入与空间嵌入;Using one-hot encoding, the encoded time features and the encoded space features are converted to generate time embedding and space embedding respectively; 集成所述时间嵌入和所述空间嵌入,得到综合时空特征,其表达式为:The time embedding and the space embedding are integrated to obtain a comprehensive spatiotemporal feature, which is expressed as: 其中,为综合时空特征;为空间嵌入;为时间嵌入。in, To integrate spatiotemporal characteristics; for spatial embedding; Embedded for time. 5.根据权利要求1所述的基于多时间步长图的交通流量自适应预测方法,其特征在于,构建解码器,通过所述解码器对所述综合时空特征进行解码,得到初步预测结果,采用转注意力机制加权融合所述编码器与所述解码器的特征信息,以在所述编码器与所述解码器之间建立时空特征的映射关系,包括:5. The method for adaptive traffic flow prediction based on a multi-time step graph according to claim 1 is characterized in that a decoder is constructed, the comprehensive spatiotemporal features are decoded by the decoder to obtain a preliminary prediction result, and a transfer attention mechanism is used to weightedly fuse the feature information of the encoder and the decoder to establish a mapping relationship between the spatiotemporal features between the encoder and the decoder, including: 构建解码器,通过所述解码器对所述综合时空特征进行解码,得到初步预测结果;Constructing a decoder, decoding the comprehensive spatiotemporal features through the decoder to obtain a preliminary prediction result; 采用转注意力机制对编码器与解码器之间的联系进行建模,其表达式为:The attention mechanism is used to model the connection between the encoder and the decoder, which is expressed as: 其中,εi,t(t1,t2)为注意力分数;ei,t′为通过ReLU激活函数处理后的时空嵌入;t1和t2均为时间节点;W为权重;b为偏差参数;<·,·>为向量内积;为缩放因子;Where ε i,t (t 1 ,t 2 ) is the attention score; e i,t′ is the spatiotemporal embedding after ReLU activation function; t 1 and t 2 are both time nodes; W is the weight; b is the bias parameter; <·,·> is the vector inner product; is the scaling factor; 解码器根据注意力分数对前一段时间点的隐藏状态进行加权求和,其表达式为:The decoder performs a weighted summation of the hidden states at the previous time point according to the attention score, and its expression is: 其中,t2=t,…,T-1;σ(·)为归一化指数函数;Wh为解码器中网络的权重参数;bh为偏差参数;εt为注意力分数;为时刻t1的隐藏状态。Where, t 2 = t,…,T-1; σ(·) is the normalized exponential function; W h is the weight parameter of the network in the decoder; b h is the bias parameter; ε t is the attention score; is the hidden state at time t1. 6.根据权利要求1所述的基于多时间步长图的交通流量自适应预测方法,其特征在于,通过强化学习控制模块,自适应确定所述自适应拓扑图中每个节点的最佳预测时刻,生成预测动作向量,并根据所述预测动作向量与所述初步预测结果得到预测结果,包括:6. The method for adaptive traffic flow prediction based on a multi-time-step graph according to claim 1 is characterized in that, through a reinforcement learning control module, the optimal prediction time of each node in the adaptive topology graph is adaptively determined, a prediction action vector is generated, and a prediction result is obtained according to the prediction action vector and the preliminary prediction result, including: 通过强化学习控制模块,自适应确定所述自适应拓扑图中每个节点的最佳预测时刻;Adaptively determine the best prediction time for each node in the adaptive topology graph through a reinforcement learning control module; 通过强化学习控制模块,基于当前状态和当前策略,优化预测策略,其表达式为:Through the reinforcement learning control module, based on the current state and current strategy, the prediction strategy is optimized, and its expression is: pt=σ(WcSt+bc);p t =σ(W c S t +b c ); at=π(St);a t =π(S t ); 其中,pt为暂停概率;Wc为强化学习控制模块的权重参数;σ为激活函数;bc为强化学习控制模块的偏差参数;St为当前状态;at为指示最佳预测时刻的预测动作向量;π为当前策略;Where pt is the pause probability; Wc is the weight parameter of the reinforcement learning control module; σ is the activation function; bc is the bias parameter of the reinforcement learning control module; St is the current state; at is the predicted action vector indicating the best prediction moment; π is the current strategy; 将预测动作向量与隐藏状态的非线性变换结果逐元素相乘,得到预测结果,其表达式为:The predicted action vector is multiplied element by element by the nonlinear transformation result of the hidden state to obtain the predicted result, which is expressed as: 其中,为预测结果;Wp为权重;bp为偏差参数;为处理每个时间步t的解码器输出隐藏状态。in, is the prediction result; W p is the weight; bp is the bias parameter; Output the hidden state for the decoder at each time step t. 7.根据权利要求6所述的基于多时间步长图的交通流量自适应预测方法,其特征在于,如果某节点i在所有时间步中的预测动作向量均为0,则该节点的最佳预测时间默认为T-1,得到预测结果 7. The method for adaptive traffic flow prediction based on multi-time step graph according to claim 6 is characterized in that if the predicted action vector of a node i in all time steps is 0, the best prediction time of the node is defaulted to T-1, and the prediction result is obtained 8.根据权利要求1所述的基于多时间步长图的交通流量自适应预测方法,其特征在于,结合性能损失函数、控制器损失函数及早期损失函数得到加权总损失函数,优化训练模型,输出交通流量的精确预测结果,包括:8. The method for adaptively predicting traffic flow based on a multi-time step graph according to claim 1 is characterized in that a weighted total loss function is obtained by combining a performance loss function, a controller loss function and an early loss function, the training model is optimized, and an accurate prediction result of traffic flow is output, including: 计算预测结果与真实值之间的平均绝对误差,得到性能损失函数,其表达式为:Calculate the mean absolute error between the predicted result and the true value to get the performance loss function, which is expressed as: 其中,Lp为性能损失函数;N为节点数量;XT,i为真实值;Where Lp is the performance loss function; N is the number of nodes; X T,i is the true value; 计算负对数暂停概率,得到早期损失函数,其表达式为:Calculate the negative log pause probability and get the early loss function, which is expressed as: 其中,Le为早期损失函数;为对于每个节点i而言,通过策略π计算,得到的最佳预测时间;Among them, Le is the early loss function; is the best prediction time calculated by strategy π for each node i; 利用奖励张量,最大化期望奖励以提升预测精度,得到控制器损失函数,其表达式为:Using the reward tensor, we maximize the expected reward to improve the prediction accuracy and get the controller loss function, which is expressed as: 其中,Lc为控制器损失函数;E表示对括号内子式求期望;bt′为基线;St为隐藏状态;rt'为更新后的奖励;r为整体奖励;Where L c is the controller loss function; E represents the expectation of the sub-formula in the brackets; b t′ is the baseline; S t is the hidden state; r t ' is the updated reward; r is the overall reward; 根据所述性能损失函数、所述早期损失函数和所述控制器损失函数,通过超参数得到加权损失函数,其表达式为:According to the performance loss function, the early loss function and the controller loss function, a weighted loss function is obtained through hyperparameters, and its expression is: L=Lp1Lc2LeL=L p1 L c2 L e ; 其中,L为加权损失函数;ω1和ω2为超参数;Where L is the weighted loss function; ω 1 and ω 2 are hyperparameters; 根据加权损失函数优化训练模型,使模型训练收敛,得到训练完成的并输出交通流量的精确预测结果。The training model is optimized according to the weighted loss function to make the model training converge, and the training is completed and the accurate prediction results of traffic flow are output. 9.一种电子设备,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至8任一项所述的基于多时间步长图的交通流量自适应预测方法。9. An electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for adaptively predicting traffic flow based on a multi-time-step graph as described in any one of claims 1 to 8 is implemented. 10.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至8任一项所述的基于多时间步长图的交通流量自适应预测方法。10. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for adaptively predicting traffic flow based on a multi-time-step graph as claimed in any one of claims 1 to 8 is implemented.
CN202510224957.2A 2025-02-27 2025-02-27 An adaptive traffic flow prediction method based on multi-time step graph Pending CN120260263A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202510224957.2A CN120260263A (en) 2025-02-27 2025-02-27 An adaptive traffic flow prediction method based on multi-time step graph

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202510224957.2A CN120260263A (en) 2025-02-27 2025-02-27 An adaptive traffic flow prediction method based on multi-time step graph

Publications (1)

Publication Number Publication Date
CN120260263A true CN120260263A (en) 2025-07-04

Family

ID=96193888

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202510224957.2A Pending CN120260263A (en) 2025-02-27 2025-02-27 An adaptive traffic flow prediction method based on multi-time step graph

Country Status (1)

Country Link
CN (1) CN120260263A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120785662A (en) * 2025-09-11 2025-10-14 湖北大学 Method and device for detecting abnormal cooperative attack of Internet of vehicles

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120785662A (en) * 2025-09-11 2025-10-14 湖北大学 Method and device for detecting abnormal cooperative attack of Internet of vehicles

Similar Documents

Publication Publication Date Title
CN109583565B (en) Flood prediction method based on attention model long-time and short-time memory network
CN108986470A (en) The Travel Time Estimation Method of particle swarm algorithm optimization LSTM neural network
CN118035777A (en) Air pollutant concentration prediction method and device based on spatiotemporal graph data
CN106709588B (en) Prediction model construction method and device and real-time prediction method and device
CN117152427A (en) Remote sensing image semantic segmentation method and system based on diffusion model and knowledge distillation
CN116311921B (en) Traffic speed prediction method based on multi-spatial scale space-time converter
CN113920379B (en) A knowledge-assisted zero-shot image classification method
CN115759461A (en) Internet of things-oriented multivariate time sequence prediction method and system
CN119066712B (en) Privacy protection method and device for sparse traffic flow prediction based on cloud-edge-end collaboration
CN117852701B (en) Traffic flow prediction method and system based on characteristic attention mechanism
CN114065996A (en) Traffic flow prediction method based on variational self-coding learning
CN116187835A (en) A data-driven method and system for estimating theoretical line loss intervals in station areas
CN115240871B (en) A method for epidemic prediction based on deep embedding clustering meta-learning
CN116959258A (en) A traffic flow prediction method based on spatiotemporal graph transfer learning
CN120260263A (en) An adaptive traffic flow prediction method based on multi-time step graph
CN117217381A (en) An attribute-enhanced perceptual sequential graph convolutional network traffic speed prediction method
CN114821337A (en) A method for extracting built-up area from semi-supervised SAR images based on temporally consistent pseudo-labels
CN119066348A (en) A water bloom prediction model and method based on multi-scale temporal convolutional neural network
CN120280901A (en) Electric vehicle charging load prediction method based on user behavior analysis
CN117437786B (en) A short-term traffic flow prediction method in real-time traffic network based on artificial intelligence
CN120277636A (en) Time-varying pore water pressure perception prediction method
CN116561697B (en) Method and device for long-term prediction of sensor data integrating multiple source factors
CN118886801A (en) Construction method of traffic flow prediction model and traffic flow prediction method
CN113869614B (en) A Pedestrian Flow Early Prediction Method Based on Spatio-temporal Graph Convolution
Selvaraj et al. An optimal model using single-dimensional CAE-IRNN based SPOA for cyclone track prediction

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination