/ Модель

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

Параметры
113 млн
Лицензия
MIT
Архитектура
vit · dense
Базовая модель
vit-base-patch16-224-in21k
Библиотека
transformers
Опубликована
9 мая 2025

ViT-Deepfake-Classifier

Классификация изображенийИзображение → label5 профессий
146скачиваний за 30 дней1лайквеса обновлены16 ноя 2026

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

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

Классификатор на базе ViT определяет, является ли изображение реальным или сгенерированным либо изменённым.

hamzenium/ViT-Deepfake-Classifier — модель компьютерного зрения, дообученная авторами карточки на базе google/vit-base-patch16-224-in21k. Она использует Vision Transformer (ViT) с архитектурой ViTForImageClassification и содержит 113,2 млн параметров. Модель классифицирует изображения по двум категориям: реальные и поддельные — сгенерированные ИИ или изменённые.

Модель предназначена для выявления дипфейков, проверки подлинности медиаматериалов и исследовательских задач. В README указаны точность 96,56% на тестовой выборке OpenForensics и предпочтительный размер изображений около 224×224 пикселей. Язык модели не применим: входом служит изображение, выходом — метка класса.

Обучение проведено на OpenForensics, поэтому результаты могут ухудшаться на изображениях и методах подделки, отсутствовавших в обучающих данных. Устойчивость к состязательным атакам не проверялась; возможны ошибки и смещения в зависимости от источника, качества и содержания изображения. Модель не следует использовать как единственное основание для важных решений об аутентичности. Метаданные указывают лицензию MIT, тогда как README — Apache 2.0; лицензию следует сверить с файлами репозитория.

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

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

Ограничения

Обучение на OpenForensics может ограничивать обобщение на новые способы генерации и манипуляции; устойчивость к состязательным атакам не проверялась. Возможны ошибки в зависимости от источника и качества изображения, а оптимальный размер входа — около 224×224 пикселей; модель не следует использовать как единственное основание для важных решений.

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

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

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

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

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

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

ViT Deepfake Detector

AI-Powered Image Forensics | Vision Transformer | 96.56% Test Accuracy

An advanced computer vision model designed to distinguish authentic images from manipulated and AI-generated visual content. Built on Google's Vision Transformer (ViT-Base), this model leverages transfer learning and fine-tuning on the OpenForensics dataset to identify visual patterns associated with image manipulation.

Developed with a focus on accuracy, accessibility, and practical deployment, the model provides a lightweight foundation for image authenticity research, content verification pipelines, and computer vision applications.


Overview

The ViT Deepfake Detector is a binary image classification model that analyzes visual representations to predict whether an image is authentic or manipulated.

Built on google/vit-base-patch16-224-in21k, the model uses self-attention mechanisms to capture relationships across image patches, enabling it to learn complex visual features associated with manipulated imagery.

The model was fine-tuned on the OpenForensics dataset and evaluated on a held-out test set.

Key Highlights

  • 96.56% Test Accuracy on a held-out evaluation set.
  • Vision Transformer Architecture leveraging pretrained ViT representations.
  • 16,000 Training Images from the OpenForensics dataset.
  • 10-Epoch Fine-Tuning Pipeline using mixed-precision training.
  • Fast Inference through the Hugging Face Transformers ecosystem.
  • Ready for Integration into Python-based computer vision applications.

Model Specifications

AttributeDetails
ArchitectureVision Transformer (ViT-Base)
Base Modelgoogle/vit-base-patch16-224-in21k
TaskBinary Image Classification
ClassesReal / Fake
Training DatasetOpenForensics
Training Samples16,000
Validation Samples2,000
Test Samples2,000
Input Resolution224 × 224
FrameworkPyTorch / Hugging Face Transformers
PrecisionFP16 Mixed Precision
LicenseMIT

Performance & Evaluation

The model was evaluated using a dedicated test set containing 2,000 images.

Benchmark Results

Evaluation MetricScore
Test Accuracy96.56%
Validation Accuracy96.22%
Validation F196.22%
Validation Precision96.30%
Validation Recall96.22%

Training Performance

The model demonstrated consistent convergence during fine-tuning, achieving its strongest validation accuracy at Epoch 5.

EpochTraining LossValidation LossAccuracy
10.22590.256792.89%
20.20020.236093.44%
30.13880.192596.11%
40.13220.216195.67%
50.11820.220896.22%

Note: Test accuracy is reported separately from validation performance.

Architecture

The model uses a pretrained Vision Transformer (ViT), which processes images as sequences of patches rather than relying exclusively on traditional convolutional operations.

The architecture consists of:

  1. Image Preprocessing: Images are resized and normalized using the pretrained ViT image processor.
  2. Patch Embedding: Input images are divided into fixed-size patches.
  3. Transformer Encoder: Self-attention layers learn spatial relationships and visual representations.
  4. Classification Head: The learned representations are mapped to two output classes.
  5. Prediction: Softmax probabilities provide the model's confidence scores for real and fake classifications.

Training Configuration

The model was fine-tuned using the following configuration:

HyperparameterValue
OptimizerAdamW
Learning Rate3e-5
Batch Size24
Epochs10
Weight Decay0.02
Warmup Ratio0.08
SchedulerCosine
Label Smoothing0.05
Mixed PrecisionFP16
Gradient Accumulation1
HardwareNVIDIA Tesla T4
Training DurationApproximately 14 minutes

Preprocessing and normalization were performed using Hugging Face's ViTImageProcessor.

Quick Start

Get started with the model in just a few lines of Python.

1. Installation

pip install transformers torch pillow

2. Load the Model

import torch
from PIL import Image
from transformers import (
    ViTImageProcessor,
    ViTForImageClassification
)

MODEL_ID = "hamzenium/vit-deepfake-detector"

processor = ViTImageProcessor.from_pretrained(MODEL_ID)
model = ViTForImageClassification.from_pretrained(MODEL_ID)

model.eval()

3. Run Inference

image = Image.open("image.jpg").convert("RGB")

inputs = processor(images=image, return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)
    probabilities = torch.softmax(outputs.logits, dim=-1)

predicted_class = probabilities.argmax(dim=-1).item()
confidence = probabilities[0][predicted_class].item()

labels = {0: "Real", 1: "Fake"}

print("Prediction:", labels[predicted_class])
print(f"Confidence: {confidence:.2%}")

4. Batch Inference

from transformers import pipeline

detector = pipeline(
    "image-classification",
    model=MODEL_ID
)

images = [
    "image1.jpg",
    "image2.jpg",
    "image3.jpg"
]

for image_path in images:
    result = detector(image_path)
    print(image_path, result)

Potential Applications

The model can serve as a building block for a variety of computer vision and digital forensics workflows.

  • Digital Image Forensics: Analyze images for potential manipulation.
  • Content Moderation: Support automated visual content screening.
  • Media Verification: Assist in evaluating the authenticity of digital imagery.
  • AI Research: Experiment with transformer-based approaches to synthetic image detection.
  • Computer Vision Pipelines: Integrate binary authenticity classification into larger ML systems.

Limitations & Responsible Use

Although the model demonstrates strong performance on its evaluation dataset, deepfake detection remains an evolving research challenge.

  • Dataset Generalization: Performance may vary on generation techniques and manipulation methods not represented in OpenForensics.
  • Domain Shift: Compression, image resizing, and different image sources may affect predictions.
  • Adversarial Robustness: The model has not been comprehensively evaluated against adversarial attacks.
  • Resolution Sensitivity: The model uses a 224 × 224 input resolution.
  • False Predictions: A high-confidence prediction does not establish the authenticity or provenance of an image.

This model should be treated as an analytical aid rather than a definitive authenticity verification system. Human review is recommended for consequential decisions.

Research & Development

This project explores the application of transformer-based architectures to digital image forensics, with an emphasis on accessible model distribution and reproducible inference.

The model is released to support further experimentation, benchmarking, and development within the computer vision and AI research communities.

Contributors

  • Dr. Lucy Liu
  • Muhammad Hamza Sohail
  • Ayaan Mohammed
  • Shadab Karim
  • Kirti Dhir

License

Released under the MIT License, allowing developers and researchers to use, modify, and integrate the model in accordance with the license terms.

Citation

If you use this model in research or development, please cite:

@misc{vit-deepfake-detector,
  title={ViT Deepfake Detector},
  author={Liu, Lucy and Sohail, Muhammad Hamza and
          Mohammed, Ayaan and Karim, Shadab and Dhir, Kirti},
  year={2024},
  publisher={Hugging Face},
  howpublished={https://huggingface.co/hamzenium/vit-deepfake-detector}
}

Built for experimentation. Released for the AI research community.

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

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

GPU в ailist

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

Можно запустить

Подбираем GPU…

Класс архитектуры
ViTForImageClassification
Ревизия весов
e4455e6

0 моделей