NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Geodesic Distance Estimation with Spherelets

Didong Li, David B. DunsonarXiv 2019 · DOI

Abstract

Many statistical and machine learning approaches rely on pairwise distances between data points. The choice of distance metric has a fundamental impact on performance of these procedures, raising questions about how to appropriately calculate distances. When data points are real-valued vectors, by far the most common choice is the Euclidean distance. This article is focused on the problem of how to better calculate distances taking into account the intrinsic geometry of the data, assuming data are concentrated near an unknown subspace or manifold. The appropriate geometric distance corresponds to the length of the shortest path along the manifold, which is the geodesic distance. When the manifold is unknown, it is challenging to accurately approximate the geodesic distance. Current algorithms are either highly complex, and hence often impractical to implement, or based on simple local linear approximations and shortest path algorithms that may have inadequate accuracy. We propose a simple and general alternative, which uses pieces of spheres, or spherelets, to locally approximate the unknown subspace and thereby estimate the geodesic distance through paths over spheres. Theory is developed showing lower error for many manifolds, with applications in clustering, conditional density estimation and mean regression. The conclusion is supported through multiple simulation examples and real data sets.

Introduction

Most machine learning algorithms, from k-means clustering to dimensionality reduction, rely on calculating distances between data points. Usually, we use Euclidean distance (the "as the crow flies" straight line). However, real-world data often concentrates near a nonlinear subspace, like a curved sheet or a spiral. In these cases, the "true" distance is the geodesic distance—the length of the shortest path following the shape of the data.

Popular algorithms like Isomap try to estimate this by building a graph of local neighbors and summing up straight-line distances. The problem is that straight lines are a poor fit for curved shapes. To get high accuracy, a massive number of data points is required so that the "straight" segments are tiny. This paper proposes a more efficient alternative: using curved "spherelets" instead of straight lines.

The Spherelet Approach

The authors propose a "local-to-global" strategy to estimate geodesic distances. Instead of approximating a small neighborhood of data with a flat plane (tangent space), they fit a $d$-dimensional sphere, called an osculating sphere. This sphere is chosen to match the local curvature of the data.

Because the geometry of a sphere is well-understood, the distance between two points on this "spherelet" has a simple, analytic closed-form solution (an arc length). To estimate global distances, a weighted graph is constructed where the edges are these spherical distances. Dijkstra’s algorithm is then used to find the shortest path between any two distant points on the manifold.

Algorithms for Spherelet Fitting

The paper provides two specific algorithms for fitting these spheres, as shown in Figure 1. Algorithm 1 describes the Centered $k$-osculating sphere, which is ideal for clean data where the base point $x$ is known. Algorithm 2 is an Uncentered version that is more robust to noise, as it uses the local mean $\bar{x}$ of the neighborhood.

Algorithms for fitting centered and uncentered k-osculating spheres.

Key Results and Insights

The Spherelet approach offers several advantages over traditional linear approximations. While the error in Euclidean distance is "third-order" ($O(s^3)$), the use of spherelets improves this to "fourth-order" ($O(s^4)$) for curves and hypersurfaces. Spheres represent a "Goldilocks" approximation: they are more complex than planes but simpler than general manifold approximations, allowing for a closed-form distance formula.

The method was validated on several datasets, including the Euler Spiral. As shown in Figure 2, the spherelet-based approach can accurately capture the underlying structure of noisy data. On the Euler Spiral, the Spherelet estimator achieved global errors several orders of magnitude smaller than Euclidean or standard graph-based methods (e.g., $3.2 \times 10^{-7}$ vs $1.4 \times 10^{-4}$ for Isomap).

Visualization of the Euler Spiral with a fitted curve approximating the manifold.

Beyond synthetic data, the authors demonstrated superior performance in real-world tasks:

  • Clustering: In the Banknote Authentication and Galaxy Zoo tasks, "k-Smedoids" (k-medoids using Spherelet distances) consistently outperformed standard k-medoids across all metrics, including the Adjusted Rand Index (ARI).
  • Regression/Density Estimation: In kernel regression and density estimation (e.g., Power Plant and Concrete datasets), using geodesic distances derived from spherelets led to significantly lower Root Mean Square Error (RMSE) compared to Euclidean-based models.

Discussion and Conclusion

While the Spherelet method provides significant accuracy gains, it does assume the data lies on a manifold. If the data lacks intrinsic geometric structure, the overhead of fitting spheres may not be beneficial. Additionally, the algorithm requires tuning parameters such as the number of neighbors ($k$) and the manifold dimension ($d$).

Future work involves making the method more adaptive, potentially allowing it to default back to Euclidean distance automatically if no significant curvature is detected. Overall, Spherelets provide a simple and general alternative for improving distance estimation in manifold-based machine learning.

Summary updated

BibTeX
@misc{li2019geodesic,
  author = {Didong Li and David B. Dunson},
  title = {{Geodesic Distance Estimation with Spherelets}},
  year = {2019},
  eprint = {1907.00296},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1907.00296},
}
Figure