# Advancing GAN Deepfake Detection: Mixed Datasets and Comprehensive Artifact Analysis
## 4 Methodology of the Novel Deepfake Detection Framework
### Data Preparation
* **HOG Transform for Image Processing**: The Histogram of Oriented Gradients (HOG) is a feature extraction technique used in image analysis to capture object shape and structure by analyzing edge orientations [56]. It was first used in face detection by [PERSON] and [PERSON] [57]. HOG divides the image into small regions (cells), computes gradient orientations, and creates histograms that summarize edge directions. These histograms are combined into feature vectors for object detection and recognition, making HOG effective at handling variations in lighting and contrast. For example, in the case of a blueberry, the consistent gradient orientations in its round shape make classification easier [58]. HOG is similar to techniques like edge orientation histograms, scale-invariant feature transform (SIFT), and shape contexts but differs by using a dense grid and local contrast normalization for improved accuracy. * **Color Difference Computation**: The human face has a well-defined color structure, such as in skin tones. Deepfake images often disrupt the natural relationships among color channels, especially following techniques like smoothing or blending. Analyzing these color differences can therefore reveal signs of tampering. The color difference function works on the Red, Green, and Blue (RGB) channels of an image after applying Fourier, wavelet, or HOG transforms to compute the following statistical features that describe the relationships between the color channels in the frequency domain. * _Mean, Min, and Max Differences_: Mean difference is the average magnitude of the difference between color channels across all pixels. Min/Max differences are the smallest or largest color channel differences, which may indicate anomalies in blending or compression. * corr(R, G) (or similar for the other channels) is used to capture the degree of uncorrelated behavior between the channels. If the channels are highly correlated, this value will be close to zero. A higher value indicates a stronger divergence between the channels, which might suggest image tampering. * _Frequency Domain Anomalies_: Unnatural correlations occur when one color channel is manipulated independently of the others. Artificial enhancements or color shifts are introduced when artificial color adjustments, such as changing skin tone to match lighting, are made in the images. 2. **Feature Scaling** Feature scaling is an essential preprocessing step in machine learning that ensures each feature contributes equally to model performance by bringing them into a similar range. In deepfake detection, where datasets include diverse features from raw pixel values to frequency domain values and color metrics, proper scaling is vital. For example, Fourier-transformed features may have values spanning several orders of magnitude, while color difference metrics might vary within a much smaller range. Similarly, a dataset may include pixel intensity (0 to 255) and age (0 to 100). Without scaling, certain features may carry disproportionate weight, resulting in inaccurate classification. Scaling ensures all features are treated equally, allowing the model to capture the true variance of the dataset without  
Figure 7: Principal Component Analysis of images after application of the HOG transform on each dataset. bias. It also optimizes performance, enabling algorithms like the Gaussian Mixture Model to converge more effectively and accurately model probability distributions, ultimately improving classification of real vs. deepfake images. The two common types of feature scaling are the following:  
* Min-Max Scaling (Normalization) is defined by the formula \(x^{\prime}=\frac{x-\min(x)}{\max(x)-\min(x)}\). This method scales data to a range between 0 and 1, making it useful when the data distribution is non-Gaussian or when algorithms need bounded inputs, such as neural networks. It is ideal for algorithms that require inputs within a specific range, like [0, 1] or [\(-1\), 1].