{'fraction_non_alphanumeric': 0.04142350383339055, 'fraction_numerical': 0.010212838997596979, 'mean_word_length': 4.36644151059257, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Stable Multi-Scale Kernel for Topological Machine Learning

Topological data analysis offers a rich source of valuable information to study vision problems. Yet, so far we lack a theoretically sound connection to popular kernel-based learning techniques, such as kernel SVMs or kernel PCA. In this work, we establish such a connection by designing a multi-scale kernel for persistence diagrams, a stable summary representation of topological features in data. We show that this kernel is positive definite and prove its stability with respect to the 1-Wasserstein distance. Experiments on two benchmark datasets for 3D shape classification/retrieval and texture recognition show considerable performance gains of the proposed method compared to an alternative approach that is based on the recently introduced persistence landscapes.


Introduction
In many computer vision problems, data (e.g., images, meshes, point clouds, etc.) is piped through complex processing chains in order to extract information that can be used to address high-level inference tasks, such as recognition, detection or segmentation. The extracted information might be in the form of low-level appearance descriptors, e.g., SIFT [21], or of higher-level nature, e.g., activations at specific layers of deep convolutional networks [19]. In recognition problems, for instance, it is then customary to feed the consolidated data to a discriminant classifier such as the popular support vector machine (SVM), a kernelbased learning technique.
While there has been substantial progress on extracting and encoding discriminative information, only recently have people started looking into the topological structure of the data as an additional source of information. With the emergence of topological data analysis (TDA) [6], computational tools for efficiently identifying topological structure have become readily available. Since then, several authors have demonstrated that TDA can capture characteristics of the data that other methods often fail to provide, c.f . [28,20].
Along these lines, studying persistent homology [13] is a particularly popular method for TDA, since it captures the birth and death times of topological features, e.g., connected components, holes, etc., at multiple scales. This information is summarized by the persistence diagram, a multiset of points in the plane. The key feature of persistent homology is its stability: small changes in the input data lead to small changes in the Wasserstein distance of the associated persistence diagrams [12]. Considering the discrete nature of topological information, the existence of such a well-behaved summary is perhaps surprising. Note that persistence diagrams together with the Wasserstein distance only form a metric space. Thus it is not possible to directly employ persistent homology in the large class of machine learning techniques that require a Hilbert space structure, like SVM or PCA. This obstacle is typically circumvented by defining a kernel function on the domain containing the data, which in turn defines a Hilbert space structure implicitly. While the Wasserstein distance itself does not naturally lead to a valid kernel (see Appendix A), we show that it is possible to define a kernel for persistence diagrams that is stable w.r.t. the 1-Wasserstein distance. This is the main contribution of this paper.
Contribution. We propose a (positive definite) multiscale kernel for persistence diagrams (see Fig. 1). This kernel is defined via an L 2 -valued feature map, based on ideas from scale space theory [17]. We show that our feature map is Lipschitz continuous with respect to the 1-Wasserstein distance, thereby maintaining the stability property of persistent homology. The scale parameter of our kernel controls its robustness to noise and can be tuned to the data. We investigate, in detail, the theoretical properties of the kernel, and demonstrate its applicability on shape classification/retrieval and texture recognition benchmarks.

Related work
Methods that leverage topological information for computer vision or medical imaging methods can roughly be grouped into two categories. In the first category, we identify previous work that directly utilizes topological information to address a specific problem, such as topologyguided segmentation. In the second category, we identify approaches that indirectly use topological information.  Figure 1: Visual data (e.g., functions on surface meshes, textures, etc.) is analyzed using persistent homology [13]. Roughly speaking, persistent homology captures the birth/death times of topological features (e.g., connected components or holes) in the form of persistence diagrams. Our contribution is to define a kernel for persistence diagrams to enable a theoretically sound use these summary representations in the framework of kernel-based learning techniques, popular in the computer vision community.
is, information about topological features is used as input to some machine-learning algorithm. As a representative of the first category, Skraba et al. [28] adapt the idea of persistence-based clustering [8] in a segmentation method for surface meshes of 3D shapes, driven by the topological information in the persistence diagram. Gao et al. [14] use persistence information to restore so called handles, i.e., topological cycles, in already existing segmentations of the left ventricle, extracted from computed tomography images. In a different segmentation setup, Chen et al. [9] propose to directly incorporate topological constraints into random-field based segmentation models.
In the second category of approaches, Chung et al. [10] and Pachauri et al. [23] investigate the problem of analyzing cortical thickness measurements on 3D surface meshes of the human cortex in order to study developmental and neurological disorders. In contrast to [28], persistence information is not used directly, but rather as a descriptor that is fed to a discriminant classifier in order to distinguish between normal control patients and patients with Alzheimer's disease/autism. Yet, the step of training the classifier with topological information is typically done in a rather adhoc manner. In [23] for instance, the persistence diagram is first rasterized on a regular grid, then a kernel-density estimate is computed, and eventually the vectorized discrete probability density function is used as a feature vector to train a SVM using standard kernels for R n . It is however unclear how the resulting kernel-induced distance behaves with respect to existing metrics (e.g., bottleneck or Wasserstein distance) and how properties such as stability are affected. An approach that directly uses well-established distances between persistence diagrams for recognition was recently proposed by Li et al. [20]. Besides bottleneck and Wasserstein distance, the authors employ persistence landscapes [5] and the corresponding distance in their experiments. Their results expose the complementary nature of persis-tence information when combined with traditional bag-offeature approaches. While our empirical study in Sec. 5.2 is inspired by [20], we primarily focus on the development of the kernel; the combination with other methods is straightforward.
In order to enable the use of persistence information in machine learning setups, Adcock et al. [1] propose to compare persistence diagrams using a feature vector motivated by algebraic geometry and invariant theory. The features are defined using algebraic functions of the birth and death values in the persistence diagram.
From a conceptual point of view, Bubenik's concept of persistence landscapes [5] is probably the closest to ours, being another kind of feature map for persistence diagrams. While persistence landscapes were not explicitly designed for use in machine learning algorithms, we will draw the connection to our work in Sec. 5.1 and show that they in fact admit the definition of a valid positive definite kernel. Moreover, both persistence landscapes as well as our approach represent computationally attractive alternatives to the bottleneck or Wasserstein distance, which both require the solution of a matching problem.

Background
First, we review some fundamental notions and results from persistent homology that will be relevant for our work.
Persistence diagrams. Persistence diagrams are a concise description of the topological changes occuring in a growing sequence of shapes, called filtration. In particular, during the growth of a shape, holes of different dimension (i.e., gaps between components, tunnels, voids, etc.) may appear and disappear. Intuitively, a k-dimensional hole, born at time b and filled at time d, gives rise to a point (b, d) in the k th persistence diagram. A persistence diagram is thus a multiset of points in R 2 . Formally, the persistence diagram is defined using a standard concept from algebraic topology called homology; see [13] for details.
Note that not every hole has to disappear in a filtration. Such holes give rise to essential features and are naturally represented by points of the form (b, ∞) in the diagram. Essential features therefore capture the topology of the final shape in the filtration. In the present work, we do not consider these features as part of the persistence diagram. Moreover, all persistence diagrams will be assumed to be finite, as is usually the case for persistence diagrams coming from data.
Filtrations from functions. A standard way of obtaining a filtration is to consider the sublevel sets f −1 (−∞, t] of a function f : Ω → R defined on some domain Ω, for t ∈ R. It is easy to see that the sublevel sets indeed form a filtration parametrized by t. We denote the resulting persistence diagram by D f ; see Fig. 2 for an illustration. As an example, consider a grayscale image, where Ω is the rectangular domain of the image and f is the grayscale value at any point of the domain (i.e., at a particular pixel). A sublevel set would thus consist of all pixels of Ω with value up to a certain threshold t. Another example would be a piecewise linear function on a triangular mesh Ω, such as the popular heat kernel signature [29]. Yet another commonly used filtration arises from point clouds P embedded in R n , by considering the distance function d P (x) = min p∈P x − p on Ω = R n . The sublevel sets of this function are unions of balls around P. Computationally, they are usually replaced by equivalent constructions called alpha shapes.

Stability.
A crucial aspect of the persistence diagram D f of a function f is its stability with respect to perturbations of f . In fact, only stability guarantees that one can infer information about the function f from its persistence diagram D f in the presence of noise.
Formally, we consider f → D f as a map of metric spaces and define stability as Lipschitz continuity of this map. This requires choices of metrics both on the set of functions and the set of persistence diagrams. For the functions, the L ∞ metric is commonly used.
There is a natural metric associated to persistence diagrams, called the bottleneck distance. Loosely speaking, the distance of two diagrams is expressed by minimizing the largest distance of any two corresponding points, over all bijections between the two diagrams. Formally, let F and G be two persistence diagrams, each augmented by adding each point (t, t) on the diagonal with countably infinite multiplicity. The bottleneck distance is where γ ranges over all bijections from the individual points of F to the individual points of G. As shown by Cohen-Steiner et al. [11], persistence diagrams are stable with respect to the bottleneck distance. The bottleneck distance embeds into a more general class of distances, called Wasserstein distances. For any positive real number p, the p-Wasserstein distance is where again γ ranges over all bijections from the individual elements of F to the individual elements of G. Note that taking the limit p → ∞ yields the bottleneck distance, and we therefore define d W,∞ = d B . We have the following result bounding the p-Wasserstein distance in terms of the L ∞ distance: Theorem 1 (Cohen-Steiner et al. [12]). Assume that X is a compact triangulable metric space such that for every 1-Lipschitz function f on X and for k ≥ 1, the degree k total persistence (b,d)∈D f (d − b) k is bounded above by some constant C. Let f, g be two L-Lipschitz piecewise linear functions on X. Then for all p ≥ k, We note that, strictly speaking, this is not a stability result in the sense of Lipschitz continuity, since it only establishes Hölder continuity. Moreover, it only gives a constant upper bound for the Wasserstein distance when p = 1.
Kernels. Given a set X, a function k : X × X → R is a kernel if there exists a Hilbert space H, called feature space, and a map Φ : X → H, called feature map, such that k(x, y) = Φ(x), Φ(y) H for all x, y ∈ X. Equivalently, k is a kernel if it is symmetric and positive definite [26]. Kernels allow to apply machine learning algorithms operating on a Hilbert space to be applied to more general settings, such as strings, graphs, or, in our case, persistence diagrams.
for all x, y ∈ X. Note that this is equivalent to Lipschitz continuity of the feature map.
The stability of a kernel is particularly useful for classification problems: assume that there exists a separating hyperplane H for two classes of data points with margin m. If the data points are perturbed by some < m/2, then H still separates the two classes with a margin m − 2 .

The persistence scale-space kernel
We propose a stable multi-scale kernel k σ for the set of persistence diagrams D. This kernel will be defined via a feature map Φ σ : D → L 2 (Ω), with Ω ⊂ R 2 denoting the closed half plane above the diagonal.
To motivate the definition of Φ σ , we point out that the set of persistence diagrams, i.e., multisets of points in R 2 , does not possess a Hilbert space structure per se. However, a persistence diagram D can be uniquely represented as a sum of Dirac delta distributions 1 , one for each point in D. Since Dirac deltas are functionals in the Hilbert space H −2 (R 2 ) [18, Chapter 7], we can embed the set of persistence diagrams into a Hilbert space by adopting this point of view.
Unfortunately, the induced metric on D does not take into account the distance of the points to the diagonal, and therefore cannot be robust against perturbations of the diagrams. Motivated by scale-space theory [17], we address this issue by using the sum of Dirac deltas as an initial condition for a heat diffusion problem with a Dirichlet boundary condition on the diagonal. The solution of this partial differential equation is an L 2 (Ω) function for any chosen scale parameter σ > 0. In the following paragraphs, we will 1) define the persistence scale space kernel k σ , 2) derive a simple formula for evaluating k σ , and 3) prove stability of k σ w.r.t. the 1-Wasserstein distance.
the space above the diagonal, and let δ p denote a Dirac delta centered at the point p. For a given persistence diagram D, we now consider the solution u : The feature map Φ σ : D → L 2 (Ω) at scale σ > 0 of a persistence diagram D is now defined as Φ σ (D) = u| t=σ . This map yields the persistence scale space kernel k σ on D as Note that Φ σ (D) = 0 for some σ > 0 implies that u = 0 on Ω×{0}, which means that D has to be the empty diagram. From linearity of the solution operator it now follows that Φ σ is an injective map.
The solution of the partial differential equation can be obtained by extending the domain from Ω to R 2 and replacing (6) with It can be shown that restricting the solution of this extended problem to Ω yields a solution for the original equation. It is given by convolving the initial condition (8) with a Gaussian kernel: Using this closed form solution of u, we can derive a simple expression for evaluating the kernel explicitly: We refer to Appendix C for the elementary derivation of (10) and for a visualization (see Appendix B) of the solution (9). Note that the kernel can be computed in O(|F|·|G|) time, where |F| and |G| denote the cardinality of the multisets F and G, respectively.
Proof. To prove 1-Wasserstein stability of k σ , we show Lipschitz continuity of the feature map Φ σ as follows: where F and G denote persistence diagrams that have been augmented with points on the diagonal. Note that augmenting diagrams with points on the diagonal does not change the values of Φ σ , as can be seen from (9). Since the unaugmented persistence diagrams are assumed to be finite, some matching γ between F and G achieves the infimum in the definition of the Wasserstein distance, 8σ . The Minkowski inequality and the inequality e −ξ ≥ 1 − ξ finally yield We refer to the left-hand side of (11) as the persistence scale space distance d k σ between F and G. Note that the right hand side of (11) decreases as σ increases. Adjusting σ accordingly allows to counteract the influence of noise in the input data, which causes an increase in d W,1 (F, G). We will see in Sec. 5.3 that tuning σ to the data can be beneficial for the overall performance of machine learning methods.
A natural question arising from Theorem 2 is whether our stability result extends to p > 1. To answer this question, we first note that our kernel is additive: we call a kernel k on persistence diagrams additive if k(E ∪ F, G) = k(E, G) + k(F, G) for all E, F, G ∈ D. By choosing F = ∅, we see that if k is additive then k(∅, G) = 0 for all G ∈ D. We further say that a kernel k is trivial if k(F, G) = 0 for all F, G ∈ D. The next theorem establishes that Theorem 2 is sharp in the sense that no non-trivial additive kernel can be stable w.r.t. the p-Wasserstein distance when p > 1.
Theorem 3. A non-trivial additive kernel k on persistence diagrams is not stable w.r.t. d W,p for any 1 < p ≤ ∞.
Proof. By the non-triviality of k, it can be shown that there exists an F ∈ D such that k(F, F) > 0. We prove the claim by comparing the rates of growth of On the other hand, Hence, d k σ can not be bounded by C · d W,p with a constant C > 0 if p > 1.

Evaluation
To evaluate the kernel proposed in Sec. 4, we investigate conceptual differences to persistence landscapes in Sec. 5.1, and then consider its performance in the context of shape classification/retrieval and texture recognition in Sec. 5.2.

Comparison to persistence landscapes
In [5], Bubenik introduced persistence landscapes, a representation of persistence diagrams as functions in the Banach space L p (R 2 ). This construction was mainly intended for statistical computations, enabled by the vector space structure of L p . For p = 2, we can use the Hilbert space structure of L 2 (R 2 ) to construct a kernel analogously to (7). For the purpose of this work, we refer to this kernel as the persistence landscape kernel k L and denote by Φ L : D → L 2 (R 2 ) the corresponding feature map. The kernel-induced distance is denoted by d k L . Bubenik shows stability w.r.t. a weighted version of the Wasserstein distance, which for p = 2 can be summarized as: Theorem 4 (Bubenik [5]). For any two persistence diagrams F and G we have where p(u) = d − b denotes the persistence of u = (b, d), and γ ranges over all bijections from F to G.
For a better understanding of the stability results given in Theorems 2 and 4, we present and discuss two thought experiments.
For the first experiment, let F λ = {−λ, λ} and G λ = {−λ + 1, λ + 1} be two diagrams with one point each and λ ∈ R ≥0 . The two points move away from the diagonal with increasing λ, while maintaining the same Euclidean distance to each other. Consequently, d W,p (F λ , G λ ) and d k σ (F λ , G λ ) asymptotically approach a constant as λ → ∞. In contrast, d k L (F λ , G λ ) grows in the order of √ λ and, in particular, is unbounded. This means that d k L emphasizes points of high persistence in the diagrams, as reflected by the weighting term p(u) in (12).
In the second experiment, we compare persistence diagrams from data samples of two fictive classes A (i.e., F,F ) and B (i.e., G), illustrated in Fig. 3. We first consider d k L (F, F ). As we have seen in the previous experiment, d k L will be dominated by variations in the points of high persistence. Similarly, d k L (F, G) will also be dominated by these points as long as λ is sufficiently large. Hence, instances of classes A and B would be inseparable in a nearest neighbor setup. In contrast, d B , d W,p and d k σ do not overemphasize points of high persistence and thus allow to distinguish classes A and B.

Empirical results
We report results on two vision tasks where persistent homology has already been shown to provide valuable discriminative information [20]: shape classification/retrieval and texture image classification. The purpose of the experiments is not to outperform the state-of-the-art on these problems -which would be rather challenging by exclusively using topological information -but to demonstrate the advantages of k σ and d k σ over k L and d k L .
Datasets. For shape classification/retrieval, we use the SHREC 2014 [24] benchmark, see Fig. 4. It consists of both synthetic and real shapes, given as 3D meshes. The synthetic part of the data contains 300 meshes of humans (five males, five females, five children) in 20 different poses; the real part contains 400 meshes from 40 humans (male, female) in 10 different poses. We use the meshes in full resolution, i.e., without any mesh decimation. For classification, the objective is to distinguish between the different human models, i.e., a 15-class problem for SHREC 2014 (synthetic) and a 40-class problem for SHREC 2014 (real).
For texture recognition, we use the Outex TC 00000 benchmark [22], downsampled to 32×32 pixel images. The benchmark provides 100 predefined training/testing splits and each of the 24 classes is equally represented by 10 images during training and testing. Implementation. For shape classification/retrieval, we compute the classic Heat Kernel Signature (HKS) [29] over a range of ten time parameters t i of increasing value. For each specific choice of t i , we obtain a piecewise linear function on the surface mesh of each object. As discussed in Sec. 3, we then compute the persistence diagrams of the induced filtrations in dimensions 0 and 1.
For texture classification, we compute CLBP [16] descriptors, (c.f . [20]). Results are reported for the rotationinvariant versions of the CLBP-Single (CLBP-S) and the CLBP-Magnitude (CLBP-M) operator with P = 8 neighbours and radius R = 1. Both operators produce a scalar-valued response image which can be interpreted as a weighted cubical cell complex and its lower star filtration is used to compute persistence diagrams; see [30] for details.
For both types of input data, the persistence diagrams are obtained using Dipha [3], which can directly handle meshes and images. A standard soft margin C-SVM classifier [26], as implemented in Libsvm [7], is used for classification. The cost factor C is tuned using ten-fold cross-validation on the training data. For the kernel k σ , this cross-validation further includes the kernel scale σ.

Shape classification
Tables 1 and 2 list the classification results for k σ and k L on SHREC 2014. All results are averaged over ten crossvalidation runs using random 70/30 training/testing splits with a roughly equal class distribution. We report results for 1-dimensional features only; 0-dimensional features lead to comparable performance.
On both real and synthetic data, we observe that k σ leads to consistent improvements over k L . For some choices of t i , the gains even range up to 30%, while in other cases, the improvements are relatively small. This can be explained by the fact that varying the HKS time t i essentially varies the smoothness of the input data. The scale σ in k σ allows to compensate-at the classification stage-for unfavorable smoothness settings to a certain extent, see Sec. 4. In contrast, k L does not have this capability and essentially relies on suitably preprocessed input data. For some choices of t i , k L does in fact lead to classification accuracies close to k σ . However, when using k L , we have to carefully adjust the HKS time parameter, corresponding to changes in the in-  put data. This is undesirable in most situations, since HKS computation for meshes with a large number of vertices can be quite time-consuming and sometimes we might not even have access to the meshes directly. The improved classification rates for k σ indicate that using the additional degree of freedom is in fact beneficial for performance.

Shape retrieval
In addition to the classification experiments, we report on shape retrieval performance using standard evaluation measures (see [27,24]). This allows us to assess the behavior of the kernel-induced distances d k σ and d k L . For brevity, only the nearest-neighbor performance is listed in Table 3 (for a listing of all measures, see Appendix D). Using each shape as a query shape once, nearestneighbor performance measures how often the top-ranked shape in the retrieval result belongs to the same class as the query. To study the effect of tuning the scale σ, the column d k σ lists the maximum nearest-neighbor performance that can be achieved over a range of scales.
As we can see, the results are similar to the classification experiment. However, at a few specific settings of the HKS time t i , d k L performs on par, or better than d k σ . As noted in Sec. 5.2.1, this can be explained by the changes in the smoothness of the input data, induced by different HKS times t i . Another observation is that nearest-neighbor performance of d k L is quite unstable around the top result with respect to t i . For example, it drops at t 2 from 91% to 53.3% and 76.7% on SHREC 2014 (synthetic) and at t 8 from 70%  to 45.2% and 43.5% on SHREC 2014 (real). In contrast, d k σ exhibits stable performance around the optimal t i . To put these results into context with existing works in shape retrieval, Table 3 also lists the top three entries (out of 22) of [24] on the same benchmark. On both real and synthetic data, d k σ ranks among the top five entries. This indicates that topological persistence alone is a rich source of discriminative information for this particular problem. In addition, since we only assess one HKS time parameter at a time, performance could potentially be improved by more elaborate fusion strategies.

Texture recognition
For texture recognition, all results are averaged over the 100 training/testing splits of the Outex TC 00000 benchmark. Table 4 lists the performance of a SVM classifier using k σ and k L for 0-dimensional features (i.e., connected components). Higher-dimensional features were not informative for this problem. For comparison, Table 4 also lists the performance of a SVM, trained on normalized histograms of CLBP-S/M responses, using a χ 2 kernel.
First, from Table 4, it is evident that k σ performs better than k L by a large margin, with gains up to ≈11% in accuracy. Second, it is also apparent that, for this problem, topological information alone is not competitive with SVMs using simple orderless operator response histograms. However, the results of [20] show that a combination of persistence information (using persistence landscapes) with conventional bag-of-feature representations leads to stateof-the-art performance. While this indicates the complementary nature of topological features, it also suggests that kernel combinations (e.g., via multiple-kernel learning [15]) could lead to even greater gains by including the proposed kernel k σ .
To assess the stability of the (customary) cross-validation strategy to select a specific σ, Fig. 5 illustrates classification performance as a function of the latter. Given the smoothness of the performance curve, it seems unlikely that parameter selection via cross-validation will be sensitive to a CLBP Operator CLBP-S (SVM-χ 2 ) 76.1 ± 2.2 CLBP-M (SVM-χ 2 ) 76.7 ± 1.8 Table 4: Classification performance on Outex TC 00000. Finally, we remark that tuning k L has the same drawbacks in this case as in the shape classification experiments. While, in principle, we could smooth the textures, the CLBP response images, or even tweak the radius of the CLBP operators, all those strategies would require changes at the beginning of the processing pipeline. In contrast, adjusting the scale σ in k σ is done at the end of the pipeline during classifier training.

Conclusion
We have shown, both theoretically and empirically, that the proposed kernel exhibits good behavior for tasks like shape classification or texture recognition using a SVM. Moreover, the ability to tune a scale parameter has proven beneficial in practice.
One possible direction for future work would be to address computational bottlenecks in order to enable application in large scale scenarios. This could include leveraging additivity and stability in order to approximate the value of the kernel within given error bounds, in particular, by reducing the number of distinct points in the summation of (10).
While the 1-Wasserstein distance is well established and has proven useful in applications, we hope to improve the understanding of stability for persistence diagrams w.r.t. the Wasserstein distance beyond the previous estimates. Such a result would extend the stability of our kernel from persistence diagrams to the underlying data, leading to a full stability proof for topological machine learning.
In summary, our method enables the use of topological information in all kernel-based machine learning methods. It will therefore be interesting to see which other application areas will profit from topological machine learning.

A. Indefiniteness of d W,p
It is tempting to try to employ the Wasserstein distance for constructing a kernel on persistence diagrams. For instance, in Euclidean space, k(x, y) = − x − y 2 , x, y ∈ R n is conditionally positive definite and can be used within SVMs. Hence, the question arises if k(x, y) = −d W,p (x, y), x, y ∈ D can be used as well.
In the following, we demonstrate (via counterexamples) that neither −d W,p nor exp(−ξd W,p (·, ·)) -for different choices of p -are (conditionally) positive definite. Thus, they cannot be employed in kernel-based learning techniques.
First, we briefly repeat some definitions to establish the terminology; this is done to avoid potential confusion, w.r.t. references [4,2,26]), about what is referred to as (conditionally) positive/negative definiteness in the context of kernel functions.
Note that in literature on linear algebra the notion of definiteness as introduced above is typically known as semidefiniteness. For the sake of brevity, in the kernel literature the prefix "semi" is typically dropped.  Typically a positive definite kernel is simply called kernel. Roughly speaking, the utility of p.d. kernels comes from the fact that they enable the "kernel-trick", i.e., the use of algorithms that can be formulated in terms of dot products in an implicit feature space [26]. However, as shown by Schölkopf in [25], this "kernel-trick" also works for distances, leading to the larger class of c.p.d. kernels (see Definition 5), which can be used in kernel-based algorithms that are translation-invariant (e.g., SVMs or kernel PCA).
Definition 5. A function k : X × X → R is (conditionally) positive (negative, resp.) definite kernel if and only if k is symmetric and for every finite subset {x 1 , . . . , x m } ⊆ X the Gram matrix (k(x i , x j )) m,m i, j=1,1 is (conditionally) positive (negative, resp.) definite.
To demonstrate that a function is not c.p.d. or c.n.d., resp., we can look at the eigenvalues of the corresponding Gram matrices. In fact, it is known that a matrix A is p.d. if and only if all its eigenvalues are nonnegative. The following lemmas from [2] give similar, but weaker results for (nonnegative) c.n.d. matrices, which will be useful to us.
Lemma 5 (see Lemma 4.1.4 of [2]). If A is a c.n.d. matrix, then A has at most one positive eigenvalue.
Corollary 1 (see Corollary 4.1.5 of [2]). Let A be a nonnegative, nonzero matrix that is c.n.d. Then A has exactly one positive eigenvalue.
The following theorem establishes a relation between c.n.d. and p.d. kernels.
Theorem 6 (see Chapter 2, §2, Theorem 2.2 of [4]). Let X be a nonempty set and let k : X × X → R be symmetric. Then k is a conditionally negative definite kernel if and only if exp(−ξk(·, ·)) is a positive definite kernel for all ξ > 0.
In the code (test negative type simple.m) 3  This will generate a short summary of the eigenvalue computations for a selection of values for p, including p = ∞ (bottleneck distance).
Remark. While our simple counterexamples suggest that typical kernel constructions using d W,p for different p (including p = ∞) do not lead to (c.)p.d. kernels, a formal assessment of this question remains an open research question.
B. Plots of the feature map Φ σ Given a persistence diagram D, we consider the solution u : Ω × R ≥0 → R, (x, t) → u(x, t) of the following partial differential equation To solve the partial differential equation, we extend the domain from Ω to R 2 and consider for each p ∈ D a Dirac delta δ p and a Dirac delta −δ p , as illustrated in Fig. 6 (left). By convolving p∈D δ p − δ p with a Gaussian kernel, see Fig. 6 (right), we obtain a solution u : R 2 × R ≥0 → R, (x, t) → u(x, t) for the following partial differential equation: Restricting the solution u to Ω × R ≥0 , we then obtain the following solution u : for the original partial differential equation and t > 0. This yields the feature map Φ σ : D → L 2 (Ω): δp p p δp Figure 6: Solving the partial differential equation: First (left), we extend the domain from Ω to R 2 and consider for each p ∈ D a Dirac delta δ p (red) and a Dirac delta −δ p (blue). Next (right), we convolve p∈D δ p − δ p with a Gaussian kernel.
In Fig. 7, we illustrate the effect of an increasing scale σ on the feature map Φ σ (D). Note that in the right plot the influence of the low-persistence point close to the diagonal basically vanishes. This effect is essentially due to the Dirichlet boundary condition and is responsible for gaining stability for our persistence scale-space kernel k σ . C. Closed-form solution for k σ For two persistence diagrams F and G, the persistence scale-space kernel k σ (F, G) is defined as By extending its domain from Ω to R 2 , we see that for all x ∈ R 2 , and we obtain We calculate the integrals as follows: In the first step, we applied a coordinate transform that moves x − q to x. In the second step, we performed a rotation such that p − q lands on the positive x 1 -axis at distance p − q to the origin and we applied Fubini's theorem. We finally obtain the closed-form expression for the kernel k σ