However, even when considering the whole batch, not all the samples are able to contribute to the loss term. This is because many of them already satisfy the constraints present in the loss. As a result, these samples are not sufficiently informative and lead to low gradient values. To overcome this problem, the idea of using hard samples has been considered, i.e. positive samples which lie far away and negative samples which lie closer. Several works on hard negative mining [1]}, [2]}, [3]}, [4]}, [5]} have been proposed. Mining-based strategies generally look for the most informative samples in the dataset and are prone to learning biased mappings, which do not generalize well to the entire dataset. On the other hand, hard negative generation-based methods [6]}, [7]}, [8]} utilize an additional sub-network, either an autoencoder or a generative adversarial network [9]} as the generator. This can result in harder optimization [10]} and an increase in training time and computation.
