Truth Lens: Your personal guard against AI-generated fakes

Inspiration

As AI-generated images become more realistic, it is getting harder for people to tell whether an image is real or synthetic. Our project was inspired by the need for a tool that can help users detect AI-generated content, especially when images are shared online without context.

What it does

Real Vs AI Image Detection analyzes an image and predicts whether it is real or AI-generated. Instead of only giving one final prediction, the system can also examine smaller patches of the image to identify suspicious regions. This helps provide a more explainable result by showing which parts of the image may look artificial.

Responsible AI Statement

Truth Lens can harm users, creators, sellers, journalists, or people in shared photos if a real image is wrongly labeled AI-generated, and it can also harm scam targets if an AI-generated image is wrongly labeled real. It is not definitive proof, legal evidence, platform moderation, identity verification, or a guarantee that an image is authentic or fake, and it is out of scope for medical, financial, legal, hiring, school discipline, or law enforcement decisions. Truth Lens is only a screening aid for suspicious online images. Its guardrails include confidence scores, AI probability, heatmaps for inspection, advisory results rather than automatic decisions, and user judgment before action.

How we built it

We built the project using deep learning models in Python with PyTorch. We experimented with CNN-based architectures such as ResNet-style classifiers and discriminator-style models inspired by GAN training and YOLO. Images are resized, normalized, and split into patches using a sliding window approach. Each patch is passed through the model, and the patch-level predictions are combined to produce an overall real-vs-AI decision.

We also explored heatmap-style visualization so users can better understand which regions influenced the model’s prediction.

Challenges we ran into

One major challenge was that AI-generated images can look very realistic, while real images can sometimes contain artifacts from compression, darkness, blur, or resizing. This caused the model to occasionally classify real images as fake. We also had to tune patch size, stride, thresholds, and model architecture so the detector could capture both local artifacts and global image patterns.

Another challenge was the training image size. The provided training have 32x32 images which is very hard to generalize to real world scenario.

Accomplishments that we're proud of

We are proud that we built a working AI image detection pipeline that goes beyond a simple binary classifier. Our system can analyze images at the patch level and provide visual feedback through heatmaps. We also experimented with multiple model ideas, including ResNet-based classification and GAN-discriminator-based detection, which helped us understand the strengths and weaknesses of different approaches.

What we learned

We learned that AI image detection is not just about training a classifier. Preprocessing, image resolution, lighting, compression, patch selection, and thresholding all affect the final prediction. We also learned how important explainability is, because users need more than just a “real” or “fake” label to trust the result.

What's next for Real Vs AI Image Detection

Next, we want to improve the model’s accuracy on difficult real-world images, especially dark, compressed, or low-quality photos. We also want to train on a larger and more diverse dataset, improve the heatmap visualization, and make the system easier to use through a web interface. In the future, we hope to add confidence scores, better region-level explanations, and support for detecting images from multiple AI generators.

Share this project:

Updates