SAVRN
Search Contact SAVRN

Open-weight model · Video classification

ms-eff-gcvit-deepfake-b5-kodf

by YUNJE SEO KoreaPeter/ms-eff-gcvit-deepfake-b5-kodf

Multi-Scale Efficient Global Context Vision Transformer (MS-EffGCViT) is a hybrid CNN-ViT architecture for deepfake detection.

Parameters53M
Context
Weights226.5 MB
Licensemit
AccessOpen weights
Monthly Downloads13.1k

Runs On

What it takes to serve ms-eff-gcvit-deepfake-b5-kodf (53M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

PrecisionWeightsMemory neededCheapest setupPer hourAlso fits
16-bit 0.1 GB 0.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.1 GB 0.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.0 GB 0.0 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Sep 18, 2026.

Model Card

By YUNJE SEO, published under mit, revision 51f2ac726085.

Multi-Scale Efficient Global Context Vision Transformer (MS-EffGCViT) is a hybrid CNN-ViT architecture for deepfake detection. It fuses CNN-driven spatial inductive bias with hierarchical global-context attention to catch both local artifacts (textures, blending seams) and global artifacts (lighting, structural inconsistency). A single architecture ships in two sizes and three domain-tuned checkpoints, working on both static images and video at the frame level. - Frame-level — one model handles both images and videos (frame-level inference + aggregation). - Cross-domain — robust on both East-Asian (KoDF) and Western (Celeb-DF-v2, FaceForensics++) faces. - Two variants — Fast (b0) for…

Read YUNJE SEO's full model card

Multi Scale Efficient Global Context Vision Transformer

GitHub Repository: HanMoonSub/DeepGuard

Live demo: DeepFake Video Detection

Live demo: DeepFake Image Detection

Live demo: DeepFake Detection XAI

Multi-Scale Efficient Global Context Vision Transformer (MS-EffGCViT) is a hybrid CNN-ViT architecture for deepfake detection. It fuses CNN-driven spatial inductive bias with hierarchical global-context attention to catch both local artifacts (textures, blending seams) and global artifacts (lighting, structural inconsistency).

A single architecture ships in two sizes and three domain-tuned checkpoints, working on both static images and video at the frame level.

Core Features

  • Frame-level — one model handles both images and videos (frame-level inference + aggregation).
  • Cross-domain — robust on both East-Asian (KoDF) and Western (Celeb-DF-v2, FaceForensics++) faces.
  • Two variantsFast (b0) for real-time/edge, Pro (b5) for enterprise accuracy.
  • timm-compatible — load via the timm interface or the deepguard package.

Model Specifications

Spec Detail
Task Binary deepfake detection (real / fake)
Domain Frame-level, spatial-domain
Input Image or video (face-cropped)
Output Sigmoid probability in [0, 1] — higher = more likely fake
Backbone EfficientNet (ImageNet-1K pretrained)
Framework PyTorch / timm

Model Zoo

ms_eff_gcvit_b0 is Optimized for real-time inference and mobile deployment.

ms_eff_gcvit_b5 is Engineered for high-fidelity analysis and enterprise-grade accuracy.

Config Fast (b0) Pro (b5)
Model name ms_eff_gcvit_b0 ms_eff_gcvit_b5
Backbone tf_efficientnet_b0.ns_jft_in1k tf_efficientnet_b5.ns_jft_in1k
Resolution 224×224 384×384
Params (M) 8.7 50.3
FLOPs (G) 0.87 13.64

Dataset: KoDF (Korean Deepfake Dataset)

Large-scale Korean deepfake dataset provided by AI-Hub in 2020

featuring 400 Korean participants across 6 deepfake synthesis methods

  • [x] Number of Subjects: 400 participants
  • [x] Videos per Subject: 150+ videos
  • [x] Total Data Duration: 88.5 days
  • [x] Deepfake Model Variants: 6 types(DeepFaceLab, FaceSwap, FSGAN, FOMM, 3DMM, Wav2Lip)
Metric Original Data Fake Data
Total Videos 62,166 175,776
Average Video Length 90+ second 15+ second
Total Duration 1,500+ hours 625+ hours
Resolution 1920 X 1080 1920 X 1080
FPS 30 FPS 30 FPS
Total Frames 162,000,000+ --

Test Evaluation

Trained and tested on the same dataset.

Dataset Variant Accuracy AUC Log Loss
KoDF Fast 0.9655 0.9792 0.1237
KoDF Pro 0.9792 0.9831 0.0692

Cross-Dataset Evaluation (Trained on KoDF)

Generalization to unseen domains — trained on KoDF, evaluated on western-face datasets.

Tested on Variant Accuracy AUC Log Loss
Celeb-DF-v2 Fast 0.5579 0.4719 1.2605
Celeb-DF-v2 Pro 0.5946 0.5400 1.0078
FaceForensics++ Fast 0.4875 0.5341 1.6178
FaceForensics++ Pro 0.4525 0.5902 1.5321

Model Usage

pip install deepguard
from transformers import pipeline

Image Classification

clf = pipeline(
    "image-classification",
    model="KoreaPeter/ms-eff-gcvit-deepfake-b5-kodf", 
    trust_remote_code=True,
)

# ── Basic Inference ───────────────────────────────────────────────
result = clf("face.jpg")
# [{'label': 'fake', 'score': 0.9712}, {'label': 'real', 'score': 0.0288}]

# ── Custom Parameters ─────────────────────────────────────────────
result = clf(
    "face.jpg",
    margin_ratio=0.2,      # Margin ratio around the detected face bbox (default: 0.2)
    conf_thres=0.5,        # Confidence threshold for YOLO face detection (default: 0.5)
    min_face_ratio=0.01,   # Minimum face-to-frame area ratio to process (default: 0.01)
    tta_hflip=0.0,         # Probability of horizontal flip for TTA (default: 0.0)
    top_k=1,               # Number of top labels to return (default: all)
)
# [{'label': 'fake', 'score': 0.9712}]

Video Classification

clf = pipeline(
    "video-classification",
    model="KoreaPeter/ms-eff-gcvit-deepfake-b5-kodf",
    trust_remote_code=True,
)

# ── Basic Inference ───────────────────────────────────────────────
result = clf("video.mp4")
# [{'label': 'fake', 'score': 0.9634}, {'label': 'real', 'score': 0.0366}]

# ── Custom Parameters ─────────────────────────────────────────────
result = clf(
    "video.mp4",
    num_frames=20,              # Number of frames to sample (default: 20)
    margin_ratio=0.2,           # Margin ratio around the detected face bbox (default: 0.2)
    conf_thres=0.5,             # Confidence threshold for YOLO face detection (default: 0.5)
    min_face_ratio=0.01,        # Minimum face-to-frame area ratio to process (default: 0.01)
    tta_hflip=0.0,              # Probability of horizontal flip for TTA (default: 0.0)
    agg_mode="conf",            # Aggregation mode: 'conf' | 'mean' | 'vote' (default: 'conf')
    return_frame_scores=True,   # Return per-frame scores (default: False)
)
# [{'label': 'fake', 'score': 0.9634},
#  {'label': 'real', 'score': 0.0366},
#  {'frame_scores': [0.97, 0.95, 0.98, ...], 'agg_mode': 'conf'}]

Deep Dive into Model

Part 1: CNN-based Patch Embedding for Spatial Inductive Bias

While traditional Vision Transformers (ViTs) utilize a Linear Projection for patch embedding, our proposed model adopts a CNN-based Patch Embedding module incorporating MBConvBlocks.

  • Injecting Inductive Bias : Standard ViTs often suffer from a lack of inherent spatial inductive bias, typically necessitating massive datasets to learn fundamental visual structures from scratch. In contrast, our CNN-based module leverages overlapping receptive fields to facilitate information sharing between neighboring patches. By explicitly injecting this spatial bias into the architecture, the model achieves more stable and accelerated convergence during the training process.

Part 2: Long-Short Range Spatial Interaction

We utilizes two distinct types of self-attention to capture both long-range and short-range information across feature maps.

  • Local Window Attention: this model efficiently captures local textures and precise spatial details while maintaining linear computational complexity relative to the image size.

  • Global Window Attention: Unlike Swin Transformer, this module utilizes global-queries that interact with local window keys and values. This allows each local region to incorporate global context, effectively capturing long-range dependencies and providing a comprehensive understanding of the entire spatial structure

Part 3: Computational Efficiency

  • Efficient Backbone While both Xception and EfficientNet show great results on DeepFake benchmarks, EfficientNet is chosen for its superior computational efficiency. By utilizing MBconv (Inverted Residual Blocks) and depthwise convolutions, it achieves significantly lower FLOPS compared to Xception.

  • Window-based Attention: Instead of applying self-attention on raw images, this model operates on feature maps extracted from backbone blocks. By partitioning these maps into windows, the $O(N^2)$ complexity is restricted to the window size, siginificantly lowering the computational footprint.

Part 4: Multi-Scale Feature Map Fusion

Modern DeepFakes can leave very localized forgery region. To Capture this, we adopts a multi-scale strategy by extracting features from different levels of the backbone.

  • (Subtle Artifacts): High-Resolution feature maps are extracted from early backbone blocks(l_block_idx) to capture like skin texture or boundary artifacts

  • (Global Features): Low-Resolution feature maps are extracted from deeper blocks(h_block_idx) to analyze overall lighting, shadows, and structural consistency.

  • Feature Fusion: The Outputs from both branches (L-GCViT and H-GCViT) are fused to make a comprehensive decision based on both local and global context.

Citation

@misc{deepguard2026,
  title  = {DeepGuard: Multi-Scale Efficient Global Context Vision Transformer for Deepfake Detection},
  author = {seoyunje},
  year   = {2026},
  url    = {https://github.com/HanMoonSub/DeepGuard}
}

Configuration

Architecture
MsEffGCViTForImageClassification
Model type
ms_eff_gcvit

Identity and Version

Repository
KoreaPeter/ms-eff-gcvit-deepfake-b5-kodf
Publisher
YUNJE SEO
Task
Video classification
Modality
Video
Library
transformers
Parameters
53M parameters
Languages
Not stated by the source
Revision
51f2ac726085296aa6b8af7cdec256332664008c
First published
2026-06-23
Last updated
2026-07-04

Files and Weights

12 files, 229.0 MB in total. The weights are 2 files totalling 226.5 MB in pt, safetensors.

Weights2 files · 226.5 MB
Configuration5 files · 13.2 KB
Documentation1 file · 10.7 KB
Other3 files · 2.5 MB
Repository1 file · 1.6 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights220.1 MB 187cb66e8563
yolov8n-face.ptWeights6.4 MB d545bf1add5a
config.jsonConfiguration1.5 KB
configuration_ms_eff_gcvit.pyConfiguration1.5 KB
modeling_ms_eff_gcvit.pyConfiguration1.3 KB
pipeline_ms_eff_gcvit.pyConfiguration3.5 KB
pipeline_video_ms_eff_gcvit.pyConfiguration5.4 KB
README.mdDocumentation10.7 KB
dual_branch.gifOther2.3 MB 3b17745fc2ef
ms_eff_gcvit.JPGOther100.3 KB 9cc6e353e563
window_attention.JPGOther45.2 KB
.gitattributesRepository1.6 KB

License and Download

License
mit
Access
Open weights, no gate
Download size
226.5 MB
Download from YUNJE SEO

Released by YUNJE SEO through its official repository on Hugging Face. Read the license.

Built From

  • Derived from timm/tf_efficientnet_b5.ns_jft_in1k
  • Trained on (disclosed) ILSVRC/imagenet-1k

Memory Requirements

PrecisionWeights in memory
As published226.5 MB
16-bit0.1 GB
8-bit0.1 GB
4-bit0.0 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About ms-eff-gcvit-deepfake-b5-kodf

How much GPU memory does ms-eff-gcvit-deepfake-b5-kodf need?

About 0.1 GB at 16-bit and 0 GB at 4-bit: the weights (53M parameters) plus a working margin. A long context needs more.

What is the cheapest GPU to run ms-eff-gcvit-deepfake-b5-kodf on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

Can I use ms-eff-gcvit-deepfake-b5-kodf commercially?

Yes. ms-eff-gcvit-deepfake-b5-kodf is released under MIT License. The MIT License is a short permissive license. It permits commercial use, modification and redistribution, provided the copyright notice and permission notice are included.

Similar Models

Model · Video classification

ms-eff-gcvit-deepfake-b5-celeb-df-v2

YUNJE SEO

Multi-Scale Efficient Global Context Vision Transformer (MS-EffGCViT) is a hybrid CNN-ViT architecture for deepfake detection. It fuses CNN-driven spatial inductive bias with hierarchical global-context attention to catch both local artifacts (textures, blending seams) and global artifacts (lighting, structural inconsistency). A single architecture ships in two sizes and three domain-tuned checkpoints, working on both static images and video at the frame level. - Frame-level — one model handles both images and videos (frame-level inference + aggregation). - Cross-domain — robust on both East-Asian (KoDF) and Western (Celeb-DF-v2, FaceForensics++) faces. - Two variants — Fast (b0) for…

Open weights mit 53M parameters transformers

Model · Video classification

ms-eff-gcvit-deepfake-b5-ff-plus-plus

YUNJE SEO

Multi-Scale Efficient Global Context Vision Transformer (MS-EffGCViT) is a hybrid CNN-ViT architecture for deepfake detection. It fuses CNN-driven spatial inductive bias with hierarchical global-context attention to catch both local artifacts (textures, blending seams) and global artifacts (lighting, structural inconsistency). A single architecture ships in two sizes and three domain-tuned checkpoints, working on both static images and video at the frame level. - Frame-level — one model handles both images and videos (frame-level inference + aggregation). - Cross-domain — robust on both East-Asian (KoDF) and Western (Celeb-DF-v2, FaceForensics++) faces. - Two variants — Fast (b0) for…

Open weights mit 53M parameters transformers

Model · Video classification

VideoMAEv2-Base

OpenGVLab

VideoMAEv2-Base model pre-trained for 800 epochs in a self-supervised way on UnlabeldHybrid-1M dataset. It was introduced in the paper [[CVPR23]VideoMAE V2: Scaling Video Masked Autoencoders with Dual Masking](https://arxiv.org/abs/2203.12602) by Wang et al. and first released in GitHub. You can use the raw model for video feature extraction. Here is how to use this model to extract a video feature

Open weights cc-by-nc-4.0 86M parameters

This model is a fine-tuned version of MCG-NJU/videomae-base-finetuned-kinetics on an unknown dataset. It achieves the following results on the evaluation set: The following hyperparameters were used during training: - learningrate: 5e-05 - trainbatchsize: 16 - evalbatchsize: 16 - lrschedulertype: linear - lrschedulerwarmupratio: 0.1 - trainingsteps: 348 - Transformers 4.49.0 - Pytorch 2.6.0+cu126 - Datasets 3.3.2 - Tokenizers 0.21.0

Open weights cc-by-nc-4.0 86M parameters transformers

Model · Video classification

videomae-violence-detector

Oleg Radzhabov

This model is a fine-tuned version of MCG-NJU/videomae-base for binary violence classification (violent / non-violent). It builds on Nikeytas/videomae-crime-detector-production-v1, which was itself fine-tuned from videomae-base on a subset of UCF Crime. Starting from that checkpoint, this model was further fine-tuned on the Bus Violence Dataset to close the domain gap to public-transport surveillance footage. - UCF Crime (jinmang2/ucfcrime) — inherited from the base checkpoint - Bus Violence Dataset (Zenodo) — real moving-bus footage, binary violent / non-violent labels, used for domain-specific fine-tuning Evaluated on a held-out Bus Violence Dataset test split (n = 280). The base…

Open weights mit 86M parameters

Model · Video classification

videomae-base-finetuned-ucf101-subset

Hon Nguyen

This model is a fine-tuned version of MCG-NJU/videomae-base on an unknown dataset. It achieves the following results on the evaluation set: The following hyperparameters were used during training: - learningrate: 5e-05 - trainbatchsize: 8 - evalbatchsize: 8 - lrschedulertype: linear - trainingsteps: 370 - Transformers 5.16.1 - Pytorch 2.14.0+cu126 - Datasets 5.0.1 - Tokenizers 0.23.2

Open weights cc-by-nc-4.0 86M parameters transformers