# Image Structure-Induced Semantic Pyramid Network for Inpainting
## 3 Experiment and Analysis
### Quantitative Comparisons  
For edge images, the evaluation criteria in this paper are mean absolute error (MAE) [33] and peak signal-to-noise ratio (PSNR) [34], which are measured by calculating the average difference between each pixel in the predicted edge image and the real edge image to determine the similarity of the images. The MAE formula is:  
\[MAE=\frac{1}{mn}\sum_{i=0}^{m-1}\sum_{j=0}^{n-1}\abs{I_{p}(i,j)-I_{g}(i,j)} \tag{20}\]  
where \(I_{p}\) represents the predicted image, \(I_{g}\) is the real image, and \(m\) and \(n\) represent the length and width of the image, respectively. In this paper, we will compare U-Net and ResU-Net used in this paper, and the two networks will be trained on the CelebA-HQ dataset separately, and the corresponding MAE and PSNR of their output results are shown in Table 2.  
As can be seen from Table 2, the results of edge prediction of the residual images using the residual U-Net are indeed better than those of using the U-Net directly. Regardless of the percentage of mask coverage, the MAE and PSNR of the residual U-Net are higher than \begin{table}
\begin{tabular}{c c c c} \hline \hline  & **Mask** & **U-Net** & **ResU-Net** \\ \hline \multirow{5}{*}{MAE} & centering & 10.05 & 6.74 \\  & 10\%–20\% & 0.94 & 0.42 \\  & 20\%–30\% & 3.91 & 2.93 \\  & 30\%–40\% & 9.92 & 6.25 \\  & 40\%–50\% & 12.68 & 8.41 \\ \hline \multirow{5}{*}{PSNR} & centering & 55.86 & 58.72 \\  & 10\%–20\% & 68.89 & 69.67 \\ \cline{1-1}  & 20\%–30\% & 64.42 & 65.01 \\ \cline{1-1}  & 30\%–40\% & 56.95 & 59.38 \\ \cline{1-1}  & 40\%–50\% & 53.17 & 56.31 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison of edge prediction image results. Figure 8: Comparison of the inpainting effects of different methods on the Facade dataset. (**a**) Input. (**b**) CE. (**c**) PEPSI. (**d**) EC. (**e**) PEN-Net. (**f**) CTSDG. (**g**) Our method. (**h**) GT. the results using the U-Net network, and it can be found that the higher the mask coverage is, the more the residual U-Net is numerically ahead compared with the normal U-Net. It can be concluded that using the residual U-Net model for image edge prediction works better than using U-Net. To objectively evaluate the image inpainting effect of the proposed method, the peak signal-to-noise ratio (PSNR) [34], structural similarity (SSIM) [35] and mean L1 loss are used as evaluation indicators. The results are compared to the CE, PEPSI, EC, and PEN-Net methods using the CelebA-HQ and Places2 datasets and are shown in Tables 3 and 4. PSNR is a standard to measure the distortion or noise level of an image, SSIM is an index to judge the similarity between the previous image and the inpainted result, and Mean L1 loss directly measures the L1 distance between the reconstructed image and the true image. Using these three evaluation indicators, the inpainting effect of the model can be measured not only at the pixel level but also at the feature level. The higher the values of PSNR and SSIM, the better the image restoration effect, while the opposite is true for L1. As seen from the three tables, the assessment criteria of the proposed method on the three datasets are superior to other comparative methods, indicating that the image inpainting results generated by the proposed method are not only closer to the original image at the structure and pixel levels but also have better effects at the feature and perception levels. This fully proves the advantage of this method.