SlowGuess/NeurIPS_2023_OCR huggingface dataset:
David Loiseaux $^{1*}$ , Luis Scoccola $^{2*}$ , Mathieu Carrière $^{1}$ , Magnus B. Botnan $^{3}$ , Steve Oudot $^{4}$
$^{1}$ DataShape, Centre Inria d'Université Côte d'Azur  $^{2}$ Mathematics, University of Oxford  $^{3}$ Mathematics, Vrije Universiteit Amsterdam  $^{4}$ GeomeriX, Inria Saclay and École polytechnique
Persistent homology (PH) provides topological descriptors for geometric data, such as weighted graphs, which are interpretable, stable to perturbations, and invariant under, e.g., relabeling. Most applications of PH focus on the one-parameter case—where the descriptors summarize the changes in topology of data as it is filtered by a single quantity of interest—and there is now a wide array of methods enabling the use of one-parameter PH descriptors in data science, which rely on the stable vectorization of these descriptors as elements of a Hilbert space. Although the multiparameter PH (MPH) of data that is filtered by several quantities of interest encodes much richer information than its one-parameter counterpart, the scarcity of stability results for MPH descriptors has so far limited the available options for the stable vectorization of MPH. In this paper, we aim to bring together the best of both worlds by showing how the interpretation of signed barcodes—a recent family of MPH descriptors—as signed measures leads to natural extensions of vectorization strategies from one parameter to multiple parameters. The resulting feature vectors are easy to define and to compute, and provably stable. While, as a proof of concept, we focus on simple choices of signed barcodes and vectorizations, we already see notable performance improvements when comparing our feature vectors to state-of-the-art topology-based methods on various types of data.
1.1 Context
Topological Data Analysis (TDA) [26] is a field of data science that provides descriptors for geometric data. These descriptors encode topological structures hidden in the data, as such they are complementary to more common descriptors. And since TDA methods usually require the sole knowledge of a metric or dissimilarity measure on the data, they are widely applicable. For these reasons, TDA has found successful applications in a wide range of domains, including, e.g., computer graphics [58], computational biology [62], or material sciences [63], to name a few.
The mathematical definition of TDA's topological descriptors relies on persistent homology, whose input is a simplicial complex (a special kind of hypergraph) filtered by an  $\mathbb{R}^n$ -valued function. The choice of simplicial complex and function is application-dependent, a common choice being the complete hypergraph on the data (or some sparse approximation) filtered by scale and/or by some density estimator. The sublevel-sets of the filter function form what is called a filtration, i.e., a family  $\{S_x\}_{x \in \mathbb{R}^n}$  of simplicial complexes with the property that  $S_x \subseteq S_{x'}$  whenever  $x \leq x' \in \mathbb{R}^n$  (where
by definition  $x \leq x' \Leftrightarrow x_i \leq x_i' \forall 1 \leq i \leq n$ . Applying standard simplicial homology [45] with coefficients in some fixed field  $\Bbbk$  to  $\{S_x\}_{x \in \mathbb{R}^n}$  yields what is called a persistence module, i.e., an  $\mathbb{R}^n$ -parametrized family of  $\Bbbk$ -vector spaces connected by  $\Bbbk$ -linear maps—formally, a functor from  $\mathbb{R}^n$  to the category  $\operatorname{vec}$  of  $\Bbbk$ -vector spaces. This module encodes algebraically the evolution of the topology through the filtration  $\{S_x\}_{x \in \mathbb{R}^n}$ , but in a way that is neither succinct nor amenable to interpretation.
Concise representations of persistence modules are well-developed in the one-parameter case where  $n = 1$ . Indeed, under mild assumptions, the modules are fully characterized by their barcode [33], which can be represented as a point measure on the extended Euclidean plane [36]. The classical interpretation of this measure is that its point masses—also referred to as bars—encode the appearance and disappearance times of the topological structures hidden in the data through the filtration. Various stability theorems [23, 29, 30, 68] ensure that this barcode representation is stable under perturbations of the input filtered simplicial complex, where barcodes are compared using optimal transport-type distances, often referred to as Wasserstein or bottleneck distances. In machine learning contexts, barcodes are turned into vectors in some Hilbert space, for which it is possible to rely on the vast literature in geometric measure and optimal transport theories. A variety of stable vectorizations of barcodes have been designed in this way—see [3] for a survey.
There are many applications of TDA where multiparameter persistence modules (that is, when  $n \geq 2$ ) are more natural than, and lead to improved performance when compared to, one-parameter persistence modules. These include, for example, noisy point cloud data [77], where one parameter accounts for the geometry of the data and another filters the data by density, and multifiltered graphs [34], where different parameters account for different filtering functions.
In the multiparameter however, the concise and stable representation of persistence modules is known to be a substantially more involved problem [19]. The main stumbling block is that, due to some fundamental algebraic reasons, there is no hope for the existence of a concise descriptor like the barcode that can completely characterize multiparameter persistence modules. This is why research in the last decade has focused on proposing and studying incomplete descriptors—see, e.g., [10] for a recent survey. Among these, the signed barcodes stand out as natural extensions of the usual one-parameter barcode [4, 11, 12, 49], being also interpretable as point measures. The catch however is that some of their points may have negative weights, so the measures are signed. As a consequence, their analysis is more delicate than that of one-parameter barcodes, and it is only very recently that their optimal transport-type stability has started to be understood [12, 55], while there currently is still no available technique for turning them into vectors in some Hilbert space.
We believe the time is ripe to promote the use of signed barcodes for feature generation in machine learning; for this we propose the following pipeline (illustrated in Fig. 1):
$$
\left\{ \begin{array}{l} \text {g e o m e t r i c} \\ \text {d a t a s e t s} \end{array} \right\} \xrightarrow {\text {f i l t r a t i o n}} \left\{ \begin{array}{l} \text {m u l t i f i l t e r e d} \\ \text {s i m p l i c a l} \\ \text {c o m p l e x e s} \end{array} \right\} \xrightarrow {\text {h o m o l o g y}} \left\{ \begin{array}{l} \text {m u l t i p a r a m e t e r} \\ \text {p e r s i s t e n c e} \\ \text {m o d u l e s} \end{array} \right\} \xrightarrow {\text {s i g n e d b a r c o d e}} \left\{ \begin{array}{l} \text {s i g n e d} \\ \text {b a r c o d e s} \end{array} \right\} \xrightarrow {\text {v e c t o r i z a t i o n}} \text {H i l b e r t}
$$
The choice of filtration being application-dependent, we will mostly follow the choices made in related work, for the sake of comparison—see also [10] for an overview of standard choices. As signed barcode descriptor, we will mainly use the Hilbert decomposition signed measure (Definition 4), and when the simplicial complex is not too large we will also consider the Euler decomposition signed measure (Definition 5). These two descriptors are arguably the simplest existing signed measure descriptors, so they will serve as a proof of concept for our pipeline. They also offer the advantage of being efficiently computable, with effective implementations already available [42, 48, 65, 71]. With these choices of signed measure descriptors, the only missing step in our pipeline is the last one—the vectorization. Here is the summary of our contributions, the details follow right after:
- We introduce two general vectorization techniques for signed barcodes (Definitions 6 and 7).
- We prove Lipschitz-continuity results (Theorems 1 to 3) that ensure the robustness of our entire feature generation pipeline.
- We illustrate the practical performance of our pipeline compared to other baselines in various supervised and unsupervised learning tasks.
Figure 1: An instance of the pipeline proposed in this article. Left to right: A filtered simplicial complex  $(S, f)$  (in this case a bi-filtered graph); the Hilbert function of its  $0th$  dimensional homology persistence module  $H_0(f): \mathbb{R}^2 \to \mathrm{vec}$  (which in this case simply counts the number of connected components); the Hilbert decomposition signed measure  $\mu_{H_0(f)}$  of the persistence module; and the convolution of the signed measure with a Gaussian kernel.
Vectorizations. Viewing signed barcodes as signed point measures enables us to rely on the literature in signed measure theory in order to adapt existing vectorization techniques for usual barcodes to the signed barcodes in a natural way. Our first vectorization (Definition 6) uses convolution with a kernel function and is an adaptation of the persistence images of [1]; see Fig. 1. Our second vectorization (Definition 7) uses the notion of slicing of measures of [59] and is an adaptation of the sliced Wasserstein kernel of [22]. Both vectorizations are easy to implement and run fast in practice; we assess the runtime of our pipeline in Appendix D. We find that our pipeline is faster than the other topological baselines by one or more orders of magnitude.
Theoretical stability guarantees. We prove that our two vectorizations are Lipschitz-continuous with respect to the Kantorovich-Rubinstein norm on signed measures and the norm of the corresponding Hilbert space (Theorems 2 and 3). Combining these results with the Lipschitz-stability of the signed barcodes themselves (Theorem 1) ensures the robustness of our entire feature generation pipeline with respect to perturbations of the filtrations.
Experimental validation. Let us emphasize that our choices of signed barcode descriptors are strictly weaker than the usual barcode in the one-parameter case. In spite of this, our experiments show that the performance of the one-parameter version of our descriptors is comparable to that of the usual barcode. We then demonstrate that this good behavior generalizes to the multiparameter case, where it is in fact amplified since our pipeline can outperform its multiparameter competitors (which rely on theoretically stronger descriptors and have been shown to perform already better than the usual one-parameter TDA pipeline) and is competitive with other, non-topological baselines, on a variety of data types (including graphs and time series). For a proof that our descriptors are indeed weaker than other previously considered descriptors, we refer the reader to Proposition 2 in Appendix A.
We give a brief overview of related vectorization methods for multiparameter persistence; we refer the reader to Appendix B for more details.
The multiparameter persistence kernel [32] and multiparameter persistence landscape [76] restrict the multiparameter persistence module to certain families of one-parameter lines and leverage some of the available vectorizations for one-parameter barcodes. The generalized rank invariant landscape [79] computes the generalized rank invariant over a prescribed collection of intervals (called worms) then, instead of decomposing the invariant as we do, it stabilizes it using ideas comings from persistence landscapes [13]. The multiparameter persistence image [20] decomposes the multiparameter persistence module into interval summands and vectorizes these summands individually. Since this process is known to be unstable, there is no guarantee on the stability of the corresponding vectorization. The Euler characteristic surfaces [6] and the methods of [42] do not work at the level of persistence modules but rather at the level of filtered simplicial complexes, and are based on the computation of the Euler characteristic of the filtration at each index in the multifiltration. These methods are very efficient when the filtered simplicial complexes are small, but
can be prohibitively computationally expensive for high-dimensional simplicial complexes, such as Vietoris-Rips complexes (Example 2).
In this section, we recall the basics on multiparameter persistent homology and signed measures. We let  $\mathrm{vec}$  denote the collection of finite dimensional vector spaces over a fixed field  $\mathbb{k}$ . Given  $n\geq 1\in \mathbb{N}$ , we consider  $\mathbb{R}^n$  as a poset, with  $x\leq y\in \mathbb{R}^n$  if  $x_{i}\leq y_{i}$  for all  $1\leq i\leq n$ .
Simplicial complexes. A finite simplicial complex consists of a finite set  $S_0$  together with a set  $S$  of non-empty subsets of  $S_0$  such that, if  $s \in S_0$  then  $\{s\} \in S$ , and if  $\tau_2 \in S$  and  $\emptyset \neq \tau_1 \subseteq \tau_2$ , then  $\tau_1 \in S$ . We denote such a simplicial complex by  $S$ , refer to the elements of  $S$  as the simplices of  $S$ , and refer to  $S_0$  as the underlying set of  $S$ . The dimension of a simplex  $\tau \in S$  is  $\dim(\tau) = |\tau| - 1 \in \mathbb{N}$ . In particular, the simplices of dimension 0 correspond precisely to the elements of the underlying set.
Example 1. Let  $G$  be a simple, undirected graph. Then  $G$  can be encoded as a simplicial complex  $S$  with simplices only of dimensions 0 and 1, by letting the underlying set of  $S$  be the vertex set of  $G$ , and by having a simplex of dimension 0 (resp. 1) for each vertex (resp. edge) of  $G$ .
Definition 1. A (multi)filtered simplicial complex is a pair  $(S, f)$  with  $S$  a simplicial complex and  $f: S \to \mathbb{R}^n$  a monotonic map, i.e., a function such that  $f(\tau_1) \leq f(\tau_2)$  whenever  $\tau_1 \subseteq \tau_2 \in S$ . Given a filtered simplicial complex  $(S, f: S \to \mathbb{R}^n)$  and  $x \in \mathbb{R}^n$ , we get a subcomplex  $S_x^f := \{\tau \in S: f(\tau) \leq x\} \subseteq S$ , which we refer to as the  $x$ -sublevel set of  $(S, f)$ .
Example 2. Let  $(P, d_P)$  be a finite metric space. The (Vietoris-)Rips complex of  $P$  is the filtered simplicial complex  $(S, f: S \to \mathbb{R})$ , where  $S$  is the simplicial complex with underlying set  $P$  and all non-empty subsets of  $P$  as simplices, and  $f(\{p_0, \ldots, p_n\}) = \max_{i,j} d_P(p_i, p_j)$ . Then, for example, given any  $x \in \mathbb{R}$ , the connected components of the  $x$ -sublevel set  $S_x^f$  coincide with the single-linkage clustering of  $P$  at distance scale  $x$  (see, e.g., [18]). In many applications, it is useful to also filter the Rips complex by an additional function  $d: P \to \mathbb{R}$  (such as a density estimator). The function-Rips complex of  $(P, d)$  is the filtered simplicial complex  $(S, g: S \to \mathbb{R}^2)$  with  $g(\{p_0, \ldots, p_n\}) = (f(\{p_0, \ldots, p_n\}), -\min_i d(p_i))$ . Thus, for example, the  $(t, -u)$ -sublevel set is the Rips complex at distance scale  $t$  of the subset of  $P$  of points with  $d$ -value at least  $u$ . See [17, 19, 25] for examples.
Homology. For a precise definition of homology with visual examples, see, e.g., [40]; the following will be enough for our purposes. Given  $i \in \mathbb{N}$ , the homology construction maps any finite simplicial complex  $S$  to a  $\Bbbk$ -vector space  $H_{i}(S)$  and any inclusion of simplicial complexes  $S \subseteq R$  to a  $\Bbbk$ -linear map  $H_{i}(S \subseteq R): H_{i}(S) \to H_{i}(R)$ . Homology is functorial, meaning that, given inclusions  $S \subseteq R \subseteq T$ , we have an equality  $H_{i}(R \subseteq T) \circ H_{i}(S \subseteq R) = H_{i}(S \subseteq T)$ .
Multiparameter persistence modules. An  $n$ -parameter persistence module consists of an assignment  $M: \mathbb{R}^n \to \operatorname{vec}$  together with, for every pair of comparable elements  $x \leq y \in \mathbb{R}^n$ , a linear map  $M(x \leq y): M(x) \to M(y)$ , with the property that  $M(x \leq x)$  is the identity map for all  $x \in \mathbb{R}^n$ , and that  $M(y \leq z) \circ M(x \leq y) = M(x \leq z)$  for all  $x \leq y \leq z \in \mathbb{R}^n$ .
Example 3. Let  $(S, f: S \to \mathbb{R}^n)$  be a filtered simplicial complex. Then, we have an inclusion  $S_x^f \subseteq S_y^f$  whenever  $x \leq y$ . By functoriality, given any  $i \in \mathbb{N}$ , we get an  $n$ -parameter persistence module  $H_i(f): \mathbb{R}^n \to \operatorname{vec}$  by letting  $H_i(f)(x) := H_i(S_x^f)$ .
Definition 2. Let  $M: \mathbb{R}^n \longrightarrow \mathrm{vec}$ . The Hilbert function of  $M$ , also known as the dimension vector of  $M$ , is the function  $\dim(M): \mathbb{R}^n \longrightarrow \mathbb{Z}$  given by  $\dim(M)(x) = \dim(M(x))$ .
In practice, one often deals with persistence modules defined on a finite grid of  $\mathbb{R}^n$ . These persistence modules are finitely presentable (fp), which, informally, means that they can be encoded using finitely many matrices. See Definition 8 in the appendix for a formal definition, but note that this article can be read without a precise understanding of this notion.
Signed measures. The Kantorovich-Rubinstein norm was originally defined by Kantorovich and subsequently studied in [46] in the context of measures on a metric space; see [43]. We denote by  $\mathcal{M}(\mathbb{R}^n)$  the space of finite, signed, Borel measures on  $\mathbb{R}^n$ , and by  $\mathcal{M}_0(\mathbb{R}^n) \subseteq \mathcal{M}(\mathbb{R}^n)$  the subspace of measures of total mass zero. For  $\mu \in \mathcal{M}(\mathbb{R}^n)$ , we let  $\mu = \mu^{+} - \mu^{-}$  denote its Jordan decomposition [8, p. 421], so that  $\mu^{+}$  and  $\mu^{-}$  are finite, positive measures on  $\mathbb{R}^n$ .
Definition 3. For  $p\in [1,\infty ]$  , the Kantorovich-Rubinstein norm of  $\mu \in \mathcal{M}_0(\mathbb{R}^n)$  is defined as
$$
\| \mu \| _ {p} ^ {\mathsf {K R}} = \inf  \left\{\int_ {\mathbb {R} ^ {n} \times \mathbb {R} ^ {n}} \| x - y \| _ {p} d \psi (x, y): \psi \text {i s a m e a s u r e o n} \mathbb {R} ^ {n} \times \mathbb {R} ^ {n} \text {w i t h m a r g i n a l s} \mu^ {+}, \mu^ {-} \right\}.
$$
We can then compare any two measures  $\mu, \nu \in \mathcal{M}(\mathbb{R}^n)$  of the same total mass using  $\| \mu - \nu \|_p^{\mathrm{KR}}$ .
Remark 1. Note that, if  $p \geq q$ , then  $\| -\|_p^{\mathsf{KR}} \leq \| -\|_q^{\mathsf{KR}}$ . For  $n = 1$ , the definition of  $\| -\|_p^{\mathsf{KR}}$  is independent of  $p$ , and in that case we just denote it by  $\| -\|^{\mathsf{KR}}$ .
Given  $x \in \mathbb{R}^n$ , let  $\delta_x$  denote the Dirac measure at  $x$ . A finite signed point measure is any measure in  $\mathcal{M}(\mathbb{R}^n)$  that can be written as a finite sum of signed Dirac measures.
The following result says that, for point measures, the computation of the Kantorovich-Rubinstein norm reduces to an assignment problem, and that, in the case of point measures on the real line, the optimal assignment has a particularly simple form.
Proposition 1. Let  $\mu \in \mathcal{M}_0(\mathbb{R}^n)$  be a finite signed point measure with  $\mu^{+} = \sum_{i}\delta_{x_i}$  and  $\mu^{-} = \sum_{i}\delta_{y_i}$ , where  $X = \{x_{1},\ldots ,x_{k}\}$  and  $Y = \{y_{1},\dots ,y_{k}\}$  are lists of points of  $\mathbb{R}^n$ . Then,
$$
\| \mu \| _ {p} ^ {\mathsf {K R}} = \min  \left\{\sum_ {1 \leq i \leq k} \| x _ {i} - y _ {\gamma (i)} \| _ {p}: \gamma \text {i s a p e r m u t a t i o n o f} \{1, \dots , k \} \right\}.
$$
Moreover, if  $n = 1$  and  $X$  and  $Y$  are such that  $x_{i} \leq x_{i + 1}$  and  $y_{i} \leq y_{i + 1}$  for all  $1 \leq i \leq k - 1$ , then the above minimum is attained at the identity permutation  $\gamma (i) = i$ .
3 Signed barcodes as measures and stable vectorizations
In this section, we introduce the signed barcodes and measures associated to multifiltered simplicial complexes, as well as our proposed vectorizations, and we prove their stability properties.
The barcode [41] of a one-parameter persistence module consists of a multiset of intervals of  $\mathbb{R}$ , often thought of as a positive integer linear combination of intervals, referred to as bars. This positive integer linear combination can, in turn, be represented as a point measure in the extended plane by recording the endpoints of the intervals [36]. Recent adaptations of the notion of one-parameter barcode to multiparameter persistence [4, 11, 12, 49] assign, to each multiparameter persistence module  $M: \mathbb{R}^n \longrightarrow \mathrm{vec}$ , two multisets  $(\mathcal{B}^{+}, \mathcal{B}^{-})$  of bars; each bar typically being some connected subset of  $\mathbb{R}^n$ . In [11, 55], these pairs of multisets of bars are referred to as signed barcodes. In several cases, the multisets  $\mathcal{B}^{+}$  and  $\mathcal{B}^{-}$  are disjoint, and can thus be represented without loss of information as integer linear combinations of bars. This is the case for the minimal Hilbert decomposition signed barcode of [55], where each bar is of the form  $\{y \in \mathbb{R}^n : y \geq x\} \subseteq \mathbb{R}^n$  for some  $x \in \mathbb{R}^n$ . The minimal Hilbert decomposition signed barcode of a multiparameter persistence module  $M$  can thus be encoded as a signed point measure  $\mu_M$ , by identifying the bar  $\{y \in \mathbb{R}^n : y \geq x\}$  with the Dirac measure  $\delta_x$  (see Fig. 1).
In Section 3.1, we give a self-contained description of the signed measure associated to the minimal Hilbert decomposition signed barcode, including optimal transport stability results for it. Then, in Section 3.2, we describe our proposed vectorizations of signed measures and their stability. The proofs of all of the results in this section can be found in Appendix A.
3.1 Hilbert and Euler decomposition signed measures
We start by interpreting the minimal Hilbert decomposition signed barcode of [55] as a signed measure. We prove that this notion is well-defined in Appendix A.4, and give further motivation in Appendix A.5.
Definition 4. The Hilbert decomposition signed measure of a fp multiparameter persistence module  $M:\mathbb{R}^n\to \mathrm{vec}$  is the unique signed point measure  $\mu_{M}\in \mathcal{M}(\mathbb{R}^{n})$  with the property that
$$
\dim (M (x)) = \mu_ {M} \left(\left\{y \in \mathbb {R} ^ {n}: y \leq x \right\}\right), \text {f o r a l l} x \in \mathbb {R} ^ {n}.
$$
Given a filtered simplicial complex, one can combine the Hilbert decomposition signed measure of all of its homology modules as follows.
Definition 5. The Euler decomposition signed measure of a filtered simplicial complex  $(S,f)$  is
$$
\mu_ {\chi (f)} := \sum_ {i \in \mathbb {N}} (- 1) ^ {i} \mu_ {H _ {i} (f)}.
$$
The next result follows from [9, 55], and ensures the stability of the signed measures introduced above. In the result, we denote  $\| h\| _1 = \sum_{\tau \in S}\| h(\tau)\| _1$  when  $(S,h)$  is a filtered simplicial complex.
Theorem 1. Let  $n \in \mathbb{N}$ , let  $S$  be a finite simplicial complex, and let  $f, g: S \to \mathbb{R}^n$  be monotonic.
1. For  $n \in \{1,2\}$  and  $i \in \mathbb{N}$ ,  $\| \mu_{H_i(f)} - \mu_{H_i(g)} \|_1^{\mathsf{KR}} \leq n \cdot \| f - g \|_1$ .
2. For all  $n\in \mathbb{N}$ $\| \mu_{\chi (f)} - \mu_{\chi (g)}\| _1^{\mathsf{K}\mathsf{R}}\leq \| f - g\| _1.$
Extending Theorem 1 (1.) to a number of parameters  $n > 2$  is an open problem.