# Intelligent Prediction of Ore Block Shapes Based on Novel View Synthesis Technology
## 2 A New View Synthesis Technique Based on Latent Diffusion Models
### Inference of Ore Block Images Using Diffusion Models and Latent Diffusion Models  
The most fundamental type of diffusion model is the Denoising Diffusion Probabilistic Models (DDPM). Its inference process is mainly divided into two phases: forward diffusion and reverse diffusion. In the forward diffusion phase, Gaussian noise is progressively added to the input image, transforming it into a noise image devoid of distinguishable features. This process can be mathematically described for time steps \(t=1\), \(2\),..., T as follows:  
\[x_{t}=\sqrt{1-\beta_{t}}x_{t-1}+\sqrt{\beta_{t}}\epsilon,\epsilon\sim N(0,1) \tag{1}\]  
where \(\beta_{t}\) represents the noise intensity at time step \(t\), and \(\epsilon\sim N(0,1)\) represents noise sampled from a standard normal distribution; the same applies below. If we define \(\overline{\alpha_{t}}=\prod_{s=1}^{t}(1-\beta_{s})\), the expression for the image \(x_{t}\) at time \(t\), obtained by directly adding noise to the original image, is given by the following:  
\[x_{t}=\sqrt{\overline{a_{t}}}x_{0}+\sqrt{1-\overline{a_{t}}}\epsilon,\epsilon \sim N(0,1) \tag{2}\]  
In the reverse diffusion process, the noise-added image is input into the U-Net network to predict the noise component. The model then gradually denoises the image, approximating the reverse of the forward diffusion process using Bayesian inference. The simplified formula for the reverse process can be expressed as follows:  
\[x_{t-1}=\frac{1}{\sqrt{1-\beta_{t}}}\bigg{(}x_{t}-\frac{\beta_{t}}{\sqrt{1- \overline{a_{t}}}}\epsilon_{\theta}(x_{t},t)\bigg{)}+\sqrt{\beta_{t}\frac{1- \overline{a_{t-1}}}{1-\alpha_{t}}}\epsilon,\epsilon\sim N(0,1) \tag{3}\]  
where \(\in_{\theta}(x_{t},t)\) is the predicted noise from the previous stage, and \(x_{t}\) and \(x_{t-1}\) represent the images at time steps \(t\) and \(t-1\), respectively.  
It is important to note that this approach requires substantial computational resources, and it assumes that the actual noise conforms to a Gaussian distribution. However, by using this method, DDPM can gradually reconstruct the original image from completely random noise, demonstrating significant potential in image generation tasks. The overall inference process of the denoising diffusion probabilistic models (DDPM) is illustrated in Figure 2.  
Figure 2: Denoising diffusion probabilistic Model (DDPM) inference process.  
Latent diffusion models (LDMs) are the evolution of denoising diffusion probabilistic models (DDPMs). They utilize variational auto-encoders (VAEs) to achieve latent space compression of images [22], allowing the denoising process to occur in this latent space, which significantly enhances the inference speed of the model and also reduces resource consumption. Additionally, LDMs improve the U-Net network with a cross-attention mechanism [23] and incorporate the pre-trained CLIP model \(\tau_{\theta}\) to extract feature information from input images and text [24]. The information is converted into embedding vectors, which are then mapped to the U-Net layers through the attention mechanism (Q, K, V). The U-Net, with its skip connection structure, effectively preserves high-resolution feature information [25], transforming the internal diffusion model into a conditional image generator [26]. The complete inference process is illustrated in Figure 3.