Inspiration

AI-generated images rarely stay in their original form. Once shared online, they are compressed, resized, cropped, blurred, or reposted—often destroying the subtle traces detectors rely on.

That led us to one question: Can AI-generated image detection remain reliable after real-world redistribution?

TraceLens is our answer.

What it does

TraceLens detects AI-generated images under real-world image transformations. Instead of optimizing only for clean images, we focus on robustness across common degradations such as JPEG compression, resizing, cropping, blur, noise, and color changes.

How we built it

We initially built a complex architecture combining a CLIP-based spatial branch, a forensic branch, MBE enhancement, and gated fusion. The main components and experiments are documented in our GitHub repository.

Instead of assuming that a more complex model would perform better, we evaluated every component on the same WildFake validation split and the official 15-condition robustness grid. These experiments led us to a simpler and stronger final system: an OpenCLIP ViT-H/14 spatial tower, with the last two transformer blocks unfrozen and fine-tuned on WildFake. During training, 30% of the images remained clean, while 70% were modified using one official degradation, such as JPEG compression, resizing, blur, noise, color changes, or cropping. The training and evaluation pipeline is implemented in experiments/spatial_tower/, data/transforms.py, and evaluate.py.

Challenges we faced

Our biggest challenge was that the model had to detect AI-generated images after realistic redistribution, rather than only on clean originals. Some approaches that looked promising on the initial dataset did not generalize to WildFake. The forensic branch achieved an official AUC of 0.9064, while gated fusion reached 0.9900, both below the spatial-only model’s 0.9924. We therefore removed these components from the submitted system based on evidence, rather than complexity.

We also found that deployment speed was limited by the serving pipeline, not only by the model. The first HTTP service processed 31.4 images per second on one A40 GPU. We added micro-batching, GPU-side preprocessing, content-hash caching, and backpressure in throughput/, increasing throughput to 44.6 images per second without changing the checkpoint or detection logic. The final project is available as an interactive Streamlit demo, a batch inference tool, and a FastAPI serving stack.

What we learn

This experience taught us that robustness and generalization matter more than architectural complexity. A simpler model supported by careful evaluation and realistic deployment engineering can be more reliable than a more complicated design.

Built With

+ 10 more
Share this project:

Updates

Submission history