Hydrogen leakage path intelligent identification method based on graph neural network
The full-graphic modeling system is constructed through the GraphGPS graph neural network, which solves the global perspective prediction problem of hydrogen leakage detection in complex environments in the existing technology, and realizes accurate and dynamic identification of leakage paths in the hydrogen transport system, improving safety and intelligence level.
Patent Information
- Application Number
- CN202510532700.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-08-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing hydrogen leakage detection technology is difficult to build a correlation relationship model between nodes in a complex, changing, dynamically evolved hydrogen transport environment, and cannot realize leakage path prediction and propagation path reconstruction from a global perspective. It lacks the ability to identify atypical and weak label samples, making it difficult to meet the needs of real-time and accuracy.
The GraphGPS graph neural network is used to build a full-graphic modeling system. By integrating local structure perception and global attention mechanisms, combining Laplace spectral position coding and shortest path distance coding, an enhanced node feature matrix is generated, and a GraphGPS graph neural network is built, path-level data enhancement strategies and sparse regular terms are introduced, network parameters are optimized, and intelligent prediction and dynamic identification of leaked paths are realized.
It realizes accurate prediction and dynamic identification of leakage paths in the hydrogen transport system, improves the level of safety and intelligence, has the advantages of strong structural perception ability, high prediction accuracy and fast response speed, and is adapted to complex pipeline environments.
Smart Images

Figure CN120451654A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of industrial safety, and in particular to a method for intelligently identifying hydrogen leakage paths based on a graph neural network. Background Art
[0002] As a clean and efficient secondary energy source, hydrogen has received widespread attention and application in transportation, industrial manufacturing, and new energy power generation in recent years. With the accelerated advancement of hydrogen energy infrastructure construction, the scale and complexity of hydrogen transportation systems continue to increase. How to ensure the safety of hydrogen during transportation, storage and use has become one of the key technical issues restricting industrial development.
[0003] Existing hydrogen leak detection technologies mainly rely on point sensors deployed at key nodes in the pipeline network. They determine whether there is a leak by monitoring changes in hydrogen concentration, pressure anomalies or acoustic signals. Typical methods include threshold alarm methods based on gas concentration mutations, mass conservation methods based on flow balance, and leak identification methods based on machine learning models. These technologies have certain engineering practicality in the early stages and can achieve leak detection and rough positioning in local areas. However, their core mechanisms are mostly based on static point data and empirical rules, which are difficult to adapt to the complex, changeable and dynamically evolving hydrogen transportation environment in modern industrial scenarios. For example, faced with large-scale pipeline systems with distributed structures, complex topologies and multi-source disturbance characteristics, traditional methods are often unable to construct a correlation model between nodes, making it difficult to predict leakage paths and reconstruct propagation paths from a global perspective, limiting the real-time perception and response control capabilities of leakage trends.
[0004] In recent years, graph neural networks (GNNs), owing to their powerful ability to model non-Euclidean structured data, have achieved remarkable results in fields such as transportation networks, social networks, and power systems. GNNs can model the entire system through the node and edge relationships in the graph structure, and have the advantage of characterizing complex topological structures, propagation mechanisms, and heterogeneous node attributes. Some studies have attempted to introduce GNNs into scenarios such as urban gas leak detection and underground pipeline fault location, and have made initial progress. However, such methods still face significant limitations in the following aspects: First, most models use nodes as prediction targets and can only identify abnormal nodes or starting points, failing to achieve detailed modeling and prediction of the dynamic propagation path of leaked gas in the graph structure; second, the network structure is mostly limited to the aggregation of local adjacency features, making it difficult to perceive the potential structural dependencies between distant nodes and lacking semantic understanding from a global perspective; third, the training mechanism does not fully consider path-level supervision signals, and lacks strategic enhancement methods that align with historical path patterns, resulting in insufficient recognition of atypical and weakly labeled samples; fourth, current data augmentation methods mostly use conventional perturbations or noise processing, making it difficult to construct synthetic leakage paths with physical meaning and structural rationality.
[0005] Furthermore, from the perspective of industrial deployability, existing graph neural network models still lack effective alignment for heterogeneous input data in practical applications. Node and edge information in hydrogen transportation systems encompass not only topological relationships but also multi-dimensional time-series monitoring data, such as pressure, temperature, flow rate, and valve status. These dynamic attributes are highly coupled across space and time, posing significant challenges to the model's expressiveness and input format requirements. Furthermore, in leak path prediction tasks, static snapshots of the structure at a single moment cannot capture the evolution of gas propagation. Dynamic graph modeling mechanisms and position-sensitive encoding methods are necessary to achieve realistic simulation and effective restoration of leak paths.
[0006] Based on the above technical background and existing problems, traditional hydrogen leak detection methods have shortcomings in structural modeling capabilities, path-level identification capabilities, data utilization efficiency, and response timeliness, making it difficult to meet the real-time, accuracy, and interpretability requirements of large-scale and high-density hydrogen transportation scenarios. Summary of the Invention
[0007] One purpose of the present invention is to propose a method for intelligent identification of hydrogen leakage paths based on graph neural networks. The present invention constructs a full-graph modeling system based on the GraphGPS graph neural network. By integrating local structural perception and global attention mechanism, it accurately depicts the topological dependency relationship between nodes in the hydrogen transportation system, and realizes intelligent prediction and dynamic identification of leakage paths. It has the advantages of strong structural perception ability, high prediction accuracy, fast response speed, and adaptability to complex pipeline networks, thereby improving the safety and intelligence level of the hydrogen transportation process.
[0008] According to an embodiment of the present invention, a method for intelligently identifying hydrogen leakage paths based on a graph neural network includes the following steps:
[0009] S1. Construct a graph structure model of the hydrogen delivery system;
[0010] S2. Acquire dynamic monitoring data of the hydrogen delivery system, perform preprocessing, and map the preprocessed dynamic monitoring data into node features and edge features of a graph structure model to form a dynamic graph structure model;
[0011] S3. Perform graph position encoding on the dynamic graph structure model to generate a node position encoding matrix, and concatenate it with the node's dynamic feature matrix to form an enhanced node feature matrix;
[0012] S4. Construct a GraphGPS graph neural network, perform full-graph semantic modeling of the dynamic graph structure model based on the enhanced node feature matrix, and generate a global context representation of the node;
[0013] S5. Based on the dynamic graph structure model, a path-level data enhancement strategy is introduced to generate a training sample set;
[0014] S6. Combined with the historical leakage path labels, the GraphGPS graph neural network is supervised and trained using the training sample set. The path-level loss function is used to minimize the deviation between the leakage path prediction result and the actual path, and the network parameters are optimized.
[0015] S7. Based on the global context representation, the real-time dynamic monitoring data is input into the trained GraphGPS neural network to generate the leakage path prediction probability.
[0016] Optionally, the graph structure model includes a node set and an edge set, the nodes represent functional units in the hydrogen delivery system, and the edges represent physical connection paths between the nodes.
[0017] Optionally, the dynamic monitoring data includes pressure, temperature, hydrogen concentration, flow rate of the node and flow direction status and control parameters of the edge.
[0018] Optionally, the preprocessing includes missing value filling, outlier removal, resampling and normalization.
[0019] Optionally, the S3 specifically includes:
[0020] S31, based on dynamic graph structure model The node set is subjected to graph position coding, which includes Laplace spectrum position coding and shortest path distance coding, to enhance the relative position modeling capability of the nodes in the graph structure. t Represents the dynamic graph structure model at time t, represents a node set, describing the functional units in the hydrogen delivery system, ε represents an edge set, describing the physical connection paths between nodes, and A represents the adjacency matrix. represents the dynamic feature matrix of the node at time t, Represents the dynamic feature matrix of the edge at time t;
[0021] S32. Use the adjacency matrix to construct the normalized graph Laplacian matrix:
[0022]
[0023] Where L represents the normalized graph Laplace matrix, I represents the identity matrix, and D represents the degree matrix, satisfying Describe node v i degree, A ij Represents node v i With node v j Whether to connect directly, n represents the total number of nodes, D iirepresents the elements of the degree matrix;
[0024] S33. Perform eigenvalue decomposition on the normalized graph Laplace matrix to obtain an eigenvector matrix and an eigenvalue diagonal matrix. Select the eigenvectors corresponding to the first k smallest eigenvalues to construct a spectral position encoding matrix:
[0025] L=UΛU T ,P=U[:,1:k];
[0026] Where L represents the normalized graph Laplacian matrix, U represents the eigenvector matrix, Λ represents the eigenvalue diagonal matrix, T represents the transpose operation, P represents the spectral position encoding matrix, the first k columns selected from the eigenvector matrix, and k represents the dimension of the spectral position encoding matrix;
[0027] S34, based on the dynamic graph structure model, calculate the shortest path distance matrix between each pair of nodes, where the elements in the shortest path distance matrix represent the distance from node v i To node v j The minimum number of edges passed through captures the relative distance information in the full graph structure:
[0028]
[0029] Among them, S ij Represents the elements of the shortest path distance matrix, describing the shortest path length, (v a ,v b ) represents the edge pair in the path, path:v i →v j Represents all slave nodes v i To node v j The reachable path, path represents the path, min represents the minimum value;
[0030] S35. Concatenate or perform dimensionality reduction processing on the spectral position encoding matrix and the row vector of each node in the shortest path distance matrix to generate a node position encoding matrix:
[0031] Z i =Concat(P i ,S i );
[0032] Among them, Z i Represents node v i The node position encoding matrix, P i Represents node v i The spectral position encoding matrix, S i Represents the row vector of each node in the shortest path distance matrix, and Concat represents the concatenation operation;
[0033] S36. Concatenate the node position encoding matrix and the node's dynamic feature matrix in the feature dimension to form an enhanced node feature matrix:
[0034]
[0035] in, represents the enhanced node feature matrix, Represents the dynamic feature matrix of the node;
[0036] S37. The enhanced node feature matrix, edge dynamic feature matrix and adjacency matrix are used as inputs of the GraphGPS graph neural network to perform structure-aware reasoning on the hydrogen leakage path.
[0037] Optionally, the S4 specifically includes:
[0038] S41, constructing a GraphGPS graph neural network, wherein the GraphGPS graph neural network includes a local graph neural network module and a global Transformer module, and the input of the GraphGPS graph neural network includes an enhanced node feature matrix, an edge dynamic feature matrix, and an adjacency matrix;
[0039] S42. The module performs weighted feature aggregation on the neighbor node features and edge dynamic feature matrix of each node according to the node connection relationship defined in the adjacency matrix, generates the local embedded features of the node in the current graph convolution layer, and assigns the enhanced node feature matrix to the node feature:
[0040]
[0041] in, Represents node v i In the local embedding feature of the l+1 layer, σ represents the nonlinear activation function, Represents node v i The set of adjacent nodes is obtained from the adjacency matrix, W (l) represents the weight matrix of the lth layer, Represents node v j In the node features of the lth layer, ⊕ represents the vector splicing operation, Represents edge v i →v j The dynamic feature matrix, W e represents the edge feature linear transformation matrix, b e represents the bias term;
[0042] S43. Input the local embedding features output by the local graph neural network module into the global Transformer module to generate the query matrix, key matrix and value matrix respectively:
[0043] Q=HWQ ,K=HW K ,V=HW V ;
[0044] Among them, Q, K, V represent the query matrix, key matrix and value matrix respectively, H represents the local embedding feature, and W Q ,W K ,W V Denotes the linear transformation matrices of query matrix, key matrix and value matrix respectively, d k represents the dimension of attention space;
[0045] S44. Based on the query matrix, key matrix and value matrix, the attention weight is calculated by introducing the edge feature bias:
[0046]
[0047] in, Represents node v i For node v j The attention weight, Q i represents the query matrix, d k represents the dimension of the attention space, represents the scaling factor, T represents the transposition operation, and W e represents the edge feature linear transformation matrix, b e represents the bias term, exp represents the natural exponential function, Represents edge v i →v j The dynamic feature matrix, n represents the total number of nodes, Represents edge v i →v m The dynamic feature matrix, K m ,K j represents the bond matrix;
[0048] S45. Use the attention weights to perform weighted aggregation on the value matrix to generate the global context representation of the node:
[0049]
[0050] Among them, H′ i Represents node v i The global context representation, V j Represents node v j The value matrix of .
[0051] Optionally, the path-level data enhancement strategy simulates and constructs combined samples of potential leakage paths, expands the training data space, and enhances the GraphGPS graph neural network's ability to recognize atypical path patterns.
[0052] Optionally, the S5 specifically includes:
[0053] S51. Based on the dynamic graph structure model, the node set is kept unchanged and a path-level enhanced graph sample set is constructed by replacing the edge set, where each enhanced graph sample represents a potential leakage path;
[0054] S52: Generate a path set for each enhanced graph sample. The paths in the path set Represents a leak propagation sequence consisting of consecutive nodes:
[0055]
[0056] in, represents the mth path in the kth augmented graph sample, v L represents the Lth node in the path, and L represents the path length;
[0057] S53. Generate a corresponding path mask matrix for each path, and identify the edges passed through in the enhanced graph sample:
[0058]
[0059] in, Represents the path mask matrix, describing the path from node v i To node v j Path coverage mark;
[0060] S54. Apply the path mask matrix to the dynamic feature matrix of the edge, perform path-level screening and enhancement on the dynamic feature matrix of the edge, and calculate the path-enhanced edge feature matrix:
[0061]
[0062] in, represents the edge v in the k-th augmented graph sample i →v j The path-enhanced edge feature matrix, represents the path mask matrix, Represents edge v i →v j The dynamic feature matrix of
[0063] S55. Combine the node feature matrix, path-enhanced edge feature matrix, and adjacency matrix of each enhanced graph sample to form a training sample set.
[0064] Optionally, the S6 specifically includes:
[0065] S61. Combined with the historical leakage path labels, the GraphGPS neural network is supervised and trained using the training sample group.
[0066] S62. To enhance the network's ability to distinguish path importance, a path confidence matrix is constructed, where the elements in the path confidence matrix represent confidence weighting coefficients:
[0067]
[0068] in, Represents edge v i →v j The confidence weighting coefficient of Represents edge v i →v j The frequency of occurrence in the sample label, τ represents the control hyperparameter of the upper limit of confidence, and min represents the minimum value;
[0069] S63. Construct a confidence-weighted path-level loss function to measure the difference between the network-predicted path probability and the historical leakage path label:
[0070]
[0071] in, represents the confidence-weighted path-level loss function, K represents the number of training samples, n represents the total number of nodes, Represents the network edge v i →v j The predicted probability of belonging to the leakage path, Represents the historical leakage path label, describing the edge v i →v j Whether it is a real label belonging to the leakage path, Represents edge v i →v j The confidence weighted coefficient of , lg represents the logarithmic function with a base of 10;
[0072] S64. Introduce the sparsity regularization term to control the network's overfitting tendency to the path structure, and define the total loss function in combination with the L1 norm of the path:
[0073]
[0074] in, represents the total loss function, λ represents the weight coefficient of the sparse regularization term, represents the L1 norm of the predicted path, ‖·‖1 represents the L1 norm;
[0075] S65. Optimize the parameters of the GraphGPS neural network by minimizing the total loss function and use the gradient descent strategy for iterative updates:
[0076]
[0077] Among them, θ (t+1) represents the network parameters at the t+1th iteration, θ (t) represents the network parameters at the tth iteration, θ (t+1) represents the updated parameters, η represents the learning rate, Represents the gradient of the total loss function with respect to the current network parameters.
[0078] Optionally, the S7 specifically includes:
[0079] S71. In the real-time prediction stage, dynamic monitoring data and graph structure information of the hydrogen transportation system at the current moment are obtained to generate an enhanced node feature matrix, an edge dynamic feature matrix, and an adjacency matrix;
[0080] S72, inputting the enhanced node feature matrix, the edge dynamic feature matrix, and the adjacency matrix into the trained and optimized GraphGPS graph neural network, and outputting the global context representation of the node;
[0081] S73. Calculate the leakage path prediction probability based on the global context representation of the node:
[0082]
[0083] in,
[0084] ″
[0085] Represents edge v i →v j The predicted probability of belonging to the leakage path, H i ,H j Represents node v i and v j The global context representation of Represents vector concatenation operation, Represents edge v i →v j The dynamic feature matrix, W o represents the weight matrix of the fully connected layer, b o represents the bias term of the fully connected layer, and σ represents the nonlinear activation function.
[0086] The beneficial effects of the present invention are:
[0087] First, the present invention introduces GraphGPS graph neural network into the field of hydrogen leakage path identification, fully tapping the advantages of graph neural network in processing complex non-Euclidean structures. By combining the local adjacency message passing mechanism with the global Transformer attention mechanism, it realizes the remote dependency modeling between any node pairs in the system. Compared with the traditional leakage identification method based on point alarm or rule model, the present invention can not only judge "whether there is a leak" or "which node is abnormal", but also accurately predict the propagation path of the leaked gas in the topological structure, thereby providing more practical support for accident prediction, emergency response and regional control.
[0088] Secondly, the graph position encoding strategy introduced in the invention combines the Laplace spectrum position and the shortest path distance information, effectively enhancing the ability to express the position of the node in the graph, solving the problem of weak perception of symmetric structures by traditional graph neural networks, and enabling the model to have the ability to identify the "relative potential relationship" in the graph. In addition, by fusing the node dynamic features and position encoding at the feature layer to form enhanced node features, the model's ability to represent the joint changes of spatial topology and dynamic state is significantly improved, providing richer contextual information support for leakage path modeling.
[0089] In addition, during the supervised training phase, the present invention introduces a path-level data augmentation strategy, combines historical leakage labels to construct a confidence weighting mechanism and a sparsity regularization optimization objective, and optimizes the learning direction and generalization ability of the model from a strategic level. Path-level enhancement not only expands the training sample space, but also improves the model's adaptability to atypical path distributions, avoids overfitting of high-frequency label paths, and enhances the ability to discriminate low-frequency, rare, or structurally complex paths. The introduction of the sparse regularization term effectively suppresses redundant prediction edges and improves the compactness and interpretability of the path output.
[0090] Finally, in the real-time reasoning stage, the present invention constructs an edge-level prediction mechanism based on context combination and edge feature fusion through deep modeling of the global context representation of the node, and extracts the leakage path subgraph in combination with the threshold judgment rule, thereby realizing the structured output of the actual leakage propagation trend. The path output not only has a clear physical meaning, but can also be directly called by the downstream risk assessment and response strategy modules, realizing rapid linkage from "identification" to "reaction", greatly improving the system's security capabilities and management efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0092] Figure 1This is a flow chart of a method for intelligently identifying hydrogen leakage paths based on graph neural networks proposed in the present invention;
[0093] Figure 2 This is a diagram showing the structure of the GraphGPS graph neural network for the intelligent identification method of hydrogen leakage paths based on graph neural networks proposed in the present invention;
[0094] Figure 3 This is a schematic diagram of the generation process of graph position coding for the hydrogen leakage path intelligent identification method based on graph neural network proposed in the present invention. DETAILED DESCRIPTION
[0095] The present invention will now be described in further detail with reference to the accompanying drawings, which are simplified schematic diagrams that illustrate the basic structure of the present invention in a schematic manner.
[0096] refer to Figure 1-3 , a method for intelligently identifying hydrogen leakage paths based on graph neural networks, comprising the following steps:
[0097] S1. Construct a graph structure model of the hydrogen delivery system;
[0098] S2. Acquire dynamic monitoring data of the hydrogen delivery system, perform preprocessing, and map the preprocessed dynamic monitoring data into node features and edge features of a graph structure model to form a dynamic graph structure model;
[0099] S3. Perform graph position encoding on the dynamic graph structure model to generate a node position encoding matrix, and concatenate it with the node's dynamic feature matrix to form an enhanced node feature matrix;
[0100] S4. Construct a GraphGPS graph neural network, perform full-graph semantic modeling of the dynamic graph structure model based on the enhanced node feature matrix, and generate a global context representation of the node;
[0101] S5. Based on the dynamic graph structure model, a path-level data enhancement strategy is introduced to generate a training sample set;
[0102] S6. Combined with the historical leakage path labels, the GraphGPS graph neural network is supervised and trained using the training sample set. The path-level loss function is used to minimize the deviation between the leakage path prediction result and the actual path, and the network parameters are optimized.
[0103] S7. Based on the global context representation, the real-time dynamic monitoring data is input into the trained GraphGPS neural network to generate the leakage path prediction probability.
[0104] The present invention provides an intelligent leakage path identification method for complex hydrogen transportation systems. By constructing a dynamic graph structure model, introducing graph position coding, and integrating the GraphGPS graph neural network, it realizes a complete closed loop from data collection, path modeling to prediction and identification. It has significant advantages such as high recognition accuracy, strong structural modeling capabilities, and adaptability to dynamic scenarios.
[0105] In this embodiment, the graph structure model includes a node set and an edge set, the nodes represent functional units in the hydrogen delivery system, and the edges represent physical connection paths between the nodes.
[0106] This invention abstracts the hydrogen transportation system into a graph structure model and maps the functional units and physical connections into nodes and edges in the graph, laying the foundation for the structure-aware reasoning of subsequent graph neural networks and improving the interpretability and topological expression capabilities of modeling.
[0107] In this embodiment, the dynamic monitoring data includes the pressure, temperature, hydrogen concentration, flow rate of the node and the flow direction state and control parameters of the edge.
[0108] The present invention realizes a multi-dimensional characterization of the hydrogen transportation status by collecting dynamic monitoring data such as node pressure, temperature, concentration, flow rate and edge control status, thereby improving the network's sensitivity to changes in operating conditions and its ability to respond to potential leakage risks.
[0109] In this embodiment, the preprocessing includes missing value filling, outlier removal, resampling and normalization.
[0110] By introducing missing value filling, anomaly elimination, resampling and normalization operations in the preprocessing stage, the present invention effectively improves data quality and model training stability, and enhances the robustness and generalization ability of the model in complex industrial scenarios.
[0111] In this embodiment, S3 specifically includes:
[0112] S31, based on dynamic graph structure model The node set is subjected to graph position coding, which includes Laplace spectrum position coding and shortest path distance coding, to enhance the relative position modeling capability of the nodes in the graph structure. t Represents the dynamic graph structure model at time t, represents a node set, describing the functional units in the hydrogen delivery system, ε represents an edge set, describing the physical connection paths between nodes, and A represents the adjacency matrix. represents the dynamic feature matrix of the node at time t, Represents the dynamic feature matrix of the edge at time t;
[0113] S32. Use the adjacency matrix to construct the normalized graph Laplacian matrix:
[0114]
[0115] Where L represents the normalized graph Laplace matrix, I represents the identity matrix, and D represents the degree matrix, satisfying Describe node v i degree, A ij Represents node v i With node v j Whether to connect directly, n represents the total number of nodes, D ii represents the elements of the degree matrix;
[0116] S33. Perform eigenvalue decomposition on the normalized graph Laplace matrix to obtain an eigenvector matrix and an eigenvalue diagonal matrix. Select the eigenvectors corresponding to the first k smallest eigenvalues to construct a spectral position encoding matrix:
[0117] L=UΛU T ,P=U[:,1:k];
[0118] Where L represents the normalized graph Laplacian matrix, U represents the eigenvector matrix, Λ represents the eigenvalue diagonal matrix, T represents the transpose operation, P represents the spectral position encoding matrix, the first k columns selected from the eigenvector matrix, and k represents the dimension of the spectral position encoding matrix;
[0119] S34, based on the dynamic graph structure model, calculate the shortest path distance matrix between each pair of nodes, where the elements in the shortest path distance matrix represent the distance from node v i To node v j The minimum number of edges passed through captures the relative distance information in the full graph structure:
[0120]
[0121] Among them, S ij Represents the elements of the shortest path distance matrix, describing the shortest path length, (v a ,v b ) represents the edge pair in the path, path:v i →v j Represents all slave nodes v i To node v j The reachable path, path represents the path, min represents the minimum value;
[0122] S35. Concatenate or perform dimensionality reduction processing on the spectral position encoding matrix and the row vector of each node in the shortest path distance matrix to generate a node position encoding matrix:
[0123] Z i=Concat(P i ,S i );
[0124] Among them, Z i Represents node v i The node position encoding matrix, P i Represents node v i The spectral position encoding matrix, S i Represents the row vector of each node in the shortest path distance matrix, and Concat represents the concatenation operation;
[0125] S36. Concatenate the node position encoding matrix and the node's dynamic feature matrix in the feature dimension to form an enhanced node feature matrix:
[0126]
[0127] in, represents the enhanced node feature matrix, Represents the dynamic feature matrix of the node;
[0128] S37. The enhanced node feature matrix, edge dynamic feature matrix and adjacency matrix are used as inputs of the GraphGPS graph neural network to perform structure-aware reasoning on the hydrogen leakage path.
[0129] The present invention introduces a joint mechanism of Laplace spectral position coding and shortest path distance coding, which enhances the node's ability to perceive its relative position in the graph and improves the modeling effect of the symmetry, position sensitivity and spatial structure complexity in the graph structure.
[0130] In this embodiment, the S4 specifically includes:
[0131] S41, constructing a GraphGPS graph neural network, wherein the GraphGPS graph neural network includes a local graph neural network module and a global Transformer module, and the input of the GraphGPS graph neural network includes an enhanced node feature matrix, an edge dynamic feature matrix, and an adjacency matrix;
[0132] S42. The module performs weighted feature aggregation on the neighbor node features and edge dynamic feature matrix of each node according to the node connection relationship defined in the adjacency matrix, generates the local embedded features of the node in the current graph convolution layer, and assigns the enhanced node feature matrix to the node feature:
[0133]
[0134] in, Represents node v i In the local embedding feature of the l+1 layer, σ represents the nonlinear activation function, Represents node v i The set of adjacent nodes is obtained from the adjacency matrix, W (l) represents the weight matrix of the lth layer, Represents node v j The node features at layer l, Represents vector concatenation operation, Represents edge v i →v j The dynamic feature matrix, W e represents the edge feature linear transformation matrix, b e represents the bias term;
[0135] S43. Input the local embedding features output by the local graph neural network module into the global Transformer module to generate the query matrix, key matrix and value matrix respectively:
[0136] Q=HW Q ,K=HW K ,V=HW V ;
[0137] Among them, Q, K, V represent the query matrix, key matrix and value matrix respectively, H represents the local embedding feature, and W Q ,W K ,W V Denotes the linear transformation matrices of query matrix, key matrix and value matrix respectively, d k represents the dimension of attention space;
[0138] S44. Based on the query matrix, key matrix and value matrix, the attention weight is calculated by introducing the edge feature bias:
[0139]
[0140] in, Represents node v i For node v j The attention weight, Q i represents the query matrix, d k represents the dimension of the attention space, represents the scaling factor, T represents the transposition operation, and W e represents the edge feature linear transformation matrix, b e represents the bias term, exp represents the natural exponential function, Represents edge v i →v j The dynamic feature matrix, n represents the total number of nodes, Represents edge v i →v m The dynamic feature matrix, K m ,Kj represents the bond matrix;
[0141] S45. Use the attention weights to perform weighted aggregation on the value matrix to generate the global context representation of the node:
[0142]
[0143] Among them, H′ i Represents node v i The global context representation, V j Represents node v j The value matrix of .
[0144] The present invention constructs a GraphGPS graph neural network consisting of a local graph neural network module and a global Transformer module, which realizes the unification of local structural feature aggregation and remote structural semantic capture between nodes, significantly improving the semantic integrity and structural perception capabilities of leakage path identification.
[0145] In this embodiment, the path-level data enhancement strategy simulates and constructs combined samples of potential leakage paths, expands the training data space, and enhances the GraphGPS graph neural network's ability to recognize atypical path patterns.
[0146] The present invention generates potential leakage path samples through a path-level data enhancement strategy, expands the training data distribution space, improves the model's ability to learn atypical and weakly labeled path patterns, and effectively improves the generalization and robustness of the prediction.
[0147] In this embodiment, the S5 specifically includes:
[0148] S51. Based on the dynamic graph structure model, the node set is kept unchanged and a path-level enhanced graph sample set is constructed by replacing the edge set, where each enhanced graph sample represents a potential leakage path;
[0149] S52: Generate a path set for each enhanced graph sample. The paths in the path set Represents a leak propagation sequence consisting of consecutive nodes:
[0150]
[0151] in, represents the mth path in the kth augmented graph sample, v L represents the Lth node in the path, and L represents the path length;
[0152] S53. Generate a corresponding path mask matrix for each path, and identify the edges passed through in the enhanced graph sample:
[0153]
[0154] in, Represents the path mask matrix, describing the path from node v i To node v j Path coverage mark;
[0155] S54. Apply the path mask matrix to the dynamic feature matrix of the edge, perform path-level screening and enhancement on the dynamic feature matrix of the edge, and calculate the path-enhanced edge feature matrix:
[0156]
[0157] in, represents the edge v in the k-th augmented graph sample i →v j The path-enhanced edge feature matrix, represents the path mask matrix, Represents edge v i →v j The dynamic feature matrix of
[0158] S55. Combine the node feature matrix, path-enhanced edge feature matrix, and adjacency matrix of each enhanced graph sample to form a training sample set.
[0159] The present invention introduces a path mask, enhanced edge features and graph structure combination mechanism in the training sample construction process, realizing a high-quality sample construction process from path semantics to structure enhancement, and enhancing the model's sensitivity to path structure and learning efficiency.
[0160] In this embodiment, S6 specifically includes:
[0161] S61. Combined with the historical leakage path labels, the GraphGPS neural network is supervised and trained using the training sample group.
[0162] S62. To enhance the network's ability to distinguish path importance, a path confidence matrix is constructed, where the elements in the path confidence matrix represent confidence weighting coefficients:
[0163]
[0164] in, Represents edge v i →v j The confidence weighting coefficient of Represents edge v i →v j The frequency of occurrence in the sample label, τ represents the control hyperparameter of the upper limit of confidence, and min represents the minimum value;
[0165] S63. Construct a confidence-weighted path-level loss function to measure the difference between the network-predicted path probability and the historical leakage path label:
[0166]
[0167] in, represents the confidence-weighted path-level loss function, K represents the number of training samples, n represents the total number of nodes, Represents the network edge v i →v j The predicted probability of belonging to the leakage path, Represents the historical leakage path label, describing the edge v i →v j Whether it is a real label belonging to the leakage path, Represents edge v i →v j The confidence weighted coefficient of , lg represents the logarithmic function with a base of 10;
[0168] S64. Introduce the sparsity regularization term to control the network's overfitting tendency to the path structure, and define the total loss function in combination with the L1 norm of the path:
[0169]
[0170] in, represents the total loss function, λ represents the weight coefficient of the sparse regularization term, represents the L1 norm of the predicted path, ‖·‖1 represents the L1 norm;
[0171] S65. Optimize the parameters of the GraphGPS neural network by minimizing the total loss function and use the gradient descent strategy for iterative updates:
[0172]
[0173] Among them, θ (t+1) represents the network parameters at the t+1th iteration, θ (t) represents the network parameters at the tth iteration, θ (t+1) represents the updated parameters, η represents the learning rate, Represents the gradient of the total loss function with respect to the current network parameters.
[0174] The present invention realizes the differentiated processing of information importance and structural constraint optimization in leakage path prediction by constructing a path confidence matrix, introducing a sparse regularization term and a path-level loss function based on a graph structure, thereby improving the training effect and output accuracy of the model.
[0175] In this embodiment, the S7 specifically includes:
[0176] S71. In the real-time prediction stage, dynamic monitoring data and graph structure information of the hydrogen transportation system at the current moment are obtained to generate an enhanced node feature matrix, an edge dynamic feature matrix, and an adjacency matrix;
[0177] S72, inputting the enhanced node feature matrix, the edge dynamic feature matrix, and the adjacency matrix into the trained and optimized GraphGPS graph neural network, and outputting the global context representation of the node;
[0178] S73. Calculate the leakage path prediction probability based on the global context representation of the node:
[0179]
[0180] in, Represents edge v i →v j The predicted probability of belonging to the leakage path, H′ i ,H′ j Represents node v i and v j The global context representation of Represents vector concatenation operation, Represents edge v i →v j The dynamic feature matrix, W o represents the weight matrix of the fully connected layer, b o represents the bias term of the fully connected layer, and σ represents the nonlinear activation function.
[0181] The present invention is based on the global context representation of the node, combines edge features with full-connection mapping to calculate the leakage path prediction probability, and realizes edge-level leakage path judgment. It has the advantages of high structural recognition accuracy, fast reasoning efficiency, and strong real-time performance, and is suitable for online leakage risk assessment.
[0182] Example 1:
[0183] To verify the feasibility of the present invention in implementation, the present invention was applied to a hydrogen transmission pipeline network system in a chemical park in South China. The park has typical characteristics such as high-pressure transmission of industrial hydrogen, complex branch pipelines, and dense deployment of sensors. The total pipeline network is approximately 22 kilometers long, covering 25 functional nodes (including gas storage tanks, pressure regulating valves, flow meters, check valves and other equipment) and 15 physically connected pipelines, forming an irregular industrial topology structure.
[0184] There are 20 multi-dimensional sensor nodes deployed in the system, which are used to collect real-time hydrogen pressure, temperature, flow rate, concentration changes, control valve status and other data. The sensor data is collected once a minute and uploaded to the data center in a structured form for storage and processing. By cleaning and screening the data of the past 6 months (October 2024 to March 2025), 12,580 groups of valid time series samples are retained as the input training data set of the graph neural network of the present invention.
[0185] Based on the system's structural drawings and equipment distribution lists, a graph structure model was constructed. Each functional unit in the system was abstracted as a node in the graph, and each connecting pipeline was mapped as an edge in the graph and represented in the form of an adjacency matrix. Combined with historical operating data, the dynamic feature vectors corresponding to each node were extracted, including pressure, temperature, and flow. The dynamic features of the edges include flow direction status, valve opening and closing values, and local flow velocity changes.
[0186] Secondly, the graph position encoding module is applied to generate two-dimensional encoding information for system nodes. One type is the spectral position encoding obtained by eigenvalue decomposition of the graph Laplacian matrix, and the other is the calculation of the shortest path matrix. After the two encoding dimensions are unified, they are concatenated and fused with the node dynamic features to form an enhanced node feature matrix, which serves as the input of the graph neural network.
[0187] Subsequently, a GraphGPS graph neural network was constructed. The local module consists of two layers of GCNs to learn the local structural embedding of nodes. The global module uses a multi-headed Transformer attention layer to model the potential dependencies between distant nodes. The model constructs labels based on paths. The training set contains nearly 400 historical leak records, including simulation experiments, real-world small-scale release tests, and sensor anomaly inversion paths. Path labels are annotated with an edge-level mask matrix, and the model is trained using a path-level weighted cross-entropy loss function. A sparsity regularization term is also introduced to suppress non-structural generalization error.
[0188] Table 1 Summary of performance comparison between the present invention and existing leakage detection methods
[0189]
[0190]
[0191] In terms of path recognition accuracy, the present invention achieved a path-level F1 value of 0.927, which is much higher than the 0.614 of the static rule model and the 0.755 of the traditional LSTM timing model. It is also better than the basic graph neural network model (0.802) that does not introduce position encoding. This shows that the present invention has stronger recognition capabilities in structural modeling and semantic perception. At the same time, the average overlap between its predicted path and the actual leakage path reaches 87.3%, reflecting that the path output results are not only accurate but also have a high degree of structural matching, and are suitable for direct use in subsequent risk control and response linkage.
[0192] From the perspective of system response efficiency, the present invention consumes an average of only 294 milliseconds in the inference stage, which is a significant improvement compared to the static rule method (1865 milliseconds) and the LSTM model (1100 milliseconds). It has real-time operation capabilities and fully meets the needs of online monitoring and edge deployment. In addition, through the path-level output form, the present invention can issue an early warning 326 seconds earlier than manual response on average, far exceeding the advance amount of other models, truly realizing the intelligent early warning goal of "early identification and fast response".
[0193] Comparison of functional characteristics further highlights the practical advantages of the present invention. Compared with other methods, the present invention supports complete path-level leakage prediction. The output results are not limited to alarm points or abnormal nodes, but restore the leakage propagation process in the form of continuous edges in the graph structure, greatly enhancing the interpretability and engineering guidance value of the prediction results. The ability to model dynamic graph structures enables the present invention to adapt to different pipe network topologies and dynamically changing operating states in real time, making it suitable for complex scenarios in industrial sites where topology is frequently adjusted and control strategies are flexibly switched. At the same time, the present invention introduces a graph position encoding strategy, integrating Laplace spectrum features with shortest path structure information, significantly enhancing the ability to model the position relationship between nodes, which is precisely the key capability commonly lacking in other comparative methods.
[0194] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.
Claims
1. A method for intelligent identification of hydrogen leakage paths based on graph neural networks, characterized in that: The steps include: S1. Construct a graph structure model of the hydrogen delivery system; S2. Acquire dynamic monitoring data of the hydrogen delivery system, perform preprocessing, and map the preprocessed dynamic monitoring data into node features and edge features of a graph structure model to form a dynamic graph structure model; S3. Perform graph position encoding on the dynamic graph structure model to generate a node position encoding matrix, and concatenate it with the node's dynamic feature matrix to form an enhanced node feature matrix; S4. Construct a GraphGPS graph neural network, perform full-graph semantic modeling of the dynamic graph structure model based on the enhanced node feature matrix, and generate a global context representation of the node; S5. Based on the dynamic graph structure model, a path-level data enhancement strategy is introduced to generate a training sample set; S6. Combined with the historical leakage path labels, the GraphGPS graph neural network is supervised and trained using the training sample set. The path-level loss function is used to minimize the deviation between the leakage path prediction result and the actual path, and the network parameters are optimized. S7. Based on the global context representation, the real-time dynamic monitoring data is input into the trained GraphGPS neural network to generate the leakage path prediction probability.
2. The method for intelligently identifying hydrogen leakage paths based on graph neural networks according to claim 1, characterized in that: The graph structure model includes a node set and an edge set, wherein the nodes represent functional units in the hydrogen delivery system, and the edges represent physical connection paths between the nodes.
3. The method for intelligently identifying hydrogen leakage paths based on graph neural networks according to claim 1, characterized in that: The dynamic monitoring data includes the pressure, temperature, hydrogen concentration, flow rate of the node and the flow direction state and control parameters of the edge.
4. The method for intelligently identifying hydrogen leakage paths based on graph neural networks according to claim 1, characterized in that: The preprocessing includes missing value filling, outlier removal, resampling and normalization.
5. The method for intelligently identifying hydrogen leakage paths based on graph neural networks according to claim 1, characterized in that: The S3 specifically includes: S31, based on dynamic graph structure model The node set is subjected to graph position coding, wherein the graph position coding includes Laplace spectrum position coding and shortest path distance coding, wherein G t Represents the dynamic graph structure model at time t, represents a node set, describing the functional units in the hydrogen delivery system, ε represents an edge set, describing the physical connection paths between nodes, and A represents the adjacency matrix. represents the dynamic feature matrix of the node at time t, Represents the dynamic feature matrix of the edge at time t; S32. Constructing a normalized graph Laplacian matrix using the adjacency matrix; S33, performing eigenvalue decomposition on the normalized graph Laplace matrix to obtain an eigenvector matrix and an eigenvalue diagonal matrix, and selecting the eigenvectors corresponding to the first k smallest eigenvalues to construct a spectral position coding matrix; S34, based on the dynamic graph structure model, calculate the shortest path distance matrix between each pair of nodes, where the elements in the shortest path distance matrix represent the distance from node v i To node v j The minimum number of edges passed through captures the relative distance information in the full graph structure; S35, concatenating or performing dimensionality reduction processing on the spectral position encoding matrix and the row vector of each node in the shortest path distance matrix to generate a node position encoding matrix; S36, concatenating the node position encoding matrix and the node dynamic feature matrix in the feature dimension to form an enhanced node feature matrix; S37. The enhanced node feature matrix, edge dynamic feature matrix and adjacency matrix are used as inputs of the GraphGPS graph neural network to perform structure-aware reasoning on the hydrogen leakage path.
6. The method for intelligently identifying hydrogen leakage paths based on graph neural networks according to claim 1, characterized in that: The S4 specifically includes: S41, constructing a GraphGPS graph neural network, wherein the GraphGPS graph neural network includes a local graph neural network module and a global Transformer module, and the input of the GraphGPS graph neural network includes an enhanced node feature matrix, an edge dynamic feature matrix, and an adjacency matrix; S42. The module performs weighted feature aggregation on the neighbor node features and edge dynamic feature matrix of each node according to the node connection relationship defined in the adjacency matrix, generates the local embedded features of the node in the current graph convolution layer, and assigns the enhanced node feature matrix to the node feature: in, Represents node v i In the local embedding feature of the l+1 layer, σ represents the nonlinear activation function, Represents node v i The set of adjacent nodes is obtained from the adjacency matrix, W (I) represents the weight matrix of the lth layer, Represents node v j The node features at layer l, Represents vector concatenation operation, Represents edge v i →v j The dynamic feature matrix, W e represents the edge feature linear transformation matrix, b e represents the bias term; S43, inputting the local embedding features output by the local graph neural network module into the global Transformer module to generate a query matrix, a key matrix, and a value matrix respectively; S44. Based on the query matrix, key matrix and value matrix, the attention weight is calculated by introducing the edge feature bias: in, Represents node v i For node v j The attention weight, Q i represents the query matrix, d k represents the dimension of the attention space, represents the scaling factor, T represents the transposition operation, and W e represents the edge feature linear transformation matrix, b e represents the bias term, exp represents the natural exponential function, Represents edge v i →v j The dynamic feature matrix, n represents the total number of nodes, Represents edge v i →v m The dynamic feature matrix, K m ,K j represents the bond matrix; S45. Use the attention weight to perform weighted aggregation on the value matrix to generate the global context representation of the node.
7. The method for intelligently identifying hydrogen leakage paths based on graph neural networks according to claim 1, characterized in that: The path-level data enhancement strategy simulates and constructs combination samples of potential leakage paths to expand the training data space.
8. The method for intelligently identifying hydrogen leakage paths based on graph neural networks according to claim 1, characterized in that: The S5 specifically includes: S51. Based on the dynamic graph structure model, the node set is kept unchanged and a path-level enhanced graph sample set is constructed by replacing the edge set, where each enhanced graph sample represents a potential leakage path; S52. For each enhanced graph sample, generate a path set, where a path in the path set represents a leakage propagation sequence consisting of consecutive nodes; S53, generating a corresponding path mask matrix for each path, and identifying the edges passed through in the enhanced graph sample; S54, applying the path mask matrix to the dynamic feature matrix of the edge, performing path-level screening and enhancement on the dynamic feature matrix of the edge, and calculating the path-enhanced edge feature matrix; S55. Combine the node feature matrix, path-enhanced edge feature matrix, and adjacency matrix of each enhanced graph sample to form a training sample set.
9. The method for intelligently identifying hydrogen leakage paths based on graph neural networks according to claim 1, characterized in that: The S6 specifically includes: S61. Combined with the historical leakage path labels, the GraphGPS neural network is supervised and trained using the training sample group. S62. Construct a path confidence matrix, where the elements in the path confidence matrix represent confidence weighting coefficients: in, Represents edge v i →v j The confidence weighted coefficient of Represents edge v i →v j The frequency of occurrence in the sample label, τ represents the control hyperparameter of the upper limit of confidence, and min represents the minimum value; S63. Construct a confidence-weighted path-level loss function to measure the difference between the network-predicted path probability and the historical leakage path label: in, represents the confidence-weighted path-level loss function, K represents the number of training samples, n represents the total number of nodes, Represents the network edge v i →v j The predicted probability of belonging to the leakage path, Represents the historical leakage path label, describing the edge v i →v j Whether it is a real label belonging to the leakage path, Represents edge v i →v j The confidence weighted coefficient of , lg represents the logarithmic function with a base of 10; S64. Introduce the sparsity regularization term to control the network's overfitting tendency to the path structure, and define the total loss function in combination with the L1 norm of the path: in, represents the total loss function, λ represents the weight coefficient of the sparse regularization term, represents the L1 norm of the predicted path, ‖·‖1 represents the L1 norm; S65. Optimize the parameters of the GraphGPS graph neural network by minimizing the total loss function and use the gradient descent strategy for iterative updates.
10. The method for intelligently identifying hydrogen leakage paths based on graph neural networks according to claim 1, characterized in that: The S7 specifically includes: S71. In the real-time prediction stage, dynamic monitoring data and graph structure information of the hydrogen transportation system at the current moment are obtained to generate an enhanced node feature matrix, an edge dynamic feature matrix, and an adjacency matrix; S72, inputting the enhanced node feature matrix, the edge dynamic feature matrix, and the adjacency matrix into the trained and optimized GraphGPS graph neural network, and outputting the global context representation of the node; S73. Calculate the leakage path prediction probability based on the global context representation of the node.
Citation Information
Cited By
Construction waste tracking method based on graph neural network
CN120821960A
Water supply network leakage node and time window joint positioning method based on hybrid neural network
CN121388739A
Position-aware hyperspectral image classification method based on subgraph convolutional network
CN121415126A