Difference between revisions of "hamming Distance Metric Learning"

From statwiki
Jump to: navigation, search
(Upper bound on empirical loss)
(Upper bound on empirical loss)
Line 19: Line 19:
 
This upper bound is continuous and piece wise smooth in w as long as f is continuous in w. in particular when <math>f<\math> is linear in <math>w<\math>. the bound becomes piecewise linear and convex.  
 
This upper bound is continuous and piece wise smooth in w as long as f is continuous in w. in particular when <math>f<\math> is linear in <math>w<\math>. the bound becomes piecewise linear and convex.  
  
To use the upper bond for optimization we should be able to find <math>(g,g^-,g^+)</math> that maximizes the first term of the above equation. There <math>2^{3q}</math> possible combinations for coeds which makes this optimization challenging. However this optimization is
+
To use the upper bond for optimization we should be able to find <math>(g,g^-,g^+)</math> that maximizes the first term of the above equation. There <math>2^{3q}</math> possible combinations for codes which makes this optimization challenging. However this optimization is

Revision as of 18:35, 8 July 2013

Introduction

This paper tries to propose a method to learn mappings from high dimensional data to binary codes. One of the main advantages of using binary space is that one can do exact KNN classification in sublinear time. Like other metric learning method this paper also tries to optimize some cost function which is based one a similarity measure between data points. One choice of similarity measure in binary space is Euclidean distance which produces unsatisfactory results. Another choice is Hamming distance, which is the total number of positions at which the corresponding bits are different.

The task is to learn a mapping from b(x) that project p-dimensional real valued input x onto a q dimensional binary code while preserving some notion of similarity. This mapping, which is called hash function is parameterized by a matrix w such that:
[math]b(x,w)=sign(f(w,x))[/math]

In a previous paper, the authors tried to used a loss function which bears some similarity to the hinge function used in SVM. It includes a hyper-parameter which is a threshold in Hamming space that differentiates neighbors from non-neighbors. such that similar points are mapped to binary codes that do differ in more than P bits and disimilar points should map to points closer no more than P bits. For two binary codes [math]h[/math] and [math]g[/math] with hamming distance [math]||h-g||_H[/math] and a similarity label [math]s \in {0,1}[/math] the pairwise hinge loss function is defined as:

However in practice finding value of P is not easy. Moreover in some datasets the relative pairwise distance is important not the precise numerical value. As a results in this paper authors define the loss function in terms of the relative similarity. To define relative similarity it is assumed that dataset include triplet of items [math](x,x^+,x^-)[/math] such that [math]x[/math] is more similar to [math]x^+[/math] than [math]x^-[/math]. With this assumption the ranking loss on triplet of binary codes [math](h,h^+,h^-)[/math] is:

[math]L_{triple}(h,h^+,h^-)=[||h-h^+||-||h-h^-||+1]_+[/math]

Optimization

Given a training set of triplets, [math]D={(x_i,x_i^+,x_i^-)}_{i=1}^n[/math], the objective is to minimize the sum of ranking loss for all training samples and a simple regularizer on the vector of unknown parameters [math]w[/math]:

[math]L(w)=\sum_{(x,x^+,x^-) \in D}l_{triple}(b(x,w),b(x^+,w),b(x^-,w))+\frac{\lambda}{2}||w||[/math]
which is a discontinuous and non-convex function and optimization is not trivial. The discontinuity is because of the sign function and can be mitigated through construction of upper bound on the empirical loss. To do that one can rewrite function b as following
[math]b(x,w)=sign(f(x,w) = \underset{h\in H} {arg\,max} h^Tf(x,w)[/math]

where [math]H={-1,+1}^q[/math].

Upper bound on empirical loss

The upper bound on loss has the following form:

[math]l_{triple}((b(x,w),b(x^+,w),b(x^-,w)) \leq max_{g,g^+,g^-}\{l_{triple}(g,g^+,g^-)+g^Tf(x,w)+g^{+^T}f(x^+,w)+g^{-^T}f(x^-,w)\}-max_h\{h^Tf(x,w)\}-max_{h^+}\{h^{+^T}f(x,w)\} -max_{h^-}\{h^{-^T}f(x,w)\}[/math]

This upper bound is continuous and piece wise smooth in w as long as f is continuous in w. in particular when [math]f\lt \math\gt is linear in \lt math\gt w\lt \math\gt . the bound becomes piecewise linear and convex. To use the upper bond for optimization we should be able to find \lt math\gt (g,g^-,g^+)[/math] that maximizes the first term of the above equation. There [math]2^{3q}[/math] possible combinations for codes which makes this optimization challenging. However this optimization is