Knowledge Base Regulation Tracker Standards & Frameworks OSS Directory AI Incident Database Research Paper Library Case Studies Society Articles News Jobs About Charter Sign inBecome a Member
Home/OSS Directory/DeepFakeDefenders

DeepFakeDefenders

Dataset auditing and provenance

A prize winning solution for Multimedia Deepfake Detection competition.

deepfake-detectiongeneralization

DeepFakeDefenders: A Technical Overview of the First-Place Solution for Multimedia Deepfake Detection

DeepFakeDefenders is a prize-winning solution developed by the JTGroup team, securing first place in The Global Multimedia Deepfake Detection (Image Track) competition. The project addresses critical challenges in deepfake detection by focusing on dataset integrity, training robustness, and model generalizability. Its methodology is rooted in addressing two key observations from the official dataset split: the distributional similarity between training and validation sets, which complicates performance evaluation on unseen test data, and the richer feature diversity present in fake data compared to real data. These insights drove the development of an unsupervised clustering-based approach for dataset reassembly and adversarial learning principles for data augmentation.

The framework is structured into two primary stages: Data Preparing and Training. In the Data Preparing stage, the existing dataset is augmented through image editing and Stable Diffusion (SD) techniques to introduce variability. Unsupervised clustering is then applied to reorganize the dataset, aiming to improve detection performance and model robustness.

The Training stage introduces a series of expert models optimized using three distinct loss functions: $L_{KL}$ (Kullback-Leibler divergence loss), $L_{NCE}$ (Noise-Contrastive Estimation loss), and $L_{CE}$ (Cross-Entropy loss). The combination of these losses enables the model to effectively distinguish between authentic and manipulated images, enhancing its discriminative capabilities.

How It Works

The implementation of DeepFakeDefenders relies on a Python-based pipeline that integrates several key components. The Data Preparing stage involves generating synthetic data to expand the dataset’s diversity. Techniques such as image editing and Stable Diffusion are employed to create variations that mimic real-world deepfake manipulations. These augmented data samples are then processed through unsupervised clustering algorithms to reassemble the dataset in a way that reduces overfitting and improves generalization.

During the Training stage, the framework employs expert models trained with a combination of $L_{KL}$, $L_{NCE}$, and $L_{CE}$ losses. Cross-Entropy loss provides a traditional classification objective, ensuring the model’s predictions are calibrated and accurate. This multi-loss optimization strategy is central to the framework’s effectiveness in detecting deepfakes.

Users provide an image path to the script infer.py, which processes the image and outputs a probability score indicating the likelihood of it being a deepfake. For example, an input image might yield a score of 0.001683078, suggesting a very low probability of being manipulated.

Key Dependencies

The project depends on several Python libraries to ensure compatibility and functionality. These include PyTorch (version 1.9.0) for deep learning operations, timm (version 1.0.8) for model architectures, scikit-learn (version 1.2.1) for clustering and preprocessing, torch-ema (version 0.3) for exponential moving average training, and torchkmeans (version 0.2.0) for k-means clustering.

Use Cases

DeepFakeDefenders is primarily designed for dataset auditing and provenance verification in multimedia deepfake detection. Its ability to augment datasets with synthetic variations and reassemble them through clustering makes it particularly useful for researchers and organizations seeking to improve the robustness of their detection models.

The framework’s focus on data integrity ensures that models trained on its augmented datasets are less susceptible to adversarial attacks and distribution shifts.

Key Features & Capabilities

  • Dataset Augmentation: Uses image editing and Stable Diffusion to generate synthetic data, increasing the diversity of training samples and improving model generalization.
  • Unsupervised Clustering: Reassembles datasets to mitigate overfitting and enhance robustness, ensuring the model performs well on unseen test data.
  • Multi-Loss Optimization: Combines $L_{KL}$, $L_{NCE}$, and $L_{CE}$ losses to improve discriminative performance, capturing subtle differences between real and fake images.
  • Easy Inference: Provides a simple inference script (infer.py) that outputs a probability score for deepfake detection, with pretrained weights available for immediate use.
  • Open-Source Flexibility: Licensed under Creative Commons Attribution-NonCommercial 4.0 International License, allowing non-commercial use and modification while requiring attribution.

The project was developed in part at the State Key Laboratory of Internet of Things for Smart City (SKL-IOTSC) at the University of Macau, with support from the INCLUSION Conference on the Bund, which organized the competition.

Training and Future Developments

While the core framework and inference capabilities are fully documented and functional, the training code—including unsupervised clustering and joint optimization loss techniques—will be made available in subsequent updates. This includes detailed technical reports that will provide deeper insights into the methodology and its empirical validation.

The repository also acknowledges the contributions of the State Key Laboratory of Internet of Things for Smart City (SKL-IOTSC) at the University of Macau, highlighting the collaborative and interdisciplinary nature of the project.

Sources

Contribute

Spot an error, or know a record we should add? Members can propose additions and submit corrections.