DEV Community

Cover image for How AI Image Detection Works: Artifacts, Frequency Analysis and C2PA

How AI Image Detection Works: Artifacts, Frequency Analysis and C2PA

"Is this image real?" used to be a question for photo editors. Now it's a question for every platform that accepts uploads, from marketplaces and dating apps to newsrooms and KYC flows.

In this post we'll look at how AI image detection works in practice: the pixel and frequency artifacts that classifiers learn, the provenance metadata standards like C2PA, and invisible watermarks like Google's SynthID. We'll also run two small experiments you can try on your own machine.

Three ways to answer "was this made by AI?"

Approach What it looks at Strength Weakness
Artifact detection The pixels themselves Works on any image Probabilistic; can be fooled by resizing, compression and new models
Provenance metadata (C2PA) Signed "Content Credentials" attached to the file Strong, cryptographically signed evidence when present Easily lost by screenshots and re-encoding
Watermarks (e.g. SynthID) An invisible signal embedded at generation time Survives some editing Only works for models that add it, and needs the vendor's detector

Real-world systems combine all three.

1. Artifact detection: what classifiers learn

Image generators like diffusion models build pictures in ways that leave statistical traces:

  • Frequency-domain patterns. Upsampling layers in generators can leave periodic, grid-like signals that are hard to see but show up clearly in a Fourier transform.
  • Noise inconsistencies. Camera photos carry sensor noise that's consistent across the frame. Generated images often have noise that's too smooth or inconsistent between regions.
  • Semantic slips. Hands, text inside images, reflections, jewellery, earrings that don't match, and shadows pointing in different directions.

Modern detectors are usually deep classifiers (CNNs or vision transformers) trained on large sets of real and generated images. They learn these cues automatically rather than relying on hand-written rules.

Experiment: look at an image's frequency spectrum

This won't detect AI on its own, but it shows the kind of signal detectors use. You need numpy, pillow and matplotlib.

# pip install numpy pillow matplotlib
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt

def log_spectrum(path: str) -> np.ndarray:
    img = np.asarray(Image.open(path).convert("L"), dtype=np.float32)
    f = np.fft.fftshift(np.fft.fft2(img))
    return np.log1p(np.abs(f))

def radial_profile(spec: np.ndarray) -> np.ndarray:
    h, w = spec.shape
    y, x = np.indices(spec.shape)
    r = np.hypot(x - w // 2, y - h // 2).astype(int)
    totals = np.bincount(r.ravel(), spec.ravel())
    counts = np.bincount(r.ravel())
    return totals / np.maximum(counts, 1)

for path in ["real_photo.jpg", "generated.png"]:
    spec = log_spectrum(path)
    plt.figure()
    plt.title(path)
    plt.imshow(spec, cmap="gray")
    plt.figure(99)
    plt.plot(radial_profile(spec), label=path)

plt.figure(99)
plt.xlabel("Frequency (radius)")
plt.ylabel("Log magnitude")
plt.legend()
plt.show()
Enter fullscreen mode Exit fullscreen mode

Compare a photo from your phone with an AI-generated image. You'll sometimes see bright dots or grid patterns in the generated image's spectrum, or a different fall-off curve at high frequencies. You'll also see how much JPEG compression and resizing muddy the picture, which is why production detectors need a lot more than one hand-made feature.

2. Provenance: C2PA Content Credentials

The C2PA standard (Coalition for Content Provenance and Authenticity) lets cameras, editing apps and AI generators attach a cryptographically signed manifest to a file. It records who or what created the image and what edits were made.

Adoption has picked up a lot in 2026. At Google I/O in May 2026, Google said C2PA verification and SynthID detection are coming to Search and Chrome, and OpenAI announced it would add SynthID watermarks to its images alongside existing C2PA credentials.

Experiment: read Content Credentials from a file

The open-source c2patool from the Content Authenticity Initiative can print a file's manifest:

# Install (requires Rust's cargo), or download a release binary from GitHub
cargo install c2patool

# Print the C2PA manifest, if the file has one
c2patool some_image.jpg
Enter fullscreen mode Exit fullscreen mode

If the file carries credentials, you'll get JSON describing the claim generator, signature and actions such as "created by an AI model" or "edited". If it doesn't, the tool reports that no manifest was found.

Key rule for developers: a missing manifest proves nothing. Screenshots, re-uploads and many social platforms strip metadata. Treat "no credentials" as inconclusive, not as "real" or "fake".

3. Watermarks: SynthID and friends

Watermarking works differently: the generator embeds an invisible signal into the pixels (or audio, or text) at creation time. Google DeepMind's SynthID is the best-known example. Google DeepMind reported in May 2026 that more than 100 billion images, videos and audio files have been watermarked with it.

Limitations to keep in mind:

  • A watermark only exists if the generating model added one. Images from open-source models running locally usually won't have one.
  • Checking a watermark depends on the vendor's detector.
  • A watermark says "this came from model X", not who made it or why.

Putting it together in a product

A sensible pipeline for user-uploaded images looks like this:

  1. Check provenance first. If valid C2PA credentials say "AI-generated", you have strong evidence.
  2. Check known watermarks where tools are available.
  3. Run an artifact classifier for everything else, and treat its output as a probability.
  4. Route uncertain or high-risk cases to a human, especially for KYC, news and legal contexts.
  5. Ask for originals when stakes are high. A real photographer usually has the RAW file or the original from their phone.

Where ProofAI fits

ProofAI checks images for signs of AI generation and manipulation using computer-vision analysis, alongside text and document detection. AI video and deepfake detection is coming soon; for now, you can check key frames from a video as images. Like every detector, it returns a confidence score, not a verdict.

What's the most convincing AI image you've seen this year, and what gave it away? Share in the comments. 👇


Disclosure: we're the team behind ProofAI at 4Born Solutions. This article was drafted with AI assistance and reviewed and edited by our team.

Top comments (0)