Am-SoftMax Loss

原始的softmax的loss损失是一个交叉熵损失:

在这里插入图片描述
其中:
在这里插入图片描述
将其代入第一个式子,得出了损失函数如下,
在这里插入图片描述

原始Softmax loss的特征分布结果:

在这里插入图片描述

进行归一化操作,将其都映射到一个单位球面上

令||W||=1,b=0,并且引入夹角,得出Modified Softmax Loss公式如下:
在这里插入图片描述
Modified Softmax Loss的特征分布结果
在这里插入图片描述
在此基础上,再引入角度距离(angular margin),用m表示,最终产生A-softmax的loss公式
在这里插入图片描述
其中:
在这里插入图片描述
在这里插入图片描述
展开的写法:
在这里插入图片描述

A-softmax loss的特征分布结果:
在这里插入图片描述
在此基础上,将将cos(m*θ)更改为cosθ-m,【一个是角度距离(angular margin),一个是余弦距离(cosine margine)】增加类间距,并减小类内距。
在这里插入图片描述
为了提高收敛速度,引进了一个超参数s,这里s设置为固定值(论文中固定为30)。

除了将b=0, ||W||=1,也将||x||=1,最终产生AM-softmax的公式
在这里插入图片描述

AM-softmax loss的特征分布结果:
在这里插入图片描述


Softmax、NormalSoftmax、A-Softmax(SphereFace)、AM-Softmax之间的比较
在这里插入图片描述
总结

AM-softmax看做是对A-softmax损失函数的改进

A-softmax的margin是将m与 θ θ θ相乘

而AM-softmax的margin则是 c o s ( θ ) − m cos(θ) - m cos(θ)m

一个是角度距离(angular margin),一个是余弦距离(cosine margine)

当用传统的softmax作为损失函数的时候,角度距离和余弦距离是等价的,即: c o s ( θ 1 ) = c o s ( θ 2 ) = > θ 1 = θ 2 cos(θ_1) = cos(θ_2) => θ_1 = θ_2 cos(θ1)=cos(θ2)=>θ1=θ2

但是当试着去推动边界的时候,余弦距离和角度距离就不再等价了。

Supongo que te gusta

Origin blog.csdn.net/qq_38973721/article/details/112861334
Recomendado
Clasificación