AI Image Detector
Upload an image and find out whether a camera took it or a generative model made it.
Trained on 1,100+ generators — and measured on generators it has never seen.
How it works
The vision tower of openai/clip-vit-base-patch16 with its last four transformer
blocks fine-tuned (~28M trainable parameters). At inference, windows spanning the whole
frame are cropped at native resolution, passed through the identical preprocessing
used in training, and averaged in logit space — a single centre crop of a large photo
throws away most of the evidence.
Training data
~195,000 images, balanced 50/50, from 1,100+ distinct generators: OpenFake (GPT-Image, nano-banana, Midjourney 6/7, Flux, Imagen, Ideogram, Recraft, SD 1.4→3.5, SDXL) and Community Forensics (thousands of community fine-tunes and LoRAs). Real images come from LAION, Pexels, COCO, FFHQ, VISION and Landscapes-HQ.
Every image of both classes is decoded, cropped and re-encoded as JPEG q95 by one function with no branch on the label. Without that, a detector reaches 99% by learning "PNG means fake". Training on randomly permuted labels lands at 0.511 — chance — which is the evidence that it did not.
Measured accuracy
| Evaluation set | What it tests | Accuracy | AUROC |
|---|---|---|---|
| Held-out validation | seen generators | 0.976 | 0.997 |
OpenFake core/test |
unseen generators and unseen real sources | 0.898 | 0.960 |
OpenFake reddit/test |
in-the-wild Reddit uploads | 0.869 | 0.939 |
| CIFAKE | Bird & Lotfi (2024), 32×32 | 0.720 | 0.815 |
Limitations — please read before trusting a verdict
- About 1 in 11 genuine photographs from unfamiliar camera pipelines is still flagged as AI. Unfamiliar sensor and compression statistics resemble generation.
- Accuracy drops on very low resolution images; heavy upscaling is its own shift.
- Screenshots, memes and heavily edited photos sit between the two classes.
- This is academic work, not a forensic authority. Evidence, not proof.
CSC625 Deep Learning · Hussein El Saadi · Modern University for Business and Science (MUBS) · Summer 2026. Non-commercial academic use — the training data is CC-BY-NC.