Intro to Metric Learning
Relative Relationship Form (a weaker supervision) → ordinal regression
→ Metric Learning: task of learning a distance (or similarity) function over objects
- input: 2 or more exampels
- output: a (non-negative) score → distance may have different meaning depending on data (i.e. meaning of relationship in the training data)
Overview
- Learning to Rank
- Widely used metric learning methods: (1) Triplet Loss (2) Contrastive Learning
- with applications in CV: face clustering, video recommendation, image/video representation learning
Learning to Rank
- train data of 'lists of items' with some partial order specified between items in each list
- evaluation metric: Normalized Discounted Cumulative Gain (NDCG)
- graded relevance DCG: higher position in output list gets more importance
- NDCG = DCG / maximum possible DCG $\in [0,1]$
Triplet Loss
make dist(anchor, positive) < dist(anchor, negative)
$L = \displaystyle \sum_i^N \Big[ \| f(x_i^a) - f(x_i^p)\|_2^2 - \|f(x_i^a) - f(x_i^n) \|2^2 + \alpha \Big]+$
Collection of negative data
- random negatives → easy triplets: often too easy to distinguish
- Online negative mining: look for hard negatives from current batch, instead of using one initially assigned
- compute kNN from each anchor to every other instance in batch → find closest instance that is not a positive pair to that anchor