Skip to main content
Log in

Topological Data Analysis Captures Task-Driven fMRI Profiles in Individual Participants: A Classification Pipeline Based on Persistence

  • Research
  • Published:
Neuroinformatics Aims and scope Submit manuscript

Abstract

BOLD-based fMRI is the most widely used method for studying brain function. The BOLD signal while valuable, is beset with unique vulnerabilities. The most notable of these is the modest signal to noise ratio, and the relatively low temporal and spatial resolution. However, the high dimensional complexity of the BOLD signal also presents unique opportunities for functional discovery. Topological Data Analyses (TDA), a branch of mathematics optimized to search for specific classes of structure within high dimensional data may provide particularly valuable applications. In this investigation, we acquired fMRI data in the anterior cingulate cortex (ACC) using a basic motor control paradigm. Then, for each participant and each of three task conditions, fMRI signals in the ACC were summarized using two methods: a) TDA based methods of persistent homology and persistence landscapes and b) non-TDA based methods using a standard vectorization scheme. Finally, using machine learning (with support vector classifiers), classification accuracy of TDA and non-TDA vectorized data was tested across participants. In each participant, TDA-based classification out-performed the non-TDA based counterpart, suggesting that our TDA analytic pipeline better characterized task- and condition-induced structure in fMRI data in the ACC. Our results emphasize the value of TDA in characterizing task- and condition-induced structure in regional fMRI signals. In addition to providing our analytical tools for other users to emulate, we also discuss the unique role that TDA-based methods can play in the study of individual differences in the structure of functional brain signals in the healthy and the clinical brain.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

Data Availability

The datasets generated during and/or analyzed during the current study are available from the corresponding author on reasonable request.

Notes

  1. https://github.com/catanzaromj/PL_fMRI

References

Download references

Funding

This work was supported by the National Institute of Mental Health (MH059299), the Children’s Foundation of Michigan, Cohen Neuroscience Endowment, the Prechter World Bipolar Foundation, the Lykacki-Young Fund from the State of Michigan, the Miriam Hamburger Endowed Chair of Psychiatry, the Paul and Anita Strauss Endowment, the Donald and Mary Kosch Foundation, the Elliott Luby Endowed Professorship, and the Detroit Wayne County Authority. Additional support was provided by the Southeast Center for Mathematics and Biology, an NSF-Simons Research Center for Mathematics of Complex Biological Systems, under National Science Foundation (DMS-1764406), a Simons Foundation Grant (594594), and the Army Research Laboratory and the Army Research Office (W911NF-18–1-0307). The funding agencies played no role in the analyses or reporting of the data.

Author information

Authors and Affiliations

Authors

Contributions

MC, SR, and AC performed the data preparation and analysis. MC, SR, PB and VAD led the conceptual design of the analyses. MC, SR, and VAD wrote the main manuscript text and prepared the figures. VAD and DRR secured the research support for the study and designed the experiments. All authors reviewed the manuscript.

Corresponding author

Correspondence to Michael J. Catanzaro.

Ethics declarations

Competing Interests

The authors have declared that no competing interests exist.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Electronic supplementary material

Below is the link to the electronic supplementary material.

Supplementary file1 (HTML 3412 KB)

Supplementary file2 (HTML 3856 KB)

Appendices

Appendix

In this appendix, we describe the mathematical details of our methodology and place persistent homology on a formal footing. Persistent homology calculations are frequently performed with binary arithmetic to increase the speed of calculations and we do the same throughout. In particular, our vector spaces have binary coefficients; so, 1 + 1 = 0.

Homology. Let X denote a cubical complex, e.g., a single stage Fs of a filtered cubical complex as described in the main text. The vector space of k-chains of X, denoted Ck(X), is the vector space with basis given by the set of k-cubes. Thus, C0(X) is the vector space with basis given by vertices in X and C1(X) is the vector space spanned by the edges of X. To connect these adjacent degrees, we use an algebraic notion of boundary inspired by the geometric version. The boundary of a k-chain is the sum of the (k-1)-dimensional faces of each of its k-cubes. By definition, we set the boundary of a 0-chain to be 0. For example, the boundary of a 1-chain is given by the sum of endpoints of each 1-cube within the 1-chain. Hence, the boundary maps links together k and (k-1)-chains for all k.

We say a k-chain is a k-cycle if its boundary is 0. Note that a sequence of edges forming a geometric cycle is a 1-cycle because each vertex is a face of two (consecutive) edges and in our binary arithmetic, 1 + 1 = 0. The set of k-cycles is denoted Zk(X). We say a k-chain is a k-boundary if it is the boundary of a (k + 1)-chain. The set of (k + 1)-boundaries is denoted Bk (X). A fundamental observation of algebraic topology is that every boundary is also a cycle. That is, the boundary map applied to a k-boundary is zero. Thus, the vector space of cycles is a sub-vector space of the boundaries and we can form the vector space quotient

$${\text{H}}_{\text{k}}\left(\text{X}\right)={\text{Z}}_{\text{k}}\left(\text{X}\right)\;/\;{\text{B}}_{\text{k}}\;\left(\text{X}\right).$$

The quotient vector space Hk(X) is known as the cubical homology of X in degree k. We provide examples of these definitions in the following paragraph.

For example, a 0-dimensional cycle can simply be a point or vertex. A generic 0-dimensional cycle is a formal algebraic sum of such vertices. There are no 0-boundaries. If two vertices are the endpoints of a line segment, then the sum of those two vertices is a 0-boundary, and those two vertices correspond to the same element in the quotient H0(X). Generically, vertices may be connected by consecutive 1-cubes rather than a single one. Two vertices are homologous or equivalent if there is a path in the cubical complex connecting them. The set of all vertices homologous to one another form a homology class. Every vertex lies in exactly one homology class. Elements of 0-dimensional homology are not vertices themselves, but rather collections of vertices which are homologous to one another. If any two points in the complex can be connected by a path, then every point is homologous to every other, and there is only one such collection of vertices. In this case, the zeroth Betti number b0 = 1, reflecting the fact that there is just one connected component. Alternatively, if the cubical complex consists of N disjoint pieces, then b0 = N. Thus, 0-dimensional homology measures the intuitive notion of being “connected”, meaning the complex consists of a single piece, and the Betti number b0 counts the number of components or disjoint pieces.

Stepping up one dimension, we have 1-dimensional cycles, 1-dimensional boundaries, and their quotient 1-dimensional homology. Examples of 1-dimensional cycles include paths of 1-cubes which start and end at the same 0-cube and formal linear combinations of such paths. Two 1-dimensional cycles are homologous if their sum is a 1-boundary. If a 1-cycle surrounds a filled in region, so that it is the boundary of that region, then it is a 1-boundary and thus trivial in H1. It is said to be trivial. The Betti number b1 counts the number of non-trivial equivalence classes of 1-cycles.

In Fig. 6, two 1-cycles are highlighted in gray and blue. The grey cycle encloses only voxels which are active within the region. The cycle is therefore a boundary of these voxels and thus the gray loop is trivial. Since the cubical complex does not contain the omitted (white) squares, the blue cycle is fundamentally different from the gray—it is non-trivial, since it cannot be expressed as the boundary of a collection of 2-cubes. Any attempt to express it as such a 2-boundary would require the “missing” voxels. The blue cycle is equivalent to many other loops including the boundary of the two omitted squares. We see this by noting the difference between the original blue cycle and the boundary of the omitted square is precisely the set of 2-cubes enclosed between the two cycles. These two cycles are equivalent from a homological perspective, and persistent homology counts them as one in the same, since they both enclose the same topological hole. Thus b1 = 1 for the region displayed in Fig. 6 since there is a single non-trivial cycle. For completeness, b0 = 1, since the region is connected.

Fig. 6
figure 6

The figure displays a filtered cubical complex. The two-dimensional cells (square voxels in this case) are colored by their signal amplitude, with darker red corresponding to higher signal amplitude, and yellow corresponding to lower signal amplitude. White regions correspond to voxels whose signal amplitude does not satisfy the threshold constraint and thus are not within the region. Two loops are highlighted. The grey loop on the left bounds voxels completely contained within the region so it is a trivial loop and does not contribute to b1. In contrast, the blue loop bounds voxels which are not within the region (the excluded white voxels) and contributes to b1

An Example. We illustrate our topological constructions with an example. A two-dimensional filtered cubical complex is displayed in the interactive display of (Online Resource 1), where the color of a square indicates its signal amplitude (filtration) value. (Online Resource 1) provides a slider below the figure which allows the user to vary the threshold interactively and see the resulting cubical complex. We compute the persistence diagram for b0 and b1 of this small example. The initial cubical complex, with threshold parameter Bmax = 10, has four connected components with no non-trivial loops. Hence, b0 = 4 and b1 = 0. Decreasing the signal amplitude threshold to 9 introduces three additional squares which in turn changes to the resulting topology. Two of the four components from the previous threshold are now merged. Furthermore, a loop has now formed in the bottom right. Thus, b0 = 3 and b1 = 1 for a signal threshold of 9. As we continue to decrease the signal threshold, the topology of the cubical complex continues to change. At a signal threshold of 5, the cubical complex becomes connected, so b0 = 1. In particular, the loop formed at a threshold of 9 lives until the threshold becomes the minimum Bmin = 1. The loop surrounding this square lives for a relatively long duration. This is indicative of a square (or more generally a region) of low activation being surrounded by an area of high activation. Such features are highlighted by persistent homology and appear in the persistence diagram as points very far from the y = x line.

Our topological analysis of fMRI signals follows the same flow as in the example of (Online Resource 1). We begin with a maximum threshold determined by the largest signal amplitude. As we reduce the signal amplitude threshold, we track how the topology of the resulting cubical complex changes. An interactive visualization for fMRI signal in the ACC is shown in (Online Resource 2). Starting from the maximum threshold Bmax = 1900, there are three connected components. As the signal threshold decreases, new connected components are formed and merged together. The persistence diagram summarizes these changes which are then reflected in the persistence landscape.

Persistence Landscapes. The persistence diagram provides a useful visualization of the geometric properties of a filtered cubical complex. However, standard statistical analysis applied to persistence diagrams is not always straightforward or interpretable. To remedy this, vectorization schemes were developed, allowing persistence diagrams to be embedded into vector spaces where standard statistical tests can be applied. One such vectorization scheme is known as the Persistence Landscape. Persistence landscapes provide a convenient, non-parametric vectorization of the diagram with no additional parameters to tune. They are essentially a repackaging of the same information provided by persistent homology amenable to arithmetic manipulation. Importantly, they provide a stable avenue to apply the techniques of machine and statistical learning to the output of persistent homology.

A persistence landscape constructs a sequence of piecewise-linear functions λk from a given diagram. Explicitly, for each point (b,d) in the diagram, first define the auxiliary function.

The graph of each f(b,d) function is an isosceles triangle whose base is precisely the interval (b, d) and whose height is determined by d-b. Finally, the persistence landscape is the sequence of functions {λk}, where each λk is a real-valued function defined so λk(t) is the kth-largest value of the collection of auxiliary functions{f(b,d)(t)}. Therefore, λ1(t) is the largest value of {f(b,d)(t)} for each t, λ2(t) is the second largest value of {f(b,d)(t)}, and so on.

As functions can be added, subtracted, and multiplied by real scalars, they naturally exhibit a vector space structure. Moreover, it is easy to construct the mean persistence landscape of a given set of persistence landscapes (whereas a mean persistence diagram might fail to exist). This allows us to easily perform statistical tests (e.g., permutation tests) on a set of labeled persistence landscapes which would be much more difficult on the underlying diagrams.

The conversion of a persistence diagram to a persistence landscape just described is shown in Fig. 2. Starting in Fig. 2a left, we see a simple persistence diagram. The vectorization procedure begins in Fig. 2a second from left, by drawing horizontal and vertical lines from each point in the diagram to the diagonal line y = x. The entire picture is rotated in Fig. 2a middle. We take outer envelopes of the dashed piecewise-linear lines of Fig. 2a middle to construct a sequence of functions λk, k ≥ 1. Thus, λ1 consists of the outer-most envelope, λ2 consists of the second outer-most envelope, and so forth (Fig. 2a right). The entire sequence of functions λk is the persistence landscape. In practice, each of these functions is sampled at a large number (roughly 1000) of points and concatenated to construct a single vector. We use the persim package of scikit-tda to compute the persistence landscape in practice. The procedure is the same for actual experimental data, albeit the output is more complicated (Fig. 2b).

Statistical Testing

We now describe in detail our labelled permutation test and support vector classifier (SVC) which comprise the main statistical tests. In addition, we also performed LASSO tests on the data.

Permutation Tests. We perform a total of six labelled permutation tests, each specified by a pair of task conditions from (Periodic, Random, Rest) and a homological degree (0 or 1). The first step in each test is to construct the baseline significance. This is done by computing the average landscape of the selected conditions individually, remembering that landscapes can be treated as vectors in a vector space where arithmetic operations are well-defined. The baseline significance is the supremum norm of the difference of the averages. The second step is to perform a stratified shuffle of the labeling on the original landscapes, so that the correct ratio is maintained between the labels. For each shuffle, the above procedure is repeated: compute the average landscape with respect to the shuffled labelling and compute the supremum norm of their difference. If the supremum norm from a shuffled labelling is greater than the baseline significance, we deem the shuffled labelling to be significant. After 1500 shuffles, the p-value of the test if the number of significant shuffles divided by 1500. These p-values are reported in Fig. 3.

Support Vector Classifiers. The support vector classifiers also depend on a pair of task conditions; however, the landscapes are concatenated along their homological degree for this test. In particular, if λ0 and λ1 are the landscape vectors in degree 0 and 1 respectively, then the vector λtot = (λ0, λ1) is used for construction of the SVC. Note that since λtot contains both λ0 and λ1 there is no loss in topological information in doing the concatenation. Each SVC is validated using tenfold cross-validation, a commonly used technique in machine learning. For each pair of test conditions, only 90% of the labelled data is used in the construction of the SVC. The remaining 10% is used to test the validity of the SVC in terms of its classification accuracy—we count how many of the remaining 10% of the data was correctly classified. This process is repeated 10 times or folds, so that at the end, the SVC algorithm has been tested against every data point exactly once. The classification accuracy from each of the 10 folds are averaged, and the results are displayed in Figs. 4 and 5.

The hyper-parameters of each SVC were determined by performing a standard grid search with 5-fold cross validation over the regularization parameter (typically denoted ‘C’) and the kernel type (whether ‘linear’, polynomial ‘poly’, or ‘sigmoid’). For the polynomial kernel, degrees less than 4 were also sampled over.

LASSO. We also tested our topological approach through the lens of a LASSO classifier. LASSO (least absolute shrinkage and selection operator) regression is a statistical analysis method that allows for variable selection by enforcing an L1 regularization penalty in its optimization routine. This leads to enhanced interpretability of the results and improved summary of the data. In particular, LASSO provides in-built feature selection, useful for analyzing high-dimensional data. Figure 7 displays the classification accuracies of a LASSO classifier applied to our persistence landscape (TDA-based) summary versus our non-TDA vectorized approach. The TDA-based approach outperforms the non-TDA vectorization in almost every case. More generally however, LASSO underperforms the SVC pipeline (TDA and Vectorization, see Fig. 4). This is unsurprising because a LASSO classifier constructs a simple linear classifier which is a simpler statistical model than an SVC (with non-linear kernel).

Fig. 7
figure 7

The heat maps for LASSO classification accuracies for TDA and non-TDA vectorized approaches (darker red indicates greater accuracy). a The non-TDA vectorization LASSO classification accuracies were above average (median accuracy = 59%). b The LASSO accuracies resulting from the TDA pipeline were higher (median accuracy = 62%) but still underperformed our SVC results. There were no discernible trends in comparing the multiclass, three-way classifier in either case. Comparing with Fig. 4, we find SVCs provide a stronger predictor than LASSO

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Catanzaro, M.J., Rizzo, S., Kopchick, J. et al. Topological Data Analysis Captures Task-Driven fMRI Profiles in Individual Participants: A Classification Pipeline Based on Persistence. Neuroinform 22, 45–62 (2024). https://doi.org/10.1007/s12021-023-09645-3

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s12021-023-09645-3

Keywords

Navigation