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:
- Limited Perceptual Grounding: They miss fine-grained visual details like thin lines, overlapping connectors, or tiny arrowheads.
- 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.
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:
- 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.
- Global Figure Attribute Inference: The model predicts high-level structural priors (e.g., diagram type, link directionality, and link density) to guide downstream steps.
- Canonical Node Inventory Construction: Visual and OCR evidence are consolidated into a stable, symbolic list of valid nodes, filtering out decorative text or noise.
- 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.
- 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.
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.
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.
- 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