Project Description

How your solution addresses the problem statement

Problem

AI-generated images are becoming increasingly realistic and easy to produce at scale. Detecting them is already challenging, but real-world platforms face an additional problem: images rarely remain in their original form.

Once uploaded and redistributed, an image may be compressed, cropped, resized, blurred, or colour-adjusted. These transformations can weaken the signals used by AI-image detectors. This is exactly the challenge highlighted in the problem statement, which asks for detection that remains reliable under realistic post-processing conditions.

At the same time, we see an opportunity to go beyond simply asking whether an image is AI-generated. AI-generated content is not inherently harmful. It can support art, education, humour, and storytelling. The problem arises when accounts or networks produce large volumes of nearly identical AI-generated images. When this repetitive content floods recommendation feeds, genuine creators may receive less visibility. Instead of penalising all AI-generated content, we focus on identifying repetitive synthetic content at scale while allowing unique and meaningful AI-assisted content to remain unaffected.

Our Solution - Mosaic

Mosaic is a robust AI-image detection system with an additional near-duplicate detection layer. It outputs two signals for each image: an AI probability and a repetition score.

For AI detection, Mosaic is evaluated on both clean and transformed images to reflect how content is actually shared online. We test robustness separately against JPEG compression, Gaussian blur, resizing, Gaussian noise, colour jitter, and cropping, allowing us to measure which transformations have the greatest impact on detection performance. These transformations directly reflect the real-world conditions defined in the challenge.

For repetition detection, Mosaic reuses the visual embeddings from the same image backbone and calculates cosine similarity between images. This allows near-duplicates to be identified even after modifications such as cropping, resizing, recompression, or colour adjustment, without requiring a separate similarity model.

By combining both signals, Mosaic can distinguish between unique content, unique AI-generated content, and repetitive AI-generated content. Rather than penalising AI content simply for being synthetic, this provides platforms with a signal for identifying high-volume repetitive AI content that may crowd recommendation feeds and reduce visibility for original creators.

Why This Addresses the Challenge

The challenge asks teams to build an AI-generated image detector that maintains its performance after realistic transformations and to consider robustness, generalisation, and false positives.

Mosaic directly addresses this through its robust detection component while extending the solution into a practical platform use case:

Rather than only detecting whether content is AI-generated, Mosaic helps determine whether AI-generated content is being used repetitively enough to reduce content diversity.


Development Tools Used

  1. VSCode → Main development environment for implementing the model pipeline, backend, evaluation scripts, and application
  2. Google Colab → GPU-based experimentation, model training, and evaluation (include only if actually used)
  3. Git → Version control and collaborative development
  4. GitHub → Central repository for code, documentation, experiments, and team collaboration

Models and APIs Used

CLIP ViT-L/14 – Visual Backbone

Mosaic uses a pretrained CLIP ViT-L/14 image encoder (OpenAI weights) as its main visual backbone.

For every uploaded image, CLIP converts the image into a 768-dimensional numerical embedding that represents its visual characteristics.

We reuse this representation for two tasks:

  1. AI-Image Classification A lightweight classifier is trained using the extracted visual features to distinguish between authentic and AI-generated images. The classifier outputs a confidence score representing the probability that an image is AI-generated.

  2. Similarity Detection The same CLIP embeddings are also compared using cosine similarity. Images with highly similar representations are grouped into clusters, allowing Mosaic to identify repeated or near-duplicate content without requiring a second large vision model.

Combined output format

Both signals are merged into a single record per image, matching the challenge's required inference format — one JSON object per image, given an input image directory:

{
  "image_path": "image_01.jpg",
  "pred": 0.91,
  "similarity_cluster": 4,
  "repetition_score": 0.94
}
  • pred — AI-generation confidence score from the classifier (0–1)
  • similarity_cluster — id of the near-duplicate cluster the image was grouped into
  • repetition_score — how strongly the image resembles other members of its cluster (0–1)

APIs

The core Mosaic detection pipeline does not rely on an external AI inference API. Inference is performed using our own model and open-source machine-learning libraries, keeping the prototype lightweight and reducing dependence on third-party services.


Libraries and Frameworks Used

Machine Learning

Technology Purpose
PyTorch Training the MLP classification head, tensor operations, model checkpoint saving/loading, and inference
OpenCLIP Loading the pretrained CLIP vision encoder and generating image embeddings
scikit-learn Computing evaluation metrics such as accuracy, ROC-AUC, precision and recall, and performing DBSCAN similarity clustering
NumPy Image-array and numerical processing
Pillow (PIL) Loading, validating, transforming, and preprocessing images
torchvision Loading image-folder datasets and applying image transformations and augmentations
pandas Creating and saving evaluation and robustness result tables
PyArrow Reading SID-Set images stored in Parquet files

Application & Product Layer

Technology Purpose
Python + FastAPI Backend and REST API backend
React + TypeScript Frontend interface
Supabase Postgres Database for metadata and analysis results
Supabase Storage Stores uploaded images

Datasets and Assets Used

Training and Evaluation Data

Mosaic supports three publicly available datasets containing authentic and AI-generated images:

  1. SID-Set A synthetic-image detection dataset containing real, fully synthetic, and partially tampered images. For Mosaic’s binary classifier, real images are labelled authentic, fully synthetic images are labelled AI-generated, and tampered images are currently excluded. SID-Set is distributed under the CC BY 4.0 licence.
  2. CIFAKE A binary image-classification dataset containing 60,000 real CIFAR-10 images and 60,000 synthetic images generated using Stable Diffusion 1.4. It provides predefined training and test splits and is distributed under the MIT licence.
  3. WildFake A large-scale dataset containing authentic images and images produced by multiple generative models. Due to its size, Mosaic uses a focused subset consisting of AFHQ, CelebA-HQ and Church authentic images, together with DDIM and DDPM generated images. The dataset page identifies its licence as Apache 2.0.

These datasets were provided or recommended as resources for the challenge and were cleaned using Mosaic’s dataset-specific validation pipelines before model training or evaluation.

Built With

Share this project:

Updates

Submission history