we set the output dimension of FC1 layer as 2 . 譬如FC1之后输出:

feat=(256, 2)
256是batch_size,256张图片,每个图片提取两个特征

sphereface论文
横纵坐标是两个feature,得到两个类,一共256个点。
sphereface论文
直角坐标系映射到极坐标:W1W2W_{1}、W_{2}向量长度不相等。 Features learned by the original softmax loss can not be classified simply via angles ——增加角度margin。
The decision boundary in softmax loss is :

(W1W2)x+b1b2=0(W_{1} −W_{2})x+b_{1} −b_{2}=0

If we define xx as a feature vector (特征向量?) and constrain W1=W2=1∥W_{1}∥=∥W_{2}∥=1 and b1=b2=0b_{1} =b_{2} =0, the boundary:

x(cos(θ1)cos(θ2))=0\left \| x \right \|\left ( cos(\theta _{1})-cos(\theta_{2}) \right )=0,
where θiθ_{i} is the angle between WiW_{i} and x

到此为止,boundary只与角度θ有关,修改softmax loss直接优化角度,让 CNNs 提取到角度可分性更高的feature。现在我们来看加了WbxW、b、x的约束后的图像:sphereface论文
通过修改的softmax loss得到的feature。Compared to original softmax loss, the features learned by modified softmax loss are angularly distributed.
作者觉得两类分的还不够开,于是引入一个整数m(m1)m(m ≥ 1),惩罚因子,控制分开的角度距离,边界变为:

x(cos(mθ1)cos(θ2))=0∥x∥(cos(mθ_{1} )−cos(θ_{2}))=0 , x(cos(θ1)cos(θ2))=0,∥x∥(cos(θ_{1} )− cos(θ_{2} ))=0,

mm越大,mθ1mθ_{1}越大,得到更大的角,两类分离越远,如下图:
sphereface论文

相关文章:

  • 2022-01-07
  • 2021-07-17
  • 2021-04-04
  • 2021-09-17
  • 2021-05-15
  • 2021-07-04
  • 2021-12-21
  • 2021-12-05
猜你喜欢
  • 2021-04-03
  • 2021-06-20
  • 2021-04-13
  • 2021-06-01
  • 2022-01-10
  • 2021-05-10
  • 2021-09-03
相关资源
相似解决方案