# A Physics-Informed Deep Learning Paradigm for Car-Following Models

Zhaobin Mo  Rongye Shi  Xuan Di<EMAIL_ADDRESS>Department of Civil
Engineering and Engineering Mechanics, Columbia University  Data Science
Institute, Columbia University

###### Abstract

Car-following behavior has been extensively studied using physics-based
models, such as Intelligent Driving Model (IDM). These models successfully
interpret traffic phenomena observed in the real world but may not fully
capture the complex cognitive process of driving. Deep learning models, on the
other hand, have demonstrated their power in capturing observed traffic
phenomena but require a large amount of driving data to train. This paper aims
to develop a family of neural network based car-following models that are
informed by physics-based models, which leverage the advantage of both
physics-based (being data-efficient and interpretable) and deep learning based
(being generalizable) models. We design physics-informed deep learning car-
following model (PIDL-CF) architectures encoded with 4 popular physics-based
models -  the IDM, the Optimal Velocity Model, the Gazis-Herman-Rothery model,
and the Full Velocity Difference Model. Acceleration is predicted for 4
traffic regimes: acceleration, deceleration, cruising, and emergency braking.
The generalization of PIDL method is further validated using two
representative neural network models: the artificial neural networks (ANN) and
the long short-term memory (LSTM) model. Two types of PIDL-CF problems are
studied, one to predict acceleration only and the other to jointly predict
acceleration and discover model parameters. We also demonstrate the superior
performance of PIDL with the Next Generation SIMulation (NGSIM) dataset over
baselines, especially when the training data is sparse. The results
demonstrate the superior performance of neural networks informed by physics
over those without.

###### keywords:

Car-following models (CFM), Physics-informed deep learning (PIDL), Neural
networks

††journal: Transportation Research Part C††footnotetext: Accepted by
Transportation Research Part C (https://doi.org/10.1016/j.trc.2021.103240)

##  1 Motivation

Car following (CF) behavioral modeling, dated back to 1930s since
Greenshields’ pioneering paper (Greenshields et al., 1935), has long been
studied by the transportation community to reveal how human drivers react to
ambient traffic environment. Recent years have witnessed a growing interest of
modeling CF behavior using deep learning (DL) methods, thanks to big data
generated from a variety of sensors (Di and Shi, 2021). Understanding how
people drive is not only crucial to develop human-like autonomous driving
policies, but also to enhance the inference ability of autonomous vehicles in
the transition period when they have to drive alongside humans.

We categorize CF modeling methods into two categories: physics-based and data-
driven. Physics-based (also known as model-based or theory-based (Zhou and
Laval, 2019)) CF models refer to pre-designated mathematical functional forms
with a limited number of parameters. Physics-based driving models assume each
driver-vehicle unit behaves like an automated particle or automaton, within
which human cognitive process and the machine’s mechanical dynamics are highly
simplified. In microscopic models, cars are assumed to select their driving
velocity and acceleration dynamically based on the following distance from
their immediate leader, speed difference, and other features. The mathematical
tool is ordinary differential equation (ODE). The widely used car following
models (CFMs) include intelligent driver model (IDM) (Treiber et al., 2000a)
and optimal velocity model (OVM) (Bando et al., 1995).

Data-driven CF models refer to cutting-edge models that mimic human
intelligence, leveraging deep neural networks, reinforcement learning,
imitation learning, and other advanced machine learning methods. There is no
predesignated mathematical form and model training purely relies on
observations. A growing number of data-driven models employ (deep) neural
networks (NN). An artificial neural networks (ANN) model was first applied in
(Panwai and Dia, 2007) to model car-following behaviors, which showed that ANN
outperformed physics-based models like Gipps in terms of overall prediction
accuracy and robustness.  Data-driven models are also found to be able to
better capture the asymmetric car-following behaviors, which can not be well
solved by pure physics-based and data-driven methods. Recurent Neural Networks
(RNN) and Long Short-Term Memory (LSTM) model (Zhou et al., 2017a; Huang et
al., 2018a; Gu et al., 2020; Shou et al., 2020) are other paradigms of NN,
which leverage historic data and are able to learn the asymmetric behaviors
arising from driver’s different driving patterns in free-flow and stop-and-go
regimes.  Neural networks exploit no explicit traffic models nor make pre-
assumptions, and thus can be treated as an uninterpretable black box. They
also contain a large number of parameters, usually over hundreds or thousands.
Such a large parameter space is a two-sided sword. On one hand, it helps learn
and approximate a more realistic driving pattern. On the other hand, it
demands large training data and incurs high computational cost.

Both physics-based and data-driven models have their pros and cons. The
physics-based models may not be generalizable, because the predefined motion
heuristics usually make strong assumptions about driving behaviors with a
small set of parameters, which may not be able to capture human’s strategic
planning behaviors and may not generalize well to diverse driving scenarios in
a highly interactive environment. Data-driven models are data-hungry, meaning
that they require a large amount of driving data to calibrate. In addition,
lack of interpretability is a key shortcoming of these models. In other words,
the trained neural networks can not offer insights into how driving behavior
evolves as traffic environment changes. Moreover, compared to physics-based
models, the DL method is more vulnerable to data noise and unseen data.
Driving data, usually measured by GPS sensors, is generally sparse because of
high installation and data acquisition cost. Thus a paradigm that is data-
efficient and highly accuracy is preferred, especially in the advent of the
era of autonomous driving.  This paper aims to develop a family of NN based
CFMs that are informed by physics-based models, which leverage the advantage
of both physics-based (which is data-efficient and interpretable) and deep
learning based (which is generalizable) models.

The rest of the paper is organized as follows: Section 2 introduces the
related works and preliminaries of CFMs and PIDL. Section 3 introduces two
types of problems of PIDL for car-following modeling (PIDL-CF): one for
acceleration prediction only and one for joint prediction and parameter
discovery, within which each component of a PIDL-CF is introduced, including
architecture design, collocation point selection, loss function design, and
training algorithms. Section 4 demonstrates the robustness of PIDL-CF by
encoding two CFMs, namely IDM and OVM, and Section 5 evaluates the PIDL on the
NGSIM data. Section 6 concludes our work and projects future research
questions in this promising arena.

##  2 Related Work

Prior to delving into literature review, we will first define notations that
will be used for the rest of the paper.

###  2.1 Preliminaries of CFM

Denote ${\cal S}\subseteq\mathbb{R}_{+}^{m}$ and ${\cal
A}\subseteq\mathbb{R}_{+}^{n}$ as state and action spaces, respectively, where
$m\in\mathbb{N}_{+}$ and $n\in\mathbb{N}_{+}$ are the dimensions of state and
action vectors, respectively. A car-following model (CFM) is a mathematical
mapping parameterized by $\theta$, denoted as $f_{\theta}(\cdot|\theta)$, from
states $\mathbf{s}\in{\cal S}$ (i.e., observations of the traffic environment)
to actions $a\in{\cal A}$ (i.e., longitudinal accelerations):

$f_{\theta}:\mathbf{s}\longrightarrow a.$ (2.1)

The input of the CFM includes all possible signals $\mathbf{s}(t)$ at time $t$
from neighboring vehicles in the traffic environment, and its output is the
acceleration $a({t+\Delta t})$ at the next time step. The key question of CFMs
is to find an optimal set of parameters $\theta^{*}$ that best fit real-world
data. Modeling the driving policy mapping is categorized into physics-based
and DL-based. Physics-based mapping can be characterized by mathematical
formulas, while DL-based mapping is usually represented by deep neural
networks. Table 1 summarizes relevant models in these two categories, along
with a third category on the hybrid of these two.

Table 1: A summary of car-following models

Models |  Input |  Output |  Physics Model Parameters |  Reference
---|---|---|---|---
Physics-Based |  IDM |  $h,\Delta v,v$ |  $a$ |  desired velocity; desired time headway; minimum spacing; maximum acceleration; comfortable deceleration |  Treiber et al. (2000b); Ossen and Hoogendoorn (2011); Rahman et al. (2017); Huang et al. (2018b); Sharma et al. (2019)
|  OVM |  $h,v$ |  $a$ |  maximum velocity; safe distance |  Bando et al. (1995); Batista and Twrdy (2010); Jin and Orosz (2014); Lazar et al. (2016)
|  Gazis-Herman-Rothery (GHR) |  $h,\Delta v,v$ |  $a$ |  - |  Gazis et al. (1961); Zhu et al. (2020)
|  Gipps |  $h,\Delta v,v$ |  $v$ |  desired deceleration; desired acceleration; desired speed, etc |  Gipps (1981); Wilson (2001)
|  Helly |  $h,\Delta v,v$ |  $a$ |  safe distance |  Helly (1959)
|  Full velocity difference Model (FVDM) |  $h,\Delta v,v$ |  $a$ |  maximum velocity; safe distance |  Jiang et al. (2001); Jin et al. (2010)
|  Wiedemann /Fritzsche model |  $h,\Delta v,v$ |  $a$ |  stand still spacing and acceleration; desired time headway; additional safety distance, etc |  Wiedemann and Reiter (1992); Fritzsche (1994); Durrani et al. (2016); Wang et al. (2017)
|  Optimal control |  $h,\Delta v,v,a$ |  $a$ |  desired time headway; minimum spacing; safe distance |  Zhou et al. (2017b); Zhou and Ahn (2019); Zhou et al. (2019)
Data-Driven |  SVM |  $h,\Delta v,v$ |  $v$ |  - |  Wei and Liu (2013)
|  ANN |  $h,v$ |  $a$ |  - |  Panwai and Dia (2007)
|  LSTM /RNN |  A time series of $(h,\Delta v,v)$, images |  $a/v$ |  - |  Zhou et al. (2017a); Huang et al. (2018a); Gu et al. (2020)
|  KNN |  $h,\Delta v,v$ |  $v$ |  - |  He et al. (2015)
|  DDPG |  $h,\Delta v,v$ |  $a$ |  - |  Zhu et al. (2018)
|  GAIL |  $h,\Delta v,v$ |  $a$ |  - |  Kuefler et al. (2017); Zhou et al. (2020)
Hybrid |  Gipps + ANN |  $h,\Delta v,v$ |  $a$ |  maximum velocity |  Yang et al. (2018)
|  Physics Regularized Gaussian Process |  $x,v,a$ |  $a$ |  Parameters of GHR, Gipps, and other CFMs |  Yuan et al. (2020)
|  PIDL |  $h,\Delta v,v$ |  $a$ |  Parameters of the IDM, OVM, GHR, and FVDM |  this paper

  * 1.

Note. $x$, $h$, $v$, $a$ are the position, spacing, velocity, and acceleration
of the subject vehicle, respectively. $\Delta v$ is the velocity difference
between the subject vehicle and its leader. (In the “Physics Model
Parameters”, only parameters related to a physical meaning are listed.
Parameters like constant coefficients sensitivity parameters are not listed.)

####  2.1.1 Physics-based CFM

Calibration of a physics-based CFM can be formulated as an optimization
problem below:

$\begin{split}\min_{\theta}\quad&\>\sum_{t=\Delta
t}^{T}(a(t)-\hat{a}(t))^{2}\\\ \textrm{s.t.}\quad&a(t+\Delta
t)=f_{\theta}(\hat{\mathbf{s}}(t)|\theta),\quad t=0,\Delta
t,\ldots,T,\end{split}$ (2.2)

where,
$\hat{a}(t)$: ground-truth acceleration;
$a(t)$: estimated acceleration from a predefined mapping;
$\Delta t$: prediction horizon;
$T$: time horizon of one trajectory;
$f_{\theta}$: the mapping function, which can be any physics-based CFM, like
the Intelligent Driving Model (IDM) or the Optimal Velocity Model (OVM), which
are listed in Table 1.

####  2.1.2 DL-based CFM

The artificial neural network (ANN) is a widely used function approximator of
car-following behavior. It takes the states as input and the acceleration as
output. The general architecture of an ANN is shown in Fig. 1. In each layer,
each node linearly combines the outputs from the last layer, and passes it to
the next layer after a non-linear activation function $g(\cdot)$ is applied.
For example, if the $j$ th node in the $i$ th layer is connecting with all the
nodes in the $i-1$ th layer, its output is

$O^{(i)}_{j}=g(I^{(i)}_{j})=g(\sum_{k}w^{(i-1)}_{k,j}\cdot
O^{(i-1)}_{k}+b^{(i)}_{j}),$ (2.3)

where,
$I^{(i)}_{j}$: input of the $j$th node in the $i$th layer. For example,
$I^{(1)}_{1}$ denotes the spacing $h(t)$.
$O^{(i)}_{j}$: output of the $j$th node in the $i$th layer;
$O_{k}^{(i-1)}$: output of the $k$th node in the $i-1$th layer in a neural
network.
$b^{(i)}_{j}$: bias of the $j$th node in the $i$th layer;
$w^{(i-1)}_{k,j}$: weights stored in the link between the $k$ th node in the
$i-1$ th layer and the $j$ th node in the $i$ th layer
$g(\cdot)$: activation function.

Figure 1: Structure of the DL-based CFM.

###  2.2 Literature on PIDL

This paper aims to integrate both a mathematical formula and a neural network
into one framework to achieve a better prediction in car-following behavior,
which is physics-informed deep learning (PIDL).  PIDL has become a mainstream
research topic and its notion bears variants like “theory-guided data science”
(Karpatne et al., 2017), “model-informed machine learning” (Yu et al., 2021),
and “physics-informed deep learning” (Raissi et al., 2019a). Its popularity
lies in that it leverages the strengths of both physics-based and data-driven
models. More importantly, it can overcome the challenges of training data-
hungry DL models particularly arising from limited data, high cost of data
acquisition, imperfect data (such as missing data, outliers, complex noise
processes), and large parameter spaces of neural networks. Physics are usually
encoded as _governing equations_ , _physical constrains_ , or _regularity
terms_ in deep neural networks’ loss functions (Alber et al., 2019).  In the
pioneering work (Raissi, 2018; Raissi and Karniadakis, 2018), PIDL was
proposed as an alternative solver of partial differential equations (PDE).
Since its inception, PIDL has become an increasingly popular tool for data-
driven solution or discovery of nonlinear dynamical systems  (including
identification of a functional form of a physics-based model and calibration
of associated parameters defined in a physics-based model)  in various
engineering areas (Yang and Perdikaris, 2019; Raissi et al., 2019b; Fang and
Zhan, 2020; Raissi et al., 2020; Rai and Sahu, 2020). There is also a
gradually rising trend to encode ordinary differential equations (ODE) into
neural networks for approximation of ODE solutions (Di Giovanni et al., 2020)
or identification of dynamical system models (Roehrl et al., 2020).

While PIDL has increasingly demonstrated its predictive power in various
fields, transportation modeling is lagging behind in combining both models and
data aspects. In transportation, Shi et al. (2021a, b) encoded traffic flow
models into neural networks for traffic state estimation. The application of
PIDL to data-driven solution of car-following dynamical equations or system
identification of such behavior, however, is a largely unexploited area. A
related study (Wu and Work, 2018) used neural networks of different structures
to capture the general behavior of a car-following model and predict the
acceleration of a vehicle using velocity and distance information. This hybrid
method leverages the prior knowledge and outperforms the NN-based algorithm.
Yang et al. (2018) combined the Gipps model with DL-based models (back-
propagation neural networks and random forest, respectively) and optimal
weights of these two models are selected for collision avoidance of predicted
trajectories. The combined model can reconstruct trajectories that balance
authenticity and safety. In this combined model, Gipps model is not encoded
into the DL-based model, and they are independently trained instead. Apart
from NN-based model, Yuan et al. (2020) introduced a physics regularized
Gaussian process model by incorporating traditional CFMs into a Gaussian
Process model to predict driver accelerations. Their experiments show that the
developed model outperforms the pure Gaussian process model in terms of both
prediction accuracy and robustness.  In this study, we propose two ways of
hybridizing the physics into the neural networks, in which the physics is
encoded into the NN structure to regularize the training of the NN.

###  2.3 Contributions of this paper

Human driving exhibits highly unstable and nonlinear behaviors (Huang et al.,
2019, 2020) and accordingly, physics-based models alone may not suffice to
reveal highly nonlinear nature of driving behavior, leading to high bias. The
generic architecture of a PIDL consists of two computational graphs: one
neural network (i.e., the data-driven component) for predicting the unknown
solution, while the other (i.e., the physics-driven component), in which
physics are encoded into NN, for evaluating whether the prediction aligns with
the given physics. The physics encoded computational graph can be treated as a
regularization term of the other deep neural network to prevent overfitting,
i.e., high-variance. In summary, the hybrid of both components overcomes high-
bias and high-variance induced by the individual ones, rendering it possible
to leverage the advantage of both the physics-based and data-driven methods in
terms of model accuracy and data efficiency.

The PIDL paradigm opens up a promising research direction in driving behavior
modeling. However, the design of how physics can be encoded remains an open
question that varies domain by domain. This paper establishes the PIDL
paradigm using two-computational graphs for the customization of PIDL to the
identification of car-following behavior. We will explore how existing
physics-based CFMs can be leveraged in deep neural networks for improved car-
following behavior training and prediction.  Specifically, the main
contributions of this paper include:

  * 1.

Design PIDL architectures encoded with 2 popular physics-based models - IDM
and OVM, on which acceleration is predicted for 4 traffic regimes:
acceleration, deceleration, cruising, and emergency braking; We also include
other physics-based models - GHR and FVDM, to investigate how different
physics components affect the performance of PIDL.

  * 2.

Identify parameters used in CFMs by solving the PIDL problem of joint state
prediction and model parameter discovery. Most existing PIDL studies assume
physics-based models are calibrated prior to the training of neural networks,
which may lead to larger errors if physics are not calibrated accurately. Thus
we introduce the joint estimation problem and show that joint estimation leads
to a higher estimation accuracy than the prediction only one.

  * 3.

Demonstrate the generalization of PIDL methods by adopting two different NN
structures: ANN and LSTM. The results show that PIDL holds the potential to
enhancing the training efficiency and prediction accuracy of existing deep
learning methods by incorporating prior physical knowledge into the training
process.

  * 4.

Demonstrate the superiority of PIDL over pure physics-based and data-driven
models using a comprehensive set of numerical experiments and real-world data
(i.e., Next Generation SIMulation (NGSIM)). This hybrid paradigm outperforms
its two individual components across various training data, especially when
measurements are sparse.

##  3 PIDL for Identification of Car-Following Behavior

In this section, we provide a generic problem statement of PIDL for CFM, which
includes two types of problems: one is acceleration-prediction only and the
other is joint acceleration-prediction and model-parameter-discover.

###  3.1 Problem statement

Subsequently we denote the observed quantities with a hat, such as
$\hat{s},\hat{a}$, indicating that their values are observed.

Define two disjoint sets $\cal O$ and $\cal C$ where $\cal{O}\cap\cal
C=\emptyset,\cal O\cup\cal C\subseteq S$. $\cal O$ represents the observed
state space and $\cal C$ the (unobserved) collocation state space. They both
consist of a set of 3-dimensional state vectors ${\cal
O}=\\{\hat{\mathbf{s}}^{(i)}=(\hat{h}^{(i)},\Delta\hat{v}^{(i)},\hat{v}^{(i)}),i=1,...,N_{o}\\},{\cal
C}=\\{\mathbf{s}^{(j)}=(h^{(j)},\Delta v^{(j)},v^{(j)}),j=1,...,N_{c}\\}$,
where $N_{o}$ and $N_{c}$ are the size of observed states and collocation
states, respectively. Denote $\cal{A}$ as the observed action set, which
contains scalar accelerations ${\cal A}=\\{\hat{a}^{(i)},i=1,..,N_{o}\\}$,
where $N_{o}$ is the size of observed states. Note that the observed action
set shares the same size as the observed state set, because it is a one-to-one
mapping. A pair of observed state and action indexed by
$i\in\\{1,...,N_{o}\\}$ constitute one observation data, denoted as
$\\{\hat{\mathbf{s}}^{(i)},\hat{a}^{(i)}\\}\in\cal{O}\times\cal{A}$.

######  Note.

The existing literature uses various variables as input, but in this paper we
only use three variables, including the spacing $\hat{h}(t)$, velocity
difference $\Delta\hat{v}(t)$ and the velocity $\hat{v}(t)$ of the subject
vehicle at current time step. The PIDL framework can be easily generalized to
include higher dimensional input vectors.

Define a physics-uninformed neural network (PUNN) ${\cal N}_{\theta}$
parameterized by a hyperparameter vector ${\theta}$ that defines a function
approximator, $f_{\theta}(\hat{\mathbf{s}}|\theta)$, which maps observed
states to actions, which is, ${\cal N}_{\theta}\triangleq
f_{\theta}(\hat{\mathbf{s}}|\theta):\hat{\mathbf{s}}\in{\cal O}\longrightarrow
a$. Define a physics-based computational graph ${\cal N}_{\lambda}$
parameterized by a physics-based parameter vector $\lambda$ that characterizes
a physics-based mapping, $f_{\lambda}(\mathbf{s}|\lambda)$, which maps
collocation states to actions, which is, ${\cal N}_{\lambda}\triangleq
f_{\lambda}(\mathbf{s}|\lambda):\mathbf{s}\in{\cal C}\longrightarrow a$.

With all the notations, we are ready to present the PIDL-CF framework in the
context of car-following.

######  Definition 3.1.

Physics-informed deep learning for modeling car-following (PIDL-CF). Assume we
have the observed states ${\cal O}$, the observed actions ${\cal A}$, and the
collocation points ${\cal C}$ defined below

$\begin{split}\left\\{{\begin{array}[]{*{20}l}\ {\cal
O}=\\{\mathbf{\hat{s}}^{(i)}=(\hat{h}^{(i)},\Delta\hat{v}^{(i)},\hat{v}^{(i)}),i=1,..,N_{o}\\}\subseteq{\cal
S},\\\ \ {\cal A}=\\{\hat{a}^{(i)},i=1,..,N_{o}\\},\\\ \ {\cal
C}=\\{\mathbf{s}^{(j)}=(h^{(j)},\Delta
v^{(j)},v^{(j)}),j=1,...,N_{c}\\}\subseteq{\cal S}.\end{array}}\right.\
\end{split},$ (3.1)

with the design of two neural networks: (1) a PUNN, denoted as
$f_{\theta}(\hat{\mathbf{s}}|\theta)$, for car-following mapping approximation
$a^{(i)}$, and (2) a physics-based computational graph, denoted as
$f_{\lambda}(\mathbf{s}|\theta)$, for computing physics-based acceleration of
$a_{phy}^{(j)}$.

A general PIDL-CF model, which denoted as
$f_{\theta,\lambda}(\hat{\mathbf{s}}|\theta,\lambda)$, is to train an optimal
parameter set $\theta^{*}$ for PUNN and an optimal parameter set $\lambda^{*}$
for the physics. The PUNN parameterized by the solution $\theta^{*}$ can then
be used to predict accelerations $\hat{a}_{new}$ on a new set of observed
states ${\cal O}_{new}\subseteq{\cal S}$, and $\lambda^{*}$ is the most likely
model parameters that describe the intrinsic physics of observed data.

######  Definition 3.2.

Two problems for PIDL-CF.

  1. 1.

Acceleration-prediction-only problem (“prediction-only” for short): The
prediction-only problem aims to train a PIDL model, encoded with a known
physics-based model, that predicts its acceleration. It can be formulated as
an optimization problem:

$\begin{split}\min_{\theta}\quad&\sum_{i=1}^{N}(a^{(i)}-\hat{a}^{(i)})^{2}\\\
\textrm{s.t.}\quad&a^{(i)}=f_{\theta}(\mathbf{\hat{s}}^{(i)}|\theta,\hat{\lambda}),\quad
i=1,\ldots,N,\end{split}$ (3.2)

where $\hat{a}_{i}$ denotes the actual observed acceleration and
$\hat{\lambda}$ is the pre-calibrated model parameter set.

  2. 2.

Joint acceleration-prediction and model-parameter-discovery problem (“joint
estimation” for short): The joint prediction-and-calibration problem not only
predicts accelerations, but also estimates model parameters $\lambda$ used in
the physics-based models. It can be formulated as an optimization problem:

$\begin{split}\min_{\theta,\lambda}\quad&\sum_{i=1}^{N}(a^{(i)}-\hat{a}^{(i)})^{2}\\\
\textrm{s.t.}\quad&a^{(i)}=f_{\theta}(\mathbf{\hat{s}}^{(i)}|\theta,\lambda),\quad
i=1,\ldots,N,\\\ &\lambda\subseteq\Lambda.\end{split}$ (3.3)

where $\Lambda$ is the feasible domain of the parameters of the physics
$\lambda$, representing the physical range of each physics parameter.

In the rest of the section, we will elaborate on the two types of PIDL-CF
problems and detail each component one by one, including the design of neural
network architectures, selection of data, loss functions, and the development
of training algorithms.

###  3.2 PIDL-CF for the prediction-only problem

In the prediction-only problem, the parameters appearing in the pre-selected
physics-based CFM are calibrated beforehand using the available training data.
In other words, model parameter calibration needs to be done before a PIDL
model is trained.

####  3.2.1 PIDL-CF architecture

Physics-informed deep learning, apparently, should consist of a physics
component and a deep learning component in the form of neural networks. That
being said, a generic PIDL-CF model is comprised of two elements: a physics-
uninformed neural network (PUNN) and a physics-based computational graph. PUNN
is a deep neural network, while the physics-based computational graph is
encoded with a physics-based CFM (e.g., IDM or OVM). Both components share the
same structure of input and output, both taking a state vector as input and
output an acceleration quantity.

Figure 2: Architecture of PIDL.

Fig. 2 illustrates the structure of a PIDL-CF model. The upper part is the
PUNN, in which each node represents a neuron associated with an activation
function and each edge is attached with a parameter that needs to be trained
using observations. The bottom part is the physics. Each circle node
represents a variable or a derived intermediate variable from the physics-
based model, each rectangle represents a model parameter that can be either
pre-calibrated or jointly trained, and each edge is encoded with a known
operator.

In this paper, we adopt ANNs for PUNN, but note that other types of neural
networks, like recurrent neural networks, can also be adopted. We choose a
hyperbolic tangent ($tanh$) function as the activation function because it
outperforms other functional forms when ANNs are used for supervised learning
tasks (Karlik and Olgac, 2011), such as prediction of acceleration in our
context.

####  3.2.2 Observations and collocation states

In this subsection we will introduce the selection of the observed data and
collocation states, and how to split them into training, validation and test
data for training a PIDL-CF model. Those data would be used to calculate the
loss function and to train the PIDL-CF model, which will be detailed in Sec.
3.2.4.

Observed data is a set of state-action pairs:
$\\{\hat{\mathbf{s}}^{(i)},\hat{a}^{(i)}\\}\in\cal{O}\times\cal{A}$, where the
state is a vector of spacing, velocity difference, and velocity, while the
action is acceleration. All these values are extracted from observed
trajectory data, which is a time-series data containing positions of a leading
vehicle and a following vehicle. From this trajectory profile, velocity and
acceleration can be computed by taking the first and the second derivatives of
its position with respect to time, respectively. Then the state at each time
step is paired with the acceleration at the next time step to form an
observation data:
$\\{\hat{\mathbf{s}}^{(i)},\hat{a}^{(i)}|i=1,...,N_{O}\\}=\\{\hat{\mathbf{s}}(t),\hat{a}(t+\Delta
t)|t=0,\Delta t,...,T\\}$. After pairing, observation data is shuffled to
break the time-dependency among each other.

Figure 3: Relationship between raw trajectory data, observed data, collocation
data, and training-validation-test split.

Other than these standard datasets, we need to define a new set of collocation
points that are particularly unique to the PIDL framework. The purpose is to
compute one’s acceleration from physics-based models over these pre-defined
collocation points. The common practice is to select collocation states based
on physics knowledge. For example, when the PIDL model was applied to discover
the data-driven solution of a PDE whose inputs are a 2-dimensional time-
location vectors over the temporal-spatial domain (Raissi, 2018), the
collocation points are selected as points on the temporal-spatial mesh grid.
The size of the collocation points usually depends on the granularity of the
temporal-spatial grid as well as the size of the observed data (Raissi, 2018;
Raissi and Karniadakis, 2018; Raissi et al., 2019a). In the CF context, a
collocation point is the state whose action is not observed, which is denoted
as a “collocation state” in the rest of this paper. Because no observed action
is paired, the selection of collocation states is not constrained by any
actually observed data. In other words, a collocation state does not
necessarily need to be observed in any raw trajectory data. Since the target
value is not observed corresponding to a specific collocation state, the
acceleration value of one collocation state is computed using a physics-based
CFM calibrated with the observed data. We denote the collocation pair as
$\\{\mathbf{s}^{(j)},a^{(j)}_{phy}|j=1,...,N_{C}\\}.$

Observed data and collocation data need to be further grouped into training,
validation, and test data for the PIDL-CF training. The observed data is
shuffled and split into three subsets following a certain training-validation-
test split ratio. The collocation data are all counted towards the training
data. In summary, the total training dataset is composed of one subset of the
observed data and all collocation data. The other two subsets of the observed
data are used for the purpose of validation and test, respectively.

Fig. 3 illustrates the relationship among all the datasets mentioned above.
Let us start from the bottom-right box enclosing a pair of leader-follower
vehicles. Suppose the red car is following the blue car and both their
position and velocities are observed. We can then extract the state and the
action, and then pair them to constitute one observed data, shown in the two
middle boxes. A training-validation-test split is then applied to further
divide this observed data pair into three subsets, shown in the three boxes on
the top. Now we will inspect the bottom-left box enclosing a set of
collocation states. The collocation states can be pre-selected uniformly on a
mesh grid over the state space. These collocation states, along with their
computed acceleration values from some physics-based CFM that has been
calibrated using the observed data, constitute the other part of the training
data.

####  3.2.3 Loss function

With observed and collocation data defined, we are ready to define the loss
function associated with PUNN and the physics. The loss function is composed
of two components, one to minimize the discrepancy between the observed
acceleration and that predicted from PUNN (i.e., data discrepancy), and the
other to minimize the discrepancy between physics-based acceleration
prediction and that computed from PUNN (i.e., physics discrepancy).
Specifically, the data discrepancy is evaluated as the Mean Square Error (MSE)
between the acceleration approximated by PUNN on the observed data and its
ground-truth value. The physics discrepancy is computed using the MSE between
the accelerations approximated by PUNN and the physics. Accordingly, we
propose a loss function as a weighted sum of these two MSEs as follows:

$\displaystyle\begin{split}\operatorname{Loss}_{\theta}&=\alpha\cdot
MSE_{O}+\left(1-\alpha\right)\cdot MSE_{C}\\\
&=\alpha\cdot\frac{1}{N_{O}}\sum_{i=1}^{N_{O}}\left|a^{(i)}-\hat{a}^{(i)}\right|^{2}+(1-\alpha)\cdot\frac{1}{N_{C}}\sum_{j=1}^{N_{C}}\left|a^{(j)}-a_{phy}^{(j)}\right|^{2}\\\
&=\alpha\cdot\underbrace{\frac{1}{N_{O}}\sum_{i=1}^{N_{O}}\left|f_{\theta}(\hat{\mathbf{s}}^{(i)}|\theta)-\hat{a}^{(i)}\right|^{2}}_{\text{data
discrepancy}}+(1-\alpha)\underbrace{\frac{1}{N_{C}}\sum_{j=1}^{N_{C}}\left|f_{\theta}(\mathbf{s}^{(j)}|\theta)-f_{\hat{\lambda}}(\mathbf{s}^{(j)}|\hat{\lambda})\right|^{2}}_{\text{physics
discrepancy}}\end{split}$ (3.4)

where,
$\alpha$: the weight of the loss function that balances the contributions made
by the data discrepancy and the physics discrepancy;
$\hat{\lambda}$: parameters of the physics that are calibrated beforehand;
$\theta$: PUNN’s parameters;
$f_{\theta}(\cdot)$: PUNN parameterized by $\theta$;
$f_{\hat{\lambda}}(\cdot)$: physics parameterized by $\hat{\lambda}$, which is
calibrated prior to training;
$N_{O}$: the number of observed data;
$N_{C}$: the number of collocation states;
$\hat{\mathbf{s}}^{(i)}$: the $i$th observed feature;
$\mathbf{s}^{(j)}$: the $j$th collocation feature;
$\hat{a}^{(i)}$: the $i$th observed acceleration;
$a^{(i)}$: the $i$th acceleration predicted by PUNN;
$a^{(j)}$: the $j$th acceleration predicted by PUNN;
$a_{phy}^{(j)}$: the $j$th acceleration predicted by the physics.

Note that in the Appendix. A we show that the PIDL-CFM framework is agnostic
of the training metrics. MSE is selected as it is commonly used in modeling CF
behaviors.

####  3.2.4 Training algorithm

Training PIDL-CF in the prediction-only problem consists of two subsequent
processes, the calibration of the physics and the training of PUNN.

##### Calibration of the Physics

In the prediction-only problem, physics-based CFM is calibrated using the
observed training data. Calibration of physics is essentially the parameter
estimation of a traditional CFM using the observed data, which has been
extensively studied in the transportation literature. In accordance with the
generic CF problem statement described in Eq. 2.1, we can write the
calibration of physics as an optimization problem as follows:

$\begin{split}\min_{\lambda}\quad&Obj=\frac{1}{N_{O}}\sum_{i=1}^{N_{O}}\left|a_{phy}^{(i)}-\hat{a}^{(i)}\right|^{2}\\\
\textrm{s.t.}\quad&a_{phy}^{(i)}=f_{\lambda}(\hat{\mathbf{s}}^{(i)}|\lambda),\quad
i=1,\ldots,N_{O},\\\ &\lambda\subseteq\Lambda,\end{split}$ (3.5)

The objective function $Obj$ measures the discrepancy of the acceleration
estimated by the physics-based CFM from its ground-truth value in an MSE form.
To distinguish with the “loss function” that will be introduced in the
training of PUNN (prediction-only problem) and the joint training of the PUNN
and physics (joint-estimation problem), in this paper “objective function” is
used for the calibration of physics.

The calibration algorithms can be divided into two categories: gradient-based
and gradient-free. Gradient-based algorithms include Least Square (LS)
estimation (Ossen and Hoogendoorn, 2005), maximum likelihood estimation
(Treiber and Kesting, 2013), and sequential quadratic programming (He et al.,
2019). Gradient-free algorithms use heuristic methods that do not require any
knowledge of gradient. The mostly used gradient-free algorithm for solving CF
problems is Genetic Algorithm (GA) (Kumar et al., 2010). In this paper, we
will use both types of algorithms for different evaluation methods, which will
be discussed in Section 5.

##### Training of PUNN

Once the physics-based model parameter $\hat{\lambda}$ is obtained, we are
ready to train the PUNN’s parameters $\theta$ using the loss function Eq. 3.4.
We use an Xavier uniform initializer (Sirignano and Spiliopoulos, 2019) to
initialize the weights and biases of the PUNN. Then we use a popular
stochastic gradient decent algorithm, the Adam optimizer (Nageshrao et al.,
2019), to update the parameters of PUNN, $\theta$. Gradients of the loss
function with respect to the weights and biases are calculated using the auto-
differential function in Tensorlow (Abadi, 2016). To avoid overfitting, we
adopt an early-stopping criteria on the validation dataset: the training
process is terminated when the minimum validation error
$min(\text{MSE}_{val})$ does not change for a certain number of iterations.
PIDL-CF parameters are stored at each iteration, and parameters with the
minimum $\text{MSE}_{val}$, which are called the optimal parameters
$\theta^{*}$, are recovered when the early-stopping is triggered. Then the
recovered PIDL-CF model receives the final evaluation on the test data. The
training process is detailed in Algorithm 1.

Result: Learned PUNN parameters $\theta^{*}$

1 Initialization:

  1. (1)

optimal parameters of the physics-based CFM $\hat{\lambda}$ calibrated
beforehand,

  2. (2)

initialized PUNN parameters $\theta_{0}$ using Xavier,

  3. (3)

loss weight $\alpha\in[0,1]$, learning rate $lr$.

2while  _not reaching early-stopping criteria_ do

3 Calculate $\nabla_{\theta}\text{Loss}_{\theta}$ using the auto-differential
technique;

4 Update the parameters using the gradient decent:
$\theta_{k+1}=\theta_{k}+lr\nabla_{\theta}\text{Loss}_{\theta}$;

5

6 Calculate $\text{MSE}_{val}$ using PUNN with the updated parameters
$\theta_{k+1}$.

7 end while

8

9

Algorithm 1 Training algorithm for PUNN

where,
$lr$: learning rate, which determines the step-size when updating parameters;
$\theta_{k}$: PUNN parameters at the $k$th iteration.

###  3.3 PIDL for the joint-estimation problem

In the joint-estimation problem, a PIDL model is trained to jointly predict
acceleration and calibrate parameters used in a physics-based model.

Because the model architecture and data structure of the joint-estimation
problem is the same as the prediction-only problem, we primarily focus on the
loss function and the training algorithm.

####  3.3.1 Loss function

$\displaystyle\begin{split}\operatorname{Loss}_{\theta,\lambda}&=\alpha
MSE_{O}+(1-\alpha)MSE_{C}\\\
&=\alpha\cdot\frac{1}{N_{O}}\sum_{i=1}^{N_{O}}\left|a^{(i)}-\hat{a}^{(i)}\right|^{2}+(1-\alpha)\cdot\frac{1}{N_{C}}\sum_{j=1}^{N_{C}}\left|a^{(j)}-a_{phy}^{(j)}\right|^{2},\\\
&=\alpha\cdot\underbrace{\frac{1}{N_{O}}\sum_{i=1}^{N_{O}}\left|f_{\theta}(\hat{\mathbf{s}}^{(i)}|\theta)-\hat{a}^{(i)}\right|^{2}}_{\text{data
discrepancy}}+(1-\alpha)\underbrace{\frac{1}{N_{C}}\sum_{j=1}^{N_{C}}\left|f_{\theta}(\mathbf{s}^{(j)}|\theta)-f_{\lambda}(\mathbf{s}^{(j)}|\lambda)\right|^{2}}_{\text{physics
discrepancy}}\end{split}$ (3.6)

where $f_{\lambda}(\cdot)$ is the physics parameterized by $\lambda$, which is
trained along with the PUNN’s parameters $\theta$.

####  3.3.2 Training algorithm

Similarly, we use the Adam optimizer with an early-stopping condition to train
the PUNN and estimate physics parameters simultaneously. While some
modifications should be made.

First, the parameter of the physics-based CFM usually has physical meaning,
and its range varies depending on the specific physics knowledge this
parameter stands for. By contrast, parameters of the PUNN do not carry
physical meanings. So the magnitudes of both parameters and gradients in the
PUNN and the physics-based CFM may differ, resulting in different training
speeds and convergence. We solve this issue by using different learning rates
for the PUNN and the physics-based CFM, denoted as $lr_{\text{PUNN}}$ and
$lr_{phy}$, respectively. This provides flexibility of balancing the training
on the PUNN part and on the physics part.

A second issue during the training process is, some parameters of the physics-
based CFM encounter significantly large gradients, which likely lead to values
beyond their physical bounds. To cope with this problem, we set bounds over
the gradients of the physics-based CFM, and then clip the calculated gradients
if they are beyond the bounds. The lower and upper bounds of the gradients of
the physics-based CFM are denoted as $minClip$ and $maxClip$, which are the
minimum and maximum value the gradients of the physics-based CFM can achieve.
A summary of the joint-training of the physics-based CFM and PUNN is shown in
Algorithm 2. We use bold texts to indicate the main differences from Algorithm
1.

Result: Learned PUNN parameters $\theta^{*}$ and parameters of the physics-
based CFM $\lambda^{*}$

1 Initialization:

  1. (1)

initialized parameters of the physics-based CFM $\lambda_{0}$,

  2. (2)

initialized PUNN parameters $\theta_{0}$ using Xavier,

  3. (3)

loss weight $\alpha\in[0,1]$, learning rates for two networks $lr_{phy}$ and
$lr_{\text{PUNN}}$, and tolerance of the early-stop $tol$;

  4. (4)

upper and lower bounds of the gradient of the physics-based CFM, $minClip$ and
$maxClip$

2while  _not reaching early-stopping criteria_ do

3 Calculate $\nabla_{\theta}\text{Loss}_{\theta,\lambda}$ and
$\nabla_{\lambda}\text{Loss}_{\theta,\lambda}$ using the auto-differential
technique, and clip the gradient of the physics parameter
$\nabla_{\lambda}\text{Loss}_{\theta,\lambda}\longleftarrow
clip(\nabla_{\lambda}\text{Loss}_{\theta,\lambda},minClip,maxClip)$

4 Update the parameters of two networks using the gradient decent:
$\theta_{k+1}=\theta_{k}+lr_{\text{PUNN}}\nabla_{\theta}\text{Loss}_{\theta,\lambda}$,
$\lambda_{k+1}=\lambda_{k}+lr_{\text{phy}}\nabla_{\lambda}\text{Loss}_{\theta,\lambda}$;

5 Calculate $\text{MSE}_{val}$ using PUNN with the updated parameters
$\theta_{k+1}$.

6 end while

Algorithm 2 Joint-training algorithm for the physics-based CFM and PUNN

###  3.4 Prediction and evaluation of PIDL-CF

The output of the training process is a learned PUNN with parameters
$\theta^{*}$ and a learned physics-based CFM with parameters $\hat{\lambda}$
or $\lambda^{*}$, depending on whether the physics-based CFM is trained by
calibration or joint-training. Then the trained PUNN, $\cal{N}_{\theta^{*}}$,
can be used for the prediction on a new dataset, which is the test data in
this paper. By feeding the states at the current timestep into
$\cal{N}_{\theta^{*}}$, it outputs the accelerations at the next timestep. A
test MSE is used to evaluate the performance of our PIDL-CF models on the test
data:

$\displaystyle\begin{split}MSE_{\text{test}}&=\frac{1}{N_{\text{test}}}\sum_{i=1}^{N_{\text{test}}}\left|a^{(i)}-\hat{a}^{(i)}\right|^{2}\\\
&=\frac{1}{N_{\text{test}}}\sum_{i=1}^{N_{\text{test}}}\left|f_{\theta^{*}}(\hat{\mathbf{s}}^{(i)}|\theta^{*})-\hat{a}^{(i)}\right|^{2},\quad
i=1,...,N_{\text{test}}.\end{split}$ (3.7)

where,
$N_{test}$: the number of test data;
$f_{\theta^{*}}(\cdot)$: PUNN parameterized by $\theta^{*}$.

###  3.5 Summary of PIDL-CF

Now we sum up all the components that are detailed sequentially in the
previous subsections. A complete picture of the generic structure of PIDL-CF
is illustrated in Fig. 4, Fig. 4(a) for the prediction-only problem and Fig.
4(b) for the joint-estimation problem. Note that the time index is omitted as
we consider the one-step prediction.

Fig. 4(a), for the prediction-only problem, is composed of two parts: the
upper part demonstrates the flow of the calibration of the physics, and the
lower part aims to train the PUNN with observed data, collocation states, and
the actions predicted by the calibrated physics on the collocation states. We
will introduce each element of Fig. 4(a) from top to bottom. In the upper
part, the colored circular nodes represent inputs and other nodes represent
intermediate quantities. The leftmost box encloses observed states
($\hat{\mathbf{s}}^{(i)}$), which is a 3-dimensional vector consisting of
spacing, velocity difference, and velocity. These nodes are colored to
indicate that these states are observed. The observed states are fed into the
physics-based computational graph, which outputs the acceleration
$a_{phy}^{(j)}$ predicted by the encoded physics. This predicted acceleration
is then compared to the actual observed acceleration $\hat{a}^{(i)}$ to
compute the calibration objective function $Obj$ that is depicted in Eq. 3.5 ,
which is used to update the physics parameters $\lambda$. The calibrated
physics parameters $\hat{\lambda}$ is then used for the training of PUNN in
the lower part. In the lower part, the leftmost two boxes enclose the observed
states ($\hat{\mathbf{s}}^{(i)}$) and collocation states ($\mathbf{s}^{(j)}$)
from top to bottom. Nodes of the collocation states are colored as red to
indicate that they are given beforehand. The observed states are fed into
PUNN, while the collocation states are fed into both PUNN and physics-based
CFM. PUNN outputs two different acceleration quantities. The first one,
$a^{(i)}$, is the approximate acceleration computed out of the observed states
$\hat{\mathbf{s}}^{(i)}$; The second one, $a^{(j)}$, is the approximate
acceleration computed using collocation states $\mathbf{s}^{(j)}$. The
physics-based CFM outputs one quantity, $a_{phy}^{(j)}$, by using the physics-
based model with input as collocation states. The approximate acceleration
$a^{(i)}$ based on the observed states is then compared to the actual observed
acceleration $\hat{a}^{(i)}$ to compute $MSE_{O}$. The approximate
acceleration $a^{(j)}$ based on the collocation states is then compared to the
physics predicted acceleration $a_{phy}^{(j)}$ to compute $MSE_{C}$. Both
$MSE_{O}$ and $MSE_{C}$ define the loss function $Loss_{\theta}$, which is
used to train the parameters $\theta$. Based on $Loss_{\theta}$ computed from
observed data, we train the PUNN. In training, we use $MSE_{val}$ to check
early-stop and avoid overfitting. Once the optimal epoch number is found that
minimizes the validation error, the training process stops.

Fig. 4(b) illustrates the joint training problem of both the PUNN and the
physics. Most of the elements share the same meaning as those in Fig. 4(a)
except for the training of physics parameters $\lambda$. The first difference
is the box enclosing the physics-based computational graph (${\cal
N_{\lambda}}$). As the physics is not calibrated prior to the training, the
physics-based computational graph is parameterized by $\lambda$ instead of the
calibrated parameters $\hat{\lambda}$. As $\lambda$ are trainable parameters
in the joint-estimation problem, the corresponding physics discrepancy
$MSE_{C}$ is also trainable with respect to $\lambda$. As a result, the loss
function $Loss_{\theta,\lambda}$ depends on the physics parameters $\lambda$
as well. The second difference is that the physics parameters $\lambda$ are
trained simultaneously along with the PUNN parameters $\theta$. In each
training epoch, $\lambda$ is updated to minimize $Loss_{\theta,\lambda}$ (by
minimizing $MSE_{C}$ as $MSE_{O}$ is unrelated to $\lambda$). In other words,
the values of the physics parameters $\lambda$ is updated during the training
process, so is $a_{phy}^{(j)}$ which is predicted by the physics.

(a)

(b)

Figure 4: Generic structure of PIDL-CF for (a) prediction-only problem and (b)
joint-estimation problem.

The mathematical formulation of two PIDL-CF problems are summarized below:

  1. 1.

A general PIDL for the prediction-only problem is to solve the optimization
problem below:

$\begin{split}\begin{gathered}\mathop{\min}\limits_{\theta}Loss_{\theta}\\\
where\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\\
Loss_{\theta}=\alpha\cdot\frac{1}{N_{O}}\sum_{i=1}^{N_{O}}\left|a^{(i)}-\hat{a}^{(i)}\right|^{2}+(1-\alpha)\cdot\frac{1}{N_{C}}\sum_{j=1}^{N_{C}}\left|a^{(j)}-a_{phy}^{(j)}\right|^{2}\\\
=\alpha\cdot\frac{1}{N_{O}}\sum_{i=1}^{N_{O}}\left|f_{\theta}(\hat{\mathbf{s}}^{(i)}|\theta)-\hat{a}^{(i)}\right|^{2}+(1-\alpha)\frac{1}{N_{C}}\sum_{j=1}^{N_{C}}\left|f_{\theta}(\mathbf{s}^{(j)}|\theta)-f_{\hat{\lambda}}(\mathbf{s}^{(j)}|\hat{\lambda})\right|^{2}.\end{gathered}\end{split}$
(3.8)

  2. 2.

A general PIDL for the joint-estimation problem is to solve the optimization
problem below:

$\begin{split}\begin{gathered}\mathop{\min}\limits_{\theta,\lambda}Loss_{\theta,\lambda}\\\
\textrm{s.t. }\lambda\subseteq\Lambda,\\\ where\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\\
Loss_{\theta,\lambda}=\alpha\cdot\frac{1}{N_{O}}\sum_{i=1}^{N_{O}}\left|a^{(i)}-\hat{a}^{(i)}\right|^{2}+(1-\alpha)\cdot\frac{1}{N_{C}}\sum_{j=1}^{N_{C}}\left|a^{(j)}-a_{phy}^{(j)}\right|^{2}\\\
=\alpha\cdot\frac{1}{N_{O}}\sum_{i=1}^{N_{O}}\left|f_{\theta}(\hat{\mathbf{s}}^{(i)}|\theta)-\hat{a}^{(i)}\right|^{2}+(1-\alpha)\frac{1}{N_{C}}\sum_{j=1}^{N_{C}}\left|f_{\theta}(\mathbf{s}^{(j)}|\theta)-f_{\lambda}(\mathbf{s}^{(j)}|\lambda)\right|^{2}.\end{gathered}\end{split}$
(3.9)

Table. 2 summarizes the difference between the prediction-only and joint-
estimation problems in updating parameters $\lambda$ and $\theta$ during the
calibration and training processes. The first column of this table lists two
problems for the PIDL, i.e., the prediction-only and joint-estimation problem.
The remaining columns (the first 2 columns for calibration process and the
remaining 4 columns for training process) address two questions as to the
calibration or training of PIDL parameters $\lambda$ and $\theta$: 1) whether
parameters are updated and 2) which states and actions are needed when
updating the parameters. The parenthesis after each quantity indicates whether
it is fixed or variant during the calibration or training process. The
observed data ($\\{\hat{\mathbf{s}}^{(i)},a^{(i)}\\}$) and the collocation
states ($\mathbf{s}^{(j)}$) are observed or given beforehand, so are fixed
throughout the calibration and training processes. $a^{(i)}$ is the output of
PUNN, whose value changes with the training process while PUNN parameters
$\theta$ are updated. As for the output of physics-based computational graph,
which is $a_{phy}^{(j)}$, its value is fixed during the training process in
the prediction-only problem, because the physics parameters are already
calibrated and fixed to be $\hat{\lambda}$. In the joint-estimation problem,
the value of $a_{phy}^{(j)}$ varies with training, because the physics
parameters $\lambda$ are updated during the training process.

Table 2: Summary of differences between prediction-only and joint-estimation problems Problem | Calibration | Training
---|---|---
If $\lambda$ is updated |  States and actions needed when updating $\lambda$ |  If $\lambda$ is updated |  States and actions needed when updating $\lambda$ |  If $\theta$ is updated |  States and actions needed when updating $\theta$
Prediction -only | Yes |  $\hat{\mathbf{s}}^{(i)}$(fixed) $\hat{a}^{(i)}$(fixed) |  No. Value is fixed to be $\hat{\lambda}$ | - | Yes |  $\hat{\mathbf{s}}^{(i)}$ (fixed) $\hat{a}^{(i)}$(fixed) $\mathbf{s}^{(j)}$(fixed) $a_{phy}^{(j)}$(fixed)
Joint -estimation | - | - | Yes |  $\mathbf{s}^{(j)}$(fixed) $a^{(j)}$(variant) | Yes |  $\hat{\mathbf{s}}^{(i)}$ (fixed) $\hat{a}^{(i)}$(fixed) $\mathbf{s}^{(j)}$(fixed) $a_{phy}^{(j)}$(variant)

##  4 PIDL for Existing Physics-based CFMs

To demonstrate the performance of the PIDL-CF framework, in this and the next
sections, we will first apply it to simulated data generated from widely used
physics-based car-following models (in Section 4) and then move to the real-
world dataset (in Section 5). In other words, in the former case, we assume we
know the data-generating mechanism, which is the known physics-based models.
Then we use simulated data generated from these models (plus some artificial
noise) as input to our PIDL-CF model, train the model, and then compare the
performances to baselines. These simulated data from known models are
homogeneous, free of errors, and are generated under controlled and ideal
traffic environments, thus laying a stepping stone to the evaluation of PIDL-
CF with real-world noisy data.  More importantly, since we know the ground-
truth physics (in other words, the car-following model type) used to generate
these simulated data, we can directly encode these functional forms into our
PIDL-CF framework, which would control test errors that may arise from using a
wrong physics. Moreover, we can also compare directly estimated physics
parameters output from our PIDL-CF to the ground-truth, without worrying if
the selected physics-based model is inaccurate per se. When it comes to real-
world datasets in Section 5, we do not know the intrinsic physics, i.e., the
car-following model type, that generates these trajectories and the only
observation we have are the actual acceleration values. Therefore, we try out
different physics-based models and compare the predicted accelerations output
from the PIDL-CF encoded with various physics.

In this section, we focus on two physics-based models, namely, IDM and OVM,
which generate ground-truth trajectories of the following vehicle. These
simulated trajectories, added with artificial noise, will be used as input
data to our PIDL model. For both the IDM based PIDL-CF model (PIDL-IDM for
short) and the OVM based PIDL-CF model (PIDL-OVM for short), the prediction-
only problem and the joint-estimation problem will be solved. In the
prediction-only problem, the predicted acceleration output from our PIDL model
will be compared with the ground truth and physics-uninformed neural networks
to justify the advantage of including physics. In the joint-estimation
problem, the estimated parameters will be compared with the ground-truth
parameters and the prediction error will also be shown, justifying that it can
do accelerations prediction and parameters discovery simultaneously.

We briefly introduce the experiment settings of the PIDL-IDM and PIDL-OVM
models in these two problems, which are summarized in Table 3. The first two
columns of this table list the names of the relevant parameters along with
their notations, and the remaining columns are their values. Each row
represents one parameter associated with either the model formula or the
training process. These setting will be revisited in the subsequent
subsections.

Table 3: Experiment settings of the PIDL-IDM model and the PIDL-OVM model for the simulated data Name | Notation | PIDL-IDM | PIDL-OVM
---|---|---|---
prediction -only |  joint -estimation |  prediction -only |  joint -estimation
number of observed data used in training ($\times 20$) | $n_{O}$ |  1, 5, 9, 13, 15, 20, 30, 40, 50 |  1, 5, 9 13, 15, 20 |  1, 5, 9, 13, 15, 20, 30, 40, 50 |  1, 5, 9 13, 15, 20
number of collocation data used in training ($\times 20$) | $n_{C}$ | 1 | 9 | 5 | 9
weight of the loss function | $\alpha$ |  0.1, 0.4, 0.7, 1.0 | 0.7 |  0.1, 0.4, 0.7, 1.0 | 0.7
training-validation-test split ratio | - | 0.5:0.25:0.25
learning rate | $lr_{\text{PUNN}}$ | 0.001
$lr_{\text{phy}}$ | - | 0.1 | - | 0.1
PUNN hidden layers size | - | (60,60,60)
ground-truth parameters of the physics | $\lambda$ |  $v_{0}$=30 $m\cdot s^{-1}$ |  $v_{max}$=30 $m\cdot s^{-1}$
$T_{0}$=1.5 $s$ |  $h_{c}$=10 $m$
$s_{0}$=2 $m$ |  $k$=0.03 $s^{-1}$
$a_{max}$=0.73 $m\cdot s^{-2}$ |
$b$=1.63 $m\cdot s^{-2}$ |
traffic regimes | - |  four separate regimes |  all regimes combined
pre-calibration method | - |  ground-truth is given | - |  ground-truth is given | -

(a)

(b)

Figure 5: Physics-based computational graph architecture of the PIDL-CF
models. (a) is the physics-based computational graph of the PIDL-IDM model,
which is encoded from an IDM model: $a(t+\Delta
t)=a_{max}[1-(\frac{v(t)}{v_{0}})^{\delta}-(\frac{s^{*}(v(t),\Delta
v(t))}{h(t)})^{2}]$, $s^{*}(v(t),\Delta
v(t))=s_{0}+v(t)T_{0}+\frac{v(t)\cdot\Delta v(t)}{2\sqrt{a_{max}b}}$. (b) is
the physics-based computational graph of the PIDL-OVM model, which is encoded
from an OVM model: $a(t+\Delta
t)=k\left[V\left(h\left(t\right)\right)-v(t)\right]$,
$V(h(t))=0.5v_{max}[\text{tanh}(h(t)-h_{c})+\text{tanh}(h_{c})]$.

###  4.1 IDM-based physics

We first apply the PIDL-IDM model on the numerical data generated from a known
IDM model. We will introduce the architecture of the PIDL-IDM model, its
experiment setting, and the results of both the prediction-only and the joint-
estimation problems.

####  4.1.1 IDM model specification

IDM model (Treiber et al., 2000a) is formulated as:

$\left\\{\begin{array}[]{l}a(t+\Delta
t)=a_{max}[1-(\frac{v(t)}{v_{0}})^{\delta}-(\frac{s^{*}(v(t),\Delta
v(t))}{h(t)})^{2}]\\\ s^{*}(v(t),\Delta
v(t))=s_{0}+v(t)T_{0}+\frac{v(t)\cdot\Delta
v(t)}{2\sqrt{a_{max}b}},\end{array}\right.$ (4.1)

where,
$v_{0}$: desired velocity;
$T_{0}$: desired time headway;
$s_{0}$: minimum spacing in congested traffic;
$a_{max}$: maximum acceleration;
$b$: comfortable deceleration;
$\delta$: a constant that is usually set to 4 for the car-following problem.

The values of model parameters that are used to generate ground-truth
trajectories are summarized in the row “ground-truth parameters of the
physics” of Table 3.

####  4.1.2 PIDL-IDM architecture

The PIDL-IDM model consists of a PUNN and a physics-based computational graph
encoded from an IDM model. The physics in the PIDL-IDM model is encoded from
the IDM model, whose architecture is illustrated in Fig. 5(a). Symbols of the
collocation states are kept the same as in Fig. 3. In the physics-based
computational graph, each circle represents a variable or a derived
intermediate variable. Each rectangle represents a model parameter, including
$v_{0}$, $T_{0}$, $s_{0}$, $a_{max}$, $b$, and $\delta$. These parameters can
be trained either by pre-calibration (in the prediction-only problem) or by
jointly training (in the joint estimation problem), except for $\delta$ that
is usually fixed as 4. Each diamond indicates a known operator, including plus
($+$), minus ($-$), multiplication ($\times$), division (/), square root
($\sqrt{\quad}$), power, square, adding one ($+1$), multiplying one half
($\times 0.5$), and multiplying negative one ($\times(-1)$).

####  4.1.3 Experiment settings

Numerical experiments are designed to justify the performance of the PIDL-IDM
models in the prediction-only problem and the joint-estimation problem. In
this subsection we will introduce the experiment settings with a focus on the
generation of the training data, the generation of the collocation data,
calibration of the physics and sensitivity analysis, which will be detailed
below.

##### Generation of training data

For the PIDL-IDM prediction-only problem, to demonstrate the influence of
traffic regimes on the performance of PIDL-IDM, we divide vehicle trajectories
into 4 driving regimes, including accelerating ($a(t)>$0 $m\cdot s^{-2}$),
decelerating ($-$2 $m\cdot s^{-2}<a(t)<$0 $m\cdot s^{-2}$), cruising ($a(t)=$
0 $m\cdot s^{-2}$), and emergency braking ($a(t)=-2$ $m\cdot s^{-2}$) for the
simulation period $\forall t\in[0,T]$, where $T$ is the maximum time duration.
For the cruising regime, $T$ is set to be 20 seconds. For other regimes, the
simulation ends when the subject vehicle’s acceleration becomes zero. In each
driving regime, we train one PIDL-IDM model using only one type of
trajectories and also test it on the same driving regime. We want to guarantee
that training and test data share similar distributions and avoid the
complication of distributional shift between these two datasets.

To generate a sufficient number of data points for each driving regime, we
vary the initial spacing and the initial velocity of the subject vehicle while
preserving the sign of its acceleration over time. In other words, the subject
vehicle always chooses its acceleration from the same regime throughout the
simulation. We also vary the initial velocity of the leading vehicle in each
run, but once the velocity is fixed, the leading vehicle drives at a constant
speed. Real-world trajectories of leading vehicles will be used in the next
section and our goal in this section is to investigate how our PIDL-IDM model
performs in different regimes, thus the impact of leading vehicle behavior
should be removed.

Fig. 6 illustrates sample trajectories generated from each regime. The figures
on each row come from the same regime: the top row for the accelerating, the
second row for decelerating, the third row for cruising, and the bottom row
for emergency braking. The figures on each column demonstrate one driving
quantity of interest: from left to right are time-space trajectories, speed
profile, and acceleration profile across time. We artificially add a Gaussian
noise to the ground-truth trajectories computed from IDM to ensure that the
PUNN can be trained to capture the noise. The time step $\Delta t$ is set to
be 0.1 second. The total numbers of data in the accelerating, decelerating,
cruising and emergency braking regimes are 468k, 145k, 200k, and 26k ,
respectively.

The training-validation-test split is also separately applied for each regime.
Randomly selected 50% of the observed data is for training, 25% for
validation, and the rest 25% for testing. To show the PIDL-IDM model’s
performance for different sizes of training data, in both the prediction-only
and joint-estimation problems, we vary the number of observed data ($n_{O}$)
that is used in the training process.

(a)

(b)

(c)

(d)

Figure 6: Sample trajectories of 4 regimes. Each row represents accelerating,
decelerating, cruising, and emergency braking respectively. Each column
represents the position, velocity and the follower’s acceleration,
respectively.

##### Generation of collocation data

After the training data is generated, we can follow the data processing steps
described in Fig. 3 to generate the collocation data. We fix the number of
collocation data, $n_{C}$, in each experiment to be 20, within the range of
the varying training data size. Then we randomly select $n_{C}$ states from
the state space $\cal S$, and compute their acceleration values using IDM. The
collocation states along with their accelerations constitute the collocation
data.

##### Sensitivity analysis

For the prediction-only problem, we perform sensitivity analysis by varying
the weights of the loss function ($\alpha$). Among these weights, the one that
leads to the minimum test error is called the optimal weight of the loss
function and is denoted as $\alpha^{*}$. Note that when $\alpha$ equals to 1,
only the data discrepancy term exists in the loss function according to Eq.
3.4, and the PIDL-IDM model is reduced to a pure PUNN model.

In the joint-estimation problem, $n_{O}$ is also varying to investigate the
effect of the number of training data. The weight of loss function $\alpha$ is
fixed to be 0.7. We use a fixed $\alpha$ because our purpose in the joint-
estimation problem is to demonstrate whether the PIDL-IDM can do prediction
and parameters discovery simultaneously, and the effect of $\alpha$, as is
already investigated in the prediction-only problem, is trivial.

##### Parameters tuning

The parameters that need to be tuned include the number of collocation data
used in training ($n_{C}$), learning rate for the PUNN ($lr_{\text{PUNN}}$)
and the physics-based CFM ($lr_{phy}$), and the PUNN hidden layers size
(including the number of hidden layers and the number of neurons in each
layer), summarized in Table 3.

Possible values for these parameters are as follows:

  * 1.

$n_{c}$: $\\{20,60,100,140,180\\}$

  * 2.

$lr_{\text{PUNN}}$: {$10^{-1},10^{-2},10^{-3},10^{-4},10^{-5}$}

  * 3.

$lr_{phy}$: {$10^{-1},10^{-2},10^{-3},10^{-4},10^{-5}$}

  * 4.

number of hidden layers: $\\{1,2,3,4,5\\}$

  * 5.

number of neurons in each layer: $\\{30,60,128,256,512\\}$

By conducting experiments with different parameter values and comparing the
corresponding performance, we select values of these parameters as in Table 3.
Details of the selection of the neural network structure are introduced in
Appendix. B.

##### Calibration of the Physcis

In the prediction-only problem, the ground-truth IDM parameters are known and
thus used without calibration. In the joint-estimation problem, parameters of
the physics-based CFM are jointly trained with the PUNN.

####  4.1.4 PIDL-IDM for the prediction-only problem

Results of the PIDL-IDM for the prediction-only problem will be presented in
this subsection.

Figure 7: Training and validation error curves for the accelerating regime
when $(n_{O},n_{C},\alpha)=(20,20,0.1)$.

To illustrate the early-stop criteria in training, Fig. 7 presents how the
training and validation errors evolve during the training process for the
accelerating regime where $(n_{O},n_{C},\alpha)=(20,20,0.1)$. The solid red
line and the dashed green line represent the training error and the validation
error, respectively. As the training process proceeds, the training error
continuously decreases, while the validation error first decreases and then
increases in general. In this specific case, the PIDL-IDM model reaches its
minimum validation loss at the 53rd epoch, and the trained PUNN parameters at
this epoch are used as the optimal parameters $\theta^{*}$.

(a) $MSE_{\text{test}}$ of the accelerating regime

(b)

(c)

(d)

(e)

(f)

(g)

(h)

Figure 8: Performance of PIDL-IDM in 4 traffic regimes

The prediction accuracy of the PIDL-IDM compared with the PUNN are presented
in Fig. 8 for 4 regimes, with the physics-uniformed PUNN as the baseline. Each
row represents different regimes, the first row for the accelerating regime,
the second for the decelerating regime, the third for the cruising regime, and
the last for the emergency braking regime. Figures on the first column
indicate the test errors of both PIDL-IDM and PUNN with varying training data
sizes. The x-axis is the number of training data, and the y-axis is the test
error. The red solid line and the dashed black line indicate the test error of
the PUNN and the PIDL-IDM, respectively. The figures on the second column
record the optimal weight of the loss function for each regime, with the
x-axis standing for the number of training data and the y-axis for the optimal
weight of the loss function.

From the first-column test error figures, we observe that the PIDL-IDM
outperforms the PUNN in all regimes, especially when the training data size is
smaller. That being said, a neural network encoded with physics improves
prediction compared to one without. The performance, however, differs in 4
regimes. To quantify such a difference, we calculate the average percentage
reduction in MSE of the PIDL-IDM relative to the PUNN in each regime. PIDL-IDM
outperforms PUNN the most in the emergency braking regime by $16.80\%$ and the
least in the cruising regime by $1.26\%$. For the emergency braking regime,
the sudden deceleration may be hard for the PUNN to learn when data is
insufficient, while the PIDL-IDM is capable of capturing such changes from the
encoded IDM imposed with the lower bound of deceleration. For the cruising
regime, all the input features lead to the same acceleration rate, which is
zero. Thus the PUNN can learn such a pattern even without being informed by
the physics.

From the second-column figures, which show the optimal weights of the loss
function, we observe that the value of $\alpha^{*}$ is low when the training
data is small, and converges to one as the number of training data increases.
A smaller $\alpha^{*}$ means a higher weight is given to the physics-
discrepancy term in the loss function defined in Eq. 3.4. Thus the knowledge
of the underlying car-following physics compensates for the data
insufficiency. As the training data size increases, $\alpha^{*}$ increases,
meaning higher weights are given to the data-discrepancy term in the loss
function. This is because PUNN can better capture the underlying data-
generating mechanism when sufficient training data is provided.

####  4.1.5 PIDL-IDM for the joint estimation problem

In the joint-estimation problem, PIDL-IDM are trained on the combined regimes.
We fix the weight of the loss function $\alpha$ to be 0.7 and the number of
collocation data $n_{C}$ to be 180, and vary different numbers of observation
data $n_{O}$. The results of the joint-estimation problem are shown in Table
4, in which the first column is the number of observed data, the second column
is the corresponding test error, and the remaining columns are the values of
the estimated parameters along with their deviations from the ground-truth
parameters.

From the table we observe that the PIDL-IDM models with a training data size
of 180 or more can achieve a satisfactory performance on both acceleration
prediction and parameters estimation. Generally, more data helps increase the
accuracy of both prediction and parameters estimation, while the improvement
becomes less significant when the number of observed data is more than 260.
The results demonstrate that the PIDL-IDM model is capable of jointly
predicting accelerations and estimating IDM parameters.

Table 4: Performance of the PIDL-IDM model in the joint-estimation problem $n_{O}(\times 20)$ | $MSE_{\text{test}}$ | estimated parameters (error%)
---|---|---
$v_{0}(m\cdot s^{-1})$ | $T_{0}(s)$ | $s_{0}(m)$ | $a_{max}(m\cdot s^{-2})$ | $b(m\cdot s^{-2})$
1 | 0.126 | 32.309 (7.70) | 1.706 (13.76) | 0.619 (69.04) | 0.872 (19.48) | 1.146 (31.39)
5 | 0.127 | 29.372 (2.09) | 1.578 (5.18) | 1.692 (15.42) | 0.813 (11.40) | 1.474 (11.75)
9 | 0.061 | 31.604 (5.35) | 1.589 (5.95) | 1.775 (11.26) | 0.784 (7.46) | 1.738 (4.06)
13 | 0.039 | 31.706 (5.69) | 1.585 (5.63) | 1.761 (11.97) | 0.737 (0.91) | 1.588 (4.91)
15 | 0.038 | 31.486 (4.95) | 1.571 (4.95) | 1.825 (8.73) | 0.746 (2.15) | 1.588 (4.90)
20 | 0.037 | 30.799 (2.66) | 1.585 (2.66) | 1.821 (8.93) | 0.737 (0.98) | 1.736 (5.58)

###  4.2 OVM-based physics

Other than IDM, OVM is another widely used CFM. In this subsection, we will
develop PIDL-OVM models. Below we will introduce the architecture of the PIDL-
OVM model, its experiment setting, and the results of the prediction-only and
the joint-estimation problems.

####  4.2.1 OVM model specification

OVM model (Lazar et al., 2016) is formulated as:

$\left\\{\begin{array}[]{l}a(t+\Delta
t)=k\left[V\left(h\left(t\right)\right)-v(t)\right]\\\
V(h(t))=0.5v_{max}[\text{tanh}(h(t)-h_{c})+\text{tanh}(h_{c})],\end{array}\right.$
(4.2)

where,
$v_{max}$: maximum velocity in the free-flow traffic;
$h_{c}$: safe distance;
$k$: sensitivity constant;
$V(\cdot)$: the Optimal Velocity (OV) function.

The values of model parameters that are used to generate ground-truth
trajectories are summarized in the row “ground-truth parameters of the
physics” of Table 3.

####  4.2.2 PIDL-OVM architecture

The PIDL-OVM model consists of a PUNN and a physics-based computational graph
encoded from an OVM model. Its PUNN shares the same structure as the PUNN
component of the PIDL-IDM model. Its physics is encoded from an OVM model,
whose architecture is illustrated in Fig. 5(b). Each circle represents a
variable or an intermediate variable. Each rectangle represents a model
parameter, including $v_{max}$, $hc$, and $k$. Each diamond indicates a known
operator, where $tanh(\cdot)$ is the hyperbolic tangent function, and other
operators have been introduced in the physics architecture of the PIDL-IDM
model before.

####  4.2.3 Experiment settings

Numerical experiments are designed to justify the performance of the PIDL-OVM
models in the prediction-only problem and the joint-estimation problem.
Experiment settings of these models are mostly the same as in the PIDL-IDM
experiment. The major difference exists in the generation of training data,
where we use a known OVM to generate the numerical data with all regimes
combined. Besides, a minor modification is made on the number of the
collocation data $n_{C}$ in the prediction-only problem, which is 100. Other
settings, like generation of collocation data, calibration of the physics, and
sensitivity analysis are the same and also summarized in Table 3.

##### Generation of training data

Vehicle trajectories are generated including all regimes for the simulated
period $\forall t\in[0,T]$, where $T$ is the maximum simulation horizon and is
set to be 20 seconds.

Similar to the data generation of the PIDL-IDM experiment, we vary the subject
vehicle’s initial position and velocity together with its leader’s initial
velocity, Gaussian noise is added to the ground-truth trajectories. The time
step $\Delta t$ is 0.1 second, and the total number of training data is 84k.

####  4.2.4 PIDL-OVM for the prediction-only problem

(a)

(b)

Figure 9: Performance of PIDL-OVM in combined traffic regimes

The prediction accuracy of the PIDL-IDM compared with the PUNN are presented
in Fig. 9 for all regimes combined together, with the physics-uninformed PUNN
as the baseline. From Fig. 9(a), we observe that the PIDL-OVM outperforms the
PUNN, especially when data is insufficient. Likewise, a neural network encoded
with physics improves prediction compared to one without. This trend is the
same as in the PIDL-IDM experiment. In Fig. 9(b), $\alpha^{*}$ is attained at
a smaller value when data is insufficient. Its value gradually increases to
one as the number of training data increases. This trend can be explained by
the same reason as in the PIDL-IDM experiment: a small $\alpha^{*}$ means more
weights are put on the physics-discrepancy term to compensate the data
insufficiency, and a big $\alpha^{*}$ means more weights are put on the data-
discrepancy term as the PUNN can better capture the underlying data-generating
pattern with sufficient training data. The similar performance of PIDL-OVM
also demonstrates that the PIDL model preserves its advantage when its physics
component is changed from an IDM model to an OVM model.

####  4.2.5 PIDL-OVM for the joint-estimation problem

Results of the joint-estimation problem of PIDL-OVM are shown in Table 5, in
which the estimated parameters are compared to the ground-truth parameters.
From the table we observe that PIDL-OVM model with a training data size of 180
or more can achieve a satisfactory performance on both acceleration prediction
and parameters estimation. These results demonstrate that the PIDL-OVM mode is
capable of jointly predicting accelerations and estimating OVM parameters.

Table 5: Performance of the PIDL-OVM model in the joint-estimation problem $n_{O}(\times 20)$ | $MSE_{\text{test}}$ | estimated parameters (error%)
---|---|---
$v_{max}(m\cdot s^{-2})$ | $h_{c}(m)$ | $k(s^{-1})$
1 | 0.052 | 34.646 (15.49) | 10.300 (3.00) | 0.022 (25.25)
5 | 0.051 | 31.784 (5.95) | 10.217 (2.17) | 0.026 (12.86)
9 | 0.015 | 30.572 (1.91) | 10.128 (1.28) | 0.029 (4.45)
13 | 0.016 | 30.240 (0.80) | 10.065 (0.65) | 0.030 (0.23)
15 | 0.015 | 30.571 (1.90) | 10.083 (0.83) | 0.029 (2.47)
20 | 0.013 | 30.565 (1.88) | 10.076 (0.76) | 0.029 (2.30)

##  5 PIDL for the NGSIM Dataset

In this section, we will validate the performance of PIDL-CF models on the
real-world data, the Next Generation SIMulation (NGSIM) dataset. As
aforementioned at the beginning of Sec. 4, the intrinsic mechanism that
generates NGSIM trajectories is unknown. Thus, we need to try different
physics-based models. The performances of PIDL-CF models can only be judged
through their predicted acceleration values, not calibrated physics. Two PIDL-
CF models (the PIDL-IDM model and PIDL-OVM model) are trained to solve the
prediction-only and joint-estimation problems. The architectures of these two
PIDL-CF models, which consists of a PUNN and a physics component, are the same
as in the numerical experiment in Fig. 5. Experiment settings of these two
PIDL-CF models are summarized in Table 6. The rows are the same as those in
Table 3. The columns are organized in three hierarchies. The top level
classifies two PIDL models based on physics models: PIDL-IDM and PIDL-OVM
models. The middle level indicates that, for each model, we try both
prediction-only and joint-estimation problems. The bottom level indicates that
two calibration and evaluation methods are used. The parameter tuning process
is the same as in Sec. 4.1.3.

Table 6: Experiment settings of the PIDL-IDM model and the PIDL-OVM model for the NGSIM data Name | Notation | PIDL-IDM | PIDL-OVM
---|---|---|---
prediction -only |  joint -estimation |  prediction -only |  joint -estimation
one -step |  long -term |  one -step |  one -step |  long -term |  one -step
number of observed data used in training ($\times 5$) | $n_{O}$ | 1, 2, 3, 4, 5, 10, 15, 20
weight of the loss function | $\alpha$ | 0.1, 0.4, 0.7, 1.0
number of collocation data used in training ($\times 5$) | $n_{C}$ | 10
training-validation-test split ratio | - | 0.5:0.25:0.25
learning rate | $lr_{\text{PUNN}}$ | 0.001
$lr_{phy}$ | - | 0.1 | - | 0.1
PUNN hidden layers size | - | (128, 256, 512, 256, 128)
traffic regimes | - |  all regimes combined
pre-calibration method | - |  LS | GA | - |  LS | GA | -

###  5.1 Experiment settings

Below we will detail the extraction and pre-processing of the training data,
PIDL models, baselines and calibration of physics-based models, and evaluation
methods.

##### Extraction and pre-processing of training data

The NGSIM data was collected from a segment of US Highway 101 by a camera
placed on the top of a high building on June 15, 2005. This highway consists
of five lanes in the mainline together with an auxiliary lane between an on-
ramp and an off-ramp. High-resolution vehicular information is provided,
including the position, velocity, acceleration, occupied lane, spacing and the
vehicle class (automobile, truck and motorcycle) at every 0.1 second. We focus
on trajectories of automobiles from all five lanes in the mainline.

We adopt the same method of calculating the speed and acceleration as used in
Coifman and Li (2017). The calculation of speed is as depicted in Eq. 5.1.
This process can be viewed as a non-linear low pass filter, which smooths out
the high-frequency noise. A Savitzky-Golay filter (Coifman and Li, 2017) is
then applied on the calculated velocity to further reduce the remaining noise.

$\begin{split}v(t)&=\underset{i\in\\{1,2,...,7\\}}{med}\frac{x(t+i\Delta
T)-x(t-i\Delta T)}{2i\Delta T}\end{split}$ (5.1)

where,
$med$: sample median,
$x(t+i\Delta T)$: position at time $t+i\Delta T$.
$x(t-i\Delta T)$: position at time $t-i\Delta T$.
$\Delta T$: sampling interval, which is 0.1 second in the NGSIM dataset.

With the processed speed, the calculation of acceleration is done via Eq. 5.2.
A Savitzky-Golay filter is further applied on the calculated acceleration to
further smoothen out the remaining noise.

$\begin{split}a(t)&=\frac{x(t+\Delta T)-x(t-\Delta T)}{2\Delta T}\end{split}$
(5.2)

A CF case consists of trajectory segments of a subject vehicle and its leader,
which is a time-series data of their positions. As we are more interested in
the follower’s state, i.e. a vector consisting of spacing, speed difference
and speed, we represent a CF cases as $\\{[h(t),\Delta
v(t),v(t)]|t=1,...,T_{i}\\}$, where $T_{i}$ is the duration of the $i$th CF
case. A CF case is identified when the following criteria are satisfied:

  1. 1.

The subject vehicle and its leader are in the same lane;

  2. 2.

The spacing does not exceed 150 meters;

  3. 3.

The duration is longer than 10 seconds.

To further reduce heterogeneity in data, we select CF cases with similar
driving behaviors. The process of which is as follows:

  1. 1.

Design a trajectory-level feature for each CF case. We characterize each CF
case by 5 representative parameters estimated from IDM and 3 from OVM. First,
we calibrate an IDM model and an OVM model for each CF case. The parameter
sets of the $i$th CF case for each model are denoted as $\lambda^{IDM}_{i}$
and $\lambda^{OVM}_{i}$, respectively. For example,
$\lambda^{IDM}_{i}=\\{30,1.5,2,0.73,1.63\\}$ and
$\lambda^{OVM}_{i}=\\{30,10,0.03\\}$. Then we combine the parameters
calibrated from two models, and use the eight calibrated parameters
$\lambda_{i}=\lambda^{IDM}_{i}\cup\lambda^{OVM}_{i}=\\{30,1.5,2,0.73,1.63,30,10,0.03\\}$
as the feature to represent a CF case.

  2. 2.

Set similarity criteria. First features calculated in the previous step are
normalized to range [0,1]. The Euclidean distance is computed to measure the
similarity between two CF cases in terms of features. Within the feature
space, a centroid is defined as the feature that has the smallest total
distance to all other features. Once the centroid is located, 50 CF cases are
selected of which features have the smallest distances to the centroid. The
total number of data points is 45K.

######  Note.

We add a one-second reaction time when pairing states with actions before
training IDM and OVM models.

##### PIDL models

To test the performance of PIDL-CF on NGSIM, we try both physics-based models:
IDM and OVM. Accordingly, we will train PIDL-IDM and PIDL-OVM models. For each
model, we will also try both prediction-only and joint-estimation problems.
The PUNNs in the PIDL-IDM and PIDL-OVM models share the same architecture.

##### Baselines and calibration of IDM/OVM

Two types of baseline models are used to compare with the PIDL models for
accelerations prediction accuracy:

  1. 1.

A PUNN model.

  2. 2.

The physics-based models, which include an IDM model and an OVM model. Two
types of calibration methods are used for the IDM/OVM.

    1. (a)

A one-step calibration method, which is the LS estimation. In the LS
estimation, physics parameters are optimized to minimize the error of the
instant prediction of the current acceleration, thus it calibrates physics-
based models from a “one-step” perspective.

    2. (b)

A trajectorial calibration method, which is GA. In GA, the accumulative error
of predicting the whole trajectory can be considered and thus it calibrates
physics-based models from a “trajectorial” perspective.

##### Evaluation methods and metrics

In accordance with the one-step and trajectorial calibration methods, two
evaluation methods are proposed to compute the test errors of the trained
PIDL-CF models:

  1. (a)

A one-step evaluation method, which only considers the instant prediction of
the acceleration. For this evaluation method, we continue to use the test MSE
to measure the discrepancy between the observed and predicted accelerations on
the test data, as is formulated in Eq. 3.7.

  2. (b)

A trajectorial evaluation method, which considers the accumulative error
during the temporal evolution of states and aims to reproduce the entire
trajectory with only the initial state. For this evaluation method, we are
interested in whether the model can reproduce the whole trajectories, or to be
more specific, the position and velocity profiles as shown in Fig. 3. Thus
prediction errors are calculated on positions and velocities instead of
accelerations. In this paper we use a Root Mean Square Percentage Error
(RMSPE) to quantify the position error and the velocity error as follows:

$\begin{split}RMSPE_{x}&=\sqrt{\frac{\sum_{i=1}^{N_{T}}\sum_{t=0}^{T_{i}}\left|\frac{x(t)-\hat{x}(t)}{\hat{x}(t)}\right|^{2}}{\sum_{i=1}^{N_{T}}\sum_{t=0}^{T_{i}}1}},\\\
RMSPE_{v}&=\sqrt{\frac{\sum_{i=1}^{N_{T}}\sum_{t=0}^{T_{i}}\left|\frac{v(t)-\hat{v}(t)}{\hat{v}(t)}\right|^{2}}{\sum_{i=1}^{N_{T}}\sum_{t=0}^{T_{i}}1}},\end{split}$
(5.3)

where,
$x(t)$: the predicted position of the subject vehicle;
$v(t)$: the predicted velocity of the subject vehicle;
$\hat{x}(t)$: the observed position of the subject vehicle;
$\hat{v}(t)$: the observed velocity of the subject vehicle;
$T_{i}$: the time horizon of the $i$th CF case;
$N_{T}$: the total number of CF cases.

###  5.2 Performance comparisons

To demonstrate the performance of PIDL-CF models on NGSIM, we will first
present the models based on one-step comparison, including the prediction-only
and joint-estimation problems of both PIDL-IDM and PIDL-OVM. We then present
the models based on trajectorial comparison, including the prediction-only
problem of both PIDL-IDM and PIDL-OVM.

####  5.2.1 One-step comparison

(a)

(b)

Figure 10: Prediction-only and joint-estimation for PIDL-IDM and PIDL-OVM
using the one-step calibration and evaluation on the NGSIM (US-101) data.

Fig. 10 presents the prediction-only and joint-estimation problems of PIDL-IDM
and PIDL-OVM models using the one-step calibration and evaluation, together
with the baselines results. Fig. 10(a) is the test error of the PIDL-IDM
model, PIDL-OVM model, and the baselines. The x-axis is the number of the
training data, and the y-axis is the test error. The cyan line with crosses is
for the OVM model, the yellow line with squares for the IDM model, the grey
line with circles for the PUNN, the blue line with stars for the prediction-
only PIDL-IDM model, the red line with triangles for the joint-estimation
PIDL-IDM model, the green line with diamonds for the prediction-only PIDL-OVM
model, and the black line with inverted triangles for the joint-estimation
PIDL-OVM model. Fig. 10(b) is the optimal weight $\alpha^{*}$ of the loss
function for both the prediction-only and joint-estimation problems of PIDL-
IDM and PIDL-OVM models. The x-axis stands for the number of training data and
the y-axis for the optimal weight of the loss function. The line specification
for each model is the same as in Fig. 10(a). To compare model performances, we
provide three perspectives below:

  1. 1.

Comparison between PIDL models and baselines. The pure physics-based IDM and
OVM models perform the worst. However, by encoding the physics-based model
into the PUNN, the resulting PIDL models outperform the PUNN. For the PIDL-IDM
model, both the prediction-only and joint-estimation models outperform the
PUNN, especially when the training data is insufficient. For the PIDL-OVM
model, the prediction-only and the joint-estimation models slightly outperform
the PUNN for some training data sizes.

  2. 2.

Comparison between the PIDL-IDM model and the PIDL-OVM model. The PIDL-IDM
models outperform the PIDL-OVM models for both the prediction-only and joint-
estimation problems. It may likely be caused by their physics components. The
IDM model can better predict the acceleration than the OVM model, as indicated
by their test error curves in Fig. 10(a). In other words, IDM provides more
accurate physics information than OVM, resulting in lower prediction errors in
PIDL models. From Fig. 10(b) we observe that $\alpha^{*}$ of the PIDL-IDM
model is lower than that of the PIDL-OVM model for both the prediction-only
and the joint-estimation problems, especially for the joint-estimation
problem. This means a higher weight is given to the physics for the PIDL-IDM
model, likely because IDM provides more accurate physics information than OVM.

  3. 3.

Comparison between the prediction-only problem and the joint-estimation
problem. For the PIDL-OVM model, the test errors of the prediction-only and
joint-estimation are close, while for the PIDL-IDM model, the test error of
the joint-estimation problem is prominently smaller than that of the
prediction problem. This is because the joint-estimation problem jointly
trains parameters of physics, which could lead to more accurate physics than
the prediction model that calibrates physics prior to the training process.
This can be evidenced by $\alpha^{*}$ in Fig. 10(b): its value for the joint-
estimation problem is smaller than that for prediction-only, indicating that a
higher weight is assigned to the physics. In other words, more accurate
physics information can be learned in the joint-estimation problem.

The estimated parameters of the PIDL-IDM and PIDL-OVM models in the joint-
estimation problem are presented in Table 7. From this table, we observe that
the physics parameters of both IDM and OVM begin to converge and fall in a
realistic range. This result, together with the prediction errors in Fig.
10(a), demonstrates that the PIDL models are capable of jointly predicting
accelerations and estimating physics parameters for the real-world data.

Table 7: Estimated physics parameters of the IDM and OVM models in the joint-estimated problem for the NGSIM data. $n_{O}(\times 5)$ | IDM | OVM
---|---|---
$v_{0}(m\cdot s^{-1})$ | $T_{0}(s)$ | $s_{0}(m)$ | $a_{max}(m\cdot s^{-2})$ | $b(m\cdot s^{-2})$ | $v_{max}(m\cdot s^{-1})$ | $h_{c}(m)$ | $k(s^{-1})$
1 | 15.109 | 0.744 | 2.150 | 0.209 | 3.931 | 6.963 | 0.049 | 0.019
5 | 15.025 | 0.606 | 1.647 | 0.290 | 4.162 | 9.636 | 8.015 | 0.014
20 | 16.775 | 0.504 | 1.667 | 0.430 | 3.216 | 10.219 | 6.409 | 0.066

####  5.2.2 Trajectorial comparison

(a)

(b)

Figure 11: Results of the prediction-only PIDL models using the trajectorial
calibration and evaluation for the NGSIM data.

Fig. 11 presents the position and velocity errors of the prediction-only PIDL
models using the trajectorial calibration and evaluation, together with the
baselines results. Fig. 11(a) is the position error and Fig. 11(b) is the
velocity error, with each line indicating the error of each model. The x-axis
is the number of training data and the y-axis is the error. From Fig. 11(a)
and (b), we can observe that the prediction-only PIDL models outperform the
baselines in terms of both the position and velocity errors especially for
insufficient training data.

Comparing Fig. 11 and Fig. 10(a), we observe that by using the trajectorial
calibration and evaluation, the advantages of the PIDL models over the PUNN
become more significant. A sharp contrast is the PIDL-OVM model. It shows a
much more significant advantage over PUNN using the trajectorial calibration
and evaluation than using the one-step calibration and evaluation. This is
because OVM in Fig. 11 is calibrated by GA, with which the trajectorial error
is considered during the calibration process. As a result, OVM provides more
accurate physics information to the PIDL models, leading to a better
performance on the real-world data. This result demonstrates the superior
performance of our PIDL models using the trajectorial calibration and
evaluation over the one-step approach.

(a)  (b)

(c)  (d)

Figure 12: Comparison of predicted and real positions. (a) and (b): $n_{O}$ =
10, $\alpha=0.1$; (c) and (d): $n_{O}=50$, $\alpha=0.4$.

The predicted position trajectories are compared with the ground truth in Fig.
12. The first row is when $n_{O}=10$ and $\alpha=0.1$, and the second row is
when $n_{O}=50$ and $\alpha=0.4$. Different columns are two selected
representative trajectories where a stop-and-go is clearly observed. The
x-axis is the time and the y-axis is position. The dashed line indicates the
real-world trajectory, and the solid lines stand for the predicted ones by
different models: the cyan for the IDM, the yellow for the PUNN, and the red
for the PIDL. By comparison, we can see that the PIDL can better predict the
vehicle position than the PUNN, especially in the stop-and-go regime.

###  5.3 Sensitivity analysis for PIDL components

In this subsection, we will investigate the PIDL methods with different types
of components. IDM and OVM were tested as the physical component in previous
sections, and we will test another two widely used physics-based car-following
models, the GHR and FVDM models. As for the deep learning component, we will
try the LSTM, which is one of the state-of-the-art DL methods in modeling the
microscopic driver behavior.

####  5.3.1 Physics-based car-following models

Apart from IDM and OVM models, we also consider a range of physics-based CFMs,
like the GHR, FVDM, Helly, and Gipps models (defined in Table 1). To determine
which physics can enhance the performance of PIDL-CFM on the NGSIM data, we
first compare the test errors of calibrated physics on the same training set.
Fig. 13 shows the test MSE of those models, in which the x-axis is the number
of training data and the y-axis is the test MSE. Different lines indicate the
error of different physical models. Different markers are used for different
CFMs: squares for the IDM, diamonds for the Gipps, inverted triangles for the
GHR, crosses for the OVM, triangles for the Helly, and circles for the FVDM.
From this figure we can see that the IDM model performs the best when the
number of training data is less than 25, and is worse than the GHR, Helly and
FVDM models as training data increases. Since we are more interested in the
data-insufficient region where the physics-based CFMs play a more important
role in the PIDL performance, we select GHR and FVDM in addition to IDM as the
alternative physics component for the PIDL.

Figure 13: Performance of 6 physical microscopic car-following models.

The results of the PIDL-GHR, PIDL-FVDM, and the previously shown PIDL-IDM are
presented in Fig. 14. Fig. 14 (a) compares the prediction-only results with
the baselines, and Fig. 14 (b) compares the joint-estimation results with the
prediction-only ones. The x-axis is the number of training data and the y-axis
is the test MSE. Different line styles are used to indicate different types of
results: solid lines for baselines, dashed lines for prediction-only results,
and dashed lines with markers for the joint-estimation results. Different
colors are used for different physical models: the red for the IDM, the blue
for the FVDM, the yellow for the GHR, and the black for non-physical model
(ANN). For sake of clarity, results are shown in two subfigures.

In Fig.14(a), the test MSE of prediction-only PIDL models, including PIDL-IDM
(dashed red), PIDL-FVDM (dashed blue), and PIDL-GHR (dashed yellow), are
compared to the pure NN-based component (solid black) and their respective
physics components (solid red lines for the IDM, solid blue for the FVDM, and
solid yellow for the GHR). All the PIDL models outperform the ANN, which shows
that the PIDL method is superior to its pure physics counterparts and thus
agnostic of encoded physics. When the data size is smaller than 50, the PIDL-
IDM outperforms the other two PIDL models. This is because the pure IDM
outperforms the other two physics-based models, and can thus provide more
accurate physics information to better train the PUNN. This advantage is less
significant as the data increases, because the PIDL model weighs more on data
than physics when the data size grows, rendering the physics less influential.

In Fig. 14(b), the line specification of prediction-only models is the same as
in Fig. 14(a), and the dashed lines with markers indicate the results of
joint-estimation PIDL models: the red for the PIDL-IDM, the blue for the PIDL-
FVDM, and the yellow for the PIDL-GHR. The joint-estimation PIDL models
achieve smaller errors than the prediction-only PIDL models for all three
physics-based car-following models, which validates the superiority of the
joint-estimation models across different physics-based CFMs. The advantage of
the PIDL-IDM model is also observed when the training data is less than 50,
which becomes less significant as the training data increases.

(a)

(b)

Figure 14: Performance comparison among PIDL-IDM, PIDL-FVDM and PIDL-GHR on
the NGSIM data.

####  5.3.2 Neural network architecture

To validate the functionality of the PIDL method for other deep learning
model, we changed the DL component of the PIDL from an ANN to a long short-
term memory (LSTM) model. The LSTM model is one of the states-of-the-art DL
model used in the car-following behavior modeling. Different from ANN, LSTM
considers historic data when making a prediction. The PIDL-LSTM structure is
shown in Fig. 15. Fig. 15 (a) introduces how to incorporate LSTM into the PIDL
architecture, and Fig. 15 (b) zooms into the LSTM component with the details
of LSTM cells. In Fig. 15(a), $\mathbf{s}(t)$ is the feature vector
$[h(t),\Delta v(t),v(t)]$, $n$ is the gap length. Note that there is no
historic component in the physics-based CFM, only the latest feature is used
for the physics regardless of the gap length. In Fig.15(b), each rectangle
encloses an LSTM cell. The row element of the input data, which is a feature
vector, $\hat{\mathbf{s}}(t)$ as the observed feature and
$\mathbf{s}(t^{\prime})$ as the collocation feature, is fed into the LSTM cell
sequentially. For each input feature $\mathbf{s}(t)$, the LSTM cell outputs
the cell state ($c(t)$) and hidden state ($h(t)$), which are also fed into the
LSTM cell for the next time step. The hyperbolic tangent function, denoted as
$tanh(\cdot)$, is a non-linear transform function, which adds non-linearity to
the LSTM model. The sigmoid function, denoted as $\sigma(\cdot)$, outputs a
number between zero and one, which controls how much information can pass
through. One means letting everything through and zero means letting nothing
through.

(a)

(b)

Figure 15: PIDL-LSTM model

We apply the LSTM-based PIDL-IDM to NGSIM and present results in Fig. 16. Fig.
16(a) shows the test MSE on two LSTM-based PIDL-IDM models, one with a
1-second gap length (indicated by dashed red line with squares) and the other
with a 3-second gap length (indicated by dashed black line with squares),
against the training data size. Baseline models include pure data-driven LSTM
with gap lengths to be 1 second (dashed red line with inverted triangles) and
3 seconds (dashed black line with inverted triangles), together with an ANN
based PIDL-IDM model (dashed blue line with stars). The x-axis the training
data size and the y-axis is the test MSE. When the length gap is 3 seconds,
both the LSTM and the LSTM-based PIDL model are worse than the ANN-based PIDL
model. The LSTM-based PIDL model achieves the best MSE when the gap length is
1 second, but it can only outperform the ANN-based PIDL model when the
training data size is more than 10. The LSTM-based PIDL model shows its
advantage when the training data size is more than 25. It is because the
LSTM’s complex structure requires more training data but at the same time is
more capable of learning driver reaction. Figure. 16 (b) shows the PIDL-LSTM
results across different gap lengths when the number of training data is fixed
as 20. Note that when the gap length equals to 0, it means that LSTM just uses
data of time step $t$ as how the ANN does. We can see that the LSTM-based PIDL
can only outperform the ANN-based PIDL when the gap length equals to 1 second,
this is partially because the LSTM-based PIDL model of longer gap lengths
demand more training data to achieve a similar performance level as that of
shorter gap lengths, and thus may not be amenable when we have sparse
observations. In conclusion, the PIDL with more complex NN architecture
requires more data to train and may not outperform those with simpler NN
architecture, especially when data is insufficient. When the training data
grows, LSTM-PIDL is superior to the ANN-based PIDL.

(a)

(b)

Figure 16: Results of PIDL-IDM (LSTM) with varying numbers of training data
(a) and varying gap lengths (b).

###  5.4 Sensitivity analysis on different datasets

In this section, we will further validate the PIDL method by varying data. We
first present how the PIDL deals with variability of training data on US-101.
Then we will apply the PIDL on I-80 data, another highway in the NGSIM
dataset.

####  5.4.1 Variability of training data

To show that the advantage of the PIDL model persists across different
training data, we trained the prediction-only PIDL-IDM model and the baselines
for 50 times with randomly sampled data each time, and evaluate the overall
performance. The comparison is shown in Fig. 17. The x-axis is the number of
training data and the y-axis is the test MSE. The solid lines are the test MSE
median among all 50 experiments: the red for the prediction-only PIDL-IDM and
the blue for the PUNN. The bands stand for the first and the third quartiles
of the test MSE across 50 experiments. The median test errors of both models
decrease as the training data size increases, so are their bandwidths. The
overall performance of the PIDL model beats the pure data-driven model even
with training data variability, but the difference shrinks with more training
data.

Figure 17: The performance comparison of the prediction-only PIDL-IDM and PUNN
over 50 experiments.

####  5.4.2 I-80 dataset

We then apply our PIDL method to the I-80 dataset. It consists of a total of
45 minutes multi-lane vehicle data collected every 0.1 second. The data is
processed the same way as the aforementioned US-101 dataset. The results of
the prediction-only PIDL-IDM model together with the baselines are shown in
Fig. 18. The x-axis is the number of training data, and the y-axis is the test
MSE. The line specification for each model is the same as in Fig. 10(a). We
can see that both the prediction-only and joint-estimation PIDL-IDM models
outperform their individual components, i.e., the baseline IDM and PUNN,
respectively. Furthermore, the joint-estimation PIDL-IDM model achieves a
better performance than the prediction-only PIDL-IDM model. The advantage of
the PIDL-IDM models over PUNN becomes less significant as the training data
size increases, which is the same as observed in the NGSIM results in Fig. 10.
From this figure, we conclude that the superiority of the PIDL method persists
for the I-80 dataset for both the prediction-only and joint-estimation
problems.

(a)

(b)

Figure 18: Prediction-only and joint-estimation for PIDL-IDM one-step
calibration and evaluation on the NGSIM (I-80) data.

##  6 Conclusions

This paper lays a methodological framework of physics-informed deep learning
(PIDL) for car-following modeling. It leverages the merits of both physics-
based models and deep learning models. Accordingly, this modeling framework
not only results in a higher estimation accuracy than either physics-based or
neural network based models, their training is also data-efficient and
generalizable. We first propose the architectures of PIDL for two popular
CFMs: IDM and OVM. Then we formulate the physics modeling framework with the
designed loss function containing one term describing the deviation from data
and one indicating the distance from physics prediction. To validate this
approach, we first generate simulated data from an IDM or OVM model that is
then used as observational data to estimate one’s acceleration. We compare its
estimation errors with the simulated values and find that the PIDL-CF
outperforms the physics-uninformed neural networks. Then we test the approach
on the NGSIM data. Building on a comprehensive set of numerical experiments,
we find that our PIDL model is capable of not only predicting accelerations
and but also estimating physics parameters on the real-world data. The
developed PIDL-CF framework is beneficial for system identification of driving
models and for the development of driving-based controls for automated
vehicles.

To the best of our knowledge, this paper is the first-of-its-kind that employs
a hybrid PIDL paradigm where a physics-based CFM is encoded into a neural
network for car-following behavior modeling.  Thus there are still a lot of
unresolved research questions. This work will be extended in several
directions.  (1) More advanced CFMs such as (Li et al., 2012) will be encoded
into the PUNN, which may hold the potential to capturing more complex car-
following behaviors. (2) A systematic procedure of identification of which
physics-based models may better fit real-world data should be developed. (3)
Driver heterogeneity will be accounted for in the PIDL framework. One possible
direction worth of exploration is to integrate the framework developed in this
paper and that in Yuan et al. (2020).

## Acknowledgements

This work is sponsored by the Region 2 University Transportation Research
Center (UTRC) (subcontract RUTGER PO 966112/PID824227) and Amazon AWS Machine
Learning Research Award Gift (#US3085926).

##  Appendix A Metrics for model accuracy

MSE is used in the experiments in Sec. 4 and Sec. 5 to measure prediction
accuracy. We also tried other 3 metrics for the calibration of physics - Mean
Absolute Error (MAE), Mean Square Error (RMSE), and Root Mean Square
Percentage Error (RMSPE). These metrics, together with the aforementioned MSE,
are depicted as follows:

  * 1.

MSE:

$\begin{split}\frac{1}{N_{O}}\sum_{i=1}^{N_{O}}\left|f_{\lambda}(\hat{\mathbf{s}}^{(i)}|\lambda)-\hat{a}^{(i)}\right|^{2}\end{split}$
(A.1)

  * 2.

MAE:

$\begin{split}\frac{1}{N_{O}}\sum_{i=1}^{N_{O}}\left|f_{\lambda}(\hat{\mathbf{s}}^{(i)}|\lambda)-\hat{a}^{(i)}\right|\end{split}$
(A.2)

  * 3.

RMSE:

$\begin{split}\sqrt{\frac{1}{N_{O}}\sum_{i=1}^{N_{O}}\left|f_{\lambda}(\hat{\mathbf{s}}^{(i)}|\lambda)-\hat{a}^{(i)}\right|^{2}}\end{split}$
(A.3)

  * 4.

RMSPE:

$\begin{split}\sqrt{\frac{1}{N_{O}}\sum_{i=1}^{N_{O}}\left|\frac{f_{\lambda}(\hat{\mathbf{s}}^{(i)}|\lambda)-\hat{a}^{(i)}}{\hat{a}^{(i)}}\right|^{2}}\times
100\%\end{split}$ (A.4)

where,
$\lambda$: physics parameters;
$f_{\lambda}(\cdot)$: physics parameterized by ${\lambda}$;
$\hat{\mathbf{s}}^{(i)}$: the $i$th observed feature;
$a_{phy}^{(j)}$: the $j$th acceleration predicted by the physics.

To investigate how different metrics used in training affect the model
performance, we use the same training data but with different metrics as the
objective function. For comparison, we use the MSE during the evaluation on
test dataset to provide a uniform evaluation metric. NGSIM US-101 data is
used, and the size of training data is varied as in Sec. 4 and Sec. 5. Results
are shown in Table. 8.

Table 8: Test MSEs of models with different metrics in the training process. $n_{O}(\times 5)$ | Metrics used in training
---|---
MSE | MAE | RMSPE | RMSE
1 | 0.632 | 0.825 | 0.680 | 1.472
2 | 0.626 | 0.653 | 0.679 | 0.623
3 | 0.619 | 0.637 | 0.645 | 0.619
4 | 0.611 | 0.612 | 0.633 | 0.595
5 | 0.609 | 0.625 | 0.643 | 0.668
10 | 0.601 | 0.612 | 0.647 | 0.641
15 | 0.647 | 0.621 | 0.630 | 0.613
20 | 0.592 | 0.581 | 0.619 | 0.600

We can see that models with different training metrics achieve similar
performance on the same test dataset. Thus, we believe the PIDL-CFM framework
is agnostic of the training metrics.

##  Appendix B Selection of neural network structure in the numerical
experiment

We present the details of determining the structure of the neural networks
here, which contains two parameters, the number of hidden layers and the
number of neurons in each layer. Candidates of these two parameters are
introduced in Sec. 4.1.3. We use numerical data of the accelerating regime to
evaluate the performance of different model structure. The number of training
data ($n_{O}$) equals to 100, and the weights of the loss function ($\alpha$)
equals to 1, which means physics is not involved. The learning rate of the
PUNN ($lr_{\text{PUNN}}$) is set to be $10^{-3}$. The early-stopping criterion
is adopted during the training process, and the test MSE for the epoch with
the minimal validation error is collected for comparison.

Table 9: Test MSEs of neural networks with different structure in the numerical experiment. Number of hidden layers | Number of neutrons in each layer
---|---
30 | 60 | 128 | 256 | 512
1 | 2.26 $\times 10^{-2}$ | 2.39 $\times 10^{-2}$ | 2.47 $\times 10^{-2}$ | 2.21 $\times 10^{-2}$ | 2.00 $\times 10^{-2}$
2 | 2.20 $\times 10^{-2}$ | 2.11 $\times 10^{-2}$ | 2.12 $\times 10^{-2}$ | 2.18 $\times 10^{-2}$ | 2.16 $\times 10^{-2}$
3 | 2.34 $\times 10^{-2}$ | 2.04 $\times 10^{-2}$ | 2.11 $\times 10^{-2}$ | 2.05 $\times 10^{-2}$ | 1.97 $\times 10^{-2}$
4 | 2.19 $\times 10^{-2}$ | 2.16 $\times 10^{-2}$ | 2.36 $\times 10^{-2}$ | 1.94 $\times 10^{-2}$ | 1.73 $\times 10^{-2}$
5 | 2.10 $\times 10^{-2}$ | 2.22 $\times 10^{-2}$ | 1.63 $\times 10^{-2}$ | 1.97 $\times 10^{-2}$ | 2.03 $\times 10^{-2}$

The results are shown in Table. 9. The first column is the number of layers,
and the first row is the number of neurons in each layer. Other entries are
the test error of the corresponding model structure adopting the early-
stopping during training. Note that the test data is held out beforehand, so
the test error reflects the generalization ability of the model. The table
shows that a complex model, if early-stopping is adopted, tends to have a
lower test error. However, we did not select a model structure that is too
complex, such as the one containing 4 layers with 512 neurons in each layer,
because a complex model needs more time to train. After balancing the test
error and training time, we select the structure of 3 layers with 60 neutrons
in each layer.

## References

  * Abadi (2016) Abadi, M., 2016.  Tensorflow: learning functions at scale, in: Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming, pp. 1–1.
  * Alber et al. (2019) Alber, M., Tepole, A.B., Cannon, W.R., De, S., Dura-Bernal, S., Garikipati, K., Karniadakis, G., Lytton, W.W., Perdikaris, P., Petzold, L., Kuhl, E., 2019.  Integrating machine learning and multiscale modeling—perspectives, challenges, and opportunities in the biological, biomedical, and behavioral sciences.  npj Digital Medicine 2, 1–11.
  * Bando et al. (1995) Bando, M., Hasebe, K., et al., 1995.  Dynamical model of traffic congestion and numerical simulation.  Physical Review E 51, 1035\.
  * Batista and Twrdy (2010) Batista, M., Twrdy, E., 2010\.  Optimal velocity functions for car-following models.  Journal of Zhejiang University-SCIENCE A 11, 520–529.
  * Coifman and Li (2017) Coifman, B., Li, L., 2017.  A critical evaluation of the next generation simulation (ngsim) vehicle trajectory dataset.  Transportation Research Part B: Methodological 105, 362–377.
  * Di and Shi (2021) Di, X., Shi, R., 2021.  A survey on autonomous vehicle control in the era of mixed-autonomy: From physics-based to AI-guided driving policy learning.  Transportation Research Part C: Emerging Technologies 125, 103008.
  * Di Giovanni et al. (2020) Di Giovanni, M., Sondak, D., Protopapas, P., Brambilla, M., 2020\.  Finding multiple solutions of odes with neural networks, in: AAAI-MLPS 2020, CEUR-WS. pp. 1–7.
  * Durrani et al. (2016) Durrani, U., Lee, C., Maoh, H., 2016.  Calibrating the wiedemann’s vehicle-following model using mixed vehicle-pair interactions.  Transportation research part C: emerging technologies 67, 227–242.
  * Fang and Zhan (2020) Fang, Z., Zhan, J., 2020.  Physics-informed neural network framework for partial differential equations on 3D surfaces: Time independent problems.  IEEE Access .
  * Fritzsche (1994) Fritzsche, H.T., 1994.  A model for traffic simulation.  Traffic Engineering+ Control 35, 317–21.
  * Gazis et al. (1961) Gazis, D.C., Herman, R., Rothery, R.W., 1961.  Nonlinear follow-the-leader models of traffic flow.  Operations research 9, 545–567.
  * Gipps (1981) Gipps, P.G., 1981.  A behavioural car-following model for computer simulation.  Transportation Research Part B: Methodological 15, 105–111.
  * Greenshields et al. (1935) Greenshields, B., Bibbins, J., Channing, W., Miller, H., 1935\.  A study of traffic capacity, in: Highway research board proceedings, National Research Council (USA), Highway Research Board.
  * Gu et al. (2020) Gu, Z., Li, Z., Di, X., Shi, R., 2020.  An lstm-based autonomous driving model using a waymo open dataset.  Applied Sciences 10, 2046\.
  * He et al. (2019) He, D., Shi, Y., Song, X., 2019.  Weight-free multi-objective predictive cruise control of autonomous vehicles in integrated perturbation analysis and sequential quadratic programming optimization framework.  Journal of Dynamic Systems, Measurement, and Control 141.
  * He et al. (2015) He, Z., Zheng, L., Guan, W., 2015.  A simple nonparametric car-following model driven by field data.  Transportation Research Part B: Methodological 80, 185–201.
  * Helly (1959) Helly, W., 1959.  Simulation of bottlenecks in single-lane traffic flow .
  * Huang et al. (2019) Huang, K., Di, X., Du, Q., Chen, X., 2019.  Stabilizing traffic via autonomous vehicles: A continuum mean field game approach.  the 22nd IEEE International Conference on Intelligent Transportation Systems (ITSC) (DOI: 10.1109/ITSC.2019.8917021) .
  * Huang et al. (2020) Huang, K., Di, X., Du, Q., Chen, X., 2020.  Scalable traffic stability analysis in mixed-autonomy using continuum models.  Transportation Research Part C: Emerging Technologies 111, 616–630.
  * Huang et al. (2018a) Huang, X., Sun, J., Sun, J., 2018a.  A car-following model considering asymmetric driving behavior based on long short-term memory neural networks.  Transportation research part C: emerging technologies 95, 346–362.
  * Huang et al. (2018b) Huang, Y.X., Jiang, R., Zhang, H., Hu, M.B., Tian, J.F., Jia, B., Gao, Z.Y., 2018b.  Experimental study and modeling of car-following behavior under high speed situation.  Transportation research part C: emerging technologies 97, 194–215.
  * Jiang et al. (2001) Jiang, R., Wu, Q., Zhu, Z., 2001.  Full velocity difference model for a car-following theory.  Physical Review E 64, 017101\.
  * Jin and Orosz (2014) Jin, I.G., Orosz, G., 2014.  Dynamics of connected vehicle systems with delayed acceleration feedback.  Transportation Research Part C: Emerging Technologies 46, 46–64.
  * Jin et al. (2010) Jin, S., Wang, D., Tao, P., Li, P., 2010.  Non-lane-based full velocity difference car following model.  Physica A: Statistical Mechanics and Its Applications 389, 4654–4662.
  * Karlik and Olgac (2011) Karlik, B., Olgac, A.V., 2011\.  Performance analysis of various activation functions in generalized mlp architectures of neural networks.  International Journal of Artificial Intelligence and Expert Systems 1, 111–122.
  * Karpatne et al. (2017) Karpatne, A., Atluri, G., et al, 2017.  Theory-guided data science: A new paradigm for scientific discovery from data.  IEEE Transactions on Knowledge and Data Engineering 29, 2318–2331.
  * Kuefler et al. (2017) Kuefler, A., Morton, J., Wheeler, T., Kochenderfer, M., 2017\.  Imitating driver behavior with generative adversarial networks, in: 2017 IEEE Intelligent Vehicles Symposium (IV), IEEE. pp. 204–211.
  * Kumar et al. (2010) Kumar, M., Husain, M., Upreti, N., Gupta, D., 2010\.  Genetic algorithm: Review and application.  Available at SSRN 3529843 .
  * Lazar et al. (2016) Lazar, H., Rhoulami, K., Rahmani, D., 2016.  A review analysis of optimal velocity models.  Periodica Polytechnica Transportation Engineering 44, 123–131.
  * Li et al. (2012) Li, X., Wang, X., Ouyang, Y., 2012.  Prediction and field validation of traffic oscillation propagation under nonlinear car-following laws.  Transportation research part B: methodological 46, 409–423.
  * Nageshrao et al. (2019) Nageshrao, S., Tseng, E., Filev, D., 2019.  Autonomous highway driving using deep reinforcement learning.  arXiv preprint arXiv:1904.00035 .
  * Ossen and Hoogendoorn (2005) Ossen, S., Hoogendoorn, S.P., 2005\.  Car-following behavior analysis from microscopic trajectory data.  Transportation Research Record 1934, 13–21.
  * Ossen and Hoogendoorn (2011) Ossen, S., Hoogendoorn, S.P., 2011\.  Heterogeneity in car-following behavior: Theory and empirics.  Transportation research part C: emerging technologies 19, 182–195.
  * Panwai and Dia (2007) Panwai, S., Dia, H., 2007.  Neural agent car-following models.  IEEE Transactions on Intelligent Transportation Systems 8, 60–70.  doi:10.1109/TITS.2006.884616.
  * Rahman et al. (2017) Rahman, M., Chowdhury, M., Dey, K., Islam, M.R., Khan, T., 2017.  Evaluation of driver car-following behavior models for cooperative adaptive cruise control systems.  Transportation Research Record 2622, 84–95.
  * Rai and Sahu (2020) Rai, R., Sahu, C.K., 2020.  Driven by data or derived through physics? a review of hybrid physics guided machine learning techniques with cyber-physical system (cps) focus.  IEEE Access 8, 71050–71073.
  * Raissi (2018) Raissi, M., 2018.  Deep hidden physics models: Deep learning of nonlinear partial differential equations.  Journal of Machine Learning Research 19, 932–955.
  * Raissi and Karniadakis (2018) Raissi, M., Karniadakis, G.E., 2018\.  Hidden physics models: Machine learning of nonlinear partial differential equations.  Journal of Computational Physics 357, 125–141.
  * Raissi et al. (2019a) Raissi, M., Perdikaris, P., Karniadakis, G.E., 2019a.  Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations.  Journal of Computational Physics 378, 686–707.
  * Raissi et al. (2019b) Raissi, M., Wang, Z., Triantafyllou, M.S., Karniadakis, G.E., 2019b.  Deep learning of vortex-induced vibrations.  Journal of Fluid Mechanics 861, 119–137.
  * Raissi et al. (2020) Raissi, M., Yazdani, A., Karniadakis, G.E., 2020.  Hidden fluid mechanics: Learning velocity and pressure fields from flow visualizations.  Science 367, 1026–1030.
  * Roehrl et al. (2020) Roehrl, M.A., Runkler, T.A., Brandtstetter, V., Tokic, M., Obermayer, S., 2020.  Modeling system dynamics with physics-informed neural networks based on lagrangian mechanics.  arXiv preprint arXiv:2005.14617 .
  * Sharma et al. (2019) Sharma, A., Zheng, Z., Bhaskar, A., 2019.  Is more always better? the impact of vehicular trajectory completeness on car-following model calibration and validation.  Transportation research part B: methodological 120, 49–75.
  * Shi et al. (2021a) Shi, R., Mo, Z., Di, X., 2021a.  Physics-informed deep learning for traffic state estimation: A hybrid paradigm informed by second-order traffic models.  35th AAAI Conference on Artificial Intelligence (AAAI 2021), https://www.aaai.org/AAAI21Papers/AAAI-3617.ShiR.pdf.
  * Shi et al. (2021b) Shi, R., Mo, Z., Huang, K., Di, X., Du, Q., 2021b.  Physics-informed deep learning for traffic state estimation.  (under review) https://arxiv.org/abs/2101.06580 .
  * Shou et al. (2020) Shou, Z., Wang, Z., Han, K., Liu, Y., Tiwari, P., Di, X., 2020.  Long-term prediction of lane change maneuver through a multilayer perceptron.  2020 IEEE Intelligent Vehicles Symposium (IEEE IV 2020) .
  * Sirignano and Spiliopoulos (2019) Sirignano, J., Spiliopoulos, K., 2019\.  Scaling limit of neural networks with the xavier initialization and convergence to a global minimum.  arXiv preprint arXiv:1907.04108 .
  * Treiber et al. (2000a) Treiber, M., Hennecke, A., Helbing, D., 2000a.  Congested traffic states in empirical observations and microscopic simulations.  Physical review E 62, 1805\.
  * Treiber et al. (2000b) Treiber, M., Hennecke, A., Helbing, D., 2000b.  Congested traffic states in empirical observations and microscopic simulations.  Physical review E 62, 1805\.
  * Treiber and Kesting (2013) Treiber, M., Kesting, A., 2013\.  Microscopic calibration and validation of car-following models–a systematic approach.  Procedia-Social and Behavioral Sciences 80, 922–939.
  * Wang et al. (2017) Wang, J., Rakha, H.A., Fadhloun, K., 2017.  Comparison of car-following models: A vehicle fuel consumption and emissions estimation perspective.  Technical Report.
  * Wei and Liu (2013) Wei, D., Liu, H., 2013.  Analysis of asymmetric driving behavior using a self-learning approach.  Transportation Research Part B: Methodological 47, 1–14.
  * Wiedemann and Reiter (1992) Wiedemann, R., Reiter, U., 1992\.  Microscopic traffic simulation: the simulation system mission, background and actual state, cec project icarus (v1052), final report, vol. 2, appendix a.  Brussels: CEC .
  * Wilson (2001) Wilson, R.E., 2001.  An analysis of gipps’s car-following model of highway traffic.  IMA journal of applied mathematics 66, 509–537.
  * Wu and Work (2018) Wu, F., Work, D.B., 2018.  Connections between classical car following models and artificial neural networks, in: Proceedings of the 21st International Conference on Intelligent Transportation Systems (ITSC)), Maui, HI, USA. pp. 3191–3198.
  * Yang et al. (2018) Yang, D., Zhu, L., Liu, Y., Wu, D., Ran, B., 2018\.  A novel car-following control model combining machine learning and kinematics models for automated vehicles.  IEEE Transactions on Intelligent Transportation Systems 20, 1991–2000.
  * Yang and Perdikaris (2019) Yang, Y., Perdikaris, P., 2019\.  Adversarial uncertainty quantification in physics-informed neural networks.  Journal of Computational Physics 394, 136–152.
  * Yu et al. (2021) Yu, T., Canales-Rodríguez, E.J., Pizzolato, M., Piredda, G.F., Hilbert, T., Fischi-Gomez, E., Weigel, M., Barakovic, M., Cuadra, M.B., Granziera, C., et al., 2021\.  Model-informed machine learning for multi-component t2 relaxometry.  Medical Image Analysis 69, 101940\.
  * Yuan et al. (2020) Yuan, Y., Wang, Q., Yang, X.T., 2020.  Modeling stochastic microscopic traffic behaviors: a physics regularized gaussian process approach.  arXiv preprint arXiv:2007.10109 .
  * Zhou and Laval (2019) Zhou, H., Laval, J., 2019.  Longitudinal motion planning for autonomous vehicles and its impact on congestion: A survey.  arXiv preprint arXiv:1910.06070 .
  * Zhou et al. (2017a) Zhou, M., Qu, X., Li, X., 2017a.  A recurrent neural network based microscopic car following model to predict traffic oscillation.  Transportation Research Part C: Emerging Technologies 84, 245–264.  URL: http://dx.doi.org/10.1016/j.trc.2017.08.027, doi:10.1016/j.trc.2017.08.027.
  * Zhou and Ahn (2019) Zhou, Y., Ahn, S., 2019.  Robust local and string stability for a decentralized car following control strategy for connected automated vehicles.  Transportation Research Part B: Methodological 125, 175–196.
  * Zhou et al. (2017b) Zhou, Y., Ahn, S., Chitturi, M., Noyce, D.A., 2017b.  Rolling horizon stochastic optimal control strategy for acc and cacc under uncertainty.  Transportation Research Part C: Emerging Technologies 83, 61–76.
  * Zhou et al. (2020) Zhou, Y., Fu, R., Wang, C., Zhang, R., 2020.  Modeling car-following behaviors and driving styles with generative adversarial imitation learning.  Sensors 20, 5034\.
  * Zhou et al. (2019) Zhou, Y., Wang, M., Ahn, S., 2019.  Distributed model predictive control approach for cooperative car-following with guaranteed local and string stability.  Transportation research part B: methodological 128, 69–86.
  * Zhu et al. (2020) Zhu, M., Wang, X., Hu, J., 2020.  Impact on car following behavior of a forward collision warning system with headway monitoring.  Transportation research part C: emerging technologies 111, 226–244.
  * Zhu et al. (2018) Zhu, M., Wang, X., Wang, Y., 2018.  Human-like autonomous car-following model with deep reinforcement learning.  Transportation research part C: emerging technologies 97, 348–368.