Water conservancy flood control pipeline flow measurement method based on image recognition and multi-source perception
By combining image recognition and multi-source sensing technologies with grayscale thresholding and multi-scale attention residual fusion, the flow area and velocity distribution in flow measurement are dynamically corrected, solving the problem of low flow measurement accuracy in drainage pipelines under complex working conditions and achieving high-precision and high-reliability flow measurement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-16
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technologies have low accuracy and poor adaptability in measuring flow in drainage pipelines under complex working conditions, and the reliability of single vision methods is insufficient, resulting in delayed risk warning and diagnostic failure.
A method based on image recognition and multi-source sensing is adopted. By collecting flow velocity data, sedimentation thickness, flow field pressure data and gas-liquid interface images, and combining grayscale thresholding, multi-scale attention residual fusion, improved progressive feature pyramid network and flow direction sensing feature alignment submodule, the flow area and flow velocity distribution are dynamically corrected to calculate the real-time flow rate.
It significantly improves the accuracy and reliability of flow measurement in drainage pipelines under complex working conditions, enhances the degree of automation and environmental adaptability of flow measurement, and is safe, efficient, and adaptable to complex working conditions.
Smart Images

Figure CN121855631A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of water conservancy engineering measurement technology, and in particular relates to a method for measuring the flow of water conservancy flood control pipelines based on image recognition and multi-source sensing. Background Technology
[0002] In urban flood control, real-time, high-precision flow data is a crucial input for calibrating stormwater runoff models, enabling accurate assessment of pipeline flow capacity and flooding risk. In pipeline defect diagnosis, abnormal flow fluctuations across time and space are important indicators for identifying defects such as blockages and ruptures. However, traditional low-precision pipeline flow measurement methods (often with errors as high as ±15% or higher) often mask these abnormal signals, leading to delayed risk warnings and diagnostic failures. The accuracy of flow measurement directly determines the timeliness of monitoring and early warning, as well as the reliability of pipeline defect diagnosis.
[0003] Machine vision-based pipeline monitoring technology offers a new path to overcome traditional bottlenecks by directly acquiring images of the gas-liquid interface and water flow morphology. Despite the potential of machine vision-based methods, their application to drainage pipeline flow measurement still faces several key research gaps: Existing algorithms, when applied to the gas-liquid interface in dark environments, struggle to simultaneously suppress background overexposure, enhance water flow details, and maintain high processing efficiency, thus limiting the accuracy of subsequent segmentation; existing fast segmentation algorithms are prone to discontinuous and broken gas-liquid interface segmentation under complex conditions, exhibit poor adaptability to dynamic water flow, and fixed alignment methods are insufficient to handle changes in flow regime; most studies, when calculating flow rate from segmentation results, fail to adequately consider the mathematical integral expression of uneven velocity distribution across the fluid cross-section, simply using the average velocity multiplied by the area, leading to increased fitting errors for irregular cross-sections and limiting the accuracy of flow rate calculation.
[0004] Traditional physical measurement methods, limited by their underlying principles, suffer from insufficient accuracy and reliability under complex drainage pipeline conditions. While emerging machine vision methods show great promise, they remain immature in key areas such as multi-domain perception collaboration, dynamic adaptive enhancement and segmentation, and accurate fluid dynamics integral models. Therefore, there is an urgent need for a method that can deeply integrate image visual information with other physical domain sensor data to achieve high-precision and high-reliability flow measurement of urban drainage pipelines under real and complex operating conditions. Summary of the Invention
[0005] This invention provides a method for measuring the flow of water conservancy and flood control pipelines based on image recognition and multi-source sensing, which can solve the problems of low accuracy, poor adaptability and insufficient reliability of existing technologies in measuring the flow of drainage pipelines under complex working conditions.
[0006] The present invention is achieved through the following technical solutions.
[0007] This invention provides a method for measuring the flow rate of a water conservancy flood control pipeline based on image recognition and multi-source sensing, comprising the following steps: Step S1: Center the measuring equipment on the pipe axis based on the pipe inner diameter data; Step S2: Collect flow velocity data, siltation thickness and local flow velocity data, cross-sectional images of the hydraulic flood control pipeline at the gas-liquid interface, and flow field pressure data. Step S3: Based on image recognition and multi-source sensing, the method for measuring the flow of water conservancy and flood control pipelines corrects the effective flow area of the water conservancy and flood control pipeline according to the siltation thickness, integrates multi-source flow velocity data and image flow characteristics, calculates the cross-sectional weighted average flow velocity, and calculates the real-time flow in the water conservancy and flood control pipeline based on the product of the effective flow area and the weighted average flow velocity.
[0008] Preferably, in step S3, the method for measuring the flow rate of a water conservancy flood control pipeline based on image recognition and multi-source sensing includes the following steps: Step S31: By introducing a water flow grayscale threshold and a background region pixel threshold, a dual-domain perception dynamic enhancement submodule is constructed for the water flow grayscale threshold and background region pixel threshold of the gas-liquid interface of the water conservancy and flood control pipeline, so as to prevent overexposure of the background of the water conservancy and flood control pipeline cross-section image; in order to enhance the features of the gas-liquid interface of the water conservancy and flood control pipeline cross-section image in the underground dark environment, a multi-scale attention residual fusion submodule is established by integrating spatial channel adaptive attention weights and asymmetric convolution kernels; the visual domain feature enhancement of the water conservancy and flood control pipeline cross-section image is achieved by the dual-domain perception dynamic enhancement submodule and the multi-scale attention residual fusion submodule. Step S32: Based on the visual domain feature enhancement of the cross-sectional image of the water conservancy and flood control pipeline in Step S31, an improved progressive feature pyramid network loss function is constructed using a dual-constraint loss function of spatial boundary integrity and temporal continuity. At the same time, a flow direction-aware feature alignment submodule based on depthwise convolution and deformable convolution is established. The improved progressive feature pyramid network loss function and the flow direction-aware feature alignment submodule are used together to achieve visual domain target segmentation of the cross-sectional image of the water conservancy and flood control pipeline. Step S33: Based on the visual domain target segmentation of the water conservancy flood control pipeline cross-section image in step S32, a fitting method based on confidence time dual-constraint B-spline and water conservancy flood control pipeline siltation scanning curve is constructed. At the same time, adaptive integral and dynamic calibration function are combined to reduce the adjustment domain error of the water conservancy flood control pipeline cross-section quantization. Step S34: Based on the reduction of the adjustment domain error of the quantification of the flow cross section of the water conservancy flood control pipeline in step S33, a method for velocity distribution and flow integral of the water conservancy flood control pipeline considering the fluctuation correction coefficient is proposed to realize the calculation of the measurement results of the flow of the fluid domain of the water conservancy flood control pipeline.
[0009] Preferably, in step S31, the constructed dual-domain perceptual dynamic enhancement submodule includes a grayscale texture dual-domain feature localization function. and two-parameter dynamic enhancement function Among them, the grayscale texture dual-domain feature localization function optimizes the grayscale threshold. and texture threshold To define the region of interest and solve for the optimal grayscale threshold and optimal texture threshold The following two objective functions are optimized simultaneously, and the calculation method is as follows:
[0010] in, and Let represent the parameters that minimize and maximize the objective function, respectively. Indicates the grayscale threshold. Indicates the texture threshold. and These represent values based on the current threshold. , The pixel ratio of the divided background area and water flow area and These represent the grayscale variances of the background area and the water flow area, respectively. and Image pixels representing texture and background regions. Represents the local binary pattern operator; Based on the obtained optimal threshold and Define region of interest :
[0011] Two-parameter dynamic enhancement function Based on region Perform adaptive enhancement:
[0012] in, This represents the gray value of the image at point (x, y). , and These represent the average grayscale value of the target area, the average grayscale value of the water flow area, and the average grayscale value of the background area, respectively. and These represent the target contrast and the contrast of the water flow area, respectively. The multi-scale attention residual fusion submodule consists of a feature fusion function based on a feature weight adaptive allocation method. The implementation and calculation method are as follows:
[0013] in, This represents the output feature map of the traditional residual branch. This represents the scale index, or scale number, with a value ranging from 1 to 3. Indicates the first Attention weights at each scale This represents the spatial attention operator. Indicates the channel attention manipulator. Indicates the first Output feature maps of asymmetric convolution at various scales This represents the element-wise multiplication operator.
[0014] Preferably, in step S32, the improved progressive feature pyramid network loss function combines the loss weights of temporal and spatial boundaries to establish an improved loss function that simultaneously emphasizes the integrity of spatial boundaries and temporal continuity. The calculation method is as follows:
[0015] in, and These represent the weights of the spatial boundary loss and the temporal continuity loss, respectively. , and These represent the cross-entropy loss, spatial boundary loss, and temporal continuity loss, respectively. Indicates the number of pixels at the segmentation boundary. This represents the Euclidean distance from the predicted interface pixel (x, y) to the actual interface. This represents the marker distance (x, y) of the actual interface pixel. Represents the gradient operator, This represents the classification probability of the pixel (x, y) predicted by the segmentation network. This represents the true label of the pixel (x, y). and These represent the gas-liquid interface functions in polar coordinates at times t and t-1, respectively. This represents the set of boundary pixels at the gas-liquid interface in a water conservancy and flood control pipeline. and Let L2 norm and L1 norm be represented respectively; The flow direction sensing feature alignment submodule dynamically adjusts the position of the adaptive convolution kernel using a deformable convolution operator, and uses the interface shape feature alignment function of the hydraulic flood control pipeline to achieve accurate segmentation of the gas-liquid interface of the hydraulic flood control pipeline. The calculation method is as follows:
[0016] in, Represents a depthwise convolution operator. This represents the deformable convolution operator. The image feature map represents the input. This represents the offset of the deformable convolution. This represents the alignment function for the interface shape characteristics of water conservancy and flood control pipelines.
[0017] Preferably, in step S33, the adaptive integral is calculated as follows:
[0018] in, and Let A and B represent the x-coordinates of the two vertices A and B at the gas-liquid interface of the water conservancy and flood control pipeline, respectively, on the x-axis. This describes the function representing the gas-liquid interface of a hydraulic flood control pipeline in a Cartesian coordinate system. The function describes the measurement of the sediment surface of a hydraulic flood control pipeline section below the gas-liquid interface in a Cartesian coordinate system. This represents the cross-sectional area of the fluid flow within the water conservancy flood control pipeline at time t. This indicates the correction region outside the integration region. and Indicate the polar angle between points A and B. Indicates the inner diameter of the water conservancy and flood control pipeline; The calculation method for the dynamic calibration function is as follows:
[0019] in, This represents the cross-sectional area after dynamic calibration. , , and Indicates the calibration coefficient. This indicates the frequency of water flow fluctuations.
[0020] Preferably, in step S34, the instantaneous flow function calculation method for the velocity distribution and flow integral method of the hydraulic flood control pipeline considering the fluctuation correction coefficient is as follows:
[0021] in, This represents the maximum flow velocity at the center of the water conservancy flood control pipeline at time t. This represents the gravity correction factor that takes into account the effect of gravity on the bottom flow velocity. This indicates the angle between the axis of the water conservancy and flood control pipeline and the horizontal plane. This represents the fluctuation correction coefficient that takes into account the impact of interface fluctuations on velocity. , This represents the interface smoothness index. Represents the velocity distribution function. Represents the instantaneous flow function. Indicates the frequency of water flow fluctuations. and These represent the horizontal and vertical coordinates of the center point O of the water conservancy flood control pipeline, respectively. and These represent the coordinate differences of the calculation point relative to the center of the pipe in the horizontal and vertical directions, respectively. This indicates that the integration region is limited to the effective flow cross-section region. , This indicates the inner diameter of the water conservancy and flood control pipeline.
[0022] Preferably, the effective flow area of the instantaneous flow function calculation method is obtained by subtracting the cross-sectional area occupied by silt from the nominal cross-sectional area of the water conservancy flood control pipeline; The velocity distribution function of the instantaneous flow function calculation method is obtained by spatial interpolation and weighted calculation using cross-sectional velocity profiles, local velocity data, and image flow characteristics collected by the measuring equipment.
[0023] If a sudden change in the flow field pressure data is detected in step S2, the attitude of the measuring equipment is adjusted until the flow field pressure data stabilizes.
[0024] If the turbidity of the water is detected to be greater than the preset value in step S2, the dredging program is started to clean the silt at the bottom of the pipe.
[0025] The beneficial effects of this invention are as follows: This invention integrates information from multiple physical domains, including image vision, radar velocity measurement, ultrasonic ranging, and pressure sensing, and employs an intelligent data fusion algorithm to dynamically correct for errors in flow area and uneven flow velocity distribution caused by siltation. This significantly improves the accuracy, reliability, and environmental adaptability of flow measurement in drainage pipelines under complex operating conditions. The entire measurement process is highly automated, requiring no personnel to enter the pipeline, ensuring safety and efficiency. It provides effective technical equipment for the intelligent management of urban flood control and drainage networks. Attached Figure Description
[0026] Figure 1 This is a flowchart of the workflow of the present invention. Detailed Implementation
[0027] The technical solution of the present invention is further described below, but the scope of protection is not limited to what is described.
[0028] Example 1: like Figure 1As shown, a method for measuring the flow rate of a water conservancy flood control pipeline based on image recognition and multi-source sensing includes the following steps: Step S1: Center the measuring equipment on the pipe axis based on the pipe inner diameter data; Step S2: Collect flow velocity data, siltation thickness and local flow velocity data, cross-sectional images of the hydraulic flood control pipeline at the gas-liquid interface, and flow field pressure data. Step S3: Based on image recognition and multi-source sensing, the method for measuring the flow of water conservancy and flood control pipelines corrects the effective flow area of the water conservancy and flood control pipeline according to the siltation thickness, integrates multi-source flow velocity data and image flow characteristics, calculates the cross-sectional weighted average flow velocity, and calculates the real-time flow in the water conservancy and flood control pipeline based on the product of the effective flow area and the weighted average flow velocity.
[0029] Step S3 includes the following steps: Step S31: By introducing a water flow grayscale threshold and a background region pixel threshold, a dual-domain perception dynamic enhancement submodule is constructed for the water flow grayscale threshold and background region pixel threshold at the gas-liquid interface of the water conservancy and flood control pipeline, to prevent overexposure of the background in the cross-sectional image of the water conservancy and flood control pipeline. To enhance the features of the gas-liquid interface in the cross-sectional image of the water conservancy and flood control pipeline in the underground dark environment, a multi-scale attention residual fusion submodule is established by integrating spatial channel adaptive attention weights and asymmetric convolution kernels. The dual-domain perception dynamic enhancement submodule and the multi-scale attention residual fusion submodule jointly realize the visual domain feature enhancement of the cross-sectional image of the water conservancy and flood control pipeline. The constructed dual-domain perception dynamic enhancement submodule includes a grayscale texture dual-domain feature localization function. and two-parameter dynamic enhancement function Among them, the grayscale texture dual-domain feature localization function optimizes the grayscale threshold. and texture threshold To define the region of interest and solve for the optimal grayscale threshold and optimal texture threshold The following two objective functions are optimized simultaneously, and the calculation method is as follows:
[0030] in, and Let represent the parameters that minimize and maximize the objective function, respectively. Indicates the grayscale threshold. Indicates the texture threshold. and These represent values based on the current threshold. , The pixel ratio of the divided background area and water flow area and These represent the grayscale variances of the background area and the water flow area, respectively. and Image pixels representing texture and background regions. This represents the local binary pattern operator.
[0031] Based on the obtained optimal threshold and Define region of interest :
[0032] Two-parameter dynamic enhancement function Based on region Perform adaptive enhancement:
[0033] in, This represents the gray value of the image at point (x, y). , and These represent the average grayscale value of the target area, the average grayscale value of the water flow area, and the average grayscale value of the background area, respectively. and These represent the target contrast and the contrast of the water flow area, respectively. The multi-scale attention residual fusion submodule consists of a feature fusion function based on a feature weight adaptive allocation method. The implementation and calculation method are as follows:
[0034] in, This represents the output feature map of the traditional residual branch. This represents the scale index, or scale number, with a value ranging from 1 to 3. Indicates the first Attention weights at each scale This represents the spatial attention operator. Indicates the channel attention manipulator. Indicates the first Output feature maps of asymmetric convolution at various scales This represents the element-wise multiplication operator.
[0035] Step S32: Based on the visual domain feature enhancement of the cross-sectional image of the water conservancy and flood control pipeline in Step S31, an improved progressive feature pyramid network loss function is constructed using a dual-constraint loss function of spatial boundary integrity and temporal continuity. Simultaneously, a flow direction-aware feature alignment submodule based on depthwise convolution and deformable convolution is established. The improved progressive feature pyramid network loss function and the flow direction-aware feature alignment submodule jointly achieve visual domain target segmentation of the cross-sectional image of the water conservancy and flood control pipeline. The improved progressive feature pyramid network loss function, by combining the loss weights of temporal and spatial boundaries, establishes an improved version of the loss function that simultaneously emphasizes spatial boundary integrity and temporal continuity. The calculation method is as follows:
[0036] in, and These represent the weights of the spatial boundary loss and the temporal continuity loss, respectively. , and These represent the cross-entropy loss, spatial boundary loss, and temporal continuity loss, respectively. Indicates the number of pixels at the segmentation boundary. This represents the Euclidean distance from the predicted interface pixel (x, y) to the actual interface. This represents the marker distance (x, y) of the actual interface pixel. Represents the gradient operator, This represents the classification probability of the pixel (x, y) predicted by the segmentation network. This represents the true label of the pixel (x, y). and These represent the gas-liquid interface functions in polar coordinates at times t and t-1, respectively. This represents the set of boundary pixels at the gas-liquid interface in a water conservancy and flood control pipeline. and Let L2 norm and L1 norm be represented respectively; The flow direction sensing feature alignment submodule dynamically adjusts the position of the adaptive convolution kernel using a deformable convolution operator, and uses the interface shape feature alignment function of the hydraulic flood control pipeline to achieve accurate segmentation of the gas-liquid interface of the hydraulic flood control pipeline. The calculation method is as follows:
[0037] in, Represents a depthwise convolution operator. This represents the deformable convolution operator. The image feature map represents the input. This represents the offset of the deformable convolution. This represents the alignment function for the interface shape characteristics of water conservancy and flood control pipelines.
[0038] Step S33: Based on the visual domain target segmentation of the water conservancy and flood control pipeline flow section image in Step S32, a fitting method based on confidence time dual-constraint B-splines and the siltation scanning curve of the water conservancy and flood control pipeline is constructed. Simultaneously, adaptive integrals and dynamic calibration functions are combined to reduce the adjustment domain error of the water conservancy and flood control pipeline flow section quantization. The calculation method of the adaptive integral is as follows:
[0039] in, and Let A and B represent the x-coordinates of the two vertices A and B at the gas-liquid interface of the water conservancy and flood control pipeline, respectively, on the x-axis. This describes the function representing the gas-liquid interface of a hydraulic flood control pipeline in a Cartesian coordinate system. The function describes the measurement of the sediment surface of a hydraulic flood control pipeline section below the gas-liquid interface in a Cartesian coordinate system. This represents the cross-sectional area of the fluid flow within the water conservancy flood control pipeline at time t. This indicates the correction region outside the integration region. and Indicate the polar angle between points A and B. Indicates the inner diameter of the water conservancy and flood control pipeline; The calculation method for the dynamic calibration function is as follows:
[0040] in, This represents the cross-sectional area after dynamic calibration. , , and Indicates the calibration coefficient. This indicates the frequency of water flow fluctuations.
[0041] Step S34: Based on the reduction of the regulation domain error in the quantification of the flow cross-section of the hydraulic flood control pipeline in Step S33, a method for velocity distribution and flow integral of the hydraulic flood control pipeline considering the fluctuation correction coefficient is proposed to realize the calculation of the measurement results of the fluid domain flow of the hydraulic flood control pipeline. The instantaneous flow function calculation method of the method for velocity distribution and flow integral of the hydraulic flood control pipeline considering the fluctuation correction coefficient is as follows:
[0042] in, This represents the maximum flow velocity at the center of the water conservancy flood control pipeline at time t. This represents the gravity correction factor that takes into account the effect of gravity on the bottom flow velocity. This indicates the angle between the axis of the water conservancy and flood control pipeline and the horizontal plane. This represents the fluctuation correction coefficient that takes into account the impact of interface fluctuations on velocity. , This represents the interface smoothness index. Represents the velocity distribution function. Represents the instantaneous flow function. Indicates the frequency of water flow fluctuations. and These represent the horizontal and vertical coordinates of the center point O of the water conservancy flood control pipeline, respectively. and These represent the coordinate differences of the calculation point relative to the center of the pipe in the horizontal and vertical directions, respectively. This indicates that the integration region is limited to the effective flow cross-section region. , This indicates the inner diameter of the water conservancy and flood control pipeline.
[0043] The effective flow area of the instantaneous flow function calculation method is obtained by subtracting the cross-sectional area occupied by silt from the nominal cross-sectional area of the water conservancy flood control pipeline; The velocity distribution function of the instantaneous flow function calculation method is obtained by spatial interpolation and weighted calculation using cross-sectional velocity profiles, local velocity data, and image flow characteristics collected by the measuring equipment.
[0044] Example 2: like Figure 1 As shown, a method for measuring the flow rate of a water conservancy flood control pipeline based on image recognition and multi-source sensing includes the following steps: Step S1: After the measuring equipment enters the water conservancy and flood control pipeline, the claw-type elastic centering mechanism scans the inner diameter of the water conservancy and flood control pipeline through the infrared ranging sensor, calculates the inner diameter data of the water conservancy and flood control pipeline through the development board, and controls the claw-type elastic centering mechanism to unfold so that the measuring equipment is centered on the axis of the water conservancy and flood control pipeline. Step S2: Based on the flow field pressure data fed back by the differential pressure sensor, the development board dynamically adjusts the extension length and pitch angle of the electric hinge to keep the hovering wing body in a low-disturbance flow field region. This technology is based on the existing system adjustment on the development board. Step S3: The development board synchronously collects the flow velocity data collected by the belly radar, the sediment thickness and local flow velocity data collected by the detection module, the cross-sectional image of the hydraulic flood control pipeline at the gas-liquid interface collected by the camera, and the flow field pressure data collected by the differential pressure sensor. Step S4: Based on image recognition and multi-source sensing, the method for measuring the flow of water conservancy and flood control pipelines corrects the effective flow area of the water conservancy and flood control pipeline according to the siltation thickness, integrates multi-source flow velocity data and image flow characteristics obtained through cameras, calculates the cross-sectional weighted average flow velocity, and calculates the real-time flow in the water conservancy and flood control pipeline based on the product of the effective flow area and the weighted average flow velocity. Step S5: If the measuring equipment detects a sudden change in flow field pressure, the pitch angle of the floating wing body is dynamically adjusted; if the camera detects that the turbidity of the water in the water conservancy flood control pipe exceeds the standard, the cleaning program is started, the gimbal rotates, and the arc-shaped anti-impact cover and cleaning brush rotate to remove the silt; the processed real-time flow data is uploaded to the ground terminal and stored locally through the wireless transmission module.
[0045] In step S4, the method for measuring the flow rate of water conservancy flood control pipelines based on image recognition and multi-source sensing includes the following steps: Step S41: By introducing a water flow grayscale threshold and a background region pixel threshold, a dual-domain perception dynamic enhancement submodule is constructed for the water flow grayscale threshold and background region pixel threshold of the gas-liquid interface of the water conservancy and flood control pipeline, so as to prevent overexposure of the background of the water conservancy and flood control pipeline cross-section image; in order to enhance the features of the gas-liquid interface of the water conservancy and flood control pipeline cross-section image in the underground dark environment, a multi-scale attention residual fusion submodule is established by integrating spatial channel adaptive attention weights and asymmetric convolution kernels; the visual domain feature enhancement of the water conservancy and flood control pipeline cross-section image is achieved by the dual-domain perception dynamic enhancement submodule and the multi-scale attention residual fusion submodule. Step S42: Based on the visual domain feature enhancement of the cross-sectional image of the water conservancy and flood control pipeline in Step S41, an improved progressive feature pyramid network loss function is constructed using a dual-constraint loss function of spatial boundary integrity and temporal continuity. Simultaneously, a flow direction perception feature alignment submodule based on depthwise convolution and deformable convolution is established. Flow direction perception features refer to visual features extracted from continuous image frames that characterize the direction and dynamic pattern of water flow within the pipeline. The alignment aims to ensure that the segmented gas-liquid interface contour can continuously and accurately follow the water flow, thereby solving the segmentation breakage problem in dynamic scenes and improving the accuracy and robustness of the entire flow measurement system. The improved progressive feature pyramid network loss function and the flow direction perception feature alignment submodule jointly achieve visual domain target segmentation of the cross-sectional image of the water conservancy and flood control pipeline. Step S43: Based on the visual domain target segmentation of the water conservancy flood control pipeline cross-section image in step S42, a fitting method based on confidence time dual-constraint B-spline and water conservancy flood control pipeline siltation scanning curve is constructed. At the same time, adaptive integral and dynamic calibration function are combined to reduce the adjustment domain error of the water conservancy flood control pipeline cross-section quantization. Step S44: Based on the reduction of the adjustment domain error of the quantification of the flow cross section of the water conservancy flood control pipeline in step S43, a method for velocity distribution and flow integral of the water conservancy flood control pipeline considering the fluctuation correction coefficient is proposed to realize the calculation of the measurement results of the flow of the fluid domain of the water conservancy flood control pipeline.
[0046] In step S41, the constructed dual-domain perceptual dynamic enhancement submodule includes a grayscale texture dual-domain feature localization function. and two-parameter dynamic enhancement function Among them, the grayscale texture dual-domain feature localization function optimizes the grayscale threshold. and texture threshold To define the region of interest and solve for the optimal grayscale threshold and optimal texture threshold The following two objective functions are optimized simultaneously, and the calculation method is as follows:
[0047] in, and Let represent the parameters that minimize and maximize the objective function, respectively. Indicates the grayscale threshold. Indicates the texture threshold. and These represent values based on the current threshold. , The pixel ratio of the divided background area and water flow area and These represent the grayscale variances of the background area and the water flow area, respectively. and Image pixels representing texture and background regions. Represents the local binary pattern operator; Based on the obtained optimal threshold and Define region of interest :
[0048] Two-parameter dynamic enhancement function Based on region Perform adaptive enhancement:
[0049] in, This represents the gray value of the image at point (x, y). , and These represent the average grayscale value of the target area, the average grayscale value of the water flow area, and the average grayscale value of the background area, respectively. and These represent the target contrast and the contrast of the water flow area, respectively. The multi-scale attention residual fusion submodule consists of a feature fusion function based on a feature weight adaptive allocation method. The implementation and calculation method are as follows:
[0050] in, This represents the output feature map of the traditional residual branch. This represents the scale index, or scale number, with a value ranging from 1 to 3. Indicates the first Attention weights at each scale This represents the spatial attention operator. Indicates the channel attention manipulator. Indicates the first Output feature maps of asymmetric convolution at various scales This represents the element-wise multiplication operator.
[0051] In step S42, the improved progressive feature pyramid network loss function combines the loss weights of temporal and spatial boundaries to establish an improved loss function that simultaneously emphasizes the integrity of spatial boundaries and temporal continuity. The calculation method is as follows:
[0052] in, and These represent the weights of the spatial boundary loss and the temporal continuity loss, respectively. , and These represent the cross-entropy loss, spatial boundary loss, and temporal continuity loss, respectively. Indicates the number of pixels at the segmentation boundary. This represents the Euclidean distance from the predicted interface pixel (x, y) to the actual interface. This represents the marker distance (x, y) of the actual interface pixel. Represents the gradient operator, This represents the classification probability of the pixel (x, y) predicted by the segmentation network. This represents the true label of the pixel (x, y). and These represent the gas-liquid interface functions in polar coordinates at times t and t-1, respectively. This represents the set of boundary pixels at the gas-liquid interface in a water conservancy and flood control pipeline. and Let L2 norm and L1 norm be represented respectively; The flow direction sensing feature alignment submodule dynamically adjusts the position of the adaptive convolution kernel using a deformable convolution operator, and uses the interface shape feature alignment function of the hydraulic flood control pipeline to achieve accurate segmentation of the gas-liquid interface of the hydraulic flood control pipeline. The calculation method is as follows:
[0053] in, Represents a depthwise convolution operator. This represents the deformable convolution operator. The image feature map represents the input. This represents the offset of the deformable convolution. This represents the alignment function for the interface shape characteristics of water conservancy and flood control pipelines.
[0054] In step S43, the adaptive integral is calculated as follows:
[0055] in, and Let A and B represent the x-coordinates of the two vertices A and B at the gas-liquid interface of the water conservancy and flood control pipeline, respectively, on the x-axis. This describes the function representing the gas-liquid interface of a hydraulic flood control pipeline in a Cartesian coordinate system. The function describes the measurement of the sediment surface of a hydraulic flood control pipeline section below the gas-liquid interface in a Cartesian coordinate system. This represents the cross-sectional area of the fluid flow within the water conservancy flood control pipeline at time t. This indicates the correction region outside the integration region. and Indicate the polar angle between points A and B. Indicates the inner diameter of the water conservancy and flood control pipeline; The calculation method for the dynamic calibration function is as follows:
[0056] in, This represents the cross-sectional area after dynamic calibration. , , and Indicates the calibration coefficient. This indicates the frequency of water flow fluctuations.
[0057] In step S44, the instantaneous flow function calculation method for the velocity distribution and flow integral method of the hydraulic flood control pipeline, considering the fluctuation correction coefficient, is as follows:
[0058] in, This represents the maximum flow velocity at the center of the water conservancy flood control pipeline at time t. This represents the gravity correction factor that takes into account the effect of gravity on the bottom flow velocity. This indicates the angle between the axis of the water conservancy and flood control pipeline and the horizontal plane. This represents the fluctuation correction coefficient that takes into account the impact of interface fluctuations on velocity. , This represents the interface smoothness index. Represents the velocity distribution function. Represents the instantaneous flow function. Indicates the frequency of water flow fluctuations. and These represent the horizontal and vertical coordinates of the center point O of the water conservancy flood control pipeline, respectively. and These represent the coordinate differences of the calculation point relative to the center of the pipe in the horizontal and vertical directions, respectively. This indicates that the integration region is limited to the effective flow cross-section region. , This indicates the inner diameter of the water conservancy and flood control pipeline.
[0059] The effective flow area of the instantaneous flow function calculation method is obtained by subtracting the cross-sectional area occupied by silt from the nominal cross-sectional area of the water conservancy flood control pipeline; The velocity distribution function of the instantaneous flow function calculation method is obtained by spatial interpolation and weighted calculation using cross-sectional velocity profiles, local velocity data, and image flow characteristics collected by the measuring equipment.
Claims
1. A method for measuring flow in water conservancy flood control pipelines based on image recognition and multi-source sensing, characterized in that, Includes the following steps: Step S1: Center the measuring equipment on the pipe axis based on the pipe inner diameter data; Step S2: Collect flow velocity data, siltation thickness and local flow velocity data, cross-sectional images of the hydraulic flood control pipeline at the gas-liquid interface, and flow field pressure data. Step S3: Based on image recognition and multi-source sensing, the method for measuring the flow of water conservancy and flood control pipelines corrects the effective flow area of the water conservancy and flood control pipeline according to the siltation thickness, integrates multi-source flow velocity data and image flow characteristics, calculates the cross-sectional weighted average flow velocity, and calculates the real-time flow in the water conservancy and flood control pipeline based on the product of the effective flow area and the weighted average flow velocity.
2. The method for measuring the flow rate of a water conservancy flood control pipeline based on image recognition and multi-source sensing as described in claim 1, characterized in that: In step S3, the water conservancy flood control pipeline flow measurement method based on image recognition and multi-source sensing includes the following steps: Step S31: By introducing a water flow grayscale threshold and a background region pixel threshold, a dual-domain perception dynamic enhancement submodule is constructed for the water flow grayscale threshold and background region pixel threshold of the gas-liquid interface of the water conservancy and flood control pipeline, so as to prevent overexposure of the background of the water conservancy and flood control pipeline cross-section image; in order to enhance the features of the gas-liquid interface of the water conservancy and flood control pipeline cross-section image in the underground dark environment, a multi-scale attention residual fusion submodule is established by integrating spatial channel adaptive attention weights and asymmetric convolution kernels; the visual domain feature enhancement of the water conservancy and flood control pipeline cross-section image is achieved by the dual-domain perception dynamic enhancement submodule and the multi-scale attention residual fusion submodule. Step S32: Based on the visual domain feature enhancement of the cross-sectional image of the water conservancy and flood control pipeline in Step S31, an improved progressive feature pyramid network loss function is constructed using a dual-constraint loss function of spatial boundary integrity and temporal continuity. At the same time, a flow direction-aware feature alignment submodule based on depthwise convolution and deformable convolution is established. The improved progressive feature pyramid network loss function and the flow direction-aware feature alignment submodule are used together to achieve visual domain target segmentation of the cross-sectional image of the water conservancy and flood control pipeline. Step S33: Based on the visual domain target segmentation of the water conservancy flood control pipeline cross-section image in step S32, a fitting method based on confidence time dual-constraint B-spline and water conservancy flood control pipeline siltation scanning curve is constructed. At the same time, adaptive integral and dynamic calibration function are combined to reduce the adjustment domain error of the water conservancy flood control pipeline cross-section quantization. Step S34: Based on the reduction of the adjustment domain error of the quantification of the flow cross section of the water conservancy flood control pipeline in step S33, a method for velocity distribution and flow integral of the water conservancy flood control pipeline considering the fluctuation correction coefficient is proposed to realize the calculation of the measurement results of the flow of the fluid domain of the water conservancy flood control pipeline.
3. The method for measuring the flow rate of a water conservancy flood control pipeline based on image recognition and multi-source sensing as described in claim 2, characterized in that: In step S31, the constructed dual-domain perception dynamic enhancement submodule includes a grayscale texture dual-domain feature localization function. and two-parameter dynamic enhancement function Among them, the grayscale texture dual-domain feature localization function optimizes the grayscale threshold. and texture threshold To define the region of interest and solve for the optimal grayscale threshold and optimal texture threshold The following two objective functions are optimized simultaneously, and the calculation method is as follows: in, and Let represent the parameters that minimize and maximize the objective function, respectively. Indicates the grayscale threshold. Indicates the texture threshold. and These represent values based on the current threshold. , The pixel ratio of the divided background area and water flow area and These represent the grayscale variances of the background area and the water flow area, respectively. and Image pixels representing texture and background regions. Represents the local binary pattern operator; Based on the obtained optimal threshold and Define region of interest : Two-parameter dynamic enhancement function Based on region Perform adaptive enhancement: in, This represents the gray value of the image at point (x, y). , and These represent the average grayscale value of the target area, the average grayscale value of the water flow area, and the average grayscale value of the background area, respectively. and These represent the target contrast and the contrast of the water flow area, respectively. The multi-scale attention residual fusion submodule consists of a feature fusion function based on a feature weight adaptive allocation method. The implementation and calculation method are as follows: in, This represents the output feature map of the traditional residual branch. This represents the scale index, or scale number, with a value ranging from 1 to 3. Indicates the first Attention weights at each scale This represents the spatial attention operator. Indicates the channel attention manipulator. Indicates the first Output feature maps of asymmetric convolution at various scales This represents the element-wise multiplication operator.
4. The method for measuring the flow rate of a water conservancy flood control pipeline based on image recognition and multi-source sensing as described in claim 2, characterized in that: In step S32, the improved progressive feature pyramid network loss function combines the loss weights of temporal and spatial boundaries to establish an improved loss function that simultaneously emphasizes the integrity of spatial boundaries and temporal continuity. The calculation method is as follows: in, and These represent the weights of the spatial boundary loss and the temporal continuity loss, respectively. , and These represent the cross-entropy loss, spatial boundary loss, and temporal continuity loss, respectively. Indicates the number of pixels at the segmentation boundary. This represents the Euclidean distance from the predicted interface pixel (x, y) to the actual interface. This represents the marker distance (x, y) of the actual interface pixel. Represents the gradient operator, This represents the classification probability of the pixel (x, y) predicted by the segmentation network. This represents the true label of the pixel (x, y). and These represent the gas-liquid interface functions in polar coordinates at times t and t-1, respectively. This represents the set of boundary pixels at the gas-liquid interface in a water conservancy and flood control pipeline. and Let L2 norm and L1 norm be represented respectively; The flow direction sensing feature alignment submodule dynamically adjusts the position of the adaptive convolution kernel using a deformable convolution operator, and uses the interface shape feature alignment function of the hydraulic flood control pipeline to achieve accurate segmentation of the gas-liquid interface of the hydraulic flood control pipeline. The calculation method is as follows: in, Represents a depthwise convolution operator. This represents the deformable convolution operator. The image feature map represents the input. This represents the offset of the deformable convolution. This represents the alignment function for the interface shape characteristics of water conservancy and flood control pipelines.
5. The method for measuring the flow rate of a water conservancy flood control pipeline based on image recognition and multi-source sensing as described in claim 2, characterized in that: In step S33, the adaptive integral is calculated as follows: in, and Let A and B represent the x-coordinates of the two vertices A and B at the gas-liquid interface of the water conservancy and flood control pipeline, respectively, on the x-axis. This describes the function representing the gas-liquid interface of a hydraulic flood control pipeline in a Cartesian coordinate system. The function describes the measurement of the sediment surface of a hydraulic flood control pipeline section below the gas-liquid interface in a Cartesian coordinate system. This represents the cross-sectional area of the fluid flow within the water conservancy flood control pipeline at time t. This indicates the correction region outside the integration region. and Indicate the polar angle between points A and B. Indicates the inner diameter of the water conservancy and flood control pipeline; The calculation method for the dynamic calibration function is as follows: in, This represents the cross-sectional area after dynamic calibration. , , and Indicates the calibration coefficient. This indicates the frequency of water flow fluctuations.
6. The method for measuring the flow rate of a water conservancy flood control pipeline based on image recognition and multi-source sensing as described in claim 2, characterized in that: In step S34, the instantaneous flow function calculation method for the velocity distribution and flow integral method of the hydraulic flood control pipeline, considering the fluctuation correction coefficient, is as follows: in, This represents the maximum flow velocity at the center of the water conservancy flood control pipeline at time t. This represents the gravity correction factor that takes into account the effect of gravity on the bottom flow velocity. This indicates the angle between the axis of the water conservancy and flood control pipeline and the horizontal plane. This represents the fluctuation correction coefficient that takes into account the impact of interface fluctuations on velocity. , This represents the interface smoothness index. Represents the velocity distribution function. Represents the instantaneous flow function. Indicates the frequency of water flow fluctuations. and These represent the horizontal and vertical coordinates of the center point O of the water conservancy flood control pipeline, respectively. and These represent the coordinate differences of the calculation point relative to the center of the pipe in the horizontal and vertical directions, respectively. This indicates that the integration region is limited to the effective flow cross-section region. , This indicates the inner diameter of the water conservancy and flood control pipeline.
7. The method for measuring the flow rate of a water conservancy flood control pipeline based on image recognition and multi-source sensing as described in claim 6, characterized in that: The effective flow area of the instantaneous flow function calculation method is obtained by subtracting the cross-sectional area occupied by silt from the nominal cross-sectional area of the water conservancy flood control pipeline; The velocity distribution function of the instantaneous flow function calculation method is obtained by spatial interpolation and weighted calculation using cross-sectional velocity profiles, local velocity data, and image flow characteristics collected by the measuring equipment.
8. A method for measuring the flow rate of a water conservancy flood control pipeline based on image recognition and multi-source sensing as described in any one of claims 1-7, characterized in that: If a sudden change in the flow field pressure data is detected in step S2, the attitude of the measuring equipment is adjusted until the flow field pressure data stabilizes.
9. A method for measuring the flow rate of a water conservancy flood control pipeline based on image recognition and multi-source sensing as described in any one of claims 1-7, characterized in that: If the turbidity of the water is detected to be greater than the preset value in step S2, the dredging program is started to clean the silt at the bottom of the pipe.
Citation Information
Patent Citations
Intelligent measuring method for flow of drainage pipeline
CN116824467A
Drainage pipeline flow intelligent measurement method based on accelerated guide region convolutional neural network and parallel multi-scale unified network
CN117274355A
Long-distance water conveying pipeline flow monitoring method fused with terrain dynamic compensation
CN120846605A
Method of surveying bottom topography of water area and apparatus therefor
RU2519269C1
Method, system, medium, equipment and terminal for inland vessel identification and depth estimation for smart maritime
US20240013505A1