UniAD icon indicating copy to clipboard operation
UniAD copied to clipboard

What is the motion anchor? What's the relationship between thsese anchors and the Planning result?

Open Rango-T10000 opened this issue 11 months ago • 4 comments

Hello, I am a freshman in this antomuous driving model field. I am tryting to understand your code by debugging. However, I have the following questions about anchor and route in your code:

  1. What does the anchor infos mean? 88ebed8ae21b8d062c9098ad67ce658d I open this .pkl file and I found the following informations: 90ee740268fa40e502c87f5b6714b1b4 Accroding to your paper, do you mean to use a k-means algorithm to cluster all the trajectories in the Nuscene dataset. My question is that you get this by convert all trajectories to offsets to the current global position and then cluster these offsets into 6 categories? So the anchor is consist of a series offsets (delta x, delta y)? But why there are four groups anchors in “anchors_all” in this motion_anchor_infos_mode6.pkl?

  2. In fact, I don't understand why do you need this anchor infos? image In your code, the Planner head outputs the final sdc's route prediction. What's the relationship between thsese anchors and the Planning result?

  3. According to your paper and demo, your model not only predicts the sdc's future planning (the ego car), but also predicts all other agent's future planning. I can find that there are groundtruth for both sdc's future traj and all agents' future traj. But the Planner head only output's the sdc's future planning, which part provide the prediction for other agents?

Rango-T10000 avatar Jan 11 '25 06:01 Rango-T10000

After finding a paper: https://arxiv.org/abs/1910.05449, I think I have a basic understanding for the concept of "anchor".

Because motion forecasting is inherently stochastic, which might have many outcomes. Hence, the trajctory forecasting in the future is a multi-modal problems. In the academic view of this paper, the proposed model regards the trajectory forecasting has multiple outcomes and their likelihoods, which is so called Gaussian mixture model.

To tackel these kind of multi-modal problems, they adopt a the concept of predefined anchors, which have a rich history in machine learning. The steps are:

They using k-means cluster algorithm to obtain several typical trajctories, which is so called "anchor"! At inference, the proposed model predicts a discrete distribution over theese predefined anchors and, for each anchor, regresses offsets from anchor waypoints along with uncertainties, yielding a Gaussian mixture at each time step.

image

As for how to get these anchors?

image

In the dataset, the trajectory is given by some waypoints (x,y) in the global coordinates. At first, these trajectories are converted to agent-centric coordinate frame. Then, using k-means algorithm to cluster these trajectories. In this way, the extracted anchors include typical motion modes which are rotation-invariant and translation-invariant.

image

Rango-T10000 avatar Jan 11 '25 08:01 Rango-T10000

why there are four groups anchors in “anchors_all” in this motion_anchor_infos_mode6.pkl? @hli2020 @Yihanhu

Rango-T10000 avatar Jan 11 '25 08:01 Rango-T10000

this repo uses inconsistent yaw definitions, resulting in bad anchors during training/eval, see https://github.com/OpenDriveLab/UniAD/issues/222

chriskeraly avatar Feb 17 '25 00:02 chriskeraly

Hi~Rango, I visulize the "anchors_all". The four groups means different distribution of motion anchor, and every groups have six mode trajectory. Maybe the set want to be cover all situation of the trajectory.

Image

zzh-yun avatar Oct 03 '25 11:10 zzh-yun