Guided Diffusion for Autonomous Trajectory Prediction. Code support
Budget: €250 – €750 EUR
This project aims to evaluate a prediction model for the movement of autonomous agents, where the prediction is guided by a driving command. The evaluation is carried out on a dataset located in the validation directory. Each scene contains up to 32 agents.
1. Data and Preparation
The prediction is based on an observed history of 10 time steps and must compute a future of 20 time steps.
The objective:
The trajectory is controlled by a discrete command such as "right", "left", or "straight".
This command is translated into a one-hot format and then transformed by a sequential structure into an embedded representation of dimension 128.
This embedded information is used as a time-dependent conditioning for all prediction time steps.
2. Inference Process (Denoising)
The trajectory is generated iteratively through a denoising process, which is based on an optimized schedule for the noise levels.
The full inference process runs for 50 steps.
The noise schedule starts at a maximum noise level of 20.0 and ends at a minimum level of 0.002.
The iterative solution algorithm uses a prediction and correction step (similar to the Heun integrator), computing intermediate estimates (
x
tilde
x
tilde
) to refine the denoising direction.
Control (Classifier-Free Guidance)
In each step of this iterative process, the prediction is guided using Classifier-Free Guidance (CFG). For this, the denoising model must output two separate results:
Uncontrolled prediction: The input includes the agent state, but the conditioning features of the future are set to zero.
Controlled prediction: The input includes both the agent state and the actual embedded command conditioning.
The final output used to update the trajectory is a weighted combination of these two results. The strength of the guidance is determined by the scaling factor of 2.0 (COND_SCALE).
3. Metrics and Evaluation
After the iterative denoising is completed and the final denoised trajectory (final_predicted_x0) is obtained, the performance is evaluated using:
Reconstruction Loss: The mean squared error (L2) between the predicted positions and the actual future positions (ground truth) is computed, with invalid data points masked.
Direction Accuracy: A specialized direction recognition structure analyzes the final predicted position data.
This structure uses a recurrent layer to process the temporal sequence of motion data.
Its output is logits for the three possible directions.
Direction accuracy is defined as the proportion of cases in which the direction derived from the model matches the command originally used as conditioning.
For qualitative analysis, a plot is also generated showing the prediction, the ground truth trajectory, the initial noise distribution, and the scene’s road graphs.
1. Data and Preparation
The prediction is based on an observed history of 10 time steps and must compute a future of 20 time steps.
The objective:
The trajectory is controlled by a discrete command such as "right", "left", or "straight".
This command is translated into a one-hot format and then transformed by a sequential structure into an embedded representation of dimension 128.
This embedded information is used as a time-dependent conditioning for all prediction time steps.
2. Inference Process (Denoising)
The trajectory is generated iteratively through a denoising process, which is based on an optimized schedule for the noise levels.
The full inference process runs for 50 steps.
The noise schedule starts at a maximum noise level of 20.0 and ends at a minimum level of 0.002.
The iterative solution algorithm uses a prediction and correction step (similar to the Heun integrator), computing intermediate estimates (
x
tilde
x
tilde
) to refine the denoising direction.
Control (Classifier-Free Guidance)
In each step of this iterative process, the prediction is guided using Classifier-Free Guidance (CFG). For this, the denoising model must output two separate results:
Uncontrolled prediction: The input includes the agent state, but the conditioning features of the future are set to zero.
Controlled prediction: The input includes both the agent state and the actual embedded command conditioning.
The final output used to update the trajectory is a weighted combination of these two results. The strength of the guidance is determined by the scaling factor of 2.0 (COND_SCALE).
3. Metrics and Evaluation
After the iterative denoising is completed and the final denoised trajectory (final_predicted_x0) is obtained, the performance is evaluated using:
Reconstruction Loss: The mean squared error (L2) between the predicted positions and the actual future positions (ground truth) is computed, with invalid data points masked.
Direction Accuracy: A specialized direction recognition structure analyzes the final predicted position data.
This structure uses a recurrent layer to process the temporal sequence of motion data.
Its output is logits for the three possible directions.
Direction accuracy is defined as the proportion of cases in which the direction derived from the model matches the command originally used as conditioning.
For qualitative analysis, a plot is also generated showing the prediction, the ground truth trajectory, the initial noise distribution, and the scene’s road graphs.
Related categories:
Python
Article Writing
Machine Learning (ML)
Data Science
Pytorch
Deep Learning
Diffusion models