CN114282165A - 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 PDFInfo
- Publication number
- CN114282165A CN114282165A CN202111503979.0A CN202111503979A CN114282165A CN 114282165 A CN114282165 A CN 114282165A CN 202111503979 A CN202111503979 A CN 202111503979A CN 114282165 A CN114282165 A CN 114282165A
- Authority
- CN
- China
- Prior art keywords
- matrix
- nodes
- layer
- node
- distribution probability
- 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.)
- Granted
Links
Images
Classifications
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine 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 flow of a road section 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 distribution probability prediction model, and performing self-correlation extraction on the initial OD parameter matrix; and the method of predicting the flow distribution probability matrix by fusing the above characteristics; 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
Technical Field
The invention relates to the technical field of traffic management, in particular to a method and a device 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 relies on strong information fusion and fitting capability of the deep learning model and becomes a better choice for an OD reverse-deducing technology, but the deep learning model needs a large amount of data to train the model, and because a real OD matrix is difficult to obtain, the label of the data in the direct learning deep learning model is difficult to obtain. 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, a device and a storage medium for a double-layer deep learning model to reversely deduce an OD matrix, which are used for constructing a deep learning model, fusing space-time information in a traffic process and providing more data and stronger model support for 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 a link 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 a 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,t2,...,tT) (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 intervalsAnd the total flow y of each road section among the simulated OD nodessThe 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-fusion module, and obtaining an OD node historical attribute sequence GsThe 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 according to nodes to obtain a splicing matrix, and performing transformation and dimension expansion on each node of the splicing matrix through two Linear layers of Linear-P and Linear-A to enable the vector dimension of each node in the fusion matrix to be expanded to E dimension from the spliced dimension and obtain a production-path distribution probability matrix A and an attraction-path distribution probability matrix P of OD nodes relative to road sections among OD nodes through Softmax calculation; 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 nodesAnd a Diffusion convolution network DCN with the weight adjacency matrix W for spatial relationship extraction, namely a Diffusion Convolationnetwork; 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 pointAnd calculating the obtained attraction-path distribution probability matrix and the OD parameter matrix to obtain the total flow of each road section deduced from the traffic demand terminalAnd simulating total flow y of the section between OD nodes obtained by simulation of the simulatorsAnd calculating Loss by using a Loss function and updating the parameters of the lower-layer distribution probability prediction model by adopting a gradient descent method.
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 usedrAnd a current OD parameter matrix T as input, and outputting the result according to the method of claim 7And 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 the loss of the lower distribution probability prediction model is converged, fixing the parameters of the lower distribution probability prediction model, transferring to the upper OD parameter matrix for training, and after the loss of the upper 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 last iteration is judged, and if the OD matrix parameters after the modification meet the convergence condition, the OD parameters after the iteration are taken 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 iteration 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 partitions; initializing OD matrix parameters, and obtaining the historical attribute sequence of the simulated OD nodes, the 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 be used 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 deep learning model is constructed, the spatio-temporal information in the traffic process is fused, and more data and stronger model support are provided 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 present 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 starting or an ending point. One OD node is a cluster obtained by clustering intersection points 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 ═ n1,n2,...,nNN denotes a total of N OD nodes.
The OD-node segment represents a segment whose both ends are connected to an intersection point not belonging to the same OD node, and all segments constituting the OD-node segment set ε ═ e1,e2,...,eEAnd E represents a total of E sections between OD nodes.
Graph structure G (v, e, W) represents a graph composed of OD nodes e, OD inter-node segments v, and weighted adjacency matrices.Is an adjacency matrix with weights, and shows the adjacency relation between nodes. Including but not limited to such things as: the number of ways between nodes is particularly significant when the OD dividing area is large, since it is considered that there may be multiple sides between each OD node.
OD parameter matrixAnd representing the matrix representation formed by the 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 matrixijAnd E is an OD pair, and represents the traffic demand flow from the OD node i to the OD node i.
Production vectorThe 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:
attraction vectorThe 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:
production-path assignment probability matrixAnd (3) the traffic distribution probability of each node to all paths between OD nodes in the production vector is shown, and the sum of all the probabilities is 1. Attraction-path assignment probability matrixAnd (3) the traffic distribution probability of each node in the attraction vector to all paths between OD nodes is shown, and the sum of all the probabilities is 1.
Simulating OD node historical attribute sequenceAnd F is the number of features. 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 sequenceAnd F is the number of features. The real OD node historical attributeThe sequence features include, but are not limited to, average speed in a specific time interval, the number of incoming vehicles and outgoing vehicles in a specific time interval, the amount of vehicles kept in a specific time interval, the number of links and intersections contained in the node, and the like. It is to be emphasized that it is,andthe 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 can be applied to processing objects in non-euclidean space. 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 the OSM open source map library acquires the map.
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 screening road sections among 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 SUMO in simulator, different simulation results obtained by small disturbance to the same OD matrix parameter include simulation OD node historical attribute sequence GsAnd simulating total flow y of the section between ODs。
Corresponding the analog data to the disturbed OD parameter matrix one by one to form a group of experience pairs (G)s,T,ys). 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. And (3) generating data by 10 simulators in parallel every time, generating 10 × 10-100 training data after 10 iterations, and extracting the stored past experience pairs from an experience pool in a random extraction mode and sending the data generated by the simulators in the current iteration to a lower-layer distribution probability prediction model as a training set 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. Because the OD parameter matrix is continuously updated to the true OD matrix through iteration, 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·Wk
V=T.Wv
Q=T·Wq
X1=T+Z
whereinIs 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. X1The 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:
x is an OD node fusion attribute sequence obtained after each OD node is fused with K-order neighbors, and X is { X ═ X(t)}。Is the parameter to be learned, and is the weight of each step diffusion. Do denotes the diagonal matrix of the out-of-degree matrix of the graph G (v, ε, W), DIA diagonal matrix representing the in-degree matrix of diagram G (ν, ε, W).It is shown that the forward diffusion is performed at K steps,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)]+br)
u(t)=σ(Θu[X(t),H(t-1)]+bu)
C(t)=tanh(ΘC[X(t),(r(t)⊙H(t-1)]+bc)
H(t)=u(t)⊙H(t-1)+(1-u(t))⊙C(t)
the dimension of the hidden layer is set to h,representing the hidden layer representation of the OD node. Mixing X(t)Hidden layer output H with previous layer output(t-1)The current time hidden layer output H obtained by circularly inputting the output of the GRU unit(t)Continue to the next GRU unit, cycle to output the last H(T)。
Splicing and normalization module S204: outputting H of the last layer of the GRU module(T)And output X of the Self-Attention module1Splicing and normalizing to obtain a fusion matrix X of the OD parameter matrix fusion self-attention and graph structure space-time information2. The calculation formula is as follows:
X2=Layernorm([X1,HT])
the normalized expression is as follows:
where e, γ, β are parameters.
Linear layer and Softmax module S205: merging the normalized fusion matrix X2And 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(X2·Wp)
A=softmax(X2·Wa)
wherein Wp,WaRespectively are parameter matrixes of a Linear layer Linear-P layer and a Linear-A layer.
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 predictionpCalculating to obtain the total flow of each road section deduced from the starting point of the traffic demandAnd assigning the probability matrix A and the attraction vector t to the obtained attraction-pathaCalculating to obtain the total flow of each road section deduced from the traffic demand terminal
The calculation formula is as follows:
and simulating total flow of the road section between OD nodes obtained by simulation of the simulatorThe loss is calculated by using a loss function, and the calculation formula is as follows:
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 usedrAnd 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 pointAnd calculating the obtained attraction-path distribution probability matrix A and the OD parameter matrix T to obtain the total of each road section deduced from the traffic demand terminalFlow rateAnd 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 the upper layer training together with the road section flow. If an upper training loss function is defined by combining the maximum entropy model, the calculation formula is as follows:
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 the 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 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 (16)
1. A method for a two-layer deep learning model to extrapolate 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 a link 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 a reversely deduced OD matrix.
2. The method according to claim 1, wherein the automatic OD node division for the map means downloading an open source map from an open source map library including but not limited to OSM, that is, OpenStreetMap, and reading a section intersection point therein, acquiring an ID and a corresponding longitude and latitude coordinate of each intersection point as an element, all the intersection points forming a set, and then 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.
3. The method of claim 1, wherein the simulation using a traffic simulator is a simulation using a distribution algorithm including but not limited to DUE, Dynamic User Equilibrium, including but not limited to SUMO traffic simulator; 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.
4. The method of claim 3, wherein the OD node history sequence comprises a sequence (T) of T time intervals T divided by the total simulation time1,t2,...,tT) (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 intervalsAnd the total flow y of each road section among the simulated OD nodessRefers to the flow of traffic throughout the demandAnd after completion, the total number of vehicles passing through the road section between the OD nodes.
5. The method of claim 1, wherein the lower layer assigning a probabilistic predictive model comprises: extracting the Self-correlation characteristics from the OD parameter matrix to obtain a Self-Attention fusion matrix X Self-Attention-fusion module, and obtaining an OD node historical attribute sequence GsThe 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 according to nodes to obtain a splicing matrix, and performing transformation and dimension expansion on each node of the splicing matrix through two Linear layers of Linear-P and Linear-A to enable the vector dimension of each node in the fusion matrix to be expanded to E dimension from the spliced dimension and obtain a production-path distribution probability matrix A and an attraction-path distribution probability matrix P of OD nodes relative to road sections among OD nodes through Softmax calculation; where E represents the size of the set of links between OD nodes.
6. The method of claim 5, wherein the graph structure feature extraction module further comprises: simulating the historical attribute sequence G of the OD nodesAnd a Diffusion convolution network DCN with the weight adjacency matrix W for spatial relationship extraction, namely a Diffusion Convolationnetwork; 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.
7. The method of claim 1, wherein the calculating the loss update lower layer distribution probability prediction model parameter is calculating the obtained production-path distribution probability matrix and the OD parameter matrix to obtain the total traffic of each road section derived from the traffic demand starting pointAnd the suction-path that has been obtainedThe total flow of each road section deduced from the traffic demand end point is obtained by calculating the distribution probability matrix and the OD parameter matrixAnd simulating total flow y of the section between OD nodes obtained by simulation of the simulatorsAnd calculating Loss by using a Loss function and updating the parameters of the lower-layer distribution probability prediction model by adopting a gradient descent method.
8. The method of claim 1, wherein each time the simulator performs parallel simulation on the same OD parameter matrix, the same OD matrix parameter is slightly disturbed to obtain different simulated OD node historical attribute sequences and total flow of the section between simulated ODs, the lower-layer distribution probability prediction model is updated by using multiple groups of data, the simulated data and the disturbed OD parameter matrix are in one-to-one correspondence to form experience pairs which are stored in an experience pool, and the experience pairs can be randomly and repeatedly sampled in the subsequent training.
9. The method of claim 1, wherein after the loss calculation of the lower distribution probability prediction model converges, the method shifts to the training of an upper OD parameter matrix, and the parameters of the lower distribution probability prediction model are fixed during the training of the upper OD parameter matrix, and then the parameters are represented by the historical attribute sequence G of the real OD nodesrAnd a current OD parameter matrix T as input, and outputting the result according to the method of claim 7And 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.
10. The method of claim 1, wherein the two-tier iterative training comprises: after the loss of the lower distribution probability prediction model is converged, fixing the parameters of the lower distribution probability prediction model, transferring to the upper OD parameter matrix for training, and after the loss of the upper 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 last iteration is judged, and if the OD matrix parameters after the modification meet the convergence condition, the OD parameters after the iteration are taken 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.
11. An apparatus for a two-layer deep learning model to extrapolate an OD matrix, the apparatus comprising: an upper layer OD parameter matrix, a lower layer distribution probability prediction model and a double-layer iteration training framework.
12. The apparatus of claim 11, wherein 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.
13. The apparatus of claim 11, wherein the lower layer assignment probability model comprises:
an obtaining module, configured to obtain the OD node partitions; initializing OD matrix parameters, and obtaining the historical attribute sequence of the simulated OD nodes, the 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.
14. The apparatus of claim 11, wherein 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 be used as a one-time double-layer iterative training process; and (5) iterating for multiple times until the OD matrix parameters are converged.
15. An apparatus, comprising a processor and a memory; the memory is used for storing a computer program; the processor is configured to execute the traffic flow prediction method according to any one of claims 1 to 10 in accordance with the computer program.
16. A computer-readable storage medium for storing a computer program for performing the OD matrix backstepping method of any one of claims 1 to 10.
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 true CN114282165A (en) | 2022-04-05 |
CN114282165B 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 (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108320504A (en) * | 2018-01-22 | 2018-07-24 | 北京工业大学 | Dynamic OD matrix estimation method based on monitoring data |
CN109447352A (en) * | 2018-10-31 | 2019-03-08 | 东南大学 | A kind of anti-combined method pushed away of bus trip OD matrix |
US10853720B1 (en) * | 2017-04-26 | 2020-12-01 | EMC IP Holding Company LLC | Traffic condition forecasting using matrix compression and deep neural networks |
CN112185124A (en) * | 2020-11-27 | 2021-01-05 | 深圳市城市交通规划设计研究中心股份有限公司 | Method and device for predicting traffic state of whole road network |
-
2021
- 2021-12-10 CN CN202111503979.0A patent/CN114282165B/en active Active
Patent Citations (4)
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 |
CN108320504A (en) * | 2018-01-22 | 2018-07-24 | 北京工业大学 | Dynamic OD matrix estimation method based on monitoring data |
CN109447352A (en) * | 2018-10-31 | 2019-03-08 | 东南大学 | A kind of anti-combined method pushed away of bus trip OD matrix |
CN112185124A (en) * | 2020-11-27 | 2021-01-05 | 深圳市城市交通规划设计研究中心股份有限公司 | Method and device for predicting traffic state of whole road network |
Non-Patent Citations (2)
Title |
---|
DANYEL KOCA 等: "Origin-destination matrix estimation by deep learning using maps with New York case study", 《2021 7TH INTERNATIONAL CONFERENCE ON MODELS AND TECHNOLOGIES FOR INTELLIGENT TRANSPORTATION SYSTEMS (MT-ITS)》 * |
任世冲: "基于人工神经网络的OD反推方法研究", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》 * |
Also Published As
Publication number | Publication date |
---|---|
CN114282165B (en) | 2023-04-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111639787B (en) | Spatio-temporal data prediction method based on graph convolution network | |
CN112631717B (en) | Asynchronous reinforcement learning-based network service function chain dynamic deployment system and method | |
JP6775469B2 (en) | OD traffic predictors, methods, and programs | |
EP3916652A1 (en) | A method and neural network trained by reinforcement learning to determine a constraint optimal route using a masking function | |
CN111406264A (en) | Neural architecture search | |
CN110659678B (en) | User behavior classification method, system and storage medium | |
CN103544496A (en) | Method for recognizing robot scenes on basis of space and time information fusion | |
CN111401557A (en) | Agent decision making method, AI model training method, server and medium | |
CN113590958B (en) | Continuous learning method of sequence recommendation model based on sample playback | |
KR20220130177A (en) | Agent control planning using learned hidden states | |
CN116345578B (en) | Micro-grid operation optimization scheduling method based on depth deterministic strategy gradient | |
CN112200266A (en) | Network training method and device based on graph structure data and node classification method | |
JP2023519770A (en) | Automatic compression method and platform for pre-trained language models for multitasking | |
CN113505924A (en) | Information propagation prediction method and system based on cascade spatiotemporal features | |
Strofylas et al. | Using synchronous and asynchronous parallel differential evolution for calibrating a second-order traffic flow model | |
CN113065443A (en) | Training method, recognition method, system, device and medium of image recognition model | |
CN113784380B (en) | Topology prediction method adopting graph attention network and fusion neighborhood | |
CN115440384A (en) | Medical knowledge map processing method and system based on multitask learning | |
CN114282165B (en) | Method and device for reversely deducing OD matrix by double-layer deep learning model and storage medium | |
CN112417748B (en) | Method, system, equipment and medium for scheduling automatic driving simulation task | |
CN117744760A (en) | Text information identification method and device, storage medium and electronic equipment | |
CN117271838A (en) | Vehicle-mounted directed acyclic graph task scheduling method and system | |
CN117811907A (en) | Satellite network micro-service deployment method and device based on multi-agent reinforcement learning | |
Tien et al. | Deep Reinforcement Learning Applied to Airport Surface Movement Planning | |
CN114566048A (en) | Traffic control method based on multi-view self-adaptive space-time diagram network |
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 |