Team Ai
Modelpublic

dennisjooo/emotion_classification

sourceHugging Faceapache-2.0updated 3y agoView on Hugging Face
0likes73downloads
Model Card

Emotion Classification

This model is a fine-tuned version of google/vit-base-patch16-224-in21k on the FastJobs/Visual_Emotional_Analysis dataset.

In theory, the accuracy for a random guess on this dataset is 0.125 (8 labels and you need to choose one).

It achieves the following results on the evaluation set:

  • —Loss: 1.0511
  • —Accuracy: 0.6687
  • —Precision: 0.7104
  • —F1: 0.6713

Model description

The Vision Transformer base version trained on ImageNet-21K released by Google. Further details can be found on their repo.

Training and evaluation data

Data Split

Trained on FastJobs/Visual_Emotional_Analysis dataset. Used a 4:1 ratio for training and development sets and a random seed of 42. Also used a seed of 42 for batching the data, completely unrelated lol.

Pre-processing Augmentation

The main pre-processing phase for both training and evaluation includes:

  • —Bilinear interpolation to resize the image to (224, 224, 3) because it uses ImageNet images to train the original model
  • —Normalizing images using a mean and standard deviation of [0.5, 0.5, 0.5] just like the original model

Other than the aforementioned pre-processing, the training set was augmented using:

  • —Random horizontal & vertical flip
  • —Color jitter
  • —Random resized crop

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • —learning_rate: 5e-05
  • —trainbatchsize: 64
  • —evalbatchsize: 64
  • —seed: 42
  • —optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • —lrschedulertype: cosinewithrestarts
  • —lrschedulerwarmup_steps: 150
  • —num_epochs: 300

Training results

Training LossEpochStepValidation LossAccuracyPrecisionF1
2.0791.0102.08950.05630.06040.0521
2.07892.0202.08510.05630.06020.0529
2.07173.0302.07730.08130.08580.0783
2.06134.0402.06580.1250.19970.1333
2.04455.0502.04830.18750.25690.1934
2.01766.0602.02060.23130.26920.2384
1.98947.0701.97630.30630.30330.2983
1.92328.0801.89120.36250.33070.3194
1.82569.0901.77750.40620.35310.3600
1.73210.01001.65800.46880.41580.4133
1.640611.01101.55970.50.43580.4370
1.558412.01201.48550.51250.47920.4784
1.489813.01301.42480.54370.50110.5098
1.421614.01401.36920.56870.52550.5289
1.370115.01501.31580.56870.53460.5360
1.343816.01601.28420.54370.54510.5098
1.279917.01701.26200.56250.51690.5194
1.248118.01801.23210.59380.60030.5811
1.199319.01901.21080.56870.56400.5412
1.159920.02001.18530.550.54340.5259
1.108721.02101.18390.55630.56700.5380
1.075722.02201.19050.550.56820.5308
0.998523.02301.15090.63750.67140.6287
0.977624.02401.10480.61880.62220.6127
0.933125.02501.11960.61250.63450.6072
0.888726.02601.14240.59380.61740.5867
0.87927.02701.12320.60620.63420.5978
0.836928.02801.11720.60.64800.5865
0.786429.02901.12850.59380.68190.5763
0.777530.03001.05110.66870.71040.6713
0.728131.03101.02950.65620.65960.6514
0.734832.03201.03980.63750.63530.6319
0.689633.03301.07290.60620.62050.6062
0.61334.03401.05050.64380.65950.6421
0.603435.03501.08270.63750.65930.6376
0.623636.03601.12710.61250.62380.6087
0.560737.03701.09850.60620.62540.6015
0.583538.03801.07910.63750.66240.6370
0.588939.03901.13000.60620.65290.6092
0.513740.04001.10620.6250.64570.6226
0.480441.04101.14520.61880.64030.6158
0.481142.04201.12710.63750.64780.6347
0.517943.04301.19420.58750.61850.5874
0.474444.04401.15150.61250.63290.6160
0.432745.04501.13210.63750.66690.6412
0.456546.04601.17420.6250.64780.6251
0.400647.04701.16750.60620.63610.6079
0.454148.04801.15420.61250.64040.6152
0.368949.04901.21900.58750.61340.5896
0.379450.05001.20020.60620.61550.6005
0.42951.05101.29040.5750.62070.5849
0.43152.05201.24160.58750.60280.5794
0.381353.05301.20730.61250.64490.6142
0.36554.05401.20830.60620.64540.6075
0.371455.05501.16270.63750.65760.6390
0.339356.05601.16200.64380.65050.6389
0.367657.05701.15010.6250.62940.6258
0.337158.05801.27790.58750.60000.5792
0.332559.05901.27190.5750.58430.5651
0.350960.06001.29560.60.64220.6059

Framework versions

  • —Transformers 4.33.0
  • —Pytorch 2.0.0
  • —Datasets 2.1.0
  • —Tokenizers 0.13.3