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

Final output #24

Closed NarendranM08 closed 2 years ago

NarendranM08 commented 2 years ago

Can you share the screenshot of final output where the images are labeled as fake or real

v0lta commented 2 years ago

Are you asking for a front-end? The code in this repository allows training and executing a backend. But is mainly intended to back up the results we report in the paper. We do not provide a frontend here, but it could of course be built using Django for example.

NarendranM08 commented 2 years ago

No , like labelling from the dataset that the images are real or fake

v0lta commented 2 years ago

The label is assigned based on the file path in https://github.com/gan-police/frequency-forensics/blob/c7e12968b14e0f609ab7e5d6df7d4090c85819f3/src/freqdect/prepare_dataset.py#L80 . For this approach to work, we require a specific file path setup. I.e for example: source_data ├── A_original ├── B_CramerGAN ├── C_MMDGAN ├── D_ProGAN └── E_SNGAN

NarendranM08 commented 2 years ago

Should we label the folder by ourselves or running the project code

v0lta commented 2 years ago

This has to happen by hand. For the code to work the folders must be arranged properly. A zipped example folder is available at: https://drive.google.com/file/d/1MOHKuEVqURfCKAN9dwp1o2tuR19OTQCF/view?usp=sharing

NarendranM08 commented 2 years ago

So from the drive that A_ffhq, b_Stylegan we make into five directories source_data ├── A_original ├── B_CramerGAN ├── C_MMDGAN ├── D_ProGAN └── E_SNGAN

v0lta commented 2 years ago

No, FFHQ means Flickr Face High Quality and StyleGAN is a GAN, see section 5.1 of the paper for more information. That means the downloaded archive has images from two sources and works as-is. The file structure with five sources (A,B,C,D,E) is what we used in section 5.2 in the paper.

NarendranM08 commented 2 years ago

So based on folder labels it presents that the image is real or fake

v0lta commented 2 years ago

Only the training data preprocessing pipeline is set up using folder labels. Once a classifier is trained the folder structure is no longer relevant. Feel free to play with the pre-trained network from https://github.com/gan-police/frequency-forensics/issues/22 . For in-depth information regarding the underlying identification mechanism please read the paper.

NarendranM08 commented 2 years ago

Is the wavelet-packet creation done in fourier_math.py

v0lta commented 2 years ago

No, the packets are created in https://github.com/gan-police/frequency-forensics/blob/main/src/freqdect/wavelet_math.py .