Sponsored by
Vmake Labs Video Enhancer
-Vmake Labs Video Enhancer uses AI to improve video quality, restore details, reduce blur, and upscale videos to 8K.
ViT Real vs. AI-Generated Image Classifier (CIFAKE Fine-tune)
A
vit_base_patch16_224
model fine-tuned on the
CIFAKE
dataset to classify images as
REAL
or
FAKE
(AI-generated).
Model Details
Base model:
vit_base_patch16_224
(ImageNet pretrained, via
timm
)
Fine-tuning data:
CIFAKE (real CIFAR-10 images vs. GAN-generated synthetic images)
Input size:
224×224 (upscaled from the dataset's native 32×32)
Classes:
REAL
(0),
FAKE
(1)
Training:
5 epochs, AdamW, cosine LR schedule, 1 epoch of backbone freezing (head-only warmup)
Reported Metrics (CIFAKE test set)
Metric
Value
Test Accuracy
99.30%
Test AUC
0.9996
Precision (REAL / FAKE)
0.9936 / 0.9925
Recall (REAL / FAKE)
0.9925 / 0.9936
These numbers are correct and reproducible —
but they describe performance on CIFAKE's own held-out test distribution only.
Read the limitation below before using this model on any other kind of image.
⚠️ Known Limitation: This Model Does Not Generalize to Real-World, High-Resolution Images
This is not a minor caveat — it's a fundamental scope limitation that anyone using this model needs to understand.
What the model actually learned
CIFAKE's "REAL" class consists of CIFAR-10 photos, which are natively
32×32 pixels
, upscaled to 224×224 for ViT input. Its "FAKE" class consists of one specific (older) GAN's outputs, generated at a similarly low native resolution and likewise upscaled.
As a result, the model did not learn general "does this image look AI-generated" cues (e.g. unnatural textures, inconsistent lighting/shadows, anatomical errors, diffusion/GAN fingerprints). Instead, it learned to detect the
blur, interpolation, and compression signature of a 32×32 image stretched to 224×224
, versus the specific artifact signature of that one GAN at the same tiny native resolution.
Why this matters in practice
Any modern, high-resolution photo — a phone photo, a Wikipedia image, a stock photo — has a sharpness and compression profile that looks nothing like CIFAKE's upscaled-32×32 "REAL" class. The model has no learned category for "real photo, but sharp and high-res," so it defaults to predicting
FAKE
, regardless of the image's actual origin.
Confirmed empirically:
high-resolution real photographs (e.g. a standard press photo of a named public figure) were consistently misclassified as FAKE. When the same images were first downscaled to 32×32 and upscaled back to 224×224 (artificially reproducing CIFAKE's REAL image distribution), predictions correctly flipped to REAL. This confirms the model is substantially keying on
resolution/compression artifacts
, not genuine evidence of AI generation.
What this means for use
Use case
Reliable?
Classifying images that are natively low-resolution (≈32×32) or have gone through similar upscaling, matching CIFAKE's distribution
Detecting output from modern generators (Midjourney, DALL·E, Stable Diffusion/SDXL, Flux, etc.)
Not validated
— CIFAKE's FAKE images come from one older, lower-resolution GAN; artifacts from modern diffusion models were never seen during training
General-purpose "is this image AI-generated" detection on the internet/social media
Not recommended as-is
Recommended paths for a general-purpose detector
If you need a detector that works on arbitrary real-world images, this checkpoint should be treated as a baseline/proof-of-concept, not a deployable classifier. Effective next steps include:
Remove the resolution confound in training:
apply matched downscale/upscale or JPEG recompression augmentation to
both
classes, so the model can't shortcut on resolution and must learn from actual generation artifacts.
Train on modern, high-resolution data:
mix in datasets covering current-generation models (e.g. GenImage) alongside high-resolution real photo sources, rather than relying on CIFAKE alone.
Evaluate out-of-distribution before trusting the model:
always test on a held-out set of high-res real photos and multiple modern generators before drawing conclusions about generalization — in-distribution test accuracy (like the 99.3% above) does not imply real-world reliability.
Intended Use
This model is best suited for:
Educational/benchmarking purposes on the CIFAKE dataset itself
A starting checkpoint for further fine-tuning toward a more general detector
Demonstrating ViT fine-tuning workflows for binary image classification
It is
not
recommended for production content-moderation, journalism verification, or any deployment where accuracy on arbitrary real-world images is required.
Note:
as explained above, expect unreliable results on high-resolution, real-world images unless you retrain with the fixes described in the Limitations section.
vit-real-vs-ai-detector huggingface.co is an AI model on huggingface.co that provides vit-real-vs-ai-detector's model effect (), which can be used instantly with this bsgcasa vit-real-vs-ai-detector model. huggingface.co supports a free trial of the vit-real-vs-ai-detector model, and also provides paid use of the vit-real-vs-ai-detector. Support call vit-real-vs-ai-detector model through api, including Node.js, Python, http.
vit-real-vs-ai-detector huggingface.co is an online trial and call api platform, which integrates vit-real-vs-ai-detector's modeling effects, including api services, and provides a free online trial of vit-real-vs-ai-detector, you can try vit-real-vs-ai-detector online for free by clicking the link below.
bsgcasa vit-real-vs-ai-detector online free url in huggingface.co:
vit-real-vs-ai-detector is an open source model from GitHub that offers a free installation service, and any user can find vit-real-vs-ai-detector on GitHub to install. At the same time, huggingface.co provides the effect of vit-real-vs-ai-detector install, users can directly use vit-real-vs-ai-detector installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
vit-real-vs-ai-detector install url in huggingface.co: