15. Contrastive Loss
• ContrastiveLossはSiameseNetで使われる事がほとんど
• SiameseNetはパラメータ共有の同じ構造のモデルを利用
S. J. Rao, Y. Wang, G. W. Cottrell. “A deep Siamese neural network learns the human-perceived similarity structure of facial expressions without explicit categories.” in CogSci, 2016.
15
33. Triplet LossのDeep Metric Learning(CVPR2016)
PositiveやNegativeの長さはユークリッド距離を使うのが一般的ですが、この距離算出自
体もDeepLearningでやってしまうような手法を提案
Shared sub-network と single-image representation(SIR)とcross-image
representation (CIR)という3つの要素でネットワークを構成
33
F. Wang, W. Zuo, L. Lin, D. Zhang, and L. Zhang. "Joint Learning of Single-image and Cross-image Representations for Person Re-identification." In CVPR, 2016.
34. Triplet LossのDeep Metric Learning(CVPR2016)
図の青色の部分がShared sub-networkで、緑色の部分がsingle-image representation
(SIR)で、赤色の部分がcross-image representation (CIR)
34
F. Wang, W. Zuo, L. Lin, D. Zhang, and L. Zhang. "Joint Learning of Single-image and Cross-image Representations for Person Re-identification." In CVPR, 2016.
41. Adapted Triplet Loss(ECCV2018)
Triplet Lossの性能は、学習時のTripletの選択方法に強く依存
• 学習データを選ぶ必要
• データの偏りによるバイアスが生じる危険性
Domain Adaptationの一種
• ソースドメインの分布をターゲットドメインに近づけながら学習
41
B. Yu, T. Liu, M. Gong, C. Ding, and D. Tao. "Correcting the Triplet Selection Bias for Triplet Loss." In ECCV, 2018.
42. Adapted Triplet Loss(ECCV2018)
Xは入力データ、Yはラベル
を、Source DomainとTarget Domainそれぞれの確率密度関数
を、Embedding空間への変換とすると下記の状態が理想的
42B. Yu, T. Liu, M. Gong, C. Ding, and D. Tao. "Correcting the Triplet Selection Bias for Triplet Loss." In ECCV, 2018.
45. References
• https://qiita.com/yu4u/items/078054dfb5592cbb80cc
• S. J. Rao, Y. Wang, G. W. Cottrell. “A deep Siamese neural network learns the
human-perceived similarity structure of facial expressions without explicit
categories.” in CogSci, 2016.
• J. Wang, Y. Song, T. Leung, C. Rosenberg, J. Wang, J. Philbin, B. Chen, and Y.
Wu. "Learning Fine-grained Image Similarity with Deep Ranking." In CVPR, 2014.
• E. Hoffer, and N. Ailon. "DEEP METRIC LEARNING USING TRIPLET NETWORK."
In ICLR workshop, 2015.
• F. Schroff, D. Kalenichenko, and J. Philbin. "Facenet: A Unified Embedding for
Face Recognition and Clustering." In CVPR, 2015.
• D. Cheng, Y. Gong, S. Zhou, J. Wang, and N. Zheng. "Person Re-Identification
by Multi-Channel Parts-Based CNN with Improved Triplet Loss Function." In
CVPR, 2016.
45
46. References
• F. Wang, W. Zuo, L. Lin, D. Zhang, and L. Zhang. "Joint Learning of Single-
image and Cross-image Representations for Person Re-identification." In CVPR,
2016.
• W. Chen, X. Chen, J. Zhang, and K. Huang. "Beyond triplet loss: a deep
quadruplet network for person re-identification." In CVPR, 2017.
• B. Yu, T. Liu, M. Gong, C. Ding, and D. Tao. "Correcting the Triplet Selection
Bias for Triplet Loss." In ECCV, 2018.
46
学習は2つの画像を1組みとして行われます。各入力画像は、CNN(変換 f )によって、Embedding空間のベクトルとして配置され、ベクトル間の距離を関数 d で計測します。関数 d はユークリッド距離を使う事が多いですが、Embedding空間の2つのベクトル間の距離を計測できる関数であれば、どのようなものでも問題ありません。Contrastive Loss関数のαはマージンを表しています。yは2つの入力画像 xaと xbのラベルが同じ場合は1、違う場合は 0となります。したがって、dは同じラベル間では小さく、違うラベル間では大きくなるように、CNN(変換 f )が学習されていきます。
学習は、基準となるAnchor画像 xa、Anchorと同じIDのPositive画像 xp、Anchorと違うIDのNegative画像 xnの3つを1組として行われます。各入力画像は、CNN(変換 f )によって、Embedding空間のベクトルとして配置されます。Embedding空間ではAnchor-Positive間の距離 dp 、Anchor-Negative間の距離 dn を関数 d で計測します。関数 d はユークリッド距離を使う場合が多いですが、Embedding空間の2つのベクトル間の距離を計測できる関数であれば、どのようなものでも問題ありません。