gan-police / frequency-forensics

Deepfake detection using wavelet-packets in PyTorch, European Conference on Machine Learning (ECML PKDD) 2022.
Other
47 stars 9 forks source link

Complete code? #21

Closed surya-venkatesan closed 2 years ago

surya-venkatesan commented 2 years ago

Is this a complete code of deepfake image detection using wavelet packets

v0lta commented 2 years ago

Yes, you can see for yourself! To reproduce the FFHQ-style-gan pair: Download the zipped data from https://drive.google.com/file/d/1MOHKuEVqURfCKAN9dwp1o2tuR19OTQCF/view?usp=sharing . You can follow the data perperation steps and train your own classifier. To do so extract the zip file into a data folder and run:

$ python -m freqdect.prepare_dataset ./data/source_data/ --log-packets 
$ python -m freqdect.prepare_dataset ./data/source_data/

the prepare the data. Once the preparation has finished train a classifier using:

$ python -m freqdect.train_classifier \
    --data-prefix ./data/source_data_log_packets_haar_reflect_3 \
    --calc-normalization \
    --features packets

You should end up with a log folder containing the classifier and intermediated loss logs.

NarendranM08 commented 2 years ago

Will it indicate that the input image is real or fake or it just makes an analysis

v0lta commented 2 years ago

It will indicate if the image is real or fake, based on the wavelet packet coefficients. In the paper we have measured the performance on standard scientific data-sets and found promising performance However, the code is not production-ready. Two goals of this repository are to prove that deepfake identification based on wavelet packets is possible and that the packet representation has advantages compared to the pixel form.

NarendranM08 commented 2 years ago

May I know what type of architecture are used in it

v0lta commented 2 years ago

Sure, you can read the description in the paper or look at the code ( https://github.com/gan-police/frequency-forensics/blob/main/src/freqdect/models.py ).

NarendranM08 commented 2 years ago

what type of cnn model is used ? is it Resnext 50?