steffen-jung / SpectralGAN

Code accompanying the AAAI 2021 paper "Spectral Distribution Aware Image Generation".
23 stars 1 forks source link

Could you provide the pre-trained models? #2

Open njuaplusplus opened 3 years ago

njuaplusplus commented 3 years ago

Hi Steffen,

Thank you for your AAAI paper and this repo. I wonder if you could provide the pre-trained models for easier reproduction of your results in the paper.

Best, Shengwei

njuaplusplus commented 3 years ago

Hi Steffen,

Because no pre-trained models are provided, I trained a model based on the official FFHQ 128x128 dataset using the command in your README. However, I couldn't reproduce the results reported in your paper against the detector proposed by Wang et al.

I selected 1k real images from the FFHQ dataset and 1k fake images generated by my trained generator. I tested using the official Wang's pre-trained model using the following command line:

python3 demo_dir.py -d my_test_data_spectralgan_dcgan_ffhq128 -m weights/blur_jpg_prob0.5.pth

The computed AP is about 96.52, which is very high and means the fake images can be detected by setting the right threshold. Since your paper reported Accuracy instead of AP as Wang et al. I wonder what threshold you used.

I really appreciate it if you could help me figure out whether I made some mistakes and reproduce your results.

Thank you very much.

Best, Shengwei

steffen-jung commented 3 years ago

Hi Shengwei,

for 128x128 images and DCGAN we report an accuracy of ~80%. An AP of 96% in this setting seems appropriate and corresponds to the CycleGAN measurements given by Wang et al. (see their GitHub repo). Our discriminator contributes by improving the spectral fidelity of generated images, and to demonstrate this we show that the detection accuracy of spectral-based detectors decreases. However, the detector by Wang et al. is trained to detect generated images in the spatial domain. While for some resolutions/networks their detection accuracy also decreases using SpectralGAN, this is only marginally the case for 128x128 images generated by DCGAN. I hope this helps, let me know in case of any further questions.

Cheers, Steffen

njuaplusplus commented 3 years ago

Hi Steffen,

Thank you very much for your reply.

I have two questions:

  1. an AP of 96% means we can detect the fake images well, like an ACC of 90+% which is higher than 80%.

  2. the images generated by the trained GAN (using the command in README) seem problematic: they are much worse than Figure 13. More grayish and blurry. Maybe the training has some problems. image image image

Best, Shengwei

steffen-jung commented 3 years ago

Hi Shengwei,

it looks like the number range of the images is not correct. Please use the following snipped before saving images to disk:

fake = fake.clamp(min=0, max=1)

and pass the corresponding value range [0,1] to your save function.

Cheers, Steffen