[Paper] MMPersistence: A mathematical morphology-oriented software library for computing persistent homology on cubical complexes

Published: (February 17, 2026 at 06:15 AM EST)
5 min read
Source: arXiv

Source: arXiv - 2602.15502v1

Overview

The paper introduces MMPersistence, a new open‑source library that marries two classic image‑analysis toolkits: mathematical morphology (the set‑theoretic operations that underlie erosion, dilation, opening, and closing) and persistent homology on cubical complexes. By letting users build filtrations with arbitrary structuring elements (SEs), the library extracts multiscale topological signatures that capture both local shape information and global connectivity—something that standard cubical homology alone cannot provide.

Key Contributions

  • Unified framework that integrates morphological operators with persistent homology (PH) on cubical complexes.
  • SE‑driven filtrations: users can define arbitrary structuring‑element shapes (disks, squares, custom kernels) to generate topological filtrations that encode spatial and morphological cues.
  • Extension of GUDHI: builds on the well‑tested GUDHI PH engine, adding a thin, Python‑friendly wrapper for image‑centric workflows.
  • Rich feature set: provides ready‑to‑use pipelines for erosion/dilation‑based filtrations, opening/closing filtrations, and mixed‑SE cascades.
  • Open‑source release (MIT‑style license) with documentation, examples, and bindings for NumPy‑compatible arrays.

Methodology

  1. Cubical Complex Construction – The input image (grayscale or binary) is interpreted as a cubical complex where each pixel/voxel becomes a 0‑cell and each adjacency defines higher‑dimensional cells.

  2. Morphological Filtration Generation – A chosen structuring element is slid across the image. At each step the morphological operation (e.g., erosion) produces a new binary mask. The sequence of masks, ordered by the size or iteration count of the SE, forms a filtration: a nested family of subcomplexes (K_0 \subseteq K_1 \subseteq \dots \subseteq K_n).

  3. Persistent Homology Computation – For each filtration step the library hands the cubical complex to GUDHI’s PH engine, which computes birth–death pairs for homology groups (H_0) (connected components), (H_1) (loops), and optionally higher dimensions for 3‑D data.

  4. Feature Extraction – The resulting persistence diagrams or barcodes can be turned into summary statistics (e.g., total persistence, Betti curves) or fed directly into machine‑learning pipelines.

All steps are exposed through a high‑level Python API:

import mmpersistence as mmp

# Load image as NumPy array
img = mmp.load_image('sample.png')

# Define a square structuring element of radius 3
se = mmp.StructuringElement.square(radius=3)

# Build an erosion‑based filtration and compute PH
diagram = mmp.compute_ph(img, se, operation='erosion')

The design deliberately hides the low‑level combinatorial details, letting developers focus on what morphological filter to use rather than how the underlying cubical complex is represented.

Results & Findings

  • Richer Descriptors – Compared to a baseline PH computation on the raw image, SE‑driven filtrations produced persistence diagrams with significantly higher total persistence in (H_1), indicating that morphological preprocessing surfaces hidden loop structures (e.g., thin bridges, filamentary patterns).

  • Robustness to Noise – Using opening/closing filtrations with modest SE sizes filtered out spurious small components while preserving the lifetimes of truly persistent features, leading to cleaner barcodes and more stable downstream classifiers.

  • Application Benchmarks – On a standard medical‑imaging dataset (brain MRI slices), a simple logistic‑regression model trained on persistence vectors from MMPersistence achieved a 4–6 % boost in classification accuracy over a model using only raw PH features.

  • Performance – Leveraging GUDHI’s optimized cubical PH engine, the added morphological steps incurred less than 15 % overhead on 2‑D images of size 512 × 512, and the library scales linearly with the number of filtration steps.

Practical Implications

Developer NeedHow MMPersistence Helps
Feature engineering for vision modelsGenerate topological descriptors that complement CNN embeddings, especially when data is scarce or interpretability matters.
Shape analysis in CAD / GISUse custom SEs (e.g., anisotropic kernels) to capture direction‑dependent features like road networks or fracture patterns.
Medical image QADetect subtle topological anomalies (e.g., missing vessels) by examining persistent loops after morphological smoothing.
Rapid prototypingOne‑line API integrates with existing NumPy/PyTorch pipelines; no need to hand‑craft cubical complexes.
Explainable AIPersistence diagrams provide visual, mathematically grounded explanations of why a region is considered “connected” or “loop‑like”.

In short, MMPersistence gives developers a plug‑and‑play way to enrich image‑processing pipelines with mathematically rigorous, multiscale topology without sacrificing performance.

Limitations & Future Work

  • Dimensionality – Current implementation focuses on 2‑D and 3‑D cubical complexes; extending to higher‑dimensional data (e.g., time‑series stacks) will require additional memory optimizations.
  • SE Selection – The library does not yet provide automated SE‑selection heuristics; choosing the right shape/size remains a user decision.
  • GPU Acceleration – Morphological operations are CPU‑bound; future releases aim to offload SE convolutions to GPUs for large‑scale video or volumetric workloads.
  • Integration with Deep Learning – While basic examples show coupling with scikit‑learn, tighter bindings to PyTorch/TensorFlow (e.g., differentiable persistence layers) are planned.

Overall, MMPersistence opens a practical pathway for developers to blend the local precision of mathematical morphology with the global insight of persistent homology—paving the way for more robust, interpretable image‑analysis tools.

Authors

  • Chuan-Shen Hu

Paper Information

  • arXiv ID: 2602.15502v1
  • Categories: cs.SE, math.AT
  • Published: February 17, 2026
  • PDF: Download PDF
0 views
Back to Blog

Related posts

Read more »