Portfolio

MSc Deepfake Defence

Created as part of my Dissertation: A user-centred deepfake detection prototype that combines machine learning models with an intuitive interface to help users evaluate the authenticity of digital media.

Project Details

Created as part of my Dissertation: A user-centred deepfake detection prototype that combines machine learning models with an intuitive interface to help users evaluate the authenticity of digital media.

As my dissertation is over, this piece of development is done for now. Maybe I'll reopen it down the line, but for now my focus is elsewhere.

Features

Key Features Implemented

  • On-device image analysis using ONNX Runtime Web and WebAssembly

  • Choice of MesoNet-inspired CNN, LightweightNet or a weighted ensemble combining both models

  • Risk scores, confidence indicators and colour-coded result summaries

  • Adjustable detection sensitivity

  • Basic, additional-context and full-detail explanations

  • Drag-and-drop uploads, file selection and batch processing

  • Limited video support through captured frames and poster images

  • In-page media detection controls and result overlays

  • Popup interface for quick controls and access to the full analysis dashboard

  • Dedicated dashboard, media analysis, history, analytics and settings views

  • Searchable analysis history with risk filtering and sorting

  • Re-analysis of previously analysed media where a stored preview or source is available

  • User feedback options to agree, disagree or express uncertainty about results

  • Analytics covering processing time, confidence distribution, risk breakdown and feedback

  • Local persistence of settings, analysis history and media previews

  • JSON export of analysis results and evaluation data

Technical Details

Browser Extension
  • Platform: Chromium browser extension using Manifest V3

  • Frontend: HTML, JavaScript ES modules and SCSS

  • Build tooling: Vite with compiled styles and bundled runtime assets

  • Inference runtime: ONNX Runtime Web using CPU-based WebAssembly execution

  • Media preparation: Browser-based image decoding, resizing and normalisation, with frame extraction for supported video workflows

  • Storage: Chrome extension storage for settings and results; IndexedDB for media previews

  • Communication: Chrome runtime messaging between the popup, dashboard, content scripts and background service worker

  • Observability: PostHog analytics controlled by the anonymous-analytics preference, alongside configured Sentry error reporting

  • Testing: Vitest and JSDOM with mocked Chrome extension APIs

Machine Learning and Research Tooling
  • Framework: PyTorch for model development, training and ONNX export

  • Models: MesoNet-inspired and lightweight convolutional neural networks

  • Ensemble: Weighted combination of outputs from both models

  • Data preparation: Python preprocessing tools for images, video frames and FaceForensics-style datasets

  • Evaluation: Training curves, model-comparison scripts and exportable evaluation metrics

  • Interpretation: User-facing explanations describe model estimates and decision thresholds to support informed judgement

Architecture Pattern
  • Layered extension architecture: Separate popup, dashboard, content-script and background-service responsibilities

  • Centralised inference: The background service worker manages model loading, inference requests, scoring and result persistence

  • Modular interface: Dashboard pages use dedicated components for uploads, history, analytics, settings and re-analysis

  • Local media processing: Core detection runs within the browser, without a remote inference service

  • Persistent local data: Settings and results remain available between sessions through extension storage and IndexedDB

  • Separate research pipeline: Python training and evaluation tools produce ONNX models for browser deployment

The project was developed as an MSc dissertation prototype. Video support is frame-based, and detection scores are model estimates rather than proof of media authenticity.