ONNX Model Zoo

prithivMLmods/Deepfake-Detection-Exp-02-22-ONNX

By prithivMLmods · ↓ 9 · ♥ 0 · Updated 2025-02-20

What's in this repo

This page lists the files in prithivMLmods/Deepfake-Detection-Exp-02-22-ONNX, including model.onnx, model_bnb4.onnx, model_fp16.onnx and more.

  • 8 ONNX models (.onnx files)
  • 13 files, including 8 .onnx, 3 .json, 1 .md
  • Last updated 2025-02-20

ONNX files

File Size Download
onnx/model.onnx — Download
onnx/model_bnb4.onnx — Download
onnx/model_fp16.onnx — Download
onnx/model_int8.onnx — Download
onnx/model_q4.onnx — Download
onnx/model_q4f16.onnx — Download
onnx/model_quantized.onnx — Download
onnx/model_uint8.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

2.png

Deepfake-Detection-Exp-02-22-ONNX

Deepfake-Detection-Exp-02-22 is a minimalist, high-quality dataset trained on a ViT-based model for image classification, distinguishing between deepfake and real images. The model is based on Google's google/vit-base-patch32-224-in21k.

Mapping of IDs to Labels: {0: 'Deepfake', 1: 'Real'} 

Mapping of Labels to IDs: {'Deepfake': 0, 'Real': 1}
Classification report:
        
                      precision    recall  f1-score   support
        
            Deepfake     0.9833    0.9187    0.9499      1600
                Real     0.9238    0.9844    0.9531      1600
        
            accuracy                         0.9516      3200
           macro avg     0.9535    0.9516    0.9515      3200
        weighted avg     0.9535    0.9516    0.9515      3200

download (1).png

Inference with Hugging Face Pipeline

from transformers import pipeline

# Load the model
pipe = pipeline('image-classification', model="prithivMLmods/Deepfake-Detection-Exp-02-22", device=0)

# Predict on an image
result = pipe("path_to_image.jpg")
print(result)

Inference with PyTorch

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

# Load the model and processor
model = ViTForImageClassification.from_pretrained("prithivMLmods/Deepfake-Detection-Exp-02-22")
processor = ViTImageProcessor.from_pretrained("prithivMLmods/Deepfake-Detection-Exp-02-22")

# Load and preprocess the image
image = Image.open("path_to_image.jpg").convert("RGB")
inputs = processor(images=image, return_tensors="pt")

# Perform inference
with torch.no_grad():
    outputs = model(**inputs)
    logits = outputs.logits
    predicted_class = torch.argmax(logits, dim=1).item()

# Map class index to label
label = model.config.id2label[predicted_class]
print(f"Predicted Label: {label}")

Limitations

  1. Generalization Issues – The model may not perform well on deepfake images generated by unseen or novel deepfake techniques.
  2. Dataset Bias – The training data might not cover all variations of real and fake images, leading to biased predictions.
  3. Resolution Constraints – Since the model is based on vit-base-patch32-224-in21k, it is optimized for 224x224 image resolution, which may limit its effectiveness on high-resolution images.
  4. Adversarial Vulnerabilities – The model may be susceptible to adversarial attacks designed to fool vision transformers.
  5. False Positives & False Negatives – The model may occasionally misclassify real images as deepfake and vice versa, requiring human validation in critical applications.

Intended Use

  1. Deepfake Detection – Designed for identifying deepfake images in media, social platforms, and forensic analysis.
  2. Research & Development – Useful for researchers studying deepfake detection and improving ViT-based classification models.
  3. Content Moderation – Can be integrated into platforms to detect and flag manipulated images.
  4. Security & Forensics – Assists in cybersecurity applications where verifying the authenticity of images is crucial.
  5. Educational Purposes – Can be used in training AI practitioners and students in the field of computer vision and deepfake detection.

Model info

image-classification transformers
transformers onnx vit image-classification Deepfake en dataset:prithivMLmods/Deepfake-vs-Real base_model:prithivMLmods/Deepfake-Detection-Exp-02-22 base_model:quantized:prithivMLmods/Deepfake-Detection-Exp-02-22 license:apache-2.0 endpoints_compatible region:us
↓ 9 ♥ 0

Created: 2025-02-19

Updated: 2025-02-20

View on Hugging Face

Files (13)

.gitattributes
README.md
config.json
onnx/model.onnx ONNX
onnx/model_bnb4.onnx ONNX
onnx/model_fp16.onnx ONNX
onnx/model_int8.onnx ONNX
onnx/model_q4.onnx ONNX
onnx/model_q4f16.onnx ONNX
onnx/model_quantized.onnx ONNX
onnx/model_uint8.onnx ONNX
preprocessor_config.json
quantize_config.json

Related models