Abstract
Current deepfake detection models often struggle with generalization, failing to identify forgeries generated by unseen algorithms. This paper proposes a backbone-agnostic architecture that aggregates features from every layer of a neural network rather than relying solely on the final layer. By extracting "primitives" from each layer and combining them through a linear aggregation head, the model captures multi-scale cues—ranging from low-level pixel artifacts to high-level semantic inconsistencies. Experimental results on FaceForensics++ and various synthetic face generators demonstrate that this approach significantly improves cross-dataset generalization and achieves state-of-the-art consistency across diverse forgery techniques.
Introduction
The rapid evolution of generative models has created a "cat-and-mouse" game in deepfake detection. A major flaw in current detection research is the assumption that training and test sets share the same distribution. In real-world scenarios, a detector trained on a specific algorithm often fails when encountering a novel generation technique. This is largely due to overfitting; standard detectors typically utilize deep backbones (such as ResNet or EfficientNet) and make classification decisions based only on the final feature map.
However, different forgery methods leave distinct "fingerprints." Some manifest as high-level semantic inconsistencies, such as anatomical irregularities, while others appear as low-level pixel artifacts or frequency inconsistencies. By ignoring intermediate layers, standard models miss the multi-scale cues necessary for robust, generalized detection. This paper introduces a method to leverage the entire depth of the network to capture these varied signals.
Methodology
The authors propose a Layer Aggregation framework designed to be backbone-agnostic. Instead of a traditional linear pipeline where information flows to a single classification head at the end, this architecture implements "skip connections" from every layer or block of the backbone.
1. Primitive Extraction
Using EfficientNet-V2-Small as a primary backbone, the model extracts a feature tensor from every layer $L_i$. Each tensor is passed through a "Primitive Extraction Block" consisting of 2D Average Pooling and a small three-layer Multi-Layer Perceptron (MLP).
2. Primitives
This extraction process reduces the complex feature maps of each layer into a compact vector of 10 values, termed "primitives." These primitives represent the essential forgery cues captured at that specific depth of the network.
3. Linear Aggregation
All primitives from all layers are concatenated into a single vector. A simple linear regression block then processes this combined vector to produce the final "real vs. fake" score. Because the final decision is a linear combination of these primitives, the model is highly interpretable; researchers can analyze the weights assigned to each layer to determine which part of the network is most effective at identifying specific forgery types.
Experimental Setup
The approach was evaluated across two primary domains with a focus on cross-dataset generalization:
- FaceForensics++: A benchmark containing four manipulation types: Deepfakes, FaceSwap, Face2Face, and NeuralTextures.
- Synthetic Face Generation: Faces generated by PGAN, StyleGAN, StyleGAN2, Glow, and GMM (Gaussian Mixture Models), using CelebA-HQ and FFHQ as the ground truth "real" datasets.
The core challenge was training the model on one specific forgery type (e.g., PGAN) and testing its performance on entirely different generators (e.g., StyleGAN2).
Key Insights and Results
Multi-Scale Cue Utilization
The research confirms that different forgeries are detected at different depths. For instance, "NeuralTextures" are often identified by mid-level layers, whereas "Deepfakes" (identity swaps) rely more heavily on high-level semantic features found in later layers.
Consistency and Generalization
The authors utilize the inverse Coefficient of Variation ($CoV^{-1}$) to measure performance consistency. While many models achieve high accuracy on specific datasets, maintaining that accuracy across unknown datasets is difficult. The proposed method achieved a $CoV^{-1}$ score of 5.06 on FaceForensics++, outperforming standard Xception and ResNet models. Furthermore, by applying layer aggregation to a standard Xception backbone (Xception++), the consistency score improved from 3.48 to 7.53.
Efficiency through Network Trimming
Due to the linear nature of the aggregation head, the authors discovered the network could be "trimmed." Utilizing only the top three most important primitive blocks—representing less than 6% of the analysis parameters—resulted in a performance drop of less than 0.25%. This suggests that massive classification heads are unnecessary if the right features are extracted from the backbone.
Synthetic Detection Performance
In GAN vs. Real detection, the model achieved a mean Average Precision (AP) of 88.54% across diverse generators. This stands in stark contrast to baseline models, which often saw performance drop to 40-50% AP when faced with unfamiliar generators like GMM.
Conclusion and Future Work
The Layer Aggregation method provides a significant boost to deepfake detection generalization by capturing multi-scale artifacts. While highly effective for static images and individual frames, the current model does not yet address temporal consistency in video. Future research may explore "smart trimming" during the training phase to create even more lightweight detectors and investigate the use of aggregated features for the spatial localization of forgeries within an image.
Summary updated