SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Computation. The design of efficient algorithms for multiparameter persistence is an active area of research [53, 48]. The worst case complexity for the computation of the Hilbert function of the  $i$ th persistent homology module is typically in  $O\left((|S_{i-1}| + |S_i| + |S_{i+1}|)^3\right)$ , where  $|S_k|$  is the number of  $k$ -dimensional simplices of the filtered simplicial complex [53, Rmk. 4.3]. However, in one-parameter persistence, the computation is known to be almost linear in practice [5]. For this reason, our implementation reduces the computation of Hilbert functions of homology multiparameter persistence modules to one-parameter persistence; we show in Appendix D.1 that this scalable in practice. We consider persistence modules and their corresponding Hilbert functions restricted to a grid  $\{0, \ldots, m-1\}^n$ . By [55, Rmk. 7.4], given the Hilbert function  $\{0, \ldots, m-1\}^n \to \mathbb{Z}$  of a module  $M$  on a grid  $\{0, \ldots, m-1\}^n$ , one can compute  $\mu_M$  in time  $O(n \cdot m^n)$ . Using the next result, the Euler decomposition signed measure is computed in linear time in the size of the complex.
Lemma 1. If  $(S,f)$  is a filtered simplicial complex, then  $\mu_{\chi (f)} = \sum_{\tau \in S}(-1)^{\dim (\tau)}\delta_{f(\tau)}$
3.2 Vectorizations of signed measures
Now that we have established the stability properties of signed barcodes and measures, we turn the focus on finding vectorizations of these representations. We generalize two well-known vectorizations of single-parameter persistence barcodes, namely the persistence image [1] and the sliced Wasserstein kernel [22]. The former is defined by centering functions around barcode points in the Euclidean plane, while the latter is based on computing and sorting the point projections onto a fixed set of lines. Both admits natural extensions to points in  $\mathbb{R}^n$ , which we now define. We also state robustness properties in both cases.
3.2.1 Convolution-based vectorization
A kernel function is a map  $K: \mathbb{R}^n \longrightarrow \mathbb{R}_{\geq 0}$  with  $\int_{x \in \mathbb{R}^n} K(x)^2 dx < \infty$ . Given such a kernel function and  $y \in \mathbb{R}^n$ , let  $K_y: \mathbb{R}^n \longrightarrow \mathbb{R}_{\geq 0}$  denote the function  $K_y(x) = K(x - y)$ .
Definition 6. Given  $\mu \in \mathcal{M}(\mathbb{R}^n)$ , define the convolution of the measure  $\mu$  with the kernel function  $K$  as  $K * \mu \in L^{2}(\mathbb{R}^{n})$  as  $(K * \mu)(x) \coloneqq \int_{z \in \mathbb{R}^n} K(x - z) d\mu(z)$ .
Theorem 2. Let  $K: \mathbb{R}^n \to \mathbb{R}$  be a kernel function for which there exists  $c > 0$  such that  $\| K_y - K_z \|_2 \leq c \cdot \| y - z \|_2$  for all  $y, z \in \mathbb{R}^n$ . Then, if  $\mu, \nu \in \mathcal{M}(\mathbb{R}^n)$  have the same total mass,
$$
\left\| K * \mu - K * \nu \right\| _ {2} \leq c \cdot \left\| \mu - \nu \right\| _ {2} ^ {\mathsf {K R}}.
$$
In Propositions 4 and 5 of the appendix, we show that Gaussian kernels and kernels that are Lipschitz with compact support satisfy the assumptions of Theorem 2.
Computation. For the experiments, given a signed measure  $\mu$  on  $\mathbb{R}^n$  associated to a multiparameter persistence module defined over a finite grid in  $\mathbb{R}^n$ , we evaluate  $K * \mu$  on the same finite grid. As kernel  $K$  we use a Gaussian kernel.
3.2.2 Sliced Wasserstein kernel
Given  $\theta \in S^{n - 1} = \{x\in \mathbb{R}^n:\| x\| _2 = 1\} \subseteq \mathbb{R}^n$ , let  $L(\theta)$  denote the line  $\{\lambda \theta :\lambda \in \mathbb{R}\}$ , and let  $\pi^{\theta}:\mathbb{R}^{n}\to \mathbb{R}$  denote the composite of the orthogonal projection  $\mathbb{R}^n\longrightarrow L(\theta)$  with the map  $L(\theta)\longrightarrow \mathbb{R}$  sending  $\lambda \theta$  to  $\lambda$ .
Definition 7. Let  $\alpha$  be a measure on  $S^{n - 1}$ . Let  $\mu, \nu \in \mathcal{M}(\mathbb{R}^n)$  have the same total mass. Their sliced Wasserstein distance and sliced Wasserstein kernel with respect to  $\alpha$  are defined by
$$
S W ^ {\alpha} (\mu , \nu) := \int_ {\theta \in S ^ {n - 1}} \left\| \pi_ {*} ^ {\theta} \mu - \pi_ {*} ^ {\theta} \nu \right\| ^ {\mathsf {K R}} d \alpha (\theta) \quad \mathrm {a n d} \quad k _ {S W} ^ {\alpha} (\mu , \nu) := \exp \big (- S W ^ {\alpha} (\mu , \nu) \big),
$$
respectively, where  $\pi_{*}^{\theta}$  denotes the pushforward of measures along  $\pi^{\theta}:\mathbb{R}^{n}\longrightarrow \mathbb{R}$ .
Theorem 3. Let  $\alpha$  be a measure on  $S^{n - 1}$ . If  $\mu, \nu \in \mathcal{M}(\mathbb{R}^n)$  have the same total mass, then  $SW^{\alpha}(\mu, \nu) \leq \alpha(S^{n - 1}) \cdot \| \mu - \nu \|_2^{\mathsf{KR}}$ . Moreover, there exists a Hilbert space  $\mathcal{H}$  and a map  $\Phi_{SW}^{\alpha}: \mathcal{M}_0(\mathbb{R}^n) \to \mathcal{H}$  such that, for all  $\mu, \nu \in \mathcal{M}_0(\mathbb{R}^n)$ , we have  $k_{SW}^{\alpha}(\mu, \nu) = \langle \Phi_{SW}^{\alpha}(\mu), \Phi_{SW}^{\alpha}(\nu) \rangle_{\mathcal{H}}$  and  $\| \Phi_{SW}^{\alpha}(\mu) - \Phi_{SW}^{\alpha}(\nu) \|_{\mathcal{H}} \leq 2 \cdot SW^{\alpha}(\mu, \nu)$ .
Computation. We discretize the computation of the sliced Wasserstein kernel by choosing  $d$  directions  $\{\theta_1,\dots ,\theta_d\} \subseteq S^{n - 1}$  uniformly at random and using as measure  $\alpha$  the uniform probability measure with support that sample, scaled by a parameter  $1 / \sigma$ , as is common in kernel methods. The Kantorovich-Rubinstein norm in  $\mathbb{R}$  is then computed by sorting the point masses, using Proposition 1.
In this section, we compare the performance of our method against several topological and standard baselines from the literature. We start by describing our methodology (see Appendix C.1 for details about hyperparameter choices). An implementation of our vectorization methods is publicly available at https://github.com/DavidLapous/multipers, and will be eventually merged as a module of the Gudhi library [70].
Notations for descriptors and vectorizations. In the following, we use different acronyms for the different versions of our pipeline. H is a shorthand for the Hilbert function, while E stands for the Euler characteristic function. Their corresponding decomposition signed measures are written HSM and ESM, respectively. The sliced Wasserstein kernel and the convolution-based vectorization are denoted by SW and C, respectively. 1P refers to one-parameter, and MP to multiparameter. Thus, for instance, MP-HSM-SW stands for the multi-parameter version of our pipeline based on the Hilbert signed measure vectorized using the sliced Wasserstein kernel. The notations for the methods we compare against are detailed in each experiment, and we refer the reader to Section 1.3 for their description.
Discretization of persistence modules. In all datasets, samples consist of filtered simplicial complexes. Given such a filtered simplicial complex  $f: S \to \mathbb{R}^n$ , we consider its homology persistence modules  $H_i(f)$  with coefficients in a finite field, for  $i \in \{0,1\}$ . We fix a grid size  $k$  and a  $\beta \in (0,1)$ . For each  $1 \leq j \leq n$ , we take  $r_0^j \leq \dots \leq r_{k-1}^j \subseteq \mathbb{R}$  uniformly spaced, with  $r_0^j$  and  $r_{k-1}^j$  the  $\beta$  and  $1 - \beta$  percentiles of  $f_j(S_0) \subseteq \mathbb{R}$ , respectively. We then restrict each module  $M$  to the grid  $\{r_0^1, \ldots, r_{k-1}^1, r_k^1\} \times \dots \times \{r_0^n, \ldots, r_{k-1}^n, r_k^n\}$  where  $r_k^j = 1.1 \cdot (r_{k-1}^j - r_0^j) + r_0^j$ , setting  $M(x_1, \ldots, x_n) = 0$  whenever  $x_j = r_j^k$  for some  $j$  in order to ensure that  $\mu_M$  has total mass zero.
Classifiers. We use an XGBoost classifier [27] with default parameters, except for the kernel methods, for which we use a kernel SVM with regularization parameter in  $\{0.001, 0.01, 1, 10, 100, 1000\}$ .
4.1 Hilbert decomposition signed measure vs barcode in one-parameter persistence
As proven in Proposition 2, in Appendix A, the Hilbert decomposition signed measure is a theoretically weaker descriptor than the barcode. Nevertheless, we show in this experiment that, in the one-parameter case, our pipeline performs as well as the following well known vectorization methods based on the barcode: the persistence image (PI) [1], the persistence landscape (PL) [13], and the sliced Wasserstein kernel (SWK) [22]. We also compare against the method pvec (PV) of [15], which consists of a histogram constructed with all the endpoints of the barcode. It is pointed out in [15] that methods like pvec, which do not use the full information of the barcode, can perform very well in practice. This observation was one of the initial motivations for our work. The results of running these pipelines on some of the point cloud and graph data detailed below are in Table 1. See Appendix C.2 for the details about this experiment. As one can see from the results, signed barcode scores are always located between PV and (standard) barcode scores, which makes sense given that they encode more information than PV, but less than barcodes. The most interesting part, however, is
that the Hilbert decomposition signed barcode scores are always of the same order of magnitude (and sometimes even better) than barcode scores.
4.2 Classification of point clouds from time series
We perform time series classification on datasets from the UCR archive [39] of moderate sizes; we use the train/test splits which are given in the archive. These datasets have been used to assess the performance of various topology-based methods in [20]; in particular, they show that multiparameter persistence descriptors outperform one-parameter descriptors in almost all cases. For this reason, we compare only against other multiparameter persistence descriptors: multiparameter persistence landscapes (MP-L), multiparameter persistence images (MP-I), multiparameter persistence kernel (MP-K), and the Hilbert function directly used as a vectorization (MP-H). Note that, in this example, we are not interested in performing point cloud classification up to isometry due to the presence of outliers. We use the numbers reported in [20, Table 1]. We also compare against non-topological, state-of-the-art baselines: Euclidean nearest neighbor (B1), dynamic time warping with optimized warping window width (B2), and constant window width (B3), reporting their accuracies from [39]. Following [20], we use a delay embedding with target dimension 3, so that each time series results in a point cloud in  $\mathbb{R}^3$ . Also following [20], as filtered complex we use an alpha complex filtered by a distance-to-measure (DTM) [24] with bandwidth 0.1. As one can see from the results in Table 2, MP-HSM-C is quite effective, as it is almost always better than the other topological baselines, and quite competitive with standard baselines.
Interestingly, MP-HSM-SW does not perform too well in this application. We believe that this is due to the fact that the sliced Wasserstein kernel can give too much importance to point masses that are very far away from other point masses; indeed, the cost of transporting a point mass is proportional to the distance it is transported, which can be very large. This seems to be particularly problematic for alpha complexes filtered by density estimates (such as DTM), since some of the simplices of the alpha complex can be adjacent to vertices with very small density, making this simplices appear very late in the filtration, creating point masses in the Hilbert signed measure that are very far away from the bulk of the point masses. This should not be a problem for Rips complexes, due to the redundancy of simplices in Rips complexes: for any set of points in the point cloud, there will eventually be a simplex between them in the Rips complex. In order to test this hypothesis, we run the same experiment but using density to filter a Rips complex instead of an alpha complex (Table 9 in Appendix C.4). We see that, in this case, the sliced Wasserstein kernel does much better, being very competitive with the non-topological baselines.
4.3 Classification of graphs
We evaluate our methods on standard graph classification datasets (see [54] and references therein) containing social graphs as well as graphs coming from medical and biological contexts.
Since we want to compare against topological baselines, here we use the accuracies reported in [20] and [79], which use 5 train/test splits to compute accuracy. We compare against multiparameter persistence landscapes (MP-L), multiparameter persistence images (MP-I), multiparameter persistence kernel (MP-K), the generalized rank invariant landscape (GRIL), and the Hilbert and Euler characteristic functions used directly as vectorizations (MP-H and MP-E). We use the same filtrations as reported in [20], so the simplicial complex is the graph (Example 1), which we filter with two parameters: the heat kernel signature [69] with time parameter 10, and the Ricci curvature [64]. As one can see from the results in Table 3, our pipeline compares favorably to topological baselines. Further experiments on the same data but using 10 train/test splits are given in Appendix C.3: they show that we are also competitive with the topological methods of [42] and the state-of-the-art graph classification methods of [75, 80, 81].
4.4 Unsupervised virtual screening
In this experiment we show that the distance between our feature vectors in Hilbert space can be used effectively to identify similar compounds (which are in essence multifiltered graphs) in an unsupervised virtual screening task. Virtual screening (VS) is a computational approach to drug discovery in which a library of molecules is searched for structures that are most likely to bind to a given drug target [61]. VS methods typically take as input a query ligand  $q$  and a set  $L$  of test ligands,
and they return a linear ordering  $O(L)$  of  $L$ , ranking the elements from more to less similar to  $q$ . VS methods can be supervised or unsupervised; unsupervised methods [67] order the elements of  $L$  according to the output of a fixed dissimilarity function between  $q$  and each element of  $L$ , while supervised methods learn a dissimilarity function and require training data [2, 78]. We remark that, in this experiment, we are only interested in the direct metric comparison of multifiltered graphs using our feature vectors and thus only in unsupervised methods.
We interpret molecules as graphs and filter them using the given bond lengths, atomic masses, and bond types. In order to have the methods be unsupervised, we normalize each filtering function using its standard deviation, instead of cross validating different rescalings as in supervised tasks. We use a grid size of  $k = 1000$  for all methods, and fix  $\sigma$  for the sliced Wasserstein kernel and the bandwidth of the Gaussian kernel for convolution to 1. We assess the performance of virtual screening methods on the Cleves-Jain dataset [28] using the enrichment factor (EF); details are in Appendix C.5. We report the best results of [67] (in their Table 4), which are used as baseline in the state-of-the-art methods of [34]. We also report the results of [34], but we point out that those are supervised methods. As one can see from the results in Table 4, MP-ESM-C clearly outperforms unsupervised baselines and approaches the performances of supervised ones (despite being unsupervised itself).
We introduced a provably robust pipeline for processing geometric datasets based on the vectorization of signed barcode descriptors of multiparameter persistent homology modules, with an arbitrary number of parameters. We demonstrated that signed barcodes and their vectorizations are efficient representations of the multiscale topology of data, which often perform better than other featurizations based on multiparameter persistence, despite here only focusing on strictly weaker descriptors. We believe that this is due to the fact that using the Hilbert and Euler signed measures allows us to leverage well-developed vectorization techniques shown to have good performance in one-parameter persistence. We conclude from this that the way topological descriptors are encoded is as important as the discriminative power of the descriptors themselves.
Limitations. (1) Our pipelines, including the choice of hyperparameters for our vectorizations, rely on the cross validation of several parameters, which limits the number of possible choices to consider. (2) The convolution-based vectorization method works well when the signed measure is defined over a fine grid, but the performance degrades with coarser grids. This is a limitation of the current version of the method, since convolution in very fine grids does not scale well in the number of dimensions (i.e., in the number of parameters of the persistence module). (3) The sliced Wasserstein vectorization method for signed measures is a kernel method, and thus does not scale well to very large datasets.
Future work. There is recent interest in TDA in the differentiation of topological descriptors and their vectorizations. Understanding the differentiability of signed barcodes and of our vectorizations could be used to address limitation (1) by optimizing various hyperparameters using a gradient instead of cross validation. Relatedly, (2) could be addressed by developing a neural network layer taking as input signed point measures, which is able to learn a suitable, relatively small data-dependent grid on which to perform the convolutions. For clarity, our choices of signed barcode descriptor and vectorization of signed measures are among the simplest available options, and, although with these basic choices we saw notable improvements when comparing our methodology to state-of-the-art topology-based methods, it will be interesting to see how our proposed pipeline performs when applied with stronger signed barcode descriptors, such as the minimal rank decomposition of [11], or to the decomposition of invariants such as the one of [79]. Relatedly, our work opens up the way for the generalization of other vectorizations from one-parameter persistence to signed barcodes, and for the study of their performance and statistical properties.
Acknowledgements. The authors thank the area chair and anonymous reviewers for their insightful comments and constructive suggestions. They also thank Hannah Schreiber for her great help in the implementation of our method. They are grateful to the OPAL infrastructure from Université Côte d'Azur for providing resources and support. DL was supported by ANR grant 3IA Côte d'Azur (ANR-19-P3IA-0002). LS was partially supported by the National Science Foundation through grants CCF-2006661 and CAREER award DMS-1943758. MC was supported by ANR grant TopModel (ANR-23-CE23-0014). SO was partially supported by Inria Action Exploratoire PREMEDIT. This work was carried out in part when MBB and SO were at the Centre for Advanced Study (CAS), Oslo.
Dataset	SWK	PI	PL	PV	1P-HSM-SW	1P-HSM-C
DistalPhalanxOutlineAgeGroup	73.4	66.9	68.3	66.9	70.5	70.5
DistalPhalanxOutlineCorrect	73.6	62.3	68.5	64.5	74.6	75.4
DistalPhalanxTW	64.7	60.4	62.6	55.4	63.3	62.6
COX2	78.8(4.0)	78.6(1.0)	79.2(3.7)	78.2(0.8)	79.2(2.6)	80.1(1.3)
DHFR	80.8(6.5)	76.2(3.5)	78.6(4.6)	73.5(4.7)	76.7(5.7)	76.7(3.4)
IMDB-B	69.6(4.4)	66.6(3.3)	65.4(3.3)	65.8(4.1)	64.3(4.6)	63.7(3.6)
Table 1: Accuracy scores of one-parameter persistence vectorizations on some of the datasets from Tables 2 and 3. The one-parameter version of our signed barcode vectorizations, on the right, performs as well as other topological methods, despite using less topological information.
Dataset	B1	B2	B3	MP-K	MP-L	MP-I	MP-H	MP-HSM-SW	MP-HSM-C
DistalPhalanxOutlineAgeGroup	62.6	62.6	77.0	67.6	70.5	71.9	71.2	74.1	71.2
DistalPhalanxOutlineCorrect	71.7	72.5	71.7	74.6	69.6	71.7	73.9	71.4	75.4
DistalPhalanxTW	63.3	63.3	59.0	61.2	56.1	61.9	60.4	62.6	67.6
ProximalPhalanxOutlineAgeGroup	78.5	78.5	80.5	78.0	78.5	81.0	82.4	82.9	82.4
ProximalPhalanxOutlineCorrect	80.8	79.0	78.4	78.7	78.7	81.8	82.1	77.7	82.5
ProximalPhalanxTW	70.7	75.6	75.6	79.5	73.2	76.1	77.1	77.6	77.6
ECG200	88.0	88.0	77.0	77.0	74.0	83.0	73	71.1	84.1
ItalyPowerDemand	95.5	95.5	95.0	80.7	78.6	79.8	80.5	79.3	77.8
MedicalImages	68.4	74.7	73.7	55.4	55.7	60.0	56.6	53.3	56.2
Plane	96.2	100.0	100.0	92.4	84.8	97.1	99	91.4	100
SwedishLeaf	78.9	84.6	79.2	78.2	64.6	83.8	79	66.2	79.8
GunPoint	91.3	91.3	90.7	88.7	94.0	90.7	89.3	88.7	94.1
GunPointAgeSpan	89.9	96.5	91.8	93.0	85.1	90.5	91.8	87.7	96.7
GunPointMaleVersusFemale	97.5	97.5	99.7	96.8	88.3	95.9	93.7	83.5	96.8
GunPointOldVersusYoung	95.2	96.5	83.8	99.0	97.1	100.0	99.7	99.4	99.4
PowerCons	93.3	92.2	87.8	85.6	84.4	86.7	88.3	83.9	88.7
SyntheticControl	88.0	98.3	99.3	50.7	60.3	60.0	55.3	49.7	61
Table 2: Accuracy scores of baselines and multiparameter persistence methods on time series datasets. Boldface indicates best accuracy and underline indicates best accuracy among topological methods. The convolution-based vectorization with the Hilbert decomposition signed measure (MP-HSM-C) performs very well in comparison to other multiparameter persistence vectorizations, and is competitive with the non-topological baselines.
Dataset	MP-K	MP-L	MP-I	GRIL	MP-H	MP-E	MP-HSM-SW	MP-ESM-SW	MP-HSM-C	MP-ESM-C
COX2	79.9(1.8)	79.0(3.3)	77.9(2.7)	79.8(2.9)	78.2(2)	78.4(2.2)	78.4(0.7)	78.2(0.4)	77.1(3)	78.2(1.5)
DHFR	81.7(1.9)	79.5(2.3)	80.2(2.2)	77.6(2.5)	81.6(1.6)	79.6(1.9)	80(1.1)	80.8(3)	81.9(2.5)	80.5(3.1)
IMDB-B	68.2(1.2)	71.2(2.0)	71.1(2.1)	65.2(2.6)	72.3(2.4)	71.3(1.7)	72.9(2.1)	74.7(1.6)	74.8(2.5)	74.4(2.4)
IMDB-M	46.9(2.6)	46.2(2.3)	46.7(2.7)	NA	47(2.7)	47.3(1.9)	47.2(2.5)	47.7(2.4)	47.9(3.2)	47.3(3.2)
MUTAG	86.1(5.2)	84.0(6.8)	85.6(7.3)	87.8(4.2)	86.7(5.5)	88.8(4.2)	87.3(5)	87.2(2.6)	85.6(5.3)	88.3(5.8)
PROTEINS	67.5(3.1)	65.8(3.3)	67.3(3.5)	70.9(3.1)	67.4(2.2)	70.2(5.7)	72(3.1)	68.8(2.7)	74.6(2.1)	70.9(0.8)
Table 3: Accuracy and standard deviation scores of topological methods (averaged over 5-fold train/test splits) on graph datasets. Bold indicates best accuracy. Again, the convolution-based vectorization with the Hilbert decomposition signed measure (MP-HSM-C) performs very well when compared to other multiparameter persistence vectorizations.
Model	EF2(max. 50)	EF5(max. 20)	EF10(max. 10)
USR + GZD	13.7	7.7	4.7
USR + PS	13.1	7.9	5.0
USR + ROCS	17.1	9.1	5.4
GZD + PS	16.0	9.1	5.9
GZD + ROCS	20.3	10.8	5.3
PSk + ROCS	20.5	10.7	6.4
MP-H	16.0	9.0	5.8
MP-E	21.3	11.8	7.0
MP-ESM-SW	17.4	8.7	4.9
MP-HSM-SW	22.5	11.1	6.4
MP-HSM-C	25.4	13.3	7.6
MP-ESM-C	28.2	13.7	8.0
ToDD-RF (supervised)	35.2(2.3)	15.6(1.0)	8.1(0.4)
ToDD-ViT (supervised)	39.6(1.4)	18.6(0.4)	9.9(0.1)
Table 4: Enrichment factor  $(EF)$  for  $\alpha \in \{2,5,10\}$  of virtual screening methods on Cleves-Jain data. Bold indicates best  $EF$  among unsupervised methods. The convolution-based vectorization of the Euler decomposition signed measure (MP-ESM-C) performs significantly better than unsupervised baselines. Moreover, the pipelines based on the vectorization of signed barcodes perform better than those using the raw Hilbert and Euler functions directly.