cosface: large margin cosine loss for deep face recognition

Wang H, Wang Y, Zhou Z, et al. CosFace: Large Margin Cosine Loss for Deep Face Recognition[C]. computer vision and pattern recognition, 2018: 5265-5274.

@article{wang2018cosface:,
title={CosFace: Large Margin Cosine Loss for Deep Face Recognition},
author={Wang, Hao and Wang, Yitong and Zhou, Zheng and Ji, Xing and Gong, Dihong and Zhou, Jingchao and Li, Zhifeng and Liu, Wei},
pages={5265--5274},
year={2018}}

本文从angular margin角度提出了对交叉熵损失的一个改进.

主要内容

一般的softmax交叉熵损失为

[L_s = frac{1}{N}sum_{i=1}^N -log frac{e^{f_{y_i}}}{sum_{j=1}^C e^{f_{y_j}}}, ]

其中

[f_j = W^T_jx=|W_j| |x| cos heta_j, ]

固定(|W_j|=1, |x|=s), 则

[L_{ns} = frac{1}{N} sum_i -log frac{e^{scos( heta_{y_i},i)}}{sum_j e^{s cos( heta_{y_j}, i)}} ]

只与角度angular margin有关, 所以实际上, 一个类别属于(i)就是当

[cos heta_i > cos heta_j, forall j ot = i, ]

为了给其增加一些难度, 我们可以

[cos heta_i - m > cos heta_j, forall j ot = i, ]

即我们在(cos heta_i > cos heta_j)的基础上, 进一步要求其angular margin进一步提高, 这就是large angular margin的思想.

于是本文的损失为:
在这里插入图片描述

原文地址:https://www.cnblogs.com/MTandHJ/p/13257710.html