Views
No views yet
facebook/deit-base-patch16-224 for deepfake image classification. The model has been trained to classify images as 'Fake' or 'Real' using the Deepfake and Real Images dataset, which is derived from the OpenForensics Dataset.transformers library (Trainer API):| Metric | Value |
|---|---|
| Test Loss | 0.0219 |
| Accuracy | 0.9922 |
| Macro F1-Score | 0.9922 |
| AUROC | 0.9997 |
| Runtime (s) | 48.26 |
| Samples/sec | 395.23 |
| Steps/sec | 6.18 |
| Class | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|
| Fake | 0.9909 | 0.9936 | 0.9922 | 9521 |
| Real | 0.9936 | 0.9909 | 0.9922 | 9520 |
| Accuracy | 0.9922 | 19041 | ||
| Macro avg | 0.9922 | 0.9922 | 0.9922 | 19041 |
| Weighted avg | 0.9922 | 0.9922 | 0.9922 | 19041 |
1 from transformers import AutoFeatureExtractor, AutoModelForImageClassification
2 from PIL import Image
3 import torch
4
5 # Load an image
6 image = Image.open("sample_image.jpg")
7
8 # Prepare inputs
9 inputs = extractor(images=image, return_tensors="pt")
10
11 # Run inference
12 with torch.no_grad():
13 outputs = model(**inputs)
14 logits = outputs.logits
15 predicted_class = logits.argmax(-1).item()
16
17 labels = model.config.id2label
18 print(f"Predicted class: {labels[predicted_class]}") @article{KUMAR2026100734,
title = {DeiTFake: Deepfake detection model using DeiT multi-stage training},
journal = {Array},
pages = {100734},
year = {2026},
issn = {2590-0056},
doi = {https://doi.org/10.1016/j.array.2026.100734},
url = {https://www.sciencedirect.com/science/article/pii/S2590005626000573},
author = {Saksham Kumar and Ashish Singh and Srinivasarao Thota and Sunil Kumar Singh and Chandan Kumar},
keywords = {DeepFake detection, DeiT, Vision transformers, Transfer learning, Progressive training, OpenForensics},
abstract = {Deepfakes are major threats to the integrity of digital media. We propose DeiTFake, a DeiT-based transformer and a two-stage progressive training strategy with increasing augmentation complexity. The approach applies an initial transfer-learning phase with standard augmentations, followed by a fine-tuning phase using advanced affine and color-based augmentations. We use DeiT models pre-trained weights, providing a strong initialization for learning manipulation artifacts, increasing the robustness of the detection model. Trained on a face-cropped dataset derived from the OpenForensics dataset (190,335 images), DeiTFake achieves 98.71% accuracy after stage one and 99.22% accuracy with an AUROC of 99.97%, after stage two, achieving strong performance under the same face-level evaluation setting. We analyze augmentation impact and training schedules, and provide practical benchmarks for facial deepfake detection.}
}