On Learning Density Aware Embeddings

Soumyadeep Ghosh, Richa Singh, Mayank Vatsa

Abstract

Deep metric learning algorithms have been utilized to learn discriminative and generalizable models which are effective for classifying unseen classes. In this paper, a novel noise tolerant deep metric learning algorithm is proposed. The proposed method, termed as Density Aware Metric Learning, enforces the model to learn embeddings that are pulled towards the most dense region of the clusters for each class. It is achieved by iteratively shifting the estimate of the center towards the dense region of the cluster thereby leading to faster convergence and higher generalizability. In addition to this, the approach is robust to noisy samples in the training data, often present as outliers. Detailed experiments and analysis on two challenging cross-modal face recognition databases and two popular object recognition databases exhibit the efficacy of the proposed approach. It has superior convergence, requires lesser training time, and yields better accuracies than several popular deep metric learning methods.

Introduction

Deep Metric Learning (DML) is fundamental to modern computer vision tasks such as facial recognition and object retrieval. The primary objective is to learn an embedding space where intra-class samples are clustered together while inter-class samples are pushed apart. Standard techniques, including Triplet Loss and Center Loss, typically optimize embeddings toward a geometric centroid (mean) of the class.

However, real-world datasets often contain noise, such as blurry images or mislabeled samples. These outliers can significantly skew the geometric mean, pulling the class center away from the high-density region of "true" samples. This leads to two primary issues: slow convergence due to unstable centers and poor generalization as the model overfits to accommodate noisy outliers.

Density Aware Metric Learning

To address these limitations, we propose Density Aware Metric Learning. Instead of a simple mean, the target center is shifted toward the most dense region of the cluster, effectively ignoring outliers on the fringes.

Comparison between conventional center-based learning (a) and the proposed density-aware approach (b).

The methodology involves identifying an "enclosure region" consisting of the $p$ nearest points to the current center estimate. The center is then iteratively updated using a weighted mean shift approach, inspired by Kernel Density Estimation (KDE). Points closer to the dense core receive higher weights, while those further away are penalized. This logic is integrated into two novel loss functions: Density Aware Triplet Loss (DATL) and Density Aware Quadruplet Loss (DAQL).

Experimental Evaluation

The proposed method was evaluated on four diverse datasets: SCface (low-resolution surveillance faces), FaceSurv (multi-modal video faces), and the CIFAR-10 and STL-10 object recognition benchmarks.

Performance and Convergence

The Density Aware approach demonstrates significant improvements in training efficiency. On the STL-10 dataset, DATL reduced training time by 54% compared to vanilla Triplet Loss.

Comparison of training time in minutes (a) and convergence in epochs (b) across different loss functions.

As shown in the results, DATL not only converges in fewer epochs but also requires substantially less wall-clock time. This efficiency stems from the stability of the density-aware center, which avoids the computational overhead of complex "hard negative mining" required by standard triplet methods.

Robustness to Noise

In stress tests where 15% of the training data was corrupted with low-resolution noise, DATL maintained a Rank-1 accuracy of 66.52% on the SCface dataset, compared to only 54.12% for the standard Triplet Loss. This confirms the model's ability to self-correct by focusing on the "mode" of the data distribution rather than being trapped by the geometric mean.

Conclusion

Density Aware Metric Learning provides a robust alternative to conventional centroid-based methods. By focusing on the densest regions of class clusters, the model achieves superior convergence, requires less training time, and exhibits higher resilience to noisy data. Future research may extend this density-aware paradigm to other domains like medical imaging or anomaly detection where outlier management is critical.

Summary updated

BibTeX
@inproceedings{ghosh2019learning,
  author = {Soumyadeep Ghosh and Richa Singh and Mayank Vatsa},
  title = {{On Learning Density Aware Embeddings}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  url = {https://openreview.net/forum?id=JSOpxQLYSpJQ},
}
Figure