オムライスの備忘録

数学・統計学・機械学習・プログラミングに関することを記す

【機械学習】Lifted Structure Loss

Index

Lifted Structure Loss

Metric Learning / Distance Learning の損失として利用される.

Loss Function Architecture

positive pair / negative pair の集合を定義.

positive pair / negative pair の集合

 \hat{P} : positive pair の集合.

 \hat{N} : negative pair の集合.



次に、任意のpositive pair / negative pair の要素 (のid) を考える.

positive pair / negative pair の要素の id


\begin{matrix}
positive\ pair\ :\ & ^\forall (i,\ j)\ \in\ \hat{P} \\
\\
negative\ pair\ :\ & ^\forall (i,\ k)\ \in\ \hat{N} \\
 & ^\forall (j,\ l)\ \in\ \hat{N} \\
\end{matrix}



図にするとこのようなイメージ.



入力データ / 写像関数 / 距離 入力データ集合を  X とし、その要素を  ^\forall x_{i}\ \in\ X とする.

そして、変換のための写像関数を  f とする.

任意のデータ id  i j の変換後の距離を以下のように計算する.

 D_{i, j}\ =\ ||\ f(x_{i})\ -\ f(x_{j})\ ||_{2}



いわゆるユークリッド距離.



まず、損失  J_{i,\ j} を考える.

 J_{i,\ j}\ =\ \max\ \left\{
\displaystyle \max_{(i,\ k)\ \in\ \hat{N}}\ \{ \alpha\ -\ D_{i,\ k}\},\ 
\displaystyle \max_{(j,\ l)\ \in\ \hat{N}}\ \{ \alpha\ -\ D_{j,\ l}\}
\right\}\ +\ D_{i,\ j}


損失  J_{i,\ j} は、positive pair のデータ点  i j のコストではあり、最小化することが目的である.

第 2 項  D_{i,\ j} は、データ点  i j の距離であるから、最小になるように写像したい.

次に、第 1 項は、negative pair の距離で小さいもの(近いもの)を選択し、それを最大化している (遠ざけている).

 
\max\ \left\{
\displaystyle \max_{(i,\ k)\ \in\ \hat{N}}\ \{ \alpha\ -\ D_{i,\ k}\},\ 
\displaystyle \max_{(j,\ l)\ \in\ \hat{N}}\ \{ \alpha\ -\ D_{j,\ l}\}
\right\}



最終的な損失  J を考える.

 J\ =\ \displaystyle \frac{1}{2|\hat{P}|}\ \displaystyle \sum_{(i,\ j)\ \in\ \hat{P}} \{\ \max \{0,\ J_{i,\ j}\}\ \}^{2}


上で決めた positive pair のデータ点  i j のコストの平均を計算するようなイメージ.

課題

  1. non-smooth / 連続ではない関数
  2. negative / positive pair の作成方法

対応策・工夫

  1. smooth upper bound を代わりに利用
  2. stochastic approach

参考

  • Deep Metric Learning via Lifted Structured Feature Embedding
    • [2015]
    • 4 Deep metric learning via lifted structured feature embedding
    • arxiv.org