IrvingMeng / MagFace

MagFace: A Universal Representation for Face Recognition and Quality Assessment, CVPR2021, Oral
Apache License 2.0
615 stars 87 forks source link

Add Magface loss to the insightface's partial FC #20

Open face-competition opened 3 years ago

face-competition commented 3 years ago

It's a great job!

I'm currently trying to add the Magface loss to the insightface's partial FC, but it doesn't work. The x_norm is getting larger during training between 30 and 40, resulting in a larger margin between 0.5 and 0.6. The model is trained from scratch. I tried to adjust the weight of LG or the sample_rate of partial FC but it still didn't work.

I checked your log and found that x_norm is pulled back to a certain interval instead of increasing. But my x_norm will keep getting larger. How do I need to deal with this problem? image notice: I have added easy margin processing

I look forward to your reply and suggestions!

IrvingMeng commented 3 years ago

Hi,

Thank you for your interests in our work. Bases on your description, I think m(ai) may not work properly as m(ai) decreases magnitudes while g(ai) increases them. Could you double-check the gradient is correct in your implementation?

IrvingMeng commented 3 years ago

Eq. 4 in NormFace provides the gradient of i-th entry in feature x. Following their notations, the gradient for MagFace can be wrote as follows (may be incorrect. please check them by your own). The key here is to add the gradient of xi brought by the magnitude a.

2021728-134726

marigoold commented 3 years ago

Hi, I tried to do the same thing with you, could you please show me your code?

khawar-islam commented 3 years ago

@face-competition I also need code of MagFace, please help me out

XieZixiUSTC commented 1 year ago

marigoold

i also need code of Magface of partial fc,please show me you code

XieZixiUSTC commented 1 year ago

@face-competition I also need code of MagFace, please help me out

i also need code of Magface of partial fc,please show me you code

XieZixiUSTC commented 1 year ago

i also need code of Magface of partial fc,please show me you code

https://github.com/IrvingMeng/MagFace/issues/20#issuecomment-888032861