SainingZhang / DDAMFN

90 stars 14 forks source link

Not able to achieve same results as the paper for RAF-DB #9

Open ipa-anm-sy opened 5 months ago

ipa-anm-sy commented 5 months ago

I am getting the best accuracy upto 89.899 with rafdb dataset, How can I achieve the results from the paper.

SainingZhang commented 5 months ago

You can use this Sharpness aware minimization for efficiently improving generalization, an optimizer for training.

ipa-anm-sy commented 5 months ago

While using predictions on a live camera feed, with gpu, my fps is only 4 do you have any suggestions for improving this?

1chenchen22 commented 5 months ago

我使用 rafdb 数据集获得了高达 89.899 的最佳准确度,我怎样才能从论文中获得结果。

您可以使用此锐度感知最小化来有效地改进泛化,这是一种用于训练的优化器。

我也是没有能达到那么高的准确率,最高也就只有百分之90,还有其他改进优化的准确率的技巧吗

SainingZhang commented 5 months ago

I think maybe you can crop the img to a small scale, since our pretrained model pay attention on face areas and maybe your img have large space of background?

1chenchen22 commented 5 months ago

I think maybe you can crop the img to a small scale, since our pretrained model pay attention on face areas and maybe your img have large space of background?

好哒谢谢你,我没有对原来的数据集做裁剪,可能就导致他的背景比较大吧,

ipa-anm-sy commented 5 months ago

Do you have some ideas for improving performance, and fps rate.

SainingZhang commented 5 months ago

What do you mean is only 4?

ipa-anm-sy commented 5 months ago

I am using a live camera feed input. (640x480 pixels) resize to 300x300 for face detection and cropping. then resize to
only have 4 frames per second prediction rate. And GPU utilization rate is near about 20% for prediction. So can you suggest a good image input method to the pretrained model, which will distribute the computational load over gpu memory and increase my frames per second significantly?

ipa-anm-sy commented 5 months ago

I am currently doing these preprocessing steps before loading the image into the model for prediction. preprocess = transforms.Compose([ transforms.Resize((112,112)), transforms.ToTensor(), transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) ]) Is it possible to load image with higher resolution for better features quality to increase the accuracy of the prediction. If yes how much bigger image I can load in the model? I have trained the model with same preprocessing steps. So Do I need to retrain the model with bigger transform.resize?

SainingZhang commented 5 months ago

Maybe you can wait for our new trained model, we will post it ASAP.

SainingZhang commented 5 months ago

Our new version DDAMFN++ is available in the folder https://github.com/simon20010923/DDAMFN/tree/main/DDAMFN%2B%2B, which includes new alignment code refer to https://github.com/biubug6/Pytorch_Retinaface and optimized by SAM (Sharpness aware minimization for efficiently improving generalization). The trained RAF-DB model is available in DDAMFN++/checkpoints_ver2.0, which is not our best. The affectnet model will soon be available.

ipa-anm-sy commented 5 months ago

Thank you for providing the trained model. I tested it. It is performing great compared to other models. But my emphasis is on the emotion 'Fear'. It is difficult to obtain in the real camera feed.

So for giving better features to the model can I train the model with higher resolution images? Can I change transforms.Resize((112,112)) while training the model. Have you tried this already?

SainingZhang commented 5 months ago

Sorry, we haven't tried that before. I think maybe you have to train a pretrained model on large images.

ipa-anm-sy commented 5 months ago

I am using DDAMFN/DDAMFN++/rafdb_train_sam_opt_ver2.0.py file for training DDAMFN++ model. And just modifying transform.resize(112,112) is not working. I am getting the error :The expanded size of the tensor (14) must match the existing size (8) at non-singleton dimension 3. Target sizes: [-1, -1, 14, 14]. Tensor sizes: [16, 512, 14, 8]. Can you give some suggestions for training the model with high resolution images please? Thank you.

SainingZhang commented 5 months ago

I will come back to you soon.

ipa-anm-sy commented 4 months ago

Do you have any updates?