# Robust Image Inpainting Forensics by Using an Attention-Based Feature Pyramid Network
## 4 Experiments
### Ablation Studies  
This paper conducted three types of ablation experiments to examine the impacts of three innovations (i.e., feature fusion mode, attention module, and loss function) on the final inpainting trace detection outcomes. The results are presented in Table 2.  
Regarding the feature fusion approach, three distinct methods for feature fusion were proposed, based on the network structure. These methods include utilizing solely low-level features as the output, solely high-level features as the output, and utilizing low- and high-level fusion features as the output. When solely low-level features are utilized, the accuracy is notably high (99.11%); however, the recall rate is relatively low (91.76%), indicating that part of inpainting traces remain undetected. The utilization of solely advanced features results in an increased recall rate of 94.74%; however, this value is significantly lower than the outcome obtained through feature fusion, which is 98.21%. This indicates that the inpainting traces of images accurately identified by low- and high-level features are restricted, and optimal recall rates can be attained by amalgamating them. Thus, the feature fusion technique employed in this study is highly efficacious, enabling the network to acquire valuable information from both low- and high-level features. Three distinct approaches for selecting an attention mechanism exist, namely, utilizing only MSCA, exclusively employing CA, or abstaining from an attention mechanism altogether. The recall rate for the latter option is the least favorable at 93.79% when compared to the other two. Upon implementation of CA, the recall rate is increased to 95.94%, albeit at the cost of a decrease in accuracy from 98.95 to 98.05%. Thus, it can be inferred that using the CA in the context of inpainting forensics is limited. The results of the ablation experiments demonstrate that using the MSCA module, as presented in this paper, can  
Figure 5: Qualitative comparisons for the detection of inpainting forgeries. significantly improve the efficacy of the loss function posited in this study, a final ablation experiment was conducted. The outcome of training the network with the loss function \(L_{F}(G,O)\) in Equation (4) (yielding an F1 score of 97.67%) is found to be nearly identical to that of \(L_{F}(G,H)\) (yielding an F1 score of 97.50%). But they are all lower than the results of fusion loss function \(L\) (98.91%). This finding serves to reaffirm the criticality of the high-level feature integrated into the network architecture employed in this research. It is noteworthy that altering the loss function has minimal impact on the network performance. Empirical findings indicate that utilizing the fusion loss function, denoted as \(L\) in Equation (5), can significantly enhance the network performance. In order to verify the hyperparameters we used in Equation (5), we perform a concrete study about the setting of the hyperparameter. The results are presented in Table 3.  
From Table 3, we observe that the best results are obtained when the \(L_{F},(G,O)\), and \(L_{F}(G,H)\) account for the same proportion in the loss function. In addition, we also study the influence of the pre-training model on the detection results. We use different pre-trained models, i.e., VGGNet [42], ResNet-50 [52], and Swin-T [53] to train AFPN. The results are presented in Table 4.  
From Table 4, we observe that using the Swin-T pre-trained model can further stimulate the potential of our method, but this improvement is limited. Usually, CNN has an \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Pre-Trained Model** & **Recall** & **Precision** & **IoU** & **F1** \\ \hline VGG-16 & 98.21 & 99.62 & 97.85 & 98.91 \\ ResNet-50 & 99.20 & 99.56 & 97.83 & 98.84 \\ Swin-T & 99.30 & 99.74 & 98.21 & 99.16 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Localization results (%) obtained by different pre-trained models.