TL;DR
VectorNet predicts how other vehicles and pedestrians will move around a self-driving car. Most earlier systems drew the road map and the past paths as coloured pictures and fed them to a convolutional network. VectorNet skips the drawing. It describes every lane, crosswalk and trajectory as a chain of short vectors, groups the vectors of each chain with a graph network, and then lets all the chains exchange information through attention. It matches the rendered-image approach on the benchmarks with about 70% fewer parameters, and it reported state-of-the-art results on the Argoverse test set when it appeared.
Builds on: Graph Neural Network, Attention Mechanism, Max Pooling, Trajectory Prediction, Self-Supervised Learning · Leads to: vectorised scene encoders for driving prediction, which take the road map as polylines rather than images
Why it mattered
A self-driving car has to guess what the cars around it will do next: stay in lane, turn, or change lanes. The paper's public benchmark is Argoverse forecasting, where each 5-second scene has one "interesting" target vehicle and a map, and the model sees 2 seconds of history and predicts 3 seconds ahead. The authors' own dataset is much bigger: 2.2 million training trajectories, each 4 seconds long.
Before this work, most recent approaches rendered the map and the nearby agents into a top-down image of 400 by 400 pixels per frame, then ran a convolutional network over it. That is simple and it works, but it throws away structure. A lane is a curve with attributes such as its speed limit, and a traffic light has a colour state. Rendering turns these into pixel colours, and the network then has to rediscover what the pixels stand for. VectorNet showed that the structured form can be used directly, and that it avoids the lossy rendering and the costly convolutional encoding.
The problem
Three things made the problem hard. The first is the mix of input types: lanes and crosswalks are shapes, traffic lights are points, and vehicle trajectories are paths over time, each with its own attributes. The second is the need for context: a car's future depends on the lane it is in and on the cars near it, and convolutional networks see only a local window of pixels, so they need carefully chosen crops to see far enough. The third is cost. Rasterised inputs are large, and the cost of a convolutional network grows with image size and kernel size.
The paper's answer is to represent every map element and trajectory as a polyline, then let the network reason over the set of polylines. This needs a graph network that does not depend on the order in which the polylines are listed, since the map has no natural starting point.
How it works
The pipeline follows the order of the data: vectorise the scene, encode each polyline, let the polylines interact, then decode the target's future path.
-
Turn the scene into polylines. A lane boundary is sampled at equal spacing along its curve. A vehicle's path is sampled every 0.1 seconds. Each polyline is then a list of points, and consecutive points give vectors. Tiny instance: a lane with three points A, B, C becomes two vectors, A to B and B to C, both tagged with the lane's id 7 and a speed-limit attribute.
-
Make each vector a node. Each vector becomes a node whose features are its start point, its end point, its attributes and the id of its polyline. Check: two vectors from the same lane share the id, so the network knows they belong together.
-
Centre the coordinates. All points are shifted so that the target vehicle's last observed position is at the origin. Then the model does not depend on where in the city the car is.
-
Encode each polyline locally. The vectors inside one polyline are connected to each other in a small graph. At each layer, each vector is passed through a small network with a single linear layer, layer normalisation and ReLU, and then the result is concatenated with the maximum over its neighbours. The paper uses three such layers. The maximum is taken channel by channel, so the order of the vectors does not matter. Check: a polyline with 2 vectors gives the same result if the two are listed in the other order.
-
Summarise each polyline. One more maximum over all vectors of the polyline gives a single polyline feature. A lane is now one vector of numbers, and so is each trajectory.
-
Let polylines interact. All polyline features are connected to each other in a fully connected graph and updated with one layer of self-attention. Each polyline can look at every other one, weighted by relevance: a lane the target is about to enter should get more weight than a distant parking lot. Check: attention produces a weighted average, so the output for each polyline is a mixture of all the polylines, itself included.
-
Decode the future. The node that belongs to the target vehicle is passed through a small network that outputs its future path as offsets from the last observed position, rotated to match the car's heading.
-
Train with an extra task. Some polyline nodes are masked out at random, and the network tries to recover them from their context, in the same spirit as BERT. This is an auxiliary loss, used only in training.
flowchart LR M["Map polylines and agent paths"] --> V["Vector nodes with coordinates and attributes"] V --> P["Polyline subgraph: MLP, max pooling"] P --> G["Global self-attention over polylines"] G --> T["Target agent: trajectory decoder"] G --> C["Masked polyline recovery (training only)"]
The math
Step 1 in symbols: a vector node
Each vector belonging to polyline is a node with features
where and are the start and end coordinates, holds attributes such as the object type or the lane's speed limit, and is the polyline's id.
Step 4 in symbols: the polyline subgraph
Let be a shared MLP, and let be the maximum over neighbours. One layer updates each node as
where concatenates the two inputs. The paper's is the maximum over the set, taken channel by channel, so the result does not depend on the order of the neighbours. Each layer has its own weights.
Step 5 in symbols: the polyline feature
After layers, the polyline feature is the same maximum over its nodes:
Step 6 in symbols: global self-attention
Stack the polyline features as the rows of a matrix . With learned projections , and , one attention layer is
as the paper writes it. The common form also divides the scores by the square root of the key size; the paper's formula omits that factor. The graph is fully connected, which means every polyline attends to every other.
Step 8 in symbols: the training objective
The model minimises
is the negative log-likelihood of the true future positions under a Gaussian. is the Huber loss between the predicted and true features of the masked nodes. The Huber loss is quadratic for small errors and linear for large ones:
Worked examples
One polyline has three vectors. Each vector has two feature channels, and the values are:
- Vector 1: channel 1 = 0.2, channel 2 = 1.0
- Vector 2: channel 1 = 0.9, channel 2 = −2.0
- Vector 3: channel 1 = 0.5, channel 2 = 0.0
- Take the maximum of channel 1 over the three vectors: .
- Take the maximum of channel 2: .
- The polyline feature is .
- Reorder the vectors as 3, 1, 2. The maxima are still and .
Interpretation: the feature is the same whatever order the vectors are listed in. That is the property the map needs, since a lane has no first vector.
A toy trajectory is sampled at 1, 2 and 3 seconds. The predicted positions are 0.5 m, 1.0 m and 1.5 m away from the true ones at those times.
- The displacement error at 3 seconds is DE@3s = 1.5 m.
- The average displacement error is the mean over the sampled times: m.
Interpretation: DE@3s reports the error at the end of the horizon, where the prediction is hardest. ADE reports the typical error along the path. The paper uses both.
On the Argoverse test set, with one predicted trajectory per agent, the best earlier entry has DE@3s of 4.17 m. VectorNet has 4.01 m.
- The gain is m.
- Relative to the earlier entry, that is .
- A car travelling at 15 m/s covers m in 3 seconds. An error of 4.01 m is about of that distance.
Interpretation: the gain is small in relative terms, but the paper is clear that this is the state of the art for that metric. Read it as about 16 centimetres of improvement in a hard problem, not as a large jump.
Try it: in the in-house ablation, DE@3s is 1.29 m with no context and 1.00 m with map and agents plus completion. What is the percentage reduction? Answer: .
Results
Argoverse test set (one predicted trajectory). VectorNet reaches DE@3s of 4.01 m and ADE of 1.81 m. The two challenge winners listed are at 4.19 and 4.17 m DE@3s, and a constant-velocity baseline is at 7.89 m. The paper calls this the state of the art on that metric.
Rendered baseline versus vectors. The best ResNet-18 baseline, which uses trajectory-shaped crops and 400 by 400 images, reaches DE@3s of 1.00 m on the in-house data and 4.49 m on Argoverse. VectorNet with the auxiliary task reaches 1.00 m and 3.67 m. The paper says the two are on par on the in-house data, and that VectorNet is clearly better on Argoverse.
Size and cost. The ResNet baseline has 246K parameters and 10.56 GFLOPs per target. VectorNet has 72K parameters, about 29% of the baseline's count, and 0.041 GFLOPs per target. The abstract's claims of more than 70% fewer parameters and an order of magnitude less compute are consistent with these figures, and the FLOP gap here is larger than an order of magnitude.
Ablations. On the in-house data, adding map polylines cuts DE@3s from 1.29 m to 1.11 m. Adding the trajectories of other agents brings it to 1.05 m. Adding the masked-node task on top of both brings it to 1.00 m. The same ordering holds on Argoverse, where the final DE@3s is 3.67 m.
Limits. The FLOP comparison is per target, and the paper notes that VectorNet's cost grows with the number of targets because each one needs its own normalised features. Whether that beats a shared rendered backbone depends on how the baseline is arranged, so do not read the 200-fold ratio as a general speed-up. The global graph is fully connected, and the paper assumes a fully connected graph as a simplification, so the distance-based graphs it mentions are not tried. The decoder predicts one trajectory, and the authors name multi-modal decoding as the natural next step.
Reading guide
- §1 Introduction. Read with Trajectory Prediction in mind. Figure 1 shows the rendered and vectorised views side by side, which is the whole argument in one picture.
- §2 Related work. The driving methods use Convolutional Neural Network encoders. The multi-agent section is about social models. The point-set paragraph introduces PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation and its Max Pooling idea.
- §3.1 Representing trajectories and maps. Read it with the vector definition in the math section. The sampling rules are the practical part.
- §3.2 Polyline subgraphs. This is where Feedforward Neural Network, Layer Normalization, Rectified Linear Unit (ReLU) and Max Pooling come together. The paper calls it a generalisation of PointNet.
- §3.3 Global graph. Read it with Attention Mechanism open. The completion objective is the BERT idea of Masked Language Modeling applied to unordered nodes, so BERT: Pre-training of Deep Bidirectional Transformers is the comparison.
- §3.4 Overall framework. The loss, the Gaussian trajectory likelihood and the heading rotation.
- §4.1 Setup. Datasets, the ADE and DE metrics, and the rasterised baseline with Deep Residual Learning for Image Recognition (ResNet) and Receptive Field. The training uses Adam Optimizer.
- §4.2–4.3 Ablations. Table 1 explains why the baseline needs crops. Table 2 and Table 3 are the vector ablations.
- §4.4 FLOPs and size. Read the counting carefully, since the per-target caveat matters.
- §4.5 State of the art. Table 5 and the leaderboard comparison.
Check yourself
QuestionIn VectorNet, what is a polyline, and what is a node?Show answer
A polyline is an ordered chain of points, such as a lane boundary, a crosswalk outline or a vehicle's past path. Each vector between two consecutive points is a node. Its features are the start and end coordinates, its attributes and the id of the polyline it belongs to.
QuestionOne polyline has two channels, and its vectors have channel values (0.3, −1.0, 0.8) for channel 1 and (2.0, 2.5, 0.1) for channel 2. What is the polyline feature after the max pooling?Show answer
Channel 1 gives . Channel 2 gives . The polyline feature is .
QuestionWhy does VectorNet use max pooling and a fully connected attention graph, rather than reading each polyline as an ordered sequence?Show answer
The vectors of a polyline and the polylines of a scene form sets with no natural first element. Max pooling gives the same result whatever order the vectors are listed in, as PointNet does for point clouds. The attention layer treats the polylines as an unordered set too. The order information that matters is kept inside the vector coordinates, so the network does not need a fixed sequence order.
QuestionA team counts VectorNet at 0.041 GFLOPs and a rendered ResNet at 10.56 GFLOPs, so they conclude VectorNet is 200 times cheaper. What should they check before trusting that?Show answer
They should check how many targets each system must process in a scene. The 0.041 GFLOPs figure is per target, and the paper says VectorNet's cost grows linearly with the number of targets because each one needs its own normalised features. They should also check how their rendered baseline is laid out, because a rendering centred on the ego vehicle can share one backbone pass across targets. The per-target ratio alone does not settle which system is cheaper for their scenes.
Sources
- Gao et al., VectorNet: Encoding HD Maps and Agent Dynamics from Vectorized Representation, arXiv:2005.04259, 2020. arxiv.org/abs/2005.04259
- DOI 10.48550/arXiv.2005.04259: doi.org/10.48550/arXiv.2005.04259