Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aimagelab/code
[ECCV'24] Contrasting Deepfakes Diffusion via Contrastive Learning and Global-Local Similarities
https://github.com/aimagelab/code
deepfake-detection global-local
Last synced: 14 days ago
JSON representation
[ECCV'24] Contrasting Deepfakes Diffusion via Contrastive Learning and Global-Local Similarities
- Host: GitHub
- URL: https://github.com/aimagelab/code
- Owner: aimagelab
- License: mit
- Created: 2024-07-04T12:52:50.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-12-12T10:14:26.000Z (29 days ago)
- Last Synced: 2024-12-12T11:23:46.577Z (29 days ago)
- Topics: deepfake-detection, global-local
- Language: Python
- Homepage:
- Size: 11.1 MB
- Stars: 28
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
CoDE (Contrastive Deepfake Embeddings)
Contrasting Deepfakes Diffusion via Contrastive Learning and Global-Local Similarities
(ECCV 2024)
## Table of Contents
1. [Training Dataset](#training-dataset)
2. [Citation](#citation)## Training Dataset
[🎯 Project web page](https://aimagelab.github.io/CoDE/) |
[Paper](https://arxiv.org/pdf/2407.20337) |
[Dataset web page](https://aimagelab.ing.unimore.it/imagelab/page.asp?IdPage=57) |
[D3 Test Set](https://ailb-web.ing.unimore.it/publicfiles/drive/elsa_dataset/d3_test.tar) |
[🤗 HuggingFace Dataset](https://huggingface.co/datasets/elsaEU/ELSA_D3) |
[🤗 HuggingFace Model](https://huggingface.co/aimagelab/CoDE) |The Diffusion-generated Deepfake Detection (D3) Dataset is a comprehensive collection designed for large-scale deepfake detection. It includes 9.2 million generated images, created using four state-of-the-art diffusion model generators. Each image is generated based on realistic textual descriptions from the LAION-400M dataset.
- **Images**: 11.5 million images
- **Records**: 2.3 million records
- **Generators**: Stable Diffusion 1.4, Stable Diffusion 2.1, Stable Diffusion XL, and DeepFloyd IF
- **Aspect Ratios**: 256x256, 512x512, 640x480, 640x360
- **Encodings**: BMP, GIF, JPEG, TIFF, PNGThe D3 dataset is part of the European Lighthouse on Secure and Safe AI (ELSA) project, which aims to develop effective solutions for detecting and mitigating the spread of deepfake images in multimedia content.
To try D3 you can access it using
```python
from datasets import load_dataset
elsa_data = load_dataset("elsaEU/ELSA_D3", split="train", streaming=True)
```
The test set of D3 is available at this link [D3 Test Set](https://ailb-web.ing.unimore.it/publicfiles/drive/elsa_dataset/d3_test.tar)## Inference
Install the requirements by
```bash
pip install requirements.txt
```After downloading the test set of D3, you can use the following code to load the dataset and run the inference on the CoDE model.
Substitute the path of the directories in ```dataset_path_d3.py```
```python
cd CoDE_model
python validate_d3.py --classificator_type "linear"
# options for classificator_type are ["linear", "knn", "svm"]
```
## CitationPlease cite with the following BibTeX:
```
@inproceedings{baraldi2024contrastive,
title={{Contrasting Deepfakes Diffusion via Contrastive Learning and Global-Local Similarities}},
author={Baraldi, Lorenzo and Cocchi, Federico and Cornia, Marcella and Baraldi, Lorenzo and Nicolosi, Alessandro and Cucchiara, Rita},
booktitle={Proceedings of the European Conference on Computer Vision},
year={2024}
}
```