Deconstructing the Mapper algorithm to extract richer topological and temporal features from functional neuroimaging data

Daniel Haşegan, Caleb Geniesse, Samir Chowdhury, Manish Saggar

TL;DR

The Mapper algorithm is a powerful tool for turning complex brain activity into intuitive "shape graphs," but its results are notoriously sensitive to hidden parameter choices. This paper systematically deconstructs the Mapper pipeline, provides evidence-based heuristics for neuroimaging, and introduces DeMapper, an open-source toolbox to help researchers navigate the parameter maze.

What Problem Does This Paper Address?

Functional MRI (fMRI) data is high-dimensional, noisy, and lacks a "ground truth" for when the brain transitions between states. Topological Data Analysis (TDA), specifically the Mapper algorithm, has emerged as a favorite for visualizing these dynamics because it doesn't require a priori assumptions about the number of brain states.

However, Mapper is often treated as a "black box." Small changes in distance metrics, dimensionality reduction techniques, or binning strategies can lead to wildly different graphs. Without a systematic way to choose these parameters, researchers risk over-interpreting artifacts or missing subtle transitions. This paper aims to turn "educated guesses" into a rigorous methodology.

Methods

The authors deconstruct the Mapper algorithm into five distinct steps and test various options for each:

  1. Distance Metric: Comparing magnitude (Euclidean), angle (Cosine/Correlation), and geodesic (shortest-path on a k-NN graph) measures.
  2. Filtering (Lens): Projecting high-dimensional data into 2D/3D. They compare "Extrinsic" methods (PCA, CMDS, UMAP, t-SNE) against an "Intrinsic" approach that uses geodesic distances directly.
  3. Binning: Segmenting the projected space into overlapping regions. They explore the relationship between Resolution (number of bins) and Gain (amount of overlap).
  4. Partial Clustering: Grouping data points within bins using algorithms like Single Linkage or DBSCAN.
  5. Graph Construction: Linking clusters that share data points to create the final "shape graph."

To validate these choices, they developed specific Goodness-of-Fit (GOF) measures, such as "circle-ness" (checking if the graph captures a known cyclical transition) and "average delay time" (how closely the graph-predicted state changes match actual task timings).

Datasets

  • Simulated BOLD Signal: Created using a biophysical network model (Wong-Wang/Wilson-Cowan). This provided a "gold standard" ground truth where the brain was known to cycle through four states in a circular topology.
  • Real fMRI (CMP Dataset): Data from 18 participants performing a Continuous Multi-Task Paradigm involving Rest, Working Memory, Video watching, and Math. This tested the algorithm's performance on messy, real-world neural dynamics.

Key Insights and Ideas

  • Geodesic is King (mostly): Geodesic distances (calculating distance as "hops" between neighbors) significantly outperformed standard Euclidean distance in capturing transitions, though they are more sensitive to high-frequency noise.
  • The "Old Reliable" CMDS: While trendy algorithms like t-SNE and UMAP are popular for visualization, they often failed to preserve the global topology (like the circular structure of the simulated data). Classical Multidimensional Scaling (CMDS) proved much more robust for Mapper.
  • Resolution and Gain are Correlated: You can't tune one without the other. High resolution requires high gain to maintain connectivity; otherwise, the graph "shatters" into disconnected components.
  • Clustering Matters: There is no "one size fits all" clustering algorithm. Single Linkage worked better for the clean simulated data, while DBSCAN was superior for handling the noise in real fMRI data.

Key Results

  • Transition Accuracy: Using the optimal parameters (Geodesic Euclidean, CMDS, and specific resolution/gain), Mapper predicted task transitions in real fMRI data with an average delay of only 5.7 seconds. Sub-optimal choices (like Correlation distance) blew this delay out to 42 seconds.
  • Robustness: The authors demonstrated that non-geodesic distances are more resilient to white noise, but geodesic distances provide much higher "topological resolution" when the signal-to-noise ratio is reasonable.
  • Software Release: The DeMapper toolbox (MATLAB) allows for batch-processing hundreds of parameter combinations, mimicking a "hyperparameter search" common in machine learning.

Limitations and Future Work

  • Task Design: The study focused on block-design fMRI. The authors acknowledge that event-related or naturalistic (movie-watching) fMRI might require different heuristics.
  • Modality: The findings are currently limited to fMRI. Future work is needed to see if these heuristics hold for EEG, MEG, or fNIRS, which have different temporal and spatial properties.
  • Theoretical Stability: While the paper provides empirical guidance, the authors note that more work is needed on the underlying mathematical "stability" of Mapper graphs—ensuring that small perturbations in data don't lead to massive changes in the resulting shape.

Summary updated

Abstract

Capturing and tracking large-scale brain activity dynamics holds the potential to deepen our understanding of cognition. Previously, tools from topological data analysis, especially Mapper, have been successfully used to mine brain activity dynamics at the highest spatiotemporal resolutions. Even though it is a relatively established tool within the field of topological data analysis, Mapper results are highly impacted by parameter selection. Given that noninvasive human neuroimaging data (e.g., from fMRI) is typically fraught with artifacts and no gold standards exist regarding "true" state transitions, we argue for a thorough examination of Mapper parameter choices to better reveal their impact. Using synthetic data (with known transition structure) and real fMRI data, we explore a variety of parameter choices for each Mapper step, thereby providing guidance and heuristics for the field. We also release our parameter exploration toolbox as a software package to make it easier for scientists to investigate and apply Mapper to any dataset.
BibTeX
@inproceedings{hasegan2024deconstructing,
  author = {Daniel Haşegan and Caleb Geniesse and Samir Chowdhury and Manish Saggar},
  title = {{Deconstructing the Mapper algorithm to extract richer topological and temporal features from functional neuroimaging data}},
  booktitle = {Network},
  year = {2024},
  doi = {10.1162/netn\_a\_00403},
}
Figure