CN114282165B - Method and device for reversely deducing OD matrix by double-layer deep learning model and storage medium - Google Patents

Method and device for reversely deducing OD matrix by double-layer deep learning model and storage medium Download PDF

Info

Publication number
CN114282165B
CN114282165B CN202111503979.0A CN202111503979A CN114282165B CN 114282165 B CN114282165 B CN 114282165B CN 202111503979 A CN202111503979 A CN 202111503979A CN 114282165 B CN114282165 B CN 114282165B
Authority
CN
China
Prior art keywords
matrix
layer
node
distribution probability
nodes
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.)
Active
Application number
CN202111503979.0A
Other languages
Chinese (zh)
Other versions
CN114282165A (en
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.)
Yangtze River Delta Information Intelligence Innovation Research Institute
Original Assignee
Yangtze River Delta Information Intelligence Innovation Research Institute
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 Yangtze River Delta Information Intelligence Innovation Research Institute filed Critical Yangtze River Delta Information Intelligence Innovation Research Institute
Priority to CN202111503979.0A priority Critical patent/CN114282165B/en
Publication of CN114282165A publication Critical patent/CN114282165A/en
Application granted granted Critical
Publication of CN114282165B publication Critical patent/CN114282165B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Traffic Control Systems (AREA)

Abstract

The invention discloses a method, a device and a storage medium for reversely deducing an OD matrix by a double-layer deep learning model, wherein the method comprises the following steps: automatically dividing OD nodes, initializing an OD parameter matrix, adopting a simulator to extract total traffic of the segments between the simulated OD nodes in parallel, and simulating a historical attribute sequence of the OD nodes; extracting graph structure history fusion representation by using a lower-layer distribution probability prediction model, and performing self-correlation extraction on the initial OD parameter matrix; and the method for predicting the flow distribution probability matrix by combining the characteristics is also disclosed; training a lower-layer distribution probability prediction model by adopting parallel simulation and an experience pool to store simulation data, fixing the model after convergence, and correcting an upper-layer OD parameter matrix by utilizing a real OD node historical attribute sequence and real total flow of a path section between OD nodes; and (5) iterating the upper layer and the lower layer to train until the OD matrix parameter is converged, namely, the backward-deducing OD matrix. The method constructs a deep learning model, integrates traffic space-time information, and effectively improves the accuracy of the backward-deducing OD matrix.

Description

Method and device for reversely deducing OD matrix by double-layer deep learning model and storage medium
Technical Field
The invention relates to the technical field of traffic management, in particular to a method and equipment for reversely deducing an OD matrix by a double-layer deep learning model and a storage medium.
Background
Because the traffic demand in reality is difficult to directly count and is costly. Therefore, the traffic demand between the customized OD partition areas, that is, the OD matrix, is usually deduced reversely according to the traffic information in the flow time interval, especially the total traffic of vehicles in each road section. In the traditional OD reverse-pushing technology, two types, namely an OD matrix is solved by constructing an optimization problem by taking total flow of each road section as constraint, and because constraint conditions are insufficient, the OD matrix to be solved is underdetermined, the reverse-pushing result is often far from the true OD matrix. Deep learning depends on strong information fusion and fitting capability of the model, and becomes a better choice for an OD (origin-destination) backstepping technology, but a deep learning model needs a large amount of data to train the model, and a real OD matrix is difficult to acquire, so that the label of the data in the direct learning deep learning model is difficult to acquire. This problem is not currently solved effectively. Therefore, it is necessary to invent a feasible method capable of performing the OD back-stepping task by using the deep learning model.
Disclosure of Invention
The invention aims to provide a method, equipment and a storage medium for reversely deducing an OD matrix by a double-layer deep learning model, which are used for constructing the deep learning model, fusing space-time information in a traffic process and providing more data and stronger model support for the accurate reverse deduction of the OD matrix. Meanwhile, a double-layer deep learning framework is adopted, and a traffic simulator is used for simulating to assist the training of the model, so that the difficulty that a large amount of training data required by the deep learning model is difficult to obtain is overcome. A feasible method and a feasible device for performing OD reverse-thrust tasks by using a double-layer deep learning model are established. The accuracy of the backward-pushing OD matrix is effectively improved.
In order to achieve the above object, the present invention provides a method for a two-layer deep learning model to reversely deduce an OD matrix, the method comprising:
automatically dividing OD nodes for a map, initializing an OD parameter matrix by using the divided OD nodes, adopting a simulator for parallel simulation, extracting total flow of the road sections among the simulated OD nodes from simulation data, and simulating an OD node historical attribute sequence; a method for carrying out feature fusion on the simulation OD node historical attribute sequence by utilizing a lower-layer distribution probability prediction model to obtain a graph structure fusion representation, carrying out self-correlation extraction on the initial OD parameter matrix to obtain a self-attention fusion matrix, fusing the attention fusion matrix and the graph structure fusion representation to obtain a flow distribution probability matrix for predicting the production quantity and the suction quantity of each OD node to be distributed to the road section among the OD nodes, and calculating loss and updating lower-layer distribution probability prediction model parameters by utilizing a plurality of groups of data randomly extracted by parallel simulation and an experience pool; fixing a lower layer distribution probability prediction model, and calculating loss to correct parameters of an upper layer OD parameter matrix by using a real OD node historical attribute sequence and real total flow of the road section between OD nodes; and circularly performing double-layer iterative training through a double-layer deep learning framework until the OD matrix parameters are converged, wherein the OD parameter matrix is the reversely deduced OD matrix.
Preferably, the automatic map OD node division means downloading an open source map from an open source map library including but not limited to OSM, that is, openStreetMap, reading road section intersection points therein, acquiring an ID and corresponding longitude and latitude coordinates of each intersection point as an element, forming a set by all the intersection points, and clustering the nodes according to the longitude and latitude coordinate information of the intersection points by using a clustering algorithm including but not limited to K-means to form N clusters, wherein the number N of the clusters is customized as required; each cluster is used as an OD node, and the traffic demand of each OD node pair is initialized to form an initialized OD parameter matrix T; therefore, all road sections are traversed, all road sections with two ends connected with intersection points which do not belong to the same OD node are screened as OD inter-node road sections, and the OD inter-node road section set is formed.
Preferably, the simulation by using the traffic simulator means that the simulation is performed by using a traffic simulator including, but not limited to, a SUMO traffic simulator, and the path algorithm is performed by using a distribution algorithm including, but not limited to, a DUE, i.e., a Dynamic User equivalent; obtaining simulator data on the map based on the initialized OD parameter matrix, extracting historical attribute sequences of the simulated OD nodes from the simulator data, wherein the historical attribute sequences include but are not limited to average speed in a specific time interval, the number of inflow vehicles and the number of outflow vehicles in the specific time interval, the quantity of vehicles reserved in the specific time interval, road sections and intersection points in the nodes and the like, and extracting the total flow of the road sections among the simulated OD nodes.
Preferably, the OD node history sequence divides the whole simulation time into T time intervals T to form a sequence (T) 1 ,t 2 ,……,t T ) (ii) a The node historical attribute sequence is a sequence G formed by the attributes in each time interval corresponding to the OD nodes in each time interval s And the total flow y of each road section among the simulated OD nodes s The total number of vehicles passing through the road sections among the OD nodes is determined after the traffic flow of the whole demand is finished.
Preferably, the lower layer assignment probability prediction model includes: extracting the Self-correlation characteristics from the OD parameter matrix to obtain a Self-Attention fusion matrix X Self-Attention module, and obtaining an OD node historical attribute sequence G s The method comprises the steps of performing sequence feature extraction to output a graph structure fusion representation H, splicing a self-attention fusion matrix and the graph structure fusion representation H according to nodes to obtain a splicing matrix, and transforming and expanding dimensions of each node of the splicing matrix through two Linear layers of Linear-P and Linear-A, so that the vector dimension of each node in the fusion matrix is expanded from the spliced dimension to E dimension, and a production-path distribution probability matrix A and an attraction-path distribution probability matrix P of OD nodes about road sections among OD nodes are obtained through Softmax calculation respectively; where E represents the size of the set of links between OD nodes.
Preferably, the graph structure feature extraction module further includes: simulating the historical attribute sequence G of the OD node s And a diffusion convolution network D C N with the weight adjacent matrix W for spatial relationship extraction, namely D if f using ConvolvulationNetwork; w may be an adjacency matrix formed by the number of paths between OD nodes; then, a cyclic neural network GRU (generalized neural network Unit), namely a Gate Recurrent Unit, is used for extracting the time relation of the sequence after the diffusion convolution processing; and finally, outputting the graph structure fusion representation H.
Preferably, the step of calculating the loss and updating the lower-layer distribution probability prediction model parameters refers to calculating the obtained production-path distribution probability matrix and the OD parameter matrix to obtain total flow of each road section derived from the traffic demand starting point
Figure GDA0003985115030000031
And calculating the obtained attraction-path distribution probability matrix and the OD parameter matrix to obtain the total flow quantity->
Figure GDA0003985115030000032
And simulating total flow y of the section between OD nodes obtained by simulation of the simulator s Calculating Loss by using a Loss function and adopting a gradient descent method to correctAnd updating the parameters of the lower-layer distribution probability prediction model.
Preferably, each time the simulator performs parallel simulation on the same OD parameter matrix, the simulative different historical attribute sequences of the simulated OD nodes and the total flow of the section between the simulated ODs are obtained by slightly disturbing the same OD matrix parameter, meanwhile, the lower-layer distribution probability prediction model is updated by utilizing multiple groups of data, the simulative data and the disturbed OD parameter matrix are in one-to-one correspondence to form experience pairs, the experience pairs are stored in an experience pool, and random repeated sampling can be performed in the subsequent training.
Preferably, after the loss calculation of the lower-layer distribution probability prediction model is converged, the training is transferred to the training of an upper-layer OD parameter matrix, the parameters of the lower-layer distribution probability prediction model are fixed during the training of the upper-layer OD parameter matrix, and then the actual OD node historical attribute sequence G is used r And the current OD parameter matrix T as input, the output result is the method of claim 7, the method is
Figure GDA0003985115030000033
And calculating Loss by using a Loss function for the real total flow y of the path sections between the OD nodes, and correcting the parameters of the upper-layer OD parameter matrix by adopting a gradient descent method.
Preferably, the two-tier iterative training comprises: after loss of the lower-layer distribution probability prediction model is converged, fixing parameters of the lower-layer distribution probability prediction model, transferring to upper-layer OD parameter matrix training, and after loss of the upper-layer OD parameter matrix is converged, completing one iteration in the whole process; at the moment, the data simulated by the simulator in the iteration needs to be stored in an experience pool for the following lower-layer distribution probability prediction model training, whether the OD matrix parameters after the iteration meet the convergence condition compared with the OD matrix parameters of the previous iteration is judged, and if the OD matrix parameters after the iteration meet the convergence condition, the OD parameters after the modification are used as the final back-stepping result; if the convergence condition is not met, entering next iteration; it should be emphasized that, at this time, the new OD matrix parameters of the upper layer are fixed and used as the OD parameter matrix simulated by the simulator, and the data obtained after parallel simulation is reused for training and updating the lower layer distribution probability prediction model.
The invention also provides a device for reversely deducing the OD matrix by the double-layer deep learning model, which comprises: an upper layer OD parameter matrix, a lower layer distribution probability prediction model and a double-layer iterative training framework.
Preferably, the upper layer OD parameter matrix comprises: the OD matrix parameters, and a training module: and calculating loss by using the predicted flow of the section between the OD nodes and the total flow of the real section between the OD nodes through a loss function, and updating parameters of an upper-layer OD parameter matrix by using a gradient descent method.
Preferably, the lower layer assignment probability model includes:
an obtaining module, configured to obtain the OD node partition; initializing OD matrix parameters, and obtaining a historical attribute sequence of the simulated OD nodes, total flow between the simulated OD nodes and the empirical pair data through simulation of a simulator;
the characteristic extraction and fusion module is used for extracting a graph structure fusion representation from an attention fusion matrix and the OD historical node attribute sequence according to the OD parameter matrix;
the result prediction module is used for obtaining the production-path distribution probability matrix and the attraction-path distribution probability matrix through inputting the self-attention fusion matrix and the graph structure fusion representation into the module, and obtaining the OD node-to-node section prediction flow through calculation by combining an OD parameter matrix respectively;
and the training module is used for calculating loss through a loss function by utilizing the predicted flow of the section between the OD nodes and the simulated total flow of the section between the OD nodes and updating parameters of a lower-layer distribution probability prediction model through a gradient descent method.
Preferably, the two-tier iterative training framework comprises: fixing upper layer OD matrix parameters, updating a lower layer distribution probability prediction model, fixing lower layer distribution probability prediction model parameters, and correcting the upper layer OD matrix parameters until loss convergence to serve as a one-time double-layer iterative training process; and (5) iterating for multiple times until the OD matrix parameters are converged.
The invention also provides a device comprising a processor and a memory; the memory is used for storing a computer program; the processor is used for executing the traffic flow prediction method according to the computer program.
The present invention also provides a computer-readable storage medium for storing a computer program for executing the above-described OD matrix backprojection method.
According to the technical scheme, the method constructs a deep learning model, integrates the space-time information in the traffic process, and provides more data and stronger model support for the accurate reverse thrust of the OD matrix. Meanwhile, a double-layer deep learning framework is adopted, and a traffic simulator is used for simulating to assist the training of the model, so that the difficulty that a large amount of training data required by the deep learning model is difficult to obtain is overcome. A feasible method and a feasible device for performing OD reverse-thrust tasks by using a double-layer deep learning model are established. The accuracy of the backward-pushing OD matrix is effectively improved.
Additional features and advantages of the invention will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a schematic view of an application scenario of a method for performing a back-stepping on an OD matrix of a traffic demand by using a two-layer deep learning framework according to the present invention;
FIG. 2 is a schematic structural diagram of an acquisition module provided in the present invention;
FIG. 3 is a schematic diagram of an OD automatic partitioning result and an OD node-to-node segment screening result provided by the present invention;
FIG. 4 is a schematic structural diagram of an upper-layer OD parameter matrix and a lower-layer distribution probability prediction model of the device for performing back-stepping on a traffic demand OD matrix by using a double-layer deep learning framework;
fig. 5 is a schematic structural diagram of a double-layer cooperative control unit of the device for performing reverse thrust on a traffic demand OD matrix by using a double-layer deep learning framework provided by the invention.
Detailed Description
The following detailed description of embodiments of the invention refers to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the preferred embodiment of the invention, are given by way of illustration and explanation only, not limitation.
In the present application, the terms "first," "second," "third," "fourth," and the like (if any) in the description and in the claims and drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In order to facilitate understanding of the method for performing the back-stepping on the traffic demand OD matrix by using the two-layer deep learning framework provided in the embodiment of the present application, the following first explains related terms involved in the present application.
OD (Origin and Destination) represents the start and end points in the traffic flow demand. Each OD node may be either a start or an end node. One OD node is a cluster obtained by clustering intersections of road segments on the map, and represents division of an area on the map as one OD node. All OD nodes form a node set v = { n = { (n) 1 ,n 2 ,……,n N H, | ν | = N denotes a total of N OD nodes.
The OD interval section represents a section with two ends connected with intersection points which do not belong to the same OD node, and all section sets epsilon = { e } between the OD nodes 1 ,e 2 ,……,e E And |, | epsilon | = E represents a total of E OD inter-node links.
Graph structure G (v, ε, W) indicates the nodes ε and ODAnd the section nu between the nodes and the adjacent matrix with the weight form a graph.
Figure GDA0003985115030000051
Is a weighted adjacency matrix showing adjacency relationships between nodes. Including but not limited to such things as: the number of ways between nodes is particularly significant when the OD division area is large, since it is considered that there may be multiple sides between each OD node.
OD parameter matrix
Figure GDA0003985115030000052
And the matrix representation is formed by traffic demand flow from each OD node to all other nodes as a starting point and an ending point respectively. Wherein the elements T of the matrix ij And E is an OD pair, and represents the traffic demand flow from the OD node i to the OD node i.
Production vector
Figure GDA0003985115030000053
The vector is formed by the traffic departure with each OD node as the starting point, and can be understood as the vector obtained by adding the elements of each row of the OD parameter matrix, and the calculation formula is as follows:
Figure GDA0003985115030000054
attraction vector
Figure GDA0003985115030000055
The traffic arrival quantity of each OD node as a terminal point is a vector, which can be understood as a vector obtained by adding elements of each column of the OD parameter matrix, and is calculated as follows:
Figure GDA0003985115030000056
production-path assignment probability matrix
Figure GDA0003985115030000057
And the flow distribution probability of each node in the production vector to all paths between OD nodes is shown, and the sum of all the probabilities is 1. Attraction-path assignment probability matrix>
Figure GDA0003985115030000061
And the probability of traffic distribution of all paths between OD nodes by each node in the attraction vector is shown, and the sum of all the probabilities is 1.
Simulation OD node historical attribute sequence
Figure GDA0003985115030000062
The time-series characteristic in the time period t is shown, and F is the number of characteristics. The characteristic of the simulated OD node historical attribute sequence includes, but is not limited to, average speed in a specific time interval, the number of inflow vehicles and outflow vehicles in the specific time interval, the holding amount of vehicles in the specific time interval, road sections and intersection points in the node, and the like.
Actual OD node historical attribute sequence
Figure GDA0003985115030000063
And F is the number of features. The historical attribute sequence characteristics of the real OD node include but are not limited to average speed in a specific time interval, the number of inflow vehicles and outflow vehicles in the specific time interval, the quantity of vehicles reserved in the specific time interval, road sections and intersection points in the node and the like. It is emphasized that>
Figure GDA0003985115030000064
And/or>
Figure GDA0003985115030000065
The features involved must be consistent.
A Gate RecurrentUnit (GRU) is a recurrent neural network that takes sequence data as input, recurses in the evolution direction of the sequence, and all nodes are connected in a chain. The Neural Network of the same kind also includes a Long Short-Term Memory Network (LSTM) and a Recurrent Neural Network (RNN).
A Diffusion Convolutional Network (DCN) is a deep learning Network, and is applicable to processing objects in non-euclidean spaces. Its homogeneous neural network also includes Graph Convolutional Network (GCN).
Fig. 1 is an application scenario diagram of a method for performing a back-estimation on a traffic demand OD matrix by using a two-layer deep learning framework according to an embodiment of the present application, as shown in fig. 1, the method includes the following steps:
step S1: obtaining data by an obtaining module
Referring to fig. 2, fig. 2 is a schematic structural diagram of an obtaining module provided in an embodiment of the present application, and as shown in fig. 2, the method includes the following steps:
step S101: and obtaining the map by the open source map library of the OSM.
Step S102: and extracting path intersection points and longitude and latitude information from the map data.
Step S103: and clustering the intersection points by adopting a K-means algorithm according to the coordinate information to obtain the OD nodes.
Step S104: and (4) screening the road sections among the OD nodes according to the clustering result to form a graph structure G (v, epsilon, W).
Referring to fig. 3, fig. 3 is a schematic diagram of an OD automatic partitioning result and an OD inter-node segment screening result provided in the embodiment of the present application.
Step S105: the graph structure G (v, ε, W) is loaded into the SUMO simulator using the initialized OD matrix to start the simulation.
Step S106: and obtaining the historical attribute sequence of the simulated OD nodes and the total flow of the road sections among the simulated ODs.
By initializing OD parameter matrix T and setting DUE distribution strategy in simulator SUMO, different simulation results obtained by micro-disturbance to the same OD matrix parameter include simulation OD node historical attribute sequence G s And simulating total flow y of the section between the ODs s
Corresponding the analog data to the disturbed OD parameter matrix one by one to form a group of experience pairs (G) s ,T,y s ). The method aims to enable a lower-layer distribution probability model to obtain enough training data for extracting feature relations, and enable the training effect to be the best. Assuming that 10 simulators are used to generate data in parallel each time, 10 × 10=100 training data are generated after 10 iterations, and then a random extraction method is adopted to extract the stored past experience pairs from the experience pool and the data generated by the current iteration simulator as a training set to be sent to the lower layer distribution probability prediction model for training. It should be emphasized that, in order to make the lower layer assignment probability prediction model learn the latest knowledge, after the maximum capacity is reached, the earliest stored experience pair in the experience pool should be deleted, and then the simulated experience pair is put into the experience pool, and the simulation data stored in the experience pool in the latest period of time is always kept. Since the OD parameter matrix is updated by iteration to be closer to the true OD matrix, recent experience is more useful for training a near-true distribution probability prediction model.
Step S2: obtaining an allocation probability matrix through a lower layer allocation probability prediction model
Referring to fig. 4, fig. 4 is a schematic structural diagram of an upper-layer OD parameter matrix and a lower-layer distribution probability prediction model of a device for performing back-estimation on a traffic demand OD matrix by using a double-layer deep learning framework according to an embodiment of the present application, and as shown in fig. 4, the device includes a feature extraction fusion module and a result prediction module, specifically:
Self-Attention module S201: the method has the capability of capturing the influence of the change of each OD pair on other OD pairs in the model training process, and the calculation formula is as follows:
K=T·W k
V=T·W v
Q=T·W q
Figure GDA0003985115030000071
X 1 =T+Z
wherein
Figure GDA0003985115030000072
Is the vector length calculated for each row vector of the K matrix. The Z matrix is a relationship attention matrix among elements of the aggregate OD matrix T, and contains information on the relationship of the magnitude of the interaction between each OD pair. X 1 The matrix represents the matrix obtained after the original OD parameter matrix is focused.
Diffusion volume module S202: and calculating the graph diffusion convolution of the K steps according to the graph structure information, and extracting the upstream and downstream spatial dependence relation of each node and the surrounding K-order neighbor nodes. The calculation formula is as follows:
Figure GDA0003985115030000073
x is an OD node fusion attribute sequence obtained after each OD node is fused with K-order neighbors, and X = { X = { (X) (t) }。
Figure GDA0003985115030000074
Is the parameter to be learned, and is the weight of each step of diffusion. D o Diagonal matrix representing the out-of-degree matrix of graph G (v, ε, W), D I The diagonal matrix of the in-degree matrix of graph G (ν, ε, W) is represented. />
Figure GDA0003985115030000075
It is shown that the forward diffusion is performed at K steps,
Figure GDA0003985115030000081
indicating that K steps of back diffusion were performed.
The GRU module S203: and sending the OD node fusion attribute sequence obtained by the calculation of the upper layer DC into the GRU to enable the model to capture the time sequence dependency relationship in the X, wherein the calculation formula is as follows:
r (t) =σ(Θ r [X (t) ,H (t-1) ]+b r )
u (t) =σ(Θ u [X (t) ,H (t-1) ]+b u )
C (t) =tanh(Θ C [X (t) ,(r (t) ⊙H (t-1) ]+b c )
H (t) =u (t) ⊙H (t-1) +(1-u (t) )⊙C (t)
the dimension of the hidden layer is set to h,
Figure GDA0003985115030000082
representing the hidden layer representation of the OD node. Mixing X (t) Hidden layer output H with previous layer output (t-1) Current time hidden layer output H obtained by circularly inputting GRU unit output (t) Continue to the next GRU unit, cycle to output the last H (T)
Splicing and normalization module S204: output H of the last layer of the GRU module (T) And output X of the Self-Attention module 1 Splicing and normalizing to obtain a fusion matrix X of the OD parameter matrix fusion self-attention and graph structure space-time information 2 . The calculation formula is as follows:
X 2 =Layernorm([X 1 ,H T ])
the normalized expression is as follows:
Figure GDA0003985115030000083
where e, γ, β are parameters.
Linear layer and Softmax module S205: the fusion matrix X after normalization 2 And sending the nodes into a Linear-P layer and a Linear-A layer, and then performing Softmax calculation, and converting the dimension represented by each node from the hidden layer dimension h into the number E of the node paths among the OD. And respectively obtaining a production-path distribution probability matrix P and an attraction-path distribution probability matrix A. The calculation formula is as follows:
P=softmax(X 2 ·W p )
A=softmax(X 2 ·W a )
wherein W p ,W a Respectively are parameter matrixes of a Linear layer Linear-P layer and a Linear-A layer.
And step S3: coordinating upper and lower layer training through double-layer cooperative training unit and finishing iteration and control
Referring to fig. 5, fig. 5 is a schematic structural diagram of a double-layer cooperative control unit of a device for performing a back-estimation on a traffic demand OD matrix by using a double-layer deep learning framework according to an embodiment of the present application, and as shown in fig. 5, a double-layer cooperative training unit includes a training module of the device, specifically:
the lower layer distribution probability prediction model training module S301: production-path distribution probability matrix P and production vector t obtained through distribution probability prediction model prediction p Calculating to obtain the total flow of each road section deduced from the starting point of the traffic demand
Figure GDA0003985115030000091
And assigning the probability matrix A and the attraction vector t to the obtained attraction-path a The total flow quantity ^ of each road section deduced from the traffic demand terminal point is calculated and obtained>
Figure GDA0003985115030000092
/>
The calculation formula is as follows:
Figure GDA0003985115030000093
Figure GDA0003985115030000094
and simulating total flow of the road section between OD nodes obtained by simulation of the simulator
Figure GDA0003985115030000095
The loss is calculated by using a loss function, and the calculation formula is as follows:
Figure GDA0003985115030000096
through lower-layer training, the model can capture the relation between the spatial time sequence characteristics and a specific OD matrix, and has the capability of predicting a reasonable production-path distribution probability matrix and an attraction-path distribution probability matrix, and the two keep consistent (through a third regular term). After multiple iterations obtained by parallel simulation of the lower layer converge, the model further improves the fitting capability and can be applied to the task of parameter estimation of the OD parameter matrix of the upper layer.
And (4) calculating the gradient of the lower layer distribution probability prediction model parameters by using the calculation loss, and updating the parameters by adopting a gradient descent method. The upper-layer OD parameter matrix training module S302: when the loss calculation of the lower distribution probability prediction model is converged, the lower distribution probability prediction model is transferred to the training of an upper OD parameter matrix, and it needs to be emphasized that the parameters of the lower distribution probability prediction model are fixed during the training of the upper OD parameter matrix, and then the actual OD node historical attribute sequence G is used r And calculating a production-path distribution probability matrix P and an OD parameter matrix T which are obtained by taking the current OD parameter matrix T as an input distribution probability prediction model for prediction to obtain the total flow of each road section deduced from the traffic demand starting point
Figure GDA0003985115030000097
And calculating the obtained attraction-path distribution probability matrix A and the OD parameter matrix T to obtain the total flow quantity ^ of each road section deduced from the traffic demand terminal>
Figure GDA0003985115030000098
And then, calculating by combining the real total flow y of the road section between the OD nodes by using a loss function and correcting the parameters of the OD matrix at the upper layer by adopting a gradient descent method. Considering that the output of the lower model training can only obtain the marginal probability distribution of the total flow of production and attraction of each node to the road section, the correction basis is lacked for each specific OD pair, although the cognition learned from the attention model is helpful for correcting each OD pair. According to the gravity model and the maximum entropy model principle in the traditional reverse-thrust model, under the constraint that the flow of the predicted road section and the flow of the observed road section are equal, the value of each OD pair can be more accurately inferred. These models can be integrated into the loss function of upper-level training together with road section flowThe method comprises the following steps. If the upper training loss function is defined by combining the maximum entropy model, the calculation formula is as follows:
Figure GDA0003985115030000101
Figure GDA0003985115030000102
the double-layer training iteration module S303: and when the loss of the upper layer OD parameter matrix is converged, completing one iteration in the whole process.
At this time, the data simulated by the simulator in the iteration needs to be stored in an experience pool for the following lower-layer distribution probability prediction model training, whether the OD matrix parameters after the iteration meet the convergence condition compared with the OD matrix parameters of the last iteration is judged, and if the OD matrix parameters after the iteration meet the convergence condition, the OD parameters after the modification are used as the final back-stepping result. And if the convergence condition is not met, entering next iteration. It should be emphasized that, at this time, the new OD matrix parameters at the upper layer are fixed and used as the OD matrix simulated by the simulator, and the data obtained after parallel simulation is reused for training and updating the lower-layer distribution probability prediction model.
The preferred embodiments of the present invention have been described in detail with reference to the accompanying drawings, however, the present invention is not limited to the specific details of the above embodiments, and various simple modifications can be made to the technical solution of the present invention within the technical idea of the present invention, and these simple modifications are within the protective scope of the present invention.
It should be noted that the various technical features described in the above embodiments can be combined in any suitable manner without contradiction, and the invention is not described in any way for the possible combinations in order to avoid unnecessary repetition.
In addition, any combination of the various embodiments of the present invention is also possible, and the same should be considered as the disclosure of the present invention as long as it does not depart from the spirit of the present invention.

Claims (3)

1. A method for a double-layer deep learning model to reversely deduce an OD matrix is characterized in that the double-layer deep learning model comprises an upper-layer OD parameter matrix and a lower-layer distribution probability prediction model for reversely deducing a traffic demand flow OD matrix, and the method comprises the following steps:
step S1, acquiring data through an acquisition module, specifically comprising the following steps S101-S106:
step S101, obtaining map data from an open source map library of an OSM;
step S102, extracting path intersection points and longitude and latitude information from map data;
step S103, clustering the path intersection points by adopting a K-means algorithm according to the coordinate information to obtain OD nodes;
step S104, screening the road sections among the OD nodes according to the clustering result to form a graph structure G (v, epsilon, W), wherein the graph structure G (v, epsilon, W) represents a graph formed by the road sections v among the OD nodes epsilon and the OD nodes and an adjacent matrix W with weight, and the adjacent matrix W with weight represents the adjacent relation among the nodes;
step S105, initializing an OD parameter matrix T, and elements T of the matrix ij The epsilon T is an OD pair and represents the traffic demand flow from the OD node i to the OD node j; loading a graph structure G (v, epsilon, W) to the SUMO simulator by using the initialized OD parameter matrix T to start simulation; wherein, the simulator adopts parallel simulation when carrying out simulation;
step S106, carrying out parameter disturbance on the OD parameter matrix to obtain different simulation results, wherein the simulation results comprise simulation OD node historical attribute sequence G s And simulating total flow y of the section between OD nodes s The characteristics of the OD node historical attribute sequence comprise the average speed in a specific time interval, the number of inflow vehicles in the specific time interval, the number of outflow vehicles in the specific time interval, the vehicle holding capacity in the specific time interval, and the number of road sections and road section intersection points contained in the OD node; the simulation results are in one-to-one correspondence with the disturbed OD parameter matrixes to form a group of empirical pairs (G) s ,T,y s ) And storing the data into an experience pool as training data of a lower-layer distribution probability prediction model;
step S2, obtaining a distribution probability matrix through a lower distribution probability prediction model, and specifically comprising the following steps S201-S205:
step S201, capturing Self-Attention information of influence of change of each OD pair on other OD pairs by using a Self-Attention module, and outputting a matrix X obtained by aggregating Self-Attention information in an OD parameter matrix 1
Step S202, a graph Diffusion Convolution is calculated on a graph structure G (v, epsilon, W) by utilizing a Diffusion Convolution module, the spatial dependency relationship between each OD node and the upstream and downstream of the adjacent OD nodes is extracted, and an OD node fusion attribute sequence is obtained through calculation according to the spatial dependency relationship;
step S203, sending the OD node fusion attribute sequence calculated by the Difsion fusion conversion module into the GRU module by using the GRU module to capture and output the time sequence dependency relationship;
step S204, utilizing the splicing and normalization module to output the GRU module and the matrix X output by the Self-orientation module 1 Splicing and normalizing to obtain a fusion matrix X with OD parameter matrix fused with self attention and graph structure space-time information 2
Step S205, fusing the matrix X by utilizing the linear layer and the Softmax module 2 Sending the data to a linear layer for Softmax calculation, converting the dimension represented by each node from the hidden layer dimension to the OD inter-node path number E, and respectively obtaining a production-path distribution probability matrix P and an attraction-path distribution probability matrix A; wherein the production-path distribution probability matrix P represents a production vector t p The flow of all paths between OD nodes is distributed to each node in the network, the sum of all the probabilities is 1, and an attraction-path distribution probability matrix A represents an attraction vector t a The flow of each node in the system distributes probability to all paths among OD nodes, the sum of all the probabilities is 1, and a vector t is produced p The method is characterized in that a vector formed by traffic departure taking each OD node as a starting point is represented by a vector obtained by adding elements in each row of an OD parameter matrix; attraction vector t a The method is characterized in that the vector formed by the traffic arrival quantity taking each OD node as a terminal point is obtained by adding elements of each column of an OD parameter matrixA vector representation;
step S3, coordinating training iteration of upper and lower layers of the double-layer deep learning model and controlling the end of training through a double-layer cooperative training unit, wherein the double-layer cooperative training unit comprises a training module, and specifically comprises the following steps S301-S303:
step S301, a training module predicts a production-path distribution probability matrix P and a production vector t which are obtained through a lower layer distribution probability prediction model p Calculating to obtain total flow of each road section deduced from the traffic demand starting point and distributing the probability matrix A and the attraction vector t to the obtained attraction-path a Calculating to obtain total flow of each road section deduced from the traffic demand end point, and simulating total flow y of the road sections among simulated OD nodes by using a simulator s Calculating loss by using a loss function, then solving the gradient of the parameters of the lower-layer distribution probability prediction model, and updating the parameters of the lower-layer distribution probability prediction model by using a gradient descent method;
step S302, the training module trains the upper layer OD parameter matrix, specifically, after the loss calculation result of the lower layer distribution probability prediction model is converged, the training is transferred to the upper layer OD parameter matrix, the parameters of the lower layer distribution probability prediction model are fixed when the upper layer OD parameter matrix is trained, and then the real OD node historical attribute sequence G is used r And the OD parameter matrix is used as the input of a lower distribution probability prediction model, the total flow of each road section deduced from a traffic demand starting point and the total flow of each road section deduced from a traffic demand terminal are obtained through prediction, finally, the loss is calculated by combining the real total flow y of the road section between the OD nodes and a loss function, and the upper OD parameter matrix is corrected by adopting a gradient descent method; the characteristics of the real OD node historical attribute sequence are consistent with those of the simulated OD node historical attribute sequence;
step S303, after the loss of the upper layer OD parameter matrix is converged, completing one iteration in the whole process, storing a simulation result obtained by simulation of the simulator in the iteration into an experience pool for subsequent training of the lower layer distribution probability prediction model, simultaneously judging whether the OD parameter matrix after the iteration meets a convergence condition compared with the OD parameter matrix of the last iteration, if the OD parameter matrix after the iteration meets the convergence condition, taking the OD parameter matrix after the iteration as a back-pushing result of the final OD matrix, if the OD parameter matrix does not meet the convergence condition, entering the next iteration, when entering the next iteration, fixing a new OD parameter matrix of the upper layer and taking the new OD parameter matrix as the OD parameter matrix for simulation, and reusing data of the simulation result obtained after the simulation in the training and updating of the lower layer distribution probability prediction model.
2. An apparatus for a two-layer deep learning model to extrapolate an OD matrix, the apparatus comprising a processor and a memory; the memory is used for storing a computer program; the processor is configured to perform the method of the two-layer deep learning model of claim 1 to extrapolate an OD matrix in accordance with the computer program.
3. A computer-readable storage medium for storing a computer program for performing the method of the two-layer deep learning model for extrapolating an OD matrix as claimed in claim 1.
CN202111503979.0A 2021-12-10 2021-12-10 Method and device for reversely deducing OD matrix by double-layer deep learning model and storage medium Active CN114282165B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111503979.0A CN114282165B (en) 2021-12-10 2021-12-10 Method and device for reversely deducing OD matrix by double-layer deep learning model and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111503979.0A CN114282165B (en) 2021-12-10 2021-12-10 Method and device for reversely deducing OD matrix by double-layer deep learning model and storage medium

Publications (2)

Publication Number Publication Date
CN114282165A CN114282165A (en) 2022-04-05
CN114282165B true CN114282165B (en) 2023-04-07

Family

ID=80871485

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111503979.0A Active CN114282165B (en) 2021-12-10 2021-12-10 Method and device for reversely deducing OD matrix by double-layer deep learning model and storage medium

Country Status (1)

Country Link
CN (1) CN114282165B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109447352A (en) * 2018-10-31 2019-03-08 东南大学 A kind of anti-combined method pushed away of bus trip OD matrix

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10853720B1 (en) * 2017-04-26 2020-12-01 EMC IP Holding Company LLC Traffic condition forecasting using matrix compression and deep neural networks
CN108320504B (en) * 2018-01-22 2020-06-16 北京工业大学 Dynamic OD matrix estimation method based on monitoring data
CN112185124B (en) * 2020-11-27 2021-03-26 深圳市城市交通规划设计研究中心股份有限公司 Method and device for predicting traffic state of whole road network

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109447352A (en) * 2018-10-31 2019-03-08 东南大学 A kind of anti-combined method pushed away of bus trip OD matrix

Also Published As

Publication number Publication date
CN114282165A (en) 2022-04-05

Similar Documents

Publication Publication Date Title
CN111061277B (en) Unmanned vehicle global path planning method and device
US20210064999A1 (en) Multi-scale multi-granularity spatial-temporal traffic volume prediction
CN110717627B (en) Full traffic prediction method based on dual graph framework
JP6775469B2 (en) OD traffic predictors, methods, and programs
CN111738372B (en) Distributed multi-agent space-time feature extraction method and behavior decision method
CN111401557B (en) Agent decision making method, AI model training method, server and medium
Saeedi Integrating macro and micro scale approaches in the agent-based modeling of residential dynamics
CN116664719B (en) Image redrawing model training method, image redrawing method and device
CN113762595A (en) Traffic time prediction model training method, traffic time prediction method and equipment
CN112597217B (en) Intelligent decision platform driven by historical decision data and implementation method thereof
CN113537580A (en) Public transport passenger flow prediction method and system based on adaptive graph learning
CN113065443A (en) Training method, recognition method, system, device and medium of image recognition model
Strofylas et al. Using synchronous and asynchronous parallel differential evolution for calibrating a second-order traffic flow model
CN113590958B (en) Continuous learning method of sequence recommendation model based on sample playback
CN115457081A (en) Hierarchical fusion prediction method based on graph neural network
CN116345578A (en) Micro-grid operation optimization scheduling method based on depth deterministic strategy gradient
CN114282165B (en) Method and device for reversely deducing OD matrix by double-layer deep learning model and storage medium
CN116662815B (en) Training method of time prediction model and related equipment
Tien et al. Deep Reinforcement Learning Applied to Airport Surface Movement Planning
CN114414090A (en) Surface temperature prediction method and system based on remote sensing image and multilayer sensing
CN114912518A (en) Reinforced learning grouping method, device and medium based on user group typical characteristics
CN114566048A (en) Traffic control method based on multi-view self-adaptive space-time diagram network
CN114399901A (en) Method and equipment for controlling traffic system
Karimzadeh et al. RL-CNN: Reinforcement learning-designed convolutional neural network for urban traffic flow estimation
CN113962312A (en) Ambiguity detection method, system, device and medium based on artificial intelligence

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
GR01 Patent grant
GR01 Patent grant