RUB-SysSec / GANDCTAnalysis

Code for the ICML 2020 paper: Leveraging Frequency Analysis for Deep Fake Image Recognition.
MIT License
176 stars 24 forks source link

Is there any way to get the pictures produced by StyleGAN? #5

Closed jiangxuefeng123 closed 3 years ago

jiangxuefeng123 commented 3 years ago

hi! I am a student trying to reproduce your experiments, but I find the pictures used in experiment 4.2(Different Upsampling Techniques) and 4.3 (Source Identification) are not provided. I just want to know is there any way to get them directly? thank you~

Joool commented 3 years ago

Hi,

You would need to train multiple StyleGAN models with the different upsampling techniques (https://github.com/NVlabs/stylegan). Then sample a data set and use the compute_statistics.pyscript. To recreate Figure 4, you can use the script extract_weights.pyon a trained LASSO classifier.

Hope this helps!

jiangxuefeng123 commented 3 years ago

Thank you!! But now I meet another problem on reproducing the mean DCT spectrum of the FFHQ data set generated by styleGAN(Figure 1 in the essay), but actually I can use your pre-trained classifier to classify them which is very confusing. I used compute_statistics.py and get fake pictures from the repository of styleGAN. I just want to ask will the psi of styleGan affects the results? There are pictures of three different psi(0.5 0.7 1) generated by styleGan. Thank you again~

Joool commented 3 years ago

Our data set was generated from https://www.whichfaceisreal.com/, I'm unsure which settings they used. In general the psi parameter controls the truncation of the latent space, thus, I would expect that the classifier should still work for different psi settings. However, since a more truncated latent space results in less output variety (i.e., images tend to be similar) the artifacts might show up more, depending on the setting.

Joool commented 3 years ago

Closing this due to inactivity.

zzzucf commented 1 year ago

Hi,

You would need to train multiple StyleGAN models with the different upsampling techniques (https://github.com/NVlabs/stylegan). Then sample a data set and use the compute_statistics.pyscript. To recreate Figure 4, you can use the script extract_weights.pyon a trained LASSO classifier.

Hope this helps!

Does it mean the Figure 1 in the paper is generated by modifying the original upsampling?

Joool commented 1 year ago

No. Figure 1 is generated using the original (tensorflow) version of StyleGAN (1). Figure 3 modifies the upsampling techniques.