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 variants — Fast (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
Number of Subjects: 400 participants
Videos per Subject: 150+ videos
Total Data Duration: 88.5 days
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.
1clf = pipeline(2"image-classification",3 model="KoreaPeter/ms-eff-gcvit-deepfake-b5-kodf",4 trust_remote_code=True,5)67# ── Basic Inference ───────────────────────────────────────────────8result = clf("face.jpg")9# [{'label': 'fake', 'score': 0.9712}, {'label': 'real', 'score': 0.0288}]1011# ── Custom Parameters ─────────────────────────────────────────────12result = clf(13"face.jpg",14 margin_ratio=0.2,# Margin ratio around the detected face bbox (default: 0.2)15 conf_thres=0.5,# Confidence threshold for YOLO face detection (default: 0.5)16 min_face_ratio=0.01,# Minimum face-to-frame area ratio to process (default: 0.01)17 tta_hflip=0.0,# Probability of horizontal flip for TTA (default: 0.0)18 top_k=1,# Number of top labels to return (default: all)19)20# [{'label': 'fake', 'score': 0.9712}]
🎬 Video Classification
python
1clf = pipeline(2"video-classification",3 model="KoreaPeter/ms-eff-gcvit-deepfake-b5-kodf",4 trust_remote_code=True,5)67# ── Basic Inference ───────────────────────────────────────────────8result = clf("video.mp4")9# [{'label': 'fake', 'score': 0.9634}, {'label': 'real', 'score': 0.0366}]1011# ── Custom Parameters ─────────────────────────────────────────────12result = clf(13"video.mp4",14 num_frames=20,# Number of frames to sample (default: 20)15 margin_ratio=0.2,# Margin ratio around the detected face bbox (default: 0.2)16 conf_thres=0.5,# Confidence threshold for YOLO face detection (default: 0.5)17 min_face_ratio=0.01,# Minimum face-to-frame area ratio to process (default: 0.01)18 tta_hflip=0.0,# Probability of horizontal flip for TTA (default: 0.0)19 agg_mode="conf",# Aggregation mode: 'conf' | 'mean' | 'vote' (default: 'conf')20 return_frame_scores=True,# Return per-frame scores (default: False)21)22# [{'label': 'fake', 'score': 0.9634},23# {'label': 'real', 'score': 0.0366},24# {'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
bibtex
1@misc{deepguard2026,
2 title = {DeepGuard: Multi-Scale Efficient Global Context Vision Transformer for Deepfake Detection},
3 author = {seoyunje},
4 year = {2026},
5 url = {https://github.com/HanMoonSub/DeepGuard}
6}