cs.LGNov 23, 2026

Physics-Constrained Neural ODEs for Learning Traffic Dynamics and Trajectories from Road Entry/Exit Times

Authors: Dennis Bogatov Wilkman, Karl Henrik Johansson, Matthieu Barreau

Organizations: Department of Decision and Control Systems, School of Electrical Engineering and Computer Science, Digital Futures, KTH Royal Institute of Technology, 100-44, Sweden

Abstract

We consider the problem of learning microscopic traffic dynamics and reconstructing vehicle trajectories from section entry/exit timestamps (EET) recorded by cameras and from the positions of a probe vehicle leading the platoon. The dynamics are difficult to recover as each vehicle's position is measured only at two points, and its trajectory between them is unknown. By combining Neural ODEs with a local density approximation, we learn a follow-the-leader model whose speed--density relation is a neural network. With such sparse data, an unconstrained network may learn physically unrealistic relations, such as negative speeds or non-zero speeds on a fully congested road. We therefore introduce a normalization that, applied to a monotone neural network with a learned regime change, enforces the endpoint conditions, guaranteeing an admissible speed--density relation while provably retaining the ability to approximate any admissible one. We validate the method on first- and second-order simulations, recovering the speed--density relation of the first-order model and reconstructing the trajectories of both models, with mean maximum position errors of 2.50m and 2.51m, respectively, on a 125~m road segment. On real-world ring-road data, the proposed model still yields an admissible relation, whereas both baselines violate the constraints; the large spread in the data, however, highlights the limitations of a first-order model with homogeneous driver behaviors.

Figures & tables

Explore similar work

CardsList
  1. Local Truncation Error-Guided Neural ODEs for Large Scale Traffic Forecasting

    May 5, 2026Xiao Zhang, Yafei Li, Ruixiang Wang +3Spatiotemporal ForecastingNeural ODEs

  2. Neural ODEs Meet Concurrent Learning: Stable Online Learning with Lyapunov Guarantees

    Sep 26, 2026Omkar Sudhir PatilNeural ODEsNeural Network Training Dynamics

  3. Exact Fixed-Point Constraints in Neural-ODEs: Injecting Prior Knowledge into the Network Parameters

    May 11, 2026Feliciano Giuseppe Pacifico, Duccio Fanelli, Lorenzo Buffoni +3Constrained OptimizationNeural Network Approximation Theory