Giter VIP home page Giter VIP logo

hfc-mffd's Introduction

HFC-MFFD

These files contain source codes we use in our paper for testing the forgery classification evaluation accuracy on the ForgeryNIR dataset. Considering that preprocessing might take a certain time, we provide feature extracted from these images by our trained feature extraction models, and provide ForgeryClassifier to obtain testing accuracy.

We also provide models trained on the wildDeepfake dataset.

Dependencies

  • Anaconda3 (Python3.9, with Numpy etc.)
  • Pytorch 1.12.0

Datasets

ForgeryNIR Dataset contains 240,000 forgery NIR images:

  • images generated via 4 different GAN techniques.
  • images added different number of perturbation.
  • images generated by different epoch models of the same GAN.

Download dataset

Dataset Name Download Images
ForgeryNIR ForgeryNIR 240,000

Usage

Edit configuration

Before running these codes, you'd better check config.py in the folder named wildDeepfake and edit them to suit your situation.

Train models

torchrun --nproc_per_node={the num of the GPUs} train.py

Evaluation of the ForgeryNIR dataset

Download feature and trained models obtained from the ForgeryNIR dataset for evaluation

Feature and Model Download
HFC-MFFD BaiduNetDisk(ia97)

After downloading the feature and trained models, the feature should be put to ./ForgeryNIR/feature, and the models should be put to ./ForgeryNIR/model. Otherwise, you should change the default path we declare in config.py from the folder named ForgeryNIR.

Test the model

python -m simple_test --train_dir std_multi --test_dir mix_multi

Evaluation of the wildDeepfake dataset

Before running these codes, you should install torch-dct which can perform DCT transform on tensors.

pip install torch-dct

Download trained models obtained from the wildDeepfake dataset for evaluation

Model Download
HFC-MFFD BaiduNetDisk(tj6r)

After downloading the trained models, the models should be put to ./WildDeepFake/model. Otherwise, you should change the default path we declare in get_result_test.py.

Test the model

torchrun --nproc_per_node={the num of the GPUs} get_result_test.py

Save the result

torchrun --nproc_per_node=1 get_score_save.py

BibTeX

@article{liu2022hierarchical,
  title={Hierarchical Forgery Classifier On Multi-modality Face Forgery Clues},
  author={Liu, Decheng and Zheng, Zeyang and Peng, Chunlei and Wang, Yukai and Wang, Nannan and Gao, Xinbo},
  journal={arXiv preprint arXiv:2212.14629},
  year={2022}
}

hfc-mffd's People

Contributors

edwhites avatar leoliu37 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.