Improving deep metric learning via self-distillation and online batch diffusion process

Zelong Zeng, Fan Yang, Hong Liu, Shin'ichi SatohVis. Intell 2024

Abstract

Deep Metric Learning (DML) is fundamental for tasks like image retrieval and clustering, where the goal is to learn an embedding space that reflects semantic similarity. Traditional DML approaches often rely on rigid class labels, failing to capture the nuanced intra-class variations and complex manifold structures of real-world data. We present OBD-SD (Online Batch Diffusion-based Self-Distillation), a plug-and-play framework that enhances DML by leveraging a model's own historical performance. By combining Progressive Self-Distillation (PSD) with an Online Batch Diffusion Process (OBDP), our method discovers high-order geometric relationships within mini-batches. Experimental results on standard benchmarks demonstrate that OBD-SD significantly improves retrieval accuracy and embedding quality with minimal computational overhead.

Introduction

The core objective of Deep Metric Learning (DML) is to map data points into a high-dimensional space where similar items are clustered together and dissimilar ones are pushed apart. While effective, standard DML objectives often treat class labels as binary constraints, which can lead to "over-clustering." This phenomenon collapses the rich internal structure of a class—such as different viewpoints of an object or sub-species within a category—into a single point, hindering the model's ability to generalize to unseen categories (zero-shot learning).

To address this, researchers have explored knowledge distillation, where a "student" model learns from a more complex "teacher." However, finding or training a suitable teacher is often computationally prohibitive. OBD-SD solves this by using the model's own past states as a teacher, refined through a diffusion process that uncovers the underlying geometry of the data.

Methodology: The OBD-SD Framework

The OBD-SD framework consists of two primary components designed to refine the learning signal without external supervision.

Progressive Self-Distillation (PSD)

Instead of a static external teacher, PSD employs the model from the previous training epoch as the teacher for the current epoch. This "self-evolution" ensures that the teacher is always relevant to the student's current state. A dynamic weighting scheme gradually increases the influence of the distillation loss as the model matures, allowing the student to first learn basic features before focusing on the nuanced geometric targets provided by the teacher.

Online Batch Diffusion Process (OBDP)

While standard distillation focuses on pairwise distances, the Online Batch Diffusion Process (OBDP) captures higher-order relationships. By treating images in a mini-batch as nodes in a graph, OBDP performs a "random walk" to explore the manifold structure. This process identifies connections between samples that might be distant in Euclidean space but are semantically linked through intermediate neighbors.

Overview of the OBD-SD framework, illustrating the interaction between Progressive Self-Distillation (PSD) and the Online Batch Diffusion Process (OBDP).

Experimental Evaluation

The effectiveness of OBD-SD was evaluated on three prominent DML benchmarks: CUB200-2011 (birds), CARS196 (cars), and Stanford Online Products (SOP).

Performance and Efficiency

OBD-SD consistently outperformed state-of-the-art baselines. When integrated with the Multi-Similarity (MS) loss, it achieved a Recall@1 improvement of 4.46% on CUB200 and 2.54% on CARS196. Crucially, this performance gain comes with very low computational cost. Compared to other self-distillation methods like BAR, which can double training time, OBD-SD adds only a ~7.4% overhead.

Qualitative Analysis

Visualizing the embedding space reveals the impact of the diffusion process. As shown in the t-SNE plots below, the addition of OBD-SD results in more distinct, well-separated clusters compared to the baseline MS loss.

Visualization of embedding spaces for different methods, demonstrating the improved clustering and separation achieved by MS+OBD-SD.

Key Insights

  • Self-Distillation as a Regularizer: Using a previous version of the model provides a "soft" target that is more informative than a hard class label, encouraging the model to preserve intra-class variance.
  • Manifold Awareness: The online diffusion process allows the model to learn the "shape" of the data distribution within each batch, leading to more robust feature representations.
  • Focus on Hard Samples: Theoretical analysis indicates that PSD naturally prioritizes samples where the student's current understanding deviates most from the teacher's refined geometric view, effectively acting as an automated hard-sample mining strategy.

Conclusion and Future Work

OBD-SD represents a significant step forward in making DML more efficient and geometrically aware. By turning the training history into a teacher and using diffusion to map the data manifold, it achieves superior generalization in zero-shot retrieval tasks. Future research may extend these diffusion-based distillation techniques to self-supervised learning environments, where the model must discover semantic structures entirely without human-provided labels.

Summary updated

BibTeX
@article{zeng2024improving,
  author = {Zelong Zeng and Fan Yang and Hong Liu and Shin'ichi Satoh},
  title = {{Improving deep metric learning via self-distillation and online batch diffusion process}},
  journal = {Vis. Intell.},
  year = {2024},
  doi = {10.1007/s44267-024-00051-0},
}
Figure