# Identifying Synthetic Faces through GAN Inversion and Biometric Traits Analysis
###### Abstract  
In the field of image forensics, notable attention has been recently paid toward the detection of synthetic contents created through Generative Adversarial Networks (GANs), especially face images. This work explores a classification methodology inspired by the inner architecture of typical GANs, where vectors in a low-dimensional latent space are transformed by the generator into meaningful high-dimensional images. In particular, the proposed detector exploits the inversion of the GAN synthesis process: given a face image under investigation, we identify the point in the GAN latent space which more closely reconstructs it; we project the vector back into the image space, and we compare the resulting image with the actual one. Through experimental tests on widely known datasets (including FFHQ, CelebA, LFW, and Caltech), we demonstrate that real faces can be accurately discriminated from GAN-generated ones by properly capturing the facial traits through different feature representations. In particular, features based on facial landmarks fed to a Support Vector Machine consistently yield a global accuracy of above 88% for each dataset. Furthermore, we experimentally prove that the proposed detector is robust concerning routinely applied post-processing operations. Generative Adversarial Networks; image forensics; GAN inversion; face biometrics; StyleGAN2 +
Footnote †: journal: Medical Image Processing  
a hyper-realistic fake face. Harmful misuses of this technology have already been observed in the web ecosystem, including the creation of fictitious social media profiles ([[https://edition.cnn.com/2020/02/28/tech/fake-twitter-candidate-2020/index.html](https://edition.cnn.com/2020/02/28/tech/fake-twitter-candidate-2020/index.html)]([https://edition.cnn.com/2020/02/28/tech/fake-twitter-candidate-2020/index.html](https://edition.cnn.com/2020/02/28/tech/fake-twitter-candidate-2020/index.html)) (accessed on 30 December 2022)) and digital identities ([[https://www.nbcnews.com/tech/security/how-fake-persona-laid-groundwork-hunter-biden-conspiracy-deluge-n1245387](https://www.nbcnews.com/tech/security/how-fake-persona-laid-groundwork-hunter-biden-conspiracy-deluge-n1245387)]([https://www.nbcnews.com/tech/security/how-fake-persona-laid-groundwork-hunter-biden-conspiracy-deluge-n1245387](https://www.nbcnews.com/tech/security/how-fake-persona-laid-groundwork-hunter-biden-conspiracy-deluge-n1245387)) (accessed on 30 December 2022)), thus calling for specialized detection technologies. Researchers have proposed different techniques to distinguish between real and synthetic faces over the years [5; 6; 7], and great attention has been devoted over the last few years toward identifying whether an image has been generated through a GAN [8; 9; 10; 11]. Further details about the related works are provided in the next section. In this paper, we propose a novel detector for GAN-generated images based on the analysis of an image resulting from a _GAN inversion process_. In practice, given an image under investigation, we project it in the GAN latent space through an inversion process [12], and then back into the image space with a generation process. The resulting image is then compared with the actual one using different similarity metrics. We demonstrate that, as expected, when the process is applied to GAN-generated images, the two images will be extremely close to each other. In contrast, natural images will be approximated with significantly lower accuracy. Extensive experiments on images coming from different sources have shown that landmark-based metrics are particularly effective in capturing the distinctive traits of synthetic images, which can be learned using shallow classifiers such as SVMs. Furthermore, the obtained detectors are proven to be generally robust to typical post-processing, such as resizing, JPEG compression, and upload/download operations through social media.