【ReID】【skimming】SphereReID: Deep Hypersphere Manifold Embedding for Person Re-identification

略读SphereReID: Deep Hypersphere Manifold Embedding for Person Re-Identication[1],文章提出了一种调整过的softmax,即Sphere Loss,使网络学习超球体流形嵌入空间来提高辨别能力。

痛点

一般使用的loss多为softmax loss和triplet loss,如下图所示

【ReID】【skimming】SphereReID: Deep Hypersphere Manifold Embedding for Person Re-identification

可以看到softmax loss或者说id loss的问题在于没有限制特征空间的分布,而使学到的特征映射可能不是最优的。而triplet loss的每个维度的特征仅在很小的间隔内,目标嵌入空间可能无法充分利用。

作者为了引入特征归一化和权重归一化,消除了不同的范数之后,classification将只依赖嵌入向量和目标类权重向量之间的角度,这带来了嵌入空间中清晰的几何解释。除此之外softmax监督的分类方法因样本量偏差而导致,并最终导致性能下降。如图1©,嵌入向量分布在超球面流形中,这与欧氏空间嵌入不同,SphereReID最大的特点是将图像映射到了超球面表面,而这将可能的空间分布限制在有限的角度空间内。因此,可以充分利用目标嵌入空间,训练网络对来自不同行人图像进行分类。

模型

Sphere Loss限制样本包埋在超球面流形上的分布。如下图:

【ReID】【skimming】SphereReID: Deep Hypersphere Manifold Embedding for Person Re-identification

其中绿色箭头w1 w2表示两个不同类的中心权重向量,黄色箭头表示嵌入特征向量,可以看到softmax分布不均,而sphere loss则将它们约束到圆上(超球面)。

还记得softmax公式如下:

【ReID】【skimming】SphereReID: Deep Hypersphere Manifold Embedding for Person Re-identification

其中最后FC层的每个神经元乘以权重的过程表示如下:

【ReID】【skimming】SphereReID: Deep Hypersphere Manifold Embedding for Person Re-identification

softmax的决策边界如下:

【ReID】【skimming】SphereReID: Deep Hypersphere Manifold Embedding for Person Re-identification

反观sphere loss,其w和x有正则化如下:

【ReID】【skimming】SphereReID: Deep Hypersphere Manifold Embedding for Person Re-identification

sphere loss对w和x做l2正则化来消除范数和角度辨别性特征的影响。

softmax loss和sphere loss的决策边界示意图如下:

【ReID】【skimming】SphereReID: Deep Hypersphere Manifold Embedding for Person Re-identification

sphere loss的决策边界:

【ReID】【skimming】SphereReID: Deep Hypersphere Manifold Embedding for Person Re-identification

sphere loss的公式如下:

【ReID】【skimming】SphereReID: Deep Hypersphere Manifold Embedding for Person Re-identification

s为温度常数,实验中取为14

实验

实验backbone为Resnet50,分离试验和与softmax loss对比实验如下,可以看到D网络效果最好,而sphere loss总体也比softmax loss表现要更好:

【ReID】【skimming】SphereReID: Deep Hypersphere Manifold Embedding for Person Re-identification

其中A网络是最后一层为global average pooling,B网络是最后一层为global Avgpooling + FC layer,C网路是global Avgpooling + FC layer + BN,D网络是global Avgpooling + BN + dropout + FC layer + BN。

droput比例的分离试验如下:

【ReID】【skimming】SphereReID: Deep Hypersphere Manifold Embedding for Person Re-identification

在market1501的SOTA对比:

【ReID】【skimming】SphereReID: Deep Hypersphere Manifold Embedding for Person Re-identification

在SUHK-SYSU的SOTA对比:

【ReID】【skimming】SphereReID: Deep Hypersphere Manifold Embedding for Person Re-identification

在DukeMTMC-reID的SOTA对比:

【ReID】【skimming】SphereReID: Deep Hypersphere Manifold Embedding for Person Re-identification

在CUHK03的SOTA对比:

【ReID】【skimming】SphereReID: Deep Hypersphere Manifold Embedding for Person Re-identification

参考文献

[1] Fan X, Jiang W, Luo H, et al. Spherereid: Deep hypersphere manifold embedding for person re-identification[J]. Journal of Visual Communication and Image Representation, 2019, 60: 51-58.