/ Модель

Характеристики

Лицензия
MIT
Базовая модель
tf_efficientnet_b0.ns_jft_in1k
Библиотека
transformers
Опубликована
23 июн 2026

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

Классификация видеоВидео → label3 профессии
74 773скачиваний за 30 дней2лайкавеса обновлены13 ноя 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Компактная гибридная модель DeepGuard для классификации лицевых изображений и кадров видео как реальных или дипфейковых.

MS-EffGCViT — разработанная в проекте DeepGuard гибридная CNN–Vision Transformer модель для выявления дипфейков. Этот вариант b0 дообучен на базе timm/tf_efficientnet_b0.ns_jft_in1k и рассчитан на классификацию лицевых кадров как реальных или поддельных. Модель принимает изображения и кадры видео с обрезанными лицами; для видео оценки кадров можно агрегировать.

Архитектура сочетает EfficientNet-B0, CNN-эмбеддинг на MBConv-блоках, локальное оконное внимание и глобальный контекст. В README указано разрешение входа 224×224 и приведены результаты на Celeb-DF-v2; показатели на KoDF и FaceForensics++ существенно слабее, поэтому качество на новых доменах может быть ограниченным. Модель распространяется по лицензии MIT.

Сценарии применения

  • проверка изображения лица на признаки дипфейка
  • поиск поддельных лицевых кадров в видеозаписи
  • кадровая классификация видео для последующей агрегации результата
  • анализ лицевых медиафайлов в системах цифровой криминалистики

Ограничения

На тесте, обученном и проверенном на Celeb-DF-v2, результаты высокие, но при проверке на других наборах KoDF и FaceForensics++ точность близка к случайному уровню, что указывает на слабую переносимость между доменами. Предназначена для кадров с обрезанными лицами; заявленный способ обработки видео — классификация кадров с последующей агрегацией.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

🚀 Multi Scale Efficient Global Context Vision Transformer

GitHub PyPI

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.

🤗 Live Demo

🎬 Video Detection🖼️ Image Detection🔍 Explainability (XAI)
Frame-level verdict with per-frame scoresFace crop → real / fake probabilityGrad-CAM maps for low / high branches
Open in SpacesOpen in SpacesOpen in Spaces

⚙️ Model Specifications

SpecDetail
TaskBinary deepfake detection (real / fake)
DomainFrame-level, spatial-domain
InputImage or video (face-cropped)
OutputSigmoid probability in [0, 1] — higher = more likely fake
BackboneEfficientNet (ImageNet-1K pretrained)
FrameworkPyTorch / timm

🧬 Model Zoo

Config⚡ ms_eff_gcvit_b0 (fast)🔥 ms_eff_gcvit_b5 (pro)
Model namems_eff_gcvit_b0ms_eff_gcvit_b5
Backbonetf_efficientnet_b0.ns_jft_in1ktf_efficientnet_b5.ns_jft_in1k
Resolution224×224384×384
Params (M)8.7050.34
FLOPs (G)0.8513.43

🕐 Model Inference Latency

Latency is measured with batch size 1 on a single Tesla T4 and video (num_frames=20).

ModelModeTarget DeploymentLatency (s)Ratio
⚡ ms_eff_gcvit_b0Fast ModeEdge / on-device deployment0.0511.00×
🔥 ms_eff_gcvit_b5Pro ModeEnterprise deployment0.4799.41×

📚 Dataset: Celeb-DF-v2

A large-scale challenging dataset for deepfake forensics [Paper] [Download], featuring 590 YouTube celebrity videos with diverse ages, ethnic groups, and genders.

  • Source: 590 original YouTube videos (celebrities)
  • Synthesis: 5,639 deepfake videos generated from real videos
  • Subjects: Diverse ages, ethnicities, and genders
SourceReal/FakeVideosDescription
celeb-realReal590Celebrity videos from YouTube
youtube-realReal300Additional YouTube videos
celeb-synthesisFake5,639Synthesized from celeb-real

📎 Available at GitHub or Kaggle

📈 Test Evaluation

Trained and tested on the same dataset.

DatasetVariantAccuracyAUCLog Loss
Celeb-DF-v2⚡ Fast0.98420.99650.0283
Celeb-DF-v2🔥 Pro0.99810.99840.0089

📊 Comparison with SOTA Models

ModelTest@AccTest@Auc#Params(M)Params Ratio#FLOPS(G)FLOPS Ratio
ms_eff_gcvit_b098.4%99.7%8.71x0.851x
sia (eccv,2022)99.0%99.8%17.572x2.052.4x
core (cvpr,2022)99.6%99.7%20.812.4x8.409.9x
ms_eff_gcvit_b599.8%99.8%50.345.8x13.4315.8x
iid (cvpr,2023)99.8%99.9%65.57.5x12.714.9x
effort (icml, 2025)99.8%99.7%303.434.9x155.9183.4x

📈 Cross-Dataset Evaluation (Trained on Celeb DF(v2))

Generalization to unseen domains — trained on Celeb DF(v2)

Tested onVariantAccuracyAUCLog Loss
KoDF⚡ Fast0.49350.72581.3459
KoDF🔥 Pro0.48320.71601.4897
FaceForensics++⚡ Fast0.54920.73011.0556
FaceForensics++🔥 Pro0.58250.73070.8897

🚀 Model Usage

pip install "deepguard>=2.0.0"
from transformers import pipeline

🖼️ Image Classification

clf = pipeline(
    "image-classification",
    model="KoreaPeter/ms-eff-gcvit-deepfake-b0-celeb-df-v2", 
    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-b0-celeb-df-v2",  
    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}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · video-classification

Нельзя запустить

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Ревизия весов
0b1703a

0 моделей