File size: 4,797 Bytes
a479aa5
b182276
a479aa5
 
b182276
a479aa5
 
 
 
 
 
 
b182276
a479aa5
84d58e0
a479aa5
84d58e0
a479aa5
b182276
a479aa5
84d58e0
a479aa5
84d58e0
 
 
 
a479aa5
b182276
a479aa5
c55595d
b182276
 
 
 
 
c55595d
 
 
a479aa5
b182276
a479aa5
b182276
84d58e0
b182276
a479aa5
84d58e0
 
 
 
 
 
c55595d
a479aa5
b182276
a479aa5
c55595d
84d58e0
b182276
 
 
 
84d58e0
 
 
b182276
 
 
 
 
 
 
 
84d58e0
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
title: Deepfake Detection Space
emoji: πŸ”
colorFrom: red
colorTo: yellow
sdk: gradio
sdk_version: 5.49.1
app_file: app.py
pinned: false
license: mit
---

# Deepfake Detection Space (Open-Source Demonstrator)

Welcome to the Truebees Deepfake Detection Space! This Space provides an **educational, open-source demonstrator** collecting a series of baseline state-of-the-art methods for deepfake detection, allowing for free and unlimited use. 

If you want to train the detectors in this Space yourself, check out our [GitHub repository](https://github.com/truebees-ai/Image-Deepfake-Detectors-Public-Library).

## 🎯 Goal and Context

This demonstrator is designed as an open-source contribution to the community. We want to allow users, researchers, and developers to experiment with baseline forensic models for free, familiarize themselves with AI detection tools, and understand both their capabilities and their limitations.

**⚠️ Important:**
* **Not Proprietary Software:** This tool showcases open-source detectors. It **does not** reflect the performance, robustness, or accuracy of Truebees' commercial detection methods. Want to give it a try? check **[Truebees Website](https://www.truebees.eu)**.
* **Non-Social Training Data:** These models were trained on images not shared on social networks from the **[DeepShield dataset](https://zenodo.org/records/15648378)**. You may experience a drop in accuracy when testing highly compressed images downloaded from social media platforms or messaging apps (e.g., WhatsApp). 
* **Expected Performance:** You can expect performance comparable to the results shown in [Dell'Anna et al. (2025)](https://arxiv.org/pdf/2504.20658).

## πŸ› οΈ Available Detectors

* **ALL**: Runs all available detectors sequentially. Shows the result of each detector and generates a Confidence Plot.
* **R50_TF**: ResNet-50 based detector trained on the TrueFake dataset.
* **R50_nodown**: ResNet-50 without downsampling operations.
* **CLIP-D**: CLIP-based deepfake detector.
* **P2G**: Prompt2Guard: Conditioned prompt-optimization for continual deepfake detection.
* **NPR**: Neural Posterior Regularization.
* **PGC**: Peak-guided calibration on DINOv2-L (official pre-trained weights).
* **ForensicConcept**: CLIP ViT-L/14 with a forensic concept codebook (official pre-trained weights).
* **MDMF**: Local distribution shift (MMD) on DINOv2-L patch embeddings (official pre-trained weights; reference bank and threshold computed on DeepShield data).

## πŸš€ Usage Guide

1. **Upload an image**: Choose an image you want to analyze.
2. **Select a detector**: Choose one of the open-source models (or "ALL") from the dropdown menu.
3. **Detect**: Click the "Detect" button to generate the prediction.

**Understanding the Results:**
* **Prediction**: Tells if an image is **Real** or **Fake**.
* **Confidence**: The confidence with which the model determines if the image is real or fake.
* **Elapsed Time**: The time the model needed to make the prediction (excluding preprocessing or model building).

**Understanding the Results produced by "ALL":**
* Lists the prediction and confidence of each detector and generates a **Confidence Plot** visualizing each model's score. No aggregated verdict is produced. In the plot, **Green** bars indicate a **Real** prediction, while **Red** bars indicate a **Fake** prediction.

## 🧠 Training Data Overview

R50_TF, R50_nodown, CLIP-D, P2G and NPR have been pretrained using the **[DeepShield dataset](https://zenodo.org/records/15648378)**:
* **Fake Images:** Generated using StyleGAN 2 and Stable Diffusion XL.
* **Real Images:** Sourced from the FFHQ Dataset and the FORLAB Dataset.

## πŸ“š References

For technical details, full code to train and test these models on your own dataset, and benchmarking data, please visit our [GitHub repository](https://github.com/truebees-ai/Image-Deepfake-Detectors-Public-Library).

1. Dell'Anna, S., Montibeller, A., & Boato, G. (2025). *TrueFake: A Real World Case Dataset of Last Generation Fake Images also Shared on Social Networks*. arXiv preprint arXiv:2504.20658.

## 🀝 Acknowledgment

This work has been funded by the European Union under Horizon Europe Grant Agreement no. 101092887 (NGI Sargasso – Open Call OC5 | Deepshield Project). 
* **Website page**: [NGI Sargasso Innovators](https://ngisargasso.eu/2025/02/28/discover-the-last-13-ngi-sargasso-innovators-from-our-open-call-5-creating-an-internet-of-humans-across-continents/)

## ⏳ Note

* ⚠️ Due to file size limitations, model weights need to be downloaded automatically on first use. This may take a few moments.
* ⚠️ To provide a free service, all models run on CPU. The detection process may take a few seconds, depending on the image size and the selected detector.