# Vehicle Trajectory Prediction Using Residual Diffusion Model Based on Image Information
## 4 Proposed Approach
### Base and Residual Denoiser  
Due to the uncertainty of the vehicle's driving intention, each vehicle has multiple potential paths in the future state. Therefore, we propose a new method for vehicle trajectory prediction using the uncertainty diffusion of trajectory path [25]. In the process of denoising, instead of generating the trajectory by gradually reducing the uncertainty of all the drivable regions, we adopt the method of adding noise latent variables on the trajectory features to get the uncertainty difference, and use parameterized Markov chains to make deterministic predictions. The specific experimental process is shown in Figure 3. The random driving region \(\left(\mathbf{x},\mathbf{y}\right)_{T}\) with given noise distribution and the mathematical true trajectory \(\left(\mathbf{x},\mathbf{y}\right)\) with data distribution. We define the diffusion process as \(\left\{\left(\mathbf{x},\mathbf{y}\right)_{0}\left(\mathbf{x},\mathbf{y} \right)_{1},\ldots,\left(\mathbf{x},\mathbf{y}\right)_{T}\right\}\), where \(K\) is the maximum number of diffusion steps. The purpose of this process is to gradually increase the uncertainty of the trajectory until the real trajectory on the ground is broken into a chaotic and irregular driving trajectory area. Instead, our model learns the denoising process \(\left\{\left(\mathbf{x},\mathbf{y}\right)_{T}\left(\mathbf{x},\mathbf{y} \right)_{T-1},\ldots,\left(\mathbf{x},\mathbf{y}\right)_{0}\right\}\) to gradually reduce the uncertainty of \(\left(\mathbf{x},\mathbf{y}\right)_{T}\), thereby generating the predicted trajectory. Both diffusion and reverse diffusion processes are described by Markov chains with Gaussian transfers. We learn the dynamic reverse process [26] as follows:  
\[\mathbf{p}_{\theta}(\left(\mathbf{x},\mathbf{y}\right)_{0:T}\mid\left(\mathbf{x },\mathbf{y}\right),\mathbf{S}_{T})=\mathbf{p}(\left(\mathbf{x},\mathbf{y} \right)_{T})\prod_{t=1}^{T}\mathbf{p}_{\theta}(\left(\mathbf{x},\mathbf{y} \right)_{T-1}\mid\left(\mathbf{x},\mathbf{y}\right)_{T},\mathbf{S}_{T}) \tag{1}\]  
The trajectory generation process under the diffusion model can be regarded as a reverse denoising process from a specific noise distribution. In order to obtain a generator that can generate accurate trajectories, we need to train the denoiser to generate future trajectories through a parameterized Gaussian transfer that simulates the backdiffusion process.In the context of a diffusion process, In the diffusion process, random noise is gradually introduced into the data through k-step Markov chain after sampling, so the representation of the denoising variable \(\mu_{k}\) with step size \(k\) can be written as:  
\[\mu_{k}^{i}=\sqrt{\hat{\beta}_{k}}\mathbf{p}_{\theta_{k}}^{i}+\sqrt{1-\hat{ \beta}_{k}}\theta_{k} \tag{2}\]  
Figure 2: In the training phase, an independent and identically distributed set of random Gaussian noise is sampled and added to the ground truth trajectory. Subsequently, in the inference phase, the future trajectory of each vehicle is initially sampled from the pure noise at the highest noise level. This sampled trajectory is then iteratively denoised by a dedicated denoiser to generate a reasonable distribution of future trajectories. At the same time, a controllable conditional constraint function is introduced in the denoising process to establish a conditional denoiser. with  
\[\hat{\beta}_{t}=\prod_{k=1}^{t}\beta_{k}\quad\theta_{k},\sim\mathcal{N}(\mathbf{0},\mathbf{1}) \tag{3}\]  
\(\hat{\beta}_{k}\in(0,1)\) is the corresponding diffusion coefficient. Where \(k\) and \(t\) are the diffusion step and time step of the diffusion model, respectively. Specifically, \(p_{\theta_{k}}^{i}\) represents the probability distribution of the k-step diffusion at a certain time. In the existing research, the conventional diffusion model needs to undergo more denoising processing to obtain high-precision pattern samples. However, in the same video scene, each vehicle is not an independent individual.