vit-face-real-vs-fake

This model is a fine-tuned version of google/vit-base-patch16-224-in21k on the desireemcv/face-real-vs-fake dataset. It achieves the following results on the evaluation set:

  • Loss: 0.2046
  • Accuracy: 0.9467

Model description

More information neeThis model is a fine-tuned Vision Transformer (ViT-Base) for binary image classification of human faces as either REAL (authentic photographs) or FAKE (AI-generated). It was fine-tuned from google/vit-base-patch16-224-in21k on the Computer Vision Face Classification Dataset (v2.0, 2026), which contains facial images sourced from Unsplash (real) and various AI generation methods (fake).

The model achieves 94.67% accuracy on the test set, with balanced performance across both classes (F1=0.94 for FAKE, F1=0.95 for REAL). It was trained for 4 epochs using PyTorch and the Hugging Face Transformers library on a Google Colab T4 GPU.ded

Intended uses & limitations

This model is intended for detecting AI-generated facial images (deepfakes) in binary classification scenarios. It can be used as a baseline for deepfake detection research or as a component in content authenticity verification pipelines.

Limitations:

  • Trained on a specific set of AI generation methods; may not generalize to newer deepfake techniques.
  • Approximately 14% of original dataset images were unavailable during download, reducing training data.
  • Not evaluated against adversarial post-processing (compression, cropping, filters).
  • Designed for frontal face images only; performance may degrade on non-frontal or occluded faces.

Training and evaluation data

More information needed

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 0.0002
  • train_batch_size: 16
  • eval_batch_size: 16
  • seed: 42
  • optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
  • lr_scheduler_type: linear
  • num_epochs: 4
  • mixed_precision_training: Native AMP

Training results

Training Loss Epoch Step Validation Loss Accuracy
0.2606 1.0 195 0.1915 0.9524
0.2163 2.0 390 0.1641 0.9472
0.1764 3.0 585 0.1451 0.9498
0.1469 4.0 780 0.1253 0.9524

Framework versions

  • Transformers 5.9.0
  • Pytorch 2.10.0+cu128
  • Datasets 4.8.5
  • Tokenizers 0.22.2
Downloads last month
70
Safetensors
Model size
85.8M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for desireemcv/vit-face-real-vs-fake

Finetuned
(2553)
this model