Run this model with HF Jobs
Run einrafh/verichain-deepfake-models on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/einrafh/verichain-deepfake-models. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/einrafh/verichain-deepfake-models on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use einrafh/verichain-deepfake-models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use einrafh/verichain-deepfake-models with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="einrafh/verichain-deepfake-models") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("einrafh/verichain-deepfake-models", device_map="auto") - Notebooks
- Google Colab
- Kaggle
VeriChain Deepfake Detection Model - ViT
This repository contains the artifacts for the Vision Transformer (ViT) model fine-tuned for the task of Deepfake detection, developed as part of the VeriChain project.
The model is trained to classify an image into one of three categories: Real, AI-Generated, or Deepfake.
Repository Structure
The model artifacts in this repository are organized as follows:
- /models/vit-deepfake-model/: Contains the final, fine-tuned PyTorch model files, ready to be loaded with the
transformerslibrary. - /models/onnx/: Contains the model converted to the ONNX format, optimized for production deployment and inference.
- /assets/: Contains visual assets for documentation, such as the confusion matrix.
How to Use (PyTorch Model)
You can use the fine-tuned PyTorch model directly with the pipeline function from the transformers library. Make sure to specify the correct subfolder.
from transformers import pipeline
from PIL import Image
# Load the image classification pipeline with your model
# The 'subfolder' parameter points to the directory containing the model files
classifier = pipeline(
"image-classification",
model="einrafh/verichain-deepfake-models",
subfolder="models/vit-deepfake-model"
)
# Load an image you want to classify
# Make sure to replace 'path/to/your/image.jpg' with an actual image file
try:
image = Image.open('path/to/your/image.jpg')
results = classifier(image)
print(results)
except FileNotFoundError:
print("Please provide a valid path to an image file.")
# Example Output:
# [{'label': 'Deepfake', 'score': 0.9985}, {'label': 'AI Generated', 'score': 0.0010}, {'label': 'Real', 'score': 0.0005}]
Evaluation Results
The model was evaluated on a held-out test set of 2,000 images, achieving near-perfect performance.
| Metric | Score |
|---|---|
| Test Accuracy | 0.9990 |
| F1-Score (Macro) | 0.9990 |
| Test Loss | 0.0202 |
Classification Report
| Class | Precision | Recall | F1-Score |
|---|---|---|---|
| AI Generated | 1.0000 | 0.9970 | 0.9985 |
| Deepfake | 0.9970 | 1.0000 | 0.9985 |
| Real | 1.0000 | 1.0000 | 1.0000 |
Confusion Matrix
The confusion matrix below shows the model's high precision and recall across all classes, with very few misclassifications.
Citation
If you use this model in your work, please consider citing this repository.
@misc{verichain_model_2025,
author = {Muhammad Rafly Ash Shiddiqi},
title = {VeriChain Deepfake Detection Model - ViT},
year = {2025},
publisher = {Hugging Face},
journal = {Hugging Face repository},
howpublished = {\url{[https://huggingface.co/einrafh/verichain-deepfake-models](https://huggingface.co/einrafh/verichain-deepfake-models)}},
}
License
Copyright (c) 2025 Muhammad Rafly Ash Shiddiqi.
