The original NetVLAD paper utilizes the weakly supervised triplet ranking loss [1]}. However, Since here the NetVLAD layer is applied to learn patch-wise embeddings, Another strategy is employed. Based on the definition of loss we tend to train on semi-hard triplets [2]}: triplets where the negative is not closer to the anchor than the positive, but which still produce positive loss: \(d(\phi _{a}, \phi _{p}) < d(\phi _{a}, \phi _{n}) < d(\phi _{a}, \phi _{p}) + margin\) .
