Randomness and Statistical Inferenceof Shapes via the
Smooth Euler Characteristic Transform
Kun Meng(Mike)
Division of Applied Mathematics
Brown University

June 27, 2023

joint work with themProf. Ani Eloyan(Biostatistics@Brown)

Kun Meng (Brown University)

Prof. Lorin Crawford(Microsoft & Biostatistics@Brown)

Shapes via SECTMr. Jinyu Wang
(Data Science@Brown)

June 27, 2023

2 / 31

1

Motivation (from the morphology viewpoint)

2

Statistical Methodology (not mathematically rigorous)

3

Applications

4

Mathematical Foundations

Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

3 / 31Section 1: Motivation.
(from the morphology viewpoint)

Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

4 / 31

Motivation: Are the teeth from the same species?

Figure 1: We have four collections of teeth =⇒ four groups of shapes.

Question: Are the four collections of teeth from the same species?
Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

5 / 31

Toy example: Are the shapes from the same
distribution?
P(1) and P(2) are shape-generating distributions, i.e., they generate“shape-valued” random variables.
iid

iid

100 blue shapes ∼ P(1) ; 100 pink shapes ∼ P(2) ;Question: P(1) = P(2) ?
To be equal, or not to be, that is the hypothesis testing question.
Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

6 / 31Section 2: Statistical Methodology.
(not mathematically rigorous)

Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

7 / 31

Smooth Euler1 Characteristic Transform (SECT)
Each shape is denoted by K.
We assume K ⊂ B(0, R) = {x ∈ Rd : ∥x∥ < R} which denotes a
closed ball centered at the origin with a prespecified radius R > 0.
For each direction ν ∈ Sd−1 = {x ∈ Rd : ∥x∥ = 1}, we define acollection of sublevel sets of K bydef

Ktν = {x ∈ K|x · ν ≤ t − R},1for all t ∈ [0, T ],where T = 2R.

‘oi-ler’Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

8 / 31

Smooth Euler Characteristic Transform (SECT)
We have the Euler characteristic transform (ECT)2 of shape K
ECT(K) : Sd−1 × [0, T ] → Z,
(ν, t) 7→ χ(Ktν ),defχ(Ktν ) = the Euler characteristic of Ktν .
E.g., Euler characteristic (a mesh) = #vertice−#edges+#faces.
The smooth Euler characteristic transform (SECT)3 is defined as
SECT(K) : Sd−1 × [0, T ] → R, (ν, t) 7→ SECT(K)(ν; t),
Z t
Z T
t
def
where SECT(K)(ν; t) =χ(Kτν ) dτ −χ(Kτν ) dτ .
T 0
02

K. Turner, S. Mukherjee, and D. M. Boyer. Persistent homology transform formodeling shapes and surfaces. Information and Inference: A Journal of the IMA,
3(4):310–344, 2014b.
3
L. Crawford, A. Monod, A. X. Chen, S. Mukherjee, and R. Rabadan. Predicting
clinical outcomes in glioblastoma: an application of topological and functional data
analysis. Journal of the American Statistical Association, 115 (531):1139–1150, 2020.
Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

9 / 31

Smooth Euler Characteristic Transform (SECT)
Shape → scalar field on Sd−1 × [0, T ]Scalar field (ν, t) 7→ SECT(K)(θ; t), where ν = (cos θ, sin θ) ∈ S1 .
Shape analysis → manifold learning4
Imaging data → functional data
4

Kun Meng and Ani Eloyan. Principal manifold estimation via model complexity
selection. Journal of the Royal Statistical Society. Series B, Statistical Methodology,
83(2):369, 2021.
Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

10 / 31

Smooth Euler Characteristic Transform (SECT)The shape-to-SECT map is invertible5 , which was proved using
o-minimal structures6 and the Schapira’s inversion formula7 .
Therefore, SECT(K) preserves all the information of the shape K.
Contribution of this project: If the shape K is random,(ν, t) 7→ SECT(K)(ν; t) is a random field indexed by Sd−1 × [0, T ];for each direction ν, the function t 7→ SECT(K)(ν; t) is astochastic process indexed by t ∈ [0, T ].
5

R. Ghrist, R. Levanger, and H. Mai. Persistent homology and Euler integral
transforms. Journal of Applied and Computational topology, 2, pages55–60 (2018).
6
Lou van den Dries. Tame Topology and O-minimal Structures. London MathematicalSociety Lecture Note Series. Cambridge University Press, 1998.
7
P. Schapira. Tomography of constructible functions. In Applied Algebra, Algebraic
Algorithms and Error-Correcting Codes: 11th International Symposium, AAECC-11 Paris,
France, July 17–22, 1995 Proceedings 11, pages 427–435. Springer, 1995
Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

11 / 31Hypothesis Testing: To be equal or not to be?
Suppose we have two underlying distributions P(1) and P(2)generating random shapes.
We want to test “ P(1) = P(2) .”Then, we have two collections of mean functions(j)m(j)ν (t) = E {SECT(·)(ν; t)} =Z{SECT(K)(ν; t)} P(j) (dK),for j ∈ {1, 2}, t ∈ [0, T ] and ν ∈ Sd−1 .
We test the following weaker form using the first moments(2)d−1
H0 : m(1)× [0, T ]
ν (t) = mν (t) for all (ν, t) ∈ S(2)
vs. H1 : m(1)
ν (t) ̸= mν (t) for some (ν, t).

One may be only concerned with the discrepancy between means.
Or, from another viewpoint, rejecting H0 implies P(1) ̸= P(2) .
Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

12 / 31Hypothesis Testing
The following involves infinitely many directions ν ∈ Sd−1(2)
d−1
H0 : m(1)× [0, T ]
ν (t) = mν (t) for all (ν, t) ∈ S(2)
vs. H1 : m(1)
ν (t) ̸= mν (t) for some (ν, t).nConsidering all the directions would induce an infeasible
multiple-comparison problem.
We only investigate the following “distinguishing direction”()
defν ∗ = arg max

ν∈Sd−1= arg maxν∈Sd−1(2)
sup m(1)ν (t) − mν (t)t∈[0,T ](2)m(1)ν − mν

C([0,T ]).

One may rigorously show that it suffices to focus on direction ν ∗ .
Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

13 / 31

Covariance Kernels
We focus on one distinguishing direction ν ∗ .
Associated with distribution P(j) , for j ∈ {1, 2}, the stochastic(j)process SECT(K)(ν ∗ , ·) has a covariance function κν ∗ (s, t).
(1)

(2)

def

Assumption:8 κν ∗ (s, t) = κν ∗ (s, t) = κ(s, t).
Under some topological conditions, the following integral operator
is a Hilbert-Schmidt (hence, compact) operator on L2 (0, T ),
Z T
f 7→

κ(s, ·)f (s) ds,
0

and it has the eigenvalues {λl }∞l=1 and orthonormal eigenfunctions{ϕl }∞
l=1 .
8This assumption corresponds to the null hypothesis P(1) = P(2) . With a permutation
trick, our statistical method is robust to the violation of the assumption.
Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

14 / 31

Karhunen–Loève expansion

We have the following Karhunen–Loève expansion(j)
SECT(K)(ν ∗ ; t) = mν ∗ (t) +∞ pXλl · Zl (K) · ϕl (t),
l=1

Z Tn
o
1
(j)
∗
where Zl (K) := √SECT(K)(ν ; t) − mν ∗ (t) · ϕl (t) dt
λl 0
P
2
(j)
The convergence ofis in the L∞
t LK (dt, P (dK)) topology.
Zl is of mean 0 and variance 1, and they are mutually uncorrelated
according to P(j) across l = 1, 2, ....

Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

15 / 31Hypothesis Testing
(1)

iid

(2)

iid

Data: shapes {Ki }ni=1 ∼ P(1) and {Ki }ni=1 ∼ P(2) .
The Karhunen–Loève expansions provide the following
def

(1)

(2)

Xi (t) = SECT(Ki )(ν ∗ ; t) − SECT(Ki )(ν ∗ ; t)
n
o
(1)
(2)
= mν ∗ (t) − mν ∗ (t)
!
∞ p
(1)
(2)
X
Zl (Ki ) − Zl (Ki )
√
+
2λl ·
· ϕl (t).
2
l=1
Xi (t) is a stochastic process associated with P(1) ⊗ P(2) .
We further define the random variables ξl,i as follows


(1)
(2)
Z T
Zl,i − Zl,i
1
def

√
ξl,i = √·Xi (t)ϕl (t)dt = θl + 
2λl 0
2
Z Tn
o
1
(1)
(2)
where θl = √mν ∗ (t) − mν ∗ (t) ϕl (t)dt.
2λl 0
Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

16 / 31Hypothesis Testingdefξl,i = √

1
·
2λl



Z T
Xi (t)ϕl (t)dt = θl +√01
where θl = √
2λl
(1)



(1)
(2)
Zl,i − Zl,i



2

Z Tn
o
(1)
(2)
mν ∗ (t) − mν ∗ (t) ϕl (t)dt.
0(2)mν ∗ (t) = mν ∗ (t) for all t ⇐⇒ θ1 = θ2 = · · · = 0.
ξl,i are of mean θl and variance 1.
ξ1,i , ξ2,i , . . . , ξl,i , . . . are mutually uncorrelated (across index l).

Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

17 / 31Hypothesis Testing
We test the following approximate hypothesis
c0 : θ1 = θ2 = · · · = θL = 0,
H
(
)
Pl
def
l′ =1 λl′where L = min l ∈ N P∞
> 0.95 .
′′λ′′l =1 lc0 ⇐⇒ ξ1,i , . . . , ξL,i are of mean zero.
H
We implement the following asymptotic χ2 -test (Algorithm 1)
L
X
l=1

1
√
n

n
X

!2
ξl,i

> χ2L,1−α .

i=1Highly-nonparametric hypothesis testing=⇒ normal distribution-based hypothesis testing.
Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

18 / 31

Permutation Test

(1)

(2)

def

Recall our assumption9 κν ∗ (s, t) = κν ∗ (s, t) = κ(s, t).
Violation (in the numerical sense) of the assumption will induce
type-I error inflation.
To reduce inflation, we need a permutation trick.
Permutation test (Algorithm 2): We first shuffle (permute) the(j)group labels j ∈ {1, 2} of shapes {Ki }ni=1 ; then, we apply
Algorithm 1 to the permuted shapes.
That is, Algorithm 2 = permutation + Algorithm 1.

9This assumption corresponds to the null hypothesis P(1) = P(2) .

Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

19 / 31

Simulations
For each ε ∈ [0, 0.1], the distribution P(ε) generates the following
shapes()1(ε) def
Ki = x ∈ R2 inf ∥x − y∥ ≤, where
(ε)
5
y∈S
i

(

)

1−ε
2
9+ε
(ε)
Si =
+ a1,i · cos t, b1,i · sin t
π≤t≤
π
5
5
5
)
(

[
6π
14π
2
≤t≤
,
− + a2,i · cos t, b2,i · sin t
55
5
i.i.d.

where a1,i , a2,i , b1,i , b2,i ∼ N (0, 0.052 ).
We test the following hypotheses(ε)
d−1
H0 : m(0)× [0, T ],
ν (t) = mν (t) for all (ν, t) ∈ S(ε)
vs. H1 : m(0)
ν (t) ̸= mν (t) for some (ν, t).
Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

20 / 31ε = 0.075
iid

100 blue shapes ∼ P(0) ;iid
100 pink shapes ∼ P(ε) .
ε measures the discrepancy between the null hypothesis and the true
shape-generating mechanism.

(ε)
d−1
H0 : m(0)× [0, T ],
ν (t) = mν (t) for all (ν, t) ∈ S(ε)
vs. H1 : m(0)
ν (t) ̸= mν (t) for some (ν, t),
Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

21 / 31

Simulations (α = 0.05)(ε)
d−1
H0 : m(0)× [0, T ],
ν (t) = mν (t) for all (ν, t) ∈ S(ε)
vs. H1 : m(0)
ν (t) ̸= mν (t) for some (ν, t).

ε measures the discrepancy between the null hypothesis and the true
shape-generating mechanism.
Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

22 / 31Section 3: Applications

Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

23 / 31

Data Analysis I: Silhouette Database

Table 1: P-values of Algorithms 1 and 2 for the silhouette database.

Apples vs. Hearts
Apples vs. Children
Hearts vs. Children
Apples vs. Apples
Hearts vs. Hearts
Children vs. Children
Kun Meng (Brown University)

Algorithm 1< 0.01< 0.01< 0.010.26 (0.23)
0.17 (0.16)
0.39 (0.28)

Shapes via SECT

Algorithm 2< 0.01< 0.01< 0.010.46 (0.27)
0.47 (0.29)
0.49 (0.30)
June 27, 2023

24 / 31

Data Analysis II: Teeth of Primates

Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

25 / 31

Data Analysis II: Teeth of Primates

Table 2: P-values of Algorithms 1 and 2 for the data set of mandibular molars.

Tarsius vs. Microcebus
Tarsius vs. Mirza
Tarsius vs. Saimiri
Microcebus vs. Mirza
Microcebus vs. Saimiri
Mirza vs. Saimiri
Tarsius vs. Tarsius

Kun Meng (Brown University)

Algorithm 1< 10−3< 10−3< 10−3< 10−3< 10−3< 10−30.206 (0.195)

Shapes via SECT

Algorithm 2< 10−3< 10−3< 10−30.009< 10−3< 10−30.519 (0.274)

June 27, 2023

26 / 31Section 4: Mathematical Foundations

Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

27 / 31

Polish Space-valued Random VariablesΩ := the collection of shapes in Rd satisfying some topologicalconditions10 . They are the shapes of interest.
For each K ∈ Ω and fixed direction ν ∈ Sd−1 , we proved thatt 7→ SECT(K)(ν, t) belongs to the Sobolev space H := H01 (0, T ),i.e., SECT(K)(ν, ·) ∈ H.
(Sobolev spaces are usually implemented to show the
well-posedness of PDEs.11 By Sobolev embedding theorm,
H = H01 (0, T ) is a RKHS)
In addition, we proved the continuity12 of the following function
Sd−1 → H, ν 7→ SECT K(ν, ·),that is, SECT(K) ∈ C(Sd−1 ; H).
10

They involve too much machinery of computational topology, hence, are omitted.
e.g., Junfeng Li and Kun Meng. Global well-posedness for the fifth order
Kadomtsev-Petviashvili II equation in three-dimensional space. Nonlinear Analysis, 130:157-175, 2016.
12
Precisely, 1/2-Hölder continuity
11

Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

28 / 31

Polish Space-valued Random Variables
SECT : Ω → C(Sd−1 ; H),
K 7→ SECT(K)

Hence, SECT(K) takes values in C(Sd−1 ; H), which is a separable
Banach space (hence, Polish space, suitable for probability).
We defined a metric (not a semi-metric) on Ω as follows(Z
1/2 )Tdefνν
χ(K1,τ
) − χ(K2,τ)ρ(K1 , K2 ) = supν∈Sd−1

2

dτ

.

0

The map SECT : Ω → C(Sd−1 ; H) is Borel-measurable,
hence, a random variable.
The conditions of the Karhunen–Loève expansion are satisfied.
Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

29 / 31

Conclusions
Methodology: We proposed statistical inference methods fortesting whether two collections of shapes are significantly different.
Our discussions connect the following fields: algebraic andcomputational topology, probability theory and stochastic
processes, Sobolev spaces and functional analysis, statisticalinference, and morphology.
Our results have been posted on arXiv.13
Future work: We will apply similar approaches tograyscale images of tumors14 and fMRI data15 .
13

Kun Meng, Jinyu Wang, Lorin Crawford, and Ani Eloyan. Randomness andstatistical inference of shapes via the smooth Euler characteristic transform. arXiv preprint
arXiv: 2204.12699 (2023). (Submitted to JASA — major revisions)
14
Q. Jiang, S. Kurtek, and T. Needham. The weighted euler curve transform for shapeand image analysis. In Proceedings of the IEEE/CVF Conference on Computer Vision and
Pattern Recognition Workshops, pages 844–845, 2020.
15
Kun Meng and Ani Eloyan. Population-level task-evoked functional connectivity via
Fourier analysis. arXiv preprint arXiv: 2102.12039 (2022).
Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

30 / 31

Thank You !

Kun Meng (Brown University)

Shapes via SECT

June 27, 2023

31 / 31