Classification in Non-Metric Spaces

Daphna Weinshall, David W. Jacobs, Yoram GdalyahuNeurIPS 1998

TL;DR

Most machine learning algorithms assume that "similarity" behaves like a standard physical distance (a metric). This paper breaks that assumption, providing new mathematical tools for classification in "non-metric" spaces where the triangle inequality doesn't hold. By redefining what a class "mean" looks like and using correlation to select representative data points, the authors show we can build more robust classifiers that better align with human perception and noisy real-world data.

What Problem Does This Paper Address?

In classical geometry and machine learning, we usually treat objects as points in a vector space and measure their similarity using Euclidean distance. This distance is a metric, meaning it follows the triangle inequality: the distance from A to C cannot be greater than the sum of the distances from A to B and B to C.

However, human psychology and robust statistics suggest that real-world similarity is often non-metric. For example, a famous psychological study by Tversky noted that while Jamaica is similar to Cuba, and Cuba is similar to Russia (politically, at the time), Jamaica is not at all similar to Russia. If your distance function allows this "shortcut" to be broken, standard algorithms like k-means or Nearest Neighbor start to fail.

Voronoi diagrams for two points under different distance metrics, showing how non-metric spaces create complex boundaries.

The authors tackle the challenge of how to perform supervised learning—specifically finding class prototypes and condensing large datasets—when your distance function is "messy" and non-metric. As seen in the Voronoi diagrams above, non-metric distances (like fractional $L^p$ norms or median distances) create highly complex, non-intuitive decision boundaries compared to standard Euclidean space.

Methods

The paper introduces two primary approaches to handle non-metric distances:

  1. Parametric (Redefining the Mean): In Euclidean space, the "mean" is the point that minimizes the sum of squared distances to all members. For non-metric $L^p$ spaces (where $p < 1$), the authors prove a fascinating property: the optimal representative point (the "mean") must be a "mixture of exemplars." Specifically, every feature of this new mean must have already appeared in at least one existing member of the class. This allows for an efficient $O(dn^2)$ algorithm to find the prototype.
  2. Non-Parametric (Correlation Selection): Nearest neighbor classifiers often use "condensing" to save memory, keeping only a few representative points. Usually, you'd keep points near the boundaries or discard points that are "close" to each other. In non-metric spaces, "closeness" is deceptive. The authors propose Correlation Selection: they keep points that are least correlated with others. They argue that in non-metric spaces, the correlation between two points' distance vectors (how they "see" the rest of the dataset) is a much better measure of whether one can substitute for the other than simple distance.

Datasets

The authors validated their theories using a mix of synthetic and real-world data:

  • Corel Image Database: A large commercial database of pre-labeled images (e.g., "lions"). Images were represented by 11-dimensional vectors describing color histograms and other properties.
  • Synthetic Clusters: 30 clusters generated in a 25-dimensional space ($\mathbb{R}^{25}$) using various distributions (normal, modified coordinates, and concentric shapes) to test how different distance functions (Median, $L^{0.2}$, $L^{0.5}$, and $L^2$) affected accuracy.
  • Image Contours: A specific dataset of 30 "cow" contours and 30 "car" contours from different viewpoints, processed using a non-metric local curve matching algorithm.

Key Insights and Ideas

  • The "Mean" is a Mosaic: In non-metric $L^p$ spaces, the "average" object isn't a new, blurred point in the middle of the space. Instead, it’s a composite where each individual feature is borrowed from an actual, observed member of the group.
  • Distance vs. Pattern: In a metric space, if A is near B, they are interchangeable. In a non-metric space, A and B might be "zero distance" apart but have completely different relationships with the rest of the world.
  • Correlation as the New Metric: The "aha moment" of the paper is that the correlation of distance vectors is a more reliable way to identify redundant data than the distance itself. If two points have highly correlated distance vectors, they provide the same "information" to the classifier.

Key Results

  • Prototype Accuracy: On the Corel dataset, using the non-metric $L^{0.5}$ prototype yielded a 25% classification accuracy, compared to only 18-20% when using a standard Euclidean mean.
  • Condensing Performance: In nearest neighbor tests, the Correlation Selection method significantly outperformed random selection and boundary-detection methods when using non-metric distances (like Median or $L^{0.2}$).
  • "Do No Harm": Importantly, the authors found that their correlation-based method performed just as well as standard methods in Euclidean (metric) spaces. This makes it a "safe" default choice when the underlying nature of the data's distance function is unknown.

Limitations and Future Work

  • Computational Cost: While the authors describe their algorithms as "efficient," the $O(dn^2)$ complexity for finding the mean might still be a hurdle for the massive, million-point datasets common in modern deep learning.
  • Specific Distances: The paper focuses heavily on $L^p$ and Median distances. It remains an open question how these methods would perform with more exotic, "black-box" similarity functions used in modern transformer-based embeddings.
  • Feature Engineering: The relatively low absolute accuracy on the Corel dataset (25%) suggests that while the non-metric approach helps, the underlying 11-dimensional features might not be expressive enough for complex image classification.

Summary updated

BibTeX
@inproceedings{weinshall1998classification,
  author = {Daphna Weinshall and David W. Jacobs and Yoram Gdalyahu},
  title = {{Classification in Non-Metric Spaces}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {1998},
  url = {https://openreview.net/forum?id=H1V4ww-ObB},
}

Loading related content...

Figure