# Intelligent Prediction of Ore Block Shapes Based on Novel View Synthesis Technology
## 2 A New View Synthesis Technique Based on Latent Diffusion Models
### Structural Similarity Constraint  
In the process of transfer learning described above, each iteration primarily aims to achieve the following objectives:  
\[min_{\theta}E_{z\sim\epsilon(x),t,\epsilon\sim N(0,1)}||\epsilon-\epsilon_{ \theta}(z_{t},t,c(x,R,T))||_{2}^{2} \tag{5}\]  
where \(E\) represents the expectation, \(z\sim\epsilon(x)\) represents the latent representation extracted from the input image x by the encoder \(\epsilon\), \(t\) represents the time step, \(\epsilon\sim N(0,1)\) represents noise sampled from a standard normal distribution, c(x, R, T) is the embedding vector, \(z_{t}\) is the latent distribution at the current time step, and \(\epsilon\) and \(\epsilon_{\theta}\) refer to the actual and predicted noise signals, respectively, and their squared Euclidean norm is computed. The model reduces the loss through continuous iterative optimization and realizes the generation of new viewpoints under the constraints of posture conditions. In the latent diffusion models, the MSE loss function is used for calculation. The MSE loss function penalizes the gray value error of the output noise at the pixel level and pays more attention to the overall nature of the noise [31]. Although the embedding vector of the original image data and posture information is introduced as a guide, the latent diffusion models still have the problem of random generation [32]. This is mainly because the diffusion models have inherent randomness in both the forward diffusion denoising and the reverse diffusion denoising process, which may cause the generated image to deviate from the expected phenomenon. In order to alleviate this effect and improve the accuracy of new view prediction, the structure similarity index measure (SSIM) [33] is introduced to guide the model to generate new viewpoints that are closer to the actual situation. In noise prediction, structural similarity measures the structural information of the noise image in more detail from multiple dimensions such as brightness, contrast, and structure and improves the understanding of subtle structural changes in the image [34]. In the task of obtaining global information of ore blocks, higher structural similarity can improve the visual continuity of the generated view. More importantly, in downstream 3D reconstruction applications, model reconstruction requires extremely high consistency between input images, and image consistency and structural similarity are positively correlated [35; 36]. Therefore, improving the structural similarity of model-generated images is crucial for subsequent engineering applications. In the context of structural similarity, brightness is measured using the mean grayscale value, which is obtained by averaging the values of all pixels, calculated as follows:  
\[l(x,y)=\frac{2\mu_{x}\mu_{y}+C_{1}}{\mu_{x}^{2}+\mu_{y}^{2}+C_{1}} \tag{6}\]  
Contrast is measured using the standard deviation of the grayscale values. The unbiased estimate of the standard deviation is calculated as follows:  
\[l(x,y)=\frac{2\sigma_{x}\sigma_{y}+C_{2}}{\sigma_{x}^{2}+\sigma_{y}^{2}+C_{2}} \tag{7}\]Structural contrast is measured using the correlation coefficient, calculated as follows:  
\[c(x,y)=\frac{\sigma_{xy}+\text{C}_{3}}{\sigma_{x}\sigma_{y}+\text{C}_{3}} \tag{8}\]  
The SSIM formula can be calculated by assigning an equal weight of 1 to each of the three features as follows:  
\[SSIM(x,y)=\frac{\left(2\mu_{x}\mu_{y}+\text{C}_{1}\right)\left(2\sigma_{xy}+ \text{C}_{2}\right)}{\left(\mu_{x}^{2}+\mu_{y}^{2}+\text{C}_{1}\right)\left( \sigma_{x}^{2}+\sigma_{y}^{2}+\text{C}_{2}\right)} \tag{9}\]  
where x and y represent the original ore block view and the target ore block view, respectively; \(\mu_{x}\) and \(\mu_{y}\) denote the mean values of x and y; \(\sigma_{x}\) and \(\sigma_{y}\) are the standard deviations of x and y; \(\sigma_{xy}\) is the covariance between x and y; and \(\text{C}_{1}\), \(\text{C}_{2}\), and \(\text{C}_{3}\) are constants. During training, the original loss function, MSE, typically converges faster.