Skip to content

ryantd/SyntheticImagesAnalysis

 
 

Repository files navigation

Intriguing properties of synthetic images: from generative adversarial networks to diffusion models

Github arXiv CVF GRIP

Preview

Code

Official implementation of the paper: "Intriguing properties of synthetic images: from generative adversarial networks to diffusion models".

We provide a script to generate the images showing the power spectra and the autocorrelation of the fingerprint. In order to launch the code, please download the denoiser's weight from the following link. Once extracted there should be a folder called DenoiserWeight. Please do not move or rename this folder.

To launch the script the following parameters should be provided.

python generate_images.py --files_path /path/to/the/folder/with/the/synthetic/images --out_dir /path/to/folder/to/save/generated/images --out_code name_of_subfolder

The following command is an example of how to launch the script on images of the test set of the repository present at this link.

python generate_images.py --files_path ./TestSet/stable_diffusion_256 --out_dir ./output --out_code stable_diffusion

In this case, after launching the script a folder called output will be created. In it, there will be a folder named stable_diffusion containing two images, one of the power spectra and one of the autocorrelation.

We provide also a script to generate images showing the radial spectra and the angular spectra of the desired images.

To script should be launched as follows.

python generate_spectra.py --files_path /path/to/the/folder/with/the/synthetic/images --out_dir /path/to/folder/to/save/generated/images --out_code name_of_subfolder

The following is an example on how to run this script on images of the dataset used previously.

python generate_spectra.py --files_path ./TestSet/stable_diffusion_256 --out_dir ./output --out_code stable_diffusion

In this case, after launching the script a folder called output will be created, if necessary. In it, there will be a folder named stable_diffusion containing two images, one of the radial spectra and one of the angular spectra.

Requirements

Pytorch Matplotlib tqdm Pillow numpy

Overview

Detecting fake images is becoming a major goal of computer vision. This need is becoming more and more pressing with the continuous improvement of synthesis methods based on Generative Adversarial Networks (GAN), and even more with the appearance of powerful methods based on Diffusion Models (DM). Towards this end, it is important to gain insight into which image features better discriminate fake images from real ones. In this paper we report on our systematic study of a large number of image generators of different families, aimed at discovering the most forensically relevant characteristics of real and generated images. Our experiments provide a number of interesting observations and shed light on some intriguing properties of synthetic images: (1) not only GANs architectures give rise to artifacts visible in the Fourier domain, but also DMs and VQ-GANs (Vector Quantized Generative Adversarial Networks) present irregular patterns; (2) when the dataset used to train the model lacks sufficient variety, its biases can be transferred to the generated images; (3) synthetic and real images differ statistically in the mid-high frequency signal content, observable in their radial and angular spectral energy distribution.

License

The license of the code can be found in the LICENSE.md file.

Bibtex

@InProceedings{Corvi_2023_CVPR,
    author    = {Corvi, Riccardo and Cozzolino, Davide and Poggi, Giovanni and Nagano, Koki and Verdoliva, Luisa},
    title     = {Intriguing Properties of Synthetic Images: From Generative Adversarial Networks to Diffusion Models},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops},
    month     = {June},
    year      = {2023},
    pages     = {973-982}
}

About

Synthetic Images Analysis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%