forensics.media Subscribe

GAN detector · image

Was this image made by a GAN?

GAN image generators build a picture by repeatedly upsampling, and that leaves a regular grid of faint repeating peaks in the image's frequency spectrum, invisible to the eye but clear in a Fourier transform. This reads that spectrum and looks for the grid. Read it as a lead, not proof.

Runs entirely in your browser. Your image is never uploaded or stored.

This teaches one basic forensic signal, read in isolation. It is a lead, not a verdict, and can be fooled on its own — real confidence comes from combining several independent signals and understanding the relationship between them.

What the spectrum shows

A photograph's frequency spectrum is smooth: a bright centre that fades evenly outward, because natural light and lenses spread energy continuously across frequencies. A GAN builds its image by upsampling a small grid again and again, and each step stamps a faint, perfectly periodic pattern into the result. In the Fourier spectrum that pattern appears as a regular lattice of bright dots away from the centre, spaced by the upsampling factor. Frank and colleagues (2020) showed this grid is a reliable artifact of the transposed-convolution layers common to GAN architectures, and Durall and colleagues (2020) traced it to the same upsampling step. The tool rings the strongest off-centre peaks it finds.

How to read the result

Several strong, regularly-placed peaks in a symmetric arrangement are the signature worth chasing, the more regular the lattice, the stronger the lead. A clean, smooth spectrum with no off-axis peaks is what a normal photo looks like. Beware the bright cross through the centre and along the axes: that comes from the image edges and from JPEG's own block grid, not from a generator, so the tool ignores it. Because the check is spectral, it reports what the frequencies look like, never a certainty about the source.

Where it fails

This artifact is fragile. Re-saving as JPEG, resizing, cropping or a screenshot blurs or destroys the grid, so a clean result on a shared or re-encoded image proves nothing. It is tuned to the upsampling GANs use and does not target diffusion models, which leave a different, subtler trace, checked by the diffusion image detector. And newer architectures deliberately suppress the grid. Treat a positive as a reason to look closer with a purpose-built detector, and a negative as far from a clean bill of health.

Sources

  • Frank, Eisenhofer, Schönherr, Fischer, Kolossa, Holz (2020). Leveraging Frequency Analysis for Deep Fake Image Recognition. ICML 2020. arXiv:2003.08685.
  • Durall, Keuper, Keuper (2020). Watch your Up-Convolution: CNN Based Generative Deep Neural Networks are Failing to Reproduce Spectral Distributions. CVPR 2020. arXiv:1911.06465.