---
title: 'RoadDiff: Two-Stage Diffusion for Traffic Inference'
url: https://www.emergentmind.com/topics/roaddiff
type: topic
---

# RoadDiff: Two-Stage Diffusion for Traffic Inference

Searching arXiv for the specific RoadDiff paper and closely related diffusion-for-road/traffic works to ground the article.
RoadDiff is a two-stage framework for **Fine-grained Road Traffic Inference (FRTI)**, a task that infers **lane-level traffic states** from **road-level traffic observations** together with road and lane topology. It formulates FRTI as the **first spatio-temporal graph node generation problem**, because the model must generate a finer node set—lane nodes—from a coarser road graph while respecting traffic-state constraints. The framework combines a **Road-Lane Correlation Autoencoder-Decoder** with a **Lane Diffusion Module**, and it is evaluated on six datasets covering speed and flow under both regular and irregular lane configurations [2507.19089].

## 1. Fine-grained Road Traffic Inference as graph node generation

The problem addressed by RoadDiff is motivated by the disparity between the availability of **road-level** traffic data and the operational need for **lane-level** traffic information in applications such as autonomous driving, lane-change guidance, dynamic lane allocation, traffic signal control, fleet routing, and precise congestion management. Road-level measurements only describe an aggregate state of a road segment, whereas many downstream decisions are lane-specific. The paper identifies three main difficulties: **coarse-to-fine information loss**, because road observations omit lane heterogeneity; **irregular lane topology**, because road segments can have different numbers of lanes; and **different physical constraints for different traffic states**, because speed and flow obey different aggregation laws [2507.19089].

Formally, the road network is modeled as an undirected graph
\[
G^R = (V^R, E^R, A^R),
\]
where \(V^R\) are road-segment nodes and \(A^R \in \mathbb{R}^{I \times I}\) is the static road adjacency matrix. The lane network is likewise modeled as
\[
G^L = (V^L, E^L, A^L),
\]
where each lane node \(l_{i,j}\) is the \(j\)-th lane segment belonging to road segment \(r_i\), and
\[
N = \sum_{i=1}^{I} J_i
\]
is the total number of lane nodes. The lane adjacency captures four directions—**up, down, left, right**—to represent along-road and cross-lane connectivity. Over a time window \(T\), the task is to infer
\[
X^L = \{X_1^L, X_2^L, \ldots, X_T^L\}
\]
from
\[
X^R = \{X_1^R, X_2^R, \ldots, X_T^R\},
\]
with the overall mapping written as
\[
f[X^R, G^R, G^L] \rightarrow X^L.
\]

The physical constraints are central. For **speed**, the road state equals the **average** of lane states:
\[
x_t^{r_i} = \frac{1}{J_i}\sum_{j=1}^{J_i} x_t^{l_{i,j}}.
\]
For **flow**, the road state equals the **sum** of lane states:
\[
x_t^{r_i} = \sum_{j=1}^{J_i} x_t^{l_{i,j}}.
\]
This makes FRTI not merely a fine-grained generation problem, but a constrained generation problem under traffic physics.

## 2. Road-Lane Correlation Autoencoder-Decoder

The first stage of RoadDiff is the **Road-Lane Correlation Autoencoder-Decoder**, which produces an initial lane-level inference from road-level inputs. It is not presented as a VAE-style probabilistic autoencoder; rather, it is a deterministic encoder-decoder that learns road spatio-temporal features and maps them into lane representations. The encoder combines **static graph convolution**, **dynamic graph attention**, **temporal attention**, and **MLP-based temporal aggregation**, while the decoder expands road representations to lane representations and restores lane-level spatio-temporal structure [2507.19089].

For static road-level spatial modeling, the encoder applies graph convolution:
\[
x^{r_i,(m+1)} = \sigma \left( D_R^{-\frac{1}{2}} A^R D_R^{-\frac{1}{2}} x^{r_i,(m)} W^{(m)} \right).
\]
To capture dynamic spatial dependency beyond fixed topology, it adds graph attention:
\[
\alpha_{r_i,r_j} = \frac{ \exp\left(\text{LeakyReLU}\left(a^T[W x^{r_i} \| W x^{r_j}]\right)\right) }{ \sum_{r_k \in \mathcal{N}(r_i)} \exp\left(\text{LeakyReLU}\left(a^T[W x^{r_i} \| W x^{r_k}]\right)\right) }.
\]
The final spatial representation is a weighted combination of static and dynamic components:
\[
\overline{x}^{r_i} = \beta \left( D_R^{-\frac{1}{2}} A^R D_R^{-\frac{1}{2}} x^{r_i} W \right) + (1-\beta)\left( \sum_{r_j \in \mathcal{N}(r_i)} \alpha_{r_i,r_j} W x^{r_j} \right).
\]

Temporal modeling is then introduced through an attention score
\[
e_{(t)}^{r_i,r_j} = \text{ReLU}\left( \frac{W_q \overline{x}^{r_i}_t \cdot W_k \overline{x}^{r_j}_t}{\sqrt{d_k}} \right),
\]
normalized as
\[
\alpha_{(t)}^{r_i,r_j} = \frac{\exp(e_{(t)}^{r_i,r_j})}{ \sum_{r_k \in \mathcal{N}(r_i)} \exp(e_{(t)}^{r_i,r_k}) }.
\]
These weights aggregate previous-step features:
\[
\widetilde{x}_t^{r_i} = \sum_{r_j \in \mathcal{N}(r_i)} \alpha_{(t)}^{r_i,r_j} W_v \overline{x}_{t-1}^{r_j},
\]
and the encoder collapses the time window into a hidden road representation
\[
\widehat{X}^R = \text{MLP}\left(\sum_{t=1}^T \widetilde{x}_t^{r_i}\right).
\]

The decoder maps each road hidden vector to multiple lane nodes by
\[
\ddot{x}^{l_{i,j}} = W_d \widehat{x}^{r_i} + b_d.
\]
It then applies lane-level static and dynamic aggregation:
\[
\overline{x}^{l_{i,j}} = \gamma \left( D_L^{-\frac{1}{2}} A^L D_L^{-\frac{1}{2}} \ddot{x}^{l_{i,j}} W_L \right) + (1-\gamma) \left( \sum_{l_{a,b} \in \mathcal{N}(l_{i,j})} \alpha_{l_{i,j},l_{a,b}} W_L \ddot{x}^{l_{a,b}} \right),
\]
followed by lane temporal restoration
\[
\widetilde{x}_t^{l_{i,j}} = \sum_{l_{a,b} \in \mathcal{N}(l_{i,j})} \alpha^{(t)}_{l_{i,j},l_{a,b}} W_{Lv}\overline{x}^{l_{i,j}}_{t-1},
\]
and final initial lane output
\[
\widehat{X}^L = \text{MLP}\left(\sum_{t=1}^T \widetilde{x}_t^{l_{i,j}}\right).
\]

This stage learns **road-road correlations**, **lane-lane correlations**, **road-lane correspondence**, and **temporal traffic dependencies**. A plausible implication is that the first stage provides a structured coarse estimate whose errors are then treated as a diffusion-refinement problem rather than as a purely direct decoding problem.

## 3. Lane Diffusion Module and constraint-aware denoising

The second stage, the **Lane Diffusion Module**, refines the initial lane information \(\widehat{X}^L\). Its role is to simulate uncertainty in lane generation, learn the lane-state distribution, refine initial lane estimates, and enforce road-lane physical constraints during denoising. The paper frames diffusion as advantageous over plain VAE-style generation because it avoids posterior collapse and yields better sample quality and robustness [2507.19089].

The forward process is explicitly **road-conditioned**:
\[
q(\widehat{X}^L_{(n)} \mid \widehat{X}^L_{(n-1)}, \widehat{X}^R_{(n-1)}) = \mathcal{N} \Big( \widehat{X}^L_{(n)}; \sqrt{1-\beta_n}\,\widehat{X}^L_{(n-1)} + \gamma_n \widehat{X}^R_{(n-1)}, \beta_n \mathbf{I} \Big),
\]
with sampling equation
\[
\widehat{X}^L_{(n)} = \sqrt{1-\beta_n}\,\widehat{X}^L_{(n-1)} + \gamma_n \widehat{X}^R_{(n-1)} + \sqrt{\beta_n}\epsilon, \qquad \epsilon \sim \mathcal{N}(0,\mathbf{I}).
\]
Unlike a vanilla DDPM, the noising process injects road information at each step through \(\gamma_n \widehat{X}^R\).

The reverse process is parameterized as
\[
p_\theta(\widehat{X}^L_{(n-1)} \mid \widehat{X}^L_{(n)}, \widehat{X}^R_{(n)}) = \mathcal{N} \Big( \widehat{X}^L_{(n-1)}; \mu_\theta(\widehat{X}^L_{(n)}, \widehat{X}^R_{(n)}, n), \Sigma_\theta(\widehat{X}^L_{(n)}, n) \Big),
\]
with noise prediction
\[
\epsilon_\theta(\widehat{X}^L_{(n)}, \widehat{X}^R_{(n)}, n).
\]
Conceptually, reverse denoising removes uncertainty while re-aligning lane estimates with road-level conditions.

Constraint-guided refinement is applied by gradient correction:
\[
\widehat{X}^L_{(n)} = \widehat{X}^L_{(n)} - \eta \frac{\partial \mathcal{L}_{con}}{\partial \widehat{X}^L_{(n)}}.
\]
For speed,
\[
\mathcal{L}_{con} = \sum_{i=1}^{I} \left( x^{r_i} - \frac{1}{J_i}\sum_{j=1}^{J_i} x^{l_{i,j}} \right)^2,
\]
and for flow,
\[
\mathcal{L}_{con} = \sum_{i=1}^{I} \left( x^{r_i} - \sum_{j=1}^{J_i} x^{l_{i,j}} \right)^2.
\]

The training objective combines KL, reconstruction, and constraint terms:
\[
\mathcal{L}(\theta) = \mathcal{L}_{KL} + \mathcal{L}_{recon} + \lambda \mathcal{L}_{con},
\]
where
\[
\mathcal{L}_{recon} = \mathbb{E}_{X^L,\epsilon,n} \left[ \|\epsilon - \epsilon_\theta(\widehat{X}^L_n, n)\|^2 \right]
\]
and
\[
\mathcal{L}_{KL} = \mathbb{E}_q \left[ \sum_{n=1}^{N} D_{KL} \big( q(\widehat{X}^L_{n-1} \mid \widehat{X}^L_n, \widehat{X}^L_0) \;\|\; p_\theta(\widehat{X}^L_{n-1} \mid \widehat{X}^L_n) \big) \right].
\]
This makes the diffusion module simultaneously a denoiser, a distribution learner, and a physics-consistency mechanism.

## 4. Datasets, baselines, and reported performance

RoadDiff is evaluated on six tasks derived from three paired road-lane datasets: **PeMS Speed**, **PeMS Flow**, **PeMS\_F Speed**, **PeMS\_F Flow**, **HuaNan Speed**, and **HuaNan Flow**. PeMS is a regular 5-lane freeway dataset from the Santa Ana Freeway, Los Angeles; PeMS\_F uses irregular lane counts \([5,6,5,6,5,6,5,5]\) from the same source; HuaNan is an urban expressway dataset from the South China Expressway, Guangzhou. The paper compares RoadDiff with 17 adapted baselines spanning a **Physics** baseline, **FUFI** image-style fine-grained inference models such as UrbanFM and CUFAR, encoder-decoder baselines such as DCRNN and MegaCRN, and spatio-temporal graph baselines such as STGCN, MTGNN, GraphWaveNet, AGCRN, and STGODE [2507.19089].

The evaluation metrics are **MAE**, **RMSE**, and **MAPE**, all lower-is-better. The paper states that RoadDiff is best across all reported benchmarks. It also notes that graph models are the strongest baseline family, whereas FUFI/grid methods degrade sharply on irregular lane topology, particularly on PeMS\_F. The following table collects representative RoadDiff results.

| Dataset/task | Window | RoadDiff result |
|---|---:|---|
| PeMS Speed | 3 | MAE 7.04, RMSE 9.22, MAPE 21.47% |
| PeMS Flow | 6 | MAE 14.42, RMSE 23.68, MAPE 16.15% |
| PeMS\_F Speed | 6 | MAE 6.94, RMSE 9.10, MAPE 21.36% |
| PeMS\_F Flow | 6 | MAE 14.83, RMSE 24.56, MAPE 16.28% |
| HuaNan Speed | 6 | MAE 3.11, RMSE 4.40, MAPE 10.21% |
| HuaNan Flow | 3 | MAE 4.83, RMSE 7.85, MAPE 71.97% |

Several result patterns are emphasized. On **PeMS speed**, RoadDiff reports **MAE 7.04, RMSE 9.22, MAPE 21.47%** at window 3, while MTGNN at window 1 reports **MAE 10.87, RMSE 13.94, MAPE 39.12%**, and the Physics baseline at window 1 reports **MAE 11.47, RMSE 14.78, MAPE 50.78%**. The paper interprets this as roughly a **40% error reduction relative to the best-performing baseline** for speed. On irregular-lane **PeMS\_F speed**, RoadDiff reports **MAE 6.95, RMSE 9.11, MAPE 21.54%** at window 3, while GraphWaveNet at window 1 reports **MAE 9.72, RMSE 13.13, MAPE 32.61%**. On **HuaNan speed**, RoadDiff reaches **MAE 3.12, RMSE 4.41, MAPE 10.24%** at window 3.

The ablations remove the Lane Diffusion Module (**w/o D**), graph attention (**w/o GA**), MLP attention mechanisms (**w/o MA**), or replace the Road-Lane Correlation Autoencoder-Decoder with a linear layer (**r/w L**). The paper reports that removing any component significantly degrades performance, and that the **Lane Diffusion Module** is the most critical component in many settings. Sensitivity studies over diffusion steps further show that too few steps underfit denoising and too many can overfit or become inefficient. For example, on **PeMS speed**, 5 steps give **8.62 / 11.29 / 26.30%**, 10 steps give **7.04 / 9.22 / 21.47%**, 20 steps give **7.19 / 11.50 / 21.91%**, and 30 steps give **7.87 / 10.30 / 23.99%**. The paper therefore characterizes the best settings as generally around **10–20** steps, though some flow tasks benefit from 30.

## 5. Position within diffusion research on road and traffic domains

RoadDiff belongs to a broader diffusion-based literature on structured road-domain generation, but its target object is distinctive: it generates **lane-level traffic states on a lane graph** from **road-level traffic states on a road graph**. This distinguishes it from diffusion models for road layout generation, traffic-scenario generation, trajectory generation, or end-to-end driving. **DiffRoad** generates **realistic, diverse, and controllable 3D road scenarios** and converts them into **OpenDRIVE** for simulator use [2411.09451]. **Path Diffuser** is a **two-stage, map-conditioned diffusion simulator** that generates agent initializations and trajectories from map context alone, using **Frenet-frame motion primitive candidates** to improve road compliance [2509.24995]. **Diff-RNTraj** generates **road network-constrained trajectories** in a hybrid representation \((e_t,r_t)\), where each point consists of a road segment and a moving ratio [2402.07369]. **DiffAD** reformulates end-to-end autonomous driving as **conditional image generation** over a unified BEV latent [2503.12170], while **DualDiff+** is a dual-branch conditional diffusion model for driving-scene image and video generation with occupancy-derived perspective-aligned control [2503.03689].

The methodological overlap is that all of these systems use diffusion to model structured objects in road-adjacent domains. The substantive difference is that RoadDiff is not a scene synthesizer, map generator, or trajectory generator. Its core object is a **spatio-temporal graph node expansion** from roads to lanes under **speed-average** and **flow-sum** constraints. This suggests that the most original aspect of RoadDiff is not diffusion in isolation, but the combination of diffusion with a road-to-lane graph transformation problem.

## 6. Assumptions, limitations, and outlook

RoadDiff assumes that **road and lane topology are known**, that **road-to-lane correspondence is known**, that road speed is approximated by the **average** of lane speeds, that road flow is the **sum** of lane flows, and that temporal dependencies can be inferred from a recent fixed window. It also assumes that lane adjacency can be captured by **up/down/left/right** relationships. These assumptions make the problem well posed, but they also delimit the method’s scope [2507.19089].

Several limitations are explicit or strongly implied. The paper states that future work will improve **diffusion efficiency and computational performance** and extend graph diffusion ideas to other **spatio-temporal graph generation problems**. It does not provide runtime or latency comparisons, and the exact train/validation/test split is not clearly documented in the provided description. No robustness experiments under missing or noisy road sensors are reported, and no explicit uncertainty-calibration metrics are given. Another empirically visible limitation is that **flow MAPE remains high on HuaNan** across methods, including RoadDiff; the reported **71.97%** at window 3 indicates that flow inference remains harder than speed inference in that setting.

Even with those caveats, the reported evidence indicates a coherent explanation for the model’s performance. The first stage captures **graph-structured spatio-temporal dependencies** and **cross-granularity road-lane correspondence**; the second stage performs **uncertainty-aware diffusion refinement** under explicit physical constraints. This suggests that RoadDiff’s significance lies less in introducing diffusion to traffic forecasting per se than in defining a new graph-generation problem and showing that diffusion can be used as a refinement mechanism for constrained fine-grained traffic inference.

Source: https://www.emergentmind.com/topics/roaddiff