# Detection of Forged Images Using a Combination of Passive Methods Based on Neural Networks
## 3 Materials and Methods
### Discrete Wavelet Transform
This approach aims to explore the accuracy of each stream individually in addition to their combination. For this, we individually trained three distinct models and a model composed of all three streams, plus additional learning layers. Stream A uses only the original images without alterations as input, Stream B uses only images with feature selection by ELA, and Stream C uses only images with feature selection by the DWT-based method. Finally, the models are combined and four layers are added to generate the Merged model, which uses images from all three streams as input. Initially, we considered employing pre-trained models to integrate passive methods into our research. For an initial assessment of their performance compared to custom models, we selected the MobileNetV2 pre-trained model due to its lightweight nature. We conducted preliminary tests, comparing the performance of MobileNetV2 combined with four dense layers, each incorporating l2 regularization and followed by a batch normalization layer, against Model 'A' as detailed later. Results of this comparison are presented in Figures 5 and 6. Figure 4: Illustration of the proposed approach. Figure 3: Example of DWT method. (**Left**), image power button manipulated. (**Right**) Results of the DWT (variations are enhanced). The tests revealed a tendency for pre-trained models to overfit to the training images. Additionally, attempts to mitigate overfitting by unfreezing some of the pre-trained layers yielded similar results. Moreover, employing another pre-trained model, such as InceptionResNetV2, did not demonstrate superior performance compared to the custom model. Consequently, these findings lead us to conclude that pre-trained models may not be well-suited for image manipulation detection. With that in mind, we decided to create three identical custom CNNs and implement regularization methods to minimize overfitting to produce results capable of generalizing to a more extensive set of images and facilitating the comparison of the three individual models. The primary challenge in developing the neural networks for this study was addressing the issue of overfitting, where the models tend to perform well on training data but struggle to generalize to new, unseen data. To address this, we conducted a series of experiments aimed at evaluating the impact of various model architectures on accuracy. These experiments involved exploring different configurations such as altering the number and size of convolutional and dense layers, as well as implementing diverse regularization methods. While we did not gather specific data from these experiments, they were instrumental in guiding our selection process and ultimately led to the development of the final model architecture outlined in Figure 7.

Through this exploration, we discovered that simply increasing the number of layers did not yield significant accuracy improvements. On the contrary, it heightened the risk of overfitting. Consequently, we opted to craft a model comprising five convolutional layers, each followed by a batch normalization layer and a max pooling layer. The outputs from these layers were then flattened and channeled through four dense layers, each supported by a batch normalization layer. Additionally, to mitigate overfitting, L2 regularization was applied to both the convolutional and dense layers, as illustrated in Figure 7.

Figure 5: Comparing the accuracy of a custom model to MobileNetV2. (**left**) Custom model accuracy during training (**right**) Pre trained MobileNetV2 accuracy during training. Figure 6: Comparing loss of a custom model to MobileNetV2. (**left**) Custom model loss during training (**right**) Pre trained MobileNetV2 loss during training. The chosen values for the convolutional layers were set as 16, 32, 64, 128, and 64, each utilizing a 3 by 3 kernel. Similarly, the dense layers were configured with sizes of 128, 128, 64, and 32.