DeepShield AI Forensics
Computer Vision

DeepShield AI Forensics

Current deepfake detectors rely heavily on spatial convolutions, making them highly vulnerable to simple post-processing attacks like JPEG compression, resizing, or minor noise additions. I needed a system that could detect fakes even after they'd been laundered through social media compressions.

The Solution

I built a dual-pipeline forensic engine. It first extracts Error Level Analysis (ELA) and high-frequency Discrete Cosine Transform (DCT) artifacts, isolating compression discrepancies. It then feeds these artifacts into a Vision Transformer (ViT-Base-16) to classify the image. I also integrated an FGSM adversarial noise injection pipeline to pre-emptively immunize photos against facial cloning.

  • Combined custom digital forensics algorithms (ELA, DCT frequency) with a pre-trained Vision Transformer (ViT-Base-16) model
  • Built custom Grad-CAM visualization hooks to output pixel heatmaps of flagged anomaly areas
  • Designed a dual-pass verification system to verify fakes that easily bypass standard CNN model boundaries
  • Implemented a prototype FGSM noise-injector script to immunize original photos before web upload

System Pipeline

Step 01

Next.js Portal

Front-end image upload payload wrapper

Step 02

FastAPI Gateway

Fast asynchronous validation route

Step 03

ELA & DCT Forensics

Digital signal image compression audits

Step 04

Vision Transformer

ViT classification ensemble analysis

Step 05

Grad-CAM Heatmap

Anomalous visual coordinate outputs

Engineering Trade-offs

Why?I opted for a Vision Transformer over standard CNNs (like ResNet) because ViTs capture global context better, despite the tradeoff of higher inference latency and memory requirements. I decoupled the Grad-CAM generation to run asynchronously to keep the main classification thread fast.

Proven Impact

%

Achieved a 97.5% classification accuracy on unseen, highly compressed GAN holdout sets. Reduced false-positive rates on heavily artifacted social media images by 34% compared to standard spatial detectors.

The Constraints

Timeline
12 Weeks
Team
Solo Developer
Core Tech
PyTorch, FastAPI, Next.js

Stack

PyTorchFastAPINext.jsOpenCVViTFGSM