This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

The Weighted Euler Characteristic Transform for Image Shape Classification

Jessi Cisewski-Kehe University of Wisconsin-Madison Department of Statistics    Brittany Terese Fasy Montana State University School of Computing & Dept. of Mathematical Sciences    Dhanush Giriyan Arizona State University School of Computing and Augmented Intelligence    Eli Quist 22footnotemark: 2
Abstract

The weighted Euler characteristic transform (WECT) is a new tool for extracting shape information from data equipped with a weight function. Image data may benefit from the WECT where the intensity of the pixels are used to define the weight function. In this work, an empirical assessment of the WECT’s ability to distinguish shapes on images with different pixel intensity distributions is considered, along with visualization techniques to improve the intuition and understanding of what is captured by the WECT. Additionally, the expected weighted Euler characteristic and the expected WECT are derived.

Funding JCK and BTF acknowledge support from NSF under Grant Numbers DMS 2038556 and 1854336. BTF and EQ also acknowledge support from NSF under Grant Number 1664858.

1 Introduction

Topological shape analysis seeks to summarize information about the shape of data via topological invariants, which can then be used in subsequent analysis tasks like classification or regression. A classical topological invariant is the Euler Characteristic (EC), which can easily be computed from data. A popular extension of the EC for a filtered topological space is the Euler characteristic function (ECF),111 In some sources, this is referred to as the Euler characteristic curve, but it is not a curve (as it is a step function). which tracks the EC as the filtration parameter changes. When considering the shape of data embedded in d\mathbb{R}^{d}, the shape is often filtered in different directions such as with the Euler Characteristic Transform (ECT) and the Persistent Homology Transform (PHT) [18, 12]. These transforms have been used in a variety of settings such as biology [18, 2], oncology [6], and organoids [15]. A recent generalization of the ECT that allows for a weighted simplicial complex is the weighted Euler characterisitc transform (WECT) [13]. Jiang, Kurtek, and Needham [13] extend work of [18, 12] and show that the WECT uniquely represents weighted simplicial complexes. The motivation of [13] is image data where the intensity of a pixel is used to assign the weights for the weighted simplicial complex. We investigate the effectiveness of the WECT at discriminating shapes with weights sampled from different distributions, and find the expected weighted EC and the expected WECT of images under different weight distributions.

The effectiveness of the WECT at discriminating different types of images was demonstrated in [13] where they considered the MNIST handwritten digit dataset [14] and magnetic resonance images of malignant brain tumors (Glioblastoma Multiforme). In the former example, the WECT-based classification model outperformed classification models that used either the image directly or the (unweighted) ECT in terms of ten-fold cross-validation classification rate. In this paper, we more generally explore the performance of the WECT when the pixel intensities are sampled from different distributions. In addition to evaluating the performance of the WECT in a variety of settings, we improve the interpretability of the WECT by estimating the expected weighted EC and the expected WECT.

2 The WECT

In this paper, we use techniques from topological data analysis (TDA) to study weighted shapes arising in image data. We write the following definitions restricted to this setting, but note here that many of the definitions can be stated more generally. For a broader introduction to TDA, see [9, 8].

2.1 From Images to Weighted Simplicial Complexes and Filtrations

Computations of the WECT requires a representation of a weighted simplicial complexes. In this paper, we compute the WECT using a simplicial complex that represents an image.222For images, a cubical complex provides a computationally preferable representation [19]; however, we choose to use simplicial complexes in order to stay closer to the theory developed in [13]. A geometric kk-simplex σ\sigma in d\mathbb{R}^{d} is the convex hull of k+1k+1 affinely independent points in d\mathbb{R}^{d}. For example, a zero-simplex is a point, a one-simplex is a segment, and a two-simplex is a triangle. If we want to list the points of a simplex, we write σ=[v0,v1,,vk]\sigma=[v_{0},v_{1},\ldots,v_{k}] and, for each i{0,1,,k}i\in\{0,1,\ldots,k\}, we write viσv_{i}\in\sigma. A simplex τ\tau is a face of σ\sigma, denoted τ<σ\tau<\sigma, if it is the convex hull of a subset of those k+1k+1 points. A simplicial complex is a collection of simplexes that are combined in such a way that (i) for all simplexes σK\sigma\in K, if τ\tau is a face of σ\sigma then τK\tau\in K, and (ii) if simplexes σ,τK\sigma,\tau\in K, then either στK\sigma\cap\tau\in K or στ=\sigma\cap\tau=\emptyset. KiK_{i} is used to denote the set of ii-simplices of KK. The simplicial complex KK is topologized using the Alexandroff topology [1]; with a slight abuse of notation, KK denotes both the complex (as a set of simplices) and the underlying topological space.

Refer to caption
Figure 1: An image. We find shapes in an image by thresholding the pixel intensities.
Shapes and Weights.

An image, such as the one shown in Fig. 1 is a collection of colored grid cells arranged in a regular grid. The grid cells are often called pixels, and we consider the monochromatic setting (i.e., the pixel color is represented by one number in [0,1][0,1]). Let DD be a rectangular subset of 2\mathbb{Z}^{2}. An image over DD is a function D[0,1]D\to[0,1]. The value assigned is called the pixel intensity. The points in 2D\mathbb{Z}^{2}\cap D represent the centers of the pixels. Without loss of generality, we assume that (0,0)(0,0) is the center of the image; see Fig. 2(2(a)).

Refer to caption
(a) Vertices
Refer to caption
(b) Cellulation
Refer to caption
(c) Triangulation
Refer to caption
(d) “Shape”
Figure 2: Illustration of triangulating and thresholding an image. (2(a)) Vertices (zero-simplexes) are added to the center of each pixel. (2(b)) Edges (one-simplexes) are drawn between pixels that share an edge and squares added. (2(c)) A triangulation is created by drawing an edge between the top-left and bottom-right corners of each square. (2(d)) The simplicial complex resulting from restricting vertices to have positive intensity.

In order to compute topological summaries of an image, we triangulate the image as follows. Letting each pixel center be a vertex, an edge is added between two vertices (pixels) that share a side, and a square is added when four pixels meet at a corner. A cellular structure is obtained that represents the continuous n×nn\times n square domain centered at (0,0)(0,0); see Fig. 2(2(b)). Adding a diagonal from the top-left to the bottom-right corners in each square and splitting each square into two triangles, we obtain the Freudenthal triangulation [11]; see Fig. 2(2(c)). The shapes that we consider in this paper are subcomplexes of this triangulation, often constructed by a threshold on the pixel intensities, as shown in Fig. 2(2(d)).

Now that we have a simplicial complex, we explore how to extend the pixel intensities to weights on each simplex. In general, a weighted simplicial complex is a pair:

(K,ω:K),(K,\omega\colon K\to\mathbb{R}),

where KK is a simplicial complex, and ω\omega is a function that assigns a real value (i.e., a weight) to each simplex in KK.

Given a weight function ω:K0[0,1]\omega\colon K_{0}\to[0,1], we extend it to a function over the whole complex, Ω:K[0,1]\Omega\colon K\to[0,1]. There are several options for performing this extension, including (i) the maximum extension (Ωmax\Omega_{\text{max}}), which maps a kk-simplex σk=[v0,v1,,vk]\sigma_{k}=[v_{0},v_{1},\ldots,v_{k}] to the maximum value over its vertices, (ii) the minimum extension (Ωmin\Omega_{\text{min}}), which maps σk\sigma_{k} to the minimum value over its vertices, and (iii) the average extension (Ωavg\Omega_{\text{avg}}), which maps σk\sigma_{k} to the average value over its vertices. In other words, we have the following formulas:

Ωmax(σk)\displaystyle\Omega_{\text{max}}(\sigma_{k}) =maxi=0,,kω(vi),\displaystyle=\max_{i=0,\ldots,k}\omega(v_{i}), (1)
Ωmin(σk)\displaystyle\Omega_{\text{min}}(\sigma_{k}) =mini=0,,kω(vi), and\displaystyle=\min_{i=0,\ldots,k}\omega(v_{i}),\text{ and } (2)
Ωavg(σk)\displaystyle\Omega_{\text{avg}}(\sigma_{k}) =1k+1i=0kω(vi).\displaystyle=\frac{1}{k+1}\sum_{i=0}^{k}\omega(v_{i}). (3)
Filtrations.

In what follows, we use lower-star filtrations parameterized by heights in various directions. The height of a point vdv\in\mathbb{R}^{d} in direction s𝕊d1s\in\mathbb{S}^{d-1} is given by the dot product hs(v):=vsh_{s}(v):=v\cdot s. Now, let KK be a simplicial complex in d\mathbb{R}^{d}. The height of a simplex σK\sigma\in K is simply the maximum height of any of its vertices; specifically, we have the Hs:KH_{s}\colon K\to\mathbb{R} defined by Hs(σ):=maxvσvsH_{s}(\sigma):=\max_{v\in\sigma}v\cdot s; we recognize this as the maximum extension of hsh_{s}. HH is an example of a filter function, that is a function on the simplices such that lower-level sets are always simplicial complexes. A filtration is a parameterized family of topological spaces connected by (forward) inclusions. The lower-star filtration is the following sequence of nested simplicial complexes:

{ttHs1(,t]}t¯.\left\{\bigcup_{t^{\prime}\leq t}H_{s}^{-1}(-\infty,t^{\prime}]\right\}_{t\in\overline{\mathbb{R}}}. (4)

For example, consider the shape from Fig. 2(2(d)). The lower-star filtration in direction s=(1,0)s=(1,0) is shown in Fig. 3(3(a)).

Refer to caption
(a) Filtration in direction (1,0)(1,0)
Refer to caption
(b) ECF in direction (1,0)(1,0)
Refer to caption
(c) WECF in direction (1,0)(1,0)
Figure 3: Filtration of the shape from Fig. 2(2(d)), along with the ECF and WECF. Note that there may be filtration values where WECF changes, but ECF does not (e.g., at h=1h=1 above.

2.2 Euler Characteristic and Weighted Euler Characteristic Functions

For a topological space 𝕏\mathbb{X}, the EC of 𝕏\mathbb{X}, denoted χ(𝕏)\chi(\mathbb{X}), is the alternating sum of Betti numbers, χ(𝕏):=i(1)iβi\chi(\mathbb{X}):=\sum_{i\in\mathbb{N}}(-1)^{i}\beta_{i}. If 𝕏\mathbb{X} is a CW complex (in particular, if it is a simplicial complex), KK, then we have two alternate (but equivalent) definitions displayed below,

χ(K)=i(1)i|Ki|=σK(1)dim(σ).\chi(K)=\sum_{i\in\mathbb{N}}(-1)^{i}|K_{i}|=\sum_{\sigma\in K}(-1)^{\dim(\sigma)}. (5)

The EC definition was generalized to include a weight function [4, 13]. For a weighted simplicial complex (K,ω)(K,\omega), the weighted EC may be defined as

χw(K,ω):=σK(1)dim(σ)ω(σ).\chi_{w}(K,\omega):=\sum_{\sigma\in K}(-1)^{\dim(\sigma)}\omega(\sigma). (6)

We call a function f:Kf\colon K\to\mathbb{R} a filter function if for all tt\in\mathbb{R}, the sublevel set f1(,t]f^{-1}(-\infty,t] is either empty or a simplicial complex. Given a filter function f:Kf\colon K\to\mathbb{R}, we consider filtering KK by ff; that is, we have a nested family of sublevel sets f1(,t]f^{-1}(-\infty,t] for tt\in\mathbb{R}. See Fig. 3(3(a)) for a filtration of the shape in Fig. 2(2(d)) in the direction (1,0)(1,0).

The EC of f1(,t]f^{-1}(-\infty,t] with respect to tt is the Euler characteristic function (ECF), denoted χf:\chi_{f}\colon\mathbb{R}\to\mathbb{Z} and is defined by

χf(t):=σf1(,t](1)dim(σ)=χ(f1(,t]).\chi_{f}(t):=\sum_{\sigma\in f^{-1}(-\infty,t]}(-1)^{\dim(\sigma)}=\chi(f^{-1}(-\infty,t]). (7)

If ff is a lower-star filter in direction ss, then we may use ss in the subscript instead of ff. Given a filter function f:Kf\colon K\to\mathbb{R} and an arbitrary function Ω:K\Omega\colon K\to\mathbb{R}, the weighted Euler characteristic function (WECF) for filter function ff with respect to the weight function Ω\Omega is defined as the function χf,Ω:\chi_{f,\Omega}\colon\mathbb{R}\to\mathbb{R}, where

χf,Ω(t):=σf1(,t](1)dim(σ)Ω(σ).\chi_{f,\Omega}(t):=\sum_{\sigma\in f^{-1}(-\infty,t]}(-1)^{\dim(\sigma)}\Omega(\sigma). (8)

We follow the setting of [13], where ff is a lower-star filter (i.e., a discretized version of a height filter) in a given direction in 𝕊d1\mathbb{S}^{d-1}; see Equation (4). Again, if ff is a lower-star filter in direction ss, then we may use ss in the subscript instead of ff. See Fig. 3 for an example ECF and WECF for a filtered shape.

2.3 Weighted Euler Characteristic Transform

Using an ensemble of directional filter functions, one for each direction in s𝕊1s\in\mathbb{S}^{1}, a parameterized collection of ECFs, the ECT, is defined as the function ECTK:𝕊1×\text{ECT}_{K}\colon\mathbb{S}^{1}\times\mathbb{R}\to\mathbb{Z}, where333The ECT and the WECT can be generalized to higher dimensions, but our setting is focused on 2D images so here we consider directions in 𝕊1\mathbb{S}^{1} only.

ECTK(s,t)=χs(t).\text{ECT}_{K}(s,t)=\chi_{s}(t). (9)

For each direction s𝕊1s\in\mathbb{S}^{1}, we can think of this as a function \mathbb{R}\to\mathbb{Z}, namely χs\chi_{s} described above. No two distinct shapes have the same ECT [18]. Since its introduction, the ECT has developed both in theory and in practice [12, 13, 3, 15, 6].

As noted previously, the WECT is a generalization of the ECT for weighted simplicial complexes, and was introduced in [13]. Let KK be a simplicial complex in 2\mathbb{R}^{2} and let Ω:K\Omega\colon K\to\mathbb{R} be its weight function (note that Ω\Omega need not be a filter function). The WECT for KK assigns to each s𝕊1s\in\mathbb{S}^{1} the function WECTK,Ω(s,t):\text{WECT}_{K,\Omega}(s,t)\colon\mathbb{R}\to\mathbb{Z} defined by:

WECTK,Ω(s,t)=d=02(1)dσKdHs(σ)tΩ(σ)=σKHs(σ)t(1)dim(σ)Ω(σ),\text{WECT}_{K,\Omega}(s,t)=\sum_{d=0}^{2}(-1)^{d}\sum_{\begin{subarray}{c}\sigma\in K_{d}\\ H_{s}(\sigma)\leq t\end{subarray}}\Omega(\sigma)=\sum_{\begin{subarray}{c}\sigma\in K\\ H_{s}(\sigma)\leq t\end{subarray}}(-1)\textsuperscript{dim($\sigma)$}\Omega(\sigma), (10)

where we recall that Hs:KH_{s}\colon K\to\mathbb{R} is the lower-star filter in direction ss. When subscripts are difficult to read, we use WECT(s,t;K,Ω):=WECTK,Ω(s,t)\text{WECT}(s,t;K,\Omega):=\text{WECT}_{K,\Omega}(s,t).

Distances Between WECTs.

Distances between WECTs is necessary for analysis tasks such as classification or inference. To define a distance in our setting, consider two weight functions ω:K\omega\colon K\to\mathbb{R} and ω:K\omega^{\prime}\colon K^{\prime}\to\mathbb{R}, with two WECTs for each direction sSd1s\in S^{d-1} denoted as Ws:W_{s}\colon\mathbb{R}\to\mathbb{N} and Ws:W^{\prime}_{s}\colon\mathbb{R}\to\mathbb{N}, respectively. Since Ws,WsW_{s},W_{s}^{\prime} are \mathbb{N}-valued functions, different distance metric between functions may be considered to compare them. Let ρ:×\rho\colon\mathcal{F}\times\mathcal{F}\to\mathbb{R} be that distance metric, where \mathcal{F} is the space of all functions \mathbb{R}\to\mathbb{N}. Common metrics are induced from the sup norm or the LpL^{p} norm.444The distance proposed in [13] is the standard L2L^{2} norm. Then, we define the distances between two WECTs, W={Ws}s𝕊1W=\{W_{s}\}_{s\in\mathbb{S}^{1}} and W={Ws}s𝕊1W^{\prime}=\{W^{\prime}_{s}\}_{s\in\mathbb{S}^{1}}, as D:𝒲×𝒲D\colon\mathcal{W}\times\mathcal{W}\to\mathbb{R} by integrating the following:

D(W,W):=sSd1ρ(Ws,Ws)ds.D(W,W^{\prime}):=\int_{s\in S^{d-1}}\!\rho(W_{s},W_{s}^{\prime})\,\mathrm{d}s. (11)

2.4 Algorithm and Vectorizing WECTs

In Algorithm 1, we provide the algorithm used to compute the WECT of a given weighted shape image. We recall that the WECT is the family of WECFs, one for each direction in 𝕊1\mathbb{S}^{1}. Computationally, knowing all WECFs is infeasible so often much fewer are used. We first consider how to compute the WECF in one direction, ss, as given in Lines 2-17 for (K,Ω)(K,\Omega).

Algorithm 1 Get-WECT(S,K,,Ω)\textsc{Get-WECT}(S,K,\ell,\Omega)
0:  Directions S𝕊1S\subset\mathbb{S}^{1}; triangulation KK; vertex locations :K02\ell\colon K_{0}\to\mathbb{R}^{2}; weight function Ω:K\Omega\colon K\to\mathbb{R}
0:  vectorized weighted Euler characteristic transform of (K,Ω)(K,\Omega)
1:  for sSs\in S do
2:     Define height function hs:K0h_{s}\colon K_{0}\to\mathbb{R} by hs(v)=s(v)h_{s}(v)=s\cdot\ell(v)
3:     Define Hs:KH_{s}\colon K\to\mathbb{R} as the maximum extension of hsh_{s}
4:     {σ1,σ2,,σn}\{\sigma_{1},\sigma_{2},\ldots,\sigma_{n}\}\leftarrow ordering simplices in KK by HsH_{s} (ties broken arbitrarily)
5:     i0i\leftarrow 0
6:     curheightcurheight\leftarrow-\infty                                     \triangleright current height being processed
7:     χ0\chi\leftarrow 0                                                     \triangleright running Euler characteristic
8:     WECTsWECT_{s}\leftarrow\emptyset
9:     while i<ni<n do
10:        i++i++
11:        if Hs(σi)curheightH_{s}(\sigma_{i})\neq curheight then
12:           Append (curheight,χ)(curheight,\chi) to WECTsWECT_{s}
13:           curheightHs(σi)curheight\leftarrow H_{s}(\sigma_{i})
14:        end if
15:        χ+=(1)dim(σi)Ω(σi)\chi+=(-1)^{\dim(\sigma_{i})}\Omega(\sigma_{i})
16:     end while
17:     WsW_{s}\leftarrow vectorization of WECTsWECT_{s}
18:  end for
19:  return  Concatenation of WsW_{s} for all sSs\in S
Computing a Weighted Euler Characteristic.

The WECF is a step function. To represent it (in the variable WECTsWECT_{s} of Algorithm 1), we use tuples (a,b)(a,b), which is read as “the weighted Euler characteristic of Hs1(,t]H_{s}^{-1}(-\infty,t] for all tt starting at aa until the next tuple is bb.” By storing the two-tuples, we have an exact representation of the WECF.

To compute the WECF of (K,Ω)(K,\Omega) in direction ss, we first compute the filter function (HsH_{s}; defined in Line 3), then order the simplices in non-decreasing function order (Line 4). Considering these simplices in order, we keep a running tally of the EC, and add a two-tuple to WECTsWECT_{s} each time a new height is encountered (Line 12). In the end, we have a list of two-tuples {(hi,Xi)}i{1,2,,N}\{(h_{i},X_{i})\}_{i\in\{1,2,\ldots,N\}}, where h1<h2<<hNh_{1}<h_{2}<\cdots<h_{N}. Then, the WECT for direction ss is:

WECT(s,t;K,Ω)={0t<0Xit[hi,hi+1]XNthN.\text{WECT}(s,t;K,\Omega)=\begin{cases}0&t<0\\ X_{i}&t\in[h_{i},h_{i+1}]\\ X_{N}&t\geq h_{N}.\end{cases} (12)
Vectorizing the WECT.

The exact representation of the WECF, as a piecewise defined function, is challenging to work with for tasks like classification where alignment across different WECFs is needed. So, we choose a vectorization parameter, nvn_{v}, and we vectorize by sampling nvn_{v} uniformly-spaced values over an interval of heights that is context-specific.

We also must choose the directions. One approach is to choose the number of sample directions, nsn_{s}, then select directions whose angles with the positive xx axis are: {0,2πns,22πns,,2π1ns}\{0,\frac{2\pi}{n_{s}},\frac{2\cdot 2\pi}{n_{s}},\ldots,2\pi-\frac{1}{n_{s}}\}. Thus, we have nsn_{s} equally-spaced direction vectors.555More generally, we can choose an ϵ>0\epsilon>0 and use an ϵ\epsilon-net .

To put this all together, in Line 19, we concatenate the WECTs for the different directions in order of increasing angle with the positive xx axis.

Relating Vectorization to Exact WECT.

We define a distance between the vectorized representations such that as the vectorization and sampling variables increases (nvn_{v}\to\infty and nsn_{s}\to\infty, respectively), we approach the distance given in Equation (11). Letting ρ\rho denote the two-norm, we have:

D^(W,W):=sSWECTsWECTs2.\hat{D}(W,W^{\prime}):=\sum_{s\in S}\!||WECT_{s}-WECT_{s}^{\prime}||_{2}. (13)

As a result, if nsn_{s} and nvn_{v} are large enough, we can perform tasks such as clustering on these vectors and approximate working in the original function space itself.

Image Data.

In this paper, KK represents a shape in an n×nn\times n image AA. We describe the input to Algorithm 1 for image data:

  • SS: Select nsn_{s}, the number of sampled directions, then starting with the first direction (0,1)𝕊1(0,1)\in\mathbb{S}^{1}, select nsn_{s} equally-spaced directions over 𝕊1\mathbb{S}^{1}.

  • KK: We use the process described in Section 2.1 to find a subcomplex of the Freudenthal triangulation representing the “shape” in the image.

  • \ell: Throughout this paper, we assume that nn is odd. The n×nn\times n grid of vertex locations (corresponding to centers of pixels) are the integer coordinates in the square [n12,n12]2[-\frac{n-1}{2},\frac{n-1}{2}]^{2}.

  • Ω\Omega: Let ω\omega be the function that takes as input a pixel (vertex of K0K_{0}) and returns the corresponding value of AA. Then, Ω\Omega, is one of the extensions of ω\omega described in Section 2.1.

In the output, we use the parameter nsn_{s} for the number of samples used to vectorize each directional WECF. These values are uniformly sampled over the interval (n12,n12)(-\frac{n-1}{2},\frac{n-1}{2}) if nn is odd.

2.5 Theoretical Results on Expected Weighted Euler Characteristic

In Section 2.1, we discussed several ways to extend a weight function on the vertices to a weighted simplicial complex. Here, we investigate how the choice of extension affects the weighted EC. In what follows, let KK be a two-complex, and let ω:K0\omega\colon K_{0}\to\mathbb{R} be the assignment of intensities to the vertices, drawn independently from a distribution centered at 0.50.5.

2.5.1 Average Extension

Let Ωavg:K\Omega_{\text{avg}}\colon K\to\mathbb{R} be the average extension of ω\omega. For each vertex vK0v\in K_{0}, since the pixel intensity is drawn from a distribution centered at 0.50.5, we know that 𝔼(Ωavg(v))=𝔼(ω(v))=0.5\mathbb{E}(\Omega_{\text{avg}}(v))=\mathbb{E}(\omega(v))=0.5. In the average extension, we recall that the value of an edge and a triangle are

Ωavg([v0,v1])\displaystyle\Omega_{\text{avg}}([v_{0},v_{1}]) =\displaystyle= 12(ω(v0)+ω(v1))\displaystyle\frac{1}{2}\left(\omega(v_{0})+\omega(v_{1})\right) (14)
Ωavg([v0,v1,v2])\displaystyle\Omega_{\text{avg}}([v_{0},v_{1},v_{2}]) =\displaystyle= 13(ω(v0)+ω(v1)+ω(v3)),\displaystyle\frac{1}{3}\left(\omega(v_{0})+\omega(v_{1})+\omega(v_{3})\right), (15)

respectively. And so, by the linearity of expectation, we compute the expectation of the function value on edges and triangles:

𝔼(Ωavg([v0,v1]))=12(𝔼(Ωavg(v0))+𝔼(Ωavg(v1)))=12(0.5+0.5)=0.5\mathbb{E}\left(\Omega_{\text{avg}}([v_{0},v_{1}])\right)=\frac{1}{2}(\mathbb{E}(\Omega_{\text{avg}}(v_{0}))+\mathbb{E}(\Omega_{\text{avg}}(v_{1})))=\frac{1}{2}(0.5+0.5)=0.5 (16)

and

𝔼(Ωavg([v0,v1,v2]))\displaystyle\mathbb{E}(\Omega_{\text{avg}}([v_{0},v_{1},v_{2}])) =\displaystyle= 13(𝔼(Ωavg(v0))+𝔼(Ωavg(v1))+𝔼(Ωavg(v2)))\displaystyle\frac{1}{3}(\mathbb{E}(\Omega_{\text{avg}}(v_{0}))+\mathbb{E}(\Omega_{\text{avg}}(v_{1}))+\mathbb{E}(\Omega_{\text{avg}}(v_{2}))) (17)
=\displaystyle= 13(0.5+0.5+0.5)=0.5.\displaystyle\frac{1}{3}(0.5+0.5+0.5)=0.5. (18)

Thus, for any σK\sigma\in K, we have shown that 𝔼(Ωavg(σ))=0.5\mathbb{E}(\Omega_{\text{avg}}(\sigma))=0.5, regardless of the distribution from which the pixel intensities were drawn (as long as that distribution is centered at 0.50.5).

To compute the expected weighted EC, we again use linearity of expectation to find:

𝔼(χw(K,Ωavg))\displaystyle\mathbb{E}\left(\chi_{w}(K,\Omega_{\text{avg}})\right) =𝔼(σK(1)dim(σ)Ωavg(σ))\displaystyle=\mathbb{E}\left(\sum_{\sigma\in K}(-1)^{\dim(\sigma)}\Omega_{\text{avg}}(\sigma)\right) (19)
=σK(1)dim(σ)𝔼(Ωavg(σ))\displaystyle=\sum_{\sigma\in K}(-1)^{\dim(\sigma)}\mathbb{E}(\Omega_{\text{avg}}(\sigma)) (20)
=12σK(1)dim(σ)\displaystyle=\frac{1}{2}\sum_{\sigma\in K}(-1)^{\dim(\sigma)} (21)
=12χ(K)\displaystyle=\frac{1}{2}\chi(K) (22)

Thus, the expected weighted EC relies (not surprisingly) on computing the EC, which, by Equation Equation (5), we know if we have the number of simplices of each dimension.

Example 1 (Square Image with Average Extension) Consider an n×nn\times n random image, where the pixels of the image are drawn independently from a distribution centered at 0.50.5. Let KK be the corresponding Freudenthal triangulation. Let ω:K0[0,1]\omega\colon K_{0}\to[0,1] be this assignment of values to the vertices/pixels. Counting the simplices, we have n2n^{2} vertices (one centered in each pixel), (n1)n(n-1)n horizontal edges, (n1)n(n-1)n vertical edges, (n1)2(n-1)^{2} diagonal edges, and 2(n1)22(n-1)^{2} triangles. And so, the EC, χ(K)\chi(K), is:

χ(K)\displaystyle\chi(K) =n22(n1)n(n1)2+2(n1)2\displaystyle=n^{2}-2(n-1)n-(n-1)^{2}+2(n-1)^{2} (23)
=(3n24n+2)(3n24n+1)\displaystyle=(3n^{2}-4n+2)-(3n^{2}-4n+1) (24)
=1.\displaystyle=1. (25)

Plugging this into Equation (22), we find that the expected weighted EC for a square image is 0.50.5, regardless of the size of the image. In fact, any random image whose support has trivial homology (i.e., no holes in the image), has the same expected weighted EC. Note that this only assumes that all the pixels are drawn independently from a distribution centered at 0.50.5.

The shapes that we are interested in are subcomplexes of the n×nn\times n image obtained by thresholding on intensities. Thus, a complex may have some pixels not included (and hence any edge/triangle they are incident to not included), resulting in different ECs. Therefore, the corresponding expected weighted EC would be different for different shapes.

2.5.2 Maximum and Minimum Extension

Unlike the average extension, the expected value of the weighted EC for the maximum and minimum extensions are dependent on the distribution of the pixel intensities. Assuming the pixel intensities are drawn from a U(0,1)U(0,1), the distribution of the kkth order statistic, Y(k)Y_{(k)}\simBeta(k,n+1k)(k,n+1-k), where nn is the number of vertex intensities considered.666For more details about distributions of order statistics under different underlying distributions (beyond the uniform distribution), see [7]. In particular, Y(1)Y_{(1)} is the minimum and Y(n)Y_{(n)} is the maximum. The expected value of Y(k)Y_{(k)} is kn+1\frac{k}{n+1}. Therefore, the expectation of the function value on edges and triangles for the maximum extensions are:

𝔼(Ωmax([v0,v1]))=𝔼(max(ω(v0),ω(v1)))=23,\mathbb{E}\left(\Omega_{\text{max}}([v_{0},v_{1}])\right)=\mathbb{E}\left(\max(\omega(v_{0}),\omega(v_{1}))\right)=\frac{2}{3}, (26)

and

𝔼(Ωmax([v0,v1,v2]))=𝔼(max(ω(v0),ω(v1),ω(v2)))=34.\mathbb{E}(\Omega_{\text{max}}([v_{0},v_{1},v_{2}]))=\mathbb{E}\left(\max(\omega(v_{0}),\omega(v_{1}),\omega(v_{2}))\right)=\frac{3}{4}. (27)

(Using the minimum extension, we also have the 𝔼(Ωmin([v0,v1]))=13\mathbb{E}\left(\Omega_{\text{min}}([v_{0},v_{1}])\right)=\frac{1}{3} and the 𝔼(Ωmin([v0,v1,v2]))=14\mathbb{E}(\Omega_{\text{min}}([v_{0},v_{1},v_{2}]))=\frac{1}{4}.) Then, the expected value of the weighted EC is

𝔼(χw(K,Ωmax))\displaystyle\mathbb{E}\left(\chi_{w}(K,\Omega_{\text{max}})\right) =𝔼(σK(1)dim(σ)Ωmax(σ))\displaystyle=\mathbb{E}\left(\sum_{\sigma\in K}(-1)^{\dim(\sigma)}\Omega_{\text{max}}(\sigma)\right) (28)
=σK(1)dim(σ)𝔼(Ωmax(σ))\displaystyle=\sum_{\sigma\in K}(-1)^{\dim(\sigma)}\mathbb{E}(\Omega_{\text{max}}(\sigma)) (29)
=iσKi(1)dim(σ)(i+1i+2)\displaystyle=\sum_{i\in\mathbb{N}}\sum_{\sigma\in K_{i}}(-1)^{\dim(\sigma)}\left(\frac{i+1}{i+2}\right) (30)
=i(1)i(i+1i+2)|Ki|.\displaystyle=\sum_{i\in\mathbb{N}}(-1)^{i}\left(\frac{i+1}{i+2}\right)|K_{i}|. (31)

We return to the example of the n×nn\times n image.

Example 2 (Square and Rectangular Images with Maximum and Minimum Extensions) Considering the same example of an n×nn\times n image from Example 2.5.1, the expected value of the weighted EC using the maximum extension is

𝔼(χw(K,Ωmax))\displaystyle\mathbb{E}(\chi_{w}(K,\Omega_{\text{max}})) =(12)n2(23)(3n24n+1)+(34)(2)(n1)2\displaystyle=\left(\frac{1}{2}\right)n^{2}-\left(\frac{2}{3}\right)(3n^{2}-4n+1)+\left(\frac{3}{4}\right)(2)(n-1)^{2} (32)
=52n6.\displaystyle=\frac{5-2n}{6}. (33)

For the minimum extension, 𝔼(χw(K,Ωmin))=2n+16\mathbb{E}(\chi_{w}(K,\Omega_{\text{min}}))=\frac{2n+1}{6}. More generally, the expected weighted EC for an n×mn\times m image using the maximum extension is 5nm6\frac{5-n-m}{6} and using the minimum extension is n+m+16\frac{n+m+1}{6}. Notice that if n=1n=1, both 𝔼(χw(K,Ωmax))=𝔼(χw(K,Ωmin))=1/2\mathbb{E}(\chi_{w}(K,\Omega_{\text{max}}))=\mathbb{E}(\chi_{w}(K,\Omega_{\text{min}}))=1/2 because there is only one vertex and no higher order simplexes.

2.5.3 Expected WECT

The expected WECT can be derived by looking at each direction independently and extending the ideas from above. For example, if the pixel intensity distribution is centered at 0.50.5 and Ω:K\Omega\colon K\to\mathbb{R} is the weight function, then the expected WECF for direction s𝕊1s\in\mathbb{S}^{1} is a function \mathbb{R}\to\mathbb{R} that takes tt\in\mathbb{R} and maps it to 𝔼(WECTK(s,t,Ωavg))\mathbb{E}\left(\text{WECT}_{K}(s,t,\Omega_{\text{avg}})\right).

In particular, for the average extension, we have:

𝔼(WECTK(s,t,Ωavg))\displaystyle\mathbb{E}\left(\text{WECT}_{K}(s,t,\Omega_{\text{avg}})\right) =𝔼(χs,Ωavg(t))\displaystyle=\mathbb{E}\left(\chi_{s,\Omega_{\text{avg}}}(t)\right) (34)
=σKHs(σ)t(1)dim(σ)𝔼(Ωavg(σ))\displaystyle=\sum_{\begin{subarray}{c}\sigma\in K\\ H_{s}(\sigma)\leq t\end{subarray}}(-1)^{\dim(\sigma)}\mathbb{E}\left(\Omega_{\text{avg}}(\sigma)\right) (35)
=12σKHs(σ)t(1)dim(σ)\displaystyle=\frac{1}{2}\sum_{\begin{subarray}{c}\sigma\in K\\ H_{s}(\sigma)\leq t\end{subarray}}(-1)^{\dim(\sigma)} (36)
=12χ(Ωavg1(,t]),\displaystyle=\frac{1}{2}\chi(\Omega_{\text{avg}}^{-1}(-\infty,t]), (37)

where we recall that Hs:KH_{s}\colon K\to\mathbb{R} is the lower-star filter in direction ss.

For the maximum extension, we have:

𝔼(WECTK(s,t,Ωmax))\displaystyle\mathbb{E}\left(\text{WECT}_{K}(s,t,\Omega_{\text{max}})\right) =𝔼(χs,Ωmax(t))\displaystyle=\mathbb{E}\left(\chi_{s,\Omega_{\text{max}}}(t)\right) (38)
=σKHs(σ)t(1)dim(σ)𝔼(ω(σ))\displaystyle=\sum_{\begin{subarray}{c}\sigma\in K\\ H_{s}(\sigma)\leq t\end{subarray}}(-1)^{\dim(\sigma)}\mathbb{E}\left(\omega(\sigma)\right) (39)
=iσKiHs(σ)t(1)dim(σ)(i+1i+2)\displaystyle=\sum_{i\in\mathbb{N}}\sum_{\begin{subarray}{c}\sigma\in K_{i}\\ H_{s}(\sigma)\leq t\end{subarray}}(-1)^{\dim(\sigma)}\left(\frac{i+1}{i+2}\right) (40)
=i(i+1i+2)σKiHs(σ)t(1)i\displaystyle=\sum_{i\in\mathbb{N}}\left(\frac{i+1}{i+2}\right)\sum_{\begin{subarray}{c}\sigma\in K_{i}\\ H_{s}(\sigma)\leq t\end{subarray}}(-1)^{i} (41)
=i(i+1i+2)(1)i|Ki(t)|,\displaystyle=\sum_{i\in\mathbb{N}}\left(\frac{i+1}{i+2}\right)(-1)^{i}|K_{i}(t)|, (42)

where we use Ki(t)K_{i}(t) to denote the set of ii-simplices σK\sigma\in K such that Hs(σ)tH_{s}(\sigma)\leq t.

Example 3 (Square Image) Extending the example of an n×nn\times n image with the maximum extension from Example 2.5.2. Let s𝕊1s\in\mathbb{S}^{1} and Ω=Ωavg\Omega=\Omega_{\text{avg}}. Let h0=minσKΩ(σ)h_{0}=\min_{\sigma\in K}\Omega(\sigma). Then, the expected WECF in direction ss is the function \mathbb{R}\to\mathbb{R} defined by

t{0t<h00.5th0t\mapsto\begin{cases}0&t<h_{0}\\ 0.5&t\geq h_{0}\end{cases} (43)

Now, consider s=(0,1)s=(0,1), Ω=Ωmax\Omega=\Omega_{\text{max}}, and nn odd. Note that, the range of the height function HsH_{s} is {n12,n121,,1,0,1,,n12}\{-{\frac{n-1}{2}},-{\frac{n-1}{2}}-1,\ldots,-1,0,1,\ldots,{\frac{n-1}{2}}\}. Letting mtm_{t} denote the number of columns in the image (that is, mt=t+n12m_{t}=\lceil t\rceil+\frac{n-1}{2}), the expected WECF in direction ss is the function \mathbb{R}\to\mathbb{R} defined by

t{0t<n1216(5nmt)t(n12,n12)52n6tn12.t\mapsto\begin{cases}0&t<-\frac{n-1}{2}\\ \frac{1}{6}(5-n-m_{t})&t\in(-\frac{n-1}{2},\frac{n-1}{2})\\ \frac{5-2n}{6}&t\geq\frac{n-1}{2}.\end{cases} (44)

A simple check shows that this equation is continuous. The middle equation comes from the fact that K(t):={σK|Hs(σ)t}K(t):=\{\sigma\in K~{}|~{}H_{s}(\sigma)\leq t\} is a rectangular image that is nn pixels tall and mt=tn12m_{t}=\lceil t\rceil-\frac{n-1}{2} pixels wide.

3 Empirical Study

In this section, we assess the performance of using WECTs to represent images generated under different weight distributions for the pixel intensities, different domain shapes, and different function extensions for assigning weights to the simplexes. We then build classification models for each pair of image types in order to evaluate the informativeness of WECTs. Rather than seeking to minimize the misclassification rate, the goal is to understand how changing intensity distributions affects the classification performance.

3.1 Data Sets

We generated image datasets using the following parameters: shape, pixel intensity distribution, and function extension (see Equations (1)-(3)). The domain of an image is a 65×6565\times 65 grid centered at (0,0)(0,0), with vertices on an integer lattice, triangulated using the Freudenthal triangulation [11]; see Fig. 2(2(c)).

Refer to caption
(a) Disc
Refer to caption
(b) Square
Refer to caption
(c) Tetris
Refer to caption
(d) Annulus
Refer to caption
(e) Clusters
Refer to caption
(f) Swiss cheese
Refer to caption
(g) Square annulus
Refer to caption
(h) Intensity scale
Figure 4: Examples of image shapes. The simulation study includes the following shapes illustrated here: (a) disc, (b) square, (c) Tetris, (d) annulus, (e) clusters, (f) Swiss cheese, and (g) square annulus. The intensity weights were drawn from a U(0,1)U(0,1) distribution, but three normal distributions are also considered in the study. The intensity scale is shown in subfigure (h).
Shape.

The shapes are the domain of the image pixels with positive intensity. We consider the following shapes: disc, annulus, square, Tetris, clusters, and Swiss cheese; see Fig. 4 for example images of these shapes. When creating these shapes, we ensure that they have approximately the same number of non-zero pixel intensities (of the 42254225 pixels in the 65×6565\times 65 grid); see Table 1.

Table 1: Number of nonzero pixels for each shape in the 65×6565\times 65 grid.
Shape Nonzero Pixels
Disc 12571257
Square 12251225
Tetris 12491249
Annulus 12121212
Clusters 11251125
Swiss Cheese 14951495
Square Annulus 12961296
Refer to caption
Figure 5: The probability densities for the four pixel intensity distributions are displayed. The normal distributions are truncated to (0,1)(0,1).
Pixel Intensity.

We consider four weight distributions for the pixel intensities: a uniform and three truncated normal distribution with different standard deviations. The uniform distribution takes values greater in the interval (0,1](0,1], and is denoted U(0,1)U(0,1). The truncated normal is centered at μ=0.5\mu=0.5 with a standard deviation of σ\sigma, N(0.5,σ)N(0.5,\sigma), and truncated to take values in the interval (0,1](0,1]. The σ\sigma takes three values so that μ±iσ\mu\pm i\sigma, for i=1,2,3i=1,2,3, is (approximately) the support, (0,1](0,1]; in other words, we consider the distributions N(0.5,0.17)N(0.5,0.17), N(0.5,0.25)N(0.5,0.25), and N(0.5,0.5)N(0.5,0.5). Fig. 5 displays the probability densities for these distributions. Notice that as the σ\sigma increases, the distribution of the weights looks more like those of a U(0,1)U(0,1), and therefore, when doing binary classification, the misclassification rate should increase as U(0,1)U(0,1) is compared to N(0.5,σ)N(0.5,\sigma) with σ\sigma increasing. Fig. 6 includes an example of an annulus with pixel intensities drawn from a U(0,1)U(0,1) distribution and from a N(0.5,0.17)N(0.5,0.17) distribution.

Refer to caption
(a) weightU(0,1)\sim U(0,1)
Refer to caption
(b) weightN[0.5,0.17]\sim N[0.5,0.17]
Figure 6: An example image of an annulus with pixel intensities drawn from the distributions (6(a)U(0,1)U(0,1) and (6(a)N(0.5,0.17)N(0.5,0.17).
Function Extension.

For these experiments, we consider the maximum and average extensions (Equations (1) and (3), respectively) for the weight functions to evaluate differences in classification performance.

3.2 Classification Methods

The seven shapes, four distributions, and two function extensions define 56 image classes. The WECT is evaluated on the task of binary classification using support vector machines (SVM) [5] and KK-nearest-neighbors [10]. For each classification model, 250 images (half from each class) are independently generated, with 80 percent of the images (200 images) used for training and the remaining 20 percent (50 images) used for testing. To approximate the WECT, we sample equally-spaced directions from 𝕊1\mathbb{S}^{1}. We discuss results below for choosing different numbers of directions from 𝕊1\mathbb{S}^{1}. To vectorize each WECF, 9191 equally-spaced threshold values from 45-45 to 4545 are considered. This ensures that there is at least one discretization value for each height threshold in any direction of filtration.

Implementation.

The simulation study was implemented in Python, using the Dionysus 2 library [16]. For classification tasks using SVM, we train an SVM separately for each binary classification model. All SVMs in this work use a regularization parameter of value 20. The classification was done using an SVM classifier library from Scikit-learn [17]. For classification tasks using KK-nearest-neighbors, a simple Python implmentation was created using our implementation of the WECT distance function.

3.3 Results

Refer to caption
Figure 7: The WECT in one direction s=1,0s=\langle 1,0\rangle for four different probability distributions on a square using the Ωavg\Omega_{\text{avg}} extension. Each of the four distributions matches the expected WECT (the dotted line). Note that the entire vectorization occurs on the interval [45,45][-45,45], but for this direction the WECT is zero until height t=17t=-17 and remains constant after height t=17t=17.

To better understand the WECT, we considered several experiments that provide insight into how different factors affect the WECT and the information it encodes. In particular, we analyze changes in the number of directions, pixel intensity distributions, function extensions, and use of the WECT vs. the vectorized WECT. However, first, as Fig. 7 demonstrates, we verify that for all four pixel intensity distributions, the computation of the WECT matches the theoretical expectation given in Equation (37).

Refer to caption
Figure 8: Classification accuracy of the U(0,1)U(0,1) image against the N(0.5,0.25)N(0.5,0.25) image for each shape across varying numbers of directions of filtration using SVM and the average function extension. As expected, increasing the number of directions had minimal effect on the classifier for shapes with no structural orientation (such as the Disc and Annulus). The Swiss Cheese and Clusters shapes also do not appear to be affected by changing the number of directions. However, the Square, Square Annulus, and Tetris all encoded more information as the number of directions increased.

Next, we analyze how changing the number of directions of the filtration impacts the ability of the WECT to capture information about the underlying image. In order to do so, the following classification task was executed using the SVM classifier. For each shape, the U(0,1)U(0,1) image was compared against the N(0.5,25)N(0.5,25) in a binary classification task for a varying number of directions. The average function extension was used when computing the WECTs. For a given shape, if the WECT successfully encoded the structure of the two different images, the classification accuracy is closer to one. The classifier accuracy was tested on all the shapes for 2,3,5,8,152,3,5,8,15 and 3030 directions. As Fig. 8 shows, as the number of directions increases, accuracy of the classifier improved only for some shapes. In order to balance an increase of encoded information in the WECT with computational cost, the remainder of the experiments are executed using 15 directions.

Refer to caption
(a) Maximum Extension
Refer to caption
(b) Average Extension
Figure 9: Binary testing classification accuracy (percentage of correct classifications out of the 50 test images) using a SVM of the classes indicated by the pixel intensity distribution (x-axis) and image shape (color) versus the same image shape with U(0,1)U(0,1) pixel intensities. The U(0,1)U(0,1) on the x-axis is a control setting where the accuracy should be around 0.50.5 since the two classes considered in the model have the same image shape and the same pixel intensity distribution. Note that the other combinations of classes are excluded here because the accuracy was nearly perfect (greater than 0.990.99) regardless of the pixel intensity distribution.

In order to gain a deeper understanding of the WECT properties, we conducted experiments to observe how changing pixel intensity distributions in various filtration directions affect its behavior. Again, we examined the WECT’s capacity to extract image information through binary classification tasks using an SVM classifier. For each shape, we consider the task of binary classification of WECTs in 1515 directions from each of the four distributions against the WECT from the U(0,1)U(0,1) distribution. All pairwise classification models were considered, but when image shape differed the classifier performed nearly perfect regardless of the pixel intensity distribution so those results are not summarized further. Results where the two classes have the same shape can be found in Fig. 9 for both function extensions. As anticipated, the accuracy of the classifier for U(0,1)U(0,1) against U(0,1)U(0,1) is roughly random, U(0,1)U(0,1) against N(0.5,0.17)N(0.5,0.17) is nearly perfect, U(0,1)U(0,1) against N(0.5,0.25)N(0.5,0.25) is slightly worse, and U(0,1)U(0,1) against N(0.5,0.5)N(0.5,0.5) is barely better than random. Ultimately, the decrease in accuracy as the normal distribution becomes more similar to the uniform distribution (i.e., as σ\sigma increases) demonstrates that the WECT encodes information about the pixel intensity distribution. In other words, the WECT captures and encodes structural information from the images that is not encoded by the ECT.

Next, we compare the results using the maximum function extension (Fig. 9(a)) and the average function extension (Fig. 9(b)). Overall, across nearly all the distributions, the classifier performs better on WECTs computed using the maximum function extension as opposed to the average function extension. As the distributions differ more at their extremes in the current setting, it is likely that the maximum function extension better emphasizes these differences, which in turn increases the accuracy of the classifier.

Refer to caption
(a) Maximum Extension
Refer to caption
(b) Average Extension
Figure 10: The average WECT for one direction s=1,0s=\langle 1,0\rangle of the 250 generated images of the square. The colored bands indicate the region within one standard deviation of the mean. Observe that the WECT changes at t=17t=-17, where the height filtration passes the left side of the square, and stops changing at t=17t=17, where the height filtration passes the right side of the square. The WECT for all distributions follow a similar pattern. For the maximum extension, as the normal distribution becomes more uniform, the corresponding WECT approaches the WECT from the uniform distribution.

To better understand the classification performance in the above experiments, we consider visualizations of the WECT for the setting that considers fifteen directions. Fig. 10 displays the average WECT in one direction of 250 generated images under the two different function extensions. The shaded region indicates the values within one standard deviation of the mean. For both function extensions, the average WECT generally follows the same pattern, but the values of the WECT depend on the distribution of the pixel intensities. The WECT using the U(0,1)U(0,1) distribution generally has the lowest values, and the WECT using the N(0.50,0.50)N(0.50,0.50) and distribution tends to have slightly greater values, then N(0.50,0.25)N(0.50,0.25), and finally the N(0.50,0.17)N(0.50,0.17) distribution tends to have the highest values. These results hold also for the rest of the shapes, as indicated in Fig. 11 and Fig. 12. This, along with the classification results, indicate that incorporating the weights into the ECT is important for distinguishing images generated under different intensity distributions. Note also that the average WECT for different shape classes have varying levels and patterns of smoothness, which reveals why the classification rate between different shapes is nearly perfect.

Refer to caption
(a) Disc
Refer to caption
(b) Annulus
Refer to caption
(c) Square Annulus
Refer to caption
(d) Tetris
Refer to caption
(e) Clusters
Refer to caption
(f) Swiss cheese
Figure 11: The average WECT for one direction of the 250 images generated using the maximum extension. Note that the y-axis scales differ among the plots to better observe small-scale features of the functions. The WECTs corresponding to the normal distributions approach the WECT corresponding to the uniform distribution as the normal distribution becomes closer to uniform. Additionally, similar shapes have similar patterns, such as the two versions of the annulus.
Refer to caption
(a) Disc
Refer to caption
(b) Annulus
Refer to caption
(c) Square Annulus
Refer to caption
(d) Tetris
Refer to caption
(e) Clusters
Refer to caption
(f) Swiss cheese
Figure 12: The average WECT for one direction of the 250250 images generated using the average extension. Observe similarities in similar shapes, like the two versions of the annulus. Additionally, the symmetry between the Clusters and the Swiss cheese shapes is evident in the WECTs. Note that y-axis scales differ.
Refer to caption
Figure 13: Binary classification of the four distributions against the U(0,1)U(0,1) distribution for each shape using KNN. The WECTs were computed in eight directions using the maximum function extension. Note that experiments were restricted to the eight direction case due to the high computational cost. The trend matches that of SVM using the vectorized WECTs in previous experiments, indicating that the WECT distance and vectorized WECT encode similar information about the underlying images.

A final result is the use of the true (non-vectorized) WECT in the classification experiments. As explained in Section 2.3, one can compute a distance between two WECTs by integrating the difference between the piecewise WECFs in each direction (and taking the maximum difference across all directions). Thus, a natural extension use of this distance is in a nonparametric classification method such as KK-nearest-neighbors (KNN). Fig. 13 summarizes results for the KNN classifier based on the WECT distance with K=5K=5 for eight directions with the maximum extension. In general, it appears that performance of SVM was better in these binary classification tasks. Extensive experiments with KNN were less feasible due to the high computational cost of nonparametric methods. However, the focus is not on using the WECT as a classifier, but instead using the classification tasks to understand the information that is encoded in the WECT. For both methods, we observe a decrease in accuracy as the pixel intensity distribution becomes more similar, which indicates that both the vectorized WECT and the WECT distance successfully encode underlying information about the image.

4 Conclusion

While the ECT has been successful at summarizing shapes in a variety of contexts, image data poses a unique challenge because the pixel intensities potentially carry significant and relevant information. The WECT was proposed to generalize the ECT and allow for the incorporation of pixel intensities as weights. However, the intuition and interpretation of the WECT is not as clear. In this paper, we explored using the WECT to represent shapes found in images, and developed an understanding of the importance of the weights. Indeed, we found that the WECT captured more than the EC and the ECF alone. This was especially important when images have the same shape, but different intensity distributions as assessed in our empirical study. As the intensity distributions become more similar between two classes that have the same shape, the test classification accuracy decreases. When the two classes had different image shapes, the WECT correctly classified new images perfectly (or almost perfectly with test classification accuracy greater than 0.99). While we limited our classification models to SVM, and explored KNN models, WECTs can be used in other classification models.

The effect on changing inputs to the WECT was also explored. Two function extensions, the maximum and average function extensions, were considered. Though the maximum function extension outperformed the average function extension in our settings, this was likely dependent on the pixel intensity distributions considered. In particular, the four distributions (U(0,1)U(0,1), N(0.5,0.17)N(0.5,0.17)N(0.5,0.5)N(0.5,0.5), and N(0.5,5)N(0.5,5); all truncated to (0,1](0,1]) had averages of 0.50.5 so differences were near the extremes (near zero or one). Therefore, the maximum function extension would amplify these differences better than the average.

We also explored how the test classification accuracy changed with different numbers of directions considered. Shapes with rotational symmetry did not benefit from increasing the number of directions, while those without rotational symmetry did benefit. How to appropriately select the number of directions in this setting is an open question that will be explored in future work.

Though classification was explored in this paper, the WECT could also be used for inference tasks such as hypothesis testing. In light of this, we developed equations for the expected weighted EC and expected WECT for images, which may be useful for developing test statistics in future studies. While we have found a clear benefit in using the WECT for image classification when the pixel intensity distributions differ, questions remain regarding its advantage for inference or for different data types.

References

  • [1] P. Alexandroff, Diskrete raume, Mathematiceskii Sbornik, 2 (1937), pp. 501–519.
  • [2] E. J. Amézquita, M. Y. Quigley, T. Ophelders, J. B. Landis, D. Koenig, E. Munch, and D. H. Chitwood, Measuring hidden phenotype: Quantifying the shape of barley seeds using the Euler characteristic transform, in silico Plants, 4 (2022), p. diab033.
  • [3] E. Berry, Y.-C. Chen, J. Cisewski-Kehe, and B. T. Fasy, Functional summaries of persistence diagrams, Journal of Applied and Computational Topology, 4 (2020), pp. 211–262.
  • [4] L. M. Betthauser, Topological reconstruction of grayscale images, PhD thesis, University of Florida, 2018.
  • [5] C. Cortes and V. Vapnik, Support-vector networks, Machine learning, 20 (1995), pp. 273–297.
  • [6] L. Crawford, A. Monod, A. X. Chen, S. Mukherjee, and R. Rabadán, Predicting clinical outcomes in glioblastoma: an application of topological and functional data analysis, Journal of the American Statistical Association, 115 (2020), pp. 1139–1150.
  • [7] H. A. David and H. N. Nagaraja, Order statistics, John Wiley & Sons, 2004.
  • [8] T. K. Dey and Y. Wang, Computational Topology for Data Analysis, Cambridge University Press, 2022.
  • [9] H. Edelsbrunner and J. Harer, Computational Topology: An Introduction, American Mathematical Soc., 2010.
  • [10] E. Fix and J. L. Hodges, Discriminatory analysis. nonparametric discrimination: Consistency properties, International Statistical Review / Revue Internationale de Statistique, 57 (1989), pp. 238–247.
  • [11] H. Freudenthal, Simplizialzerlegungen von beschrankter flachheit, Annals of Mathematics, (1942), pp. 580–582.
  • [12] R. Ghrist, R. Levanger, and H. Mai, Persistent homology and Euler integral transforms, Journal of Applied and Computational Topology, 2 (2018), pp. 55–60.
  • [13] Q. Jiang, S. Kurtek, and T. Needham, The weighted Euler curve transform for shape and image analysis, in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, 2020, pp. 844–845.
  • [14] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner, Gradient-based learning applied to document recognition, Proceedings of the IEEE, 86 (1998), pp. 2278–2324.
  • [15] L. Marsh, F. Y. Zhou, X. Quin, X. Lu, H. M. Byrne, and H. A. Harrington, Detecting temporal shape changes with the euler characteristic transform, 2022. arXiv preprint arXiv:2212.10883.
  • [16] D. Morozov, Dionysus 2. https://mrzv.org/software/dionysus2/.
  • [17] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay, Scikit-learn: Machine learning in Python, Journal of Machine Learning Research, 12 (2011), pp. 2825–2830.
  • [18] K. Turner, S. Mukherjee, and D. M. Boyer, Persistent homology transform for modeling shapes and surfaces, Information and Inference: A Journal of the IMA, 3 (2014), pp. 310–344.
  • [19] H. Wagner, C. Chen, and E. Vuçini, Efficient computation of persistent homology for cubical data, in Topological methods in data analysis and visualization II, Springer, 2012, pp. 91–106.