Exploring Self-Supervised Vision Transformers for Deepfake Detection: A Comparative Analysis

Huy H. Nguyen, Junichi Yamagishi, Isao EchizenIJCB 2024

Introduction

The rapid advancement of deepfake technology necessitates robust detection methods. While Vision Transformers (ViTs) have set new benchmarks in general computer vision, their application to deepfake forensics has been limited by high data requirements and a tendency to overfit on small forensic datasets. This research explores whether self-supervised learning (SSL) pre-training can overcome these hurdles, enabling ViTs to outperform traditional Convolutional Neural Networks (ConvNets).

Methodology

The study evaluates two primary approaches for adapting large, pre-trained ViT backbones for the binary classification task of distinguishing real from fake images.

Overview of the two proposed approaches for deepfake detection using ViT backbones: Frozen Backbone (Approach 1) and Partial Fine-Tuning (Approach 2).
  1. Approach 1: Frozen Backbone: The ViT serves as a fixed feature extractor. Features from the final $k$ blocks are aggregated and processed by a simple classifier, such as a 2-layer MLP.
  2. Approach 2: Partial Fine-Tuning: The initial $n-k$ blocks remain frozen to preserve general visual features, while the final $k$ blocks are fine-tuned on deepfake data. This allows the model to specialize its internal attention mechanisms to detect subtle forgery artifacts.

The researchers tested several architectures, including DINOv2, MAE, and EVA-02-CLIP, comparing them against the industry-standard EfficientNetV2.

Key Insights and Results

The Advantage of Self-Supervision

A central finding is that SSL-pre-trained models (DINOv2, MAE) significantly outperform those with supervised pre-training (e.g., DeiT III). This suggests that the broad, unlabeled data used in SSL provides a more versatile foundation for identifying synthetic anomalies than the class-specific features learned from ImageNet.

Optimizing the Fine-Tuning "Sweet Spot"

The research demonstrates that full-parameter fine-tuning is not necessary. Instead, there is an optimal number of final blocks ($k$) to fine-tune for maximum accuracy.

Equal Error Rate (EER) relative to the number of fine-tuned blocks (k) for DINOv2 and MAE models, showing optimal performance at specific depths.

As shown in the performance analysis, DINOv2 (ViT-L/14-Reg) reaches its peak performance (lowest EER) when approximately 11 out of 24 blocks are fine-tuned. For MAE, the optimal $k$ is around 15. Beyond these points, performance can degrade, likely due to overfitting on specific forensic artifacts at the expense of generalizability.

Superior Generalization and Explainability

DINOv2 emerged as the most robust model, particularly when tested against "unseen" fakes generated by diffusion models (e.g., Stable Diffusion). While traditional ConvNets like EfficientNetV2 struggled with an EER of 15.05% on seen data, DINOv2 achieved a much lower 5.63%. Furthermore, the fine-tuning process naturally aligns the model's internal attention mechanisms with facial regions prone to manipulation (eyes, mouth), providing inherent explainability without the need for additional modules.

Conclusion

Self-supervised Vision Transformers represent a significant leap forward for deepfake detection. By leveraging massive unlabeled datasets and strategic partial fine-tuning, these models achieve superior accuracy and better generalization to novel forgery techniques than traditional supervised models. Future research will focus on improving forensic localization and further utilizing unlabeled data to enhance backbone sensitivity to synthetic artifacts.

Summary updated

BibTeX
@inproceedings{nguyen2024exploring,
  author = {Huy H. Nguyen and Junichi Yamagishi and Isao Echizen},
  title = {{Exploring Self-Supervised Vision Transformers for Deepfake Detection: A Comparative Analysis}},
  booktitle = {IJCB},
  year = {2024},
}
Figure