10 Ways to Detect Deepfakes Created by Text-to-image Services and GANs

Table of Contents

Reading time: 8 min

With deepfake images getting increasingly realistic, staying ahead of detection techniques is more important than ever. In this article, we explore various clues—both intuitive and technical—that can assist in detecting deepfakes.

how to detect deepfakes

Dear friends, welcome back to our blog! Unless you live on Mars, you’ve heard a lot of hype (and noise) about deepfakes, AI-generated images, synthesized images, and so on. It’s indeed a big challenge for those who still believe in visual content as a powerful and worthy communication means.
If you follow our blog (you should!), you may have read several articles on how to detect deepfakes using Amped Authenticate filters and tools. In this article, we aim to provide a lighter overview of many possible clues that could help you spot AI-generated images, including technical and intuitive ones.

Before you continue, it’s important that you understand the difference between deepfakes created using text-to-image models and those created using Generative Adversarial Networks (GANs). Text-to-image models, also known as “diffusion models,” include tools like Dall-E, Midjourney, Stable Diffusion, and Flux. You can find a very quick introduction to the differences between them on our blog at this link.

Ready? Let’s go with the list!

1. Metadata

As simple as it is, some text-to-image services leave clear traces of their use in the image metadata. Below we show an example of the metadata found in an image created with Dall-E 3. Of course, removing metadata is as simple as re-saving the image, possibly to a different format. It is also easy to tamper with them using a hex editor or some dedicated software. Furthermore, when an image is exchanged through a social network, the relevant metadata is generally stripped away and the file container is redesigned. Therefore, it’s pretty evident that relying solely on metadata or container analysis is not a solid choice for deepfake detection. However, that doesn’t mean you shouldn’t check them!

ai generated image in amped authenticate

2. Issues with Hands and Text

You may remember that until a few months ago, it was common for AI-generated images to expose blatant artifacts in people’s hands. This was indeed a meme goldmine. Since then, diffusion models have greatly improved from this point of view, and you’ll now see consistent hands more often than not. Nevertheless, it is still common to find less obvious oddities in AI-generated hands. The example below was published on X by AISafetyMemes.  Although very compelling, it is easily identified as fake if you focus on the thumb of the subject (we used Authenticate’s Annotate tool for that).

ai generated image in amped authenticate

Similarly, diffusion models still experience a hard time when generating text on signs, billboards, license plates, etc. This is a rather effective way to reveal deepfakes as the creator himself may focus on fixing macroscopic issues and forget to check the consistency of text in the background.

ai generated image in amped authenticate

3. Position of the Eyes

Researchers found that facial images generated by Generative Adversarial Networks (GANs), e.g. those obtained from thispersondoesnotexist.com, expose some interesting geometrical properties in the position of the eyes. Specifically, the eyes tend always to be located in the same position, as if the face was built around them.

This is briefly explained with four GAN-generated images below. First, you see the four images arranged in a grid. Then, we added lines crossing the eyes, where the regular pattern is pretty obvious. Finally, we used Amped FIVE to average the four images.  As you can see, the position of the eyes is consistently the same. That alone is not enough to call the image a deepfake, but it can certainly contribute to the evaluation process.

pictures of different aged women

pictures of women

image of women

4. Inconsistencies in Shadows

Shadow analysis belongs to the so-called “physical/geometrical analysis” branch. Compared to metadata or pixel-level analysis, this branch typically requires more user intervention but offers an unmatched level of robustness.

Imagine you have a deepfake picture, you print it, and take a picture of it with a smartphone. From the container/metadata point of view, that would be a perfectly pristine image. Even most pixel-based analysis algorithms could be fooled unless you have an algorithm to detect traces of the recapturing process. However, any issues in the image’s geometrical properties will remain detectable.

As Hany Farid first pointed out in 2022, diffusion models often introduce inconsistent shadows in images. Sometimes, such inconsistencies are easily seen, e.g., an object completely missing its shadows or viceversa. For example, below we see an example of an extra human shadow! Do you believe in ghosts? 🙂

ai generated image

More often, it takes a technical analysis to reveal something is wrong. Luckily, Amped Authenticate’s Shadows filter makes analyzing shadows very easy!

Below you see an example of a deepfake image whose shadows “look” consistent to the naked eye, but they’re proven to be wrong in Authenticate. The “System Unfeasible” label means that those green wedges (each connecting a point on a shadow to a range of possible originating points) have no common intersection for the analyzed image. For a real image, instead, they would intersect in a region containing the projection of the sun on the image plane. You can find more details about the Shadows filter at this link.

shadow analysis

5. Inconsistent Reflections

Another geometrical inconsistency often found in diffusion model images is wrong reflections. Like it was for shadows, in some cases, reflections are blatantly wrong. In other cases, a technical analysis is needed to reach a convincing conclusion.

The geometrical reasoning behind shadow and reflection analysis is largely similar. Therefore, you can safely use the Shadows filter to check the reflections of an object on a flat mirror, as we did in the example below. As you can see, the outcome is an unfeasible set of constraints, meaning that reflections are wrong.

reflection analysis

6. Inconsistent Perspective

It was still Prof. Hany Farid who first revealed that many text-to-image pictures expose perspective inconsistencies. They are typically quite subtle, though! The tiles on a floor will actually converge to a common vanishing point most of the time. And the same will hold for the table sitting on that floor. But when you combine them together, you may find that they are not mutually consistent as a whole. For example, in the image below, the vanishing points defined by the two tables (green, yellow, and red squares) define a horizon line (magenta line) that is not consistent with the floor’s vanishing point (orange square).

perspective inconsistencies

If you’re allowed to upload the image you’re working on to the web, a reverse image search could reveal its provenance. It could also lead you to other pages where the image is presented or discussed.

In Amped Authenticate, this is as simple as going to Tools and selecting Search Similar Images on the Web.

tools

This will open your default browser and search for the image content on Google Lens. Since we’re mostly interested in exact matches, you should look for this link and click it.

google lens

This will show a list of sources where the image was found. Opening links can be dangerous and should be done in a safe environment. Also, reading through external sources could be a source of bias, so be mindful of this. For example, you could first run your other analyses and leave this one as the last.

matches

8. Artifacts in the Fourier Domain

This one is more technical, but insightful. Some AI-generated images expose weird artifacts in the full-frame Fourier transform. You can easily inspect it with Amped Authenticate’s Fourier filter.

If you’re not familiar with this concept, this is the Fourier transform of a “standard” real image, where low frequencies are brought to the center (bright spike).

histogram equalization

For some AI-generated images, you may spot strong artifacts like these:

fourier filter

It must be said that not all deepfake images expose these artifacts. For example, this image included in Authenticate’s samples folder does not show them:

fourier filter

Moreover, there could be several reasons leading to artifacts in the Fourier transform. Therefore, you can’t just call an image a deepfake based on this.

All of that being said, strong artifacts like those seen above could be the product of a neural network and are certainly a valid reason to run more checks over the image.

9. Authenticate’s Face GAN Deepfake filter

You may encounter deepfake images that do not expose any of the clues presented above. If you’re still in doubt as to whether you’re looking at a deepfake, you should try the two filters in Amped Authenticate’s Deepfake Detection category.

The Face GAN Deepfake specifically targets faces generated with GANs. This filter works by first detecting faces in the image, and then using a deep neural network to classify each face as being GAN-generated or not. For example, using it on the montage of the images previously downloaded from thispersondoesnotexist.com yields the following results:

detect deepfakes filter

While it’s reassuring to know that my colleagues Blake and Cortney are not deepfakes 😉

detect deepfakes filter

It’s important to remark that if an image is classified as “Not GAN”, that doesn’t mean it’s authentic. Perhaps it was altered with Photoshop or created using a different deepfake method.

You can find more details about the Face GAN Deepfake filter in this dedicated article.

10. Authenticate’s Diffusion Model Deepfake filter

This is another AI-powered filter in Authenticate’s Deepfake Detection category.  It focuses on detecting images generated using some common off-the-shelf diffusion models: Dall-E, Midjourney, and Stable Diffusion (the list will grow!).

The filter analyzes the image as a whole based on a recently published scientific work. The main idea of this research is to extract the so-called CLIP features from the image and use machine learning to classify them. This process determines whether they belong to a diffusion deepfake image or not. The output is provided in tabular form, as in the example below.

diffusion model deepfake filter

You can find more details about how the filter works and its limitations in this dedicated article.

Conclusion

Deepfakes are harming the credibility of images and videos like never before. Fake images have indeed existed since the beginning of photography. However, until nowadays, the world has hardly seen politicians publishing fake images intentionally as part of their campaigns, fake videos being spread daily to generate war misinformation, and so on.

Therefore, staying on top of deepfake detection is very important for everyone dealing with investigations, intelligence, and information. Amped Software is here to help you with knowledge and tools. Follow our blog and get in touch with us if you’re interested in what we do!

Table of Contents

Share on

Subscribe to our Blog

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Subscribe to our Blog

Related posts