Skip to content

Spyderzz/DeepShield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

81 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ DeepShield

Explainable AI-Powered Multimodal Misinformation Detection Platform

Python JavaScript React Vite FastAPI PyTorch Hugging Face Gemini Supabase Vercel Docker OpenCV

Detect deepfakes, fake news, and manipulated media with transparency-backed AI verdicts


πŸ“– Overview

DeepShield is a production-ready, full-stack web platform designed to combat the rising threat of synthetic media. It accepts images, videos, news text, audio, and social media screenshots, subjecting them to a rigorous, multi-model forensic analysis.

Moving beyond simple "real or fake" probability scores, DeepShield provides human-readable LLM explanations, granular component breakdowns, temporal video analysis, and trusted-source cross-referencing.

It is built with a highly optimized decoupled architecture combining state-of-the-art Vision Transformers (ViT), BERT NLP classifiers, and Gemini-powered Explainable AI to create an end-to-end misinformation detection pipeline that doesn't just give a verdict β€” it shows you exactly why in plain, jargon-free English.


✨ Features & Capabilities

πŸ” Multimodal Deepfake Detection

  • Image Forensics: Utilizes a fine-tuned Vision Transformer (ViT) and EfficientNet trained on FaceForensics++ to detect pixel noise and compression anomalies via Grad-CAM++ and Error Level Analysis (ELA).
  • Video Frame Analysis: Performs keyframe extraction, per-frame ViT analysis, and optical flow temporal consistency tracking to spot deepfakes and unnatural movement.
  • Audio Voice Cloning Detection: Extracts acoustic features using Wav2Vec2/WavLM and applies signal heuristics (spectral variance, RMS consistency) to identify AI voice cloning across any language.
  • Fake News Verification: Employs a Multilingual BERT classifier (English & Hindi) for sensationalism scoring, Named Entity Recognition (NER), and truth-override via trusted-source cross-referencing.
  • Screenshot Forensics: Uses EasyOCR for text extraction and performs layout anomaly detection to catch manipulated social media posts.

🧠 Explainable AI (XAI)

  • Gemini 1.5 Flash Integration: Asynchronous LLM streaming (typewriter effect) generates plain-English narrative summaries and granular Visual Language Model (VLM) component-score breakdowns.
  • Artifact Highlighting: Explicitly points out manipulated regions, unusual compression artifacts, and synthetic noise patterns.

⚑ Premium Engineering

  • Ultra-Fast Frontend Performance: Built with Vite and React 18, utilizing React.lazy, Suspense boundary code-splitting, and deferred 3D asset loading for an instant First Contentful Paint (FCP).
  • Glassmorphism UI: Features a premium interface with Apple-style 3D processing animations and highly polished, jargon-free data visualization.
  • PDF Report Generation: Downloadable, professional verification reports via WeasyPrint with full evidence breakdowns and embedded metadata.
  • Secure Cloud Persistence: JWT-authenticated user accounts and stateless analysis history backed by a production-ready Supabase PostgreSQL database.

πŸ—οΈ System Architecture

DeepShield uses a robust, microservice-inspired architecture designed for high concurrency and stateless inference.

graph TD;
    Client[React 18 + Vite SPA] -->|HTTPS / REST| API[FastAPI Gateway]
    
    subgraph Backend Services
        API --> Auth[JWT & Auth Service]
        API --> Upload[SHA-256 Storage Cache]
        API --> Inference[AI Inference Layer]
        API --> DB[(Supabase PostgreSQL)]
    end
    
    subgraph AI Inference Engines
        Inference --> Image[ViT + EfficientNet]
        Inference --> Text[Multilingual BERT]
        Inference --> Audio[Wav2Vec2]
        Inference --> OCR[EasyOCR]
        Inference --> LLM[Gemini 1.5 Flash]
    end
Loading

πŸ€– Detection Pipelines

  • πŸ–ΌοΈ Image Pipeline: Upload β†’ SHA-256 Cache Check β†’ ViT Classification β†’ Generate Evidence Map (Grad-CAM++) β†’ Tampering Check (ELA) β†’ Metadata Trace β†’ VLM Breakdown β†’ Verdict
  • 🎬 Video Pipeline: Upload β†’ Extract Frames β†’ Analyze Individual Frames β†’ Unnatural Movement Check β†’ Audio Extraction & Deepfake Detection β†’ Aggregate Signals β†’ Verdict
  • πŸ“° Text Pipeline: Paste Article β†’ Scan for Sensationalism β†’ NLP Classification β†’ Fact-Checking (Trusted Sources) β†’ Async LLM Summary β†’ Verdict
  • πŸ“± Screenshot Pipeline: Upload β†’ Text Extraction (EasyOCR) β†’ NLP Credibility Scan β†’ Layout Tampering Detection β†’ Source Cross-Reference β†’ Verdict
  • πŸŽ™οΈ Audio Pipeline: Upload β†’ Preprocess Audio β†’ Extract Vocal Patterns β†’ Detect Synthetic Voice Cloning β†’ Analyze Acoustic Signals β†’ Verdict

πŸ“ˆ Authenticity Scoring

DeepShield uses a standardized Deepfake Probability score alongside a 0–100 confidence scale, reinforced by a component breakdown.

Score Range Verdict Indicator Meaning
81–100 βœ… Very Likely Real 🟒 Green High confidence authentic
61–80 βœ… Likely Real 🟒 Light Green Probably authentic
41–60 ⚠️ Possibly Manipulated 🟑 Amber Uncertain β€” cross-check recommended
21–40 ❌ Likely Fake 🟠 Orange Probable manipulation detected
0–20 ❌ Very Likely Fake πŸ”΄ Red Strong manipulation signals

βš™οΈ Installation & Deployment

DeepShield is built to run locally for development and is fully containerized for deployment on platforms like Hugging Face Spaces.

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • Gemini API Key (from Google AI Studio)
  • Supabase Database Connection String

1️⃣ Clone the Repository

git clone https://github.com/Spyderzz/DeepShield.git
cd DeepShield

2️⃣ Backend Setup

cd backend
python -m venv .venv

# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate

# Install dependencies
pip install torch==2.4.1 torchvision==0.19.1 --index-url https://download.pytorch.org/whl/cpu
pip install -r requirements.txt

3️⃣ Environment Configuration

Create a .env file in the root directory:

# Server
APP_HOST=0.0.0.0
APP_PORT=8000
DEBUG=true
CORS_ORIGINS=["http://localhost:5173", "https://your-huggingface-space.hf.space"]

# Database
DATABASE_URL=postgresql://postgres.xxx:password@aws-0-region.pooler.supabase.com:6543/postgres

# AI Models & Explainability
LLM_PROVIDER=gemini
LLM_API_KEY=your_gemini_api_key_here
LLM_MODEL=gemini-2.0-flash

# Auth
JWT_SECRET_KEY=generate_a_secure_random_key
JWT_ALGORITHM=HS256
JWT_EXPIRATION_MINUTES=1440

4️⃣ Start the Backend

cd backend
uvicorn main:app --reload --host 0.0.0.0 --port 8000

(API Documentation will be available at http://localhost:8000/docs)

5️⃣ Frontend Setup

cd frontend
npm install
npm run dev

(Open http://localhost:5173 to view the application)


πŸ›‘οΈ Security Features

  • Stateless Analysis: Uploaded files are cached via SHA-256 for fast retrieval but safely stored without permanent coupling unless explicitly saved to history.
  • Rate Limiting: IP and User-ID based slowapi limiters across endpoints to protect system resources and prevent API abuse.
  • Route Guards: Authenticated endpoints with mandatory UUID token validation to prevent unauthorized record enumeration.
  • Supabase Cloud DB: Production-ready PostgreSQL persistence with Row Level Security (RLS) support.

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


πŸ‘€ Author

GitHub

⭐ **If this project helps you, consider giving it a star!** ⭐

Built with ❀️ using AI/ML for a safer digital world

About

Resources

License

Stars

Watchers

Forks

Contributors