ViT Emotion Recognition (FER2013)

Vision Transformer fine-tuned for 7-class facial emotion recognition on the FER2013 Enhanced dataset.

Best for in-the-wild / webcam faces.

Labels

angry, disgust, fear, happy, sad, surprise, neutral

Usage

from transformers import pipeline

clf = pipeline("image-classification", model="ChristopherLi/vit-fer2013-emotion")
print(clf("face.jpg"))

Or with this project's webcam app:

python webcam_app.py --model ChristopherLi/vit-fer2013-emotion

Training

  • Base: google/vit-base-patch16-224-in21k
  • 3 epochs, fp16, lr 5e-5, effective batch size 32
  • Input: 48×48 grayscale faces resized to 224×224 and replicated to 3 channels

Results (test set)

Metric Value
Accuracy 69.4%
Macro F1 0.656

FER2013 is a noisy benchmark (human agreement ~65%). See the project README for details.

Downloads last month
-
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 ChristopherLi/vit-fer2013-emotion

Finetuned
(2550)
this model

Dataset used to train ChristopherLi/vit-fer2013-emotion

Evaluation results