# Vehicle Trajectory Prediction Using Residual Diffusion Model Based on Image Information
## 4 Proposed Approach
### Base and Residual Denoiser
By exploiting the correlation of vehicle states in the same scene, the computation of the denoising network can be greatly reduced. To achieve this goal, we divide the vehicles \(x_{i}\) in the shared scenario into basic vehicle and residual vehicles, denoted as \(z^{1},z^{2},\cdots,z^{i}\), where \(z^{0}\) represents the base vehicle in the scene. \[p_{\theta_{k}}^{i}=\sqrt{\lambda^{i}}z^{0}+\sqrt{1-\lambda^{i}}\Delta z^{i}, \quad i\in[1,N] \tag{4}\]  
In the traffic scenario of the proposed framework, the symbol \(z_{0}\) denotes the universally shared base vehicle, while \(\lambda^{i}\) in [0,1] denotes the interaction ratio parameter of the reference \(z^{0}\) in the remaining vehicle \(z^{i}\). Specifically, when \(\lambda^{i}=0\), it means that there is no interaction between \(z^{i}\) and \(z^{0}\), indicating the lack of shared environmental information. On the contrary, when \(\lambda^{i}=1\), it means that \(z^{i}\) is equal to \(z^{0}\), which is the same car. Under the prescribed conditions, the formula sets the noise latent variable for the denoising step \(k\) as:  
\[\mu_{k}^{i}=\sqrt{\beta_{k}}\Big{(}\sqrt{\lambda^{i}}z^{0}+\sqrt{1-\lambda^{i }}\Delta z^{i}\Big{)}+\sqrt{1-\hat{\beta}_{k}}\theta_{k}^{i} \tag{5}\]  
Further, we split the added noise \(\theta_{k}\) into two parts: the base noise \(a_{k}^{i}\) and the residual noise \(b_{k}^{i}\):  
\[\theta_{k}^{i}=\sqrt{\lambda^{i}}a_{k}^{i}+\sqrt{1-\lambda^{i}}b_{k}^{i}\quad a _{k}^{i},b_{k}^{i}\sim\mathcal{N}(0,1) \tag{6}\]  
According to the above two equations, it can be obtained:  
\[ \begin{split}\mu_{k}^{i}=\sqrt{\lambda^{i}}(\sqrt{\hat{\beta}_{ k}}z^{0}+\sqrt{1-\hat{\beta}_{k}}a_{k}^{i})+\\ \sqrt{1-\lambda^{i}}(\sqrt{\hat{\beta}_{k}}\Delta z^{i}+\sqrt{1- \hat{\beta}_{k}}b_{k}^{i})\end{split}  \tag{7}\]  
Figure 3: In the framework of the diffusion model, the purpose of the residual network is to reduce the noise reduction pressure in the trajectory prediction stage. The reference track is first generated by the basic denoising device, and then the residual noise is estimated by the residual generator. \(\mu_{k}^{i}\) represents the denoising function in the prediction formula. The coefficients and conditions shown in the figure have been omitted for brevity. In the selection of the reference vehicle, its motion trajectory and vehicle information should include most of the environmental information in the video scene as much as possible, such as the dynamic information in the vehicle environment (such as the state of the traffic light) or the important static objects on the road surface, so the reference vehicle must be selected specifically. This particular choice enables \(z^{i}\) to model the smallest difference between \(z^{i}\) and \(z^{0}\). To do so, we choose vehicle with vehicle encoding \(N/2\), where \(z_{0}\) is set to \(z^{N/2}\) and \(\lambda^{N/2}\) is set to 1. Thus, in this configuration, \(\Delta z_{N/2}\) is set to 0, and the equation can be succinct as follows:  
\[\mu_{k}^{i}=\left\{ \begin{array}{ll}\sqrt{\hat{\beta}_{k}}z^{i}+\sqrt{1-\hat {\beta}_{k}}a_{k}&i=N/2\\ \sqrt{\hat{\beta}_{k}}z^{i}+\sqrt{1-\hat{\beta}_{k}}\Big{(}\sqrt{\lambda^{i}}a _{k}+\sqrt{1-\lambda^{i}}b_{k}^{i}\Big{)}&i\
eq N/2,\end{array} \right. \tag{8}\]  
By inputting \(z_{N/2}\) into the predictive denoising function \(z_{\phi}^{a}\) with parameter \(\phi\), the \(z_{\phi}^{a}\) will be called the basis generator of the model and serve as the basic denoising network for subsequent joint inference. Then, the function of the residual generator can be written concisely as:  
\[\mu_{k}^{\prime i}=\mu_{k}^{i}-\sqrt{\lambda^{i}}\sqrt{1-\hat{\beta}_{k}}z_{ \phi}^{a}\Big{(}\mu_{k}^{\left\lfloor N/2\right\rfloor},t\Big{)}\quad i\
eq N/2 \tag{9}\]  
It is worth noting that the base generator \(z_{\phi}^{a}\) assumes the task of reconstructing the future trajectories of the base vehicles \(z^{0}\), while the generator \(z_{\phi}^{b}\) is responsible for building the residual frame \(z^{i}\).