Learning a Similarity Metric Discriminatively, with Application to Face Verification

Chopra S, Hadsell R, Lecun Y, et al. Learning a similarity metric discriminatively, with application to face verification[C]. computer vision and pattern recognition, 2005: 539-546.

Hadsell R, Chopra S, Lecun Y, et al. Dimensionality Reduction by Learning an Invariant Mapping[C]. computer vision and pattern recognition, 2006: 1735-1742.

@article{chopra2005learning,
title={Learning a similarity metric discriminatively, with application to face verification},
author={Chopra, Sumit and Hadsell, Raia and Lecun, Yann},
volume={1},
pages={539--546},
year={2005}}

@article{hadsell2006dimensionality,
title={Dimensionality Reduction by Learning an Invariant Mapping},
author={Hadsell, Raia and Chopra, Sumit and Lecun, Yann},
volume={2},
pages={1735--1742},
year={2006}}

这俩篇论文介绍了一种contrastive loss (最近很火, 但是感觉虽然核心思想是一致的, 现在的contrastive loss在此基础上更进了一步), 实际上就是最大化类间距离, 最小化类内距离.

主要内容

genuine 和 impostor

首先, 给定数据集(mathcal{D}={(x_i,y_i)}_{i=1}^N), 其分别代表数据和标签, 根据此数据集进行配对,

[X_{ij}=(x_i, x_j), ]

若对应的(y_i=y_j)则称该对为genuine(真实的), 否则为impostor(虚假的), 记为(Y_{ij})(1:genuine, 0:impostor).
一个很自然的想法就是真实的对之间的距离应该小(就是最小化类内距离), 虚假对的数据间的距离大(即最大化类间距离).

不过在做这个工作之前, 我们需要通过一个映射(G_W)(x)映射到一个低维的空间中去, 用现在的话讲, 这是一个提特征的过程, 并将上面的最大最小化的思想套用到这些特征(G_W(x))上去. 用

[E_W(X_{ij}) := |G_W(x_i)-G_W(x_j)| ]

来表示一对数据之间的"能量" (实际上就是特征的距离).

如何最大最小呢? 最小化下面的式子:

[mathcal{L}(W)=sum_{i,j} Y_{ij}L_G(E_W(X_{ij}))+(1-Y_{ij})L_{I}(E_W(X_{ij})). ]

文1

[L_G(E_W):= frac{2}{Q}(E_W)^2 \ L_I(E_W):= 2Q exp(-frac{2.77}{Q}E_W), ]

其中(Q)为一常数, 表(E_W)的上界, 不是很理解为什么要这么构造.

文2

[L_G(E_W):= frac{1}{2}(E_W)^2 \ L_I(E_W):=frac{1}{2} {max (0, m-E_W)}^2, ]

其中(m)是认为给定的一个margin.

注: 文1中并没有注明去何种范数, 但有这么一句话:

Second, we must emphasize that using the square norm instead of the L1 norm for the energy would not be appropriate.

照这个说法, 那就应该用(L_1), 可第二篇是显示使用(L_2)的, 难道就因为第二篇是应用在数据降维中的缘故?

实际上, (G_W)就是一个压缩映射, 文二用此来进行数据降维, 而文一在此基础上进行分类. 按照现在的做法, 就应该是利用(G_W)作为一个特征提取器, 然后再其后加一个分类器用于分类, 文1是假设每一个个体(类)服从一个多维的正态分布, 这个正态分布用这个类中的数据(经过映射后的特征)来估计. 假设每个类的概率密度函数为(phi_i), 便用

[frac{phi_i(x)}{phi_i(x)+c_i}, ]

来表示(x)与第(i)类的样本关系为genuine的可能性.

[c_i = mathrm{mean} {phi_i(x):xinmathcal{D}, y ot = i}. ]

没理解错应该是这个意思.

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