Sherlock

๐Ÿ•ต๏ธโ€โ™‚๏ธ SHERLOCK: Deepfake Detection System

![Sherlock Banner](https://img.shields.io/badge/SHERLOCK-AI_CYBERSECURITY-00ff9d?style=for-the-badge&logo=openai&logoColor=black) [![Python](https://img.shields.io/badge/Python-3.10+-3776AB?style=flat-square&logo=python&logoColor=white)](https://www.python.org/) [![PyTorch](https://img.shields.io/badge/PyTorch-EE4C2C?style=flat-square&logo=pytorch&logoColor=white)](https://pytorch.org/) [![FastAPI](https://img.shields.io/badge/FastAPI-009688?style=flat-square&logo=fastapi&logoColor=white)](https://fastapi.tiangolo.com/) [![Next.js](https://img.shields.io/badge/Next.js-black?style=flat-square&logo=next.js&logoColor=white)](https://nextjs.org/) [![Cloudflare Workers](https://img.shields.io/badge/Cloudflare_Workers-F38020?style=flat-square&logo=cloudflare&logoColor=white)](https://workers.cloudflare.com/) [![License](https://img.shields.io/badge/License-MIT-green?style=flat-square)](./LICENSE) *Advanced Multi-Modal Deepfake Detection secured by Edge Computing.* [Report Bug](https://github.com/obsTR/Sherlock/issues) ยท [Request Feature](https://github.com/obsTR/Sherlock/issues)

โšก Overview

Sherlock is a state-of-the-art cybersecurity platform designed to detect synthetic media manipulation. By combining Visual Artifact Analysis (EfficientNet) with Audio Spectral Analysis (MFCC/CNN), Sherlock provides a robust defense against deepfakes.

The system is built with a Security-First architecture, featuring an Edge Gateway that sanitizes and validates requests before they reach the core inference engine.

๐Ÿš€ Key Features

Feature Description
๐Ÿ‘๏ธ Multi-Modal Detection Analyzes both Video (visual artifacts) and Audio (voice synthesis) concurrently.
๐Ÿ›ก๏ธ Edge Security Protected by a Cloudflare Worker gateway that handles Auth, Rate Limiting, and Validation.
โšก Real-Time Inference Optimized PyTorch pipeline delivering sub-second frame analysis.
๐Ÿ“Š Cyber Dashboard Modern, dark-mode React/Next.js interface for visualization and reporting.
๐Ÿ” Explainable AI Provides confidence scores for both visual and audio components.

๐Ÿ—๏ธ Architecture

sherlock_flow

๐Ÿ› ๏ธ Technology Stack

Frontend (Command Center)

Edge (Security Layer)

Backend (The Brain)


๐Ÿ Getting Started

Prerequisites

1. ๐Ÿง  Start the Backend (ML Engine)

cd backend
pip install -r requirements.txt
python app/main_api.py

Server will start on http://localhost:8000

2. ๐Ÿ›ก๏ธ Start the Edge Gateway

cd edge
npm install
npx wrangler dev

Gateway will start on http://localhost:8787

3. ๐Ÿ’ป Start the Frontend Dashboard

cd frontend
npm install
npm run dev

UI will be available at http://localhost:3000


๐Ÿงช Usage & Testing

You can test the full pipeline using the included integration script or the Web UI.

Option A: Web UI

  1. Open http://localhost:3000.
  2. Drag & Drop a video file (MP4/AVI).
  3. Click ANALYZE MEDIA.

Option B: CLI Test

# Generates a dummy video and sends it through the pipeline
python integration_test.py

๐Ÿ“‚ Project Structure

Sherlock/
โ”œโ”€โ”€ ๐Ÿ“‚ backend/             # Python ML Engine
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ app/             # Application Code
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ core/        # Detection Logic
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ services/    # Model & Processor Services
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“‚ api/         # FastAPI Endpoints
โ”‚   โ””โ”€โ”€ main_api.py         # Entry Point
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ edge/                # Cloudflare Worker
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ src/             # Worker Logic (Auth/Proxy)
โ”‚   โ””โ”€โ”€ wrangler.toml       # Edge Config
โ”‚
โ””โ”€โ”€ ๐Ÿ“‚ frontend/            # Next.js Dashboard
    โ”œโ”€โ”€ ๐Ÿ“‚ components/      # React UI Components
    โ””โ”€โ”€ ๐Ÿ“‚ app/             # Pages & Layouts

๐Ÿ“œ License

Distributed under the MIT License. See LICENSE for more information.


**Built for the future of Cybersecurity.**
Developed with โค๏ธ by Onur Kolay