## 6 Experiment and Result Analysis
### Analysis of Diffusion Model Effectiveness  
To validate the effectiveness of the diffusion model in denoising and artifact removal tasks, we employed four distinct subsets of FaceForensics++. Initial preprocessing steps were implemented to ensure the quality of the input data. Subsequently, the effectiveness of denoising and artifact removal was evaluated using assessment metrics and visual analysis, laying the foundation for subsequent deepfake detection efforts. In the quantitative experiments of the diffusion model, we utilized the Peak Signal-to-Noise Ratio (PSNR) [PERSON] et al. (2018) and Learned Perceptual Image Patch Similarity (LPIPS) [PERSON] et al. (2018) as metrics to gauge image quality. PSNR is considered a reliable method for evaluating image quality, with higher scores indicating better image quality. LPIPS, meanwhile, uses deep learning models to assess perceptual differences between two images. In this study, VGG network models were employed for extracting image features, followed by computing the distance between them. Evaluation scores were derived by comparing the generated images with real images to calculate the L2 distance value. A smaller LPIPS score signifies higher image quality, as illustrated in Equations (26) and (27). \[PSNR(I_{t+1},\hat{I}_{t+1})=10\times\log_{10}\frac{[\max(I_{t+1})]^{2}}{\sum \limits_{l=0}^{N}{(I_{t+1}-\hat{I}_{t+1})^{2}}} \tag{26}\] \begin{table}
\begin{tabular}{c c c c c} \hline \multirow{2}{*}{**Loss Function**} & **Deepfakes** & **Face2 Face** & **FaceSwap** & **NeuralTextures** \\ \cline{2-5}  & **AUC** & **AUC** & **AUC** & **AUC** \\ \hline Gram L2 Loss & 99.50 & 98.87 & 99.24 & 98.75 \\ EMD Loss & 96.78 & 95.43 & 96.48 & 95.97 \\ \hline \end{tabular}
\end{table} 
Table 4: The detection AUC results were obtained from training experiments with the gram l2 loss function and the emd loss function in efficientnet. \[LPIPS(I_{1},I_{2})=\sum_{l}\frac{1}{H_{l}W_{l}}\sum_{h,w}\left\|w_{l}\bullet\left( \hat{y}^{l}_{1 hw}-\hat{y}^{l}_{2 hw}\right)\right\|_{2}^{2} \tag{27}\]  
In Equation (27), \(\bullet\) represents multiplication. \(max(I_{l+1})\) signifies the maximum pixel value in the real image, while \(1/\text{N}\sum_{t=0}^{N}(I_{t+1}-\hat{I}_{t+1})^{2}\) represents the mean squared error between the generated and real images. Within Equation (27), \(I_{1}\)and \(I_{2}\) denote two image blocks, and \(\hat{y}^{l}_{1 hw}\) and \(\hat{y}^{l}_{2 hw}\) denote the normalized feature map activations of the real and generated images at layer I, respectively. These activations have dimensions H \(\times\) W (where H is height and W is width), and \(w_{l}\) is a scaling vector used to weigh the feature channels of the \(l\) layer. Finally, by computing the L2 distance between \(\hat{y}^{l}_{1 hw}\) and \(\hat{y}^{l}_{2 hw}\) across all layers of image blocks, these distances are averaged across the spatial dimensions. Moreover, in the experiments, T was set to 1000 for all trials to ensure a sufficient and consistent number of neural network evaluations during sampling. Therefore, this paper illustrates the denoising process through the inverse reversible process of the diffusion model, as depicted qualitatively in Figure 16.  
The experiment validated the efficacy using motion blur and Gaussian noise. Through the inverse process of the diffusion model, it was observed from Figure 16 that both denoising and restoration were notably effective on images affected by motion blur and those with added Gaussian noise. The diffusion model effectively reduced noise from deblurred images and removed Gaussian noise, as visually confirmed in Figure 16. This verifies the effectiveness of the diffusion model in experimental settings. Additionally, to ensure result stability, quantitative tests were conducted. PSNR and LPIPS scores were computed on the sample dataset, experiments were repeated, and the averages were taken as the final results. The model's performance on the four different subsets of the FaceForensics++ dataset is presented in Table 5.