TopoAgent: An Agentic Framework for Automated Topology Learning in Medical Imaging
Abstract
Topological data analysis (TDA), particularly persistent ho-mology (PH), captures geometric structural properties in medical im-ages (e.g., connected components, loops, shape characteristics), whichconventional pixel-level deep learning approaches often neglect. Whilemany topological descriptors are known for converting persistence di-agrams (PDs) or raw images into topological feature vectors, existingmethods mostly default to a single fixed descriptor (e.g., persistenceimages), leaving the diversity of topological representations largely un-explored. To the best of our knowledge, there is no known large lan-guage model (LLM)-based agentic framework that can automaticallydetermine the most suitable topological descriptors for a given imagedataset and produce the corresponding topological feature vectors fordownstream tasks. To fill this gap, we propose TopoAgent, an LLM-based agentic framework that automates topology learning for medicalimage analysis. TopoAgent operates through a Perception–Reasoning–Action–Reflection loop supported by 21 domain-specific tools and dualmemory that accumulates experience across runs. Its skill set is dis-tilled from systematic evaluation of 15 topological descriptors across 26datasets with six classifiers. TopoAgent analyzes input images and theirtopological characteristics, reasons about which topological descriptorsbest suit the input, and determines the optimal descriptor and its con-figuration, all without task-specific training. To evaluate TopoAgent, weintroduce TopoBenchmark, a frozen benchmark of 113,182 samplesfrom 26 medical image datasets spanning five object types: cells, glandsand lumens, organ shapes, vessel trees, and surface lesions. Experimentsshow that TopoAgent obtains 68.21% average balanced accuracy, out-performing the strongest baseline by 9.32% and general-purpose LLMsequipped with the same tools by over 21%.