{'fraction_non_alphanumeric': 0.035333333333333335, 'fraction_numerical': 0.007511111111111111, 'mean_word_length': 4.636397795591182, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The Euler Characteristic: A General Topological Descriptor for Complex Data

Datasets are mathematical objects (e.g., point clouds, matrices, graphs, images, fields/functions) that have shape. This shape encodes important knowledge about the system under study. Topology is an area of mathematics that provides diverse tools to characterize the shape of data objects. In this work, we study a specific tool known as the Euler characteristic (EC). The EC is a general, low-dimensional, and interpretable descriptor of topological spaces defined by data objects. We revise the mathematical foundations of the EC and highlight its connections with statistics, linear algebra, field theory, and graph theory. We discuss advantages offered by the use of the EC in the characterization of complex datasets; to do so, we illustrate its use in different applications of interest in chemical engineering such as process monitoring, flow cytometry, and microscopy. We show that the EC provides a descriptor that effectively reduces complex datasets and that this reduction facilitates tasks such as visualization, regression, classification, and clustering.


Introduction
Datasets are mathematical objects (e.g., point clouds, matrices, graphs, images, field/functions) that have shape [45]. Characterizing the shape (geometrical features) of these objects reduces the dimensionality and complexity of the data while minimizing information loss, but is not always straightforward [34]. Popular tools from statistics, linear algebra, and signal processing (e.g., moments, correlation functions, singular value decomposition, convolutions, Fourier analysis) do not directly characterize geometrical features of data objects; instead, such tools are used to characterize other types of features (e.g., variance and frequency content).
Topology is a branch of mathematics that provides powerful tools to characterize the shape of data objects. One such tool is the so-called Euler characteristic (EC); the EC, originally used for the characterization of polyhedra [14], is now broadly used in scientific areas such as random fields [2,3,4], cosmology [41,38,19], material science [31,6,9,42], thermodynamics [32,20,16], and neuroscience [21,23]. To the best of our knowledge, the EC has seen limited applications in engineering and of these applications most are focused on the characterisation of the permeability of porous media and modelling geometric states of fluids within porous media [42,30]. However, a fact that is often overlooked in this literature is that the EC provides a general descriptor of different types of topological spaces (this enables the characterization of a much wider range of data objects). This generality arises from the fact that (i) one can use transformations to map a data object into another type of object and (ii) the EC has fundamental connections with statistics, field theory, linear algebra, and graph theory.
In a nutshell, the EC is a descriptor that characterizes geometrical features of a topological space defined by a data object. This characterization is accomplished by performing a decomposition of the space into a set of independent topological bases. This decomposition is similar in spirit to an eigen-decomposition of a matrix; here, the matrix object is decomposed into a set of independent basis vectors. The EC is a scalar integer quantity that is defined as the alternating sum of the rank of the topological bases. The EC is often combined with a transformation technique known as filtration to characterize the geometry of different objects such as matrices, images, fields/functions, and weighted graphs. This characterization is summarized in the form of what is called an EC curve which provides a direct approach to quantify the topology of an object.
Topological descriptors such as the EC offer advantages over statistical descriptors [31]. For instance, statistical descriptors such as Moran's I, which measures spatial structure via spatial autocorrelation, or correlation matrices do not directly capture the global structure of the data (thus limiting the ability to characterize geometrical features) [39,22]. High-order statistical descriptors such as 2-point correlation functions, which have been employed in characterizing the structure of heterogeneous materials, are also limited at capturing spatial and morphological features of the data (especially if the data object is irregular) [18,29]. However, there exists well-developed theory that connects the EC to the geometry of random fields [3,4]. Such work establishes that the EC encodes information of simple statistical descriptors such as means and variances and of more complex descriptors (e.g., space-time covariances) [2]. These connections between topology and statistics are powerful and provide a mechanism to understand the emergence of topological features from physical behavior (e.g., diffusion phenomena). The EC also connects with concepts from linear algebra and graph theory; for example, a matrix or an image can be represented as a weighted graph and the geometry of such graph can be quantified using the EC (a graph is a 2D polyhedron). Establishing these connections is important because data objects encountered in practice are often complex and require the combined use of different characterization techniques. For instance, in brain analysis, one often characterizes a multivariate time series (a collection of time series obtained from different locations in the brain) by constructing a correlation matrix. The topology of this matrix is then reduced to an EC curve through a filtration. The EC curve provides a low-dimensional descriptor that characterizes the spatio-temporal structure of the brain. It is also important to emphasize that the EC curve is a much simpler topological descriptor than the so-called persistence diagrams used in most of the topological data analysis (TDA) literature [45]. Persistent diagrams contain more topological information but are more difficult to analyze and interpret.
The aim of this paper is to present an applied perspective on the EC. We briefly discuss the mathematics of the EC and discuss how to use filtration operations to characterize diverse data objects. This discussion will establish connections with field theory, graph theory, and linear algebra. We then bring our focus to applying these concepts to tackle diverse problems arising in science and engineering; in particular, we discuss how the EC can be used in process monitoring by analyzing correlation structures. We also apply the EC in the analysis of both 2D spatial and 3D spatio-temporal fields; these data objects are derived from reaction-diffusion partial differential equations (PDEs), micrographs of liquid crystals, and flow cytometry. In these examples, we show how to use the EC as a data pre-processing (reduction) step that can facilitate machine learning tasks. We also provide scripts and datasets to help the interested reader apply these tools.

Introduction to the Euler Characteristic
Around 1735, Euler discovered a relationship between the number of vertices, edges, and faces of a convex polyhedron (which is now known as the EC). The study and generalization of this formula, specifically by Cauchy and L'Huilier, is at the origin of topology. The EC is a scalar integer value that summarizes the shape of a topological space (an object). A topological space is a set with a structure defined by continuity and connectedness which also represents the ideas of limits or closeness based on relationships between the sets of the space rather than a specific distance or metric [35] . Topological spaces are a central unifying notion that appears in virtually every branch of modern mathematics (e.g., capture graphs and manifolds). The EC is a topological invariant quantity (e.g., does not change with deformations such rotation, streching, bending). For instance, the topology of a graph is fully defined by its node-edge connectivity (the location of the nodes and edges is irrelevant); as such, graphs that appear to be visually distinct might have the same underlying topology (and thus have the same EC value). In this work, we will introduce the EC from the perspective of data objects that can be represented as graphs (a 2D polyhedron) and manifolds (e.g., images and fields/functions). Graphs and manifolds are special types of topological spaces but, as we will see, these spaces are sufficient to represent a vast number of data objects encountered in chemical engineering applications such as the analysis of industrial chemical process sensor data (graph) and soft material experimental images (manifold) .
(a) Example object (2D shape) (b) EC of example object (χ) Figure 1: Illustration on how topology can be quantified via the Euler characteristic. (a) A 2D shape that has two connected components and three holes. (b) The EC is an alternating sum of the number of connected components and holes and thus χ = −1.
We begin with a general definition of the EC (which we denote as χ ∈ Z) for a 2D manifold (see Figure 1). The EC of the manifold is an alternating sum of the number of 0-dimensional topological bases (known as connected components) and the number of 1-dimensional topological bases (known as holes): There are only two sets of topological bases (connected components and holes) that describe a 2D object. The rank of the first basis is known as the 0-th Betti number β 0 ∈ Z + , while the rank of the second basis is known as the 1-st Betti number β 1 ∈ Z + ; here, Z + denotes the set of all nonnegative integers. The relationship between the number of topological bases and dimensions holds for ndimensional shapes; as such, the EC of an (n + 1)-dimensional shape is given by: To simplify our notation, we will use the generalized topological representation of the Betti numbers β n ∈ Z + ; here, the n-th Betti number β n is the number of unique n-dimensional topological bases for a given shape [2].

EC for Graphs
A graph object G(V, E) is a 2D topological space (a 2D polyhedron). The EC of this object is given by: where |V | ∈ Z + is the number of graph vertices (nodes) and |E| ∈ Z + is the number of graph edges. We define v(e), v (e) ∈ V as the support nodes of edge e ∈ E. One can show that |V | − |E| equals the number of connected components of the graph (β 0 ) minus the number of holes (cycles) of the graph (β 1 ) [1]. One can use the EC to characterize edge-weighted graphs G(V, E, w E ), where each edge e ∈ E has an associated scalar weight w E (e) ∈ R. Similarly, one can use the EC to characterize node-weighted graphs G(V, E, w V ), where each node v ∈ V has an associated scalar weight w V (v) ∈ R. This characterization is done via a process known as a filtration which leads to the creation of a topological descriptor known as an EC curve. The ability to deal with weighted graphs enables analysis of data objects that are represented as discrete fields, such as matrices and images. For example, a correlation matrix (a square and symmetric matrix) can be represented as an edge-weighted graph in which the nodes are the random variables, the edges are the connections between variables, and the weights are the degrees of correlation between pairs of random variables ( Figure 2). A grayscale image can be represented as a node-weighted graph in which the nodes are pixel locations, the weights are the intensity of the pixels, and the edges connect adjacent pixels to form a grid ( Figure 3). A 2D discrete field (e.g., obtained from a discretized PDE) can also be represented as a node-weighted graph; here, the nodes are locations in the discretization mesh and the weights are values of a variable of interest at such locations (e.g., temperature). It is important to emphasize that graphs are topological spaces that do not live in a Euclidean space; as such, the location of the nodes and edges is irrelevant (topology is fully dictated by the node-edge connectivity). Thus, the EC and associated EC curve are focused on the global topology of the graph during a filtration, and not on specific connectivity information (e.g. the number of edges connected to node x) which it does not track.
To characterize the topology of an edge-weighted graph G(V, E, w E ), we perform a filtration of the graph by eliminating edges that have weights less than or equal to a certain threshold w E (e) ≤ (with ∈ R). Filtration gives a graph that is sparser than the original graph and that has an associated EC value. We can repeat the filtering process by progressively increasing the threshold value and with this obtain new graphs and associated EC values. One stops the process once the threshold reaches the largest weight in the original graph G(V, E, w E ); this gives the original graph itself and and its associated EC value. To formalize the filtration process, we define the following filtration function (see Figure 2).
The pre-image of the filtration function is used to create a set of nested graphs; this is done by defining a sequence of increasing thresholds 1 < 2 < ... < m with associated graphs: Here, we note that G m = G if m = max e∈E w E (e) (the last graph in the filtration is the original graph). We also re-emphasize that the density of the graph (its number of edges) increases with the threshold value; specifically, G 1 is the graph with lowest density (highest sparsity) and G m is the graph of highest density (lowest sparsity). We can define a similar filtration for node-weighted graphs; here, nodes are filtered/eliminated based on their weight values. The filtration function for this object (see Figure 3) can be defined as follows.

Definition 2.2. Graph Node Filtration Function (f V ):
For an undirected node-weighted graph G : As in the edge-weighted case, the pre-image of the node filtration function is used to create a set of nested graphs: Here, we highlight that node filtration has the effect of eliminating both nodes and edges; in other words, if a node is eliminated, we also eliminate its supported edges. We again note that G m = G if m = max v∈V w V (v) (the last graph in the filtration is the original graph). For each graph G in the node or edge filtration process, we compute and record its EC value χ . This information is used to construct the so-called EC curve, which contains the pairs ( , χ ). The EC curve thus provides a topological descriptor for edge-or node-weighted graphs. Furthermore, it is important to note that the edge and/or node weights are a critical component of this analysis as this is what allows for the filtration to be performed. Without this information only a single EC value can be computed which is ineffective at distinguishing graphs with different topologies if they have the same ratio of nodes and edges.

EC for Manifolds
The EC can also be used for characterizing the geometry of topological spaces known as manifolds [48,8,24]. Specifically, we consider an n-dimensional manifold M that is defined by a chart (X, f ), where X ⊆ R n is an open subset of M (a Euclidean space) and the field/function f : X → R is a homeomorphism (a one-to-one, onto, and continuous mapping with an inverse mapping that is also continuous). In simple terms, the manifolds of interest involve an n-dimensional continuous domain X and field f : X → R. We will say that field f is n-dimensional if X ⊆ R n and we say that this field is embedded in an (n + 1)-dimensional manifold (because the dimension of the chart (X, f ) is n + 1). For instance, in Figure 4, we show a 1-dimensional (1D) field/function f : X → R with domain X ⊆ R; this field is embedded in a 2D manifold M defined by the chart (X, f ). In our 1D field example, the horizontal coordinate of the chart is X and the vertical coordinate is f . A 1D field arise, for instance, as the solution of an ordinary differential equation (e.g., the domain is defined by a time coordinate). Another example of a 1D field is the probability density function of a univariate random variable. Similarly, a 2D field f : X → R with X ⊆ R 2 is embedded in a 3D manifold M (given by a 3D chart). Formalizing these definitions is important in characterizing the topology of fields. Higher dimensional fields arise, for instance, as solutions of PDEs (e.g., the domain is defined by space-time coordinates) or can be probability density functions of mutivariate random variables. These high-dimensional fields often have complex topology and are notoriously difficult to analyze/characterize. The chart (X, f ) is also often referred to as the graph of field f . For n = 2 (2D), the chart (X, f ) is analogous to the concept of a node-weighted graph G(V, E, w V ) arising in graph theory, in the sense that the domain X captures spatial locations (the nodes V ) and the function f captures values at the spatial locations (the node weights w V ). This analogy becomes clearer when the domain X is a 2D box and G(V, E, w V ) has a mesh topology; here, the mesh can be seen as a discrete approximation of the continuous domain X. Mesh topologies arise in images, matrices, and discretized PDEs. We will define the chart associated with a given manifold using the notation G(X, f ) and we will refer to this as a field graph. This definition introduces some abuse of notation (analogous to G(V, E, w V )) but we do this in order to emphasize connections between field graphs and node-weighted graphs. This will facilitate the explanation of the concept of filtration in a field context. We also emphasize that the concept of a field graph generalizes to arbitrarily high dimensions (while a graph is inherently a 2D object). We also emphasize that a graph does not live in a Euclidean space (while X does). The fact that X is a Euclidean space indicates that there is a notion of order.
A filtration can be applied to continuous fields in the same way that it is applied to node-weighted graphs (discrete case); however, this now requires a filtration function that is defined over continuous domains. We can define a filtration function via superlevel sets of the field [37]. Definition 3.1. Superlevel Set: Given a manifold M with field f : X → R and domain X ⊆ R n , the superlevel set X at a threshold ∈ R is defined as: The super level set is has an associated field graph G := G(X , f ) with f defined over X .
The field graph G = (X , f ) contains all points of the manifold M that have a function value greater than or equal to (it is a filtration of the manifold). Similar to the node-weighted graph case, the filtration creates a nested set of field graphs which are obtained by defining a sequence of decreasing filtration values 1 > 2 > ... > m with associated field graphs: Here, the field graphs are sparser with larger threshold values; we also have that For each superlevel set we obtain the field graph G and we compute and record its EC value χ (e.g., we determine the number of connected components and number of holes). This information is used to construct an EC curve, which contains the pairs ( , χ ).
It is important to highlight that the EC curve provides a topological descriptor for a general ndimensional field. The types of topological bases change with dimension; for instance, for a 1D field (e.g., a temporal field) we only have connected components (χ = β 0 ) while for a 2D field (e.g., a space-time field) we have connected components and holes (χ = β 0 − β 1 ). It is also often convenient to track the evolution of the individual Betti numbers through the filtration; in other words, we keep track of the pairs ( , β ).
In Figure 4, we present multiple superlevel sets of a 1D field and the corresponding EC curve. Since this is a 1D field, the EC of a given superlevel set only involves the number of connected components. Filtration captures topology by revealing a local maximum (connected component is formed) or a local minimum (two components are connected); thus, the EC compactly encodes information about the critical points of the field and their relations with respect to the function shape, which are the topologically interesting characteristics of a continuous function or field. The critical points of fields are key because they define their topological features.
Superlevel set filtration is generalizable and extends to higher dimensional fields. Such fields appear in scientific areas such as geophysics [33,15,10], climatology [10,28], astrophysics [53], and medical imaging [36,7,52,54]. Fields can be used to represent many important data objects such as images (2D fields embedded in a 3D manifold), volumes (3D fields embedded in a 4D manifold), and spatio-temporal fields obtained from PDEs (4D fields embedded in a 5D manifold). Theoretical connections between integral geometry, statistics, and topology have shown that the EC provides a general descriptor to characterize the behavior of these complex data objects, such as identifying higher order statistical characteristics of these data objects (e.g. statistics of derivatives of the data) or capturing global properties of the data, such as the magnitude and frequency of spatial or temporal flucturations, without the need for assumptions such as isotropy or stationarity [5,2].
The filtration of a high-dimensional field is analogous to that used in the 1D case. The difference is the number and nature of the topological features captured in higher dimensions. For instance, for a 2D field (embedded in a 3D manifold), we capture both connected components and holes. Specifically, the threshold is a 2D plane that cuts through the 3D graph. When the plane passes through a local maximum we have that connected components are formed, when it passes a saddle point components are joined to form holes, and when a local minimum is passed holes are filled. This reveals that filtration captures incidence of different types of critical points in the field (its topological features) and this information is summarized in the EC curve. This process is illustrated in Figure  (    : Connected components (β 0 ) and holes (β 1 ) that make up the EC curve for the 2D field in Figure 5. The structure of the EC curve is a direct reflection of the changing topology of the superlevel sets during the filtration. The local maxima of the field represent connected components (β 0 ) which are eventually joined via saddle points to form holes (β 1 ) that are filled in once local minima of the field are passed by the filtration.
5; here, we see that the EC curve contains a single minimum and a single maximum. The reason for this structure is revealed when we visualize the individual topological bases for our 2D field (see Figure 6). Here, we see two distinct areas of the filtration, the first is dominated by connected components (β 0 ) which causes the maximum and the second is dominated by holes (β 1 ) which causes the minimum. These topologically distinct components of the filtration represent the presence of local maxima (high β 0 values) and saddle points/local minima (high β 1 values) in the 2D field. Betti numbers reveal differences in the topology of a data object at varying thresholds and have been used in analysis that is complementary to the EC itself [38]. Specifically, analyzing individual Betti numbers can provide additional insight into the appearance/disappearance of specific topological features throughout the filtration process. This approach is at the core of the so-called persistence diagrams (which summarize the appearance/disappearance of topological features). Persistent diagrams, while more informative, are difficult to interpret and analyze primarily because the diagram is constructed from an unordered set of intervals which are not amenable to statistical computations (e.g. means and variances) [49,17]. For this reason, it is difficult to analyze persistence diagrams directly or to use them as a data preprocessing step for further analysis in statistical and machine learning methods without further transformation.

Applications
In this section, we illustrate how to use the EC to characterize diverse datasets arising in applications of interest to chemical and biological engineers . All scripts and data needed to reproduce the results can be found here https://github.com/zavalab/ML/tree/master/ECpaper.

Brain and Process Monitoring
One is often interested in characterizing the topology of graphs (such as those arising in brain networks or process networks) as a way to identify abnormal behavior. As an example, we might want to relate the topological structure of the functional connections of brains at different stages of development (adult vs. child) or to identify diseases. Here, we illustrate how to do this using a real dataset taken from the work of Richardson and co-workers available in OpenNeuro (ds000228) [40]. We then show how to use this same approach to identify faults in chemical processes.
In the brain dataset, adults and children watch a short film and the activity in different regions of the brain are measured with functional magnetic resonance imaging (fMRI). Here, the signal in each region i = 1, ..., n is a univariate random variable Y i and we denote the collection of signals as the multivariate random vector Y = (Y 1 , ..., Y n ). We denote the observation of the signals at time t = 1, ..., m as Y (t) ∈ R n . This dataset is thus a multivariate time series; the series is used to construct a functional network, which is given by the sample inverse covariance matrix Cov[Y ] −1 ∈ R n×n (also known as precision matrix). This procedure is summarized in Figure 7. The precision matrix is represented as an edge-weighted graph G(V, E, w E ); here, vertices represent the different regions of the brain and edge weights w(e) ∈ [0, 1] represent the absolute value of the partial correlation between different regions. From Figure 7, we can see that these functional networks have a complex structure, making them difficult to characterize.
We perform a filtration in order to characterize the precision matrix of different brains. This filtration gives an EC curve for each brain that is used to understand topological differences between developed and underdeveloped brains (see Figure 8). Here, we can see that there is a perceptible difference between the average EC curves for different brain types. This illustrates the effectiveness of the EC curve in identifying structural differences in complex functional networks [11,12]. Intuitively,  a developed brain has a more widespread correlation structure, and thus the EC curve decays more slowly. Interestingly, the brain monitoring problem is analogous (from a mathematical viewpoint) to the problem of chemical process monitoring. This is because, fundamentally, any multivariate time series can be represented as a precision matrix. In brain monitoring methods, such as fMRI, the goal is to identify differences in brain activity that may be a result of genetic defects, disease, or different stimuli. In chemical process monitoring, we seek to identify the presence of faults, disturbances, or problems in equipment operation. Brain monitoring typically uses observations on electrical signals, blood flow, or oxygen levels; in a chemical processes we use observations on temperatures, pressures, and flows (see Figure 9). To highlight this analogy, we provide a fault detection case study for the Tennessee Eastman process dataset [13]. This dataset contains a simulation of a chemical process that is monitored using 52 variables (Figure 9). The goal is to use time series for such variables to identify faulty behavior. The variables monitored by the different sensors of a chemical process (in different locations) are Y i , i = 1, 2, ..., n and the observations are Y (t) ∈ R n for t = 1, ..., m. As in the brain example, this multivariate time series is used to construct the precision matrix Cov[Y ] −1 ∈ R n×n . We again represent this matrix as an edge-weighted graph G(V, E, w E ) and use filtration to determine its EC curve. We compute EC curves for precision matrices obtained from different multivariate time series (containing different types of faults).
The Tennessee Eastman dataset contains multiple simulations of the chemical process; here, some simulations contain faults and others do not. For each simulation, we construct an edge-weighted graph from the precision matrix and leverage the EC curve to identify whether or not the given pro-  (b) A simplified representation of the Tennessee Eastman process. The process is monitored using temperature sensors (TS), pressure sensors (PS), flow sensors (FS) and level sensors (LS) distributed in different regions. While the context of the two systems are vastly different, the type of data produced (i.e. multivariate time series) are identical. This suggests that methods used in the analysis of brain functional networks for the detection of disease can be directly applied to chemical process systems to detect faults or process issues. cess is experiencing a fault based upon the topological structure induced by the correlations between the process variables ( Figure 10). Figure 11 shows examples of the precision matrices derived from process simulations that either contain or do not contain faults, demonstrating that the identification of faults from the precision matrix is not a trivial task.   Figure 11: Visualization of multiple precision matrices derived from chemical process simulations with and without faults. Distinguishing these matrices is difficult, demonstrating the inherent complexity in identifying faults in a process with the precision matrix alone. Figure 12 demonstrates that there is a quantifiable difference between the process operating with no faults, and the process operating with faults. We also note that there is a separation into two groups within the faulty systems. The two groups of faults deal with with either feed temperature and reactor faults, or feed composition and condenser faults. The reason for this separation is of interest and will be explored in future work. This demonstrates that the EC can be used to detect faults based purely on the topological structure of the precision matrix. Note that this is a method that accounts for the space-time relationships of the entire process (all-at-once) and does not require statistical assumptions on the data (e.g., independence of observations). The simplicity of (2.3) also ensures that the EC can be rapidly calculated via the number of edges and vertices of a graph. The computation of the EC and the associated EC curve requires a simple thresholding operation (to obtain the number of nodes and edges in the filtered graph) and a few addition and subtraction operations (to sum the number of edges and nodes and compute the EC value) at each point in the filtration, because of this the method scales well with large networks as the required computations are simple and efficient.  There is also a notable separation of the faults into two groups, one which represents faults primarily associated with feed temperatures or reactor conditions, and the other associated with feed composition changes or condenser faults.

Spatio-Temporal Data Analysis
We now use the EC to characterize the spatio-temporal behavior of fields for a reaction diffusion system. Here, the fields are solutions of a PDE model with different diffusion (D ∈ R) and reaction (R ∈ R) coefficients. The coefficients can be manipulated to generate fields with different topological features, which capture different mechanistic behavior (e.g., reaction-limited or diffusion-limited).
The model is described by the coupled PDEs: Here, u(x, t) : D x × D t → R and v(x, t) : D x × D t → R represent the concentrations for the reactants over space and time. The spatial domain is continuous and given by D x := [0, n] × [0, n] ⊂ R 2 ; the temporal domain is D t := [0, T ] ⊂ R. We thus have that u(x, t) and v(x, t) are 3D fields (embedded in a 4D manifold). Here, we hypothesize that the topological features of these fields are expected to change with the parameter pair (D, R) (the structure changes with governing mechanism). An example field generated for a given parameter pair (D, R) is shown in Figure 13. Here, we focus on characterizing the topology of u(x, t) for different values of the parameters. To do so, we generate 30 fields (obtained using different random initial conditions) for each of the following combinations: (D = 3, R = 0.8), (D = 3, R = 0.4), and (D = 6, R = 0.8). The goal in the analysis of this dataset is to cluster the realizations into groups that reflect the parameters of the models (e.g., to detect changes in the underlying mechanism). For each simulation, we represent u(x, t) as a spatiotemporal field (Figure 13). We construct superlevel sets for each spatio-temporal field and record the EC of the resulting superlevel sets. This process is similar to the examples shown for the 1D and 2D cases (Figures 4 and 14); however, the filtration performed here can no longer be visualized as a simple plane that slices the field. This highlights the versatility of using the EC to characterize datasets over high dimensions.
The average EC curves for the three different parameter settings are presented in Figure 14. Here, it is clear that the EC reveals a change in the topological structure. To perform clustering, we represent the EC curve for sample j = 1, ..., n as a vector χ j ∈ R m ; the entries of this vector are the EC value of the level set. Each EC vector can be stacked into a matrix [χ 1 χ 2 χ 3 ... χ n ] T ∈ R n×m . We obtain a matrix for each of the three parameter settings. We apply a singular value decomposition to these matrices and visualize the data projected onto the two leading principal components. Figure 14 shows the results; note that there is a distinct clustering of the data into three separate groups. This confirms that the EC curve captures the topological differences of the fields obtained under different parameter settings. For comparison, we compute the Fourier transform of the data to obtain the frequency spectrum and project the spectrum to two dimensions using a singular value decomposition. The results are shown in Figure 14; here, we can see that the frequency spectrum of the data does not contain enough information to separate the different types of fields. This indicates that the EC contains information that cannot be captured by the frequency spectrum.

Image Analysis
We explore the topological characterization of simulated micrographs for liquid crystal (LC) systems. These micrographs capture their responses to different reactive gaseous environments [44,47]. These LC systems start with homeotropic alignment of a thin film on a functionalized surface. When the LC system is exposed to an analyte, the analyte diffuses through the LC film and disrupts the binding http://zavalab.engr.wisc.edu between the LC and the surface. This disruption triggers a reorientation of the LC film and forms complex optical patterns and textures simulated via random fields. Figure 15 provides images (micrographs) that capture the response of an LC system to a couple of different environments. For this dataset, we want to characterize the topological differences between the textures of the LC systems when exposed to the different envrionments and use this information to classify the datasets. This provides a mechanism to design gas sensors. Such classification tasks have been recently performed succesfully using convolutional neural networks [44]; these machine learning models, however, contain an extremely large number of parameters and are difficult to train.
The micrographs of the LC systems at their endpoint are discrete fields (matrices), which we represent as node-weighted graphs. The EC curves for such graphs are obtained via filtration. The filtration process seeks to characterize regions of high and low intensity in the A* channel. We highlight that one can also think of an image as a discrete approximation of a continuous 2D field; this emphasizes that the filtration process for a discrete field is analogous to the filtration process of a node-weighted graph (we perform filtration over weight values instead of over field values).
The average EC curves for the LC systems exposed to the two gaseous environments are presented in Figure 16. Here, we also show the projection of the EC curves onto the first two principal components using SVD. We can see that there is a strong separation between the two datasets. As a comparison, we cluster the micrographs by applying SVD directly to the images (as opposed to the EC curves) and by computing the Fourier transform of the images, which decomposes an image into a weighted set of spatial frequency functions. We chose these methods for comparison because they are commonly used in characterizing image textures [55,26]. We can see these traditional techniques do not provide a clear separation ( Figure 17). Figure 18 shows the distribution of the first principal component of the EC values and compares this with the distribuiton of Moran's I values which capture average spatial autocorrelation in the images by computing spatial autocorrelation in neighborhoods around each pixel in the image and averaging results over the entire image [25]. It is clear (a) LC response to environment 1 (b) LC response to environment 2 Figure 15: Comparison of the visual response of an LC system to two different gaseous environments. We can see that there are perceptible differences between the responses, but these differences are difficult to quantify due to the heterogeneity present. The EC is able to effectively summarize the topological differences and similarities in the images, allowing for an accurate separation of the responses.
that the ECs provide a sharper separation than Moran's I; we conclude that EC is a more effective descriptor. We attribute the limitations encountered with traditional tools (such as SVD, Fourier, and Moran's I) to the spatial heterogeneity of the images (see Figure 15) [29].
(a) Average EC for LC system response.
(b) PCA of EC curves from LC system responses. Figure 16: (a) The average EC curve of the LC system responses to the two different gaseous environments. (b) SVD performed on the EC curves. This highlights that the EC is able to produce a strong, linear separation of the LC responses.
To further demonstrate the usefulness of the EC; we used the EC curve (a vector) as an input to a support vector machine (SVM) for classification of the two datasets. We compare this classification  approach against approaches that use SVM with: (i) raw image as input and (ii) Fourier spectrum as input. Using the EC vector as an input, we were able to classify the two datasets with 95 ± 6% accuracy, compared to 66±7% and 68±7% accuracy obtained with raw images and Fourier spectrum. It is particularly remarkable that, after reducing the images to an EC curve, it is possible to separate the datasets using a simple (linear) SVM classifier. This highlights how the EC can be used to preprocess data and how this can facilitate machine learning tasks. For instance, in this case, it is not necessary to use a more sophisticated machine learning model (e.g., a convolutional neural net) to perform image classification.

Point Cloud Analysis
We now shift our focus to the use of the EC to analyze the structure of point clouds (also known as scatter fields). Here, we consider 2D point clouds that are realizations of a bivariate random variable. As such, the point clouds emanate from a 2D joint probability density function (pdf). The analysis of the shape of univariate pdfs is typically performed by using summarizing statistics (e.g., moments); analysis in higher dimensions is quite complicated (no good descriptors exist for multi-dimensional joint pdfs) [51]. This limitation is particularly relevant when the pdf has a complex shape (e.g., it is non-Gaussian). Here, we will see that one can characterize the complex shapes of a multi-variate pdf by using an EC curve. Moreover, the results that we present highlight that the EC can be used to characterize pdfs in higher dimensions (even if it is not possible to visualize them).
We use an experimental flow cytometry dataset to illustrate how this can be done. The dataset was obtained through the FlowRepository (Repository ID: FR-FCM-ZZC9) [46]. This dataset is obtained in a study of the kinetics of gene transcription and protein translation within stimulated human blood mononuclear cells through the quantification of proteins (CD4 and IFN-γ) and mRNA (CD4 and IFN-γ) [50]. In our study, we focus on the evolution of the concentration of CD4 mRNA and IFN-γ mRNA in a given cell which is measured via a flow cytometer. At each time point, a number of cells (∼ 15, 000) are passed through the flow cytometer; each of these cells provides an observation vector y ∈ R 2 (corresponding to CD4 mRNA and IFN-γ mRNA). These observations are typically visualized as point clouds in a 2D scatter plot. The evolution of the point clouds over time is shown in Figure 19. The goal is to characterize how the shape of the point clouds evolves over time; for instance, it is clear that the point cloud progressively separates into two distinct domains.
To characterize the shape of the point clouds, we convert them into a continuous 2D field by applying smoothing. It is important to note that the point clouds are realizations of a bivariate random variable (CD4 mRNA and IFN-γ mRNA); as such, one can obtain a 2D histogram for them (by counting the number of points in a bin). The histogram is an empirical approximation of the joint pdf of CD4 mRNA and IFN-γ mRNA. The continuous 2D field obtained via smoothing is a smooth representation of the 2D histogram. Our approach provides an alternative to traditional heuristic methods such as gating, which are difficult to tune as they are highly sensitive to potential noise and outliers in the data [27].
In order to create the 2D fields, we utilize a Gaussian kernel smoothing [43]. Figure 20 shows the smoothing of a scatter plot. The 2D field is a projection of a 3D function (it is embedded in a 3D http://zavalab.engr.wisc.edu    manifold). This is illustrated in Figure 20; as such, we can characterize the field by using a filtration on the values of the pdf. Our goal is thus to compute an EC curve for the pdf at different points in time (to analyze how its shape evolves). To visualize this deformation, we compute the Euclidean norm of the difference between EC curve at a time point to that at the initial time. From Figure 21, we can see that the distance exhibits a strong and continuous dependence with time (indicating that there is a strong change in the shape of the density function). Importantly, this also suggests that there exists a continuous mapping between the EC and time (the topological deformation is continuous with respect to time). For instance, one could construct a dynamical model that predicts the evolution of the shape with time. This indicates that the EC provides a useful descriptor to monitor the evolution of complex shapes. This could help, for instance, to detect times at which the change in shape is fastest/slowest.

Conclusions and Future Work
The Euler characteristic (EC) is a powerful tool for the characterization of complex data objects such as point clouds, graphs, matrices, images, and functions/fields. The EC summarizes the topological characteristics of such data objects. We have demonstrated that the EC can be applied to a wide variety of applications by using creative data transformations (e.g., point clouds to fields and multivariate time series to correlation matrices). We have shown that the EC provides an effective descriptor and can be used as a pre-processing step that simplifies visualization, clustering, and classification tasks. We believe the inclusion of the EC and other topology based methods into engineering will forge connections between long standing fields of science (such as neuroscience, as explored here). As part of future work, we will explore the use of EC to characterize more complex data objects (such as random fields, tensors, and simplices) and we will explore new applications. For instance, it is possible to characterize the topology of objective functions in optimization problems in order to determine the complexity in solving such problems. Moreover, one can seek to optimize time-dependent or space-dependent functions by optimizing their EC. Furthermore, the EC curve is represented as a vector which makes it difficult to perform common statistical and hypothesis tests that require a single numerical value. Thus, our future work will also focus on the development of statistical methods for the EC curve, such as hypothesis testing, which are needed if the EC is to be broadly applied in science and engineering.