Spaces:
Sleeping
Sleeping
AMontiB commited on
Commit ยท
261c3be
1
Parent(s): b182276
modify app.py
Browse files
app.py
CHANGED
|
@@ -270,32 +270,33 @@ demo = gr.Blocks(title="Deepfake Detection Space", theme=gr.themes.Soft())
|
|
| 270 |
with demo:
|
| 271 |
gr.Markdown("""
|
| 272 |
# ๐ Deepfake Detection Space
|
| 273 |
-
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
|
| 274 |
-
|
| 275 |
-
### โ ๏ธ Important Limitations
|
| 276 |
-
* **Not Proprietary Software:** This tool showcases open-source networks. It **does not** reflect the performance, robustness, or accuracy of Truebees' commercial detection methods.
|
| 277 |
-
* **"In-the-Wild" Performance Drop:** These models were trained on non-social datasets. You may experience a severe drop in accuracy when testing highly compressed images downloaded from social media platforms or messaging apps (e.g., WhatsApp).
|
| 278 |
-
|
| 279 |
-
### Training & Performance
|
| 280 |
-
All methods have been trained using the **[DeepShield dataset](https://zenodo.org/records/15648378)**, on images generated with **Stable Diffusion XL** and **StyleGAN 2**.
|
| 281 |
-
You can expect performance comparable to the results shown in [Dell'Anna et al. (2025)](https://arxiv.org/pdf/2504.20658).
|
| 282 |
-
|
| 283 |
-
### Understanding the Results
|
| 284 |
-
* **Prediction**: Tells if an image is **Real** or **Fake**.
|
| 285 |
-
* **Confidence**: The confidence with which the model determines if the image is real or fake.
|
| 286 |
-
* **Elapsed Time**: The time the model needed to make the prediction (excluding preprocessing or model building).
|
| 287 |
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
*
|
| 292 |
-
*
|
| 293 |
-
*
|
| 294 |
-
|
| 295 |
-
### Note
|
| 296 |
โ ๏ธ Due to file size limitations, model weights need to be downloaded automatically on first use. This may take a few moments. <br>
|
| 297 |
โ ๏ธ 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.
|
| 298 |
""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 299 |
|
| 300 |
with gr.Row():
|
| 301 |
with gr.Column():
|
|
@@ -320,8 +321,7 @@ with demo:
|
|
| 320 |
with gr.Accordion("โ๏ธ Weight Details", open=False):
|
| 321 |
gr.Markdown(f"""
|
| 322 |
### **Detector Weights**
|
| 323 |
-
The weights are assigned
|
| 324 |
-
|
| 325 |
| Detector | Weight |
|
| 326 |
| :--- | :---: |
|
| 327 |
| **CLIP-D** | {DETECTOR_WEIGHTS['CLIP-D']:.2f} |
|
|
@@ -334,7 +334,7 @@ with demo:
|
|
| 334 |
with gr.Accordion("๐ Model Details", open=False):
|
| 335 |
gr.Markdown("""
|
| 336 |
### **ALL**
|
| 337 |
-
* **Description**: Runs all available detectors (R50_TF, R50_nodown, CLIP-D, P2G, NPR) sequentially on the input image.
|
| 338 |
* **Results**: Produces a **Majority Vote** verdict (Real/Fake) considering only confident predictions (> 0.6). Also generates a **Confidence Plot** visualizing each model's score and a textual **Explanation** of the consensus.
|
| 339 |
|
| 340 |
### **R50_TF**
|
|
|
|
| 270 |
with demo:
|
| 271 |
gr.Markdown("""
|
| 272 |
# ๐ Deepfake Detection Space
|
| 273 |
+
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!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 274 |
|
| 275 |
+
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).
|
| 276 |
+
|
| 277 |
+
### โ ๏ธ Important
|
| 278 |
+
* 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)**
|
| 279 |
+
* These models were trained on image 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.
|
| 280 |
+
* You can expect performance comparable to the results shown in [Dell'Anna et al. (2025)](https://arxiv.org/pdf/2504.20658).
|
| 281 |
+
|
|
|
|
| 282 |
โ ๏ธ Due to file size limitations, model weights need to be downloaded automatically on first use. This may take a few moments. <br>
|
| 283 |
โ ๏ธ 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.
|
| 284 |
""")
|
| 285 |
+
with gr.Accordion("๐ Understanding the Results", open=False):
|
| 286 |
+
gr.Markdown("""
|
| 287 |
+
### Individual Detectors
|
| 288 |
+
* **Prediction**: Tells if an image is **Real** or **Fake**.
|
| 289 |
+
* **Confidence**: The confidence with which the model determines if the image is real or fake.
|
| 290 |
+
* **Elapsed Time**: The time the model needed to make the prediction (excluding preprocessing or model building).
|
| 291 |
+
|
| 292 |
+
### The "ALL" Option
|
| 293 |
+
* Runs all available detectors (R50_TF, R50_nodown, CLIP-D, P2G, NPR) sequentially on the input image.
|
| 294 |
+
* Produces a **Weighted Majority Vote** verdict (Real/Fake). Each model's vote is weighted by a fixed importance score (summing to 1) based on user ranking **and its confidence score**. Only confident predictions (> 0.6) are counted.
|
| 295 |
+
* You can find the specific weights used for each model in the **"โ๏ธ Weight Details"** menu below.
|
| 296 |
+
* Also generates a **Confidence Plot** visualizing each model's score and a textual **Explanation** of the consensus.
|
| 297 |
+
* In the plot, **Green** bars indicate a **Real** prediction, while **Red** bars indicate a **Fake** prediction.
|
| 298 |
+
""")
|
| 299 |
+
|
| 300 |
|
| 301 |
with gr.Row():
|
| 302 |
with gr.Column():
|
|
|
|
| 321 |
with gr.Accordion("โ๏ธ Weight Details", open=False):
|
| 322 |
gr.Markdown(f"""
|
| 323 |
### **Detector Weights**
|
| 324 |
+
The weights are assigned according to the models' performance ranking on the **[DeepShield dataset](https://zenodo.org/records/15648378)** (**CLIP-D > R50_TF > R50_nodown > P2G > NPR**), ensuring their total sum equals 1.
|
|
|
|
| 325 |
| Detector | Weight |
|
| 326 |
| :--- | :---: |
|
| 327 |
| **CLIP-D** | {DETECTOR_WEIGHTS['CLIP-D']:.2f} |
|
|
|
|
| 334 |
with gr.Accordion("๐ Model Details", open=False):
|
| 335 |
gr.Markdown("""
|
| 336 |
### **ALL**
|
| 337 |
+
* **Description**: Runs all available detectors (R50_TF, R50_nodown, CLIP-D, P2G, NPR) sequentially on the input image. The complete code for training and testing these models on your own datasets is available in our [GitHub repository](https://github.com/truebees-ai/Image-Deepfake-Detectors-Public-Library).
|
| 338 |
* **Results**: Produces a **Majority Vote** verdict (Real/Fake) considering only confident predictions (> 0.6). Also generates a **Confidence Plot** visualizing each model's score and a textual **Explanation** of the consensus.
|
| 339 |
|
| 340 |
### **R50_TF**
|