Deepfake Detection via Knowledge Injection

Tonghui Li, Yuanfang Guo, Zeming Liu, Heqi Peng, Yunhong WangarXiv 2025 · DOI

Introduction

Deepfake detection has become a critical "cat-and-mouse" game as synthetic media generation techniques grow increasingly sophisticated. While modern AI models can identify many forgeries, they often suffer from poor generalization—a phenomenon known as overfitting. Existing detection strategies typically fall into two categories: fitting-based methods, which learn specific artifacts of training data but fail on unseen fakes, and synthesis-based methods, which attempt to model a general forgery distribution but often neglect the nuances of real images, leading to biased classification boundaries.

Conceptual comparison of deepfake detection methods and their classification boundaries.

To address these limitations, researchers from Beihang University have introduced KID (Knowledge Injection based deepfake Detection). KID is a novel framework that leverages the rich "real-world" knowledge embedded in large-scale pre-trained Vision Transformer (ViT) models. By "injecting" forgery-specific cues without degrading the model's original features, KID achieves a more robust understanding of both real and fake data distributions.

Methodology

KID is designed as a "plug-and-play" framework for ViT-based architectures, focusing on balancing existing knowledge with new forgery insights. The framework consists of three primary components:

Knowledge Injection Module (KIM)

Standard fine-tuning often "washes out" valuable pre-trained features. To prevent this, KID utilizes an Injection Multi-Head Self-Attention (I-MSA) block. This module introduces a separate "knowledge query vector" to compute an authenticity correlation matrix, which is then seamlessly injected back into the main feature flow. This allows the model to learn forgery-specific patterns while keeping its fundamental understanding of real-world imagery intact.

The KID framework architecture featuring Knowledge Injection, Forgery Localization, and Suppression & Contrast modules.

Coarse-Grained Forgery Localization

To deepen the model's understanding of where an image has been tampered with, KID incorporates a multi-task learning branch for forgery localization. By forcing the model to identify specific regions of manipulation—such as the eyes, mouth, or blending boundaries—it enriches the feature representation with spatial knowledge of the fake data distribution.

Layer-Wise Suppression & Contrast (S&C) Losses

The framework employs a dual-loss strategy to maintain a balanced decision boundary:

  • Suppression: In the shallow layers, modifications are suppressed to preserve the model's foundational knowledge of real images.
  • Contrast: In the deeper layers, a contrast loss is applied to maximize the feature-space distance between real and fake images, thereby sharpening the classification boundary.

Experimental Evaluation

The model was trained on the FaceForensics++ (FF++) dataset, which includes 1,000 real videos and 4,000 fakes generated by four distinct methods. To evaluate cross-dataset generalization, the researchers tested KID on several high-quality benchmarks: Celeb-DF-v2 (CDF), DeepFakeDetection (DFD), DeepFake Detection Challenge (DFDC), and Wild-Deepfake (FFIW).

Results and Discussion

KID demonstrated state-of-the-art (SOTA) performance across multiple benchmarks, particularly in cross-dataset scenarios:

  • Generalization: On Celeb-DF, KID achieved a 95.74% AUC, outperforming previous methods by nearly 2%. It also reached 75.77% AUC on the challenging DFDC dataset.
  • Robustness: The model maintained high accuracy even under common image degradations such as JPEG compression, blurring, and Gaussian noise.
  • Efficiency: By keeping original attention branches frozen and only updating injection weights, KID converges up to four times faster than standard ViT fine-tuning.
  • Versatility: The framework proved compatible with various backbones, including DinoV2 and the lightweight LeVit.

Conclusion

KID represents a significant shift in deepfake detection methodology, moving from simple data fitting to a nuanced "injection of expertise" into foundation models. While currently optimized for Transformer-based architectures and frame-level analysis, future work may explore adapting this logic to other architectures and incorporating temporal consistency for video-level detection.

Summary updated

BibTeX
@misc{li2025deepfake,
  author = {Tonghui Li and Yuanfang Guo and Zeming Liu and Heqi Peng and Yunhong Wang},
  title = {{Deepfake Detection via Knowledge Injection}},
  year = {2025},
  eprint = {2503.02503},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.02503},
}
Figure