TL;DR
TopoAgent is the first LLM-based agentic framework designed to automate Topological Data Analysis (TDA) for medical imaging. By utilizing a specialized reasoning loop and a distilled expert "skill set," it automatically selects and configures the best topological descriptors for a given image, outperforming general-purpose LLMs and fixed-descriptor baselines by over 21% and 9%, respectively.
What Problem Does This Paper Address?
Topological Data Analysis (TDA), particularly Persistent Homology (PH), is a powerful tool for medical imaging. It captures structural features—like the branching of blood vessels, the arrangement of cells, or the loops in glandular tissue—that standard pixel-level deep learning often misses.
However, TDA has a "usability" bottleneck. To use PH in a machine learning pipeline, you must convert complex persistence diagrams into fixed-length feature vectors using "topological descriptors." There are dozens of these descriptors (e.g., Persistence Images, Betti Curves, Minkowski Functionals), and no single descriptor works best for every dataset. Currently, choosing the right one requires a TDA expert to perform extensive manual trial-and-error.
The authors address this by asking: Can we build an AI agent that reasons about an image's morphology and automatically picks the best topological tool for the job?
Methods
The authors introduce TopoAgent, which operates via a Perception–Reasoning–Action–Reflection (PRAR) loop. Unlike a simple chatbot, this agent is equipped with a library of 21 domain-specific tools and a specialized knowledge base.
Key Components:
- The PRAR Loop:
- Perception: The agent uses tools to extract a "topological profile" (e.g., Betti ratios, persistence statistics) and identifies the object type (e.g., "vessel tree").
- Reasoning: A two-step process where the agent first proposes a descriptor based on mathematical properties and then refines that choice using empirical evidence.
- Action: The agent calls the specific TDA tool with optimized parameters.
- Reflection: The agent inspects the resulting feature vector for quality issues (like excessive sparsity) and retries if necessary.
- The Skill Set ($S$): This is the "brain" of the agent, containing distilled knowledge from a systematic evaluation of 15 descriptors across 26 datasets. It includes qualitative properties, tiered rankings, and validated hyperparameter ranges.
- Dual Memory: A short-term memory tracks actions within a single run, while a long-term memory allows the agent to learn from failures across different images in the same dataset.
- Anti-Anchoring Design: To prevent the LLM from blindly following rankings (acting as a simple lookup table), the authors hide the empirical rankings during the initial "Proposal" phase, forcing the agent to reason independently first.
Datasets
The authors introduce TopoBenchmark, a massive, standardized testbed for TDA in medical imaging.
- Scale: 113,182 samples across 26 datasets.
- Diversity: Covers 11 imaging modalities and 5 distinct morphological categories: cells, glands/lumens, organ shapes, vessel trees, and surface lesions.
- Purpose: It provided the empirical data used to distill the TopoAgent Skill Set and serves as a frozen benchmark for evaluation.
Key Insights and Ideas
- No Universal Winner: The paper confirms that the "best" descriptor varies wildly. For example, Minkowski Functionals might excel at skin lesions, while Persistence Statistics are better for glandular tissue (see Figure 1a).
- LLMs Need Grounding: General-purpose LLMs (like GPT-4o or Claude) fail at TDA tasks even when given the tools because they lack "empirical grounding"—they don't know which mathematical properties actually translate to high classification accuracy in practice.
- Visual + Topological Synergy: The agent performs best when it "sees" both the raw image and the abstract topological summary. This helps it distinguish between visually similar but topologically different structures, like dense cell clusters vs. fragmented lumen boundaries.
- Interpretability: Unlike "black-box" deep learning features, the descriptors TopoAgent selects (like Minkowski functionals) provide interpretable geometric signatures like area, perimeter, and Euler characteristics.
Key Results
- Superior Accuracy: TopoAgent achieved 68.21% average balanced accuracy across the benchmark.
- Outperforming Baselines: It beat the strongest non-adaptive baseline (an "oracle" that always picks the best descriptor for a specific object type) by 9.32%.
- Agentic Advantage: It outperformed general-purpose LLMs equipped with the same tools by over 21%, proving that the PRAR framework and Skill Set are essential.
- Downstream Integration: When TopoAgent's features were fused with standard backbones (ResNet-152, SwinV2-B), it matched or exceeded the performance of state-of-the-art learnable topology layers (like PHG-Net) without requiring task-specific training.
Limitations and Future Work
- Dimensionality: Currently, the framework and benchmark are limited to 2D images. Extending this to 3D volumetric data (like CT or MRI scans) is a logical next step.
- Latency: The agentic loop is relatively slow, taking about 32 seconds per image due to multiple LLM calls. While practical for batch processing, it is not yet suitable for real-time applications.
- Domain Specificity: The current Skill Set is distilled from medical images. Using TopoAgent for other fields (like materials science or satellite imagery) would require a new round of knowledge distillation.
- Multi-Descriptor Fusion: Future versions could explore using the agent to combine multiple descriptors for even richer feature sets.
Summary updated