Skip to content

chuangchuangtan/NPR-DeepfakeDetection

Repository files navigation

Rethinking the Up-Sampling Operations in CNN-based Generative Network for Generalizable Deepfake Detection


Beijing Jiaotong University, YanShan University, A*Star

overall pipeline

Reference github repository for the paper Rethinking the Up-Sampling Operations in CNN-based Generative Network for Generalizable Deepfake Detection.

@misc{tan2023rethinking,
      title={Rethinking the Up-Sampling Operations in CNN-based Generative Network for Generalizable Deepfake Detection}, 
      author={Chuangchuang Tan and Huan Liu and Yao Zhao and Shikui Wei and Guanghua Gu and Ping Liu and Yunchao Wei},
      year={2023},
      eprint={2312.10461},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

News 🆕

  • 2024/02: NPR is accepted by CVPR 2024! Congratulations and thanks to my all co-authors!

Environment setup

Classification environment: We recommend installing the required packages by running the command:

pip install -r requirements.txt

Getting the data

Download dataset from CNNDetection CVPR2020, UniversalFakeDetect CVPR2023 (googledrive), DIRE 2023CVPR (googledrive), GANGen-Detection (googledrive), Diffusion1kStep googledrive.

pip install gdown==4.7.1

chmod 777 ./download_dataset.sh

./download_dataset.sh

Training the model

CUDA_VISIBLE_DEVICES=0 python train.py --name 4class-resnet-car-cat-chair-horse --dataroot {CNNDetection-Path} --classes car,cat,chair,horse --batch_size 32 --delr_freq 10 --lr 0.0002 --niter 50

Testing the detector

Modify the dataroot in test.py.

CUDA_VISIBLE_DEVICES=0 python test.py --model_path ./NPR.pth  -batch_size {BS}

Acknowledgments

This repository borrows partially from the CNNDetection.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published