MFFI-Models / README.md
lucasoc's picture
docs(readme): update README with SRM representation, DF-40 breakdown and top ensembles
f2dee3c verified
|
Raw History Blame Contribute Delete
4.33 kB
metadata
license: mit
tags:
  - deepfake-detection
  - face-forgery
  - fourier-transform
  - steganalysis
  - srm
  - computer-vision
  - pytorch

MFFI: Model Checkpoints & Benchmarks for Face Forgery Detection

Public weights, representations, and experiment artifacts for the project:

Benchmarking Spatial, Spectral, and Self-Supervised Cues for Face Forgery Detection under Realistic Degradation
πŸ”— Official Codebase: github.com/lucasdocunha/tcc


πŸ“Œ Overview

This repository hosts official pre-trained and fine-tuned model checkpoints (best.pth), evaluation metrics, and experiment configurations evaluated across FaceForensics++ (clean and test_d), Celeb-DF v2, and the DF-40 (DeepFake-40) benchmarks.

Included Model Families:

  • CLIP-ViT-B/16 (Multimodal Vision Transformer, OpenAI)
  • DINO (ConvNeXt-Base) (Self-supervised distillation via DINOv3 LVD-1689M)
  • ViT-B/16 (Vision Transformer, ImageNet-21k)
  • Xception (Depthwise Separable CNN)
  • ResNet-18 (Residual CNN)
  • MobileNetV3-Large (Efficient Mobile CNN with Squeeze-and-Excitation)
  • Mixture of Experts (MoE) (Standard and Frequency-specialized MoE architectures)

Feature Representations & Frequency Modes:

  • none: Spatial domain RGB (3 channels)
  • srm: Steganalysis Rich Models (SRM) high-pass residual filters (3 channels: horizontal, vertical, diagonal edge residuals)
  • magnitude: FFT Log-Magnitude $\log(|F| + 1)$ (1 channel)
  • phase: FFT Phase angle $[0, 1]$ (1 channel)
  • complex: Real and Imaginary components (2 channels)
  • concat: Spatial RGB concatenated with FFT Magnitude (4 channels)
  • frequency_3: High-pass filtered magnitude (1 channel)
  • concat_frequency: Multi-domain RGB + Magnitude + Phase + HighPass + LowPass (7 channels)

πŸ† Benchmark Highlights: SRM & Top Ensembles

1. Top Ensemble (CLIP-SRM + DINO-SRM)

Evaluating across 5 statistical seeds (42, 123, 2024, 7, 2025):

  • FF++ Test Limpo: 94.17% AUC (Mega 10x) / 93.07% Β± 0.61% (Ensemble 2x)
  • FF++ Test-D (DifΓ­cil): 88.60% AUC (Mega 10x) / 87.24% Β± 0.49% (Ensemble 2x)
  • DF-40 (40 Generative Methods): 84.15% AUC (Mega 10x) / 83.53% Β± 1.74% (Ensemble 2x)
  • Celeb-DF v2: 75.06% AUC (Mega 10x) / 74.11% Β± 3.14% (Ensemble 2x)

2. DF-40 Breakdown by Paradigm:

  • Editing (T2I & Inversion): 97.47% Recall
  • Face Swap: 93.30% Recall
  • Diffusion (SD 2.1, PixArt, DiT): 93.32% Recall (SD 2.1: 100%, PixArt: 99.6%)
  • GANs (StyleGAN 2/3, VQGAN): 90.96% Recall (StyleGAN 2/3: 100%)
  • Commercial Avatars & Talking Heads: 68.53% AUC (HeyGen: 33.2% recall)

πŸ“‚ Repository Structure

β”œβ”€β”€ <model_family>/
β”‚   └── srm/
β”‚       └── finetune_robust/
β”‚           └── seed_<seed>/
β”‚               β”œβ”€β”€ weights/best.pth       # Best checkpoint saved by validation ROC-AUC
β”‚               β”œβ”€β”€ results/metrics_*.csv  # Full metrics across test, test_d, df40, celeb_df
β”‚               β”œβ”€β”€ results/run_config.json# Hyperparameters and seed configuration
β”‚               └── plots/*.png            # Confusion matrix and ROC-AUC plots
β”œβ”€β”€ tables/                                # Consolidated CSV benchmark tables
β”‚   β”œβ”€β”€ tabela9_srm_5seeds.csv
β”‚   β”œβ”€β”€ df40_srm_breakdown_by_paradigm.csv
β”‚   └── df40_srm_breakdown_by_technique.csv
└── figures/                               # Multimodal attention rollout maps
    └── heatmap_clip_dino_fusion_4rows.png

πŸš€ How to Download & Load Weights

import torch
from huggingface_hub import hf_hub_download

# Download best.pth for CLIP (SRM mode, finetune_robust, seed 42)
checkpoint_path = hf_hub_download(
    repo_id="lucasoc/MFFI-Models",
    filename="clip/srm/finetune_robust/seed_42/weights/best.pth"
)

# Load state dict
state_dict = torch.load(checkpoint_path, map_location="cpu", weights_only=True)
print(f"Loaded {len(state_dict)} tensors successfully!")

πŸ“„ Codebase & Citation

For reproduction scripts, training configurations, and data preparation pipelines: