av-savchenko / face-emotion-recognition

Efficient face emotion recognition in photos and videos
Apache License 2.0
654 stars 124 forks source link

afew test accuracy is around 55% #32

Closed fw-codes-files closed 1 year ago

fw-codes-files commented 1 year ago

hi, thanks for your great work.Now, I'm following your work on afew dataset. But I just got around 55% accuracy by running AFEW_train.ipynb and train_emotions-pytorch.ipynb. When I read your codes, I found you used enet_b0_8_va_mtl.pt model in train_emotions-pytorch.ipynb and used mobilnet_7.h5 model in AFEW_train.ipynb. I am confused which model is the right one and what should I do to reproduce 59% accuracy on afew dateset. thank you for your replies!

av-savchenko commented 1 year ago

Hello! Please, refer to the table in readme. In particular, you could use model enet_b0_8_best_afew.pt in train_emotions-pytorch.ipynb. You should use LinearSVC classifier. It is also possible to load enet_b2_7.pt model with sligtly higher accuracy. MTL model works worse on AFEW as you can see in Table of Readme. Sorry for possible confusion, now the source code uses enet_b2_8_best.pt which is also not as accurate on AFEW as other models

Mobilenet_7 is a Tensorfow/Keras model, so you need to use train_emotions.ipynb if you want to run it

fw-codes-files commented 1 year ago

thanks for you explanation. I got 59.89% using enet_b0_8_best_afew.pt and got 58.05% using enet_b2_7.pt in train_emotions-pytorch.ipynb. It's fine enough. thanks again.

av-savchenko commented 1 year ago

Excellent, I'm closing this issue. I forgot to mention that train_emotions-pytorch.ipynb contains variable USE_ENET2, which should be set to True for enet2 models and to False for enet0 models due to the different resolution of input images for EfficientNet-B2 and EfficientNet-B0.

av-savchenko commented 1 year ago

You're correct, frames_mtcnn_cropped directory in my code was created by simple crop without face alignment

On Thu, Apr 6, 2023 at 10:07 AM fw @.***> wrote:

Thanks a lot. And, sorry to bother you again, there is one more question: afew dataset preprocess has 2 functions face detection and align. I wonder which function should I run to generate train and test data? Because 59.89% accuracy is achieved on just face detection data.

— Reply to this email directly, view it on GitHub https://github.com/HSE-asavchenko/face-emotion-recognition/issues/32#issuecomment-1498593322, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFZQMVGMVN467B3V7C2AQZDW7ZTS7ANCNFSM6AAAAAAWUBQIJY . You are receiving this because you modified the open/close state.Message ID: @.*** com>

-- С уважением, А.В. Савченко