# Advancing GAN Deepfake Detection: Mixed Datasets and Comprehensive Artifact Analysis
## 4 Methodology of the Novel Deepfake Detection Framework
### Data Preparation  
Data preparation consists of two important steps described below: (i) Feature Extraction, and (ii) Feature Scaling. 1. **Feature Extraction** Our innovative approach to extracting meaningful features from images involves combining frequency space transformations--such as Fourier, wavelet, and Histogram of Oriented Gradients (HOG)--with metrics from the Red-Green-Blue (RGB) color channels. As demonstrated in a later section, combining multiple image processing methods for feature extraction hugely enhances deepfake detection effectiveness. Figure 4 illustrates the feature extraction process. * **Fourier Transform for Image Processing**: The Fourier transform (FT) is a mathematical method that decomposes a signal into its individual frequencies. In image processing, the 2D Fourier transform converts an image from the spatial domain (where pixels are arranged by location) to the frequency domain, where each point represents a specific frequency and amplitude. This technique is particularly useful for deepfake detection, as the generation of deepfakes often introduces subtle frequency domain artifacts, such as compression artifacts (e.g., ringing, blurring, jagged edges, and color degradation) [52] and blending or smoothing artifacts from manipulations like face-swapping. The Fourier transform helps uncover these anomalies by highlighting unnatural patterns. The feature extraction process involves three main steps [53]: (i) Spatial Domain to Frequency Domain Conversion: The FT separates an image into frequency components, where low frequencies represent broad patterns such as skin and high frequencies capture fine details such as edges, wrinkles, and hair. (ii) Logarithmic Transformation: A logarithmic transformation (log(abs(FT))) is applied to enhance visibility, and convert the wide dynamic range generated by the FT, where high-frequency components tend to be small, and low-frequency components are dominant, into a more interpretable range for analysis. (iii) Shift to Center Frequencies: The Fourier Shift (fftshift) recognitions the zero-frequency component to the center of the spectrum, facilitating easier interpretation during analysis. Figure 5 shows the principal component analysis (PCA) of images after applying the Fourier transform on each dataset. Figure 3: Detection pipeline. * **Wavelet Transform for Image Processing**: The wavelet transform is a powerful mathematical tool that decomposes images into frequency components, enabling the identification of textures, edges, and patterns. A wavelet is a compact o  
Figure 4: From the top: The Fourier, wavelet, and HOG transforms applied to one image from the CelebA, ProGAN, StyleGAN3, and InterfaceGAN datasets. Figure 5: Principal Component Analysis of images after application of the Fourier transform on each dataset. cillatory function that starts at zero, varies in amplitude, and returns to zero, making it distinct from traditional infinite functions like sine and cosine used in Fourier transforms. This finite duration allows wavelets to capture localized features, making them particularly effective for analyzing signals with varying frequencies and behaviors at different scales [23]. Wavelets can be used to analyze and represent data in both time and frequency domains. Wavelets offer unique characteristics, such as sparse wavelet sub-bands [54], which enhance image representation quality through multi-scale modeling and enable efficient representation and storage of multi-resolution images. For instance, the high-frequency sub-bands contain most of the texture information of the image. Wavelets are robust against shifts and distortions, enhancing their practical applicability [55]. However, wavelet transforms can be computationally intensive, and the choice of wavelet function and parameters requires careful consideration, as these factors can significantly influence the results. Figure 6 shows the principal component analysis (PCA) of images after applying the wavelet transform on each dataset.