有一些相关,简单看看
Class-Variant Margin Normalized Softmax Loss for Deep Face Recognition
TNNLS 的short paper
要解决的问题
softmax有两个问题
- 类别不平衡
- 有饱和区域
主要思路
L c v m = − 1 N ∑ i = i N log e s ⋅ ( cos θ y i − h ( θ y i ) ) e s ⋅ ( cos θ y i − h ( θ y i ) ) + ∑ j ≠ y i e s ⋅ ( cos θ y i + g ( θ j ) ) L_{cvm} = - \frac{1}{N}\sum_{i=i}^N \log \frac{e^{s \cdot (\cos \theta_{y_i}-h({ \theta_{y_i})})}} {e^{s \cdot(\cos \theta_{y_i}-h({ \theta_{y_i})})} +\sum_{j \neq y_i} e^{s \cdot (\cos \theta_{y_i}+g({ \theta_{j})})} } Lcvm=−N1i=i∑Nloges⋅(cosθyi−h(θyi))+∑j=yies⋅(cosθyi+g(θj))es⋅(cosθyi−h(θyi))
-
h
(
θ
y
i
)
=
m
1
(
1
−
cos
2
θ
y
i
)
h(\theta_{y_i}) = m_1(1-\cos ^2 \theta_{y_i})
h(θyi)=m1(1−cos2θyi)
-
g
(
θ
j
)
=
m
2
(
cos
2
θ
j
)
g(\theta_j) = m_2(\cos ^2 \theta_j)
g(θj)=m2(cos2θj)
论文把这个
h
(
θ
y
i
)
h(\theta_{y_i})
h(θyi)叫 “true class margin”,作用是给更难分的样本更大的margin (我不知道该怎么翻译好了,就还用这个单词吧)。
h
(
θ
y
i
)
h(\theta_{y_i})
h(θyi)和
cos
θ
y
i
\cos\theta_{y_i}
cosθyi成反比,正常来说目标类的
cos
θ
y
i
\cos\theta_{y_i}
cosθyi应该大,这个值小的话说明样本难分,所以给它留个大边界。
g
(
θ
j
)
g(\theta_j)
g(θj)叫false class margin。容易被误分类的,给大边界。
还是有点儿意思的。