TopoAgent: A Structure-Aware Perception-to-Reasoning Framework for Diagram-to-Graph Topology Extraction with Large Vision-Language Models

Bangwei Guo, Xujiang Zhao, Yanchi Liu, Wei Cheng, Shengyu Chen, Dongyue Li, Masaharu Morimoto, Takayuki Kuroda, Dimitris Metaxas, Haifeng ChenarXiv 2026

TL;DR

The paper introduces TopoAgent, a structure-aware AI agent framework that accurately extracts underlying graph topologies (nodes and edges) from complex visual diagrams. By breaking down the task into localized perception and node-centric reasoning stages, it significantly reduces hallucinations and edge inconsistencies common in standard Vision-Language Models (VLMs). The authors also release TopoBench-180, a human-verified benchmark to rigorously evaluate diagram-to-graph extraction.

What Problem Does This Paper Address?

Technical and scientific diagrams—such as network topologies, flowcharts, and food webs—convey rich relational data through text labels, visual connectors, and spatial layouts. While modern VLMs excel at visual question answering, they struggle to extract the entire underlying graph structure accurately.

As shown in Figure 1, general-purpose VLMs often suffer from two main issues:

  1. Limited Perceptual Grounding: They miss fine-grained visual details like thin lines, overlapping connectors, or tiny arrowheads.
  2. Lack of Topology Consistency: They generate topologically impossible structures, such as hallucinating non-existent nodes or outputting conflicting edge directions.

This paper addresses the challenge of achieving both precise local perceptual grounding and global topological consistency during diagram-to-graph extraction.

Motivating comparison showing how general VLMs and visual baselines fail compared to TopoAgent.

Methods

Instead of relying on a "one-shot" graph generation prompt, TopoAgent utilizes a multi-stage perception-to-reasoning pipeline that progressively builds a globally coherent graph:

  1. Perception & Grounding: The framework partitions the diagram into candidate visual regions using geometric cues and OCR (via PaddleOCR). It then uses a VLM to generate structured summaries for each region, capturing local text and primitive shapes.
  2. Global Figure Attribute Inference: The model predicts high-level structural priors (e.g., diagram type, link directionality, and link density) to guide downstream steps.
  3. Canonical Node Inventory Construction: Visual and OCR evidence are consolidated into a stable, symbolic list of valid nodes, filtering out decorative text or noise.
  4. Node-Centric Local-to-Global Relation Reasoning: To avoid visual clutter and cognitive overload, the system decomposes full-graph extraction into $N$ smaller subproblems, prompting the VLM to predict edges originating from only one focus node at a time.
  5. Topological Consistency Enforcement: Finally, an LLM-based self-check and deterministic post-processing rules (e.g., ensuring all edge endpoints exist in the node inventory and enforcing single-component connectivity) clean up and validate the final graph structure.
Figure 3: Overview of the proposed TopoAgent framework for diagram-to-graph topology extraction. The pipeline begins with a perception and grounding stage that decomposes the input diagram into grounded regions, aligns them with OCR-recognized text, and constructs region-level structured summaries. These grounded representations are then passed to a local-to-global topology reasoning pipeline, which produces a structured topology JSON representing the extracted graph.

Datasets

The authors introduce TopoBench-180, a benchmark consisting of 180 high-quality diagram-graph pairs. Curated from public datasets (like AI2D) and web searches, the dataset is split into two distinct categories to test different connectivity patterns:

  • Web-style diagrams (54 images): Food webs and biological interaction graphs where relations are primarily direction-sensitive arrows.
  • Network-style diagrams (126 images): Computer network topologies where connections are typically bidirectional or undirected.

The dataset was constructed using a rigorous multi-stage quality gating pipeline and expert manual calibration to ensure gold-standard graph annotations.

Figure 2: Pipeline for constructing the TopoBench-180 benchmark. Candidate diagrams are collected from ex- isting public datasets, public web sources, and curated internal sources. The initial pool of raw images is then filtered through a multi-stage quality gating pipeline consisting of content-based de-duplication, VLM-driven pruning, and annotator cross-audit. For each retained diagram, a draft graph is first generated under a unified topology schema and then manually verified and refined by annotators to produce the final canonical graph anno- tation.

Key Insights and Ideas

  • Decomposition Beats Holistic Vision: Trying to parse a complex graph all at once causes VLMs to miss subtle details. Focusing on one node at a time (node-centric reasoning) dramatically improves edge recall.
  • Global Priors Guard Local Decisions: Inferring whether a diagram is generally directed or undirected before analyzing individual lines helps resolve ambiguous visual connectors (like overlapping or faint lines).
  • Symbolic Scaffolding Prevents Hallucination: Locking down a "node inventory" before predicting edges acts as a strict guardrail, preventing the model from inventing random connections to non-existent entities.

Key Results

The authors evaluated TopoAgent against strong closed-source VLMs, open-source VLMs, and specialized visual reasoning frameworks.

Main experimental results on TopoBench-180.
  • Superior Edge Extraction: TopoAgent achieved the highest overall performance across both subsets. On the challenging Network-style diagrams, TopoAgent achieved an Edge F1 score of 58.1, substantially outperforming vanilla GPT-4o (53.5) and the strongest open-source baseline, Qwen2.5-VL-Instruct-72B (47.5).
  • Ablation Validation: Removing either the node-centric reasoning or the final consistency self-check caused sharp declines in Edge F1, confirming that the agentic pipeline design is the primary driver of performance rather than just the underlying VLM's raw power.

Limitations and Future Work

  • Scale and Coverage: With only 180 diagrams, TopoBench-180 is relatively small and does not cover the full diversity of real-world technical documentation. The authors suggest using synthetic diagram generation to scale up future benchmarks.
  • Inference Efficiency: The multi-stage, node-centric pipeline requires multiple sequential API calls per diagram (averaging 14.04 calls per diagram compared to 1.00 for single-pass baselines). This introduces significant latency and computational cost.
  • Future Directions: The authors propose exploring more compact reasoning pipelines and routing local node-level tasks to smaller, specialized open-source VLMs while reserving frontier models for global planning and verification.

Summary updated

BibTeX
@misc{guo2026topoagent,
  author = {Bangwei Guo and Xujiang Zhao and Yanchi Liu and Wei Cheng and Shengyu Chen and Dongyue Li and Masaharu Morimoto and Takayuki Kuroda and Dimitris Metaxas and Haifeng Chen},
  title = {{TopoAgent: A Structure-Aware Perception-to-Reasoning Framework for Diagram-to-Graph Topology Extraction with Large Vision-Language Models}},
  year = {2026},
  eprint = {2608.28701},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.28701},
}
Figure