SahAi - Enhanced Fake Image Detection Model

SahAi is a fine-tuned Vision Transformer (ViT) model designed for fake image localization in social media.

πŸš€ Model Description

  • Base Model: ViT-B/16
  • Input Size: 224x224
  • Output Classes: Real (0), Fake (1)

πŸ”₯ How to Use

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

model = ViTForImageClassification.from_pretrained("SahilSha/SahAi")
feature_extractor = AutoFeatureExtractor.from_pretrained("google/vit-base-patch16-224-in21k")

image = Image.open("test_image.jpg").convert("RGB")
inputs = feature_extractor(images=image, return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)
    prediction = outputs.logits.argmax(-1).item()

print("Real" if prediction == 0 else "Fake")
Downloads last month
28
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Space using SahilSha/SahAi 1

Evaluation results

  • Accuracy on Real and Fake Face Detection Dataset
    self-reported
    99.120
  • Precision on Real and Fake Face Detection Dataset
    self-reported
    98.950
  • Recall on Real and Fake Face Detection Dataset
    self-reported
    99.000