Home

Awesome

Deep Metric Learning in PyTorch

 Learn deep metric for image retrieval or other information retrieval. 

Our XBM is nominated as best paper in CVPR 2020.

One Blog on XBM in Zhihu

我写了一个知乎文章,通俗快速解读了XBM想法动机:

跨越时空的难样本挖掘

欢迎大家阅读指点!

Recommend one recently released excellent papers in DML not written by me:

A Metric Learning Reality Check

from Cornell Tech and Facebook AI

Abstract: Deep metric learning papers from the past four years have consistently claimed great advances in accuracy, often more than doubling the performance of decade-old methods. In this paper, we take a closer look at the field to see if this is actually true. We find flaws in the experimental setup of these papers, and propose a new way to evaluate metric learning algorithms. Finally, we present experimental results that show that the improvements over time have been marginal at best.

  

XBM: A New Sota method for DML, accepted by CVPR-2020 as Oral and nominated as best paper:

Cross-Batch Memory for Embedding Learning

Other implementations:

pytorch-metric-learning(a great work by Kevin Musgrave)

     

MS Loss based on GPW: Accepted by CVPR 2019 as Poster

Multi-Similarity Loss with General Pair Weighting for Deep Metric Learning

 

Deep metric methods implemented in this repositories:

Dataset

Requirements

Comparasion with state-of-the-art on CUB-200 and Cars-196

Recall@K1248163212481632
HDC53.665.777.085.691.595.573.783.289.593.896.798.4
Clustering48.261.471.881.9--58.170.680.387.8--
ProxyNCA49.261.967.972.4--73.282.486.487.8--
Smart Mining49.862.374.183.3--64.776.284.290.2--
Margin [5]63.674.483.190.094.2-79.686.591.995.197.3-
HTL57.168.878.786.592.595.581.488.092.795.797.499.0
ABIER57.568.778.386.291.995.582.089.093.296.197.898.7

Comparasion with state-of-the-art on SOP and In-shop

Recall@K110100100011020304050
Clustering67.083.793.2-------
HDC69.584.492.897.762.184.989.091.292.393.1
Margin [5]72.786.293.898.0------
Proxy-NCA73.7---------
ABIER74.286.994.097.883.195.196.997.597.898.0
HTL74.888.394.898.480.994.395.897.297.497.8

see more detail in our CVPR-2019 paper Multi-Similarity Loss

Reproducing Car-196 (or CUB-200-2011) experiments

*** weight :***

sh run_train_00.sh

Other implementations:

<p><a href="https://github.com/geonm/tf_ms_loss"> [Tensorflow]</a> (by geonm)

References

[1] [R. Hadsell, S. Chopra, and Y. LeCun. Dimensionality reduction by learning an invariant mapping]

[2] [F. Schroff, D. Kalenichenko, and J. Philbin. Facenet: A unified embedding for face recognition and clustering. In CVPR, 2015.]

[3][H. Oh Song, Y. Xiang, S. Jegelka, and S. Savarese. Deep metric learning via lifted structured feature embedding. In CVPR, 2016.]

[4][D. Yi, Z. Lei, and S. Z. Li. Deep metric learning for practical person re-identification.]

[5][C. Wu, R. Manmatha, A. J. Smola, and P. Kr¨ahenb¨uhl. Sampling matters in deep embedding learning. ICCV, 2017.]

[6][R. Salakhutdinov and G. Hinton. Learning a nonlinear embedding by preserving class neighbourhood structure. In AISTATS, 2007.]

Citation

If you use this method or this code in your research, please cite as:

@inproceedings{wang2019multi,
title={Multi-Similarity Loss with General Pair Weighting for Deep Metric Learning},
author={Wang, Xun and Han, Xintong and Huang, Weilin and Dong, Dengke and Scott, Matthew R},
booktitle={CVPR},
year={2019}
}

@inproceedings{wang2020xbm,
title={Cross-Batch Memory for Embedding Learning},
author={Wang, Xun and Zhang, haozhi and Huang, Weilin and Scott, Matthew R},
booktitle={CVPR},
year={2020}
}