Abstract
Deep embedding learning often struggles with "easy" samples that contribute nothing to training, while finding "hard" samples usually requires computationally expensive exhaustive searches. This paper introduces DE-DSP, a framework that replaces hand-crafted mining rules with a Deep Sampler Network (DSN) that learns to intelligently pick the most informative training examples. By treating sampling as a reinforcement learning problem, the DSN identifies samples that maximize the expected reward (loss value), leading to faster convergence and state-of-the-art accuracy across multiple image retrieval benchmarks.
Introduction
In deep embedding learning (or metric learning), the goal is to map images into a feature space where similar items are close together and dissimilar items are far apart. This is the backbone of technologies like face recognition and image retrieval.
The challenge is that most pairs or triplets of images in a dataset are "easy"—the model already knows they are different. Training on these easy samples produces gradients near zero, wasting time and slowing down convergence. To fix this, researchers use "hard example mining" to find the tricky cases. However, existing mining methods are usually hand-crafted based on fixed rules, computationally heavy (often $O(N^2)$ or $O(N^3)$), and local to small mini-batches.
Methods
The authors propose Deep Embedding with Discriminative Sampling Policy (DE-DSP). Instead of using a fixed rule to find hard examples, they treat sampling as a learning problem. The framework consists of two models trained simultaneously: the Feature Embedding (M), which learns image representations, and the Deep Sampler Network (DSN), a lightweight agent that learns a selection policy.
The training process involves three main steps:
- Sample Generation: The DSN selects a mini-batch from the larger batch.
- DSN Fine-tuning: The DSN is updated based on the "instructiveness" (loss) of the selected samples.
- M Learning: The embedding network M is updated using the samples chosen by the DSN.
The DSN uses a stochastic selection process with a softmax policy to maintain exploration. It is trained to maximize an "expected reward," where the reward is the loss value generated in the embedding network. If a sample helps the embedding network learn, the DSN is rewarded for picking it.
Furthermore, the DSN learns a relational prior. Unlike exhaustive search, which treats every image as an independent calculation, the DSN learns to exploit the relationships between samples. It can generalize from a few "score tests" to estimate the hardness of untested samples, drastically reducing the number of forward passes needed.
Experimental Setup
The authors evaluated DE-DSP on four widely-used image retrieval benchmarks:
- CUB-200-2011: 200 bird species (fine-grained categorization).
- Cars196: 196 car models.
- Stanford Online Products (SOP): Over 120,000 images of eBay products.
- In-Shop Clothes Retrieval: A large-scale fashion dataset.
Results and Discussion
DE-DSP consistently outperformed standard Triplet and N-pair baselines across all datasets. For example, on the Cars196 dataset, it improved the Recall@1 score from 45.1% (standard Triplet) to 59.3%.
Key Insights
- Sampling > Loss Function: The paper reinforces the idea that how you choose your data is often more important than the specific loss function (Triplet vs. N-pair) you use.
- Efficiency: The DSN is remarkably fast. In a test selecting a negative sample from 100 classes, exhaustive search took 4.3 seconds, while the DSN took only 0.016 seconds—a speedup of roughly 270x.
- Adaptability: Because the DSN is trained alongside the embedding, the sampling strategy evolves. As the embedding gets "smarter," the DSN automatically starts looking for even harder examples to keep the challenge level appropriate.
Conclusion
While DE-DSP offers significant performance and efficiency gains, it introduces initial overhead due to the need for DSN training and fine-tuning. Future work could explore the impact of different DSN architectures and the generalization of learned sampling to unsupervised or self-supervised metric learning contexts.
Summary updated