# DRRU-Net: DCT-Coefficient-Learning RRU-Net for Detecting an Image-Splicing Forgery
## 4 Experiments and Results
### Experimental Environment  
The GPU used in the experiment is NVIDIA GTX 1660, and DRRU-Net is implemented with Pytorch. All models used for performance comparison learn 10,000 images of DEFACTO's Splicing set [30]; 10,000 images of DEFACTO's Splicing set that are not used as training and validation, 10,000 sets of DEFACTO's Copy-Move, and 3000 forgery image sets of the CASIAv2 dataset [31] are used as the test dataset for evaluation.  
DEFACTO's datasets only contain images in TIFF format. CASIAv2 saves images in TIFF and PNG formats, not JPEG files. To collect compression artifacts on the deep learning network, JPEG compression is performed with quality of 100 for non-JPEG format images of the training and test datasets.  
Normalization of the image is required for the RGB stream input to pass through the network. The normalization method used for image X in [13] is X/255, and in [14], it is (X \(-\) 127.5)/127.5, with the image pixel values of 0-1 and \(-\)1-1, respectively. In this experiment, we tried to compare them by normalizing in the method of [5], but it was confirmed that training was not performed at all when the RRU-Net was normalized in the method of [14]. Therefore, RRU-Net normalizes in the existing [4] method. DRRU-Net normalizes in the method of [14] and keeps the input.  
As in the experiment in [13], the loss function of DRRU-Net uses binary cross entropy to obtain the loss of images in pixel units. The optimizer uses Adam [32] with a learning rate of 0.001. The batch size is 1, and 764 images that are not used in training are used as validation data, so that the verification score does not increase during the training loop. The training is stopped after 6 epochs, and the epoch's models with the highest verification score are saved and used for evaluation. The verification score is calculated with _Dice_ coefficient. _Dice_ coefficient is a set operation that calculates the degree of overlap between the correct answer and the prediction region. The equation can be calculated with a confusion matrix, but it can be obtained without a confusion matrix by using the library of Pytorch and can be used as a loss function because it is differentiable.  
\[Dice=\frac{2(|A|\cap|B|)}{|A|+|B|}=\frac{2 TP}{2 TP+FP+FN} \tag{8}\]  
_Dice_ coefficient and \(F1\)-score have different meanings but can be obtained with the same equation. Since the task of detecting image forgery regions can be binary-classified into forgery (P) and normal (N) per pixel, accuracy can be calculated in pixel units. However, since the ratio of the number of pixels in the forgery regions to the number of pixels in the normal regions in each image of the dataset is not fixed and unbalanced, the performance of forgery pixel detection may not be properly evaluated only with that accuracy. For example, on the premise that only 30 pixels are forged in an image of 100 \(\times\) 100 resolution, if the training is not done properly and all the pixels in all images are predicted as negative (normal), the accuracy would be 0.997, which seems like an excellent model. Therefore, inorder to evaluate reliable classification in the unbalanced distribution of positive pixels and negative pixels, the \(F1\)-score obtained from the confusion matrix is used, denoted as _Dice._  
\[DACC_{p}=\frac{TP+TN}{TP+TN+FP+FN} \tag{9}\]  
\[PRE_{p}=\frac{TP}{TP+FP} \tag{10}\]  
\[DREC_{p}=\frac{TP}{TP+FN} \tag{11}\]  
\[F1_{p}=\frac{2\big{(}PRE_{p}\times REC_{p}\big{)}}{PRE_{p}+REC_{p}}=\frac{2 TP}{ 2 TP+FP+FN}=Dice \tag{12}\]  
In Equation (9), the subscript \(p\) means that the equations are applied based on pixels. _TP_, _TN_, _FP_, and _FN_ correspond to the correct detection of forgery pixels, the correct detection of normal pixels, the false detection of normal pixels as forgery pixels, and no detection of forgery pixels, respectively. The _Dice_ coefficients obtained from each image are added together and the average value is taken. All results are rounded off from the fourth digit and used up to the third digit.