DEV Community

Sutharsan
Sutharsan

Posted on

Building TruthLens AI: Explainable Image Analysis with Gemma 4




Team Ghost Protocol | MLH Hack Day 2026

AI-generated and manipulated images are becoming increasingly difficult to identify. A simple visual inspection is often not enough to determine whether an image has been altered.

For MLH Hack Day 2026, we built TruthLens AI, an AI-powered image analysis platform that analyzes uploaded images for potential AI generation or manipulation and provides an explainable result.

πŸ” What is TruthLens AI?

TruthLens combines AI-based image detection and Gemma 4 reasoning to investigate suspicious images.

Instead of simply showing "Fake" or "Real", TruthLens provides:

🧠 AI-based image analysis
πŸ“Š Confidence and evidence assessment
πŸ”Ž Detection insights
πŸ’¬ Human-readable explanations
⚠️ A probabilistic investigation result
πŸ€– How We Use Gemma 4

Gemma 4 is an important part of our pipeline.

Image
↓
AI Image Detection
↓
Detection Evidence
↓
Gemma 4
↓
Evidence Reasoning
↓
Investigation Result
↓
Confidence + Explanation

Our key idea is:

The detection model provides evidence. Gemma 4 provides reasoning.

The detection model analyzes the image and produces relevant signals. Gemma 4 interprets those signals and turns them into a clear explanation that users can understand.

This makes TruthLens more than just a prediction system.

πŸ› οΈ Technology Stack

Frontend

React
Vite
Tailwind CSS

Backend

Python
FastAPI
Uvicorn

AI/ML

PyTorch
Hugging Face Transformers
CommunityForensics-DeepfakeDet-ViT
Gemma 4

Image Processing

Pillow
OpenCV
NumPy
SciPy

Local AI

Ollama
πŸ’‘ Why We Built It

AI-generated and manipulated images are becoming more common, while identifying them manually is becoming harder.

We wanted to create a tool that doesn't just give users a prediction, but also helps them understand the reasoning behind the result.

TruthLens is designed as an investigation assistant, not an absolute truth detector.

Note: TruthLens provides probabilistic analysis. Its results should not be treated as definitive proof that an image is authentic, manipulated, or AI-generated.

πŸ‘₯ Team Ghost Protocol
Sutharsan R β€” Frontend Development & UI/UX Design
Jai Nivas V β€” AI Detection Model Development & Evaluation
Mithun Karthik Dhaneshkumar β€” Problem Research, Dataset Preparation & Solution Design
Rohith N M β€” Gemma 4 Integration & AI Reasoning
πŸš€ What We Built

Our workflow is simple:

Upload β†’ Analyze β†’ Generate Evidence β†’ Gemma Reasoning β†’ Explainable Result

We focused on building a working end-to-end prototype that combines AI image detection with an AI reasoning layer.

πŸ”— Project

GitHub:
https://github.com/Sutharsan11308-git/hacktoberfest-hack-day-coimbatore-x-init-club-and-idea-club

Top comments (0)