I shipped TruthLens today — a multi-signal deepfake detection tool that shows you exactly why an image is flagged, not just a confidence score.
Try it free (no signup): huggingface.co/spaces/legendarydragontymer/DeepfakeDetectGPU
The Problem
Most deepfake detectors are black boxes. They tell you "87% fake" but never explain why. That's useless for developers building trust & safety features — you need to know which signals triggered and how confident each one is.
How TruthLens Works
Instead of a single model, TruthLens fuses 4 independent signals:
1. CNN Spatial Analysis (50% weight)
EfficientNet backbone analyzing pixel-level artifacts — blending boundaries, texture inconsistencies, unnatural smoothing that the human eye misses.
2. FFT Frequency Analysis (20% weight)
This is the most visually interesting part. Every image has a frequency spectrum (via Fast Fourier Transform). Real photos show smooth, natural falloff. AI-generated images leave grid artifacts — visible as a cross/plus pattern in the spectrum.
TruthLens renders this spectrum so you can literally see the GAN fingerprint.
3. Edge Density Analysis (15% weight)
Real photos from cameras have complex, varied edges from natural scenes. AI-generated images tend to be unnaturally smooth with less micro-texture. A simple Sobel filter quantifies this.
4. Noise Residual Analysis (15% weight)
Camera sensors produce characteristic noise patterns. AI generators produce different (often more uniform) noise. TruthLens extracts the noise residual via median filter subtraction and measures its uniformity across quadrants.
The Stack
- Model: PyTorch + EfficientNet-B0
- UI: Gradio
- Hosting: HuggingFace Spaces + ZeroGPU (free H200 access)
- Signals: torchvision, NumPy FFT, PIL filters
- Total cost: $9/month (HF Pro subscription)
- Time to build: ~3 hours
What the Output Looks Like
Upload any image and you get:
- A composite fake/real score
- A signal breakdown table showing each detector's individual score
- Detailed metrics with human-readable interpretations
- The actual FFT frequency spectrum image
API Access
Every Gradio Space auto-exposes an API. You can call TruthLens programmatically:
from gradio_client import Client
client = Client("legendarydragontymer/DeepfakeDetectGPU")
result = client.predict(
"path/to/image.jpg",
api_name="/detect_deepfake"
)
print(result)
I'm building toward a production API with rate limiting and paid tiers for developers who need deepfake screening at scale.
What's Next
- Fine-tuned CNN weights from ImageCLEF 2026 competition research
- Audio deepfake detection (voice clone detection)
- PRNU camera fingerprinting for device-level provenance
- Multi-model ensemble for higher accuracy
Try It
Live demo: huggingface.co/spaces/legendarydragontymer/DeepfakeDetectGPU
Feedback welcome — especially edge cases where it gets things wrong. That's how I improve the fusion weights.
Built by @AnubhavBharadwaaj | AgenticEdge.in
Top comments (0)