STDEN: Towards Physics-Guided Neural Networks for Traffic Flow Prediction

Jiahao Ji, 1 Jingyuan Wang, 1,2 Zhe Jiang, 3 Jiawei Jiang, 4 Hu Zhang 4 Corresponding author: jywang@buaa.edu.cn
Abstract

High-performance traffic flow prediction model designing, a core technology of Intelligent Transportation System, is a long-standing but still challenging task for industrial and academic communities. The lack of integration between physical principles and data-driven models is an important reason for limiting the development of this field. In the literature, physics-based methods can usually provide a clear interpretation of the dynamic process of traffic flow systems but are with limited accuracy, while data-driven methods, especially deep learning with black-box structures, can achieve improved performance but can not be fully trusted due to lack of a reasonable physical basis. To bridge the gap between purely data-driven and physics-driven approaches, we propose a physics-guided deep learning model named Spatio-Temporal Differential Equation Network (STDEN), which casts the physical mechanism of traffic flow dynamics into a deep neural network framework. Specifically, we assume the traffic flow on road networks is driven by a latent potential energy field (like water flows are driven by the gravity field), and model the spatio-temporal dynamic process of the potential energy field as a differential equation network. STDEN absorbs both the performance advantage of data-driven models and the interpretability of physics-based models, so is named a physics-guided prediction model. Experiments on three real-world traffic datasets in Beijing show that our model outperforms state-of-the-art baselines by a significant margin. A case study further verifies that STDEN can capture the mechanism of urban traffic and generate accurate predictions with physical meaning. The proposed framework of differential equation network modeling may also cast light on other similar applications.

\affiliations

1 State Key Laboratory of Software Development Environment,
School of Computer Science & Engineering, Beihang University, Beijing, China
2 Peng Cheng Laboratory, Shenzhen, China
3 Department of Computer & Information Science & Engineering, The University of Florida
4 MOE Engineering Research Center of Advanced Computer Application Technology,
School of Computer Science & Engineering, Beihang University, Beijing, China
{jiahaoji, jywang, jwjiang, zhanghu2006}@buaa.edu.cn, zhe.jiang@ufl.edu

Introduction

Rapid urbanization has brought about the growth of urban population, and presented huge transportation and sustainability challenges to modern cities. Intelligent Transportation System (ITS) has become an active research area because of its potential to improve transportation efficiency and solve the sustainability problem of cities Snyder and Do (2019). As the core technology of the ITS, traffic flow prediction, aiming at forecasting the future status of traffic systems given historical observations, plays a crucial role in many important urban applications, such as public safety, congestion management and navigation Li et al. (2020).

In the literature, traffic flow prediction methods mainly fall into two categories: physics-based and data-driven. The former one usually relies on traffic flow theory Ni (2015), which represents traffic system as coupled Differential Equations (DEs). Traffic flow prediction is then achieved through conducting system simulation governed by these DEs. The physics-based models are able to guarantee the simulation results consistently represent the traffic dynamics over the entire domain, not only where it was calibrated by observation data. However, these models usually make strong assumptions about traffic flow with a small set of parameters Mo et al. (2021), which may not be able to capture the complex human behaviors and the uncertain factors in real-world traffic. Besides, the simulation process relies on solving DEs through numerical differentiation and integration techniques, which requires a lot of computing resources Wang et al. (2020).

The second category is data-driven methods, which usually utilize historical observational data to train a statistical learning model, and then use the trained model to generate predictions. Among the data-driven methods, the most representative branch is traffic flow prediction based on deep learning. For example, using recurrent neural networks Li et al. (2018) or temporal convolution Wu et al. (2019) to model temporal dependencies, using convolutional neural networks Tang et al. (2020) to capture spatial correlations, and using graph convolutional Song et al. (2020); Tian and Chan (2021) to introduce road network information into traffic prediction. In recent years, with a huge volume of traffic data becoming available, the deep learning-based data-driven methods have drawn great attention from both industry and academia, and achieved great success in many real-world applications. However, these methods also have defects. First, without the physical knowledge to guarantee generalization ability, the data-driven models are very likely to lose effectiveness in scenarios that are not sampled by the training data. Second, the “black-box” structure of deep learning models introduces unknown risks in the ITS, which may cause potential threats to urban safety.

To bridge the gap between data-driven and physics-based approaches, we raise a hybrid modeling paradigm,  Physics-Guided Deep Learning, for traffic flow prediction. Specifically, we propose a Spatio-Temporal Differential Equation Network (STDEN 111The code is available at https://github.com/Echo-Ji/STDEN) that combines the physical mechanism of traffic dynamics and end-to-end deep learning into a whole framework. Our idea is based on the key assumption that traffic flow on road networks is driven by a latent potential energy field (like water flows are driven by the gravity field). The latent potential energy field follows physical constraints that reflect the transport of energy Lienhard and Lienhard (2008). These constraints take the form of differential equations (DEs) commonly used in physics. To capture complex functions in the potential energy field DE in a learnable manner, we extend the existing ordinary DE network Chen et al. (2018) by replacing the differential operator with graph Laplacian and design a graph neural network for spatio-temporal road networks. The overall framework of STDEN consists of an encoder that maps traffic flow into latent potential energy fields, a DE network that predicts the dynamics of potential energy fields continuously over time, and a decoder that generates traffic flow predictions from the latent potential energy fields. Evaluations on real-world traffic datasets show that STDEN consistently outperforms state-of-the-art traffic prediction baselines by a large margin in terms of prediction accuracy. Moreover, the learned potential energy field can potentially reveal the evolution of urban dynamics, thereby explaining changes in traffic flow. In summary, our contribution is three-fold:
We model the fundamental physical mechanism of urban dynamics using potential energy fields, and introduce the physical mechanism into a data-driven deep learning model for traffic prediction. To the best of our knowledge, this is the first work that proposes a physics-based and data-driven mixed, i.e., physics-guided, deep learning model for traffic flow prediction on road networks.
We propose a novel hybrid deep learning model, STDEN, that unifies the traffic potential energy field DE and neural networks into one framework. This modeling paradigm may cast light on other DE-based applications, such as weather forecasting and epidemic prediction.
We conduct extensive experiments on three real-world traffic datasets, and the proposed method achieves significant improvement over state-of-the-art baselines. Moreover, a case study confirms that the learned potential energy field can reveal the physical mechanism of traffic flow and provide interpretability for the deep traffic prediction model.

Preliminaries

We study the traffic flow prediction problem over urban road networks. A list of major symbols is in Table 1.

Definition 1 (Road Network).

A Road Network is a directed graph , where is a set of nodes, is a set of edges, and is a weighted adjacency matrix. A node represents a road junction or a road end, while an edge represents a directed road segment from node to node .

Definition 2 (Traffic Flow).

We define Traffic Flow as a feature of edges in the road network. Given an edge , the overall traffic flow during a give time period is denoted as . We express the traffic flow of the whole road network as a vector . is the size of the edge set.

Sym. Domain Descriptions
Number of nodes in a road network
Adjacency matrix of a road network
Traffic flow of a road network at time
Potential field of a road network at time
Energy density, energy flux
Node volume
Contribution ratio of traffic flow
Table 1: List of major symbols and descriptions.
Illustration of traffic flow and potential energy field defined on road networks. The arrow indicates the traffic flow direction while its size denotes the flow volume. In panel (b), higher cylinder means more potential energy, and the traffic flow volume (arrow size) increases with the energy gradients between adjacent nodes.
Figure 1: Illustration of traffic flow and potential energy field defined on road networks. The arrow indicates the traffic flow direction while its size denotes the flow volume. In panel (b), higher cylinder means more potential energy, and the traffic flow volume (arrow size) increases with the energy gradients between adjacent nodes.
Definition 3 (Traffic Potential Energy Field (PEF)).

For each node of a road network , we define the Traffic Potential Energy as its feature. The Traffic Potential Energy Field on the whole road network is denoted as .

As shown in Figure 1, the potential energy field on the road network is the latent dominated force of the traffic flow, which is similar to the gravity field driving water flow. The traffic flow of the corresponding edge is the potential energy gradient between adjacent nodes,

(1)

where is the graph gradient operator, and the negative sign ahead of indicates the direction of flow. According to Eq. (1), the traffic flow on the road network can be explained as a “energy transport” process of the traffic potential energy field. This is a fundamental insight of our model.

Definition 4 (Flow-sequence and PEF-sequence).

We divide time as regular time slices. Let represent traffic flow observed at time slice . Flow-sequence is the time series of traffic flow , while PEF-sequence is that of PEF .

Problem Definition

Based on the basic concepts above, we formally define the problem of traffic flow prediction as follows.
Input: The history flow-sequence from time to , , the future flow-sequence from time to , , and the corresponding road network .
Output: A model satisfying .
Objective: Minimizing prediction errors of training data.

Physics-Guided Traffic Flow Modeling

The Model Framework

Data-driven methods directly model the correlation between and to generate predictions. We innovatively propose a physics-guided traffic flow prediction framework (see Figure 2), consisting of two parts: an explicit deep learning model STDEN and an implicit physical dynamic process PGFM. In PGFM, i.e.,Physics-Guided traffic Flow Modeling, we use a physics-based continuity equation to model the transformation between the PEF and the traffic flow (denoted as PF-Trans in Figure 2). Details of the implicit PGFM will be given in this section.

Over the implicit physical dynamic process, we implement a deep neural network model,  Spatio-Temporal Differential Equation Network (STDEN), which contains three components: an RNN-based network to encode the traffic flow-sequence as the initial state of PEF, a DE network to predict the evolution of the PEF, and a decoder governed by Eq. (1) to generate traffic flow from the predicted PEF. Note the layers of DE-Net correspond to the dynamic of potential energy in PGFM. Details of STDEN are in the next section.

In our model, the physical dynamic process and the deep learning model are unified under the same framework, that is why we call our model a “physics-guided” neural network.

Overview of the proposed physics-guided model. STDEN: Spatio-Temporal Differential Equation Network. PGFM: Physics-Guided traffic Flow Modeling. PF-Trans: transformation between the PEF and traffic flow (Eq. (
Figure 2: Overview of the proposed physics-guided model. STDEN: Spatio-Temporal Differential Equation Network. PGFM: Physics-Guided traffic Flow Modeling. PF-Trans: transformation between the PEF and traffic flow (Eq. (5)).

Physics-Based Continuity Equation

In this section, we use a continuity equation to model the relations between the flow-sequence and PEF-sequence. First, we provide a brief introduction to the continuity equation.

In physics, the continuity equation describes the transport of some physical quantity, such as mass, energy, momentum, electric charge Lienhard and Lienhard (2008). Here we take the transport of energy as an example. Using the continuity equation, the energy transport process over a set of locations could be described as

(2)

where is the energy density (energy per unit volume), is the Energy Flux (a measure of energy “transport”), and is the divergence operator. The differential equation in Eq. (2) gives a relation between the volume of the energy and the “transport” of that energy, i.e., the change of energy density leads to energy transport in the space. For example, heat always transports from hot locations to cold locations.

Continuity Equation for Traffic PEF

The traffic flow driven by traffic potential energy fields in a road network is naturally a specific example of the continuity equation. In Table 2, we draw an analogy between the potential energy-driven traffic flow and the energy continuity equation, where traffic flow on a road network could be considered as energy transport within a Potential Energy Field. In this section, we propose a continuity equation for traffic PEF to describe the dynamic relations between flow-sequence and PEF-sequence of a road network.

Potential energy field Energy field
Potential energy per unit volume Energy density
Traffic flow Energy flux
Table 2: Analogy from potential energy-driven traffic flow to energy continuity equation.

Energy Density and Traffic Potential Energy. Given a road network , for , we define it having a Energy Density . The potential energy of the is proportional to its energy density as , where is the trainable node volume. The node volume is determined by the endogenous feature of the node, which is in analogy with the mass in the gravity field. For all nodes in , we have the relation between the potential energy and the energy density

(3)

where and is the Hadamard product.

Energy Flux and Traffic Flow. In a traffic system defined on , the traffic potential energy can only be transported along the edges (road segments) in the edge set . So we define the Energy Flux of as . We consider the traffic flow as the major component of the energy flux , and introduce a shared parameter to measure the contribution ratio of the traffic flow to energy flux for every edge,

(4)

where and .

Potential Energy DE Function. Plugging Eq. (3) and (4) into the energy continuity equation in Eq. (2), we have

(5)

which is the continuity equation for energy transport in the traffic potential energy field. According to Eq. (1), traffic flow on edges of a road network is the gradient of potential energy between adjacent nodes, i.e.,. Using it to replace the traffic flow in Eq. (5), we have

(6)

This function is a Differential Equation (DE) about the potential energy field , so we name it as Potential Energy Field DE. The graph Laplacian operator is given by the divergence of the gradient Bronstein et al. (2017), i.e.,, so the potential energy field DE can be transformed into

(7)

Physics Interpretation of the Potential Energy Field DE. Eq. (7) is the dynamical equation to express the evolution of the PEF-sequence . From a discrete perspective, Eq. (7) could be expressed as the form of

(8)

which gives an evolution trajectory of the PEF-sequence .

Spatio-Temporal Differential Equation Network

In Eq. (7), the evolution of PEF-sequence is expressed as a Potential Energy Field DE form. In this section, we implement Eq. (7) using a neural network approach to enhance the modeling capability of the potential energy DE for real-world traffic data. The framework of our model is in Figure 2.

Differential Equation Network

Our method is based on the neural ordinary Differential Equation Network (DE-Net) Chen et al. (2018), which is a kind of model that generalizes standard layer-to-layer neural networks as a continuous form. Specifically, in standard residual networks He et al. (2016), the layer-to-layer state update process is in the form of

(9)

where is hidden state of (i.e., layer outputs) of the -th layer222In our model, the layer of DE-Net just corresponds to time slices, so we use as the index of the network layers in Eq. (9).. is the repeated network structure of the residual networks and is the network parameters at layer .

Eq. (9) could be rewritten as a generalized form as

(10)

where is the step size and its value is 1 in residual networks. When , the update process of state becomes

(11)

which is a continuous version of the residual networks. In Eq. (11), the deep residual neural network becomes a dynamic system that is governed by an ordinary differential equation Ruthotto and Haber (2019); Lu et al. (2018). Moreover, the function is a neural network, which provides powerful representation learning capacity for complex data.

DE-Net for Traffic Potential Energy Fields

DE-Net on Potential Energy Fields. Inspired by the neural ordinary differential equation network, we model the potential energy field DE in Eq. (7) as,

(12)

where represents all trainable parameters including and . The function is a neural network guided by the physics model in Eq. (7). According to Eq. (7), we express the function as a residual graph convolution network (GCN) form, where the repeated neural network layer is in the form of

(13)

where is the graph Laplacian operator to calculate the differences between the state of the node and its neighbor’s. This is equivalent to using as a convolution kernel to aggregate the states of nodes in a receptive field. is a Hyperbolic Tangent activation function. The results of the convolution are combined using the weights from .

From the spatial perspective, if we set as a discrete value, Eq. (13) is equivalent to a residual GCN, where inputs of each layer are for all nodes of the road network. From the temporal perspective, the time is continuous, meaning we can calculate for any . Therefore, we name the proposed model based on the differential equation network in Eq. (13) as Spatio-Temporal DE Network.

Encode Traffic Flow into Potential Energy Fields. In our model, the PEF-sequence can be calculated using a neural ODE solver Chen et al. (2018) for a given initial state ,

(14)

where is sampled from a distribution . We implement the distribution as a conditional probability distribution of historical traffic flow sequence . Specifically, we let is generated from a Gaussian distribution, where the mean and standard deviation are determined by the historical traffic flow sequence as

(15)

We employ Gated Recurrent Unit (GRU) Chung et al. (2014) as encoder to extracts information from . is a fully connected network to translate the final hidden states of GRU into the mean and standard deviation of .

To achieve a differentiable “sampling” operation, we adopt a reparametrization trick Kingma and Welling (2014) to implement generation process of in Eq. (15). In specific, given a batch of training data, we calculate of each node as

(16)

where is sampled from a standard normal distribution . In this way, for a given batch of training data are fixed, and therefore, Eq. (16) is differentiable in backpropagation algorithm for neural network training. In the prediction phase, the is sampled for every input example.

Generate Traffic Flow from Potential Energy Fields. Given the initial , we can calculate the entire PEF-sequence for future time steps. Next, we generate the flow-sequence from by Eq. (1).

The Model Training

With the pipeline introduced above, we build a physics-guided latent variable model entitled Spatio-Temporal Differential Equation Network (STDEN). Using the backpropagation algorithm, the entire framework can be trained in an end-to-end manner by minimizing the negative log-likelihood of the predicted traffic flow-sequence with the ground truth in training data. The only difference compared with the training of standard neural network is the forward propagation of the DE-Net part needs to calculate using the neural ODE solver in Eq. (14).

Remark: In our model, the physical generation process of traffic flow in a potential energy field is expressed as deep residual GCN based DE-Net, providing a good explanation for our model structure. In other words, our model is not a complete “black-box” as other deep learning models. It could be considered as a kind of physics-guided generative model and therefore be expected to have better performance. Moreover, the elaborate residual DE-Net structure and the measure of uncertainty in potential energy fields also have the potential to improve the prediction performance.

Experiments

T Metric HA VAR GRU STGCN DCRNN GWNET AGCRN MTGNN LODE OLSTM STDEN
GT-221 15 min MAE 1.324 1.125 0.988 0.976 0.976 0.967 0.968 0.962 0.981 0.978 0.865
RMSE 1.835 1.581 1.511 1.528 1.520 1.516 1.502 1.505 1.531 1.522 1.317
MAPE 61.47 52.34 42.77 41.40 41.10 40.70 41.18 40.88 42.11 42.87 36.72
30 min MAE 1.324 1.141 1.000 0.988 0.994 0.980 0.981 0.976 0.992 0.986 0.872
RMSE 1.835 1.620 1.541 1.552 1.553 1.540 1.525 1.531 1.544 1.561 1.328
MAPE 61.47 52.03 42.95 42.08 41.75 41.23 41.73 41.40 42.71 41.80 37.37
1 hour MAE 1.324 1.164 1.018 1.008 1.020 1.006 1.004 1.003 1.011 1.007 0.896
RMSE 1.835 1.835 1.578 1.585 1.601 1.581 1.561 1.576 1.588 1.579 1.360
MAPE 61.47 51.51 43.29 43.20 42.46 42.12 42.79 42.36 43.28 43.22 39.04
WRS-393 15 min MAE 1.239 1.070 0.823 0.803 0.803 0.801 0.799 0.792 0.818 0.809 0.730
RMSE 1.735 1.509 1.393 1.400 1.386 1.390 1.382 1.376 1.402 1.391 1.241
MAPE 64.08 55.51 35.52 33.20 33.51 33.50 33.28 32.91 35.33 35.28 31.62
30 min MAE 1.239 1.097 0.837 0.818 0.826 0.818 0.814 0.807 0.827 0.818 0.737
RMSE 1.735 1.568 1.429 1.436 1.435 1.427 1.414 1.411 1.433 1.428 1.244
MAPE 64.08 55.72 36.00 33.69 34.46 33.95 33.96 33.34 35.77 35.12 32.04
1 hour MAE 1.239 1.139 0.856 0.841 0.858 0.845 0.841 0.834 0.853 0.848 0.745
RMSE 1.735 1.653 1.477 1.490 1.500 1.488 1.468 1.469 1.482 1.478 1.266
MAPE 64.08 56.01 36.10 34.31 35.83 34.37 34.93 34.01 35.87 35.14 33.25
ZGC-564 15 min MAE 1.120 0.978 0.729 0.714 0.715 0.716 0.709 0.708 0.723 0.718 0.623
RMSE 1.522 1.402 1.229 1.218 1.230 1.232 1.210 1.207 1.226 1.219 1.026
MAPE 62.68 53.72 33.82 32.63 31.99 31.31 32.19 32.64 32.98 32.75 28.81
30 min MAE 1.120 0.991 0.734 0.724 0.727 0.725 0.717 0.714 0.730 0.725 0.628
RMSE 1.522 1.393 1.242 1.241 1.258 1.255 1.228 1.222 1.263 1.252 1.036
MAPE 62.68 53.64 33.99 33.13 32.34 31.32 32.66 32.90 33.78 32.65 29.14
1 hour MAE 1.120 1.019 0.747 0.738 0.746 0.743 0.733 0.731 0.742 0.740 0.657
RMSE 1.522 1.441 1.266 1.272 1.298 1.296 1.259 1.255 1.281 1.274 1.033
MAPE 62.68 53.85 34.55 33.78 32.86 32.50 33.24 33.54 33.98 33.36 31.58
Table 3: Model comparison on metrics MAE/RMSE/MAPE, where MAPE is in %. Our STDEN significantly outperforms all competing baselines with regard to all metrics over all datasets according to Student’s -test at level 0.01.

Datasets

We evaluate the performance of our model over the real-world urban traffic dataset collected by the Beijing Municipal Commission of Transport, which contains trajectories of 40,000 taxies in Beijing from April 1st 2015 to July 31st 2015 (totally 4 months). These trajectories mapped to the road networks using the map matching algorithm. We statistic the traffic flow by counting the number of taxis on each road segment during every 5-minute time interval, resulting in 288 data points per day.

Due to Beijing road networks are too complex, we select three sub-networks to construct datasets of our experiments. Without loss of dataset diversity, the selected sub-networks have different urban functions. The first one is a well-known entertainment area, i.e., Gong Ti (Workers’ Stadium), which has 221 road segments, the second is the area around Beijing West Railway Station, which has 393 road segments, and the last area is around the biggest business park in Beijing, i.e., Zhongguancun (China Silicon Valley), which has 564 road segments. We denote the three datasets as GT-221, WRS-393, and ZGC-564 respectively. We split each dataset into the training, validation, and test sets with a ratio of 7:1:2. For multi-step prediction, we use one-hour historical traffic flow data (12 time steps) to predict the next hour’s.

Experimental Settings

Baselines. We consider ten baselines that belong to three classes. (1) Time series modeling: We take Historical Average (HA), Vector Auto-Regression (VAR) and GRU as baselines. The history traffic flow-sequence are treated as purely time series to predict the futures state without consideration of spatial information. (2) Graph-based spatio-temporal methods: The classical graph-based tarffic prediction methods such as Diffusion Convolution Recurrent Neural Network (DCRNN) Li et al. (2018), Spatial-Temporal Graph Convolutional Network (STGCN) Yu et al. (2018) and Graph WaveNet (GWNET) Wu et al. (2019), and state-of-the-art models such as Adaptive Graph Convolutional Recurrent Network (AGCRN) Bai et al. (2020) and MTGNN Wu et al. (2020) are used for comparison. (3) Approaches based on neural differential equation networks: Here we use two classical methods Latent-ODE (LODE) Rubanova et al. (2019) and ODE-LSTM (OLSTM) Lechner and Hasani (2020) for comparison. Latent-ODE generalizes RNNs to have continuous-time hidden dynamics defined by ordinary differential equations (ODEs). ODE-LSTM is a novel long short term memory network, that possesses a continuous-time output state, and consequently modifies its internal dynamical flow to a continuous-time model.

Settings. The settings of STDEN contains the following two parts: (1) Settings of the DE-Net part. We model the dynamics of potential energy in latent space using an adaptive method  Dormand and Prince (1980), and conduct grid search on the latent dimension over . (2) Settings of the encoder. GRU is used to encode the distribution of the initial value of the PEF-sequence. The number of hidden units in GRU is searched over . More implementation details about our STDEN and other baselines settings are given in Appendix. We conduct experiments of all deep learning models with 7 different seeds and report the mean results.

Performance Comparison

Table 3 shows the comparison of different approaches for 15 minutes, 30 minutes, and 1 hour ahead forecasting on three datasets. These methods are evaluated by three commonly used metrics in traffic flow prediction, including mean absolute error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE).

There are four observations from Table 3. (1) The graph neural network-based spatio-temporal methods generally outperform the time series models, which emphasizes the importance of modeling the spatial correlations of road networks for traffic prediction. (2) Our STDEN improves spatio-temporal methods with a significant margin (an average 10.29%/13.49%/6.03% improvement on MAE/RMSE/MAPE compared with the second best method) and achieves the best performance for all horizons on all the metrics, which shows the effectiveness of the potential energy field DE to model the continuous spatial and temporal dynamics. (3) The approaches based on purely neural differential equation network are not effective than the spatio-temporal ones. Because they ignore the spatial correlation which is important to traffic flow prediction. However, they outperform the traditional time series methods. (4) Traditional methods including HA and VAR are not good enough due to their incapability of handling complex and non-linear spatio-temporal data. Besides, the performance of HA is invariant since this method does not depend on short-term data.

Ablation Study

To better illustrate the effectiveness of the Potential Energy Field DE in Eq. (7), we compare STDEN with the following variants: (1) UnkP, which means unknown physics and replaces the potential energy field DE with a fully connected neural network. (2) IncP, which denotes incomplete physics and ignores the energy volume factor in the potential energy field DE, making it incomplete.

Evaluation on potential energy field differential equation over all datasets.
Figure 3: Evaluation on potential energy field differential equation over all datasets.

Figure 3 shows the comparison of the two variants with regard to all metrics for different datasets. From the results, we have the following observations: (1) STDEN surpasses NoP by a large margin, demonstrating the superiority of deploying potential energy fields to model traffic flow. (2) That IncP beats UnkP shows the effectiveness of the potential energy field DE. The guidance of physical process expressed by the potential energy field DE introduces the diffusion process of energy in space. This allows IncP to capture the changing trend of potential energy fields throughout the road network. (3) However, IncP performs slightly worse than STDEN because of the absence of the energy volume factor . Without , IncP has to infer the potential energy only through the energy density, which is as hard as to calculate the mass of an object from density without object volume.

Computation overhead vs. Prediction accuracy. NFE denotes number of function evaluation.
(a) Epochs vs. NFE (GT-221).
Computation overhead vs. Prediction accuracy. NFE denotes number of function evaluation.
(b) Epochs vs. NFE (WRS-393).
Computation overhead vs. Prediction accuracy. NFE denotes number of function evaluation.
(c) Epochs vs. NFE (ZGC-564).
Computation overhead vs. Prediction accuracy. NFE denotes number of function evaluation.
(d) NFE vs. MAE (GT-221).
Computation overhead vs. Prediction accuracy. NFE denotes number of function evaluation.
(e) NFE vs. MAE (WRS-393).
Computation overhead vs. Prediction accuracy. NFE denotes number of function evaluation.
(f) NFE vs. MAE (ZGC-564).
Figure 4: Computation overhead vs. Prediction accuracy. NFE denotes number of function evaluation.

Computation Cost

During the solving process of the differential equation network, we utilize an ODE solver which allows our method to dynamically balance the trade-off between prediction accuracy and the computation cost. As shown in Figure 4(a), 4(b) and 4(c), required number of function evaluation (NFE) increases consistently with the epochs, there is no stable stage because we set early stopping for the training process. Note that NFE varies with the difficulty of tasks. For example, flow prediction of GT-221 is the most complicated among all three tasks because the traffic flow in GT-221 changes more drastically. Therefore, the NFE is around 80% more than that of ZGC-564. From Figure 4(d), 4(e) and 4(f), it can be observed that the more evaluation (NFE), the lower the prediction error our method can achieve. This allows us to trade accuracy for faster response for emergency events during inference phase, which is very valuable in practice.

Case Study

Visualization of the learned potential energy fields and real traffic flow on GT-221 dataset. The heat map represents the potential energy fields, while the arrows denote traffic flow with its volume reflected by the color and the arrow size. The potential energy fields learned by STDEN can interpret the traffic flow.
Figure 5: Visualization of the learned potential energy fields and real traffic flow on GT-221 dataset. The heat map represents the potential energy fields, while the arrows denote traffic flow with its volume reflected by the color and the arrow size. The potential energy fields learned by STDEN can interpret the traffic flow.

In this part, we qualitatively analyze why our STDEN can yield good performance. To this end, we visualize the learned potential energy and the real traffic flow in Figure 5.

Figure 5(a) and (c) shows the potential energy learned by STDEN and UnkP by a heat map, with real traffic flows at the corresponding moment represented by arrows. To see more clearly how the potential energy drives traffic flow, we select loop areas with complex traffic for detailed analysis. In Figure 5(b), traffic always flows along the road network from a place with high potential energy to a place with low potential energy. Besides, the gradient of potential energy roughly reflects the relative magnitude of the traffic flow. This shows that potential energy governed by physical equation captures the mechanism of traffic flow and can be interpreted as a force that drives traffic flow. However, without the guidance of potential energy field DE, the energy learned by neural networks in UnkP (Figure 5(d)) has no physical meaning and can not indicate the traffic flow mechanism. For example, there are some traffic flows that transport from a low-value node to a high-value node in Figure 5(d), which violates the physical constraint of the energy transport process.

In a word, the results in this section verifies that STDEN can capture the physical mechanism of traffic flow (Figure 5) and generate accurate predictions (Table 3) under the guidance of the potential energy field DE. This is because we combine the advantages of physics-based and data-driven methods.

Related Work

Traffic Prediction. Traffic prediction problem has been studied for decades, and existing methods mainly fall into two categories: physics-based and data-driven. In the former one, researchers apply different branches of traffic flow theory depending on the application problems Ni (2015), such as the kinematic wave theory Daganzo and Laval (2005), the car-following theory Olstam and Tapani (2004), and the queuing theory Cascetta (2013). However, they may only capture limited dynamics of real-world traffic, resulting in low-quality estimation of traffic flow. The data-driven approaches have drawn considerable attentions Xie et al. (2020). The shallow machine learning methods for traffic prediction usually base on the stationary assumptions (e.g., ARIMA and Kalman filteringLippi et al. (2013)), leading to limited representation power. Deep learning methods are free from stationary assumptions and effective to capture complex non-linearity using models such as recurrent neural networks Li et al. (2018) and temporal convolutional networks Wu et al. (2019); Li and Zhu (2021). Because traffic data is spatial correlated, CNN Tang et al. (2020) and its extension to arbitrary graphs Song et al. (2020); Tian and Chan (2021) are utilized to capture spatial correlations. Although temporal dependencies and spatial correlations have been considered in these methods, the lack of physical knowledge leads to a lack of generalization ability to out-of-sample scenarios.

Physics-Guided Deep Learning. Many recent studies have proposed to integrate physics-based modeling approaches with state-of-the-art deep learning techniques, giving birth to a field called “Physics-Guided Deep Learning”. One can introduce additional physics-based penalty in loss function of neural networks Shi et al. (2021). Some efforts also lie in combining physics-based models with deep learning. For example, Wang et al. (2020) presents a hybrid framework that combines turbulent flow simulation with deep learning. Ji et al. (2020) introduces the physical potential energy field concept into deep learning to achieve grid-based urban traffic prediction. However physics-based models governed by differential equations are usually continuous in time, while deep learning are dominated by discrete models Ruthotto and Haber (2019). Recent advances propose a treatment of neural networks equipped with a continuum of layers Chen et al. (2018), allowing a more accurate and natural modeling of physical principles in real world, e.g., hydropower generation Zhou et al. (2020) and reservoir flow Zhou and Li (2021). To the best of our knowledge, we are the first to introduce physics-guided deep learning into road network-based traffic flow prediction.

Conclusion and Future Work

In this paper, we introduced potential energy fields as the dominant force to drive traffic flows and derived an differential equation to describe the physical mechanism of the traffic potential energy fields. Based on the differential equations, we proposed a novel Spatio-Temporal Differential Equation Network (STDEN), blending deep learning into physical mechanism modeling, for physics-guided traffic flow prediction. Extensive experiments on three real-world traffic datasets demonstrated the effectiveness of the proposed STDEN. A case study further verified that our model can capture the mechanism of urban traffic and generate accurate predictions with physical meaning. However, we have noticed that the major efficiency bottleneck of our model is the evolution modeling of potential energy fields. In the future, we plan to reduce the number of function evaluations in ODE solver while preserving the model performance, and explore STDEN on more datasets.

Acknowledgments

The work of J. Ji, J. Wang, J. Jiang and H. Zhang was supported by the National Key R&D Program of China (2019YFB2101804), the National Natural Science Foundation of China (Grant No. 72171013, 82161148011, 92046010), CCF-DiDi Gaia Collaborative Research Funds for Young Scholars, and the Fundamental Research Funds for the Central Universities (Grant No. YWF-21-BJ-J-839).

References

  • L. Bai, L. Yao, C. Li, X. Wang, and C. Wang (2020) Adaptive graph convolutional recurrent network for traffic forecasting. NeurIPS 33. Cited by: Experimental Settings.
  • M. M. Bronstein, J. Bruna, Y. LeCun, A. Szlam, and P. Vandergheynst (2017) Geometric deep learning: going beyond euclidean data. SPM 34 (4), pp. 18–42. Cited by: Continuity Equation for Traffic PEF.
  • E. Cascetta (2013) Transportation systems engineering: theory and methods. Vol. 49, Springer Science & Business Media. Cited by: Related Work.
  • R. T. Q. Chen, Y. Rubanova, J. Bettencourt, and D. Duvenaud (2018) Neural ordinary differential equations. NeurIPS. Cited by: Introduction, Differential Equation Network, DE-Net for Traffic Potential Energy Fields, Related Work.
  • J. Chung, C. Gulcehre, K. Cho, and Y. Bengio (2014) Empirical evaluation of gated recurrent neural networks on sequence modeling. In NeurIPS, Cited by: DE-Net for Traffic Potential Energy Fields.
  • C. F. Daganzo and J. A. Laval (2005) Moving bottlenecks: a numerical method that converges in flows. Transportation Research Part B: Methodological. Cited by: Related Work.
  • J. R. Dormand and P. J. Prince (1980) A family of embedded runge-kutta formulae. Journal of computational and applied mathematics 6 (1), pp. 19–26. Cited by: Experimental Settings.
  • K. He, X. Zhang, S. Ren, and J. Sun (2016) Deep residual learning for image recognition. In CVPR, pp. 770–778. Cited by: Differential Equation Network.
  • J. Ji, J. Wang, Z. Jiang, J. Ma, and H. Zhang (2020) Interpretable spatiotemporal deep learning model for traffic flow prediction based on potential energy fields. In ICDM, Cited by: Related Work.
  • D. P. Kingma and M. Welling (2014) Auto-encoding variational bayes. stat 1050, pp. 1. Cited by: DE-Net for Traffic Potential Energy Fields.
  • M. Lechner and R. Hasani (2020) Learning long-term dependencies in irregularly-sampled time series. NeurIPS. Cited by: Experimental Settings.
  • M. Li and Z. Zhu (2021) Spatial-temporal fusion graph neural networks for traffic flow forecasting. In AAAI, Cited by: Related Work.
  • T. Li, J. Zhang, K. Bao, Y. Liang, Y. Li, and Y. Zheng (2020) Autost: efficient neural architecture search for spatio-temporal prediction. In KDD, pp. 794–802. Cited by: Introduction.
  • Y. Li, R. Yu, C. Shahabi, and Y. Liu (2018) Diffusion convolutional recurrent neural network: data-driven traffic forecasting. In ICLR, Cited by: Introduction, Experimental Settings, Related Work.
  • J. I. Lienhard and J. Lienhard (2008) DOE fundamentals handbook: thermodynamics, heat transfer, and fluid flow. Washington, DC: US Department of Energy. Cited by: Introduction, Physics-Based Continuity Equation.
  • M. Lippi, M. Bertini, and P. Frasconi (2013) Short-term traffic flow forecasting: an experimental comparison of time-series analysis and supervised learning. T-ITS 14 (2), pp. 871–882. Cited by: Related Work.
  • Y. Lu, A. Zhong, Q. Li, and B. Dong (2018) Beyond finite layer neural networks: bridging deep architectures and numerical differential equations. In ICML, pp. 3276–3285. Cited by: Differential Equation Network.
  • Z. Mo, R. Shi, and X. Di (2021) A physics-informed deep learning paradigm for car-following models. Transportation Research Part C: Emerging Technologies 130, pp. 103240. Cited by: Introduction.
  • D. Ni (2015) Traffic flow theory: characteristics, experimental methods, and numerical techniques. Butterworth-Heinemann. Cited by: Introduction, Related Work.
  • J. J. Olstam and A. Tapani (2004) Comparison of car-following models. Vol. 960, Swedish National Road and Transport Research Institute Linköping, Sweden. Cited by: Related Work.
  • Y. Rubanova, R. T. Chen, and D. Duvenaud (2019) Latent odes for irregularly-sampled time series. In NeurIPS, Cited by: Experimental Settings.
  • L. Ruthotto and E. Haber (2019) Deep neural networks motivated by partial differential equations. Journal of Mathematical Imaging and Vision, pp. 1–13. Cited by: Differential Equation Network, Related Work.
  • R. Shi, Z. Mo, and X. Di (2021) Physics-informed deep learning for traffic state estimation: a hybrid paradigm informed by second-order traffic models. In AAAI, Cited by: Related Work.
  • C. Snyder and M. Do (2019) Streets: a novel camera network dataset for traffic flow. In NeurIPS, pp. 10242–10253. Cited by: Introduction.
  • C. Song, Y. Lin, S. Guo, and H. Wan (2020) Spatial-temporal synchronous graph convolutional networks: a new framework for spatial-temporal network data forecasting. In AAAI, pp. 914–921. Cited by: Introduction, Related Work.
  • X. Tang, H. Yao, Y. Sun, C. Aggarwal, P. Mitra, and S. Wang (2020) Joint modeling of local and global temporal dynamics for multivariate time series forecasting with missing values. In AAAI, pp. 5956–5963. Cited by: Introduction, Related Work.
  • C. Tian and W. K. Chan (2021) Spatial-temporal attention wavenet: a deep learning framework for traffic prediction considering spatial-temporal dependencies. IET Intelligent Transport Systems 15 (4), pp. 549–561. Cited by: Introduction, Related Work.
  • R. Wang, K. Kashinath, M. Mustafa, A. Albert, and R. Yu (2020) Towards physics-informed deep learning for turbulent flow prediction. In KDD, pp. 1457–1466. Cited by: Introduction, Related Work.
  • Z. Wu, S. Pan, G. Long, J. Jiang, and C. Zhang (2019) Graph wavenet for deep spatial-temporal graph modeling. In IJCAI, Cited by: Introduction, Experimental Settings, Related Work.
  • Z. Wu, S. Pan, G. Long, J. Jiang, X. Chang, and C. Zhang (2020) Connecting the dots: multivariate time series forecasting with graph neural networks. In KDD, pp. 753–763. Cited by: Experimental Settings.
  • P. Xie, T. Li, J. Liu, S. Du, X. Yang, and J. Zhang (2020) Urban flow prediction from spatiotemporal data using machine learning: a survey. Information Fusion 59, pp. 1–12. Cited by: Related Work.
  • B. Yu, H. Yin, and Z. Zhu (2018) Spatio-temporal graph convolutional networks: a deep learning framework for traffic forecasting. In IJCAI, Cited by: Experimental Settings.
  • F. Zhou, L. Li, K. Zhang, G. Trajcevski, F. Yao, Y. Huang, T. Zhong, J. Wang, and Q. Liu (2020) Forecasting the evolution of hydropower generation. In KDD, pp. 2861–2870. Cited by: Related Work.
  • F. Zhou and L. Li (2021) Forecasting reservoir inflow via recurrent neural odes. In AAAI, Cited by: Related Work.