End-to-End Data Visualization by Metric Learning and Coordinate Transformation

Lilei Zheng, Ying Zhang, Stefan Duffner, Khalid Idrissi, Christophe García, Atilla Baskurt · DOI

Abstract

This paper presents a deep nonlinear metric learning framework designed for high-dimensional data visualization. We introduce "Triangular Similarity" and demonstrate its mathematical equivalence to Cosine Similarity for measuring data pairs. Leveraging this similarity, we develop a geometrically motivated "triangular loss" function to optimize a Siamese CNN architecture. To overcome the computational bottlenecks of traditional metric learning, we propose a hybrid training algorithm. Finally, we apply coordinate transformations to "unfold" the resulting hyperspherical output spaces into lower-dimensional planes, achieving state-of-the-art classification results in visualizable 2D and 3D spaces.

Introduction

Visualizing high-dimensional data, such as images, typically requires mapping them into a 2D or 3D space. While standard Convolutional Neural Networks (CNNs) are powerful, their output layers are often constrained by the number of classes. Siamese networks offer more flexibility by learning from data pairs, but they suffer from quadratic growth in training pairs relative to dataset size. This research seeks an "end-to-end" solution that maintains the performance of deep learning while ensuring efficient training and flexible dimensionality reduction.

Methodology

1. Triangular Similarity

The core innovation is the Triangular Similarity, a geometric approach to measuring vector similarity. While standard Cosine Similarity focuses on the angle $\theta$ between vectors, Triangular Similarity measures the half-length of the chord connecting two points on a unit circle.

Geometric equivalence between Triangular Similarity and Cosine Similarity on a unit circle.

As shown in the figure above, the authors prove that these two measures are mathematically equivalent. However, the triangular formulation provides a more intuitive basis for gradient-based optimization in metric learning.

2. Triangular Loss Function

Building on the triangle inequality, the researchers developed a loss function that encourages "similar" pairs to converge toward a single point and "dissimilar" pairs to move toward opposite poles of a hypersphere.

The geometric intuition behind the Triangular Loss, showing positive (similar) and negative (dissimilar) vector configurations.

This geometric motivation allows the system to utilize standard deep learning optimizations like Dropout and Momentum, as the gradient of the triangular loss effectively mirrors a "double copy" of the standard Mean Square Error (MSE) gradient.

3. TSML-Hybrid Training

To address the speed limitations of Siamese networks, a four-stage hybrid strategy is employed:

  1. Tiny-scale training: A Siamese network is trained on a minimal subset of samples to establish initial class centers.
  2. Transplanting: Parameters are transferred to a single-track CNN.
  3. Large-scale training: The single-track CNN is trained using MSE against the established class centers, which is significantly faster than pair-wise training.
  4. Length normalization: Final outputs are projected onto a unit hypersphere.

4. Coordinate Transformation

To improve visualization, the authors use manifold "unfolding" techniques. By treating the output hypersphere as a manifold, they apply coordinate transformations (similar to a Mercator projection) to map the data onto lower-dimensional Euclidean planes. This process often results in cleaner class separation than direct linear projection.

Experimental Results

The framework was evaluated on the MNIST dataset. The proposed TSML-Hybrid method demonstrated significant improvements over the state-of-the-art DrLIM method:

  • Efficiency: Training time was reduced from approximately 9,600 seconds (DrLIM) to just 1,110 seconds.
  • Accuracy: The system achieved remarkable classification accuracy in extremely low-dimensional spaces:
  • 1D (unfolded 2D circle): 94.76%
    • 2D (unfolded 3D sphere): 98.05%
    • 3D (unfolded 4D hypersphere): 98.66%

Conclusion

By combining geometric intuition with efficient hybrid training, this framework enables high-performance data visualization that scales better than traditional Siamese approaches. Future work will focus on addressing boundary artifacts created during the "unfolding" process and extending the framework to unsupervised learning tasks on more complex datasets.

Summary updated

BibTeX
@misc{zheng2016end,
  author = {Lilei Zheng and Ying Zhang and Stefan Duffner and Khalid Idrissi and Christophe García and Atilla Baskurt},
  title = {{End-to-End Data Visualization by Metric Learning and Coordinate Transformation}},
  year = {2016},
  eprint = {1612.08499},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1612.08499},
}
Figure