Dual Dynamic Threshold Adjustment Strategy

Xiruo Jiang, Yazhou Yao, Sheng Liu, Fumin Shen, Liqiang Nie, Xian-Sheng Hua

TL;DR

This paper introduces a novel "Dual Dynamic Threshold Adjustment Strategy" (DDTAS) for deep metric learning. By dynamically adjusting thresholds for both sample mining and loss functions, DDTAS effectively addresses the imbalance between positive and negative sample pairs, leading to improved image retrieval performance.

What Problem Does This Paper Address?

Deep metric learning (DML) aims to learn an embedding space where similar samples are close and dissimilar samples are far apart. Two crucial components of DML algorithms are the loss function and the sample mining strategy. Sample mining is essential for selecting informative pairs of samples to train on, thereby improving efficiency and performance. A key aspect of sample mining is the use of a "threshold" to determine which sample pairs are considered informative.

However, existing DML methods face several challenges related to these thresholds:

  • Manual Tuning: Thresholds are often manually set, requiring extensive grid searches and repeated experiments to find optimal values, which is time-consuming and inefficient.
  • Static Thresholds: Thresholds are typically fixed throughout the training process. This is problematic because the embedding space learned by the model is constantly evolving. An initially appropriate threshold might become too strict or too loose as training progresses, leading to either exclusion of valuable samples or inclusion of redundant ones.
  • Imbalance in Sample Pairs: DML often deals with an inherent imbalance between positive (similar) and negative (dissimilar) sample pairs. Existing methods struggle to effectively manage this imbalance, especially when the number of positive samples is scarce.

This paper addresses these limitations by proposing a dynamic approach to threshold adjustment for both sample mining and loss functions.

Methods

The core of this paper's contribution lies in its Dual Dynamic Threshold Adjustment Strategy (DDTAS), which comprises two main components:

  1. Asymmetric Sample Mining Strategy (ASMS) and Adaptive Tolerance ASMS (AT-ASMS):
    • ASMS: This strategy addresses the imbalance between positive and negative pairs by using different thresholds for filtering them. It employs a looser threshold for positive pairs to ensure more are included, and a stricter threshold for negative pairs to filter out less informative ones. This helps to increase the number of informative positive pairs while reducing redundant negative pairs.
  2. AT-ASMS: This is a dynamic extension of ASMS. It adaptively adjusts the mining thresholds based on the current ratio of positive and negative pairs being mined. This meta-learning-based approach uses a single-step gradient descent to learn new thresholds during training, allowing the mining strategy to adapt to the evolving embedding space.
  3. Soft Contrastive Loss:
    • This novel loss function builds upon the strengths of Contrastive Loss and Binomial Deviance Loss. It uses a softplus function to replace the hinge function, allowing for a more nuanced weighting of sample pairs, especially those near the decision boundary.
  4. Crucially, the threshold parameter ($\lambda$) within this loss function is also made adaptive through a meta-learning approach, similar to the AT-ASMS strategy.

The Online Threshold Generator is a key mechanism that enables these dynamic adjustments. It uses a lightweight meta-training set to learn optimal thresholds for both the mining strategy and the loss function, integrating this process into the main training loop.

Datasets

The proposed method was evaluated on three standard image retrieval datasets:

  • CUB200-2011 (CUB200): Contains images of bird species.
  • Cars196: Contains images of car models.
  • Stanford Online Products (SOP): A large-scale dataset for few-shot image retrieval.

Key Insights and Ideas

  • Asymmetric Thresholding is Crucial: Simply using the same threshold for positive and negative pairs is suboptimal. Differentiating thresholds allows for better management of the inherent imbalance in DML.
  • Dynamic Adaptation is Key: Static thresholds fail to account for the evolving nature of learned embeddings during training. Dynamically adjusting thresholds based on the current training state significantly improves performance.
  • Meta-Learning for Threshold Optimization: Leveraging meta-learning principles allows for the automatic learning of optimal thresholds, reducing the need for manual tuning and improving robustness.
  • Balancing Positive and Negative Pairs: The paper highlights that while including many informative pairs is good, an overabundance of negative pairs can introduce noise and hinder compactness. Their strategy aims to strike a better balance.

Key Results

The DDTAS method, combining AT-ASMS and Soft Contrastive Loss, achieved state-of-the-art performance on the CUB200 and Cars196 datasets.

  • On CUB200, Recall@1 was improved by 2.7% (from 65.7% to 68.4%) compared to MS Loss with a fixed threshold.
  • On Cars196, Recall@1 was improved by 2.3% (from 84.1% to 86.4%) compared to MS Loss with a fixed threshold.
  • The method also demonstrated competitive performance on the larger-scale SOP dataset, achieving 78.0% for image retrieval.
  • Ablation studies showed that the asymmetric mining strategy (ASMS) and its adaptive version (AT-ASMS) significantly improved performance over symmetric thresholding methods.

Limitations and Future Work

  • Computational Cost: The dynamic threshold adjustment, particularly the meta-learning component, inevitably increases computational costs due to the need for an additional training loop or generator. The authors acknowledge this and mention using a lightweight meta-learning set to mitigate it.
  • Future Work: The authors suggest several avenues for future research:
  • Developing parameter-tuning models with even lower computational costs.
  • Evaluating the strategy on more diverse datasets to assess robustness against varying lighting conditions, noise, image clarity, and data scales.
  • Extending the method beyond image retrieval to broaden its applicability.

Summary updated

BibTeX
@article{jiang2024dual,
  author = {Xiruo Jiang and Yazhou Yao and Sheng Liu and Fumin Shen and Liqiang Nie and Xian-Sheng Hua},
  title = {{Dual Dynamic Threshold Adjustment Strategy}},
  journal = {ACM Trans. Multim. Comput. Commun. Appl.},
  year = {2024},
  doi = {10.1145/3656047},
}
Figure