Robust AI-Generated Image Detector

💡 Inspiration

With generative AI tools on the rise, TikTok creators are increasingly concerned about their likeness being used without permission and their content being stolen. This is made even more problematic by AI-generated images that undergo augmentation, making it harder for consumers to verify the authenticity of online content. Our solution aims to achieve a high true positive percentage for the robust detection of AI-generated images.

✨ Key Features

1. Robust AI Image Detector

  • Single Image Analysis: Upload a singular image to detect whether an image is AI-generated or authentic.
  • Multi-Augmentation Stress Testing: Apply multi-sliders with 6 different types of applicable augmentations (JPEG Compression, Gaussian Blur, Resizing, Gaussian Noise, Colour Jitter, Center Crop) on the selected image to test the model's confidence level and classification robustness.

2. Image Dataset Evaluator

  • Batch Performance Benchmarking: Iterate through a dataset with a configurable maximum dataset size to determine the exact number of successful and unsuccessful image classifications across the dataset.

🛠️ How We Built It

Datasets

Dataset Source Description & Purpose
SID_Set HuggingFace Main training data consisting of ~300k real and varied synthetic images.
CIFAKE Kaggle Pipeline smoke-test set used to validate end-to-end data flow.
COCO train2017 COCO Supplementary real images mixed into the training set for benchmark-aligned reals.
COCO val2017 COCO Test only, never used in training. Unseen, independent cross-source test set to measure MLP generalisation ability.
Parveshiiii/AI-vs-Real HuggingFace Test only. Independent dataset with real and fake images from unseen sources, used to evaluate if frozen CLIP features generalise to new generators.

Architecture & Training Pipeline

  • Backbone: We used the pre-trained OpenAI CLIP ViT-B/16 vision encoder as our backbone with a frozen foundational model. This allows CLIP's general features to generalise effectively across unseen generators (GANs, Diffusion Models, DALL-E, Midjourney), prioritizing higher-level semantic plausibility over brittle, high-frequency artifacts.
  • Classification Head: Our primary trained model is a Multilayer Perceptron (MLP) that leverages the frozen CLIP backbone to project images into semantic vector space and output the probability of AI generation.
  • Data Augmentation: Images fed into the training model undergo random, vigorous augmentations during training to guarantee invariance and robust real-world performance.

🏆 Accomplishments We're Proud Of

  • Unseen Cross-Source Accuracy: Our model correctly identified ~92% of real images from the full unseen COCO val2017 test set (4,965 images) with a low 8.2% false-positive rate, demonstrating strong cross-source generalisation.
  • Cross-Generator Generalisation: On an independent dataset (Parveshiiii/AI-vs-Real) with real and fake images from unseen sources, our model caught 99.1% of fakes at a 7.4% false-positive rate, and the false-positive rate stayed stable at ~7–8% across three independent test sources.
  • Resistant to Degradation: In held-out evaluation, our model remained virtually invariant to image corruption, staying within 0.002 of the clean AUROC across all 15 conditions.

🚦 Limitations

  • Real-source mismatch. Training reals were largely OpenImages (from SID_Set); the benchmark reals are COCO. This drives most of the ~7% false-positive rate.
  • Prototype scale. Training of MLP was conducted with limited GPU computation power.
  • Single primary generator source. Fakes come mainly from SID_Set's synthetic set; broader generator diversity was scoped out under time pressure.

🚀 What's Next

  • Dataset Expansion: Train against larger and more diverse datasets (e.g., COCO train2017, WildFake) to expand generator diversity and cross-generator generalisation.
  • Model Scaling: Upgrade the vision backbone to CLIP ViT-L/14 (~430M parameters) to boost detection accuracy while keeping parameter size under 2B.
  • Crop Robustness: Patch-based inference for stronger crop robustness.
  • Robustness Baseline: A from-scratch CNN baseline, trained on the same augmented data, to quantify how much the frozen foundation model buys us in robustness.

Built With

+ 37 more
Share this project:

Updates