Improving Deep Binary Embedding Networks by Order-Aware Reweighting of Triplets

Hanjiang Lai, Jikai Chen, Libing Geng, Yan Pan, Xiaodan Liang, Jian Yin

TL;DR

This paper introduces an "order-aware reweighting" method for deep binary embedding networks used in image retrieval. By considering the rank order of binary codes within triplets, rather than just their loss values, the method effectively prioritizes more informative triplets, leading to significant improvements in retrieval accuracy.

What Problem Does This Paper Address?

The paper tackles a key challenge in image retrieval using deep binary embedding networks: how to effectively train these networks using triplet loss. Triplet loss, which aims to ensure that similar images have closer binary codes than dissimilar ones, is powerful but suffers from inefficiencies. Existing methods either treat all triplets equally or select "hard" triplets based solely on their loss value. This approach overlooks the crucial aspect of order within the ranked list of binary codes. For instance, a triplet where a positive example is ranked far below a negative example might be considered "hard" by loss alone, but its true importance for retrieval might be even greater if it's near the top of the ranked list. The authors argue that this neglect of order relations leads to suboptimal training and hinders performance.

Methods

The core contribution is an "order-aware reweighting" strategy for the triplet loss. This strategy has two main components:

  1. Order-Aware Weighting Factor: Instead of relying solely on the triplet loss value, the authors propose a weighting factor that quantifies the importance of a triplet based on its rank order. This is achieved by calculating the change in Mean Average Precision (MAP) when the positions of the positive and negative codes within a ranked list are swapped. A larger change in MAP indicates a more misranked and thus more informative triplet, which receives a higher weight.
  2. Squared Triplet Ranking Loss: The standard linear triplet loss is replaced with a squared triplet loss. This modification amplifies the impact of larger loss values (i.e., harder triplets) while diminishing the influence of smaller loss values (easier triplets). This helps the network focus more on the challenging cases that truly require learning.

Datasets

The proposed method was evaluated on four standard benchmark datasets for image retrieval:

  • VOC2007: A dataset of annotated consumer photographs with 20 object classes.
  • Stanford Dogs: A dataset containing images of 120 dog breeds.
  • SUN397: A dataset with 397 scene categories.
  • CUB-200-2011: A dataset of 200 bird species.

The authors followed standard train/test splits for VOC2007, Stanford Dogs, and CUB-200-2011, using testing samples as queries and training samples as the retrieval database. For SUN397, they used a subset of images from 42 categories with over 500 images each.

Key Insights and Ideas

  • Order Matters More Than Just Loss: The most significant insight is that the relative ordering of binary codes within a ranked list is a more accurate indicator of a triplet's importance for retrieval than its raw loss value.
  • MAP as a Ranking Quality Metric: Leveraging MAP, a standard retrieval evaluation metric, to derive triplet weights provides a principled way to quantify the impact of misranked items on overall retrieval performance.
  • Squared Loss Amplifies Hard Cases: The squared triplet loss effectively amplifies the gradients from harder triplets, forcing the network to pay more attention to them and thus improving learning.

Key Results

The proposed order-aware reweighting method consistently outperformed existing state-of-the-art baselines across all four datasets and various bit lengths (16, 32, 48, 64 bits).

  • On VOC2007 with 64 bits, the proposed method achieved a Mean Average Precision (MAP) of 0.8227, compared to 0.7897 for the existing triplet-based method (TripletH).
  • On Stanford Dogs, the method showed a 2% increase in MAP compared to TripletH.
  • Ablation studies demonstrated that both the order-aware weighting factor and the squared triplet loss contributed to the performance gains, with their combination yielding the best results.
  • Comparisons with hard triplet selection methods (HNM and Semi-hard) also showed that the proposed order-aware approach achieved better performance, indicating the advantage of considering rank order.

Limitations and Future Work

  • Computational Cost: While not explicitly detailed as a limitation, calculating MAP for each triplet within a mini-batch to derive weights could introduce additional computational overhead compared to simpler loss functions.
  • Future Work: The paper suggests that the proposed order-aware reweighting method can be extended to other ranking-based learning tasks beyond image retrieval. The authors also explore different functions for the triplet loss (beyond squared) and found that y=2 (squared) and y=3 performed best, suggesting further investigation into the exponent's impact.

Summary updated

Abstract

In this paper, we focus on triplet-based deep binary embedding networks for image retrieval task. The triplet loss has been shown to be effective for hashing retrieval. However, most of the triplet-based deep networks treat the triplets equally or select the hard triplets based on the loss. Such strategies do not consider the order relations of the binary codes and ignore the hash encoding when learning the feature representations. To this end, we propose an order-aware reweighting method to effectively train the triplet-based deep networks, which up-weights the important triplets and down-weights the uninformative triplets via the rank lists of the binary codes. First, we present the order-aware weighting factors to indicate the importance of the triplets, which depend on the rank order of binary codes. Then, we reshape the triplet loss to the squared triplet loss such that the loss function will put more weights on the important triplets. The extensive evaluations on several benchmark datasets show that the proposed method achieves significant performance compared with the state-of-the-art baselines.
BibTeX
@article{lai2020improving,
  author = {Hanjiang Lai and Jikai Chen and Libing Geng and Yan Pan and Xiaodan Liang and Jian Yin},
  title = {{Improving Deep Binary Embedding Networks by Order-Aware Reweighting of Triplets}},
  journal = {IEEE Trans. Circuits Syst. Video Technol.},
  year = {2020},
  url = {https://openreview.net/forum?id=MwvhL_QZ-T},
}
Figure