Abstract
Current deepfake detection models struggle with generalization, often failing when encountering unseen forgery techniques. This paper proposes the Masked Conditional Diffusion Model (MCDM), a novel data augmentation strategy that treats deepfake generation as a conditional inpainting task. By leveraging diffusion-based inpainting to create diverse, high-quality synthetic forgeries, MCDM enables detectors to learn more robust, generic facial artifacts. Experimental results on benchmark datasets like FaceForensics++ and Celeb-DFv2 demonstrate that MCDM significantly improves cross-dataset detection performance, achieving state-of-the-art results in generalization.
Introduction
Deepfake detection has reached high accuracy in intra-dataset scenarios where training and testing data share the same distribution. However, the "generalization problem" remains a critical bottleneck: detectors often overfit to specific technical artifacts of known methods (e.g., face-swapping or facial reenactment) and fail when presented with new generative techniques.
Existing datasets typically rely on fixed forgery pipelines that produce predictable artifacts like boundary mismatches or blurring. To address this, the authors introduce a method to generate "synthetic forgeries" using a diffusion model. Instead of swapping faces between two individuals, the proposed approach masks parts of a single pristine image and uses a diffusion process to inpaint the missing regions, creating a forgery that is semantically consistent yet contains subtle, diverse artifacts that challenge a detector.
Methodology
The MCDM Framework
The core innovation of the Masked Conditional Diffusion Model (MCDM) is treating forgery generation as a masked inpainting task. By partially masking a source image and asking the model to fill it in, the system creates a forged version of the original face that retains the identity but introduces synthetic variations.
Technical Architecture
The MCDM pipeline consists of several specialized components designed to ensure both visual fidelity and semantic consistency:
- Random Mask Generator: To prevent the detector from overfitting to specific shapes, this module generates varied mask geometries, including circles, lines, and squares.
- Adaptive Combine Module: This module blends the original image, the random mask, and Gaussian noise to prepare the input for the diffusion process.
- Dual Loss Function: The model is optimized using two distinct losses:
- Pixel-level Diffusion Loss ($L_{pixel}$): Ensures high visual quality and coherence in the generated regions.
- Feature-level Reconstruction Loss ($L_{fea}$): Utilizes a pre-trained feature extractor (e.g., EfficientNet-B4) to maintain semantic similarity to the original face, preventing the generation of unrealistic or "nonsense" features.
Experimental Evaluation
Datasets and Metrics
The researchers evaluated MCDM using industry-standard benchmarks:
- FaceForensics++ (FF++): Primary baseline for training and intra-dataset testing.
- Celeb-DFv2 (CDF) & DeepFakeDetection (DFD): Used for evaluating cross-dataset generalization.
Key Results
The MCDM approach demonstrated superior performance in both image quality and detection robustness:
- Visual Fidelity: The method achieved a Fréchet Inception Distance (FID) of 2.04, outperforming standard diffusion baselines like LDM and IDDPM.
- Detection Performance: On the FF++ dataset, the model reached an AUC of 99.31%.
- Cross-Dataset Generalization: This was the most significant gain. On Celeb-DFv2, the MCDM-augmented model achieved 78.02% AUC (up from a 73.12% baseline). On DFD, it reached 90.30% AUC (up from 87.80%).
Conclusion and Future Work
By treating deepfake generation as a conditional inpainting task, MCDM provides a powerful tool for creating diverse training data that forces detectors to focus on facial boundaries and subtle semantic inconsistencies rather than dataset-specific artifacts. Future work will explore integrating MCDM directly into detection networks for end-to-end training and further diversifying the types of facial occlusions used during the masking process.
Summary updated