Skip to content

Code for IJCV 2025 paper "Rethinking open-world deepfake attribution with multi-perspective sensory learning" and ICCV 2023 paper "Contrastive Pseudo Learning for Open-World DeepFake Attribution"

License

Notifications You must be signed in to change notification settings

TencentYoutuResearch/OpenWorld-DeepFakeAttribution

Repository files navigation

Open-World DeepFake Attribution

This repository is official implementation for Contrastive Pseudo Learning for Open-World DeepFake Attribution, ICCV 2023 and Rethinking Open-World DeepFake Attribution with Multi-perspective Sensory Learning, IJCV 2025

arXiv Paper python pytorch lightning

Overview

The challenge in sourcing attribution for forgery faces has gained widespread attention due to the rapid development of generative techniques. While many recent works have taken essential steps on GAN-generated faces, more threatening attacks related to identity swapping or diffusion models are still overlooked. And the forgery traces hidden in unknown attacks from the open-world unlabeled faces remain under-explored. To push the related frontier research, we introduce a novel task named Open-World DeepFake Attribution, and the corresponding benchmark OW-DFA and OW-DFA++, which aims to evaluate attribution performance against various types of fake faces in open-world scenarios.

Dataset

  • Prepare Deepfake Detection datasets

    Dataset Paper Link
    FaceForensics++ FaceForensics++: Learning to Detect Manipulated Facial Images Paper Code
    Celeb-DF Celeb-DF: A Large-scale Challenging Dataset for DeepFake Forensics Paper Code
    ForgeryNet ForgeryNet: A Versatile Benchmark for Comprehensive Forgery Analysis Paper Home
    DFFD On the Detection of Digital Face Manipulation Paper Home
    ForgeryNIR ForgeryNIR: Deep Face Forgery and Detection in Near-Infrared Scenario Paper Code
    DF^3 GLFF: Global and Local Feature Fusion for AI-synthesized Image Detection Paper Code
  • Download dataset and unzip data under the directory of /Datasets/deepfakes_detection_datasets/

  • Process dataset with script scripts/preprocess/create_academic_meta.ipynb, and you will get the following structure:

    data/release
    ├── AttributeManipulation
    │   ├── FaceAPP
    │   │   └── DFFD
    │   ├── MaskGAN
    │   │   └── ForgeryNet
    │   ├── SC-FEGAN
    │   │   └── ForgeryNet
    │   ├── StarGAN
    │   │   └── DFFD
    │   └── StarGAN2
    │       └── ForgeryNet
    ├── EntireFaceSyncthesis
    │   ├── CycleGAN
    │   │   └── ForgeryNIR
    │   ├── PGGAN
    │   │   └── DFFD
    │   ├── StyleGAN
    │   │   └── DFFD
    │   └── StyleGAN2
    │       ├── ForgeryNet
    │       └── ForgeryNIR
    ├── ExpressionTransfer
    │   ├── ATVG-Net
    │   │   └── ForgeryNet
    │   ├── Face2Face
    │   │   └── faceforensics
    │   ├── FOMM
    │   │   └── ForgeryNet
    │   ├── NeuralTextures
    │   │   └── faceforensics
    │   └── Talking-Head-Video
    │       └── ForgeryNet
    ├── IdentitySwap
    │   ├── DeepFaceLab
    │   │   └── ForgeryNet
    │   ├── Deepfakes
    │   │   └── faceforensics
    │   ├── FaceShifter
    │   │   └── ForgeryNet
    │   ├── FaceSwap
    │   │   └── faceforensics
    │   └── FSGAN
    │       └── ForgeryNet
    ├── RealFace
    │   └── Real
    │       ├── CelebDF
    │       └── faceforensics
    ├── meta_data
    │   ├── Protocol1_openset_fake_large_merge_meta.csv
    │   ├── Protocol1_openset_fake_val_merge_meta.csv
    │   ├── Protocol2_openset_real_fake_large_merge_meta.csv
    │   └── Protocol2_openset_real_fake_val_merge_meta.csv
    └── shape_predictor_68_face_landmarks.dat

Method

CPL

CPL

MPSL

MPSL

Quick Start

Step1. Create a conda environment and activate it.

conda create --name owdfa python=3.9 -y
conda activate owdfa

Step2. Install the required python libraries.

cd OW-DFA
pip3 install -r requirements.txt
wandb offline

Step3. Train MPSL model on OW-DFA dataset. (IJCV 2025)

python3 -u -m torch.distributed.launch --nproc_per_node=1 --master_port 12345 \
  train.py -c configs/train_mpsl.yaml

OR Train CPL model on OW-DFA dataset. (ICCV 2023)

python3 -u -m torch.distributed.launch --nproc_per_node=1 --master_port 12345 \
  train.py -c configs/train_cpl.yaml

Citation

If you find this project useful in your research, please consider cite:

@inproceedings{sun2023contrastive,
  title={Contrastive pseudo learning for open-world deepfake attribution},
  author={Sun, Zhimin and Chen, Shen and Yao, Taiping and Yin, Bangjie and Yi, Ran and Ding, Shouhong and Ma, Lizhuang},
  booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision},
  pages={20882--20892},
  year={2023}
}

@article{sun2025rethinking,
  title={Rethinking open-world deepfake attribution with multi-perspective sensory learning},
  author={Sun, Zhimin and Chen, Shen and Yao, Taiping and Yi, Ran and Ding, Shouhong and Ma, Lizhuang},
  journal={International Journal of Computer Vision},
  volume={133},
  number={2},
  pages={628--651},
  year={2025},
  publisher={Springer}
}

About

Code for IJCV 2025 paper "Rethinking open-world deepfake attribution with multi-perspective sensory learning" and ICCV 2023 paper "Contrastive Pseudo Learning for Open-World DeepFake Attribution"

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •