MixFairFace icon indicating copy to clipboard operation
MixFairFace copied to clipboard

About mask2 in cifp_margin

Open yiminglin-ai opened this issue 1 year ago • 4 comments

Hello, why in CIFP margin did you consider only neg_logits that are smaller than pos_logits - self.m? Why those largerneg_logits should not be penalised? Thanks.

https://github.com/fuenwang/MixFairFace/blob/11691d330a3cde2e1c4eeb76211ec6d5b7752547/network.py#L29-L30

yiminglin-ai avatar Sep 14 '23 11:09 yiminglin-ai

This part is modified from official CIFP code (https://github.com/Tencent/TFace/blob/99cc558fde0176f38ff051155b110bfd7f6cdb3a/recognition/torchkit/head/localfc/cifp.py#L12)

I don't know the reason either. But I have tried many experiments on CIFP, and the implementation can really work and improve accuracy.

fuenwang avatar Sep 14 '23 12:09 fuenwang

Thanks Fu-En, your implementation is much more readable than the official code! Have you experimented without the mask2?

yiminglin-ai avatar Sep 14 '23 12:09 yiminglin-ai

I guess so. Because I had removed the official code line-by-line to check the corresponding performance, and my network.py only keeps the necessary parts to improve performance.

fuenwang avatar Sep 14 '23 12:09 fuenwang

I see. My assumption is that the high neg_logits may be due to label errors, such as images with incorrect ID labels. Therefore, CIFP avoids using these neg_logits exclude these errors. They can be harmful especially towards the end of the training process.

yiminglin-ai avatar Sep 14 '23 12:09 yiminglin-ai