A Tensorflow retrieval (space embedding) baseline. Metric learning baseline on CUB and Stanford Online Products.
This repository provides a retrieval/space embedding baseline using multiple retrieval datasets and ranking losses. This code is based on triplet-reid repos.
All the following experiments assume a training mini-batch of size 60. The architecture employed is the one used in In Defense of the Triplet Loss for Person Re-Identification but ResNet is replaced by a DenseNet169. Optimizer: Adam, Number of iterations = 25K
Method | Normalized | Margin | NMI | R@1 | R@4 | # of classes | #samples per class |
---|---|---|---|---|---|---|---|
Semi-Hard | Yes | 0.2 | 0.902 | 87.43 | 95.42 | 10 | 6 |
Hard-Negative | No | 1.0 | 0.904 | 88.38 | 95.74 | 10 | 6 |
Lifted Structured | No | 1.0 | 0.903 | 87.32 | 95.59 | 10 | 6 |
N-Pair Loss | No | N/A | 0.903 | 89.12 | 96.13 | 30 | 2 |
Angular Loss | Yes | N/A | 0.8931 | 84.70 | 92.32 | 30 | 2 |
Custom Contrastive Loss | Yes | 1.0 | 0.826 | 44.09 | 67.17 | 15 | 4 |
Mini-batch size=120. Architecture: Inception_Net V1. Optimizer: Momentum. Number of iterations = 10K
Method | Normalized | Margin | NMI | R@1 | R@4 | # of classes | #samples per class |
---|---|---|---|---|---|---|---|
Semi-Hard | Yes | 0.2 | 0.587 | 49.03 | 73.43 | 20 | 6 |
Hard Negatives | No | 1.0 | 0.561 | 46.55 | 71.03 | 20 | 6 |
Lifted Structured | No | 1.0 | 0.502 | 35.26 | 59.82 | 20 | 6 |
N-Pair Loss | No | N/A | 0.573 | 46.52 | 59.26 | 60 | 2 |
Angular Loss | Yes | N/A | 0.546 | 45.50 | 68.43 | 60 | 2 |
Custom Contrastive Loss | Yes | 1.0 | 0.476 | 37.27 | 62.39 | 30 | 4 |
Mini-batch size=120. Architecture: Inception_Net V1. Optimizer: Adam. Number of iterations = 30K
Method | Normalized | Margin | NMI | R@1 | R@4 | # of classes | #samples per class |
---|---|---|---|---|---|---|---|
Semi-Hard | Yes | 0.2 | 0.893 | 71.22 | 81.77 | 20 | 6 |
Hard Negatives | No | 1.0 | 0.895 | 72.03 | 82.55 | 20 | 6 |
Lifted Structured | No | 1.0 | 0.889 | 68.26 | 79.72 | 20 | 6 |
N-Pair Loss | No | N/A | 0.893 | 72.60 | 82.59 | 60 | 2 |
Angular Loss | Yes | N/A | 0.878 | 60.30 | 72.78 | 60 | 2 |
Custom Contrastive Loss | Yes | 1.0 | 0.825 | 19.05 | 32.28 | 30 | 4 |
Keep an eye on ranking/__init__.py
for new ranking loss
Method | Setting |
---|---|
Semi-Hard | L2-Norm Yes, Margin =0.2 |
Hard Negatives | L2-Norm No , Margin =1.0 |
Lifted Structured | L2-Norm No , Margin =1.0 |
N-Pair Loss | L2-Norm No , Margin =N/A |
Angular Loss | L2-Norm Yes, Margin =N/A |
Custom Contrastive Loss | L2-Norm Yes, Margin =1.0 |