Inspiration

Deepfake technology has advanced faster than public awareness. Manipulated videos spread across TikTok, Instagram, and YouTube before anyone can verify them. Traditional deepfake detectors require users to download content, upload it, and wait — by then, the damage is done.

DeepGuard was inspired by a simple question: what if you could know something is fake at the exact moment you see it?

We realized that deepfake detection shouldn't be a separate tool you visit — it should be an invisible safety layer that protects you as you scroll. Like how antivirus software runs silently in the background, DeepGuard brings real-time awareness directly to where the problem happens: your screen.


What it does

DeepGuard is a real-time deepfake detection overlay that:

  • Floats on your screen as a draggable, always-on-top widget
  • Scans ANY on-screen content — social media feeds, video calls, streaming platforms
  • Color-coded alerts: Green (REAL) → Yellow (UNCERTAIN) → Red (DEEPFAKE)
  • 5-tier confidence system: REAL, LIKELY REAL, UNCERTAIN, LIKELY FAKE, DEEPFAKE
  • Gemini-powered explanations: Hover over the overlay to understand WHY something was flagged

Also supports image, video, and webcam analysis via command-line pipelines.

No uploads. No waiting. Just scroll — and DeepGuard watches your back.


How we built it

DeepGuard uses a modular, real-time architecture:

Component Technology Purpose
Screen Capture mss (thread-safe) Captures screen at 2 FPS
Face Detection MTCNN Locates faces in frames
Classification MesoNet CNN Detects manipulation artifacts
Temporal Aggregation 30-frame sliding window Stabilizes predictions over time
Confidence System 5-tier classification Maps raw scores to human-readable levels
Explainability Gemini 2.0 Flash Generates natural language explanations
Overlay UI PyQt6 Floating, draggable, always-on-top widget

The overlay runs in a separate thread, continuously processing frames while the UI remains responsive. Each component is decoupled, making it easy to swap models or add new detection backends.

Gemini Integration

Gemini is central to DeepGuard's user experience. The ML pipeline produces technical outputs (probability scores, frame counts, trends). Gemini transforms these into human-understandable explanations:

# Technical Output
{"level": "LIKELY_FAKE", "score": 0.72, "trend": "rising"}

# Gemini Transforms To:
"This video shows signs of digital manipulation. The face movements 
appear inconsistent with natural expressions. Consider verifying 
this content from trusted sources before sharing."

We use gemini-2.0-flash-exp for sub-second responses in real-time scenarios.


Challenges we ran into

  • Thread-safety with screen capture: mss isn't thread-safe by default — we solved this with thread-local storage
  • Real-time performance: Balancing detection accuracy with smooth FPS processing
  • Cinematic false positives: Movie scenes with dramatic lighting often trigger false alerts
  • Gemini API reliability: Implemented deterministic fallback explanations when API is unavailable
  • Overlay UX: Making the widget informative but non-intrusive took multiple iterations

Accomplishments that we're proud of

  • First overlay-based deepfake detector that works on arbitrary screen content
  • Zero-upload workflow: Users never leave their current app or browser
  • 5-tier confidence system instead of binary real/fake — because uncertainty matters
  • Gemini-powered explanations that help users understand WHY, not just WHAT
  • Clean, extensible codebase with 5 independent usage modes

What we learned

  • Real-world AI ≠ benchmark AI: A 99% accurate model is useless if it's too slow or confusing
  • Explainability builds trust: Users accept uncertain results when they understand the reasoning
  • UX is safety: A clunky interface means users will disable the tool
  • Conservative design matters: It's better to say "UNCERTAIN" than to wrongly accuse someone

What's next for DeepGuard

  • Browser extension for YouTube, Instagram, and TikTok integration
  • System tray mode that runs silently until a deepfake is detected
  • Transformer-based models for improved accuracy on modern deepfakes
  • Multi-modal analysis using Gemini's vision capabilities
  • Mobile app for on-device protection

Built With

Share this project:

Updates