
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->

# vit_fer_finetuned

This model is a fine-tuned version of [google/vit-base-patch16-224-in21k](https://huggingface.co/google/vit-base-patch16-224-in21k) on an unknown dataset.
It achieves the following results on the evaluation set:
- Loss: 0.5470
- Accuracy: 0.8399
- F1 Macro: 0.8459
- F1 Micro: 0.8399
- Precision Macro: 0.8451
- Recall Macro: 0.8472
- F1 Angry: 0.7908
- Precision Angry: 0.7735
- Recall Angry: 0.8090
- F1 Disgust: 0.9321
- Precision Disgust: 0.9364
- Recall Disgust: 0.9279
- F1 Fear: 0.7547
- Precision Fear: 0.7677
- Recall Fear: 0.7422
- F1 Happy: 0.9386
- Precision Happy: 0.9556
- Recall Happy: 0.9222
- F1 Neutral: 0.8262
- Precision Neutral: 0.8105
- Recall Neutral: 0.8427
- F1 Sad: 0.7626
- Precision Sad: 0.7692
- Recall Sad: 0.7562
- F1 Surprise: 0.9164
- Precision Surprise: 0.9030
- Recall Surprise: 0.9302

## Model description

More information needed

## Intended uses & limitations

More information needed

## Training and evaluation data

More information needed

## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 2e-05
- train_batch_size: 32
- eval_batch_size: 32
- seed: 42
- gradient_accumulation_steps: 2
- total_train_batch_size: 64
- optimizer: Use adamw_torch with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: linear
- lr_scheduler_warmup_ratio: 0.1
- num_epochs: 5
- mixed_precision_training: Native AMP

### Training results

| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 Macro | F1 Micro | Precision Macro | Recall Macro | F1 Angry | Precision Angry | Recall Angry | F1 Disgust | Precision Disgust | Recall Disgust | F1 Fear | Precision Fear | Recall Fear | F1 Happy | Precision Happy | Recall Happy | F1 Neutral | Precision Neutral | Recall Neutral | F1 Sad | Precision Sad | Recall Sad | F1 Surprise | Precision Surprise | Recall Surprise |
|:-------------:|:-----:|:----:|:---------------:|:--------:|:--------:|:--------:|:---------------:|:------------:|:--------:|:---------------:|:------------:|:----------:|:-----------------:|:--------------:|:-------:|:--------------:|:-----------:|:--------:|:---------------:|:------------:|:----------:|:-----------------:|:--------------:|:------:|:-------------:|:----------:|:-----------:|:------------------:|:---------------:|
| 1.0353        | 1.0   | 899  | 0.9539          | 0.6659   | 0.6128   | 0.6659   | 0.6136          | 0.6759       | 0.5457   | 0.6230          | 0.4854       | 0.4869     | 0.3312            | 0.9189         | 0.3857  | 0.6196         | 0.2800      | 0.8874   | 0.8872          | 0.8877       | 0.6550     | 0.5993            | 0.7220         | 0.5604 | 0.5187        | 0.6093     | 0.7683      | 0.7166             | 0.8281          |
| 0.7413        | 2.0   | 1798 | 0.7735          | 0.7400   | 0.7367   | 0.7400   | 0.7297          | 0.7520       | 0.6732   | 0.5915          | 0.7812       | 0.8264     | 0.7634            | 0.9009         | 0.5777  | 0.6519         | 0.5187      | 0.9088   | 0.9434          | 0.8767       | 0.7174     | 0.7219            | 0.7130         | 0.6216 | 0.6297        | 0.6137     | 0.8318      | 0.8059             | 0.8595          |
| 0.5094        | 3.0   | 2697 | 0.6381          | 0.7955   | 0.8039   | 0.7955   | 0.8033          | 0.8053       | 0.7633   | 0.7405          | 0.7875       | 0.9364     | 0.9450            | 0.9279         | 0.6834  | 0.6727         | 0.6945      | 0.9246   | 0.9425          | 0.9074       | 0.7696     | 0.7606            | 0.7788         | 0.6779 | 0.7035        | 0.6541     | 0.8723      | 0.8580             | 0.8871          |
| 0.4165        | 4.0   | 3596 | 0.5596          | 0.8319   | 0.8391   | 0.8319   | 0.8428          | 0.8366       | 0.7983   | 0.8326          | 0.7667       | 0.9401     | 0.9623            | 0.9189         | 0.7452  | 0.7219         | 0.7701      | 0.9327   | 0.9515          | 0.9145       | 0.8100     | 0.7809            | 0.8413         | 0.7446 | 0.7482        | 0.7410     | 0.9028      | 0.9023             | 0.9034          |
| 0.2772        | 5.0   | 4495 | 0.5151          | 0.8528   | 0.8575   | 0.8528   | 0.8582          | 0.8571       | 0.8179   | 0.7972          | 0.8396       | 0.9364     | 0.9450            | 0.9279         | 0.7839  | 0.8025         | 0.7662      | 0.9397   | 0.9486          | 0.9310       | 0.8335     | 0.8251            | 0.8421         | 0.7720 | 0.7696        | 0.7744     | 0.9190      | 0.9196             | 0.9184          |


### Framework versions

- Transformers 4.47.0
- Pytorch 2.5.1+cu121
- Datasets 3.3.1
- Tokenizers 0.21.0

angry disgust fear happy neutral sad surprise