Downloads · 30 days
0
yyouretoast/deepfake-detector
deepfake-detector is a image classification model from yyouretoast. Use it when you need a label for an image. It is set up for pytorch. The card lists the license as mit.
A PyTorch deepfake detection architecture fusing a ConvNeXt-Small spatial backbone with a 4-stage ResSE-Spectral Tower (Steganographic Rich Model + Bayar-Stamm 2D Real FFT decomposition), High-Frequency SNR-Adaptive G…
Downloads · 30 days
0
Access
Public
Updated Sep 25, 2026
Repo size
1.1 GB
Likes
0
Public
Click a slice to open those files.
.pth643 MB · 100%
From the Hugging Face model README
A PyTorch deepfake detection architecture fusing a ConvNeXt-Small spatial backbone with a 4-stage ResSE-Spectral Tower (Steganographic Rich Model + Bayar-Stamm 2D Real FFT decomposition), High-Frequency SNR-Adaptive Gating, Platt probability calibration, and a Dual-Path (Attention + Global Max-Pooling) Bi-GRU temporal video sequence head.
| Checkpoint | File Size | Description | SHA-256 Checksum |
|---|---|---|---|
dual_stream_calibrated.pth | 214.7 MB | Primary spatial-spectral hybrid backbone with ResSE Tower and post-hoc calibration ($T^* = 4.288$, $\tau^* = 0.4200$). | cacdd1f63a089f157d7cec384df632a37ee107830bd52a71d7faabeb50fd5237 |
temporal_head_best.pth | 13.3 MB | 2-Layer Bi-GRU video sequence head evaluating multi-frame velocity deltas and attention weights. | 5976689a9132bdad51bb09cedc48c8ebbd425f353849ad15aa67073058d0700e |
import torch
from huggingface_hub import hf_hub_download
# Download calibrated weights
ckpt_path = hf_hub_download(
repo_id="yyouretoast/deepfake-detector",
filename="dual_stream_calibrated.pth"
)
checkpoint = torch.load(ckpt_path, map_location="cpu", weights_only=False)
optimal_threshold = float(checkpoint.get("optimal_threshold", 0.4200))
temperature = float(checkpoint.get("temperature", 4.2880))
tau_real = float(checkpoint.get("tau_real", 0.40))
tau_fake = float(checkpoint.get("tau_fake", 0.60))
print(f"Loaded model calibrated with T*={temperature:.3f}, optimal threshold τ*={optimal_threshold:.2f}")
Using the official repository engine:
from src.services.video_engine import process_single_image
# Runs YuNet 5-point face alignment, dual-stream inference, and telemetry
report = process_single_image("suspect_face.jpg")
print("Verdict:", report["three_zone"]["verdict"])
print("Calibrated Probability:", report["prob"])
print("Spectral vs Spatial Gate:", f"{report['spectral_gate']*100:.1f}% / {report['spatial_gate']*100:.1f}%")
print("SNR Attenuation (γ):", report["snr_attenuator"])
Evaluated across 13,444 facial crops (756 authentic real faces, 12,688 deepfakes across 5 generator families) and 1,120 video sequences:
| Metric | Single-Frame Spatial Model | Video Spatiotemporal Bi-GRU | Delta / Impact |
|---|---|---|---|
| ROC AUC | 0.8248 | 0.8719 | +4.71% discriminative improvement |
| PR AUC | 0.8115 | 0.9904 | Precision-recall area under curve |
| Equal Error Rate (EER) | 24.10% | 18.98% | -5.12% biometric verification error drop |
| Fake Precision | 98.00% | 98.60% | +0.60% false alarm suppression |
| Fake Recall | 77.04% | 79.75% | +2.71% detection coverage |
| Overall Accuracy | 76.85% | 79.82% | +2.97% classification rate |
| Expected Calibration Error (ECE) | 0.0050 | -- | Platt-calibrated ($98.9%$ error drop from raw $0.4525$) |
0.99750.97490.96250.90910.8166@misc{deepfake_forensics_2026,
author = {Yassin},
title = {Dual-Stream Deepfake Forensics Engine: Spatial ConvNeXt and ResSE-Spectral Gated Fusion with Spatiotemporal Sequence Modeling},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/yyouretoast/deepfake-detector}}
}