Abstract
Deepfake detection models often suffer from poor generalization when encountering unseen forgery techniques or environmental variations. This paper proposes the Selective Domain-Invariant Feature (SDIF) framework, which aims to decouple domain-specific noise from forgery-related features. By utilizing a Diversity Domain-Aware Module (DDA) for style sampling, a Dynamic Feature Extractor (DFE) for adaptive artifact capture, and a Domain Discriminator Module (DD) to enforce domain invariance, the proposed method achieves state-of-the-art performance on major benchmarks, particularly in cross-dataset scenarios.
Introduction
The rapid advancement of facial manipulation technologies has made Deepfakes increasingly realistic and accessible. While current detection methods based on Convolutional Neural Networks (CNNs) achieve high accuracy on specific datasets, they frequently fail to generalize to new forgery methods or different capture conditions (e.g., lighting, background, or identity). This "generalization gap" occurs because models tend to overfit to domain-specific characteristics—features unique to the training data but irrelevant to the underlying forgery.
To address this, we propose the Selective Domain-Invariant Feature (SDIF) framework. The core idea is to force the model to ignore dataset-specific "noise" and focus on universal forgery artifacts. By treating "style" as a proxy for the domain, we can diversify the training environment and learn features that remain consistent across various manipulation techniques.
Methodology
The SDIF framework consists of three primary components designed to enhance feature robustness and domain invariance.
1. Diversity Domain-Aware Module (DDA)
The DDA module constructs a comprehensive style representation space. It employs Farthest-Point Sampling (FPS) to select style samples that are maximally distant from one another in the feature space. This ensures that the model is exposed to a wide and uniform variety of styles during training, preventing it from overfitting to a narrow distribution. These sampled styles are then integrated with content features using Adaptive Instance Normalization (AdaIN), effectively augmenting the data with diverse domain characteristics.
2. Dynamic Feature Extractor (DFE)
Standard static convolutions are often insufficient for capturing the subtle and varied artifacts produced by different forgery algorithms. The DFE module utilizes dynamic convolutions, where filter weights are adapted based on the specific input instance. This flexibility allows the network to focus on the most relevant features for each unique image, improving its ability to detect diverse manipulation types.
3. Domain Discriminator Module (DD)
To explicitly enforce domain invariance, the DD module works in tandem with a Gradient Reversal Layer (GRL). During training, the discriminator attempts to identify the source domain (dataset or forgery method) of the input image. The GRL reverses the gradients during backpropagation, forcing the feature extractor to learn representations that make it impossible for the discriminator to distinguish between domains. This process effectively filters out domain-specific noise, leaving only the invariant features necessary for forgery detection.
Experiments and Results
The framework was evaluated on several prominent Deepfake benchmarks, including FaceForensics++ (FF++), Celeb-DF, WildDeepfake, and the Deepfake Detection Challenge (DFDC).
Intra-dataset Performance
On the FF++ (High Quality) dataset, SDIF achieved near-perfect results with an accuracy (ACC) of 99.19% and an Area Under the Curve (AUC) of 99.93%. These results surpass existing state-of-the-art methods such as RECCE and Local-relation, demonstrating the effectiveness of the framework even in standard scenarios.
Cross-dataset Generalization
The true strength of SDIF lies in its generalization capabilities. When trained on FF++ and tested on the high-quality Celeb-DF dataset, the model achieved an AUC of 81.79%. This significantly outperforms popular baselines like SRM (79.40%) and RECCE (77.39%). Similar improvements were observed on the WildDeepfake dataset, where the inclusion of the DDA module alone boosted performance, and the full framework reached an AUC of 64.01%.
Conclusion
The Selective Domain-Invariant Feature (SDIF) framework represents a significant step toward robust and generalizable Deepfake detection. By decoupling domain-specific noise from forgery features through style diversification and adversarial training, the model achieves superior performance across diverse datasets. While a performance gap still exists between intra-dataset and cross-dataset testing, the SDIF approach provides a promising foundation for future research into universal forgery detection.
Summary updated