Detecting AI-generated faces

AI can now generate very realistic human faces. Nefarious actors can use these for fake personas (examples: document attributed to a "Martin Aspen" with AI-generated face, or Facebook accounts with AI-generated faces masquerading as Americans) rather than relying on reverse-searchable stock images or random real people.

1604185413820.png
(image source: https://arxiv.org/pdf/1912.04958.pdf)

Faces generated with Nvidia's StyleGAN (v1, v2) are available conveniently through thispersondoesnotexist.com. The convenience and quality mean that almost every AI-generated face you currently see will be from StyleGAN. Below are tips for spotting StyleGAN faces.

Eye/mouth positioning
1604191876986.png1604191929467.png1604191975744.png
StyleGAN is trained on the Flickr-Faces-HQ dataset, containing 1024x1024 images of faces that have all been aligned in the same way. If the generated image is uncropped, the face should roughly match this template:
ffhq_template.png

Inconsistent background
1604187172148.png1604187179458.png1604187439813.png1604188054254.png
StyleGAN has trouble keeping backgrounds continuous between the left and right side of the image. Sometimes the background is at an angle when the subject isn't, or makes no discernible sense.

Asymmetric clothing
1604188997080.png1604189030430.png1604189107423.png
The clothing on one shoulder often doesn't match the other - check the collars.

Ringing artifacts
1604188622854.png1604189731727.png1604189761879.png1604190355124.png
The GAN equivalent of JPEG artifacts. Most easily noticeable on images that haven't been downscaled.

Earlobes
1604192258000.png1604192308416.png1604192483092.png1604192646124.png
Common place for artifacts, asymmetry, and strange earrings.

Nonsense writing
1604189996388.png1604190017542.png
In places where you'd expect to see writing (usually a hat) there are odd symbols.

The "obvious fails"
Less useful since these images are unlikely to be picked for fake personas, and you'd already easily spot them, but sometimes the GAN mistakes microphones for beards, merges glasses with hair, creates an extra distorted face on the side of the image, or otherwise messes up. Some examples below:
1604190133309.png 1604190272450.png1604190502722.png
1604190292266.png 1604190242299.png 1604190321928.png



What about automated detection?
Current most promising method involves making the same generator network recreate a given image and seeing how close it can get - but seems to require technical knowledge and computing power. Looking into this more and may update this post.

For usability, I was able to find the below online tools. Can't completely vouch for them, but they gave reasonable results to the images I fed them:
View attachment 41948
https://gan-detector-mayachitra.azurewebsites.net/
https://medifor-webapp-mayachitra.azurewebsites.net/


And another useful site, if you're now wanting to test your ability to distinguish real from generated:
https://www.whichfaceisreal.com/index.php
 
Last edited:

Related Articles

Top