Paper · 2020-12-24 · cs.LG, eess.SP
A Physics-Informed Deep Learning Paradigm for Car-Following Models
Adds a car-following formula (IDM or OVM) as a second graph to a neural network that predicts acceleration from spacing, speed difference and speed. The loss mixes data error and physics error with weight alpha, and the formula's parameters can be fitted jointly. On simulated data and NGSIM US-101 it beats the plain network, mostly when data is scarce. Results are author-reported.
Physics-informed neural networkKnowledge injectionMulti-layer perceptron (MLP)Gradient clippingcar-followingtraffic-modelingphysics-informedsystem-identificationintelligent-driver-modeloptimal-velocity-model
AI-compiled by claude-haiku-5-5 on 2026-11-08, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
In plain words
Traffic engineers already have simple formulas for how a car should speed up or slow down, given the gap to the car ahead, how fast it is closing on that car, and its own speed. These formulas need little data, but they are rigid. A neural network can fit real driving more closely, but it needs a lot of data.
This paper puts both into one training run. A small network predicts the acceleration. The formula is written into the training loss as a second opinion: at extra states where no acceleration was recorded, the network's output should agree with what the formula says. A single weight decides how much each opinion counts. The formula's constants can be fixed beforehand or learned together with the network.
The authors test this on driving simulated by the same formulas, where the right model is known, and on real highway data. The gains are reported to be largest when training data is scarce.
TL;DR
- The method adds an IDM or OVM car-following formula as a second computational graph, and its output is matched by the network on extra "collocation" states §3.2.3 §4.1.2 §4.2.2.
- The loss weights the data error and the physics error with alpha. Two problems are studied: prediction-only (formula calibrated first) and joint estimation (formula constants trained with the network) §3.1 §3.2 §3.3.
- On data simulated from the same IDM, the mean MSE reduction against the plain network is largest in the emergency-braking regime (16.80%) and smallest in cruising (1.26%) §4.1.4.
- On NGSIM US-101 the text reports qualitative gains, mostly with little data, and gives no NGSIM error numbers in the text §5.2.
- Results are author-reported. No official code was found, and several details (early-stopping patience, batch size, clip bounds, Δv sign) are not stated. See Pitfalls.
Problem
Car-following models predict a follower's acceleration from its spacing to the leader, the speed difference, and its own speed §1 §2.1. Physics-based models (IDM, OVM) have few parameters and a fixed functional form, so they can miss real driver behaviour. Deep networks fit better but need much more data §1 §2.2. The paper asks whether a network whose loss contains a physics term can keep the advantages of both, and whether the physics parameters can be estimated from the same data §3.1 §2.3.
Method
Setting and notation
The state is a three-vector: spacing h, speed difference \Delta v and follower speed v §3.1 note. Observed states \hat{\mathbf{s}}^{(i)} come with observed accelerations \hat{a}^{(i)}. Collocation states \mathbf{s}^{(j)} have no observed acceleration; their acceleration comes from the physics model §3.1 §3.2.2. Two networks are defined:
- the physics-uninformed neural network (PUNN), f_\theta, a fully connected network from state to acceleration §3.2.1;
- the physics graph, f_\lambda, which is IDM §4.1.1 or OVM §4.2.1 with parameters \lambda fig. 5.
Loss
The central equation combines two mean squared errors eq. 3.4:
\text{Loss}_\theta = \alpha\,\text{MSE}_O + (1-\alpha)\,\text{MSE}_C
\text{MSE}_O = \frac{1}{N_O}\sum_i \left| f_\theta(\hat{\mathbf{s}}^{(i)}) - \hat{a}^{(i)} \right|^2, \qquad \text{MSE}_C = \frac{1}{N_C}\sum_j \left| f_\theta(\mathbf{s}^{(j)}) - f_\lambda(\mathbf{s}^{(j)}) \right|^2
The first term is the data discrepancy and the second the physics discrepancy §3.2.3. The paper also checks other training metrics (MAE, RMSE, RMSPE) in app. A.
The two problems
- Prediction-only §3.1 §3.2. The physics parameters \hat{\lambda} are calibrated first on the observed data (objective in eq. 3.5), then fixed. The PUNN is trained with the loss above. Calibration uses least squares (LS) for one-step error or a genetic algorithm (GA) for trajectory error §3.2.4 §5.1. In the numerical study the true parameters are given, so no calibration is needed tab. 3.
- Joint estimation §3.1 §3.3. \lambda is trained together with \theta on the same loss eq. 3.6. The physics output on collocation states changes during training tab. 2 §3.5. The physics gradients are clipped, and the two parts use separate learning rates §3.3.1 §3.3.2.
Data §3.2.2
- Observed pairs: the state at time t is paired with the acceleration at t+\Delta t. Velocity and acceleration come from the first and second derivatives of the position trace. Pairs are then shuffled.
- Collocation states: they carry no observed acceleration and need not appear in the observed trajectories §3.2.2. Their accelerations come from the calibrated physics.
- Split: observed pairs are split into training, validation and test subsets. All collocation data go to training. The numerical split is 0.5 / 0.25 / 0.25 tab. 3 §4.1.3.
Architecture §3.2.1
The PUNN is a fully connected network. Each node takes a weighted sum of the previous layer plus a bias and applies a hyperbolic tangent. The paper chose tanh because it performed better than other forms in its cited prior work §3.2.1. The physics graph is a fixed computation built from the IDM or OVM equations, with its parameters as trainable inputs fig. 5. The paper says other network types, such as recurrent ones, can be used §3.2.1; an LSTM variant is in §5.3.2.
Physics models
# IDM acceleration for the physics graph [eq. 4.1] [§4.1.1]
# Units as in [tab. 3]: h in m, v and dv in m/s, result in m/s^2. (N,)
# Sign convention for dv is not stated in the paper (see Pitfalls).
def idm_acceleration(h, dv, v, v0, T0, s0, a_max, b, delta):
# desired dynamic gap [eq. 4.1]
s_star = s0 + v * T0 + v * dv / (2 * sqrt(a_max * b))
# acceleration from free-road and gap terms [eq. 4.1]
return a_max * (1 - (v / v0) ** delta - (s_star / h) ** 2)# OVM acceleration for the physics graph [eq. 4.2] [§4.2.1]
# delta is fixed to 4 for IDM in the paper; OVM has no delta.
def ovm_acceleration(h, v, v_max, h_c, k):
# optimal velocity as a function of spacing [eq. 4.2]
v_opt = 0.5 * v_max * (tanh(h - h_c) + tanh(h_c))
# relaxation toward the optimal velocity [eq. 4.2]
return k * (v_opt - v)Training loop
The text uses Adam for the PUNN with Xavier uniform initialisation and early stopping on validation MSE §3.2.4. The two algorithms in the paper are printed with a plus sign in the update; the text says gradient descent. The block below follows the text and the Adam choice, with the update written as a generic step.
# Training loop for prediction-only [alg. 1] and joint estimation [alg. 2]
# Joint mode: physics_params is trainable and its gradient is clipped [§3.3.2]
# Stop rule (patience, max epochs) is not stated in the paper.
def train_pidl(punn, physics_params, train, val, alpha, lr_punn, lr_phy):
# keep the parameters with the lowest validation MSE [§3.2.4]
best_val = inf
best_theta = copy(punn.params)
while not stop_rule_met():
# loss on training data with both terms [eq. 3.4] [eq. 3.6]
loss = pidl_loss(punn, physics_params, train, alpha)
# PUNN update with Adam [§3.2.4] [alg. 1]
punn.params = adam_step(punn.params, loss, lr_punn)
# joint only: clipped physics step [§3.3.2] [alg. 2]
if physics_params.trainable:
grad_lam = grad(loss, physics_params)
grad_lam = clip(grad_lam, min_clip, max_clip)
physics_params = physics_params - lr_phy * grad_lam
# validation MSE of the PUNN alone [alg. 1]
val_mse = mse(punn(val.states), val.acc)
if val_mse < best_val:
best_val = val_mse
best_theta = copy(punn.params)
# restore the best parameters before testing [§3.2.4]
punn.params = best_theta
return punn, physics_paramsLoss block
# Combined loss for one step [eq. 3.4] (prediction-only) and [eq. 3.6] (joint)
# alpha in [0, 1]; alpha = 1 leaves only the data term, i.e. a plain network.
def pidl_loss(punn, physics, train, alpha):
# data discrepancy on observed states [eq. 3.4]
pred_obs = punn(train.observed_states) # (N_O,)
mse_obs = mean((pred_obs - train.observed_acc) ** 2)
# physics discrepancy on collocation states [eq. 3.4]
pred_col = punn(train.collocation_states) # (N_C,)
phys_col = physics(train.collocation_states) # (N_C,)
mse_col = mean((pred_col - phys_col) ** 2)
return alpha * mse_obs + (1 - alpha) * mse_colEvaluation §3.4 §5.1
- One-step test error: test MSE on accelerations eq. 3.7.
- Trajectory error (NGSIM only): the model rolls out positions and speeds from the initial state, and the error is a relative root-mean-square percentage on positions and speeds eq. 5.3. The paper calls the two calibration and evaluation modes one-step and trajectorial.
NGSIM preprocessing §5.1
- Speed is the median of central differences over lags 1 to 7 eq. 5.1. Acceleration is a central difference of speed eq. 5.2. A Savitzky–Golay filter is applied after each step; its window and order are not stated.
- A car-following case needs the same lane, a spacing of at most 150 m, and a duration over 10 s. Sampling interval is 0.1 s §5.1.
- Homogeneity filter: each case gets eight calibrated parameters (five from IDM, three from OVM). Features are normalised to [0, 1]; the 50 cases nearest the centroid (the feature with the smallest total distance to all others) are kept, giving about 45K points §5.1.
- A one-second reaction time is added when pairing states and actions for the IDM and OVM calibration §5.1, note.
Hyperparameters
| Name | Value | Where | Notes |
|---|---|---|---|
| Loss weight alpha | prediction-only sweep {0.1, 0.4, 0.7, 1.0}; joint fixed 0.7 (numerical) | tab. 3 §4.1.4 §4.1.5 | alpha = 1 removes the physics term |
| Loss weight alpha (NGSIM) | sweep {0.1, 0.4, 0.7, 1.0}; joint value not stated | tab. 6 §5.2.1 | |
| Observed data, numerical | n_O x 20; prediction-only 1 to 50, joint 1 to 20 | tab. 3 | units are multiples of 20 |
| Collocation data, IDM numerical | prediction-only 20; joint 180 | tab. 3 §4.1.3 §4.1.5 | table lists 1 and 9 (x 20) |
| Collocation data, OVM numerical | prediction-only 100; joint 180 | tab. 3 §4.2.3 | |
| Observed data, NGSIM | n_O x 5 in {1, 2, 3, 4, 5, 10, 15, 20} | tab. 6 | |
| Collocation data, NGSIM | 10 (x 5, so 50) | tab. 6 | |
| Split | 0.5 / 0.25 / 0.25 | tab. 3 tab. 6 | numerical split applied per regime §4.1.3 |
| Learning rate, PUNN | 0.001 | tab. 3 tab. 6 | Adam §3.2.4 |
| Learning rate, physics (joint) | 0.1 | tab. 3 tab. 6 | |
| PUNN layers, numerical | (60, 60, 60), tanh | tab. 3 app. B | chosen from a grid of structures app. B |
| PUNN layers, NGSIM | (128, 256, 512, 256, 128) | tab. 6 | |
| IDM ground truth (numerical) | v0 30 m/s, T0 1.5 s, s0 2 m, a_max 0.73, b 1.63, delta 4 | tab. 3 §4.1.1 | delta fixed |
| OVM ground truth (numerical) | v_max 30, h_c 10 m, k 0.03 s^-1 | tab. 3 §4.2.1 | |
| Simulation step | 0.1 s | §4.1.3 §4.2.3 | |
| IDM lower bound in simulation | -2 m/s^2 for emergency braking | fig. 6 §4.1.3 | applied when generating data |
| Physics gradient clip | minClip, maxClip | alg. 2 | values not stated |
| Early stopping | lowest validation MSE, restore best | §3.2.4 | patience not stated in the rendered text |
| Initialisation | Xavier uniform | §3.2.4 | |
| Batch size, max epochs, Adam betas | not stated | - |
Results
Author-reported. Setup: simulated IDM and OVM data (numerical) and NGSIM US-101 (real), with the plain network (PUNN) and calibrated IDM or OVM as baselines §4 §5.1. The paper states that the numerical setting removes the model-choice error because the true generator is encoded §4.
| Setting | Metric | Baseline | This paper | Source |
|---|---|---|---|---|
| Numerical IDM, prediction-only, emergency braking | mean MSE reduction vs PUNN | PUNN | 16.80% (largest of four regimes) | §4.1.4 fig. 8 |
| Numerical IDM, prediction-only, cruising | mean MSE reduction vs PUNN | PUNN | 1.26% (smallest of four regimes) | §4.1.4 fig. 8 |
| Numerical IDM, joint, n_O x 20 = 1 | test MSE | - | 0.126 | tab. 4 |
| Numerical IDM, joint, n_O x 20 = 20 | test MSE; v0, T0, s0, a_max, b with error % | - | 0.037; 30.799 (2.66%), 1.585 (2.66%), 1.821 (8.93%), 0.737 (0.98%), 1.736 (5.58%) | tab. 4 |
| Numerical OVM, joint, n_O x 20 = 1 | test MSE | - | 0.052 | tab. 5 |
| Numerical OVM, joint, n_O x 20 = 20 | test MSE; v_max, h_c, k with error % | - | 0.013; 30.565 (1.88%), 10.076 (0.76%), 0.029 (2.30%) | tab. 5 |
| Numerical OVM, prediction-only | qualitative | PUNN | better than PUNN, most at small data; alpha* rises with data | §4.2.4 fig. 9 |
| NGSIM US-101, one-step | qualitative | PUNN, IDM, OVM | PIDL-IDM beats PUNN, most at small data; PIDL-OVM slightly; PIDL-IDM above PIDL-OVM; joint above prediction-only for IDM | §5.2.1 fig. 10 |
| NGSIM US-101, trajectorial, prediction-only | position and speed RMSPE | PUNN, calibrated IDM and OVM | PIDL better, most at small data; the OVM gain is larger than in one-step because GA calibration sees the trajectory | §5.2.2 fig. 11 |
| NGSIM joint estimates, n_O x 5 = 20 | IDM v0, T0, s0, a_max, b; OVM v_max, h_c, k | - | 16.775, 0.504, 1.667, 0.430, 3.216; 10.219, 6.409, 0.066 | tab. 7 |
| NGSIM I-80, prediction-only and joint | qualitative | IDM, PUNN | both PIDL beat IDM and PUNN; joint beats prediction-only | §5.4.2 fig. 18 |
| NGSIM, 50 random training draws | median test MSE | PUNN | PIDL-IDM median lower; gap narrows with more data | §5.4.1 fig. 17 |
| Physics choice, NGSIM | test MSE by physics | IDM, OVM, GHR, FVDM, Helly, Gipps | IDM best when training data is below 25 (unit not stated); GHR and FVDM kept as alternatives | §5.3.1 fig. 13 fig. 14 |
| LSTM variant, NGSIM | test MSE | ANN-PIDL | LSTM-PIDL better only with 1 s gap and larger data (above 25 in the text); 3 s gap worse | §5.3.2 fig. 16 |
| Training metric, NGSIM | test MSE | MSE-trained | similar at most sizes; at n_O x 5 = 1, RMSE-trained 1.472 vs MSE-trained 0.632 | app. A |
| Network size choice | test MSE | - | 3 layers of 60 chosen at 2.04e-2; the lowest in the grid is 1.63e-2 (5 layers of 128), not chosen for training time | app. B |
Paper vs code
No official code. The paper and its LaTeX source link no repository (the only link is the journal DOI on the first page p. 1). The arXiv metadata has no code link. Searches: the GitHub repository search for "PIDL-CF", for "physics-informed car-following", and for "physics-informed deep learning car-following IDM OVM" returned no matching repository; the public repositories of one author account were checked and none is related. Other GitHub hits are third-party projects that are not from the authors.
Pitfalls
- Two versions of the objective. Eqs. 3.2 and 3.3 define the problems with only the observed-data error, and as a sum rather than a mean §3.1. Training uses eqs. 3.4 and 3.6, which add the physics term. Implement the mixed loss.
- Update sign. Algorithms 1 and 2 print \theta_{k+1} = \theta_k + lr \nabla \text{Loss} with a plus sign alg. 1 alg. 2. The text says gradient descent and the loss is minimised §3.2.4. Use a minus sign.
- Optimiser. The text says Adam for the PUNN §3.2.4. The algorithms show a plain gradient update. Use Adam, as the text states, and say so in code.
- Physics bounds. The joint problem restricts \lambda to a feasible set \Lambda eq. 3.3 §3.3.1. Only gradient clipping is described (minClip, maxClip, values not stated). No projection onto \Lambda is described.
- Early stopping. The stopping rule and restore step are stated §3.2.4, but patience, maximum epochs and batch size are not in the rendered text. A tolerance of 5000 appears only in a commented-out table in the source, not in the paper.
- Alpha chosen on test data. The optimal weight alpha* is defined as the weight with the lowest test error §4.1.3. Reported alpha* values therefore use the test split. Select alpha on validation data.
- Pairing lag. Observed training pairs use the state at t and the acceleration at t+\Delta t §3.2.2. The NGSIM section adds a one-second reaction time when pairing for IDM and OVM calibration §5.1, note. It is not stated whether the PUNN training pairs use the same lag.
- Sign of Δv. The paper never defines the sign of the speed difference, but the IDM dynamic gap uses v\,\Delta v as printed eq. 4.1. Choose and check the convention against the data.
- Clipped emergency braking. Simulated emergency braking is clipped at -2 m/s² fig. 6 §4.1.3. Whether the physics graph in training applies the same clip is not stated.
- Collocation sampling. Numerical collocation states are random draws from a state space S §4.1.3, whose bounds are not given. Section 3 also names a mesh grid as an option §3.2.2. Collocation accelerations come from the physics model: the true one in the numerical study, a calibrated one on NGSIM.
- Noise model. Gaussian noise is added to simulated trajectories §4.1.3. Its mean and variance are not given in the rendered text; the noise equation is commented out in the source.
- Rollout and error. The integration used to roll positions and speeds forward from predicted accelerations is not described §3.4 §5.1. The RMSPE in eq. 5.3 divides by the observed position and speed, which are zero at standstill in stop-and-go traffic; the paper does not say how this case is handled.
- Speed filter. The Savitzky–Golay settings are not stated §5.1.
- Example vector. The example calibrated feature vectors in §5.1 equal the synthetic ground-truth values in tab. 3. They look illustrative; the paper does not say.
- Units. Table 5 labels v_max in m·s^-2; from context it should be m/s tab. 5. Table 7 uses m/s.
- Appendix A labels. The text calls the root form "Mean Square Error (RMSE)" app. A. The paper says the training metric is "agnostic", but the spread at one observed unit is large app. A.
- Unit of n_O. Numerical tables multiply n_O by 20, NGSIM tables by 5. The trajectory figure caption gives n_O as 10 and 50 without a unit fig. 12.
- Physics as ground truth. The numerical study generates data from the same formulas it encodes §4. Gains there show that correct physics helps, not that real traffic is governed by it. The NGSIM gains are qualitative.
- Physics parameters on real data. The text says the NGSIM physics parameters "fall in a realistic range" §5.2.1 without giving a reference range.
- Equation and table numbers. Equation numbers are section-based (section.counter) and were counted from the LaTeX source, skipping commented blocks. They were not checked against the compiled PDF. Appendix equations and tables are cited by appendix letter.
Lineage
- Builds on: physics-informed neural networks for PDE solving, cited in the text as Raissi et al. (2018) §2.2; the IDM of Treiber et al. (2000) §4.1.1; the OVM of Bando et al. (1995) with a review by Lazar et al. (2016) §4.2.1; the Adam optimiser and Xavier initialisation, by name §3.2.4.
- Compared against: IDM and OVM calibrated by LS or GA §5.1; the plain network, i.e. alpha = 1 §4.1.4; a hybrid of Gipps and an ANN by Yang et al. (2018) and a physics-regularised Gaussian process by Yuan et al. (2020), both in §2.2; GHR, FVDM, Helly and Gipps as alternative physics §5.3.1; LSTM §5.3.2.
- Superseded by: none known from this wiki.
Source and license
Adapted from “A Physics-Informed Deep Learning Paradigm for Car-Following Models” by Zhaobin Mo, Xuan Di, Rongye Shi (arXiv:2012.13376), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors.