Table of Contents
Fetching ...

Ultra-fast Traffic Nowcasting and Control via Differentiable Agent-based Simulation

Fumiyasu Makinoshima, Yuya Yamaguchi, Eigo Segawa, Koichiro Niinuma, Sean Qian

Abstract

Traffic digital twins, which inform policymakers of effective interventions based on large-scale, high-fidelity computational models calibrated to real-world traffic, hold promise for addressing societal challenges in our rapidly urbanizing world. However, conventional fine-grained traffic simulations are non-differentiable and typically rely on inefficient gradient-free optimization, making calibration for real-world applications computationally infeasible. Here we present a differentiable agent-based traffic simulator that enables ultra-fast model calibration, traffic nowcasting, and control on large-scale networks. We develop several differentiable computing techniques for simulating individual vehicle movements, including stochastic decision-making and inter-agent interactions, while ensuring that entire simulation trajectories remain end-to-end differentiable for efficient gradient-based optimization. On the large-scale Chicago road network, with over 10,000 calibration parameters, our model simulates more than one million vehicles at 173 times real-time speed. This ultra-fast simulation, together with efficient gradient-based optimization, enables us to complete model calibration using the previous 30 minutes of traffic data in 455 s, provide a one-hour-ahead traffic nowcast in 21 s, and solve the resulting traffic control problem in 728 s. This yields a full calibration--nowcast--control loop in under 20 minutes, leaving about 40 minutes of lead time for implementing interventions. Our work thus provides a practical computational basis for realizing traffic digital twins.

Ultra-fast Traffic Nowcasting and Control via Differentiable Agent-based Simulation

Abstract

Traffic digital twins, which inform policymakers of effective interventions based on large-scale, high-fidelity computational models calibrated to real-world traffic, hold promise for addressing societal challenges in our rapidly urbanizing world. However, conventional fine-grained traffic simulations are non-differentiable and typically rely on inefficient gradient-free optimization, making calibration for real-world applications computationally infeasible. Here we present a differentiable agent-based traffic simulator that enables ultra-fast model calibration, traffic nowcasting, and control on large-scale networks. We develop several differentiable computing techniques for simulating individual vehicle movements, including stochastic decision-making and inter-agent interactions, while ensuring that entire simulation trajectories remain end-to-end differentiable for efficient gradient-based optimization. On the large-scale Chicago road network, with over 10,000 calibration parameters, our model simulates more than one million vehicles at 173 times real-time speed. This ultra-fast simulation, together with efficient gradient-based optimization, enables us to complete model calibration using the previous 30 minutes of traffic data in 455 s, provide a one-hour-ahead traffic nowcast in 21 s, and solve the resulting traffic control problem in 728 s. This yields a full calibration--nowcast--control loop in under 20 minutes, leaving about 40 minutes of lead time for implementing interventions. Our work thus provides a practical computational basis for realizing traffic digital twins.

Paper Structure

This paper contains 25 sections, 25 equations, 7 figures, 2 algorithms.

Figures (7)

  • Figure 1: Framework of the differentiable agent-based traffic simulation for traffic nowcasting and control. The framework consists of two main stages: calibration and nowcasting/control. (1) Calibration: The simulation runs with initial conditions $X(t=0)$, optimizable behavioral parameters ($\theta_b$), and fixed environmental parameters ($\theta_e$). By minimizing the loss $\ell$ between the simulated traffic state $\hat{y}(t=T)$ and ground-truth observations $y(t=T)$ via gradient-based optimization using the gradient ${\partial}{\ell}/{\partial}{\theta_b}$, the behavioral parameter is calibrated to $\theta^{*}_b$, accurately replicating observed traffic dynamics. (2) Nowcasting and Control: Using the calibrated parameter $\theta^{*}_b$, the current traffic state $X(t=T)$, and the current environmental parameter $\theta_e$, the model performs nowcasting to predict the near-future state $\hat{y}(t=T+{\Delta}T)$. To control traffic, a desired state $y^{*}$ is set. The gradient with respect to the environmental parameter, ${\partial}{\ell}/{\partial}{\theta_e}$, is then calculated to determine the optimal interventions $\theta^{*}_e$ (e.g., dynamic pricing, dynamic speed limit control) that guide the system towards this desired state.
  • Figure 2: Calibration results on the Chicago Sketch network. (a) Cumulative traffic counts from the mean-parameter simulation and the calibrated simulation, compared against ground-truth counts. (b) Five-minute traffic counts from the mean-parameter simulation and the calibrated simulation, compared against ground-truth counts. (c) Estimated $\beta$ values compared against ground-truth $\beta$ values. Because the choice probability of the next links is determined only by differences in utility, $\beta$ is normalized for comparison. For clarity, we display only the $\beta$ values of links at junctions connected to the top-10 links by traffic volume.
  • Figure 3: Traffic nowcasting results on the Chicago Sketch network. (a) Estimated cumulative traffic counts at nowcast horizons of 5, 10, 30, and 60 minutes from the current state. (b) Estimated cumulative traffic counts on links at the 60-minute nowcast horizon compared against ground-truth counts. (c) JIT compilation time for different nowcast horizons. (d) Forward simulation time for different nowcast horizons. In panels c and d, whiskers indicate the standard deviation across five trials. The dashed lines represent the regression results, indicating the linear scalability of the nowcasting computation.
  • Figure 4: Traffic control results on the Chicago Sketch network. (a) Network view highlighting the target link to be controlled via cost changes. (b) Optimized cost changes designed to halve the cumulative traffic count on the target link. (c) Cumulative traffic counts on the target link with and without control (cost changes). The dashed line represents the target value (50% reduction).
  • Figure S1: Effect of the trajectory grafting on parameter estimation. (a) Experimental setup. A single agent travels from Link 1 to Link 2 over a total duration of $t=10~\mathrm{s}$. The link lengths are $L_1 = L_2 = 15~\mathrm{m}$. The ground-truth trajectory is generated with free-flow speeds $u_1 = 1.5~\mathrm{m/s}$ on Link 1 and $u_2 = 1.0~\mathrm{m/s}$ on Link 2, resulting in a single observation of the agent at position $x=0~\mathrm{m}$ on Link 2 at $t=10~\mathrm{s}$. From this observation, we estimate $u_1$ and $u_2$ by minimizing the squared error between the observed and simulated positions. (b) Optimization results without TG (left) and with TG (right). The solid and dashed lines represent estimated and true values, respectively. The results for $u_1$ and $u_2$ are shown in different colors.
  • ...and 2 more figures