Paper · 2021-06-28 · cs.CV, cs.RO
Multimodal Trajectory Prediction Conditioned on Lane-Graph Traversals
PGP predicts several future paths of a target vehicle. A GRU and graph encoder over lane-graph nodes feeds a behaviour-cloned policy that samples routes; an attention decoder conditioned on each route and a 5-d Gaussian latent outputs trajectories, clustered to K=10. Author-reported on nuScenes: MinADE10 1.00, MissRate10,2 0.37, offroad 0.03; best or tied on four of five metrics.
Graph neural networkImitation learningAttention mechanismRecurrent neural network (RNN)trajectory-predictionautonomous-drivinglane-graphnuscenes
AI-compiled by claude-haiku-5-5 on 2026-10-18, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
In plain words
Predicting where a car will be a few seconds from now is uncertain: it may turn, keep its lane, speed up or brake. Many earlier systems read the map, squeeze everything into one summary and then output several guesses in one go. Some of those guesses drive off the road.
This paper's model, PGP, treats the road map as a graph of lane pieces. It first samples routes a driver could take through that graph, favouring the routes that look more likely given how the car is moving. Then it predicts a path along each sampled route, and adds a random number that changes the speed and braking pattern. Each guess is therefore built from a route plus a motion style, so the set of guesses spreads out over both where the car goes and how it drives.
The point is that the guesses stay on legal routes and cover both kinds of uncertainty. The card reports how this compares with other nuScenes entries below.
TL;DR
- PGP predicts K = 10 future trajectories of a target vehicle on nuScenes from 2 s of history and a lane-graph HD map §5.
- Route variety comes from a learned discrete policy that rolls out paths in the lane graph; motion variety comes from a sampled 5-d Gaussian latent §4.2, §4.3.
- The policy is trained by behaviour cloning on ground-truth routes; the decoder by winner-takes-all regression eq. 3, eq. 5.
- Author-reported: best MinADE and MissRate at 10 modes among the compared entries, with offroad rate tied with P2T tab. 1.
- Only one dataset is evaluated, and the headline configuration is ambiguous (see Pitfalls).
Problem
Models that encode the whole scene into one context vector and map it to several trajectories must learn a one-to-many mapping, which can produce predictions that go off the road or break traffic rules §1. Rasterised bird's-eye-view maps are costly to process, can lose connectivity through occlusion, and need large receptive fields §1, §2. Goal-conditioned methods pick goal points, but a goal may be unreachable or reachable by several paths §2. The paper assumes an HD map with lane centrelines, and past tracks of the target and nearby agents from on-board detection and tracking §3.1.
Method
The model has three modules trained end to end: a graph encoder that gives each lane node a feature vector using the map and nearby agents §4.1, fig. 2; a policy header that scores outgoing edges at each node and samples routes §4.2; and an attention decoder that predicts trajectories from each sampled route plus a latent sample §4.3.
Input representation §3.1, §3.2, app. A.1
- Each agent's past is a sequence of motion states with position, speed, acceleration, yaw rate and a pedestrian flag. The target vehicle has index 0 §3.1.
- The lane graph is directed. Nodes are lane-centreline snippets of at most 20 m, sampled at 1 m, in an area of ±50 m laterally and −20 to 80 m longitudinally around the target app. A.1. Each pose carries position, yaw and a 2-D binary flag for stop line and crosswalk §3.2.
- Edges are successor edges (lane continuation, including branches and merges) and proximal edges (lane changes between neighbouring nodes whose distance and yaw are within thresholds) §3.2.
Encoder §4.1, app. A.2–A.4
- Three GRU encoders, each with depth 1 and hidden size 32, run over linearly embedded inputs (embedding size 16, leaky ReLU). They produce the target's motion encoding, the agent encodings and the initial node encodings app. A.2.
- Agent-node attention: each node attends to nearby agents within a distance threshold, using one scaled dot-product head with 32×32 projections. The attention output is concatenated with the node encoding and passed through a linear layer of size 32 with leaky ReLU §4.1, app. A.3.
- Graph layers: GCN or GAT (one or two layers were ablated). Successor and proximal edges are treated as equivalent and bidirectional, output size 32 §4.1, app. A.4.
Discrete policy over the lane graph §4.2
- Each edge gets a scalar score from an MLP over the motion encoding, the two node encodings and an indicator for successor edges eq. 1. The MLP has two hidden layers of size 32 and input size 98 app. A.5.
- A softmax over the outgoing edges of each node gives the policy eq. 2. Rolling this out from the target's node yields sampled routes.
- Training uses behaviour cloning. Ground-truth poses are assigned to nodes, and an edge counts as visited if both its nodes are visited. The loss is the negative log-likelihood of visited edges eq. 3.
Trajectory decoder §4.3, app. A.6
- For a sampled route with nodes v1 … vM, multi-head scaled dot-product attention (32 heads) runs with the motion encoding as query and the route's node features as keys and values. The output is a context vector of size 128 §4.3, app. A.6.
- A latent z is drawn from a standard normal distribution of dimension 5. An MLP with one hidden layer of size 128 maps the motion encoding, context and z to a trajectory with 24 outputs, which are x and y over 6 s at 2 Hz eq. 4, app. A.6.
- The model draws 200 samples per instance and, during training, the appendix says, clusters them with K-means into K = 10 trajectories §4.3, app. A.6. Training uses the winner-takes-all average L2 error over time eq. 5.
- Total loss: the sum of the policy and regression losses, with unit weights eq. 6.
# Forward pass for one target vehicle, condensed from the text (no algorithm
# box in the paper) [§3-4] [app. A]
# Input: motion histories of all agents, lane graph G(V, E)
# Output: K trajectories, one per cluster centre
def predict(target_history, agent_histories, lane_graph):
# Encode target, agents and lane nodes with GRUs [app. A.2]
motion = gru_target(target_history) # (32,)
agents = gru_agent(agent_histories) # (num_agents, 32)
nodes = gru_node(lane_graph.node_polylines) # (num_nodes, 32)
# Let each node attend to nearby agents [§4.1] [app. A.3]
nodes = agent_node_attention(nodes, agents) # (num_nodes, 32)
# Mix features along the graph with GCN or GAT [§4.1] [app. A.4]
nodes = graph_layers(nodes, lane_graph.edges) # (num_nodes, 32)
# Sample policy rollouts through the lane graph [§4.2] [eq. 1-2]
# number of rollouts per instance: not stated
routes = sample_routes(motion, nodes, lane_graph)
# Decode a trajectory for each route plus a latent sample [§4.3] [eq. 4]
trajectories = []
for route in routes:
# Attention over the route's nodes gives the context [app. A.6]
context = multi_head_attention(motion, nodes[route]) # (128,)
# Latent sample, 5-dimensional standard normal [app. A.6]
latent = sample_standard_normal(dim=5)
trajectory = mlp(concat(motion, context, latent)) # (24,)
trajectories.append(trajectory)
# Cluster the samples into K modes, K = 10 [§4.3] [app. A.6]
return kmeans_centres(trajectories, k=10)# Training losses for one instance [eq. 3] [eq. 5] [eq. 6]
def training_loss(policy, visited_edges, trajectories, gt_trajectory):
# Behaviour cloning on the ground-truth route [eq. 3]
loss_bc = 0.0
for edge in visited_edges:
loss_bc = loss_bc - log(policy[edge])
# Average L2 error over time for each sampled trajectory [eq. 5]
errors = [mean_l2(traj, gt_trajectory) for traj in trajectories]
# Winner-takes-all: only the best sample is penalised [eq. 5]
loss_reg = min(errors)
# Unit weights on both terms [eq. 6]
return loss_bc + loss_regKey equations, as written in the paper:
\mathrm{score}(u,v) = \mathrm{MLP}\big(\mathrm{concat}(h_{motion}, h^{u}_{node}, h^{v}_{node}, \mathbb{1}_{(u,v)\in E_{suc}})\big) eq. 1
\pi_{route}(v \mid u) = \mathrm{softmax}\big(\{\mathrm{score}(u,v) \mid (u,v)\in E\}\big) eq. 2
\mathcal{L}_{BC} = \sum_{(u,v)\in E_{gt}} -\log \pi_{route}(v \mid u) eq. 3
\tau^k_{1:t_f} = \mathrm{MLP}\big(\mathrm{concat}(h_{motion}, \mathcal{C}_k, z_k)\big) eq. 4
\mathcal{L}_{reg} = \min_k \frac{1}{t_f}\sum_{t=1}^{t_f} \lVert \tau^k_t - \tau^{gt}_t \rVert_2 eq. 5
\mathcal{L} = \mathcal{L}_{BC} + \mathcal{L}_{reg} eq. 6
Training app. A.7: Adam, learning rate 1e-4, batch size 32. The first 100 epochs use ground-truth routes for sampling trajectories and computing the regression loss, because the policy does not yet give meaningful routes. The next 100 epochs fine-tune on routes sampled from the policy. On four V100 GPUs (AWS p3.8xlarge), a pre-training epoch takes about 1 minute and a fine-tuning epoch about 5 minutes on nuScenes.
Figures. Fig. 1 contrasts scene-wide context with context selected along lane-graph paths fig. 1. Fig. 2 shows the three modules: the graph encoder, the policy header and the trajectory decoder fig. 2. Fig. 3 compares decoders on examples; the MTP baseline often predicts trajectories that veer off the road, and the goal-conditioned decoder predicts goals that are not reachable fig. 3.
Hyperparameters
| Name | Value | Where | Notes |
|---|---|---|---|
| history length | 2 s | §5 | step count and sampling rate of the input not stated |
| prediction horizon | 6 s, 24 outputs (x, y at 2 Hz) | §5 app. A.6 | |
| lane node length | at most 20 m | app. A.1 | longer centrelines are split |
| pose resolution | 1 m | app. A.1 | |
| map area | ±50 m lateral, −20 to 80 m longitudinal | app. A.1 | |
| embedding size | 16, leaky ReLU | app. A.2 | |
| GRU depth, hidden size | 1, 32 | app. A.2 | three GRUs (target, agents, nodes) |
| agent-node attention | 1 head, 32×32 projections, output 32 | app. A.3 | distance threshold for agents: not stated §4.1 |
| GNN layers | GCN or GAT, 1 or 2 layers, size 32 | app. A.4 tab. 2 tab. 3 | GAT single head; which setting tab. 1 uses: see Pitfalls |
| proximal-edge thresholds | distance and yaw: not stated | §3.2 | |
| policy MLP | 2 hidden layers of 32, input 98 | app. A.5 | input = 32 + 32 + 32 + 2 one-hot edge type |
| decoder attention | 32 heads, context size 128 | app. A.6 | |
| latent z | standard normal, dimension 5 | app. A.6 | |
| output MLP | hidden 128, output 24 | app. A.6 | |
| samples per instance | 200 | app. A.6 | clustered to K |
| K (modes) | 10 | app. A.6 tab. 1 | K = 5 also reported for MinADE and MissRate |
| optimiser | Adam | app. A.7 | betas, weight decay, schedule: not stated |
| learning rate | 1e-4 | app. A.7 | |
| batch size | 32 | app. A.7 | |
| epochs | 100 pre-training + 100 fine-tuning | app. A.7 | |
| loss weights | 1 and 1 | eq. 6 | |
| K-means settings | not stated | §4.3 | initialisation, distance and iterations |
| rollouts per instance | not stated | §4.2 | |
| dropout, gradient clipping | not stated |
Results
Author-reported. Setup: nuScenes prediction task, 2 s history, 6 s prediction, the standard split from the nuScenes devkit §5. Baselines are leaderboard entries; the paper does not say how their numbers were obtained §5. Hardware: four V100 GPUs app. A.7.
Main comparison tab. 1. Lower is better for MinADE and MissRate; the offroad rate is the fraction of predictions off the road.
| Model | MinADE5 | MinADE10 | MissRate5,2 | MissRate10,2 | Offroad rate |
|---|---|---|---|---|---|
| CoverNet | 1.96 | 1.48 | 0.67 | - | - |
| Trajectron++ | 1.88 | 1.51 | 0.70 | 0.57 | 0.25 |
| SG-Net | 1.86 | 1.40 | 0.67 | 0.52 | 0.04 |
| MHA-JAM | 1.81 | 1.24 | 0.59 | 0.46 | 0.07 |
| CXX | 1.63 | 1.29 | 0.69 | 0.60 | 0.08 |
| P2T | 1.45 | 1.16 | 0.64 | 0.46 | 0.03 |
| PGP (this paper) | 1.30 | 1.00 | 0.61 | 0.37 | 0.03 |
Encoder ablations tab. 2, all with agent-node attention unless noted above:
| Successor edges | Proximal edges | Agent-node attention | GNN layers | MinADE5 | MinADE10 | MissRate5,2 | MissRate10,2 | Offroad |
|---|---|---|---|---|---|---|---|---|
| yes | - | - | - | 1.35 | 1.03 | 0.64 | 0.41 | 0.04 |
| yes | yes | - | - | 1.33 | 1.01 | 0.63 | 0.38 | 0.03 |
| yes | yes | yes | - | 1.30 | 1.00 | 0.61 | 0.37 | 0.03 |
| yes | yes | yes | GCN ×1 | 1.31 | 1.01 | 0.62 | 0.39 | 0.04 |
| yes | yes | yes | GCN ×2 | 1.31 | 1.01 | 0.61 | 0.39 | 0.04 |
| yes | yes | yes | GAT ×1 | 1.30 | 1.00 | 0.62 | 0.38 | 0.03 |
| yes | yes | yes | GAT ×2 | 1.31 | 1.01 | 0.61 | 0.37 | 0.03 |
Decoder ablations tab. 3, all on the proposed encoder with both edge types, agent-node attention and 2 GAT layers:
| Decoder | MinADE5 | MinADE10 | MissRate5,2 | MissRate10,2 | Offroad |
|---|---|---|---|---|---|
| MTP (multimodal regression head) | 1.59 | 1.12 | 0.57 | 0.48 | 0.08 |
| latent variable only | 1.38 | 1.08 | 0.65 | 0.43 | 0.05 |
| traversal only | 1.37 | 1.10 | 0.65 | 0.44 | 0.04 |
| goals + latent variable | 1.33 | 1.02 | 0.60 | 0.42 | 0.06 |
| traversals + latent variable (full) | 1.31 | 1.01 | 0.61 | 0.37 | 0.03 |
Diversity at K = 10 tab. 4, tab. 5 (lateral: distinct final lanes and yaw variance; longitudinal: speed and acceleration variance). Table numbers follow the caption order in the LaTeX source.
| Decoder | Distinct final lanes | σ²yaw | σ²speed | σ²acc |
|---|---|---|---|---|
| latent variable only | 1.22 | 0.11 | not reported | not reported |
| traversal only | not reported | not reported | 2.33 | 5.28 |
| traversals + latent variable | 1.41 | 0.13 | 4.07 | 6.65 |
The paper's text says the latent-only decoder gives the most diverse speed and acceleration profiles, but that is not in the compiled tables (see Pitfalls).
Paper vs code
No official code.
Searches: the arXiv abstract page lists no code link. A GitHub search for
"PGP" with trajectory-prediction terms, and for "PGP" inside the
motional organisation, returned no official repository. One repository,
nachiket92/PGP (MIT), is owned by an author, but its README describes it as an
independent re-implementation, not the original code. It was not used for
this card. Another repository, sancarlim/PGP, belongs to a different paper.
Pitfalls
- Headline configuration is ambiguous. The PGP row of tab. 1 (1.30 / 1.00 / 0.61 / 0.37 / 0.03) matches the encoder row without GNN layers in tab. 2. The full decoder in tab. 3, which the text says uses 2 GAT layers [§5 ablation text, app. A.4], gives 1.31 / 1.01 / 0.61 / 0.37 / 0.03. The paper does not say which encoder produced tab. 1. Implement the 2-GAT setting from tab. 3 and the text unless the code says otherwise.
- Policy end state. The text says every node has an edge to an end state §4.2, but eq. 2 normalises only over edges in E. The published text does not give a score for the end edge. The source file has a commented-out equation for it. Choose a rule and state it when you implement.
- Sample count and K-means. The paper clusters samples into K = 10 to output predictions §4.3, and the appendix says this happens during training [app. A.6]. It is unclear whether test-time prediction also clusters 200 samples. The number of rollouts, the K-means initialisation, distance metric and iteration count are not stated. Cluster centres carry no probability, unlike MTP.
- Pre-training and the policy loss. The first 100 epochs use ground-truth routes app. A.7. It is not stated whether the behaviour-cloning term (eq. 3) is active during that phase.
- Visited-edge rule. Matching ground-truth poses to nodes uses a yaw threshold and a distance rule, and the value of neither is stated §4.2. The agent distance threshold for agent-node attention is also not stated §4.1.
- MTP is not the original MTP. The MTP baseline first runs the same multi-head attention over the whole graph, then two fully connected layers [app. A.8]. Its numbers are not directly comparable with the original MTP paper.
- Headline claim is qualified. The text says the method achieves state of the art on almost all metrics §5. In tab. 1, MissRate5,2 is best for MHA-JAM (0.59), not for PGP (0.61). The offroad rate is tied with P2T (0.03).
- Latent-only longitudinal diversity is missing. The text says the latent-only decoder generates diverse motion profiles §5, but tab. 5 has no latent-only row. The source file has a commented-out table with those values. Treat the claim as qualitative only.
- Single dataset. Only nuScenes is evaluated §5. Generalisation to other datasets or sensors is not tested.
- Cost. Each instance draws 200 samples, and the decoder runs once per route. Training took about 5 minutes per epoch after pre-training on four V100 GPUs app. A.7. Inference cost and latency are not reported.
- Diversity metrics. "Distinct final lanes" is not defined beyond its name §5, so the lane identity used to count them is not stated.
Lineage
- Builds on: VectorNet and LaneGCN, which encode HD-map polylines as graph nodes §1, §2; the bibliography gives no arXiv ids for them. Scaled dot-product attention §4.1, GCN §4.1 and GAT §4.1 are cited from their own papers. The MTP header is the decoder baseline tab. 3.
- Closest prior work: P2T, arXiv:2001.00735 (bibliography entry), which conditions predictions on paths sampled from an inverse-RL policy over a rasterised grid. This paper replaces the raster with the lane graph. It also generates different motion profiles along one path, which the paper says P2T cannot §2.
- Goal-conditioned alternatives discussed: TNT, LaneRCNN, PECNet, WIMP, GoalNet and CXX §2.
- Compared against: CoverNet, Trajectron++, SG-Net, MHA-JAM, CXX and P2T tab. 1.
- Superseded by: nothing in this wiki yet.
Source and license
Adapted from “Multimodal Trajectory Prediction Conditioned on Lane-Graph Traversals” by Nachiket Deo, Eric M. Wolff, Oscar Beijbom (arXiv:2106.15004), 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.