Automating the digitization of Piping and Instrumentation Diagrams (P&IDs) into structured process graphs would unlock significant value in plant operations, yet progress is bottlenecked by a fundamental data problem: engineering drawings are proprietary, and the entire community shares a single public benchmark of just 12 annotated images. Prior attempts at synthetic augmentation have fallen short because template-based generators scatter symbols at random, producing graphs that bear little resemblance to real process plants and, accordingly, yield only approximately 33% edge detection accuracy under synth-only training. We argue the failure is structural rather than visual and address it by introducing SynthPID, a corpus of 665 synthetic P&IDs whose pipe topology is seeded directly from real drawings. Paired with a patch-based Relationformer adapted for high-resolution diagrams, a model trained on SynthPID alone achieves 63.8 +/- 3.1% edge mAP on PID2Graph OPEN100 without seeing a single real P&ID during training, closing within 8 pp of the real-data oracle. These gains hold up under a controlled comparison against the template-based regime, confirming that generation quality drives performance rather than model choice. A scaling study reveals that gains flatten beyond roughly 400 synthetic images, pointing to seed diversity as the binding constraint.
Figures & tables
Figure 1: Method overview. Twelve real P&IDs serve as structural seeds. Our generator perturbs each seed’s topology and re-renders it, producing SynthPID: 665 diverse synthetic P&IDs with full graph annotation. After connector collapsing and patch extraction, a Relationformer is trained on these patches and evaluated on the original real images via patch merging.
Figure 2: The visual domain gap. Real OPEN100 P&IDs (top) have white backgrounds and professional drafting conventions; SynthPID images (bottom) have a grey background and a different rendering style. Despite this, both share the same symbol vocabulary and, critically, the same pipe topology statistics.
Figure 3: Degree distribution (a) and edge density (b) for three corpora. SynthPID tracks the real OPEN100 distribution closely; template-based synthetic data does not.
Node classes (7)
Edge classes (2)
valve, pump, instrumentation
solid
general, tank, arrow, inlet/outlet
non-solid
Table 1: Output vocabulary used throughout all experiments.
Dataset
# Images
Nodes/img
Edges/img
OPEN100 (real)
12
147±52
65±28
SynthPID (seed-synth)
665
231±44
152±37
Table 2: Dataset statistics after connector collapsing.
Table 3: Node [email protected] and edge mAP on OPEN100 (stitched evaluation). Bold: our primary result (E2, zero real training data). † Estimated from Appendix A5 of [ 18 ] , described as “suffers significantly” relative to the full model. Our results: mean ± std over 15 runs.
Figure 4: Edge mAP versus number of synthetic training images. Performance rises sharply up to around 400 images (+12.5 pp from 100) and then begins to level off (+5.1 pp from 400 to 665), suggesting that seed diversity rather than image volume is the limiting factor.
Table 4: Per-class node [email protected] under E2 (zero real training data).
Figure 5: Ground truth (left) versus SynthPID predictions (right) on a real OPEN100 P&ID (top row) and a synthetic image (bottom row), both under E2. Solid boxes and solid edge lines are true positives; dashed elements are false positives. The model reconstructs the main process topology without any real training data, with errors concentrated in the general class and densely packed regions.
Piping and Instrumentation Diagrams (P&IDs) are the authoritative maps of process plants: isolation, maintenance, and HAZOP decisions depend on what connects to what. Vision-language models describe these sheets fluently, yet they often invent or miss process connections---and an invented or missed link can reverse an isolation or reachability call, so a plant decision cannot trust a fluent answer that was never checked against the linework. We instead recover an explicit graph of the drawing---its symbols, the process connections between them, and the tags that name them---and then require the model to answer only by querying that graph through seven read-only operators, so a topology claim is returned only when it cites the query results that support it. On TopoPID-VQA, a new suite of 3000 topology questions over these sheets, Graph-Grounded Harness (Ours) raises exact match accuracy from 36.7--41.3% under image-only prompting to 74.3--76.0% for Qwen3-VL-4B, Qwen3-VL-8B, and Gemma-4-E4B. It does so on an imperfect substrate: on Digitize-PID dataset the recovered graph scores F1 0.742 on exact process connections, and 0.801 once symbols and tags are pooled in. The residual errors track that gap---grounding pays off where the recovered graph is right, and perception error still breaks topology questions where it is not.
Large Language Models (LLMs) combined with Retrieval-Augmented Generation (RAG) and knowledge graphs offer new opportunities for interacting with engineering diagrams such as Piping and Instrumentation Diagrams (P&IDs). However, directly processing raw images or smart P&ID files with LLMs is often costly, inefficient, and prone to hallucinations. This work introduces ChatP&ID, an agentic framework that enables grounded and cost-effective natural-language interaction with P&IDs using Graph Retrieval-Augmented Generation (GraphRAG), a paradigm we refer to as GraphRAG for engineering diagrams. Smart P&IDs encoded in the DEXPI standard are transformed into structured knowledge graphs, which serve as the basis for graph-based retrieval and reasoning by LLM agents. This approach enables reliable querying of engineering diagrams while significantly reducing computational cost. Benchmarking across commercial LLM APIs (OpenAI, Anthropic) demonstrates that graph-based representations improve accuracy by 18% over raw image inputs and reduce token costs by 85% compared to directly ingesting smart P&ID files. While small open-source models still struggle to interpret knowledge graph formats and structured engineering data, integrating them with VectorRAG and PathRAG improves response accuracy by up to 40%. Notably, GPT-5-mini combined with ContextRAG achieves 91% accuracy at a cost of only $0.004 per task. The resulting ChatP&ID interface enables intuitive natural-language interaction with complex engineering diagrams and lays the groundwork for AI-assisted process engineering tasks such as Hazard and Operability Studies (HAZOP) and multi-agent analysis.
Achmad Anggawirya Alimin, Artur M. Schweidtmann
Process Intelligence Research Group, Department of Chemical Engineering, Delft University of Technology
Nowadays, the creation of a process flow diagram (PFD) and its subsequent transformation into a piping and instrumentation diagram (P&ID) is predominantly performed manually. Applying artificial intelligence in the task could potentially lead not only to process automation and time savings, but also to financial gains by exploring numerous diagram's topology options and reducing manual labor. This research presents P&ID Pilot - a practical end-to-end AI pipeline capable of handling flowsheet developing for both stages. The first stage focuses on PFD synthesis, whereas the second is directed toward modifying the generated PFD into P&ID. After comparing four different methods, the hybrid approach combining genetic algorithms (GA) and large language models (LLM) is shown to generate the optimal valid PFD topology, achieving the lowest loss value among all the methods, while satisfying the required outlet flow parameters without engineering-rule violations. For the second stage, the proposed LLM-based agent successfully transforms the generated PFD into a source-grounded P&ID by producing validated, executable modifications through a restricted engineering software development kit, achieving 100% execution success while maintaining compliance with domain-specific rules and reference graph structures. This unified pipeline - coupling GA/LLM-driven synthesis with an LLM-based transformation agent - offers a feasible path toward end-to-end process design automation by producing validated, deployable outputs and substantially reduces manual engineering effort.
Timur Zakarin, Sergei Voitov, Sergei Shumilin +1
Skoltech, AI Center, Moscow, Russia · AIRI, Moscow, Russia