Abstract 1 Introduction 2 Mathematical Preliminaries 3 Hilbert SVM 4 Extensions References

Classifiers in High Dimensional Hilbert Metrics

Aditya Acharya ORCID Department of Computer Science, University of Maryland, College Park, MD, USA    Auguste H. Gezalyan ORCID Department of Computer Science, University of Maryland, College Park, MD, USA    David M. Mount ORCID Department of Computer Science, University of Maryland, College Park, MD, USA
Abstract

Classifying points in high-dimensional spaces is a fundamental geometric problem in machine learning. In this paper, we address the problem of classifying points in the d-dimensional Hilbert polygonal metric. The Hilbert metric is a generalization of the Cayley-Klein hyperbolic distance to arbitrary convex bodies and has a diverse range of applications in machine learning and convex geometry. We first present an efficient LP-based algorithm in the metric for the large-margin SVM problem. Our algorithm runs in time polynomial in the number of points, the number of bounding facets, and the dimension. This is a significant improvement over previous work, which either provides no theoretical guarantees on runtime or suffers from exponential runtime. We also consider the closely related Funk metric. Finally, we present efficient algorithms for the soft-margin SVM problem and nearest-neighbor-based classification in the Hilbert metric.

Keywords and phrases:
Support vector machines, Hilbert geometry, classification, machine learning
Copyright and License:
[Uncaptioned image] © Aditya Acharya, Auguste H. Gezalyan, and David M. Mount; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Computational geometry
Editor:
Pierre Fraigniaud

1 Introduction

In machine learning, binary classification is a supervised learning task where an algorithm learns to map input data (feature vectors in d) to one of two mutually exclusive classes, often denoted as positive and negative. The primary objective is to train a model that can accurately predict the class of a new, unseen data point. Binary classification is one of the most fundamental geometric problems in machine learning [11, 39, 37, 5]. Support vector machines (SVMs) were introduced by Vapnik and Chervonenkis [41] as a robust binary classification algorithm [10]. Given two sets of training points P+ and P, SVM computes a hyperplane that separates the two sets such that the minimum distance from each point set to the separating hyperplane, called the margin, is maximized.

SVMs are widely used across diverse fields such as computer vision [40, 26], natural language processing [13, 22], and computational biology [20]. Traditionally, these models are built upon Euclidean geometry. However, there has been a massive recent surge of interest in non-Euclidean spaces, particularly hyperbolic geometries. This interest stems from the unique exponential volume growth property of hyperbolic space, which allows it to embed trees and complex hierarchical structures with minimal distortion. Consequently, hyperbolic representations have become highly effective for modeling word hypernymy and linguistic structures in natural language processing [31, 14], capturing complex user-item interactions and implicit hierarchies in recommendation systems [8], and mapping structural connectivity in brain networks in neuroscience [2]. SVMs have been successfully adapted to these hyperbolic settings to respect this intrinsic geometry [9].

While unbounded spaces (like the hyperbolic Poincaré disk) excel at representing hierarchical data, a vast number of critical domains in modern machine learning are intrinsically constrained within bounded convex polytopes. In this paper, we study the SVM problem from the perspective of the Hilbert geometry and the closely related Funk geometry. The Hilbert metric (defined formally in Section 2) generalizes the Cayley-Klein model of hyperbolic geometry to arbitrary bounded convex sets. It boasts several desirable properties, such as straight-line geodesics and invariance under projective transformations [34]. In bounded domains, distances must be acutely sensitive to the proximity of a point to the boundary of the feasible region. The Hilbert metric naturally imposes this penalty, diverging to infinity as points approach the boundary.

The motivation for developing classification algorithms specifically tailored to bounded polytopal boundaries under the Hilbert metric is driven by several pivotal paradigms in contemporary machine learning:

  • Compositional Data and the Probability Simplex: Compositional data, such as market shares, genomic relative abundances, and topic distributions, consist of nonnegative vectors that sum to one. These vectors naturally reside within a bounded polytope known as the probability simplex. Euclidean distances are notoriously ill-suited here because they fail to capture relative variations near the boundaries (i.e., when probabilities approach 0 or 1). The Hilbert metric implicitly respects these compositional constraints and boundary sensitivities, serving as a powerful intrinsic geometry for clustering and classification in the simplex [32, 33].

  • Optimal Transport and the Birkhoff Polytope: In optimal transport, matching, and assignment problems, the set of feasible transport plans (doubly stochastic matrices) forms a bounded convex domain known as the Birkhoff polytope [29]. Solving machine learning problems over permutations or transport plans frequently requires navigating this highly structured polytope [38, 6]. An SVM formulated in the Hilbert metric provides a theoretically sound mechanism for large-margin classification of transport matrices by explicitly respecting the linear constraints that define the Birkhoff polytope.

  • Deep Learning on Symmetric Spaces and Siegel Networks: There is a growing interest in representation learning on symmetric spaces, such as the bounded Siegel disk or the cone of symmetric positive-definite matrices. These spaces are foundational in advanced architectures such as Siegel networks and are crucial for applications in quantum information theory, medical imaging, and deep learning [36, 21, 27, 24]. The Hilbert metric naturally models the intrinsic geometry of these bounded domains, particularly when they are approximated by high-dimensional bounding facets.

  • Combinatorial Reasoning and Tropical Geometry: Recent advances at the intersection of machine learning and combinatorial optimization utilize tropical geometry to map discrete algorithms into continuous, piecewise-linear, polyhedral structures. In tropical geometry, feasible solutions and decision boundaries trace the faces of polyhedral complexes [18, 43]. Classifying or routing information within these spaces requires a metric that aligns with polyhedral boundaries. A Hilbert SVM provides an exact, geometrically grounded decision boundary for neural algorithmic reasoning over such combinatorial domains.

1.1 Related Work

In the Euclidean metric, SVMs are typically solved by formulating them as convex optimization problems, specifically quadratic programming, which efficiently maximizes the margin between classes [3, 7]. This formulation frequently exploits Lagrangian duality, allowing the problem to be expressed purely in terms of inner products, which can then be elegantly generalized via the kernel trick [19]. However, generalizing this dual formulation to non-Euclidean spaces, such as hyperbolic or Hilbert geometries, is highly non-trivial. Substituting the Euclidean inner product or distance with a non-Euclidean metric generally destroys the positive semi-definiteness of the kernel or the convexity of the objective function. Consequently, the standard trick of solving the dual problem yields a nonconvex optimization problem when applied naively to these geometries.

Because of this inherent non-convexity, previous attempts to formulate SVMs and linear classifiers in hyperbolic spaces have faced significant computational hurdles. Cho et al. [9] were among the first to consider large-margin classification in hyperbolic space. While they demonstrated that their approach significantly outperforms Euclidean classifiers on hierarchical benchmarks by respecting the data’s intrinsic geometry, their method directly optimized a non-convex margin objective using Riemannian gradient descent. Without careful initialization, such approaches are highly susceptible to local minima and provide neither a guarantee of a global optimum nor a worst-case polynomial running time. Other continuous optimization techniques for representation learning in hyperbolic spaces similarly rely on iterative local methods lacking rigorous theoretical convergence guarantees [15, 35]. Furthermore, as highlighted by Mishne et al. [30], training hyperbolic learning models via Riemannian optimization frequently suffers from severe numerical instability and convergence issues, leading to catastrophic floating-point failures. By formulating our Hilbert SVM as a series of exact LPs, our approach completely obviates these Riemannian convergence and numerical stability bottlenecks.

Another potential avenue for solving SVMs in the Hilbert metric is to exploit isometric embeddings. Extending results of de la Harpe [12], Vernicos [42] presented an elegant isometry mapping the polytopal Hilbert geometry into a finite-dimensional normed vector space. While one might be tempted to map the input points into this embedding space to solve a standard SVM, this approach is fundamentally flawed for linear classification. Because the mapping is highly non-linear, a simple linear classifier (a hyperplane) computed in the embedding space does not translate back to a linear hyperplane in the original input space. Furthermore, computing the complex intersection of the resulting decision boundary with the polytope’s feasible image is analytically and computationally impractical.

Recently, Acharya et al. [1] addressed the exact polytopal SVM problem in the Hilbert metric without relying on non-convex optimization or non-linear embeddings. They showed that the Hilbert SVM could be modeled precisely as an LP-type problem. While their algorithmic framework achieves a running time linear in the number of training points, its complexity grows polynomially with the total number of vertices of the polytope defining the metric balls. Unfortunately, the vertex complexity of a polytope defined by m facets generally grows exponentially with the dimension d. As such, their method suffers from the curse of dimensionality and remains unsuitable for high-dimensional spaces, where the vast majority of machine learning applications lie.

1.2 Our Contributions

In this paper, we explore an alternative algebraic viewpoint of Hilbert geometry to develop an efficient, globally approximate algorithm for the Hilbert SVM problem. The defining feature of our approach is that the running time scales only polynomially with the dimension of the space, successfully circumventing the exponential bottleneck that plagues prior vertex-based methods while avoiding the local-minima pitfalls of Riemannian optimization.

Rather than relying on non-convex gradient descent or explicit vertex enumeration, our algorithm leverages Birkhoff’s formulation of the Hilbert metric to reduce the maximum-margin problem to a sequence of linear programming (LP) feasibility tests. Because we rely on numerical LP solvers, we assume the input coordinates and bounding hyperplane coefficients are represented as bounded B-bit rational numbers, and we compute the maximum margin to within a user-supplied additive approximation error ε.

The following theorem formalizes our main result:

Theorem 1.

Consider a polytope Ω in d defined by m hyperplanes, and two linearly separable point sets P+ and P of total size n contained within Ω’s interior. Assume further that all of the defining coordinates and coefficients are representable as B-bit rational numbers. Then there exists an algorithm running in time O(poly(n,m,d,B,log(1/ε)) that computes a separating hyperplane whose margin in the Hilbert metric defined by Ω is within an additive error ε of the optimum.

This polynomial dependence on the ambient dimension d is a crucial advancement for modern machine learning applications. Furthermore, our framework is highly extensible:

Asymmetric Metrics:

We generalize our LP-feasibility results to the closely related asymmetric Funk geometry, which is useful for directed spaces and specific optimal transport problems (Section 2.1).

Soft-Margin Classification:

To handle real-world datasets that contain noise or are not perfectly linearly separable, we provide a robust soft-margin formulation for the Hilbert SVM that scales penalties based on boundary proximity (Section 4.1).

Nearest-Neighbor Classifiers:

While isometric embeddings fail for hyperplane SVMs, we leverage Vernicos’s mapping to design an efficient approximate nearest-neighbor-based classifier for non-linear decision boundaries (Section 4.2).

2 Mathematical Preliminaries

In this section, we provide a number of definitions and facts, which will be used throughout. We will use different fonts, specifically p and 𝐩, to distinguish between a point pd and its associated d-dimensional column vector 𝐩. We represent a (d1)-dimensional flat, that is a hyperplane, L in d as a pair (𝐰,c)d× represented by the function fL(x)=𝐰𝐱+c. A hyperplane partitions space into three sets, L, L, L+, where a point 𝐱d belongs to each of these sets depending on whether fL(x) is <0, =0, or >0, respectively.

Given a set of m hyperplanes, ={Li:(𝐰i,ci)}i=1m let Ω=Ω() denote the closure of the space bounded by the positive half-spaces Li+, that is, Ω=cl(i=1mLi+). Let Ω denote the boundary of Ω. Throughout, we assume that Ω is bounded and full-dimensional. Given a nonnegative integer m, let [m] denote the index set {1,,m}.

Given two points p,qint(Ω), let pq¯ denote the chord of Ω passing through these points, that is, the intersection of Ω with the line through p and q. Let pq denote the line that passes through them, and pq denote the ray starting from p and passing through q.

Given p,qd, let d(p,q) denote their Euclidean distance. Given a hyperplane L, let d(p,L) denote the minimum Euclidean (perpendicular) distance from p to L.

2.1 Hilbert Geometry

In this section, we introduce the Funk and Hilbert distances. Given a convex body Ω and any two points p,qint(Ω), let p and q denote the endpoints of the chord pq¯ ordered as p,p,q,q (see Figure 1). If p=q all the distances are defined to be zero. Otherwise, the Funk and Hilbert distances are defined as:

Funk:dΩF(p,q) := lnpqqq (1)
Reverse Funk:dΩrF(p,q) := dΩF(q,p)=lnqppp (2)
Hilbert:dΩH(p,q) := dΩF(p,q)+dΩrF(p,q)2=12lnqppppqqq. (3)

Intuitively, dΩF(p,q) is a measure of how far q is from p relative to the boundary that lies beyond q, and dΩrF(p,q) is just the reverse of this. The Hilbert distance dΩH(p,q) symmetrizes these by taking their arithmetic mean.

Figure 1: The (a) forward Funk, (b) reverse Funk, (c) and Hilbert distances between p and q in Ω.

These distance functions are all nonnegative and satisfy the triangle inequality [34]. The Hilbert distance defines a metric over int(Ω). The Funk and reverse Funk are asymmetric and hence define weak metrics over int(Ω). Observe that as either point approaches the boundary of Ω, the Hilbert distance approaches . The Hilbert distance is invariant under invertible projective transformations.

2.2 Birkhoff’s Formulation and Metric Balls

Birkhoff [4] provided an alternative, equivalent definition of these metrics that is better suited to our approach.

Proposition 2 (Birkhoff’s Formulation).

Given a set of m hyperplanes, ={Li:(𝐰i,ci)}i=1m, then for any pair of points p,qint(Ω()):

dΩF(p,q) =maxi[m]logd(p,Li)d(q,Li)=maxi[m]log𝐰i𝐩+ci𝐰i𝐪+ci
dΩrF(p,q) =maxi[m]logd(q,Li)d(p,Li)=maxi[m]log𝐰i𝐪+ci𝐰i𝐩+ci
dΩH(p,q) =12maxj,k[m]logd(p,Lj)d(q,Lj)d(q,Lk)d(p,Lk)=12maxj,k[m]log(𝐰j𝐩+cj𝐰j𝐪+cj𝐰k𝐪+ck𝐰k𝐩+ck).

This follows from the fact that Ω is convex, and observing that if pq intersects Ω in q, on the bounding hyperplane Lk, then by similar triangles

d(p,q)d(q,q)=d(p,Li)d(q,Li).

Intuitively, this provides a way to define the metrics without explicitly calculating where the line pq intersects Ω. One consequence of the proposition is that the metrics can be reduced to a sup norm over t for some finite dimension t, using a non-linear mapping function [28]. Another useful consequence is its application to constructing metric balls in high dimensions.

Letting dΩ denote any of the above metrics and given a point pint(Ω) and scalar r0, the associated metric balls are defined in the standard way.

BΩ(p,r):={qΩ:dΩ(p,q)r}.

It is well known that the Funk ball about a point p is a scaling of Ω about p by an appropriate factor that depends on the radius. This can be derived directly from Proposition 2:

BΩF(p,r) ={qΩ:dΩF(p,q)r}
={qΩ:maxi[m]log𝐰i𝐩+ci𝐰i𝐪+cir}
={qΩ:log𝐰i𝐩+ci𝐰i𝐪+cir,i[m]}
={qΩ: 0𝐰i𝐪+cier(𝐰i𝐩+ci),i[m]}
=i[m]{qΩ: 0𝐰i𝐪+cier(𝐰i𝐩+ci)}. (4)

Fixing p and r, let ci:=cier(𝐰i𝐩+ci), and let SiF be the hyperplane represented by (𝐰i,ci) (See Figure 2(a)). Observe that SiF is parallel to Li. We have the following:

Lemma 3 (Funk Balls).

Given a set of m hyperplanes, as in Proposition 2, the Funk ball BΩ()F(p,r) is a polytope bounded by the m hyperplanes, SiF:(𝐰i,ci), for i[m].

Figure 2: Defining balls and their bounding hyperplanes for (a) Funk, (b) Reverse Funk, and (c) Hilbert.

A similar result can be proved for reverse-Funk balls (see Figure 2(b)). We next use Proposition 2 to demonstrate the Hilbert balls are convex polytopes, but the number of bounding facets is larger by the square. Following the same reasoning as in Eq. (4), we have

BΩH(p,r) ={qΩ:dΩH(p,q)r}
={qΩ:12maxj,k[m]log(𝐰j𝐩+cj𝐰j𝐪+cj𝐰k𝐪+ck𝐰k𝐩+ck)r}
=j,k[m]{qΩ:(𝐰j𝐩+cj)(𝐰k𝐪+ck)e2r(𝐰k𝐩+ck)(𝐰j𝐪+cj)}.

Fixing p and r, let αj,k:=e2r(𝐰k𝐩+ck) and αj,k:=(𝐰j𝐩+cj). We have

BΩH(p,r)=j,k[m]{qΩ: 0(αj,k𝐰jαj,k𝐰k)𝐪+(αj,kcjαj,kck)}. (5)

Let 𝐰j,k=(αj,k𝐰jαj,k𝐰k), and cj,k=(αj,kcjαj,kck). Let Sj,kH be the hyperplane represented by (𝐰j,k,cj,k). Observe that Sj,kH is a linear combination of Lj, and Lk, and therefore Sj,kH passes through the intersection of Lj and Lk (see Figure 2(c)). In summary, we have the following:

Lemma 4 (Hilbert Balls).

Given a set of m hyperplanes, as in Proposition 2, the Hilbert ball BΩ()H(p,r) is a polytope bounded by the at most m(m1) hyperplanes Sj,kH, for j,k[m].

3 Hilbert SVM

In this section, we present our solution to the SVM problem in the Hilbert geometry. Recall that our objective is to compute a maximum-margin hyperplane (with respect to the Hilbert distance) that separates two point sets P+ and P of total size n.

We are given an index set I={1,,n}, and a partition of I into I+, and I, that is I+I=I, I+I=, along with the associated d-dimensional point sets: P±={pi:iI}, P+={pi:iI+}, P={pi:iI}. Throughout this section, we assume P+ and P are linearly separable, that is, there is a hyperplane K such that P+K+, and PK. (In Section 4.1, we will consider the general case.)

Define the Hilbert distance of a point pΩ to a hyperplane L to be dΩH(L,p)=minxLdΩH(x,p). We define the margin of P+ and P with respect to a separating L as minpP±dΩH(L,p), the minimum distance of any point to L. Finding the maximum margin of any separating hyperplane can be expressed formally as

max{γ:Ksuch thatP+K+,PK,anddΩH(K,p)γ,pP±}. (6)

Our algorithm will yield an absolute approximation to the optimal solution. In particular, given an approximation parameter ε>0, our algorithm will produce a separating hyperplane that achieves a margin of at least γε, where γ is the optimal margin.

Assuming K is represented by the pair (𝐰,c), this can be expressed equivalently as the following optimization problem:

maximize: γ
subject to: 𝐰𝐩+c> 0,pP+
𝐰𝐩+c< 0,pP
dΩH(K,p)γ,pP±,K:(𝐰,c). (7)

It is not immediately straightforward as to how to solve Opt (3). One difficulty lies in finding a reasonable representation for dΩH(K,p), the Hilbert distance of a point to a hyperplane. This was done in an earlier work on the SVM in the polytopal Hilbert geometries [1], but the size of the representation given there depended on the number of vertices in the Hilbert ball, which grows exponentially with the dimension. Other ways of formulating the SVM problem in hyperbolic spaces usually mirror that in the Euclidean setting, framing it as a non-convex optimization problem, with no theoretical guarantees on the runtime [9]. However, by exploiting the geometry of the polytopal Hilbert metric and using the alternative viewpoints of the metrics as presented in Proposition 2, we can significantly improve upon prior attempts.

3.1 Overall Algorithm

We assume every input parameter is given to us as a rational number, expressed as a fraction of two nonzero B-bit integers. We call this representation a B-bit rational number. Each of the n points pP± is represented as a d-vector 𝐩 whose coordinates are B-bit rational numbers. The domain Ω is defined by a set of m hyperplanes, each of whose (𝐰,c) representation is given as a sequence of d+1 B-bit rational numbers. We say that the resulting SVM problem instance has size parameters (d,n,m,B). The total bit complexity of such an instance is O(d(n+m)B).

Before describing the overall algorithm, we first establish an upper bound on γ, the maximum margin in terms of the bit size of the input. Let K be the corresponding separating hyperplane for which γ is achieved. Observe that for an arbitrary p+P+, and pP, we have dΩH(p,p+)dΩH(p,K)+dΩH(p+,K)2γ. Now let the line joining p and p+ intersect Ω in bounding hyperplanes L:(𝐰,c), and L+:(𝐰+,c+). Therefore,

dΩH(p,p+)=12logd(p+,L)d(p,L+)d(p+,L+)d(p,L)=12log(𝐰𝐩++c)(𝐰+𝐩+c+)(𝐰𝐩+c)(𝐰+𝐩++c+).

Consider any one of the terms in the numerator, say, (𝐰𝐩++c). Now, 𝐰, and p+ are given by d B-bit rational numbers, therefore their inner product can have an absolute value of at most d22B. Hence, the entire term 𝐰𝐩++c has an absolute value at most d22B+2B. Recalling that the Hilbert distance is the logarithm of ratios, up to constant factors, dΩH(p,p+) is at most (8B+4logd)log2=O(B+logd), implying that γM for some MO(B+logd). Thus, we have:

Lemma 5.

Given an SVM instance with size parameters (d,n,m,B), the separation margin γ for any hyperplane is at most M(d,n,m,B)=O(B+logd).

Our overall algorithm is as follows. Since we are interested in the optimum margin up to an accuracy of ε, we check if P+ and P are separable with a margin of at least r, where r is an element from the range: Γ=[ε,2ε,3ε,,M], where M=M(d,n,m,B). To check separation for a particular value r, we will conduct an (approximate) LP-based feasibility test. We employ this test as part of a parametric binary search over the range Γ. This implies that we only need to solve O(logB+loglogd+log(1/ε)) many feasibility tests. We next describe this LP-based subroutine.

3.2 LP-feasibility

We consider the problem of determining whether it is possible to achieve a given margin γ, up to an additive error of ε. For a particular margin r, recall that BΩH(p,r) is the Hilbert ball of radius r centered at p. By Lemma 4, BΩH(p,r) is a polytope bounded by m(m1) hyperplanes. (In Section 3.3, we will show how to construct them efficiently.) Let (r)+={BΩH(p+,r)p+P+}, the collection of the Hilbert balls of radius r around the positively labeled points, and define (r) analogously for P.

The feasibility of γ reduces to determining whether the collections of balls (r)+ and (r) are linearly separable. For i[n], let 𝐀(r,i) be an m(m1)×d matrix and let 𝐛(r,i) be an m(m1)×1 vector such that

𝐱BΩH(pi,r)𝐀(r,i)𝐱+𝐛(r,i)0.

We can construct 𝐀(r,i) and 𝐛(r,i) from the hyperplanes Sj,kH:(𝐰j,k,cj,k) described in Lemma 4. In particular, for t[m(m1)], if (𝐰t,ct) denotes the t-th bounding hyperplane of BΩH(pi,r), then 𝐰t is the t-th row of 𝐀(r,i) and ct is the t-th element of 𝐛(r,i).

Therefore, finding whether (r)+ and (r) are linearly separable is equivalent to the following decision problem:

K:(𝐰,c),such that
piP+,𝐰𝐱+c0,𝐱:𝐀(r,i)𝐱+𝐛(r,i)0, (8)
piP,𝐰𝐱+c0,𝐱:𝐀(r,i)𝐱+𝐛(r,i)0. (9)

For fixed r and i, let 𝐀=𝐀(r,i) and 𝐛=𝐛(r,i). Eq. (8) can be rewritten as:

min{𝐱:𝐀𝐱+𝐛0}𝐰𝐱+c 0.

By standard LP duality (see, e.g., [16, pp. 81–84]), we have

min{𝐱:𝐀𝐱+𝐛0}𝐰𝐱=max{𝐲:𝐀𝐲=𝐰,𝐲𝟎}𝐛𝐲.

Therefore we can simplify Eq. (8) as follows:

𝐰𝐱+c 0,𝐱:𝐀𝐱+𝐛0
(min{𝐱:𝐀𝐱+𝐛0}𝐰𝐱+c) 0
(max{𝐲:𝐀𝐲=𝐰,𝐲𝟎}𝐛𝐲+c) 0
𝐲(i):𝐀(r,i)𝐲(i)=𝐰,𝐲(i)𝟎,𝐛(r,i)𝐲(i)c.

Analogously, Eq. (9) can be simplified to

𝐲(i):𝐀(r,i)𝐲(i)=𝐰,𝐲(i)𝟎,𝐛(r,i)𝐲(i)c.

Hence, to determine whether the collections (r)+ and (r) are linearly separable we solve the following LP-feasibility problem in the parameters 𝐰d×1, c, and 𝐲(i)m(m1)×1, for i[n].

Minimize: 0
Subject to: 𝐛(r,i)𝐲(i) c,iI+
𝐛(r,i)𝐲(i) c,iI
𝐀(r,i)𝐲(i) =𝐰,iI
𝐲(i) 0,iI
𝟏𝐰 = 1. (10)

We add the final constraint to avoid the trivial solution in which all the parameters are zero.

 Remark 6 (Intuitive Description).

Opt. (10) can be understood intuitively by observing the following. (r)+ and (r) being linearly separable implies there exists a hyperplane K:(𝐰,c), such that for every B+(r)+, there is a hyperplane KB+ that is parallel to and above K, and is tangent to some ball in B+. Similarly, for every B(r), there is a hyperplane KB that is parallel to and below K, and is tangent to some ball in B (see Figure 3).

Figure 3: Intuitive description of the dual: K separates (r)+ and (r). KB is a conical combination of S1 and S2 while lying strictly above K.

A hyperplane L that is tangent to a polytope Ω, with bounding hyperplanes L1,,Lm, can be written as a positive linear combination (often referred to as the conical combination) of the bounding hyperplanes.

The vector 𝐲(i) in Opt. (10) corresponds to the factors for this conical combination. The third constraint in Opt. (10) guarantees a hyperplane KB parallel to K, along with being a conical combination of the supporting hyperplanes for each B(r)+(r). The first two constraints ensure KB is above or below K, depending on whether B(r)+ or (r).

 Remark 7 (LP for Funk).

The LP feasibility formulation for the Funk metric is similar to Opt. (10). We briefly mention the required modifications. By the construction given in Lemma 3, for i[n], let 𝐀(r,i) be an m×d matrix and let 𝐛(r,i) be an m×1 vector such that

𝐱BΩF(pi,r)𝐀(r,i)𝐱+𝐛(r,i)0.

For this case, 𝐲(i) will be an m×1 vector. The remainder of the analysis and formulation is exactly the same as in the case of the Hilbert metric.

3.3 Constructing Hilbert Balls

In this section, we present a procedure for constructing the bounding hyperplanes for a Hilbert ball, BΩH(pi,r). Recall that ={Li}i=1m denotes the set of hyperplanes bounding Ω. First, we take two bounding hyperplanes of Ω: Lj:(𝐰j,cj) and Lk:(𝐰k,ck), jk, j,k[m]. For piP±, we find S(i,r)j,k:(𝐮(i,r)(j,k),t(i,r)j,k), the hyperplane at a Hilbert-distance of r from pi with respect to the boundary defined by Lj and Lk, such that there exists a line that intersects Lj, S(i,r)j,k, pi, and Lk in that order (see Figure 4).

Figure 4: Constructing BΩH(pi,r).

It is clear that α:0α1, such that

S(i,r)j,k=αLj(1α)Lk. (11)

For any point s on S(i,r)j,k, sLj+Lk+, it is easy to see that

d(s,Lk)d(s,Lj)=α1α.

Solving for α using the following:

exp(2dΩH(pi,S(i,r)j,k))=𝐰j𝐩i+cj𝐰k𝐩i+ckα1α=exp(2r). (12)

For piint(Ω), r is finite and positive: 0<r<. Therefore, Eq. (12) can be equivalently written as a linear equation in α. Since for j,k[m], jk, i[n], S(i,r)j,k is a bounding hyperplane for BΩH(pi,r), we can use Eqs. (11), and (12) to construct BΩH(pi,r), for all piP± in O(ndm2) time.

 Remark 8 (Funk Balls).

We can use a similar approach to construct BΩF(pi,r), the Funk ball of radius r around pi. Recall that the Funk ball around pi is a scaled copy of Ω around pi. Therefore for a bounding hyperplane of Ω, Lj:(𝐰j,cj), j[m], we have S(i,r)j=(𝐰j,cj(i,r)) as a bounding hyperplane of BΩF(pi,r) for some constant cj(i,r). We solve for cj(i,r) using the following equation:

exp(dΩF(pi,S(i,r)j))=𝐰j𝐩i+cj𝐰j𝐩i+cj(i,r)=exp(r). (13)

As before, for any r0, this can be expressed as a linear function in c(i,r). Therefore, we can construct BΩF(pi,r), for all piP± in O(nmd) time.

3.4 Complexity Analysis

Recall that to obtain γ within an additive error of ε, we solve O(logB+loglogd+log(1/ε)) LPs of the form Opt. (10). We can use any standard interior-point method, such as Khachiyan’s Ellipsoid method [25] or Karmarkar’s method [23] to solve Opt. (10) in time that is polynomial in the number of variables, number of inequalities, and bit-length of each variable. We first establish the bit-length required to encode a parameter in our LP-feasibility problem (Opt. (10)).

Recall that we are searching for r over the range Γ=[ε,2ε,,M], with M=M(d,n,m,B)=O(B+logd). Therefore, the quantity e2r can take on values in the range Γe=[e2ε,e4ε,,e2M]. Instead of fixing r’s value exactly over Γ, it is sufficient for our purposes if we search for r over [r1,r2,,rM/ε], where (i1)εri<iε.

The minimum difference between two elements in Γe is at least e4εe2ε>ε. (This can be verified using Taylor’s series for ex, at x=0.) Therefore, to represent Γe, it is sufficient for our purposes to find a bit-representation which allows for a maximum value e2M up to a resolution of ε. This can be done by using O(M) bits for the integer part, and O(log(1/ε)) bits for the fractional part. Hence, it is sufficient to represent the elements of Γe as O(M+log(1/ε))=O(B+logd+log(1/ε))-bit rational numbers.

Using Eq. (12), we solve for and represent α, using O(B+logd+log(1/ε))-bit rational numbers. Therefore, using Eq. (11) every parameter of S(i,r)j,k, which acts as a bounding hyperplane for BΩH(pi,r), can also be represented using O(B+logd+log(1/ε))-bit rational numbers.

Now, the number of variables in Opt. (10) is O((n+d)m2), with the number of inequalities being O(n(m2+d)). Hence, we can determine if Opt. (10) is feasible in O(poly(n,m,d)(B+logd+log(1/ε)) time, for a fixed r. And since we solve O(logB+loglogd+log(1/ε)) such LPs, our overall running time is O(poly(n,m,d,B,log(1/ε)). This proves our main result in Theorem 1. Recall that the input bit-length is d(n+m)B, implying the overall running time is also polynomial in the input bit-length and the log of the desired accuracy.

4 Extensions

In this section, we will explore two extensions to binary classification and SVM problem in the Hilbert geometry. The first is a soft-margin classifier, which is applicable when the point sets are not linearly separable, and the second is a binary classifier based on nearest neighbors.

4.1 A Soft-Margin Classifier

Up to this point, we assumed P+ and P are linearly separable. If they are not, a common approach is to use a hyperplane classifier with appropriate penalties for misclassifying points in the training set. In this section, we propose a formulation for such a “soft” classifier.

We modify our LP-feasibility problem: Opt (10) to introduce penalties in the form of slack variables. Reiterating the observation from Remark 6, we note that the first two constraints of Opt (10) enforce the condition that, for pP+, BΩH(p,r) is completely above the separator K:(𝐰,c). Instead, we only require that BΩH(p,r) is above K:(𝐰,c+ξ) for some positive ξ. Here ξ works as a penalty for the improper separation of BΩH(p,r). We similarly set individual penalties for each point.

Next, we want the following desirable property: points that are closer to the boundary of Ω should pay a heavier penalty for being misclassified. It is because for a fixed point q, dΩH(pi,q) scales inversely with pi’s distance to the boundary. Therefore, we scale the penalty associated with pi by ωi, defined as the inverse of its distance to the boundary:

ωi=(minj[m]dΩH(Lj,pi))1.

Finally, we propose the following LP in the parameters 𝐰, c, and ξi, 𝐲(i), for i[n], to minimize the overall weighted penalty for a fixed Hilbert radius r:

Minimize: Ξr=i[n]ωiξi
Subject to: 𝐛(r,i)𝐲(i) c+ξi,iI+
𝐛(r,i)𝐲(i) cξi,iI
𝐀(r,i)𝐲(i) =𝐰,iI
𝐲(i) 0,iI
𝟏𝐰 = 1
ξi 0,iI. (14)

Let the optimum value derived from Opt. (14) be Ξr, and the corresponding separating hyperplane, Kr=(𝐰,c). Recall that r attains values over Γr=[r1,r2,,rM/ε], where ri’s are any values satisfying (i1)εri<iε, and M=O(B+logd). To find an appropriate classifier K, we take

K=Ks,wheres=argmaxi[M/ε](riCΞrin).

Note that C is a user-defined constant, a weight associated with improper separation. A higher value would favor proper separation, while a lower value would favor a larger margin.

A slight drawback of this approach is that it no longer suffices to perform a binary search on the range Γr. Rather, we need to perform a grid search, i.e. solve Opt. (14) for every value of rΓr in the worst case. This implies the overall running time for the soft-margin classifier is O(poly(n,m,d,B,1/ε)).

4.2 A Nearest Neighbor-based Classifier

In this section, we consider an alternative approach to binary classification in the Hilbert geometry. Rather than using a separating hyperplane, we select two sites q+ and q, and classify a point p according to which of these two sites it is closer to. In the Euclidean setting, the bisector between two points is a hyperplane, and this is no different from SVM. However, in Hilbert, bisectors are generally not hyperplanes. (An analysis of the structure of Hilbert bisectors in the 2-dimensional case was presented in [17], where it was shown that they are piecewise conics.)

As before, we assume that Hilbert geometry is defined with respect to a polytope Ω in d defined by m bounding hyperplanes ={Li}i=1m. Extending results of de la Harpe [12], Vernicos presented an elegant isometry from the polytopal Hilbert geometry (Ω,dΩH) to a finite-dimensional normed vector space [42]. In particular, he presented an isometric mapping fΩ:(Ω,dΩH)(m1,||||Σ2m), where ||||Σ2m is a norm defined by a regular polytope Σ bounded by 2m facets in m1. In other words, the embedding space is m1 with Σ2m as the unit ball.

Although one might be tempted to solve the SVM problem in the embedding space, the result would be far from ideal. Since fΩ is nonlinear, a linear classifier K^ in the embedding space would not translate to a simple classifier in the input space. Moreover, since fΩ is not a bijection it is not clear how complex the intersection of K^ with the image of Ω, fΩ(Ω), would be.

Instead, we propose a simple nearest neighbor-based classifier in the embedding space. Given Ω, let qi, Q+, and Q denote the images of pi, P+, and P under the embedding fΩ. (qi for all i[n] can be computed in O(m2) time by solving m linear equations). We find two representative centers c+, and c, for Q+, and Q respectively such that the following is maximized:

β=maxc+,cm1(minq+Q+minqQ𝐪+𝐪Σ𝐪+𝐜+Σ,minqQminq+Q+𝐪𝐪+Σ𝐪𝐜Σ). (15)

Stated differently, β is the value such that any point q is at least β times away from its nearest neighbor in the opposite class, as from its representative. This implies that the points can be correctly classified using an approximate nearest-neighbor algorithm with approximation factor at most β.

This can be rewritten as an optimization problem over the variables 𝐜+, 𝐜, and 1/β

Minimize: 1β
Subject to: 𝐪+𝐜+Σ1β𝐪+𝐪Σ, q+Q+,qQ
𝐪𝐜Σ1β𝐪𝐪+Σ, q+Q+,qQ. (16)

We note that 𝐪+𝐪Σ in the above optimization is a pre-determined constant. If we let W={𝐰1,𝐰2,,𝐰2m} denote the directions determining the norm polytope Σ, then the condition that 𝐱Σt can be expressed as a set of linear inequalities: 𝐰i𝐱t, for i[2m]. Therefore, Opt. (4.2) is an LP in O(m) variables, and O(nm) inequalities.

References

  • [1] Aditya Acharya, Auguste H. Gezalyan, Julian Vanecek, David M. Mount, and Sunil Arya. Support vector machines in the hilbert geometry. In 19th International Symposium on Algorithms and Data Structures, WADS 2025, pages 3:1–3:20, 2025. doi:10.4230/LIPIcs.WADS.2025.3.
  • [2] Antoine Allard and M. Ángeles Serrano. Navigable maps of structural brain networks across species. PLOS Computational Biology, 16:1–20, 2020. doi:10.1371/journal.pcbi.1007584.
  • [3] Kristin P. Bennett and Colin Campbell. Support vector machines: Hype or hallelujah? SIGKDD Explor. Newsl., 2, 2000. doi:10.1145/380995.380999.
  • [4] Garrett Birkhoff. Extensions of Jentzsch’s theorem. Trans. Amer. Math. Society, 85:219–227, 1957.
  • [5] Christopher M. Bishop. Pattern Recognition and Machine Learning. Springer, 2016. doi:10.1007/978-0-387-45528-0.
  • [6] Mathieu Blondel, André F. T. Martins, and Vlad Niculae. Learning with Fenchel-Young losses. J. Mach. Learn. Research, 21:1–69, 2020. URL: http://jmlr.org/papers/v21/19-021.html.
  • [7] Christopher J. C. Burges. A tutorial on support vector machines for pattern recognition. Data Min. Knowl. Discov., 2(2):121–167, 1998. doi:10.1023/A:1009715923555.
  • [8] Ines Chami, Zhitao Ying, Christopher Ré, and Jure Leskovec. Hyperbolic graph convolutional neural networks. In Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 4869–4880, 2019. doi:10.48550/arXiv.1910.12933.
  • [9] H. Cho, B. DeMeo, J. Peng, and B. Berger. Large-margin classification in hyperbolic space. In Proc. 22nd Internat. Conf. Artif. Intell. and Stat., pages 1832–1840. PMLR, 2019. doi:10.48550/arXiv.1806.00437.
  • [10] C. Cortes and V. Vapnik. Support-vector networks. Mach. Learn., 20:273–297, 1995. doi:10.1007/BF00994018.
  • [11] Nello Cristianini and John Shawe-Taylor. An Introduction to Support Vector Machines and Other Kernel-based Learning Methods. Cambridge University Press, 2000. doi:10.1017/CBO9780511801389.
  • [12] P. de la Harpe. On Hilbert’s metric for simplices. In G. A. Niblo and M. A. Roller, editors, Geometric Group Theory, pages 97–119. Cambridge University Press, 1993. doi:10.1017/CBO9780511661860.009.
  • [13] D. DeCoste and B. Schölkopf. Training invariant support vector machines. Mach. Learn., 46:161–190, 2002. doi:10.1023/A:1012454411458.
  • [14] B. Dhingra, C. Shallue, M. Norouzi, A. Dai, and G. Dahl. Embedding text in hyperbolic spaces. In Proc. Twelfth Workshop Graph-Based Methods for Nat. Lang. Proc. (TextGraphs-12), pages 59–69, 2018. doi:10.48550/arXiv.1806.04313.
  • [15] Octavian-Eugen Ganea, Gary Bécigneul, and Thomas Hofmann. Hyperbolic neural networks. In Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pages 5350–5360, 2018. doi:10.48550/arXiv.1805.09112.
  • [16] Bernd Gärtner and Jirí Matousek. Understanding and using linear programming. Universitext. Springer, 2007. doi:10.1007/978-3-540-30717-4.
  • [17] Auguste H. Gezalyan and David M. Mount. Voronoi diagrams in the hilbert metric. In 39th International Symposium on Computational Geometry, SoCG 2023, Dallas, Texas, USA, June 12-15, 2023, volume 258 of LIPIcs, pages 35:1–35:16. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2023. doi:10.4230/LIPIcs.SoCG.2023.35.
  • [18] B. Hashemi, K. Pasque, C. Teska, and R. Yoshida. Tropical attention: Neural algorithmic reasoning for combinatorial algorithms. In Proc. 39th Annu. Conf. Neural Inf. Process. Systems, 2025. doi:10.48550/arXiv.2505.17190.
  • [19] T. Hofmann, B. Schölkopf, and A. J. Smola. Kernel methods in machine learning. The Annals of Statistics, 36:1171–1220, 2008. doi:10.1214/009053607000000677.
  • [20] S. Huang, N. Cai, P. P. Pacheco, S. Narrandes, Y. Wang, and W. Xu. Applications of support vector machine (SVM) learning in cancer genomics. Cancer Genomics & Proteomics, 15:41–51, 2018. doi:10.21873/cgp.20063.
  • [21] M. Ito, Y. Seo, T. Yamazaki, and M. Yanagida. Geometric properties of positive definite matrices cone with respect to the Thompson metric. Linear Algebra Appl., 435:2054–2064, 2011. doi:10.1016/j.laa.2011.03.063.
  • [22] Thorsten Joachims. Learning to classify text using support vector machines - methods, theory and algorithms, volume 668 of The Kluwer international series in engineering and computer science. Kluwer, 2002. doi:10.1007/978-1-4615-0907-3.
  • [23] N. Karmarkar. A new polynomial-time algorithm for linear programming. Combinatorica, 4:373–395, 1984. doi:10.1007/BF02579150.
  • [24] Jacek Karwowski and Frank Nielsen. Hilbert geometry of the symmetric positive-definite bicone: Application to the geometry of the extended gaussian family. CoRR, abs/2508.14369, 2025. doi:10.48550/arXiv.2508.14369.
  • [25] L. G. Khachiyan. A polynomial algorithm in linear programming. Doklady Akademii Nauk, 244:1093–1096, 1979. URL: https://www.mathnet.ru/eng/dan42319.
  • [26] Scott Krig. Computer Vision Metrics - Textbook Edition. Springer, 2016. doi:10.1007/978-3-319-33762-3.
  • [27] Wu Lin, Valentin Duruisseaux, Melvin Leok, Frank Nielsen, Mohammad Emtiyaz Khan, and Mark Schmidt. Simplifying momentum-based positive-definite submanifold optimization with applications to deep learning. In International Conference on Machine Learning, ICML 2023, 23-29 July 2023, Honolulu, Hawaii, USA, volume 202, pages 21026–21050. PMLR, 2023. doi:10.48550/arXiv.2302.09738.
  • [28] B. C. Lins. Asymptotic behavior and Denjoy-Wolff theorems for Hilbert metric nonexpansive maps. PhD thesis, Rutgers University-Graduate School-New Brunswick, 2007.
  • [29] J. A. De Loera and E. D. Kim. Combinatorics and geometry of transportation polytopes: An update, volume 625, pages 37–76. AMS, 2013. URL: http://www.ams.org/books/conm/625/12491.
  • [30] G. Mishne, Z. Wan, Y. Wang, and S. Yang. The numerical stability of hyperbolic representation learning. In Proc. 40th Internat. Conf. Mach. Learn., pages 24925–24949, 2023. URL: https://proceedings.mlr.press/v202/mishne23a.html.
  • [31] M. Nickel and D. Kiela. Poincaré embeddings for learning hierarchical representations. Adv. Neural Inf. Proc. Syst., 30:6341–6350, 2017. doi:10.48550/arXiv.1705.08039.
  • [32] F. Nielsen and K. Sun. Clustering in Hilbert’s projective geometry: The case studies of the probability simplex and the elliptope of correlation matrices. In Frank Nielsen, editor, Geometric Structures of Information, pages 297–331. Springer Internat. Pub., 2019. doi:10.1007/978-3-030-02520-5_11.
  • [33] Frank Nielsen and Ke Sun. Non-linear embeddings in hilbert simplex geometry. In Topological, Algebraic and Geometric Learning Workshops 2023, 28 July 2023, Honolulu, HI, USA, volume 221 of Proceedings of Machine Learning Research, pages 254–266. PMLR, 2023. arXiv:2203.11434.
  • [34] A. Papadopoulos and M. Troyanov. Handbook of Hilbert geometry, volume 22 of IRMA Lectures in Mathematics and Theoretical Physics. European Mathematical Society Publishing House, 2014. doi:10.4171/147.
  • [35] W. Peng, T. Varanka, A. Mostafa, H. Shi, and G. Zhao. Hyperbolic deep neural networks: A survey. IEEE Trans. Pattern Anal. Mach. Intell., 44(12):10023–10044, 2021. doi:10.1109/TPAMI.2021.3136921.
  • [36] D. Reeb, M. J. Kastoryano, and M. M. Wolf. Hilbert’s projective metric in quantum information theory. J. Math. Physics, 52(8), 2011. doi:10.1063/1.3615729.
  • [37] Stuart Russell and Peter Norvig. Artificial Intelligence: A Modern Approach (4th Edition). Pearson, 4th edition, 2020. URL: http://aima.cs.berkeley.edu/.
  • [38] Thibault Séjourné, Jean Feydy, François-Xavier Vialard, Alain Trouvé, and Gabriel Peyré. Sinkhorn divergences for unbalanced optimal transport. CoRR, abs/1910.12958, 2019. doi:10.48550/arXiv.1910.12958.
  • [39] Ingo Steinwart and Andreas Christmann. Support Vector Machines. Information science and statistics. Springer, 2008. doi:10.1007/978-0-387-77242-4.
  • [40] Richard Szeliski. Computer Vision - Algorithms and Applications, Second Edition. Texts in Computer Science. Springer, 2022. doi:10.1007/978-3-030-34372-9.
  • [41] V. N. Vapnik and A. Y. Chervonenkis. On a class of algorithms of learning pattern recognition. Automation and Remote Control, 25(6):937–945, 1964. (In Russian). URL: http://mi.mathnet.ru/at11678.
  • [42] C. Vernicos. On the Hilbert geometry of convex polytopes. In Handbook of Hilbert geometry, volume 22 of IRMA Lectures in Mathematics and Theoretical Physics, pages 111–126. European Mathematical Society Publishing House, 2014. doi:10.48550/arXiv.1406.0733.
  • [43] Liwen Zhang, Gregory Naitzat, and Lek-Heng Lim. Tropical geometry of deep neural networks. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmässan, Stockholm, Sweden, July 10-15, 2018, volume 80, pages 5819–5827. PMLR, 2018. doi:10.48550/arXiv1805.07091.