Transferable Deep Metric Learning for Clustering

Simo Alami C, Rim Kaddah, Jesse ReadIDA 2023

Introduction

Clustering is a fundamental task in unsupervised learning, yet it remains inherently subjective. Depending on the context, a "good" clustering might group objects by color, shape, or semantic category. In high-dimensional spaces, this ambiguity is compounded by the "curse of dimensionality," where standard distance metrics like Euclidean distance often fail to capture meaningful relationships.

While deep clustering methods have made significant strides, they are typically domain-specific. A model trained to cluster handwritten digits rarely generalizes to fashion items or biological data without extensive retraining. This paper introduces a framework for Transferable Deep Metric Learning, designed to learn the underlying "logic" of clustering. By capturing this logic, the proposed model can be applied to entirely unseen datasets across different distributions and dimensions.

The Critic2Metric (C2M) Framework

The authors propose a three-component architecture called Critic2Metric (C2M), which decouples the clustering logic from the specific features of the data. This is achieved through the following modules:

1. The Clustering Mechanism (Bloc A)

Unlike traditional deep learning models that rely on backpropagation, C2M utilizes the Cross-Entropy Method (CEM), an evolutionary optimization strategy. CEM optimizes the weights of a simple neural network to propose clusterings that maximize a score provided by a "Critic." This allows the model to explore the clustering space without requiring differentiable loss functions for the clustering step itself.

2. Graph-based Dataset Embedding (Bloc B)

To capture global geometric properties rather than just local pairwise distances, the framework represents the dataset as a graph where clusters are represented as cliques. A Graph Autoencoder (GAE) compresses this global structure into a fixed-length embedding vector ($z$). This approach ensures the model understands the overall topology of the data, which is crucial for identifying complex clusters.

3. The Critic as a Metric (Bloc C)

The core of the system is the critic component of a Wasserstein GAN (WGAN). This critic is trained to act as a universal grading scale. It learns to output high scores for embeddings of "correct" (ground-truth) clusterings and low scores for the proposals generated by the clustering mechanism. Because the critic evaluates the quality of the grouping rather than the raw data points, it becomes a domain-agnostic metric.

Experimental Evaluation

The researchers evaluated C2M on a diverse array of benchmarks, ranging from synthetic 2D data to complex real-world images:

  • Synthetic Data: Blobs, Moons, Circles, and Anisotropic distributions.
  • MNIST Variants: Standard Digits, EMNIST (Letters), and Fashion-MNIST.
  • Real-world Images: SVHN (Street View House Numbers) and Omniglot (handwritten characters from 100 classes).

Notably, the model was tested in "few-shot" scenarios, where the metric was trained on as few as five labeled datasets before being deployed on entirely new domains.

Key Results

  • Cross-Domain Generalization: A metric trained exclusively on simple Gaussian "Blobs" successfully clustered non-linear shapes like "Circles" and "Moons" with over 91% accuracy. This demonstrates that the model learns the concept of "separation" rather than just memorizing shapes.
  • MNIST to Fashion-MNIST: When transferring from handwritten digits to fashion items, the model achieved a Normalized Mutual Information (NMI) of ~0.79, performing competitively with models specifically engineered for those domains.
  • Robustness in Difficult Transfers: In a challenging transfer from SVHN (real-world house numbers) to MNIST (handwritten digits), the few-shot version of C2M achieved 81.4% accuracy, significantly outperforming baseline methods like DANN and LTR that lacked domain adaptation capabilities.
  • Scalability on Omniglot: On the Omniglot dataset, the model achieved 83.4% accuracy, rivaling specialized state-of-the-art methods such as DTC (87.0%) and Autonovel (85.4%).

Key Insights

  • Clustering as "Logic" Transfer: The fundamental breakthrough is the realization that clustering reasoning (e.g., "group by density" or "group by shape") is transferable even when the data distribution changes entirely.
  • Global vs. Local Structure: By using Graph Autoencoders to embed the entire dataset, the model avoids the computational bottlenecks of pairwise distance calculations, making it more scalable to larger datasets while maintaining a global perspective.
  • Permutation Invariance: The critic is designed to be invariant to specific labels. It prioritizes the quality of the grouping—ensuring items inside a cluster belong together—regardless of whether a cluster is labeled "1" or "A."
  • Efficiency: C2M achieves state-of-the-art results using remarkably shallow networks (often just two layers), proving that complex backbones are not always necessary if the metric logic is sound.

Limitations and Future Work

Despite its success, the framework faces certain challenges. The current embedding method remains somewhat sensitive to the number of points in a dataset; transferring between datasets with vastly different scales (e.g., 200 vs. 20,000 points) currently requires additional regularization. Furthermore, while the CEM optimization is robust, it can occasionally settle in local optima, suggesting that more advanced optimization strategies could yield even higher performance.

Future research will focus on developing "transferability measures" to predict which auxiliary datasets provide the best training ground for specific target tasks, further refining the ability to apply "clustering logic" across the diverse landscape of machine learning problems.

Summary updated

BibTeX
@inproceedings{c2023transferable,
  author = {Simo Alami C and Rim Kaddah and Jesse Read},
  title = {{Transferable Deep Metric Learning for Clustering}},
  booktitle = {IDA},
  year = {2023},
}
Figure