CodingMSTR LogoCodingMSTR
Deepfake Video & Audio Detection Platform

Deepfake Video & Audio Detection Platform

โ‚น 99

A lightweight, high-performance, and zero-dependency web application designed to analyze uploaded video and audio files, estimate manipulation probability, visualize anomalies, and generate downloadable PDF authenticity reports. This project is a fully functioning MVP, perfect for computer science students, researchers, and developers looking for a modular template to integrate and showcase deep learning models.

Category: AI, Node.js
Added On: N/A
Developer: By Praveen

For any customization or code setup, feel free to contact us. We also offer deployment on live servers.

For any issues related to downloading, email me at devpraveenkr@gmail.com

Need additional support or customization? Contact me!

Project Screenshots

Project Description

๐Ÿ“Œ Project Overview

The proliferation of deepfakes and AI-synthesized media has created a massive challenge for cybersecurity, media authenticity, and digital forensics. This project offers an end-to-end web-based platform that allows users to upload media files and immediately inspect them for manipulation indicators.

The application is built using pure Node.js with zero external npm dependencies, showcasing how to construct complex features like custom multipart file uploading, modular file processing, dynamic canvas-based evidence visualization, local JSON-based database persistence, and raw PDF report generation using only standard library features.

The analysis engine utilizes an explainable, deterministic heuristic model that rates files across multiple signal categories. Its decoupled architecture makes it extremely simple to swap out the heuristic analyzer with active deep learning inference pipelines (such as PyTorch/TensorFlow, OpenCV face meshes, or Librosa audio processing).


๐ŸŽจ Project Screenshots & UI Preview

Below are previews of the clean, modern dark-mode dashboard:


๐Ÿš€ Key Features

  • Dual-Modality Analysis: Supports both video and audio files across multiple formats:
    • Video: .mp4, .mov, .avi, .mkv, .webm
    • Audio: .mp3, .wav, .m4a, .aac, .ogg, .flac
  • Interactive Results Dashboard: Displays overall manipulation probability (%), classification result (e.g., Likely Manipulated vs Likely Authentic), and analysis confidence rating.
  • Explainable Evidence (Visual Heatmaps & Charts):
    • Frame Anomaly Heatmap: Visual representation overlay of facial/texture inconsistency regions.
    • Audio Spectral Anomaly Map: Dynamic timeline chart illustrating anomalous frequencies and noise levels.
  • Granular Detection Signals:
    • Video Signals: Entropy Pressure, Texture Instability, Temporal Jitter, and Compression Artifacts.
    • Audio Signals: Spectral Noise, Smoothness Anomaly, Phase Irregularity, and Silence Patterns.
  • Automated PDF Report Generation: Creates a professional, detailed authenticity summary containing file metadata, analysis breakdown, suspicious timestamp lists, and embedded visual charts.
  • Analysis History Archive: Persists uploads and results in a local database so users can browse historical checks and retrieve reports.
  • Highly Decoupled Architecture: Clean separation of routes, controller layers, data storage, and the ML analyzer service, providing a direct upgrade path to a Python/PyTorch inference server.
  • Zero npm Dependencies: Runs entirely on Node.js core modules. Extremely lightweight, fast, and secure.

๐Ÿ› ๏ธ Technology Used

  • Frontend:
    • HTML5: Semantic layouts and upload zones.
    • Vanilla CSS3: Modern dark-theme design with responsive flex/grid cards, glassmorphic inputs, transition animations, and sidebar navigation.
    • Vanilla JavaScript (ES6): Upload progress tracking, dynamic DOM rendering of scores, and API call handlers.
  • Backend:
    • Node.js (v18+): Built-in modules only (http, fs, path, crypto).
    • Custom Multipart Parser: Efficient streaming parser for handling large binary file uploads.
    • Custom PDF Generator: Core-based binary writer that constructs and compiles clean, downloadable PDF files from scratch.
  • Database & File Storage:
    • Flat JSON Database (storage/db.json): Serves as a local document store for past results.
    • Structured Directories: Dynamic storage folders for uploads, evidence maps, and generated PDFs.
  • Testing Suite:
    • Node.js Test Runner: Unit tests verifying multipart parsing, schema validators, scoring mathematical models, and report layout dimensions.

๐Ÿ“ File & Folder Structure

deepfake_detection_platform/
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ server.js              # Entrypoint server (serves frontend, routes APIs)
โ”‚   โ””โ”€โ”€ services/
โ”‚       โ”œโ”€โ”€ analyzer.js        # Detection heuristic scoring & signals compiler
โ”‚       โ”œโ”€โ”€ db.js              # Database helper (JSON-based history reader/writer)
โ”‚       โ””โ”€โ”€ pdf.js             # Custom PDF writer for reports
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ index.html             # Main single-page application dashboard
โ”‚   โ”œโ”€โ”€ styles.css             # Vanilla CSS styling with variable-based dark theme
โ”‚   โ””โ”€โ”€ app.js                 # Dynamic UI controllers & API request methods
โ”œโ”€โ”€ storage/                   # Local media & records directory (auto-created)
โ”‚   โ”œโ”€โ”€ db.json                # Database storage file
โ”‚   โ”œโ”€โ”€ evidence/              # Visual heatmaps and audio charts
โ”‚   โ”œโ”€โ”€ reports/               # Generated PDF authenticity reports
โ”‚   โ””โ”€โ”€ uploads/               # Original uploaded media files
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ index.test.js          # Unit tests suite for validators, parsers, and scorings
โ”œโ”€โ”€ package.json               # Project details & npm start scripts
โ””โ”€โ”€ RUN_GUIDE.md               # Detailed technical operations manual

โš™๏ธ Installation & How to Run

๐Ÿ“‹ Prerequisites

  • Node.js: Version 18.0.0 or higher.
  • Operating system command-line (Terminal, Command Prompt, or PowerShell).

๐Ÿ”ง Step-by-Step Setup

  1. Clone or Download the Source Code: Save the project folder locally, ensuring you have the following path structure:

    deepfake_detection_platform/
    
  2. Open your Terminal: Navigate into the project root directory:

    cd path/to/deepfake_detection_platform
    
  3. Start the Application: Run the following command to start the server:

    npm start
    

    (Alternatively, you can run npm run dev to start in development mode).

  4. Access the Dashboard: Open your web browser and navigate to:

    http://localhost:3000
    

๐ŸŽ›๏ธ Configurations & Environment Variables

The application runs seamlessly with default configurations. However, you can control port and size configurations using environment variables:

1. Custom Port Configuration

By default, the server listens on port 3000. To change it, set the PORT variable:

  • Windows (PowerShell):
    $env:PORT=8080
    npm start
    
  • macOS / Linux:
    PORT=8080 npm start
    

2. Maximum Upload Limit

The default maximum media size allowed for upload is 80 MB. To adjust the threshold:

  • Windows (PowerShell):
    $env:MAX_UPLOAD_BYTES=104857600  # Sets limit to 100 MB
    npm start
    
  • macOS / Linux:
    MAX_UPLOAD_BYTES=104857600 npm start
    

๐Ÿงช Running Automated Tests

To execute the test runner and verify backend functionality:

npm test

The tests will run and output assertions covering:

  • Multipart Boundary Parser: Ensures raw file uploads compile cleanly.
  • Analyzer Scoring Model: Tests confidence mathematical bounds and anomalies.
  • API Endpoints: Simulates requests and validates database logs.

๐Ÿงน Resetting Local Analysis History

If you want to clear your local dashboard history and delete previous uploads/reports:

  1. Stop the running server (Ctrl + C).
  2. Delete the contents inside the following folders (do not delete the folders themselves):
    • storage/uploads/
    • storage/evidence/
    • storage/reports/
  3. Open storage/db.json and reset it to empty:
    {
      "analyses": []
    }
    
  4. Restart the server.

๐Ÿท๏ธ Why Buy This Project Template?

  • Ideal for Academic Projects: Perfect foundation for final year college, university, or boot camp capstone projects.
  • Production-Ready Extension: Easily replace the mock scoring system with advanced deep learning APIs (FastAPI + PyTorch/TensorFlow) without changing the frontend UI.
  • Clean Code & Zero NPM Fat: Easy to audit, debug, and configure. No risk of broken or deprecated package dependencies.
  • Comprehensive Documentation: Comes pre-packaged with setting guides and instructions.