A method for quickly detecting sewer pipe clogging
By performing modal transformation and encoding on drainage pipe data, and combining physical information neural networks and graph attention mechanisms, the problems of low detection efficiency and insufficient accuracy in existing technologies have been solved, achieving high-precision and comprehensive drainage pipe siltation detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA POWER CONSRTUCTION GRP GUIYANG SURVEY & DESIGN INST CO LTD
- Filing Date
- 2026-02-12
- Publication Date
- 2026-04-17
AI Technical Summary
Existing drainage pipeline inspection technologies suffer from high risks and low efficiency due to manual inspection, insufficient sensor accuracy, weak generalization ability of data-driven neural networks, poor adaptability of inspection equipment, and difficulty in achieving comprehensive pipeline siltation detection.
By collecting drainage, siltation, and pipeline data, modal transformation and encoding are performed to obtain feature embedding vectors for each modality. Combined with physical information neural networks and graph attention mechanisms, spatiotemporal feature fusion is carried out. The total loss function modified by the physical mechanism is used for constrained training to output siltation thickness, type, and distribution area.
It achieves high-precision, all-round detection of siltation in drainage pipes, improves the model's generalization ability and prediction accuracy, adapts to pipe environments with different pipe diameters and slopes, and avoids contradictions between detection results and physical laws.
Smart Images

Figure CN121706028B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of drainage pipe inspection technology, and more specifically, to a rapid detection method for siltation in drainage pipes. Background Technology
[0002] Siltation in drainage pipes can easily lead to urban flooding, pipe network blockage, and water pollution, seriously threatening the normal operation of urban drainage systems and the safety of residents. Traditional detection methods have many limitations:
[0003] First, manual inspection in wells is risky and inefficient, and cannot be adapted to complex pipeline environments, such as pipes with changing diameters, bends, and murky water. Inspection personnel face safety hazards such as toxic and harmful gases and falls.
[0004] Second, the detection accuracy of a single sensor is insufficient. Acoustic sensors are easily affected by turbulent flow, leading to measurement errors. Visual sensors experience a sharp decline in imaging quality or even complete failure in murky water or low-light environments. Although lidar can acquire the contour of the inner wall of the pipe, it is difficult to capture the dynamic correlation between the flow field and sedimentation.
[0005] Third, existing data-driven neural network models lack physical constraints, have weak generalization ability, and are prone to output detection results that do not conform to the laws of fluid mechanics. For example, there is a physical contradiction between the predicted sediment thickness and the flow field velocity. The model's performance drops sharply under working conditions outside the training data distribution. Furthermore, the existing algorithm structure is rigid and has not designed a dedicated fusion mechanism for multi-source heterogeneous data in pipelines, making it difficult to fully explore the complementary information between different sensor data.
[0006] Fourth, the testing equipment has poor adaptability and is difficult to work stably in different pipe diameter ranges. The sensor probe is easily contaminated by silt, which leads to inaccurate measurements. In addition, there is a lack of special detection structures for siltation on the side walls and hidden siltation of pipes, resulting in blind spots and making it impossible to achieve comprehensive detection of siltation in pipes. Summary of the Invention
[0007] To address the above problems, this application provides a rapid detection method for siltation in drainage pipes, comprising the following steps:
[0008] S1. Collect drainage data, siltation data, and pipeline data;
[0009] The drainage data includes: flow rate data, water level data, flow velocity data, and liquid level data;
[0010] The sedimentation data includes: sidewall sedimentation thickness data, sedimentation surface height data, and sedimentation hardness data;
[0011] The pipeline data includes: physical connection relationships of drainage pipelines, pipe diameter data, pipe slope data, pipe length data, and pipe material data;
[0012] S2. Perform modal transformation and encoding on the drainage data to obtain the feature embedding vectors of each modality. Interact and fuse the feature embedding vectors of each modality to obtain the fused feature representation.
[0013] S3. Obtain spatial feature representation based on pipeline data, fused feature representation, flow data, and water level data;
[0014] S4. Perform predictive encoding on the fused feature representation to obtain the temporal feature representation;
[0015] S5. Obtain spatiotemporal fusion feature representation based on spatial feature representation and temporal feature representation;
[0016] S6. Input the spatiotemporal fusion feature representation and siltation data into the physical information neural network decoder, perform constrained training by combining the total loss function corrected by the physical mechanism, and output the drainage pipe detection results.
[0017] The test results for the drainage pipes include: silt thickness, silt type, and silt distribution area.
[0018] Furthermore, step S2, which involves modal transformation and encoding of the drainage data to obtain the feature embedding vectors of each modality, and then interacting and fusing these embedding vectors to obtain the fused feature representation, includes the following steps:
[0019] S21. Add location codes to the drainage data and obtain the drainage data after adding location codes;
[0020] S22. Map the drainage data after adding position encoding to the high-bit feature space to obtain the feature embedding vectors of each modality.
[0021] S23. Pair the feature embedding vectors of each modality, calculate the attention weights between the feature embedding vectors of each modality, and obtain cross-modal fusion features;
[0022] S24. Adjust the contribution weights of cross-modal fusion features through a gating mechanism to obtain the fusion feature representation.
[0023] Furthermore, the added position encoding supports the generation of sine and cosine functions;
[0024] The expression for the position encoding is:
[0025]
[0026]
[0027] Where PE represents the position encoding matrix, pos represents the position index in the sequence, i represents the feature dimension index, and d represents the model hidden dimension;
[0028] The expression for mapping the drainage data after adding position encoding to the high-order feature space is as follows:
[0029]
[0030] in, Represents the modal feature embedding vectors of the m-th modality. Represents the original input data of the m-th mode. and The weight matrix of the linear projection layer, and represents the bias vector, LayerNorm represents the layer normalization operation, and GELU represents the Gaussian error linear unit activation function.
[0031] The expression for calculating the attention weights between the feature embedding vectors of each modality is as follows:
[0032]
[0033]
[0034]
[0035]
[0036] Where Q represents the query matrix, K represents the key matrix, and V represents the value matrix. Feature embeddings representing query modalities Feature embeddings representing key modes Feature embeddings representing value modes The projection weight matrix representing the query. The projection weight matrix representing the key. The projection weight matrix of each value, The dimension of the key vector is represented by `softmax`, which represents the normalization exponential function. Represents the transpose of the key matrix;
[0037] The expression for adjusting the contribution weight of cross-modal fusion features through a gating mechanism is as follows:
[0038]
[0039]
[0040]
[0041]
[0042] Where G represents the gating weight vector, Represents the Sigmund activation function, and Represent the weight matrices of the gated layer and the projection layer, respectively. and Represents the bias vector, Represents the splicing of cross-modal fusion features. Representing the features after projection, The symbol represents the mean of six sets of features; circle (⊙) represents element-wise multiplication. This represents the fusion feature representation.
[0043] Furthermore, step S3, obtaining spatial feature representation based on pipeline data, fused feature representation, flow data, and water level data, includes the following steps:
[0044] S31. Construct a spatial topology adjacency matrix based on pipeline data;
[0045] S32. Obtain the dynamic adjacency matrix based on the spatial topology adjacency matrix, pipeline data, fusion feature representation, flow data, and water level data;
[0046] S33. Calculate the attention weights between nodes in the dynamic adjacency matrix using the graph attention mechanism, and perform weighted aggregation on the nodes of the dynamic adjacency matrix based on the fusion feature representation to obtain the weighted aggregation feature representation;
[0047] S34. Weighted aggregated feature representation uses a multi-head attention mechanism to execute multiple graph attention heads, concatenates the outputs of the attention heads, and obtains spatial feature representation.
[0048] Furthermore, step S4, predictively encoding the fused feature representation to obtain the temporal feature representation, includes the following steps:
[0049] S41. Extract local features based on the fused feature representation, and obtain multi-scale temporal features by feature concatenation of local features;
[0050] S42. Add positional encoding to multi-scale time series features, and use probabilistic query to obtain multi-scale time series features with reduced computational complexity.
[0051] S43. Perform feature transformation on the multi-scale time series features to reduce computational complexity and obtain time series feature representations.
[0052] Furthermore, step S5, obtaining the spatiotemporal fusion feature representation based on the spatial feature representation and the temporal feature representation, includes the following steps:
[0053] S51. Perform linear interpolation on the temporal feature representation;
[0054] S52. Using the cross-attention mechanism, spatial features are used as queries and temporal features are used as keys and values. Spatiotemporal cross-attention weights are calculated, and spatiotemporal fusion features are obtained based on the spatiotemporal cross-attention weights.
[0055] S53. Spatiotemporal fusion features are obtained by residual connection and layer normalization operations to obtain spatiotemporal fusion feature representations.
[0056] Furthermore, the physical information neural network decoder includes: a siltation thickness prediction network, a siltation type prediction network, and a physical residual feature extraction network;
[0057] The total loss function corrected by the physical mechanism specifically refers to the weighted sum of data loss and physical constraint loss;
[0058] The data loss includes: the deviation between the predicted value of siltation thickness and the measured value, the deviation between the predicted value of siltation type and the measured value, and the deviation between the predicted value of siltation distribution area and the measured value.
[0059] The physical constraint losses include: Navier-Stokes equation residual constraints, mass conservation constraints, siltation physical model constraints, and mechanical detection physical constraints.
[0060] Furthermore, the Navier-Stokes equation residual constraints The mechanical equilibrium used to constrain the flow field and sedimentation is expressed as follows:
[0061]
[0062] Where u is the flow velocity, t is the time, Let be the fluid kinematic viscosity, and ∇ be the gradient operator. 2 Here, p is the Laplace operator, and p is the pressure. Where g is the fluid density, g is the gravitational acceleration, and h is the sediment thickness. Where N is the pipe inner diameter and N is the sample size;
[0063] The mass conservation constraint To ensure that the sedimentation volume matches the flow field transport capacity, the expression is:
[0064]
[0065] Where ∇ is the gradient operator, h is the sedimentation thickness, t is time, and u is the flow velocity. Here, N represents the sediment settling rate, and N represents the sample size.
[0066] The constraints of the siltation physical model The expression is:
[0067]
[0068] in, Where h is the siltation coefficient and h is the siltation thickness. Here, denoted as critical scouring velocity, u is the velocity, and N is the number of samples.
[0069] The mechanical detection physical constraints The expression is:
[0070]
[0071] in, For the thickness of sidewall sediment, For pipe slope, For the hardness of the deposit measured by the pressure sensor, , where T is the hardness-type correlation coefficient, T is the sediment type, and N is the number of samples.
[0072] Furthermore, the training data for the constrained training model consists of multiple known drainage pipe data.
[0073] One set of known drainage pipeline data includes: pipe diameter, siltation type, flow field conditions, known drainage data, and known siltation data;
[0074] The model parameter update of the constraint training supports an adaptive matrix estimation optimizer, and the scheduling strategy of the constraint training adopts a cosine annealing learning rate scheduling strategy.
[0075] The constrained training model supports early stopping and gradient pruning.
[0076] Furthermore, the drainage pipe inspection results are output through an output layer, which includes: a siltation thickness output node, a siltation type output node, and a siltation distribution area output node;
[0077] The accumulation thickness output node supports a linear activation function;
[0078] The siltation type output node supports the normalized exponential activation function;
[0079] The output node for the siltation distribution area supports a linear activation function.
[0080] The beneficial effects of this invention are as follows:
[0081] 1. This invention achieves deep fusion of multi-source heterogeneous sensor data by performing modal transformation and encoding on drainage data, obtaining the embedding vectors of each modal feature, and interacting and fusing the embedding vectors of each modal feature. By extracting spatial correlation features and temporal evolution features, and through a spatiotemporal cross-attention mechanism, it achieves deep fusion of spatiotemporal features and fully explores the complementary information between different sensor data.
[0082] 2. The physical mechanism proposed in this invention corrects the loss function. Through four physical constraints—Navier-Stokes equation residual constraint, mass conservation constraint, siltation physical model constraint, and mechanical detection physical constraint—it ensures that the neural network prediction results conform to the laws of fluid dynamics, significantly improves the model's generalization ability and prediction accuracy, and avoids outputting detection results that contradict physical laws.
[0083] 3. This invention introduces pipeline physical parameters into spatial feature extraction, and integrates pipeline data such as pipe diameter and slope into the edge weight learning process of dynamic adjacency matrix. This enables the graph neural network to learn the influence of pipeline geometric characteristics on the spatial distribution of siltation, thereby improving the model's adaptability and generalization performance to pipelines with different diameters and slopes. Attached Figure Description
[0084] Figure 1 This is a flowchart illustrating the rapid detection method for siltation in drainage pipes provided in an embodiment of the present invention. Detailed Implementation
[0085] The specific implementation of the present invention will now be described in detail with reference to the accompanying drawings.
[0086] like Figure 1 As shown, the present invention provides a rapid detection method for siltation in drainage pipes, comprising the following steps:
[0087] S1. Collect drainage data, siltation data, and pipeline data;
[0088] The drainage data includes: flow rate data, water level data, flow velocity data, and liquid level data;
[0089] The sedimentation data includes: sidewall sedimentation thickness data, sedimentation surface height data, and sedimentation hardness data;
[0090] The pipeline data includes: physical connection relationships of drainage pipelines, pipe diameter data, pipe slope data, pipe length data, and pipe material data;
[0091] S2. Perform modal transformation and encoding on the drainage data to obtain the feature embedding vectors of each modality. Interact and fuse the feature embedding vectors of each modality to obtain the fused feature representation.
[0092] S2, performing modal transformation and encoding on the drainage data to obtain the feature embedding vectors of each modality, and interacting and fusing the feature embedding vectors of each modality to obtain the fused feature representation, includes the following steps:
[0093] S21. Add location codes to the drainage data and obtain the drainage data after adding location codes;
[0094] The added position encoding supports the generation of sine and cosine functions;
[0095] The expression for the position encoding is:
[0096]
[0097]
[0098] Where PE represents the position encoding matrix, pos represents the position index in the sequence, i represents the feature dimension index, and d represents the model hidden dimension;
[0099] S22. Map the drainage data after adding position encoding to the high-bit feature space to obtain the feature embedding vectors of each modality.
[0100] The expression for mapping the drainage data after adding position encoding to the high-order feature space is as follows:
[0101]
[0102] in, Represents the modal feature embedding vectors of the m-th modality. Represents the original input data of the m-th mode. and The weight matrix of the linear projection layer, and represents the bias vector, LayerNorm represents the layer normalization operation, and GELU represents the Gaussian error linear unit activation function.
[0103] S23. Pair the feature embedding vectors of each modality, calculate the attention weights between the feature embedding vectors of each modality, and obtain cross-modal fusion features;
[0104] In this embodiment, a total of six pairing combinations are formed, including flow rate-water level, flow rate-flow velocity, flow rate-liquid level, water level-flow velocity, water level-liquid level, and flow velocity-liquid level;
[0105] The expression for calculating the attention weights between the feature embedding vectors of each modality is as follows:
[0106]
[0107]
[0108]
[0109]
[0110] Where Q represents the query matrix, K represents the key matrix, and V represents the value matrix. Feature embeddings representing query modalities Feature embeddings representing key modes Feature embeddings representing value modes The projection weight matrix representing the query. The projection weight matrix representing the key. Projection weight matrix of each value The dimension of the key vector is represented by `softmax`, which represents the normalization exponential function. Represents the transpose of the key matrix;
[0111] S24. Adjust the contribution weights of cross-modal fusion features through a gating mechanism to obtain the fusion feature representation.
[0112] The expression for adjusting the contribution weight of cross-modal fusion features through a gating mechanism is as follows:
[0113]
[0114]
[0115]
[0116]
[0117] Where G represents the gating weight vector, Represents the Sigmund activation function, and Represent the weight matrices of the gated layer and the projection layer, respectively. and Represents the bias vector, Represents the splicing of cross-modal fusion features. Representing the features after projection, The symbol represents the mean of six sets of features; circle (⊙) represents element-wise multiplication. This represents the fusion feature representation.
[0118] S3. Obtain spatial feature representation based on pipeline data, fused feature representation, flow data, and water level data;
[0119] S3, obtaining spatial feature representation based on pipeline data, fused feature representation, flow data, and water level data, includes the following steps:
[0120] S31. Construct a spatial topology adjacency matrix based on pipeline data;
[0121] Specifically, in the spatial topology adjacency matrix, a value of 1 indicates a direct connection between corresponding network nodes, while a value of 0 indicates no direct connection. The expression is as follows:
[0122]
[0123] in, This represents the element in the i-th row and j-th column of the adjacency matrix A.
[0124] S32. Obtain the dynamic adjacency matrix based on the spatial topology adjacency matrix, pipeline data, fusion feature representation, flow data, and water level data;
[0125] Among them, pipeline data is used to constrain the hydraulic correlation strength between adjacent pipeline nodes, so that dynamic edge weights can reflect the physical impact of pipe diameter differences and slope changes on water flow transmission.
[0126] In this embodiment, a dynamic adjacency matrix is obtained through dynamic edge weight learning;
[0127] Specifically, the expression for dynamic edge weight learning is:
[0128]
[0129]
[0130]
[0131] in, The edge feature vector between node i and node j and Represent the feature vectors of node i and node j respectively. and Represent the flow values of node i and node j respectively. and Represent the water level values of node i and node j respectively. and The weight matrix of the edge-weighted learning network is represented by... and ReLU represents the bias vector, and ReLU represents the modified linear unit activation function. This represents the learned dynamic edge weights. Let represent the element in the i-th row and j-th column of the adjacency matrix A. Represents the elements of the dynamic adjacency matrix.
[0132] S33. Calculate the attention weights between nodes in the dynamic adjacency matrix using the graph attention mechanism, and perform weighted aggregation on the nodes of the dynamic adjacency matrix based on the fusion feature representation to obtain the weighted aggregation feature representation;
[0133] In this embodiment, attention weights between nodes are calculated through a graph attention mechanism, and the features of neighboring nodes are weighted and aggregated. A nonlinear transformation is performed using a modified linear unit activation function with leakage to obtain a weighted aggregated feature representation.
[0134] The graph attention layer has two layers, and each layer contains eight attention heads.
[0135] Specifically, the expression for the graph attention layer is:
[0136]
[0137]
[0138]
[0139]
[0140] in, W represents the input feature vector of node i, and W represents the feature transformation weight matrix. and The vector represents the transformed feature vector, and 'a' represents the parameter vector of the attention mechanism. LeakyReLU represents the transpose of the parameter vector; LeakyReLU represents the modified linear unit activation function with leakage. Let N(i) represent the attention weight of node i to node j, and let N(i) represent the set of neighboring nodes of node i. This represents the output feature of node i after passing through the graph attention layer.
[0141] S34. Weighted aggregated feature representation uses a multi-head attention mechanism to execute multiple graph attention heads, concatenates the outputs of the attention heads, and obtains spatial feature representation.
[0142] In this embodiment, the weighted aggregated feature representation is obtained by using a multi-head attention mechanism to execute multiple graph attention heads, concatenating the outputs of the attention heads, and then obtaining the spatial feature representation through the output projection layer and layer normalization operation.
[0143] Specifically, the multi-head attention mechanism executes K graph attention heads in parallel. The expression for multi-head graph attention is:
[0144]
[0145] Where ‖ denotes the vector concatenation operation, and K represents the number of attention heads. This represents the attention weight calculated by the k-th attention head. This represents the weight matrix of the k-th attention head.
[0146] S4. Perform predictive encoding on the fused feature representation to obtain the temporal feature representation;
[0147] S4, predictively encoding the fused feature representation to obtain the temporal feature representation, includes the following steps:
[0148] S41. Extract local features based on the fused feature representation, and obtain multi-scale temporal features by feature concatenation of local features;
[0149] In this embodiment, short-term convolution with a kernel size of 3, medium-term convolution with a kernel size of 24, and long-term dilated convolution with a dilation rate of 12 and a kernel size of 7 are used to extract local features at different time scales, and multi-scale temporal features are obtained by concatenating the features.
[0150] Specifically, the expression for multi-scale temporal convolution is:
[0151]
[0152]
[0153]
[0154]
[0155]
[0156] Where X represents the input feature sequence, Conv1d represents the one-dimensional convolution operation, This indicates the kernel size, padding indicates the padding size, and dilation indicates the dilation rate. This represents the output of a short-term convolution, used to capture short-term temporal changes. This represents the mid-term convolution output, used to capture mid-term temporal changes. This represents the output of a long-term dilated convolution, used to capture long-term temporal variations. Represents the output of residual convolution. This represents the result of splicing multi-scale convolutional features.
[0157] S42. Add positional encoding to multi-scale time series features, and use probabilistic query to obtain multi-scale time series features with reduced computational complexity.
[0158] By adding positional encoding to multi-scale temporal features, probabilistic queries are used to sparsify multi-scale temporal features. The most representative query vector is selected to participate in attention calculation, which reduces computational complexity while preserving long-range dependencies.
[0159] Specifically, the expression for probabilistic query sparsification is:
[0160]
[0161]
[0162]
[0163]
[0164] in, Represents the query vector Sparsity metric, used to measure the importance of the query vector. Indicates the length of the key sequence, This represents the selection of the most important u query indexes, TopK represents the operation of selecting the top u maximum values, and u = c·ln( ) represents the number of samples, and c represents the sampling factor. Represents the sparsed query matrix, Let Q represent the dimension of the key vector, Q represent the query matrix, K represent the key matrix, and V represent the value matrix.
[0165] In this embodiment, the sampling factor is 5.
[0166] S43. Perform feature transformation on the multi-scale time series features to reduce computational complexity and obtain time series feature representations.
[0167] In this embodiment, feature transformation is performed through a feedforward neural network. The feedforward neural network contains two layers of linear transformation and Gaussian error linear unit activation function, and the temporal length is compressed layer by layer through one-dimensional convolutional distillation operation. The encoder has 3 layers to obtain the final temporal feature representation.
[0168] Specifically, the expression for the feature transformation is:
[0169]
[0170] Wherein, FFN represents a feedforward neural network, and The weight matrix representing the linear transformation, and represents the bias vector, and GELU represents the Gaussian error linear unit activation function.
[0171] The temporal length is compressed layer by layer through a one-dimensional convolutional distillation operation, expressed as:
[0172]
[0173] in, Indicates the output of the l-th layer, represents the output of the (l+1)th layer, Conv1d represents the one-dimensional convolution operation, and MaxPool represents the max pooling operation.
[0174] S5. Obtain spatiotemporal fusion feature representation based on spatial feature representation and temporal feature representation;
[0175] S5, obtaining the spatiotemporal fusion feature representation based on spatial feature representation and temporal feature representation, includes the following steps:
[0176] S51. Perform linear interpolation on the temporal feature representation;
[0177] By performing linear interpolation on the temporal feature representation, the temporal dimension of the temporal feature representation is aligned with the spatial feature representation;
[0178] Specifically, the expression for linear interpolation is:
[0179]
[0180] in, Representing temporal characteristics, This represents the temporal characteristics after interpolation. The temporal dimension of the spatial feature representation is indicated by , and Interpolate represents the linear interpolation operation.
[0181] S52. Using the cross-attention mechanism, spatial features are used as queries and temporal features are used as keys and values. Spatiotemporal cross-attention weights are calculated, and spatiotemporal fusion features are obtained based on the spatiotemporal cross-attention weights.
[0182] This step achieves deep fusion of spatiotemporal features;
[0183] Specifically, the expression for cross-attention is:
[0184]
[0185]
[0186]
[0187]
[0188] in, Representation of spatial features, , , represents the query, key, and value projection weight matrices of spatiotemporal cross-attention, respectively, and HST represents the spatiotemporal fusion feature representation.
[0189] S53. Spatiotemporal fusion features are obtained by residual connection and layer normalization operations to obtain spatiotemporal fusion feature representations.
[0190] Specifically, the expressions for residual connectivity and layer normalization operations are:
[0191]
[0192] in, LayerNorm represents the spatiotemporal fusion feature representation after residual connection and layer normalization. It is a spatiotemporal fusion feature.
[0193] S6. Input the spatiotemporal fusion feature representation and siltation data into the physical information neural network decoder, perform constrained training by combining the total loss function corrected by the physical mechanism, and output the drainage pipe detection results.
[0194] The physical information neural network decoder includes: a siltation thickness prediction network, a siltation type prediction network, and a physical residual feature extraction network;
[0195] The total loss function corrected by the physical mechanism specifically refers to the weighted sum of data loss and physical constraint loss;
[0196] In this embodiment, the weighted sum of data loss and physical constraint loss is expressed as follows:
[0197]
[0198] Where α is the data loss weight coefficient, ranging from 0.6 to 0.8, and β is the physical constraint loss weight coefficient, ranging from 0.2 to 0.4. The optimal value is determined through cross-validation.
[0199] The data loss includes: the deviation between the predicted value of siltation thickness and the measured value, the deviation between the predicted value of siltation type and the measured value, and the deviation between the predicted value of siltation distribution area and the measured value.
[0200] In this embodiment, data loss The smoothed L1 loss function is used to measure the deviation between the model's predicted values and the labeled values. The expression is:
[0201]
[0202] Where N is the number of samples, h represents the siltation thickness, S represents the siltation area, T represents the siltation category, pred represents the predicted value of the siltation-related features for the i-th sample, true represents the true value of the siltation features, SmoothL1 represents the smoothing L1 loss function, and CE represents the cross-entropy loss function.
[0203] The physical constraint losses include: Navier-Stokes equation residual constraints, mass conservation constraints, siltation physical model constraints, and mechanical detection physical constraints.
[0204] Physical constraint loss Based on fluid mechanics theory and a sedimentation physics model, the prediction results are constructed to ensure they conform to physical laws. The expression is as follows:
[0205]
[0206] in, Representing the residual constraints of the Navier-Stokes equations, This represents the mass conservation constraint. This represents the constraints of the siltation physical model. This indicates the physical constraints of mechanical detection.
[0207] The Navier-Stokes equation residual constraint The mechanical equilibrium used to constrain the flow field and sedimentation is expressed as follows:
[0208]
[0209] Where u is the flow velocity, t is the time, Let be the fluid kinematic viscosity, and ∇ be the gradient operator. 2 Here, p is the Laplace operator, and p is the pressure. Where g is the fluid density, g is the gravitational acceleration, and h is the sediment thickness. Where N is the pipe inner diameter and N is the sample size;
[0210] The mass conservation constraint To ensure that the sedimentation volume matches the flow field transport capacity, the expression is:
[0211]
[0212] Where ∇ is the gradient operator, h is the sedimentation thickness, t is time, and u is the flow velocity. Here, N represents the sediment settling rate, and N represents the sample size.
[0213] The constraints of the siltation physical model The expression is:
[0214]
[0215] in, Where h is the siltation coefficient and h is the siltation thickness. Here, denoted as critical scouring velocity, u is the velocity, and N is the number of samples.
[0216] The mechanical detection physical constraints The expression is:
[0217]
[0218] in, For the thickness of sidewall sediment, For pipe slope, For the hardness of the deposit measured by the pressure sensor, , where T is the hardness-type correlation coefficient, T is the sediment type, and N is the number of samples.
[0219] In this embodiment, the physical information neural network decoder also includes a fluid-structure interaction residual calculation module, which is used to calculate the residuals of the continuity equation and the momentum equation.
[0220] The expression for the residual of the continuity equation is:
[0221]
[0222] Where A represents the cross-sectional area of the water passage, Q represents the flow rate, and x represents the spatial coordinate along the pipe direction;
[0223] The expression for the residual of the momentum equation is:
[0224]
[0225] Where H represents the water level, represents the friction gradient, and g represents the acceleration due to gravity;
[0226] By concatenating residual features with spatiotemporal fusion features, the physical consistency of the model is enhanced. The expression is as follows:
[0227]
[0228] in, This represents the final enhanced feature representation.
[0229] The training data for the constrained training model consists of multiple known drainage pipe data.
[0230] One set of known drainage pipeline data includes: pipe diameter, siltation type, flow field conditions, known drainage data, and known siltation data;
[0231] In this embodiment, the known drainage pipe data collected ranges from 300 mm to 2000 mm in inner diameter and from 0 to 5 degrees in slope, with a sample size of ≥10,000 groups.
[0232] The model parameter update of the constraint training supports an adaptive matrix estimation optimizer, and the scheduling strategy of the constraint training adopts a cosine annealing learning rate scheduling strategy.
[0233] In this embodiment, the adaptive matrix estimation optimizer has an initial learning rate of 0.001 and uses a cosine annealing learning rate scheduling strategy. The learning rate update expression is as follows:
[0234]
[0235] in, This represents the learning rate in the t-th period. This represents the minimum learning rate. This represents the maximum learning rate, and T represents the total number of training cycles.
[0236] The constrained training model supports early stopping and gradient pruning.
[0237] In this embodiment, an early stopping mechanism is used to prevent overfitting. Training is stopped when the validation set loss does not decrease for 10 consecutive epochs.
[0238] Gradient clipping is used to prevent gradient explosion, with an upper limit of 1.0 for the gradient norm. The gradient clipping formula is as follows:
[0239]
[0240] in, Represents the original gradient. Let |g|| represent the gradient after clipping, and ||g|| represent the norm of the gradient. This represents the upper bound of the gradient norm.
[0241] The test results for the drainage pipes include: silt thickness, silt type, and silt distribution area.
[0242] The prediction network for sediment thickness consists of three layers of linear transformation and Gaussian error linear unit activation functions. The last layer uses a modified linear unit activation function to ensure that the output is non-negative. The expression is as follows:
[0243]
[0244] in, This represents the predicted value of siltation thickness. , , This represents the weight matrix of the siltation thickness prediction network. , , represents the bias vector, ReLU represents the modified linear unit activation function, and GELU represents the Gaussian error linear unit activation function.
[0245] The prediction network for siltation types consists of two linear transformation layers, and finally outputs the type probability distribution through a normalized exponential function, expressed as:
[0246]
[0247]
[0248] in, This represents the raw output of the siltation type. , This represents the weight matrix of the siltation type prediction network. , This represents the bias vector. represents the probability distribution for predicting siltation type, softmax represents the normalized exponential function, and GELU represents the Gaussian error linear unit activation function.
[0249] The siltation distribution area prediction network adopts the same structure as the siltation thickness prediction network, and its expression is:
[0250]
[0251] Where Spred represents the predicted area of siltation distribution. , , This represents the weight matrix of the siltation distribution area prediction network. , , represents the bias vector, and GELU represents the Gaussian error linear unit activation function.
[0252] The drainage pipeline inspection results are output through the output layer, which includes: siltation thickness output node, siltation type output node, and siltation distribution area output node;
[0253] The accumulation thickness output node supports a linear activation function;
[0254] In this embodiment, the sediment thickness output node uses a linear activation function to output the sediment thickness value in centimeters.
[0255] The siltation type output node supports the normalized exponential activation function;
[0256] In this embodiment, the siltation type output node uses a normalized exponential activation function to output the probability distribution of siltation types, where type 1 represents siltation, type 2 represents oil blockage, and type 3 represents hardened scale. The category with the highest probability is taken as the final predicted type.
[0257] The output node for the siltation distribution area supports a linear activation function.
[0258] In this embodiment, the output node for the siltation distribution area uses a linear activation function to output the siltation distribution area value, in square meters.
[0259] This embodiment statistically analyzes the actual values of three indicators—silt thickness, silt type, and silt distribution area—from 300 sets of drainage pipe siltation detection cases, and compares them with the output results of the method proposed in this application. The performance indicators are shown in the table below:
[0260]
[0261] The experimental results compared with existing methods are shown in the table below:
[0262]
[0263] Experimental results show that the root mean square error of the sediment thickness is 0.352 cm, the accuracy of sediment type classification reaches 94.7%, the root mean square error of sediment distribution area is 0.089 m², and the goodness of fit reaches 0.978 and 0.965 respectively, which are significantly better than existing methods.
[0264] The introduction of the physical mechanism-corrected loss function reduced the root mean square error of the accumulation thickness by 16.4%, improved the accuracy of the accumulation type by 5.5 percentage points, and reduced the root mean square error of the accumulation area by 20.5%, verifying the effectiveness of the physical mechanism-corrected loss function in improving model performance.
[0265] This invention achieves deep fusion of multi-source heterogeneous sensor data by performing modal transformation and encoding on drainage data, obtaining embedding vectors of each modal feature, and interacting and fusing the embedding vectors of each modal feature. By extracting spatial correlation features and temporal evolution features, and through a spatiotemporal cross-attention mechanism, it achieves deep fusion of spatiotemporal features and fully explores the complementary information between different sensor data.
[0266] The physical mechanism proposed in this invention corrects the loss function by using four physical constraints: Navier-Stokes equation residual constraint, mass conservation constraint, siltation physical model constraint, and mechanical detection physical constraint. This ensures that the neural network prediction results conform to the laws of fluid dynamics, significantly improves the model's generalization ability and prediction accuracy, and avoids outputting detection results that contradict physical laws.
[0267] This invention significantly improves the physical representation capability and engineering adaptability of the model by introducing pipeline physical parameters into spatial feature extraction. Specifically, pipe diameter data directly affects the pipeline's flow capacity and velocity distribution. According to Manning's formula, pipeline flow rate is proportional to the 2 / 3 power of the hydraulic radius, and the hydraulic radius is positively correlated with pipe diameter. Therefore, differences in pipe diameter lead to significant changes in the flow transmission characteristics between adjacent pipes. Pipe slope data determines the acceleration of water flow under gravity and sediment deposition conditions. According to Chezy's formula, flow velocity is proportional to the 1 / 2 power of the slope. The smaller the slope, the lower the flow velocity, and the easier it is for sediment to deposit and form silt. By integrating pipe diameter and slope data into the edge weight learning process of the dynamic adjacency matrix, the graph neural network can adaptively adjust the information propagation weights according to the differences in the geometric characteristics of adjacent pipes when performing node feature aggregation, thereby more accurately modeling the spatial correlation patterns of siltation in the pipeline network. Furthermore, the introduction of pipeline data enhances the model's generalization ability to pipelines with different diameter ranges and slope conditions, enabling the model to maintain stable prediction accuracy under operating conditions outside the training data coverage, effectively solving the problem of insufficient generalization ability caused by the lack of physical prior knowledge in traditional data-driven models.
[0268] This invention has the advantages of high detection accuracy, good physical rationality, and strong adaptability, which is conducive to achieving the goal of high-precision and intelligent detection of siltation in drainage pipes.
[0269] The above-disclosed embodiments are merely a few specific examples of the present invention. However, the present invention is not limited thereto, and any variations that can be conceived by those skilled in the art should fall within the protection scope of the present invention.
Claims
1. A method for quickly detecting sewer pipe clogging, characterized by, Includes the following steps: S1. Collect drainage data, siltation data, and pipeline data; The drainage data includes: flow rate data, water level data, flow velocity data, and liquid level data; The sedimentation data includes: sidewall sedimentation thickness data, sedimentation surface height data, and sedimentation hardness data; The pipeline data includes: physical connection relationships of drainage pipelines, pipe diameter data, pipe slope data, pipe length data, and pipe material data; S2. Perform modal transformation and encoding on the drainage data to obtain the feature embedding vectors of each modality. Interact and fuse the feature embedding vectors of each modality to obtain the fused feature representation. S3. Obtain spatial feature representation based on pipeline data, fused feature representation, flow data, and water level data; S4. Perform predictive encoding on the fused feature representation to obtain the temporal feature representation; S5. Obtain spatiotemporal fusion feature representation based on spatial feature representation and temporal feature representation; S6. Input the spatiotemporal fusion feature representation and siltation data into the physical information neural network decoder, perform constrained training by combining the total loss function corrected by the physical mechanism, and output the drainage pipe detection results. The drainage pipe inspection results include: silt thickness, silt type, and silt distribution area; The physical information neural network decoder includes: a siltation thickness prediction network, a siltation type prediction network, and a physical residual feature extraction network; The total loss function corrected by the physical mechanism specifically refers to the weighted sum of data loss and physical constraint loss; The data loss includes: the deviation between the predicted value of siltation thickness and the measured value, the deviation between the predicted value of siltation type and the measured value, and the deviation between the predicted value of siltation distribution area and the measured value. The physical constraint losses include: Navier-Stokes equation residual constraints, mass conservation constraints, siltation physical model constraints, and mechanical detection physical constraints.
2. The sewer clogging quick detection method according to claim 1, characterized by, S2, performing modal transformation and encoding on the drainage data to obtain the feature embedding vectors of each modality, and interacting and fusing the feature embedding vectors of each modality to obtain the fused feature representation, includes the following steps: S21. Add location codes to the drainage data and obtain the drainage data after adding location codes; S22. Map the drainage data after adding position encoding to the high-bit feature space to obtain the feature embedding vectors of each modality. S23. Pair the feature embedding vectors of each modality, calculate the attention weights between the feature embedding vectors of each modality, and obtain cross-modal fusion features; S24. Adjust the contribution weights of cross-modal fusion features through a gating mechanism to obtain the fusion feature representation.
3. The sewer clogging quick detection method according to claim 2, characterized by, The added position encoding supports the generation of sine and cosine functions; The expression for the position encoding is: Where PE represents the position encoding matrix, pos represents the position index in the sequence, i represents the feature dimension index, and d represents the model hidden dimension; The expression for mapping the drainage data after adding position encoding to the high-order feature space is as follows: wherein, denotes the modal feature embedding vector of the m-th modality, denotes the original input data of the m-th modality, and denotes the weight matrix of the linear projection layer, and denotes the bias vector, LayerNorm denotes the layer normalization operation, and GELU denotes the Gaussian Error Linear Unit activation function. The expression for calculating the attention weights between the feature embedding vectors of each modality is as follows: Where Q represents the query matrix, K represents the key matrix, and V represents the value matrix. Feature embeddings representing query modalities Feature embeddings representing key modes Feature embeddings representing value modes The projection weight matrix representing the query. The projection weight matrix representing the key. Projection weight matrix of each value The dimension of the key vector is represented by `softmax`, which represents the normalization exponential function. Represents the transpose of the key matrix; The expression for adjusting the contribution weight of cross-modal fusion features through a gating mechanism is as follows: Where G represents the gating weight vector, Represents the Sigmund activation function, and Represent the weight matrices of the gated layer and the projection layer, respectively. and Represents the bias vector, Represents the splicing of cross-modal fusion features. Representing the features after projection, The symbol represents the mean of six sets of features; circle (⊙) represents element-wise multiplication. This represents the fusion feature representation.
4. The rapid detection method for siltation in drainage pipes according to claim 1, characterized in that, S3, obtaining spatial feature representation based on pipeline data, fused feature representation, flow data, and water level data, includes the following steps: S31. Construct a spatial topology adjacency matrix based on pipeline data; S32. Obtain the dynamic adjacency matrix based on the spatial topology adjacency matrix, pipeline data, fusion feature representation, flow data, and water level data; S33. Calculate the attention weights between nodes in the dynamic adjacency matrix using the graph attention mechanism, and perform weighted aggregation on the nodes of the dynamic adjacency matrix based on the fusion feature representation to obtain the weighted aggregation feature representation; S34. Weighted aggregated feature representation uses a multi-head attention mechanism to execute multiple graph attention heads, concatenates the outputs of the attention heads, and obtains spatial feature representation.
5. The rapid detection method for siltation in drainage pipes according to claim 1, characterized in that, S4, predictively encoding the fused feature representation to obtain the temporal feature representation, includes the following steps: S41. Extract local features based on the fused feature representation, and obtain multi-scale temporal features by feature concatenation of local features; S42. Add positional encoding to multi-scale time series features, and use probabilistic query to obtain multi-scale time series features with reduced computational complexity. S43. Perform feature transformation on the multi-scale time series features to reduce computational complexity and obtain time series feature representations.
6. The rapid detection method for siltation in drainage pipes according to claim 1, characterized in that, S5, obtaining the spatiotemporal fusion feature representation based on spatial feature representation and temporal feature representation, includes the following steps: S51. Perform linear interpolation on the temporal feature representation; S52. Using the cross-attention mechanism, spatial features are used as queries and temporal features are used as keys and values. Spatiotemporal cross-attention weights are calculated, and spatiotemporal fusion features are obtained based on the spatiotemporal cross-attention weights. S53. Spatiotemporal fusion features are obtained by residual connection and layer normalization operations to obtain spatiotemporal fusion feature representations.
7. The rapid detection method for siltation in drainage pipes according to claim 1, characterized in that, The Navier-Stokes equation residual constraint The mechanical equilibrium used to constrain the flow field and sedimentation is expressed as follows: Where u is the flow velocity, t is the time, Let be the fluid kinematic viscosity, and ∇ be the gradient operator. 2 Here, p is the Laplace operator, and p is the pressure. Where g is the fluid density, g is the gravitational acceleration, and h is the sediment thickness. Where N is the pipe inner diameter and N is the sample size; The mass conservation constraint To ensure that the sedimentation volume matches the flow field transport capacity, the expression is: Where ∇ is the gradient operator, h is the sedimentation thickness, t is time, and u is the flow velocity. Here, N represents the sediment settling rate, and N represents the sample size. The constraints of the siltation physical model The expression is: in, Where h is the siltation coefficient and h is the siltation thickness. Here, denoted as critical scouring velocity, u is the velocity, and N is the number of samples. The mechanical detection physical constraints The expression is: in, For the thickness of sidewall sediment, For pipe slope, For the hardness of the deposit measured by the pressure sensor, , where T is the hardness-type correlation coefficient, T is the sediment type, and N is the number of samples.
8. The rapid detection method for siltation in drainage pipes according to claim 1, characterized in that, The training data for the constrained training model consists of multiple known drainage pipe data. One set of known drainage pipeline data includes: pipe diameter, siltation type, flow field conditions, known drainage data, and known siltation data; The model parameter update of the constraint training supports an adaptive matrix estimation optimizer, and the scheduling strategy of the constraint training adopts a cosine annealing learning rate scheduling strategy. The constrained training model supports early stopping and gradient pruning.
9. The rapid detection method for siltation in drainage pipes according to claim 1, characterized in that, The drainage pipeline inspection results are output through the output layer, which includes: siltation thickness output node, siltation type output node, and siltation distribution area output node; The accumulation thickness output node supports a linear activation function; The siltation type output node supports the normalized exponential activation function; The output node for the siltation distribution area supports a linear activation function.
Citation Information
Patent Citations
Pipeline deposition condition diagnosis method and device based on multi-sensor data fusion
CN116821845A
Full-space intelligent detection method and system for underground drainage networks, as well as storage media
US20250259289A1