TL;DR
A self-driving system is usually built as a chain of separate models: one finds objects, one tracks them, one predicts where they will go, and one plans the car's path. UniAD puts these tasks into one network built from Transformer decoders. Each task hands the next one a set of learned query vectors rather than hard bounding boxes, and the planner is tuned to avoid the occupied space that the occupancy module predicts. On the nuScenes driving benchmark, using camera images only, the paper reports gains over earlier vision-based end-to-end methods on tracking, motion forecasting, near-range occupancy and planning.
Builds on: Transformer, Object Detection, Multi-Object Tracking, bird's-eye view representations, Deformable Attention · Leads to: no lesson in the graph builds on it yet.
Why it mattered
Driving stacks need to answer several questions at once: what is around the car, what will each thing do next, and what is safe to do now. In most production systems each question has its own model, trained for its own target. The paper's authors argue that this separation causes information loss between modules, error accumulation and feature misalignment.
The other extreme optimises planning directly, end to end. The paper counts that as one earlier attempt, and a partial design that keeps only some components as another. UniAD takes a middle path. It keeps every stage that a planner needs to see, and it makes the stages talk through shared queries, so that the whole system is trained with the planning goal in mind.
The paper was published at CVPR in 2023 and has been widely cited.
The problem
The authors look at two earlier designs. Multi-task learning shares one backbone across tasks, which is efficient, but the tasks can pull the shared features in conflicting directions, which the paper calls negative transfer. Standalone modules avoid that conflict but lose information at each hand-off, because a box or a single predicted trajectory discards most of what the module knew.
Their question is which intermediate tasks a planner needs in order to be safe, and how to connect them so that the information survives. Their answer is that motion forecasting and occupancy prediction both matter for safety, and that queries, which are learned vectors that stand for an agent or a map element, carry more information than a box and can model interactions between many agents.
How it works
The steps below follow the order in which the model runs, from camera images to a planned path. The example scene has one ego car and one other car ahead, so there is one agent query.
- Encode the scene. Images from several cameras go through a feature extractor. An off-the-shelf bird's-eye-view encoder, BEVFormer in the paper, turns the image features into one top-down feature map of size . Check: is the stated shape, so every cell has a 256-number feature.
- Track the agents. TrackFormer uses detection queries for newly seen objects and track queries for objects seen earlier. Each query attends to , and the track queries also attend to one another, so they keep a memory of each agent across frames. The other car gets one track query, and the ego car gets a special ego query. Check: a query for the other car persists while it stays in view.
- Map the road. MapFormer uses map queries for lanes, dividers, crossings and the drivable area. It is based on a panoptic segmentation method, so it outputs a map and its elements. Check: the map is used only as queries and not as a fixed picture for the rest of the system.
- Forecast motion. MotionFormer takes each agent query and attends to the other agents, to the map queries and to a goal point on the predicted trajectory. It outputs several possible trajectories per agent, six modalities in the paper, each 12 steps long. Check: the other car gets six candidate paths, not one.
- Predict occupancy. OccFormer uses the bird's-eye-view features as queries and the agent features as keys and values. It predicts which cells will be occupied in the next five steps and keeps each agent's identity, so the planner knows which occupied cell belongs to which car.
- Plan. The planner takes the ego query from MotionFormer and adds a command embedding for the navigation signal (turn left, turn right or keep forward). This plan query attends to , and it outputs six future waypoints. Check: the plan is a set of six points for the ego car.
- Refine the plan. At inference only, the waypoints are adjusted by minimizing a cost that keeps them close to the first plan and away from occupied cells. The paper uses Newton's method for this step. Check: when no cell is occupied on the path, the cost is just the distance to the first plan, so the refinement leaves the plan unchanged.
flowchart LR C["Multi-camera images"] --> B["Bird's-eye-view features B"] B --> T["TrackFormer: detection and track queries"] B --> M["MapFormer: map queries"] T --> F["MotionFormer: agent trajectories"] M --> F T --> O["OccFormer: future occupancy"] B --> O F --> P["Planner: plan query to waypoints"] O --> R["Refinement against occupancy"] P --> R R --> W["Planned path"]
Worked examples
Use a simplified version of the planner cost, for illustration only: the cost of a candidate point is . Take and . The first plan is , and one cell at is occupied.
- Candidate : the distance to the first plan is 0. The occupied cell at is within distance 1, so the count is 1. Cost: .
- Candidate : the distance to the first plan is 1.5. The occupied cell is at distance , which is more than 1, so the count is 0. Cost: .
- The lower cost is , from the candidate . So the refinement moves the waypoint sideways, away from the occupied cell.
- Interpretation: the planner accepts a small detour to avoid the occupied cell, because the collision term costs more than the extra distance.
Table 2 of the paper compares the full model (row 12) with a multi-task baseline (row 0) on average planning L2 error in metres and average collision rate in percent over the planning horizon.
- Average L2 error, baseline: . Full model: .
- Reduction: , so about 13.0 percent lower.
- Average collision rate, baseline: . Full model: .
- Reduction: , so about 54.3 percent lower.
- Interpretation: the gain in collision rate is much larger than the gain in trajectory error. The modules that predict motion and occupancy mostly help the plan stay out of the way of other agents.
Table 7 reports the planning L2 error at three seconds, in metres, for the full model and for ST-P3, a prior vision-based planner: 1.65 for UniAD and 2.90 for ST-P3.
- Difference: metres.
- Ratio: , so ST-P3's three-second error is about 1.76 times UniAD's.
- Interpretation: the gap grows with the horizon. The paper reports a 51.2 percent reduction in average L2 error against ST-P3, which is the average over all horizons.
- Try it: what is UniAD's three-second error as a percentage lower than ST-P3's?
Answer: , so about 43.1 percent lower.
The math
Step 2 in symbols: tracking with queries
Let be the agent features and their positions, one per valid agent in the scene, with agents. Track queries carry an agent's state from one frame to the next. Newly seen objects enter through detection queries, and the paper matches predictions to ground truth with bipartite matching, as DETR does, so each object has one query. The paper reports 900 initial object queries, each of width .
Step 4 in symbols: motion forecasting
Each motion query is updated by three attention terms: attention to other agents, , attention to map elements, , and deformable attention to the goal point of the previous layer's trajectory, . Here MHSA and MHCA are multi-head self-attention and cross-attention, and deformable attention looks only at a few points around a reference point. The three results are concatenated and passed through an MLP to give the context .
The output for agent and modality is a trajectory of points,
with modalities in the paper. The query position combines the scene anchors, the agent anchors, the agent's current location and the predicted goal point, each through a sinusoidal position encoding and a small MLP.
Step 6 in symbols: the planner's cost
The planner first predicts six waypoints . Refinement searches over candidate trajectories for the one that minimizes
where is the occupancy map at future step . The collision term is a sum of Gaussian weights over the occupied cells that lie within a distance of the waypoint,
The first term keeps the plan close to the prediction, and the second pushes it away from occupied cells. The paper gives the form of the cost; , and are hyperparameters. The worked example above uses a hard count of occupied cells instead of the Gaussian weights, to keep the arithmetic by hand.
Training in two stages
The perception modules, tracking and mapping, are first trained together for six epochs. The whole system is then trained end to end for twenty epochs, with all perception, prediction and planning losses. The authors report that this two-stage schedule was more stable than training everything at once.
Results
Joint ablation. The table below is a subset of the paper's Table 2 on the nuScenes validation set. Row 0 is a multi-task baseline with separate heads. Row 12 is the full system. Lower is better for minADE, minFDE, MR, the collision rate and the L2 error. Higher is better for IoU and VPQ.
| Row | Modules | minADE (m) | minFDE (m) | MR | IoU far | Average L2 (m) | Average collision (%) |
|---|---|---|---|---|---|---|---|
| 0 | Multi-task baseline | 0.858 | 1.270 | 0.186 | 34.6 | 1.154 | 0.941 |
| 10 | Planning only | not reported | not reported | not reported | not reported | 1.131 | 0.773 |
| 11 | Track, map, motion, plan | not reported | not reported | not reported | not reported | 1.014 | 0.717 |
| 12 | All five tasks | 0.728 | 1.054 | 0.154 | 39.5 | 1.004 | 0.430 |
The paper's conclusion is that the motion and occupancy modules are both needed for a safe plan. Row 10 plans directly from the features with no intermediate tasks, and row 12 adds all of them. The authors report that, against the multi-task baseline, row 12 lowers minADE by 15.2 percent and minFDE by 17.0 percent, and lowers the collision rate by 0.51 points.
Perception. On the nuScenes tracking benchmark (Table 3), UniAD reaches an AMOTA of 0.359, against 0.294 for MUTR3D and 0.217 for ViP3D. The paper notes that it is still behind Immortal Tracker, a tracking-by-detection method with 0.378, which uses a separate association step. On online mapping, its lane segmentation score is 31.3, against 23.9 for BEVFormer, but its scores on some other map classes trail perception-only methods.
Motion forecasting and occupancy. On motion forecasting (Table 5), UniAD reports minADE 0.71 m and minFDE 1.02 m, against 1.15 m and 1.95 m for PnPNet with vision input. In occupancy (Table 6), the near-range IoU is 63.4, against 59.4 for FIERY and 61.4 for BEVerse. BEVerse is better in the far range.
Planning. On the planning table (Table 7), UniAD's average L2 error is 1.03 m, against 2.11 m for ST-P3. Its average collision rate is 0.31 percent, against 0.71 percent for ST-P3. The table caption states that UniAD also outperforms several LiDAR-based methods in most cases.
Limits. The experiments use one benchmark, nuScenes, and the paper reports results on its validation split. The system is large and needs substantial compute, especially when trained with temporal history, and the authors list lighter deployment as future work. Some comparisons use LiDAR methods, which have a different sensor setup. The paper also points out that the tracking and mapping modules are tuned to help planning, so they are not always the best on their own tasks.
Reading guide
Read the paper in this order, with these prerequisites:
- Section 1, Introduction, and Table 1: the design options and the task taxonomy. Needs Object Detection for the idea of boxes and Trajectory Prediction for forecasting.
- Section 2 overview: the five modules and the queries that connect them. Needs Transformer and bird's-eye view representations.
- Section 2.1, Perception: tracking and mapping: the track and detection queries and the panoptic map queries. Needs Multi-Object Tracking, DETR and Image Segmentation.
- Section 2.2, Motion forecasting: attention types and the goal-point refinement. Needs Deformable Attention and Positional Encoding.
- Section 2.3, Occupancy prediction: the pixel-to-agent attention. Needs the transformer background above.
- Section 2.4, Planning: the command embeddings and the Newton refinement. Needs Newton-Raphson Method and Behavior Cloning for the planner's baselines.
- Section 2.5, Learning: the two-stage schedule and bipartite matching. Needs Bipartite Matching.
- Section 3, Experiments: Tables 2 to 7, which are the core results.
- Appendices A to F: task definitions, implementation details, and the full notation table, which is useful for checking shapes.
Check yourself
QuestionWhich module produces the ego car's future waypoints, and what does it take as input?Show answer
QuestionIn Table 2, the average L2 error falls from 1.154 m to 1.004 m between the baseline and the full model. What is the percentage reduction?Show answer
QuestionWhy do the modules pass learned queries to one another rather than bounding boxes?Show answer
QuestionA team builds a planner that uses only the outputs of a separate detector and planning, with no motion forecasting or occupancy. The collision rate is high. What does the paper suggest, and what does Table 2 show?Show answer
Sources
- Hu, Y. et al. (2023). Planning-oriented Autonomous Driving. arXiv: https://arxiv.org/abs/2212.10156
- Caesar, H. et al. (2019). nuScenes: A multimodal dataset for autonomous driving. arXiv: https://arxiv.org/abs/1903.11027