A method and system for identifying pipe and instrument diagram connections based on graph neural networks.

By constructing graph-structured data using a graph neural network-based approach and utilizing multi-layer graph convolutional layers and edge classifiers, the problem of accurate connection relationship recognition in P&ID images with complex layouts and dense scenes was solved, achieving efficient and robust connection relationship recognition.

CN122135392APending Publication Date: 2026-06-02CHINA NUCLEAR POWER OPERATION TECH CORP +3

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA NUCLEAR POWER OPERATION TECH CORP
Filing Date
2026-04-23
Publication Date
2026-06-02

Smart Images

  • Figure CN122135392A_ABST
    Figure CN122135392A_ABST
Patent Text Reader

Abstract

This application discloses a method and system for identifying connection relationships in pipe and instrument diagrams based on graph neural networks. The method includes: acquiring a pipe and instrument flow diagram to be identified; detecting components and connecting lines in the pipe and instrument flow diagram to construct graph structure data; encoding the features of nodes and edges in the graph structure data respectively, and mapping the features of nodes and edges to a high-dimensional latent space to obtain initial feature vectors; inputting the initial feature vectors into a preset graph neural network, using multiple graph convolutional layers for information propagation and aggregation, learning and updating the latent space features of topological relationships between components; based on the updated topological representation features, identifying whether the connection relationships corresponding to each edge in the graph are valid through an edge classifier, and outputting the connection relationship identification result. This invention transforms the connection relationship identification problem into a graph connectivity judgment task, significantly improving the accuracy and robustness of pipe and instrument diagram connection relationship identification in complex scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial vision technology, specifically to a method and system for identifying the connection relationships of pipe and instrument diagrams based on graph neural networks. Background Technology

[0002] Piping and Instrumentation Diagrams (P&IDs) are critical engineering drawings used in industry to represent process flows, system architectures, and equipment interconnections. With the advancement of industrial digital twins and digital delivery, automatically converting paper or bitmap-formatted P&IDs into computer-readable structured topology data has become a prerequisite for process simulation and automated wiring. Efficient and accurate identification of connections is of great practical significance for shortening engineering cycles, reducing manual data entry errors, and building a full lifecycle data model of the plant.

[0003] Most existing connection recognition methods rely on location information and preset rules. For example, some methods determine connections by analyzing the order of component coordinates or by traversing neighboring components and setting distance thresholds. These methods may be effective when dealing with simple, well-defined P&ID layouts, but their accuracy drops sharply when encountering complex line types (such as jumpers and cross lines) or dense component layouts, leading to numerous false positives or false negatives. The limitations of these traditional methods hinder the digitalization and intelligentization of P&ID. Therefore, there is an urgent need to explore a more robust connection recognition technology that can accurately identify connections even in scenarios with complex line types or dense component layouts.

[0004] Therefore, there is an urgent need to propose a method and system for identifying the connection relationships of pipeline and instrument diagrams based on graph neural networks, which can solve the problems of excessive reliance on local location rules and lack of physical topological logic in traditional methods, and achieve accurate identification of the connection relationships of pipeline and instrument diagrams. Summary of the Invention

[0005] This invention provides a method and system for identifying pipe and instrument diagram connections based on graph neural networks, which solves the technical problem of low accuracy and poor robustness in the traditional automatic P&ID image recognition process due to the lack of global topological semantics and industrial logic constraints, resulting in connection relationship recognition in complex wiring and dense scenarios.

[0006] To address the above problems, this invention provides a method for identifying the connection relationships of pipe and instrument diagrams based on graph neural networks, comprising: Obtain the piping and instrumentation flow diagram to be identified, perform component and connection line detection on the piping and instrumentation flow diagram, use component modeling as the nodes of the graph, and use connection relationships as the edges of the graph to construct the graph structure data; The nodes and edges of the graph structure data are encoded separately to obtain the component features of the nodes and the connection features of the edges. The features of the nodes and edges are then mapped to a high-dimensional latent space to obtain the initial feature vector. The initial feature vector is input into a pre-defined graph neural network, and information is propagated and aggregated using multiple graph convolutional layers to learn and update the latent space features of the topological relationships between components. Based on the updated topological representation features, the edge classifier identifies whether the connection relationship corresponding to each edge in the graph is valid, and outputs the connection relationship identification results of the pipeline and instrument diagram.

[0007] Furthermore, the component features of the node include: the center coordinates, width, and height of the component bounding box, as well as the component category information.

[0008] Furthermore, the connection features of the edge include: the distance connecting two nodes, and the geometric description information of the connection path between any two nodes.

[0009] Furthermore, the connection features of the edges also include: linear features and flow direction features; The linear feature is used to distinguish between solid lines in process pipelines and dashed lines in instrument signals; The flow direction feature transforms the graph structure data from an undirected graph into a directed graph by recognizing the arrow markers on the connection lines, thereby representing the logical flow between components.

[0010] Furthermore, the preset graph neural network adopts a multi-layer structure and captures complex multi-level topological features through a layer-by-layer progressive approach; The graph convolution operation for each layer is expressed by the following formula: By utilizing multi-layer graph convolutional layers for information propagation and aggregation, the latent space features of topological relationships between components are learned and updated, including: Where N(v) is the set of neighbors of node v, and d u and d v are the degrees of nodes u and v, respectively, and W(l) and b(l) are the learnable parameters of layer L.

[0011] Furthermore, based on the updated topological representation features, an edge classifier is used to identify whether the connection relationships corresponding to each edge in the graph are valid, including: Calculate the hidden features of the start and end points of each edge based on the aggregated node information; The latent features and edge features are concatenated and then input into a multilayer perceptron for classification. The validity of the connection relationship represented by the classification result is determined based on the classification result. Traverse all nodes and edges in the output piping and instrumentation diagram to obtain the connection relationships of all components; The concatenation of the latent features and edge features, followed by input into a multilayer perceptron for classification, can be expressed by the following formula: In the formula, This indicates a feature concatenation operation. It is the sigmoid activation function. It is the edge The prediction results.

[0012] Furthermore, the preset graph neural network also includes: The graph attention module is used to introduce an attention mechanism to calculate the correlation coefficient between a node and its neighboring nodes, and to perform weighted aggregation of neighboring features based on the correlation coefficient, so as to automatically suppress the feature weights of non-connectivity interfering nodes in densely populated areas.

[0013] Furthermore, the constructed graph structure data also includes: Identify the standard interface locations on component nodes and assign port feature vectors with directional identifiers to the nodes based on the corresponding limits of the interfaces in the component's geometric center coordinates. Calculate the offset angle of potential connection edges relative to component interfaces, and assign preset weight probabilities to potential edges that conform to horizontal or vertical orientations based on the wiring specifications of pipes and instruments.

[0014] Furthermore, the identification of whether the connection relationship corresponding to each edge in the graph is valid also includes: Obtain the device category corresponding to the component node, and determine the maximum allowed number of connections for that type of device based on preset industry standards; After the classifier outputs the connection probability, if the total number of valid edges connected to any node exceeds its maximum allowed number of connections, the topology conflict correction mechanism is triggered to reweight or prune the probabilities of the edges related to that node.

[0015] Secondly, the present invention also provides a pipeline and instrument diagram connection relationship recognition system based on graph neural networks, comprising: The preprocessing module is used to acquire the piping and instrumentation flow diagram to be identified, detect components and connecting lines in the piping and instrumentation flow diagram, use component modeling as nodes of the graph, and use connection relationships as edges of the graph to construct the graph structure data. The feature extraction module is used to encode the features of nodes and edges in the graph structure data respectively, to obtain the component features of nodes and the connection features of edges, and to map the features of nodes and edges to a high-dimensional latent space to obtain the initial feature vector. The aggregation module is used to input the initial feature vector into a preset graph neural network, and use multiple graph convolutional layers to propagate and aggregate information, learn and update the latent space features of the topological relationship between components. The identification module is used to identify whether the connection relationship corresponding to each edge in the graph is valid based on the updated topological representation features and through an edge classifier, and outputs the identification results of the connection relationship of the pipeline and instrument diagram.

[0016] Compared with the prior art, the beneficial effects of the present invention include: (1) By learning the topological structure of the graph rather than simple positional rules to determine connections, the shortcomings of traditional methods in handling complex line types and dense layouts are effectively overcome. At the same time, by introducing a multi-layer graph neural network, the model learns multi-level topological features between components. The model can understand the layout of the drawing from a global perspective. When dealing with large-scale, high-density component connections, it can automatically suppress the weights of non-connectivity interference nodes, significantly improving the connection recognition accuracy in complex intersection areas and dense wiring scenarios.

[0017] (2) The data-driven feature encoding and edge classification architecture is adopted, (1) reducing the reliance on manually designed complex rules and making it easy to deploy and expand. By performing high-dimensional mapping on the features of nodes and edges, it can effectively cope with noise interference such as low image contrast and slight offset of component positions.

[0018] (3) This invention transforms industry prior knowledge into hard constraints or post-processing correction mechanisms for algorithms, ensuring that the recognition results are not only geometrically reasonable, but also meet industrial standards such as maximum number of connections and flow vector in terms of process logic, thus solving the problem of uncontrollable model output results. Attached Figure Description

[0019] Figure 1 A flowchart illustrating a method for identifying pipe and instrument diagram connections based on graph neural networks provided by this invention; Figure 2 This is a schematic diagram illustrating the implementation process of the pipeline and instrument diagram connection relationship identification method based on graph neural network provided by the present invention; Figure 3 A schematic diagram of the structure of the pipeline and instrument diagram connection relationship recognition system based on graph neural network provided by the present invention; Figure 4 This is a schematic diagram illustrating the process of identifying the connection relationships between pipelines and instrument diagrams provided by the system of this invention. Detailed Implementation

[0020] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.

[0021] This invention provides a method for identifying pipeline and instrumentation diagram connections based on graph neural networks, primarily used for tracing processes such as natural gas generation, migration, accumulation, and storage. For example... Figure 1 As shown, Figure 1 This is a flowchart illustrating the method for identifying pipe and instrument diagram connections based on graph neural networks, the method comprising: Step S101: Obtain the piping and instrumentation flow diagram to be identified, perform component and connection line detection on the piping and instrumentation flow diagram, use component modeling as the nodes of the graph, and use connection relationships as the edges of the graph to construct the graph structure data; Step S102: Encode the features of the nodes and edges of the graph structure data respectively to obtain the component features of the nodes and the connection features of the edges, and map the features of the nodes and edges to the high-dimensional latent space to obtain the initial feature vector; Step S103: Input the initial feature vector into the preset graph neural network, use multiple graph convolutional layers to propagate and aggregate information, learn and update the latent space features of the topological relationship between components; Step S104: Based on the updated topological representation features, use an edge classifier to identify whether the connection relationship corresponding to each edge in the graph is valid, and output the connection relationship identification results of the pipeline and instrument graph.

[0022] This embodiment provides a graph neural network-based method for identifying pipe and instrument diagram (P&ID) connection relationships. First, by detecting components and connecting lines in the P&ID image, physical entities and relationships are abstracted into nodes and edges of a graph structure. Second, multi-dimensional attributes of nodes and edges are extracted and high-dimensional feature encoding is performed to construct a latent space vector with initial semantic information. Finally, a multi-layer graph convolutional neural network is used for deep feature aggregation and topology learning, and an edge classifier determines the validity of potential connections, thereby outputting accurate digital connection results. This method overcomes the limitations of traditional algorithms that overly rely on local geometric rules, and can deeply capture cross-regional, high-density global topological features in P&ID. It improves the recognition accuracy and system robustness in scenarios with dense components and line intersections, providing efficient and rigorous technical support for the automated digital delivery of industrial drawings.

[0023] In a preferred embodiment, in step S101, the component features of the node include: the center coordinates, width, and height of the component bounding box, as well as the component category information.

[0024] In a preferred embodiment, the connection features of the edge include: the distance connecting two nodes, and the geometric description information of the connection path between any two nodes.

[0025] To address the problem that traditional methods, which only consider "whether there is a wire," easily confuse signal lines with process piping, as a preferred embodiment, the connection features of the edge further include: line type features and flow direction features; The linear feature is used to distinguish between solid lines in process pipelines and dashed lines in instrument signals; The flow direction feature transforms the graph structure data from an undirected graph into a directed graph by recognizing the arrow markers on the connection lines, thereby representing the logical flow between components.

[0026] By identifying linear features, the model can automatically distinguish between hard pipes for material flow and soft signals for data transmission. The identification results are no longer just simple geometric connections, but possess semantic meaning at the business level. Furthermore, by identifying arrow markers to convert undirected graphs into directed graphs, the model captures the logical flow between components. This greatly filters out invalid paths in topology identification. For example, when identifying pump connections, the directed graph can clearly distinguish between inlets and outlets, preventing material backflow or logical loop errors when building digital twin models.

[0027] In a preferred embodiment, in step S102, the constructed graph structure data further includes: Identify the standard interface locations on component nodes and assign port feature vectors with directional identifiers to the nodes based on the corresponding limits of the interfaces in the component's geometric center coordinates. Calculate the offset angle of potential connection edges relative to component interfaces, and assign higher weight probabilities to potential edges that conform to horizontal or vertical orientations, based on the wiring specifications of pipes and instruments.

[0028] Through this processing, the physical prior knowledge of industrial drawing is deeply integrated into the feature extraction stage. By accurately locating component interfaces and introducing offset angle calculations, the model can identify the inflow and outflow directions between components from a geometric perspective, effectively filtering out interfering connections that are spatially close but logically inconsistent. At the same time, by using an orthogonal weight allocation mechanism, the accuracy of identifying effective horizontal or vertical connections in densely populated areas and multi-pipeline parallel scenarios is significantly improved, ensuring that the graph structure data has extremely high engineering logic consistency from the very beginning of its construction.

[0029] In a preferred embodiment, in step S103, the preset graph neural network adopts a multi-layer structure and captures complex multi-level topological features through a layer-by-layer progressive approach. Specifically, the steps include: Step S31: Through an input dimension Output Dimension The node encoder transforms node features into a latent space, and then passes them through an input dimension. Output dimension The edge feature encoder transforms edge features into the latent space, which can be expressed by the formula: In the formula, These are input features. and These are learnable parameters.

[0030] Since the original features have different dimensions and meanings, direct fusion will produce noise. Therefore, the above encoding method can extract the deep industrial semantics hidden behind simple geometric data and transform the features of nodes (components) and edges (pipelines) to the same dimensional space, providing a standardized data foundation for subsequent graph convolution fusion.

[0031] Step S32: Input the latent space features obtained in step S31 into a 3-layer graph convolutional network. The graph convolution operation of the Lth layer is represented as follows: In the formula, N(v) is the set of neighbors of node v, and d u and d v are the degrees of nodes u and v, respectively, and W(l) and b(l) are the learnable parameters of layer L.

[0032] It should be noted that, The degree normalization factor is crucial in P&ID (Portable & Utility Model). Some nodes (such as main pipes and busbars) have numerous connections, while others (such as terminal instruments) have very few. Without normalization, nodes with high connection counts can exert excessive numerical influence during convolution, leading to model failure. The degree normalization factor ensures that the magnitude of feature transfer remains stable regardless of component complexity, improving the model's generalization ability to drawings of varying complexity.

[0033] In graph computation, a single convolutional layer represents the perception of direct neighbors, while three convolutional layers represent that each node can perceive information about distant nodes. Since the connections in P&ID drawings often have long path characteristics, this method uses a three-layer structure to enable the graph model to not only see local interfaces but also understand the logic of a wider range of process loops, thus providing a global perspective during recognition and effectively solving the problem of easy breakage in long-distance connection recognition.

[0034] In step S104, the starting point of each edge is calculated based on the aggregated node information obtained in step S32. and the end point The latent features are concatenated with the edge features and then input into a multilayer perceptron (MLP) for classification, denoted as: In the formula, This indicates a feature concatenation operation. It is the sigmoid activation function. It is the edge The prediction results are then used to determine whether the connections they represent are valid, thus obtaining the connection relationships of all components in the entire P&ID.

[0035] like Figure 2 As shown, Figure 2 A schematic diagram illustrating the implementation process of this method is shown.

[0036] In a preferred embodiment, the preset graph neural network further includes: The graph attention module is used to introduce an attention mechanism to calculate the correlation coefficient between a node and its neighboring nodes, and to perform weighted aggregation of neighboring features based on the correlation coefficient, so as to automatically suppress the feature weights of non-connectivity interfering nodes in densely populated areas.

[0037] In a preferred embodiment, step S104, which involves identifying whether the connection relationships corresponding to each edge in the graph are valid, further includes: Obtain the device category corresponding to the component node, and determine the maximum allowed number of connections for that type of device based on preset industry standards; After the classifier outputs the connection probability, if the total number of valid edges connected to any node exceeds its maximum allowed number of connections, the topology conflict correction mechanism is triggered to reweight or prune the probabilities of the edges related to that node.

[0038] This embodiment also provides a pipeline and instrument diagram connection relationship recognition system based on graph neural networks, such as... Figure 3 As shown, the pipeline and instrument diagram connection relationship recognition system 300 based on graph neural network includes: The preprocessing module 301 is used to acquire the piping and instrumentation flow diagram to be identified, perform component and connection line detection on the piping and instrumentation flow diagram, use component modeling as the nodes of the graph, and use connection relationships as the edges of the graph to construct the graph structure data. The feature extraction module 302 is used to encode the features of the nodes and edges of the graph structure data respectively, to obtain the component features of the nodes and the connection features of the edges, and to map the features of the nodes and edges to a high-dimensional latent space to obtain the initial feature vector. The aggregation module 303 is used to input the initial feature vector into a preset graph neural network, and use multiple graph convolutional layers to propagate and aggregate information, learn and update the latent space features of the topological relationship between components. The identification module 304 is used to identify whether the connection relationship corresponding to each edge in the graph is valid based on the updated topological representation features and through an edge classifier, and output the connection relationship identification results of the pipeline and instrument graph.

[0039] like Figure 4 As shown, Figure 4 This diagram illustrates the process by which the system identifies the connections between pipes and instrument diagrams.

[0040] This invention discloses a method and system for identifying pipe and instrument graph (P&ID) connectivity relationships based on graph neural networks. First, components and connections in the P&ID are detected, and components are abstracted as nodes in the graph, while potential connections between components are abstracted as edges, constructing graph structure data. Then, node encoders and edge encoders extract feature information such as component position, category, size, and the distance and path represented by the edges. Subsequently, a multi-layer graph convolutional network (GCN) is used to propagate and aggregate node features, effectively capturing the complex topological relationships in the P&ID. Finally, the updated node and edge features are aggregated, and a classifier performs binary classification on each edge to determine whether the connection relationship is valid. This invention transforms the connectivity identification problem into a graph connectivity judgment task, significantly improving the accuracy and robustness of P&ID connectivity identification in complex scenarios.

[0041] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for identifying the connection relationships in pipe and instrument diagrams based on graph neural networks, characterized in that, include; Obtain the piping and instrumentation flow diagram to be identified, perform component and connection line detection on the piping and instrumentation flow diagram, use component modeling as the nodes of the graph, and use connection relationships as the edges of the graph to construct the graph structure data; The nodes and edges of the graph structure data are encoded separately to obtain the component features of the nodes and the connection features of the edges. The features of the nodes and edges are then mapped to a high-dimensional latent space to obtain the initial feature vector. The initial feature vector is input into a pre-defined graph neural network, and information is propagated and aggregated using multiple graph convolutional layers to learn and update the latent space features of the topological relationships between components. Based on the updated topological representation features, the edge classifier identifies whether the connection relationship corresponding to each edge in the graph is valid, and outputs the connection relationship identification results of the pipeline and instrument diagram.

2. The method for identifying pipe and instrument diagram connection relationships based on graph neural networks according to claim 1, characterized in that, The component features of the node include: the center coordinates, width, and height of the component bounding box, as well as the component category information.

3. The method for identifying pipe and instrument diagram connection relationships based on graph neural networks according to claim 1, characterized in that, The connection features of the edge include: the distance connecting two nodes, and the geometric description information of the connection path between any two nodes.

4. The method for identifying pipe and instrument diagram connection relationships based on graph neural networks according to claim 3, characterized in that, The connection features of the edges also include: linear features and flow direction features; The linear feature is used to distinguish between solid lines in process pipelines and dashed lines in instrument signals; The flow direction feature transforms the graph structure data from an undirected graph into a directed graph by recognizing the arrow markers on the connection lines, thereby representing the logical flow between components.

5. The method for identifying pipe and instrument diagram connection relationships based on graph neural networks according to claim 1, characterized in that, The preset graph neural network adopts a multi-layer structure and captures complex multi-level topological features through a layer-by-layer progressive approach. The graph convolution operation for each layer is expressed by the following formula: By utilizing multi-layer graph convolutional layers for information propagation and aggregation, the latent space features of topological relationships between components are learned and updated, including: Where N(v) is the set of neighbors of node v, and d u and d v are the degrees of nodes u and v, respectively, and W(l) and b(l) are the learnable parameters of layer L.

6. The method for identifying pipe and instrument diagram connection relationships based on graph neural networks according to claim 5, characterized in that, Based on the updated topological representation features, an edge classifier is used to identify whether the connection relationships corresponding to each edge in the graph are valid, including: Calculate the hidden features of the start and end points of each edge based on the aggregated node information; The latent features and edge features are concatenated and then input into a multilayer perceptron for classification. The validity of the connection relationship represented by the classification result is determined based on the classification result. Traverse all nodes and edges in the output piping and instrumentation diagram to obtain the connection relationships of all components; The concatenation of the latent features and edge features, followed by input into a multilayer perceptron for classification, can be expressed by the following formula: In the formula, This indicates a feature concatenation operation. It is the sigmoid activation function. It is the edge The prediction results.

7. The method for identifying pipe and instrument diagram connection relationships based on graph neural networks according to claim 5, characterized in that, The preset graph neural network also includes: The graph attention module is used to introduce an attention mechanism to calculate the correlation coefficient between a node and its neighboring nodes, and to perform weighted aggregation of neighboring features based on the correlation coefficient, so as to automatically suppress the feature weights of non-connectivity interfering nodes in densely populated areas.

8. The method for identifying pipe and instrument diagram connection relationships based on graph neural networks according to claim 1, characterized in that, The constructed graph structure data also includes: Identify the standard interface locations on component nodes and assign port feature vectors with directional identifiers to the nodes based on the corresponding limits of the interfaces in the component's geometric center coordinates. Calculate the offset angle of potential connection edges relative to component interfaces, and assign preset weight probabilities to potential edges that conform to horizontal or vertical orientations based on the wiring specifications of pipes and instruments.

9. The method for identifying pipe and instrument diagram connection relationships based on graph neural networks according to claim 1, characterized in that, The method of identifying whether the connection relationship corresponding to each edge in the graph is valid also includes: Obtain the device category corresponding to the component node, and determine the maximum allowed number of connections for that type of device based on preset industry standards; After the classifier outputs the connection probability, if the total number of valid edges connected to any node exceeds its maximum allowed number of connections, the topology conflict correction mechanism is triggered to reweight or prune the probabilities of the edges related to that node.

10. A system for identifying the connection relationships of pipe and instrument diagrams based on graph neural networks, characterized in that, include: The preprocessing module is used to acquire the piping and instrumentation flow diagram to be identified, detect components and connecting lines in the piping and instrumentation flow diagram, use component modeling as nodes of the graph, and use connection relationships as edges of the graph to construct the graph structure data. The feature extraction module is used to encode the features of nodes and edges in the graph structure data respectively, to obtain the component features of nodes and the connection features of edges, and to map the features of nodes and edges to a high-dimensional latent space to obtain the initial feature vector. The aggregation module is used to input the initial feature vector into a preset graph neural network, and use multiple graph convolutional layers to propagate and aggregate information, learn and update the latent space features of the topological relationship between components. The identification module is used to identify whether the connection relationship corresponding to each edge in the graph is valid based on the updated topological representation features and through an edge classifier, and outputs the identification results of the connection relationship of the pipeline and instrument diagram.