Visual Forensics Radar is a sophisticated, multi-layered AI orchestration system designed to detect digital forgeries, manual image manipulations, and AI-generated synthetic media. By combining mathematical error analysis, semantic latent space detection, and visual-language reasoning, it provides a comprehensive "forensic report" for any suspicious image.
You can try the live version of the project here:
Live Demo on Hugging Face Spaces
Important
- Technical Performance: The demo runs on Hugging Face's Free CPU Tier. Since the system operates without a GPU:
- Cold Start: The initial loading of the AI engines may take 2-3 minutes.
- Inference Speed: Processing an image through all three layers (especially the VLM Layer) can take between 90 to 180 seconds.
- Memory Optimization: The Qwen2-VL model is forced to load in float32 on CPU memory.
- Please be patient while the "Detective" analyzes the pixels and logic!
Why One AI Model Can't Stop Deepfakes: Architecting a 3-Layer Defense System
├── backend/
│ ├── ela_detector.py # Error Level Analysis Engine
│ ├── clip_detector.py # Semantic Deepfake Detector
│ └── vlm_explainer.py # Qwen2-VL Reasoning Logic
├── frontend/
│ └── app.py # Streamlit Dashboard
├── .streamlit/
│ └── config.toml # Streamlit Configurations
├── main.py # FastAPI Entrypoint
├── Dockerfile # Containerization blueprint
├── start.sh # Startup script for Docker
└── requirements.txt # Dependencies
The project employs a decoupled architecture consisting of a FastAPI backend and a Streamlit frontend, orchestrated via Docker. It utilizes an "Ensemble of Experts" approach across three distinct forensic layers:
- Engine:
ElaDetector - Logic: Uses Error Level Analysis to detect compression inconsistencies.
- Target: Identifies manual "splicing" or "Photoshop" edits where specific regions have different compression levels than the rest of the image.
- Engine:
ClipAuthenticator - Logic: Leverages OpenAI's CLIP (Contrastive Language-Image Pre-training) for Zero-Shot classification.
- Target: Detects the "latent DNA" of generative models (like Midjourney or DALL-E) by comparing image embeddings against known synthetic vs. real descriptors.
- Engine:
VlmExplainer - Logic: Utilizes Qwen2-VL-2B, a state-of-the- visual-language model.
- Target: Acts as a "Digital Detective" that identifies physical impossibilities (e.g., asymmetrical shadows, distorted limbs, or unnatural lighting) and explains them in natural language.
- API: FastAPI
- Frontend: Streamlit
- ML Frameworks: PyTorch, Transformers (Hugging Face)
- Models:
openai/clip-vit-base-patch32,Qwen/Qwen2-VL-2B-Instruct - Deployment: Docker
Ensure you have Docker installed on your machine.
- Clone the repository:
git clone https://github.com/KadirCanCelik/visual-forensics-radar.git cd visual-forensics-radar - Build the Docker Image:
docker build -t visual-forensics-radar . - Run the Container:
docker run -p 8501:8501 -p 8000:8000 visual-forensics-radar
- Access the Dashboard:
Open your browser and navigate to
http://localhost:8501.
