Image Classification
Transformers
Safetensors
vit
vision
emotion-recognition
facial-expression
ck+
Eval Results (legacy)
Instructions to use ChristopherLi/vit-ckplus-emotion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ChristopherLi/vit-ckplus-emotion with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="ChristopherLi/vit-ckplus-emotion") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("ChristopherLi/vit-ckplus-emotion") model = AutoModelForImageClassification.from_pretrained("ChristopherLi/vit-ckplus-emotion", device_map="auto") - Notebooks
- Google Colab
- Kaggle
metadata
license: apache-2.0
library_name: transformers
tags:
- vision
- image-classification
- emotion-recognition
- facial-expression
- vit
- ck+
datasets:
- AlirezaF138/ckplus-dataset
metrics:
- accuracy
- f1
base_model: google/vit-base-patch16-224-in21k
pipeline_tag: image-classification
model-index:
- name: vit-ckplus-emotion
results:
- task:
type: image-classification
name: Facial Emotion Recognition
dataset:
name: CK+
type: AlirezaF138/ckplus-dataset
metrics:
- type: accuracy
value: 0.98
name: Test Accuracy
- type: f1
value: 0.965
name: Macro F1
ViT Emotion Recognition (CK+)
Vision Transformer fine-tuned for 7-class facial emotion recognition on CK+.
Initialized from a FER2013-tuned ViT, then fine-tuned on CK+. Best for clean, frontal, posed lab faces. Prefer the FER2013 model for webcam / in-the-wild use.
Labels
anger, contempt, disgust, fear, happy, sadness, surprise
Usage
from transformers import pipeline
clf = pipeline("image-classification", model="ChristopherLi/vit-ckplus-emotion")
print(clf("face.jpg"))
Training
- Base: FER2013 fine-tune of
google/vit-base-patch16-224-in21k - 10 epochs on CK+ (stratified 80/10/10), fp16, lr
3e-5
Results (held-out test)
| Metric | Value |
|---|---|
| Accuracy | 98.0% |
| Macro F1 | 0.965 |
See the project README for caveats about CK+ generalization.