A method for filling physical attributes in GIS data of water supply networks based on graph neural networks

By constructing a topological map of the connection relationships of water supply pipeline segments and a graph attention neural network model, the problem of missing GIS attributes in the water supply network was solved, achieving efficient and accurate data filling and meeting the engineering requirements of the smart water system.

CN120910175BActive Publication Date: 2026-04-03TIANJIN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing technologies, when dealing with missing GIS attributes in water supply networks, ignore the spatial correlation characteristics between pipe segments, resulting in inaccurate filling results that do not conform to engineering practices and are difficult to meet the requirements of smart water systems for data integrity and accuracy.

Method used

A graph neural network-based approach is used to construct a topological map of the connection relationships of water supply pipe segments and combine it with a graph attention neural network model. Through spatial indexing and geometric alignment operations, the spatial and attribute relationships of pipe segments are fused. The graph attention feature aggregation module is used to fill in missing attributes, and the model performance is evaluated by weighted filling accuracy.

Benefits of technology

It improves the accuracy and logical consistency of filling missing attributes in pipeline network GIS, realizes end-to-end automated learning and data repair, ensures that the filling results meet engineering specifications, and improves the integrity and accuracy of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120910175B_ABST
    Figure CN120910175B_ABST
Patent Text Reader

Abstract

This invention discloses a method for physical attribute completion of GIS data for water supply networks based on graph neural networks, comprising the following steps: constructing a topological map of pipe segment connections and extracting physical attributes of pipe segments through spatial indexing and geometric alignment operations, generating missing attribute markers; constructing a pipe segment attribute completion model based on a graph attention neural network, employing a graph attention feature aggregation module, combining a Gaussian kernel function to express multi-hop spatial dependencies, forming composite attention weights, aggregating effective attribute features of neighbors, and decoding and predicting missing attributes; designing a weighted completion accuracy rate, and comprehensively evaluating the model's completion accuracy through a weighted approach. This invention integrates the topological connections between pipe segments into a graph neural network model, overcoming the limitation of traditional attribute completion methods that ignore the spatial correlation of the pipe network; the constructed graph neural network attribute completion model, through a graph attention feature aggregation module, incorporates both the spatial relationship of pipe segments and the attribute correlation into the model, improving inference accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of smart water technology, specifically to a method for filling in the physical attributes of GIS data for water supply networks based on graph neural networks. Background Technology

[0002] In the digital transformation of smart water management, water supply networks, as a core component of urban infrastructure, directly impact the accuracy of hydraulic model calibration, leakage detection, and operation and maintenance decisions due to the completeness of their physical attribute data (such as pipe diameter, pipe material, interface type, and completion date). However, due to factors such as non-standard historical data recording, missing construction data, and sensor malfunctions, large-scale missing attribute data often occurs in the geographic information system (GIS) data of water supply networks. Current mainstream data completion technologies have significant limitations: traditional statistical methods (such as mean imputation and regression imputation) and simple machine learning methods treat the water supply network as independent data points, ignoring the spatial correlation characteristics between pipe segments; undirected graph-based clustering algorithms (such as k-nearest neighbor algorithms) lack consideration for the impact of missing neighbors and the correlation between attributes, resulting in low accuracy and easily generating imputation results that do not conform to engineering practices. With the expansion of urban water supply networks and their intelligent upgrades, there is an urgent need for a new technology that can integrate the spatial and attribute correlations of pipe segments to comprehensively imput missing attributes, thereby solving the technical bottleneck of traditional methods in handling high-dimensional, strongly correlated GIS attribute missing data and meeting the requirements of data completeness and accuracy in practical engineering applications. Summary of the Invention

[0003] To overcome the shortcomings of traditional filling techniques in terms of low accuracy in complex missing scenarios, the main objective of this invention is to provide a method for filling physical attributes of water supply network GIS data based on graph neural networks. This method integrates the topology map of water supply pipeline connection relationships and the graph attention neural network model, solving the problem of accuracy in pipeline modeling and analysis when dealing with missing attributes in high-dimensional, strongly correlated pipeline networks.

[0004] To achieve the aforementioned objectives, the technical solution adopted by this invention includes:

[0005] A method for filling in physical attributes of GIS data for water supply networks based on graph neural networks includes the following steps:

[0006] S1: Construct a topology graph of pipe segment connection relationships through spatial indexing and geometric alignment operations, transform the pipe segment connection relationships into an undirected graph network, extract the physical attributes of the pipe segments, and generate missing markers;

[0007] S2: Construct a pipe segment attribute filling model based on graph attention neural network, adopt graph attention feature aggregation module, combine Gaussian kernel function to express multi-hop spatial dependency, form composite attention weight, aggregate effective attribute features of neighbors, and decode and predict missing attributes;

[0008] S3: Model performance evaluation, considering the differences in engineering importance of different attributes, designing a weighted filling accuracy rate, and comprehensively evaluating the model filling accuracy through a weighted method.

[0009] The step S1 of constructing the pipe segment connection topology diagram includes the following steps:

[0010] S1-1: Read the pipe network data in Shapefile format and calculate the geometric center coordinates of each pipe segment as a spatial reference;

[0011] S1-2: Use R-tree spatial index and buffer area to quickly retrieve neighbor segments;

[0012] S1-3: Align the geometry through the Snap operation to eliminate data acquisition errors and detect and verify pipe segment contact points;

[0013] S1-4: For neighboring pipe segments that meet the physical constraints, a topology graph is created with the midpoint coordinates as the graph vertex and the pipe segment connection relationship as the edge. The vertex attribute set includes pipe diameter, material, interface type, and completion date.

[0014] The method for constructing the R-tree spatial index structure in step S1-2 is as follows:

[0015] S1-2-1) Data Preprocessing: Expand the pipe segment geometry into a buffer region, with a buffer distance d. buffer Adaptively adjust based on pipeline density, such as: dense area d buffer =0.0005m, sparse region d buffer =0.002m;

[0016] S1-2-2) Index Insertion: Insert the bounding box of the buffer region into the R-tree index to establish a spatial hierarchy;

[0017] S1-2-3) Neighbor Query: Execute index.nearest on the current pipe segment to quickly return candidate neighboring pipe segments within the buffer area.

[0018] The Snap operation in steps S1-3 is used for geometric coordinate alignment. The specific steps are as follows:

[0019] S1-3-1) Coordinate Adsorption: Position the current pipe segment within tolerance t... snap =The geometry adsorbed to the adjacent pipe section within 0.001m generates the aligned geometry;

[0020] S1-3-2) Contact point calculation: Perform geometric intersection calculation on the aligned geometry and the adjacent pipe segment. If the result is a non-empty set of points and meets the physical constraints, it is determined to be a valid connection.

[0021] S1-3-3) Exception handling: If the contact point is a set of multiple points, select the contact point closest to the midpoint of both parties as the valid connection point.

[0022] The physical constraints in steps S1-4 are as follows:

[0023]

[0024] In the formula: d u d v —These are the distances from the contact point to the midpoint of the current pipe segment and the midpoint of the adjacent pipe segment, respectively; u , l v —These are the lengths of the current pipe segment and the adjacent pipe segment, respectively.

[0025] The method for extracting the physical properties of the pipe segment in step S1 is as follows:

[0026] Let the original attribute features of the current node u be: in Let be the set of real numbers, used to define the numerical space of model parameters. The attribute feature expressions are as follows:

[0027] h u = [Pipe diameter code, pipe material code, joint type code, completion date code].

[0028] The method for generating missing markers in step S1 is as follows: Let the missing marker m u ∈{0,1} 4 1 indicates missing, and 0 indicates present. Generation is divided into two phases: training and inference. During training, a random mask simulates missing data scenarios in real-world data, teaching the model how to infer when some information is missing. During inference, the model first detects the missing states of each attribute in the input data, generates a binary vector based on the detection results to identify the missing locations, and fills the detected missing attribute positions with 0s, inputting the effective attribute features h′ into the model. u The calculation formula is as follows:

[0029] h′ u =Wh u ⊙(1-m u );

[0030] In the formula: ⊙ — element-wise multiplication, i.e., Hadamard product, which suppresses the influence of missing attributes; —Feature projection matrix, which projects the original features h u Projected into a higher-dimensional space, d′ is the hidden layer dimension.

[0031] Step S2, which involves constructing a pipe segment attribute filling model based on a graph attention neural network, includes the following steps:

[0032] S2-1) Weight Calculation: Introduce the Gaussian kernel term into the graph attention weight calculation to form a composite attention weight e. uv The dynamic weight α is obtained by normalization using the Softmax function. uv The specific calculation formula is as follows:

[0033]

[0034] In the formula: e uv —Dynamic weights with Gaussian kernel terms; LeakyReLU—an improved neural network activation function; —Attention mechanism parameter vector, which maps the concatenated features to scalar attention scores; h′ v —Effective attribute features of neighbor node v; || —Vector concatenation operation, the concatenated dimension is 2d′×1; d uv —The number of hops in the shortest path between two nodes; —Gaussian kernel distance attenuation coefficient; α uv —Normalized attention weights; The set of neighbors of node u; k — to check in turn Each node in the process.

[0035] S2-2) Missing attribute imputation:

[0036] S2-2-1) Set up the graph attention feature aggregation module, first using the shared weight matrix W g Effective attribute features h′ of neighboring nodes v Perform the transformation, and then apply the attention weight α. uv Weighted aggregation is used to obtain the aggregation result z of the current node. u The aggregation result will serve as a unified feature representation for multi-attribute decoding, and its expression is as follows:

[0037]

[0038] In the formula: W g —The GAT layer shares the same weight matrix;

[0039] S2-2-2) Aggregate the feature vector z u Decode the data, and then fill in the missing attributes based on the missing marker of the current node; the decoding and filling formulas for the prediction results are as follows:

[0040]

[0041] In the formula: —The dimensions of the decoded predicted attribute features are consistent with those of the original attribute features; — Output decoding matrix; — Output bias vector; m u —Missing marker; h u —Original attribute characteristics;

[0042] S2-2-3) To extract the predicted binning results, filter out the neighboring nodes within the bin and extract their completion dates:

[0043]

[0044] In the formula: bin u —Predicted binning results; —Predicted completion date for each container; θ —Weighted threshold; —The set of high-weight neighbor nodes selected; y v — The completion date of neighbor v; bin(·) — Date binning mapping function;

[0045] A mode decision mechanism is set up, and the mode of the dates of the high-weight nodes selected within the bins is used as the filling result for the completion date of the current node. The calculation formula is as follows:

[0046]

[0047] In the formula: mode(·) — takes the mode of the set, i.e. the most frequent date;

[0048] S2-3) Model parameter optimization, including the following steps:

[0049] S2-3-1) Design of the loss function: The model loss function is as follows:

[0050]

[0051] In the formula: —Total number of nodes in the current training batch; —The true attribute vector of node u; (·) °2 — Element-by-element squaring operation; —The Frobenius norm of a matrix; — Vector L2 norm; λ — Regularization coefficient, determined through cross-validation;

[0052] S2-3-2) Parameter Optimization: Calculating the Loss Function Then, the gradients of each parameter are obtained through backpropagation automatic differentiation, and the Adam optimizer is used to update the parameters and minimize the result. Repeat the forward-backward process until the loss function converges and σ reaches its optimal value, thus achieving a balance between topological association modeling and missing-filling accuracy; the update of σ must satisfy the non-negativity constraint:

[0053]

[0054] In the formula: ε — the smallest positive value;

[0055] Trainable parameters include: feature projection matrix W, attention vector a, Gaussian kernel parameters σ, and GAT layer shared weight matrix W. g The output decoding matrix V and the output bias vector b are optimized through end-to-end training.

[0056] The formula for calculating the weighted imputation accuracy in step S3 is as follows:

[0057]

[0058] In the formula: k — attribute index; w k —Attribute importance weight; N miss,k — The number of missing samples for attribute k in the test set; —The padding value for the node u attribute k; —The actual value of attribute k of node u; τ k —Attribute tolerance threshold; —Indicator function, returns 1 if the condition is true, and 0 otherwise.

[0059] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0060] (1) Based on the spatial index and geometric alignment method, the construction of the topology map is completed more efficiently. The topological connection relationship between pipe segments is integrated into the graph neural network model, breaking through the limitation of the traditional attribute filling method that ignores the spatial correlation of the pipeline network.

[0061] (2) The constructed graph neural network attribute filling model incorporates the relationship between pipe segment space and attribute into the model through the graph attention feature aggregation module. At the same time, it can suppress the influence of missing attributes of neighboring nodes on the attribute filling of the current node, solve the problem of insufficient robustness of traditional methods for complex missing scenarios, and improve the inference accuracy.

[0062] (3) The attribute filling method realizes end-to-end automated learning. From the input of water supply network GIS data to the output of physical attribute missing value filling results, the entire process is automatically realized by the graph attention neural network model, which integrates topology construction, feature encoding, weight calculation and filling prediction into a unified framework. The model can be trained and its missing attributes can be filled through a piece of water supply network GIS data (which may contain missing attributes), which is more in line with the actual engineering needs of water supply network attribute filling.

[0063] (4) The learning framework enables multi-attribute collaborative filling. By combining the attribute coding system and regularization constraints, it ensures that the filling results are logically consistent under engineering specifications and avoids generating results that do not conform to engineering conventions. Attached Figure Description

[0064] Figure 1 A general framework diagram of the method for filling in the physical attributes of water supply networks;

[0065] Figure 2 This is a schematic diagram showing the mapping between the pipe segment and its topological connection relationship;

[0066] Figure 3 This is a schematic diagram of the attribute completion algorithm for a graph attention neural network. Detailed Implementation

[0067] The embodiments described below are exemplary descriptions of key experimental evidence and are not intended to limit the core content and application scope of this invention due to the amount of evidence. It should be noted that all the accompanying drawings and corresponding descriptions merely illustrate the concept, principles, and representative experimental evidence of the disclosed embodiments of this invention. Where the chain of evidence is complete, it is unnecessary to show all the specific details and extended details of the various embodiments listed in this invention.

[0068] Unless otherwise defined, the technical terms used in the following embodiments have the same meaning as commonly understood by those skilled in the art to which this invention pertains.

[0069] The invention aims to provide a method for filling in the physical attributes of water supply network GIS data by integrating a topological map of water supply pipeline connection relationships and a graph attention neural network model, achieving accurate data repair through the following technological innovations:

[0070] (1) Construct a topology graph of pipe segment connection relationship and extract the physical attributes and missing features of pipe segments: Construct a pipe network topology graph through spatial indexing and geometric alignment operations, and transform the pipe segment connection relationship into an undirected graph network, thereby integrating the spatial dependency relationship between pipe segments into the graph neural network; Design a multi-attribute standardized coding system (such as one-hot coding and time binning) to ensure that the filling result conforms to the engineering specifications; Introduce missing labels to transform the original attribute features into effective attribute features that mask the missing attributes and input them into the model, so that the model can suppress the influence of the missing attributes of neighboring nodes on the filling result.

[0071] (2) Constructing a pipe segment attribute filling model based on graph attention neural network: Propose a dynamic weighted model that integrates Gaussian kernel function and attention mechanism to adaptively adjust the influence weight of neighbor nodes; establish a single-layer graph attention feature aggregation module to aggregate effective attributes of neighbor nodes and finally obtain the filling result of the comprehensive pipe segment space and attribute correlation; realize the collaborative filling of multiple attributes such as pipe diameter and pipe material to enhance the data logic consistency.

[0072] (3) Model performance evaluation: Considering the differences in the importance of the physical properties of pipe sections in the project, a weighted fill accuracy (WIA) evaluation index is set to evaluate the accuracy of the model prediction. By introducing attribute importance weights and tolerance thresholds, the fill accuracy of attributes such as pipe diameter, pipe material, interface type and completion date is scientifically quantified to ensure that the model output results meet the actual needs of the project.

[0073] Example 1:

[0074] This invention proposes a method for filling in the physical attributes of GIS data for water supply networks based on graph neural networks. By integrating spatial topological relationships and deep learning technology, it solves the technical bottleneck of traditional methods when dealing with missing network attributes. The overall framework is as follows: Figure 1 As shown in the accompanying drawings and through specific embodiments, the method for filling in the physical properties of water supply networks according to the present invention will be further described below:

[0075] Step 1: Construct a topology map of pipe segment connections and extract physical attributes and missing features of the pipe segments.

[0076] (1) Construction of the topology diagram of pipe segment connection relationship

[0077] The system reads pipeline geographic information data in Shapefile format, calculates the geometric center coordinates of each pipe segment to establish a spatial feature benchmark, uses an R-tree spatial index structure combined with a buffer area to achieve fast retrieval of neighboring pipe segments, aligns the geometry through a snap operation to eliminate data acquisition errors, detects precise contact points between pipe segments and verifies their validity, and creates a topology graph of pipe segment connection relationships for neighboring pipe segments that meet physical constraints, using their midpoint coordinates as graph vertices. The vertex attribute set includes pipe diameter, material, interface type, completion date, etc. Figure 2 A schematic diagram illustrates the mapping between pipe segments and their topological connections.

[0078] The method for constructing the R-tree spatial index structure is as follows:

[0079] 1) Data preprocessing: Expand the pipe segment geometry into a buffer region, with a buffer distance d. buffer Adaptive adjustment based on pipeline network density (e.g., densely populated areas d) buffer =0.0005m, sparse region d buffer =0.002m);

[0080] 2) Index insertion: Insert the bounding box of the buffer region into the R-tree index to establish a spatial hierarchy;

[0081] 3) Neighbor query: Perform the index.nearest operation on the current pipe segment and return the candidate neighboring pipe segments in its buffer area (default maximum of 20) to avoid full traversal.

[0082] The Snap operation is used for geometric coordinate alignment, and the specific steps are as follows:

[0083] 1) Coordinate snapping: Snaps the endpoint of the current pipe segment geometry (G1) to the geometry of the adjacent pipe segment (G2), with snapping tolerance.

[0084] t snap =0.001m, generate the aligned geometry G′1 = snap(G1,G2,t) snap );

[0085] 2) Contact point calculation: Perform geometric intersection on G′1 and G2. If the result is a non-empty set of points and satisfies the physical constraints, it is determined to be a valid connection.

[0086] 3) Anomaly handling: If the contact point is a set of multiple points, select the contact point closest to the midpoint of both parties as the valid connection point.

[0087] The physical constraints are as follows:

[0088]

[0089] In the formula: d u d v —These are the distances from the contact point to the midpoint of the current pipe segment and the midpoint of the adjacent pipe segment, respectively; u , l v —These are the lengths of the current pipe segment and the adjacent pipe segment, respectively.

[0090] (2) Attribute feature extraction

[0091] Let the original attribute features (including possible missing values) of the current node u be: ( (where the set is the real number set, used to define the numerical space of model parameters), and the attribute feature expressions are as follows:

[0092] h u = [Pipe diameter code, pipe material code, joint type code, completion date code]

[0093] The specific encoding methods for each attribute are as follows:

[0094] 1) Pipe diameter coding

[0095] According to national standards, continuous pipe diameter values ​​are divided into 11 standard sizes (DN100-DN1400). For non-standard sizes, the nearest matching size is used. One-hot encoding is used to represent them. For example, DN300 corresponds to the encoding vector [0,0,1,0,…,0], with a dimension of 11.

[0096] 2) Pipe material and interface type coding

[0097] Both pipe material and interface type are categorical attributes, so searching for their categories can be done directly using one-hot encoding, with the number of categories being the dimension of the encoding vector.

[0098] 3) Completion date code

[0099] The completion date is determined using a time-binding method. Based on information such as the "project name" of each pipe segment in the pipeline network data, the completion date is divided into multiple time windows and then individually coded.

[0100] (3) Missing marker generation

[0101] Let the missing marker m u ∈{0,1} 4 1 indicates missing, and 0 indicates present. The missing data marker is a 4-dimensional binary vector; for example, [1,0,0,1] represents missing pipe diameter and date. Its generation involves two phases: training and inference.

[0102] 1) Training phase: Lack of artificial simulation

[0103] By simulating missing scenarios in real-world data through random masking, the model is taught how to reason when some information is missing. This primarily involves randomly masking some attributes of the training set samples according to a preset ratio, enabling the model to learn to fill in the missing values ​​using unmissing attributes and topological relationships.

[0104] 2) Reasoning stage: Automatically detect true missing values

[0105] This stage is used to handle natural missing data in actual business data. In practical applications, the model needs to first detect the missing status of each attribute in the input data, and generate a binary vector based on the detection results to identify the missing locations.

[0106] This step, in addition to detecting null (NaN) values ​​for a given attribute, also includes detecting outliers. Outliers are values ​​that exceed the reasonable range, such as pipe diameter of 0 or a negative value, missing part of the completion date (year, month, day), or other attribute values ​​not within the scope of the design data; these are marked as missing.

[0107] Missing attribute locations are padded with 0s to avoid inconsistencies in input dimensions. Therefore, missing attribute filtering is required for each node to retain valid features. Thus, the valid attribute features h′ input to the model... u The calculation formula is as follows:

[0108] h′ u =Wh u ⊙(1-m u )

[0109] In the formula: ⊙ — element-wise multiplication (Hadamard product), which suppresses the influence of missing attributes; —Feature projection matrix, which projects the original features hx into a high-dimensional space (d′ is the hidden layer dimension).

[0110] Step 2: Construct a pipe segment attribute filling model based on a graph attention neural network.

[0111] In the task of attribute completion for water supply networks, the topological connectivity between pipe segments is a more effective indicator of attribute correlation than simple spatial distance. Therefore, the shortest path hop count is used to quantify the topological distance: the distance between directly connected pipe segments is defined as 1, and the distance between segments connected via an intermediate pipe segment is defined as 2. Based on the pre-calculated hop count distance, this method designs a single-layer graph attention network structure that uses a Gaussian kernel function to express multi-hop spatial dependencies, enabling the perception of distant topological correlations without stacking multiple layers of networks. The algorithm's principle diagram is shown below. Figure 3 .

[0112] (1) Weight Calculation

[0113] To integrate spatial and attribute correlations, a Gaussian kernel term is introduced into the graph attention weight calculation, forming a composite attention weight. This weight is normalized using the Softmax function to generate a dynamic weight that simultaneously captures attribute similarity and the strength of multi-hop topological associations. The specific calculation formula is as follows:

[0114]

[0115] In the formula: e nv —Dynamic weights with Gaussian kernel terms; LeakyReLU—an improved neural network activation function; —Attention mechanism parameter vector, which maps the concatenated features to scalar attention scores; h′ v —Effective attribute features of neighbor node v; || —Vector concatenation operation, the concatenated dimension is 2d′×1; d uv —The number of hops in the shortest path between two nodes; —Gaussian kernel distance decay coefficient (scalar); α uv —Normalized attention weights; The set of neighbors of node u; k — to check in turn Each node in the process.

[0116] (2) Missing attribute imputation module

[0117] 1) Graph Attention Feature Aggregation Module

[0118] A single-layer Graph Attention Neural Network (GAT) is employed, which aggregates effective attribute features from neighbors by setting up a graph attention feature aggregation module. This is achieved through a shared weight matrix W. g Effective attribute features h′ of neighboring nodes vPerform the transformation, and then apply the attention weight α. uv Weighted aggregation yields the aggregation result z of the current node. u The aggregation result will serve as a unified feature representation for multi-attribute decoding, and its expression is as follows:

[0119]

[0120] In the formula: W g —The GAT layer shares the weight matrix.

[0121] 2) Decoding missing attribute prediction results

[0122] The calculated aggregated feature vectors of neighboring nodes are then decoded and converted into their original attribute feature form. Based on the missing markers of the current node, the corresponding missing attributes are then filled in. The decoding and filling formulas for the prediction results are as follows:

[0123]

[0124] In the formula: —The dimensions of the decoded predicted attribute features are consistent with those of the original attribute features; — Output decoding matrix; — Output bias vector; m u —Missing marker; h u —Original attribute characteristics.

[0125] 3) Special handling module for completion date:

[0126] Previously, to simplify calculations, completion dates were binned. Therefore, the output prediction results require special processing to ensure the results are in the form of completion dates rather than binned dates. First, the binned prediction results need to be extracted, filtering out neighboring nodes within each bin and extracting their completion dates:

[0127]

[0128] In the formula: bin u —Predicted binning results; —Predicted completion date for each container; θ —Weighted threshold; —The set of high-weight neighbor nodes selected; y v — Completion date of neighbor v; bin(·) — Date binning mapping function.

[0129] Finally, a mode decision mechanism is set up, where the mode of the dates of the high-weight nodes selected within the bins is used as the filling result for the completion date of the current node. The calculation formula is as follows:

[0130]

[0131] In the formula: mode(·) — takes the mode of the set (the most frequent date).

[0132] (3) Model parameter optimization strategy

[0133] Trainable parameters include: feature projection matrix W, attention vector a, Gaussian kernel parameters σ, and GAT layer shared weight matrix W. g The output decoding matrix V and the output bias vector b are optimized through end-to-end training.

[0134] 1) Design of the loss function

[0135] Regularization constraints were added along with the loss constraint for missing puncture to prevent overfitting and improve the model's generalization ability. The model loss function is as follows:

[0136]

[0137] In the formula: —Total number of nodes in the current training batch; —The true attribute vector of node u; (·) °2 — Element-by-element squaring operation; —The Frobenius norm of a matrix; — Vector L2 norm; λ — Regularization coefficient (hyperparameter), determined through cross-validation.

[0138] 2) Parameter optimization process

[0139] First, calculate the loss function. Then, the gradient of the loss function with respect to each parameter is calculated automatically through backpropagation. The Adam optimizer is then used to update the parameters to minimize the loss function. This forward-backward process is repeated until the loss function converges and σ reaches its optimal value, achieving a balance between topological association modeling and missing data imputation accuracy. The update of σ must satisfy a non-negativity constraint:

[0140]

[0141] In the formula: ε — a very small positive value.

[0142] Step 3: Model Performance Evaluation

[0143] Considering the varying importance of different engineering attributes, a weighted imputation accuracy (WIA) was designed to comprehensively evaluate the model's imputation accuracy through a weighted approach. Generally, a model is considered to have high accuracy if its average WIA value during training is greater than 0.85. The WIA calculation formula is as follows:

[0144]

[0145] In the formula: k—attribute index (e.g., 1 = pipe diameter, 2 = pipe material, 3 = joint type, 4 = completion date); w k —Attribute importance weight; N miss,k — The number of missing samples for attribute k in the test set; —The padding value for the node u attribute k; —The actual value of attribute k of node u; τ k —Attribute tolerance threshold; —Indicator function (1 if the condition is true, 0 otherwise).

[0146] Example 2: Application Case

[0147] (1) Construct a topology diagram of the water supply network connection relationship

[0148] This embodiment uses a water supply network containing 10 pipe segments as input data. The geometric information and connection relationships of the pipe segments are shown in Table 1. The network diagram and the generated connection topology diagram of the embodiment are shown below. Figure 2 As shown in the diagram. The following steps explain the process of building this pipeline network topology diagram.

[0149] Table 1. Geometric Information and Connection Relationships of Pipe Segments in Examples

[0150]

[0151] 1) Geometric center calculation

[0152] Spatial feature benchmarks were established by calculating the geometric centers of each pipe segment: P1:(5.0,0.0), P2:(15.0,2.5), P3:(17.5,10.0), P4:(10.0,12.5), P5:(2.5,5.0), P6:(22.5,7.5), P7:(27.5,7.5), P8:(32.5,2.5), P9:(7.5,12.5), P10:(12.5,15.0).

[0153] 2) Spatial Index Construction

[0154] An R-tree spatial index structure is adopted, and a buffer region is created for each pipe segment (the buffer distance in the dense region is 0.0005m, and the buffer distance in the sparse region is 0.0002m) to establish a spatial hierarchical retrieval structure.

[0155] 3) Inspection of adjacent pipe sections

[0156] For each pipe segment, perform the index.nearest operation to detect neighboring pipe segments (default maximum of 20): P1 end point (10,0) is adjacent to P2 start point (10,0); P2 end point (20,5) is adjacent to P3 start point (20,5) and P6 start point (20,5); P3 end point (15,15) is adjacent to P4 start point (15,15) and P10 start point (15,15), and other connection relationship detection.

[0157] 4) Geometric alignment verification

[0158] Align the geometry using a Snap operation (tolerance 0.001m) and verify the physical constraints. For example, at contact point (10,0):

[0159] Distance from midpoint of P1 satisfy

[0160] Distance from midpoint of P2 satisfy

[0161] 5) Topology graph generation

[0162] Construct the undirected graph G = (V, E):

[0163] Vertex set V = {P1, P2, P3, P4, P5, P6, P7, P8, P9, P10}

[0164] Edge set G={(P1,P2),(P2,P3),(P2,P6),(P3,P4),(P3,P6),(P3,P10),

[0165] (P4,P10),(P4,P5),(P4,P9),(P5,P1),(P6,P7),(P7,P8),(P9,P10),(P9,P5)}(2) Attribute Encoding and Missing Marker Generation

[0166] The physical properties (including missing properties) of the pipe section in the example are shown in Table 2.

[0167] Table 2 Pipe Segment Properties Table (Example)

[0168]

[0169] The pipe sections of the embodiment are coded according to the following coding rules, and the attribute coding and missing marker results are shown in Table 3. Pipe diameter: Unique heating code (DN100:[1,0],DN300:[1,0]).

[0170] Pipe material: Unique heat-resistant code (ductile iron: [1,0,0], PVC: [0,1,0], cast iron: [0,0,1]).

[0171] Interface type: Thermal coding (cut: [1,0,0], adhesive: [0,1,0], rubber ring socket: [0,0,1]).

[0172] Completion date: Container code (2000-2004: [1,0,0], 2005-2009: [0,1,0], 2010-2019: [0,0,1]).

[0173] Table 3. Correspondence Code Table for Pipe Segment Attributes in Examples

[0174]

[0175] (3) Constructing an attribute prediction model

[0176] 1) Model training samples

[0177] During training, 30% of the graph vertices in the network are randomly selected, and 1 to 3 attributes of each graph vertex are masked. Therefore, in this embodiment, 10 graph vertices can form 329280 graphs. There are 10 possible mask combinations, and the model training samples are sufficient and consistent with the actual missing data.

[0178] 2) Model parameters and evaluation

[0179] After 300 training rounds, the initial model loss decreased from 0.0435 to 0.0070, and the learning rate decreased from 0.01 to 0.0005. The optimized σ was 0.000183, indicating that the model assigned higher weights to directly connected pipe segments (hop count = 1). The WIA of the prediction results in each training round was calculated, along with the w for each attribute. k Setting it to 0.25 resulted in an average WIA of 0.91, indicating a high accuracy (>0.85), and the model training was complete.

[0180] (4) Model Application

[0181] The model trained using the above method can be directly applied to this water supply network, specifically to predict and fill in the missing attributes of pipe segments P3, P6, and P8. The original attribute features and missing data markers input to the model are as follows:

[0182] h P3 =[0,0,0,0,0,1,0,0,1,0,0]

[0183] m P3 =[1,1,0,0]

[0184] h P6 =[1,0,1,0,0,0,0,1,0,0,0]

[0185] m P3 =[0,0,0,1]

[0186] h P8 =[1,0,0,1,0,0,0,0,0,1,0]

[0187] m P3 =[0,0,1,0]

[0188] go through Figure 3 The computational process shown outputs the decoded prediction vector:

[0189]

[0190] The prediction results show that P3 has a pipe diameter of 300mm and is made of ductile iron, P6 has a date of 2013-5-6, and P8 has an adhesive joint. The model has completed the filling of the missing attributes of this pipeline network.

[0191] The above embodiments only describe a portion of the specific implementation methods of the present invention in detail, and are not limited to the embodiments disclosed herein. Furthermore, the substantive content protected by the present invention is not limited thereto. Any other modifications, equivalent substitutions, improvements, etc., made based on the principles and techniques of the present invention without departing from its design scope are all within the protection scope of the present invention.

Claims

1. A method for filling in physical attributes of GIS data for water supply networks based on graph neural networks, characterized in that, Includes the following steps: S1: Construct a topology graph of pipe segment connection relationships through spatial indexing and geometric alignment operations, transform the pipe segment connection relationships into an undirected graph network, extract the physical attributes of the pipe segments, and generate missing markers; S2: Construct a pipe segment attribute imputation model based on a graph attention neural network. It employs a graph attention feature aggregation module, combined with a Gaussian kernel function to express multi-hop spatial dependencies, forming composite attention weights. This aggregates effective attribute features from neighbors and decodes and predicts missing attributes. The steps include: S2-1) Weight Calculation: Introduce the Gaussian kernel term into the graph attention weight calculation to form composite attention weights. Dynamic weights are obtained by normalization using the Softmax function. ; The specific calculation formula is as follows: ; ; In the formula: —Dynamic weights with Gaussian kernel terms; LeakyReLU—an improved neural network activation function; —Attention mechanism parameter vector, which maps the concatenated features to scalar attention scores; — Neighbor nodes v Effective attribute features; || — Vector concatenation operation, the concatenated dimension is 2. d ′×1; —The number of hops in the shortest path between two nodes; —Gaussian kernel distance attenuation coefficient; —Normalized attention weights; :node u The set of neighbors; —Take all in sequence Each node in; S2-2) Missing attribute imputation: S2-2-1) Set up the graph attention feature aggregation module, first using a shared weight matrix. Effective attribute features of neighboring nodes Perform the transformation, and then adjust according to the attention weights. Weighted aggregation is used to obtain the final aggregation result for the current node. The aggregation result will serve as a unified feature representation for multi-attribute decoding, and its expression is as follows: ; In the formula: —The GAT layer shares the same weight matrix; S2-2-2) Aggregate feature vectors Decode the data, and then fill in the missing attributes based on the missing marker of the current node; the decoding and filling formulas for the prediction results are as follows: ; ; In the formula: —The dimensions of the decoded predicted attribute features are consistent with those of the original attribute features; — Output decoding matrix; — Output bias vector; —Missing markers; —Original attribute characteristics; S2-2-3) To extract the predicted binning results, filter out the neighboring nodes within the bin and extract their completion dates: ; ; ; In the formula: —Predicted binning results; —Predicted completion date for each container; —Weight threshold; —The set of high-weight neighbor nodes selected; --Neighbor The completion date; —Date binning mapping function; A mode decision mechanism is set up, where the mode of the dates of the high-weight nodes selected within the bins is used as the filling result for the completion date of the current node. The calculation formula is as follows: ; In the formula: —Take the mode of the set, i.e., the date with the highest frequency; S2-3) Model parameter optimization, including the following steps: S2-3-1) Design of the loss function: The model loss function is as follows: ; In the formula: —Total number of nodes in the current training batch; —The true attribute vector of node u; — Element-by-element squaring operation; —The Frobenius norm of a matrix; — Vector L2 norm; —The regularization coefficient is determined through cross-validation; S2-3-2) Parameter Optimization: Calculating the Loss Function Then, the gradients of each parameter are obtained through backpropagation automatic differentiation, and the Adam optimizer is used to update the parameters and minimize the time. Repeat the forward-backward process until the loss function converges. To achieve the optimal value, the model strikes a balance between topological association modeling and missing-filling accuracy; among which The update must satisfy the nonnegativity constraint: ; In the formula: —Minimum positive value; Trainable parameters Includes: feature projection matrix Attention vector Gaussian kernel parameters GAT layer shared weight matrix Output decoding matrix and output bias vector Optimized through end-to-end training; S3: Model performance evaluation, considering the differences in engineering importance of different attributes, designing a weighted filling accuracy rate, and comprehensively evaluating the model filling accuracy through a weighted method.

2. The method for filling in physical attributes of water supply network GIS data based on graph neural networks according to claim 1, characterized in that, The step S1 of constructing the pipe segment connection topology diagram includes the following steps: S1-1: Read the pipe network data in Shapefile format and calculate the geometric center coordinates of each pipe segment as a spatial reference; S1-2: Use R-tree spatial index and buffer area to quickly retrieve neighbor segments; S1-3: Align the geometry through the Snap operation to eliminate data acquisition errors and detect and verify pipe segment contact points; S1-4: For neighboring pipe segments that meet the physical constraints, create a topology graph with the midpoint coordinates as the graph vertex and the pipe segment connection relationship as the edge. The vertex attribute set includes pipe diameter, material, interface type, and completion date.

3. The method for filling in physical attributes of water supply network GIS data based on graph neural networks according to claim 2, characterized in that, The method for constructing the R-tree spatial index structure in step S1-2 is as follows: S1-2-1) Data Preprocessing: Expand the pipe segment geometry into a buffer zone, buffer distance... Adaptive adjustment based on pipeline density, in densely populated areas. =0.0005m, sparse region =0.002m; S1-2-2) Index Insertion: Insert the bounding box of the buffer region into the R-tree index to establish a spatial hierarchy; S1-2-3) Neighbor query: Execute index.nearest on the current pipe segment to quickly return candidate neighboring pipe segments in the buffer area.

4. The method for filling in physical attributes of water supply network GIS data based on graph neural networks according to claim 2, characterized in that, The Snap operation in steps S1-3 is used for geometric coordinate alignment. The specific steps are as follows: S1-3-1) Coordinate Adsorption: Position the current pipe segment within the tolerance range... =The geometry adsorbed onto the adjacent pipe section within 0.001m is generated into an aligned geometry; S1-3-2) Contact point calculation: Perform geometric intersection calculation on the aligned geometry and the adjacent pipe segment. If the result is a non-empty set of points and meets the physical constraints, it is determined to be a valid connection. S1-3-3) Exception handling: If the contact point is a set of multiple points, select the contact point closest to the midpoint of both parties as the valid connection point.

5. The method for filling in physical attributes of water supply network GIS data based on graph neural networks according to claim 2, characterized in that, The physical constraints in steps S1-4 are as follows: ; In the formula: , —These are the distances from the contact point to the midpoint of the current pipe segment and the midpoint of the adjacent pipe segment, respectively; , —These are the lengths of the current pipe segment and the adjacent pipe segment, respectively.

6. The method for filling in physical attributes of GIS data for water supply networks based on graph neural networks according to claim 1, characterized in that, The method for extracting the physical properties of the pipe segment in step S1 is as follows: Let the original attribute features of the current node u be: Let be the set of real numbers, used to define the numerical space of model parameters. The attribute feature expressions are as follows: 。 7. The method for filling in physical attributes of water supply network GIS data based on graph neural networks according to claim 1, characterized in that, The method for generating missing markers in step S1 is as follows: Let the missing markers be... 1 indicates missing, 0 indicates present; The generation process is divided into two phases: training and inference. During training, random masks are used to simulate missing data scenarios in real-world data, teaching the model how to infer when some information is missing. In the inference phase, the model first detects the missing states of each attribute in the input data, generates binary vectors based on the detection results to identify the missing locations, and fills the detected missing attribute positions with 0s, inputting these as valid attribute features into the model. The calculation formula is as follows: ; In the formula: — Element-wise multiplication, also known as the Hadamard product, suppresses the effects of missing attributes; —Feature projection matrix, which projects the original features Projected into a higher-dimensional space, d′ is the hidden layer dimension.

8. The method for filling in physical attributes of GIS data for water supply networks based on graph neural networks according to claim 1, characterized in that, The formula for calculating the weighted imputation accuracy in step S3 is as follows: ; ; In the formula: k — attribute index; —Attribute importance weight; — The number of missing samples for attribute k in the test set; —The padding value for the node u attribute k; —The actual value of the node u attribute k; —Attribute tolerance threshold; —Indicator function, 1 if the condition is true, 0 otherwise.

Citation Information

Patent Citations

  • Heterogeneous network attribute completion method based on graph neural network and attention mechanism

    CN115130663A

  • Heterogeneous graph neural network attribute completion method

    CN115587626A