Intelligent perception data processing method based on electronic water gauge

By using multi-source data fusion and intelligent identification of obstructions, the measurement error problem of electronic water gauges under the influence of obstructions was solved, enabling accurate water level monitoring in complex environments and improving the robustness and adaptability of the system.

CN121051350BActive Publication Date: 2026-05-08MEIZHOU HYDROLOGY BRANCH OF GUANGDONG PROVINCIAL HYDROLOGY BUREAU
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
MEIZHOU HYDROLOGY BRANCH OF GUANGDONG PROVINCIAL HYDROLOGY BUREAU
Filing Date
2025-07-21
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Electronic water level gauges are susceptible to measurement errors and uncertainties due to obstructions on the water surface or underwater, affecting the accuracy and reliability of water level monitoring, and potentially causing misjudgments, especially in flood warning systems.

Method used

A multi-source data fusion mechanism is adopted, integrating visible light images, infrared thermal imaging, ultrasonic ranging, and pressure-based water level values. Sensor weights are dynamically adjusted through a Kalman filter, and semantic segmentation is performed using a U-Net model to identify the type and area of ​​obstructions. Combined with the Kalman filter, an accurate water level estimate is output.

Benefits of technology

Even when some sensors fail or data is abnormal, it can still output accurate and reliable water level estimates, improving the robustness and continuity of water level monitoring and enhancing the system's adaptability to complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121051350B_ABST
    Figure CN121051350B_ABST
Patent Text Reader

Abstract

The application discloses an intelligent perception data processing method based on an electronic water gauge, belongs to the water level sensor field, obtains visible light images, infrared thermal imaging, ultrasonic ranging and pressure type water level values to form multi-source data; based on the obtained multi-source data, a Kalman filter is constructed and a water level state vector is defined, the weight factor and the noise covariance matrix of each sensor are dynamically adjusted according to the real-time confidence, and after fusion calculation, the preliminary water level estimation value and the corresponding confidence index are output; the obtained multi-source data is fused into four-channel input data, input into a pre-trained U-Net model for semantic segmentation, a water surface shelter segmentation mask is generated, the shelter type is identified based on the mask and the shelter area proportion is calculated; the generated shelter segmentation mask is used to extract the water level line edge point set of the unsheltered area from the original image, a continuous water level line is reconstructed through linear fitting, and the sheltered area is interpolated and filled.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water level sensors, and more specifically, to an intelligent sensing data processing method based on an electronic water level gauge. Background Technology

[0002] Electronic water level gauges, as advanced measuring devices, rely on sensor technology to accurately detect changes in water level and convert these changes into electrical signals, thus enabling digital measurement and intuitive display of water levels. This technology not only endows electronic water level gauges with high-precision measurement capabilities but also provides advantages such as fast response speed and easy integration into automated monitoring systems. Therefore, electronic water level gauges are widely used in water level monitoring of various water bodies, including rivers, lakes, reservoirs, and canals, providing crucial data support for water resource management, flood control, and disaster reduction.

[0003] In practical use, when the surface of an electronic water level gauge is partially covered by natural objects such as leaves and weeds, or by floating objects such as plastic bags, these obstructions severely hinder the normal contact between the sensor and the water. The water level sensing component of the electronic water level gauge relies on direct contact with the water. When this contact is blocked by obstructions, the sensing component cannot accurately detect changes in water level, leading to measurement errors. These errors may manifest as measured values ​​that are higher or lower than the actual water level, depending on the location and extent of the obstruction.

[0004] Covering materials are rarely stationary; floating debris such as leaves, weeds, and plastic bags can move with the wind or currents, causing fluctuations in water level readings measured by sensors at different times. This fluctuation increases the uncertainty of the measurement data and can mislead subsequent data analysis and decision-making. For example, in flood warning systems, misjudging the rising water level trend due to measurement fluctuations caused by covering materials could trigger unnecessary panic and waste of resources.

[0005] Besides surface obstructions, electronic water level gauges also face the problem of underwater weeds becoming entangled. When entangled, these weeds can alter the surrounding water flow, creating eddies or turbulence, which can affect the accuracy of the water level sensing components. Weeds can also exert physical pressure on the gauge itself, causing the measuring section to deviate from its normal position. This deviation not only causes measurement errors but can also worsen with continued entanglement, eventually leading to surface wear or internal structural damage. Once damaged, the gauge's measurement accuracy and lifespan will be severely affected, potentially even causing complete failure. Summary of the Invention

[0006] To address the problems existing in the prior art, the present invention aims to provide an intelligent sensing data processing method based on electronic water level gauges. This method integrates data from multiple sensors, including visible light images, infrared thermal imaging, ultrasonic ranging, and pressure-based water level values, to construct a multi-source data fusion mechanism. By dynamically adjusting the weights of each sensor through a Kalman filter, it achieves data cross-calibration and anomaly tolerance. Even when some sensors fail or data is abnormal, it can still output accurate and reliable water level estimates, significantly improving the robustness of water level monitoring.

[0007] To solve the above problems, the present invention adopts the following technical solution.

[0008] Firstly, a method for intelligent sensing data processing based on electronic water level gauges includes:

[0009] Step S1: Acquire visible light images, infrared thermal imaging, ultrasonic ranging, and pressure-based water level values ​​to form multi-source data;

[0010] Step S2: Based on the multi-source data from step S1, construct a Kalman filter and define a water level state vector. Dynamically adjust the weighting factor and noise covariance matrix of each sensor according to the real-time confidence level. After fusion calculation, output the preliminary water level estimate and the corresponding confidence index.

[0011] Step S3: Fuse the multi-source data from step S1 into four-channel input data, input it into the pre-trained U-Net model for semantic segmentation, generate a water surface obstruction segmentation mask, identify the obstruction type based on the mask and calculate the obstruction area ratio.

[0012] Step S4: Using the occlusion segmentation mask generated in step S3, extract the water level edge point set of the unoccluded area from the original image, reconstruct the continuous water level line through linear fitting, interpolate and fill the occluded area, and evaluate the credibility value of the visual water level measurement result in combination with the identified occlusion type.

[0013] Step S5: Based on the occlusion segmentation mask and area ratio obtained in Step S3, dynamically adjust the fusion strategy weights, combine the preliminary water level estimate and its confidence index output in Step S2, and the visual water level confidence assessment value evaluated in Step S4, perform weighted fusion calculation, and output the final water level estimate.

[0014] Step S6: Based on the data quality score in step S5 and the occlusion area ratio in step S3, compare the measured data of the backup mechanical water gauge with the current water level estimate and update the sensor calibration coefficient; conduct graded early warnings based on the degree of occlusion and data quality deviation, and store typical occlusion scenario data.

[0015] Further, in step S2, based on the multi-source data from step S1, a Kalman filter is constructed and a water level state vector is defined. The weighting factors and noise covariance matrix of each sensor are dynamically adjusted according to their real-time reliability. After fusion calculation, a preliminary water level estimate and corresponding confidence index are output, including:

[0016] Step S2.1: Define a state vector, which consists of water level height and water level change rate, and is used to comprehensively describe the state of the water level system.

[0017] Step S2.2: Based on the state vector defined in step S2.1, construct a Kalman filter prediction model. The Kalman filter prediction model is based on a state-space model and consists of a state transition equation and an observation equation. The state transition equation describes how the system state changes over time, and the observation equation describes the relationship between the system state and the sensor observations.

[0018] Step S2.3: Perform Kalman filtering iteration based on the prediction model constructed in step S2.2, including a prediction step and a correction step. The prediction step calculates the prior state estimate at the current time based on the state estimate and state transition equation of the previous time step, and calculates the prior estimate covariance. The correction step uses the weighted fusion principle to weight the residuals using the weight factors of each sensor, calculates the Kalman gain, and uses the Kalman gain to correct the prior state estimate to obtain the posterior state estimate.

[0019] Step S2.4: Based on the Kalman filter iteration results of step S2.3, update the state estimate, including updating the posterior estimate covariance. The covariance reflects the uncertainty of the corrected state estimate and is used for the iteration calculation at the next time step.

[0020] Step S2.5: Based on the updated state estimate in step S2.4, output the fused water level estimate, which is a water level height estimate that takes into account the measurement information of multiple sensors and has been processed by noise reduction.

[0021] Further, in step S2.2, based on the state vector defined in step S2.1, a Kalman filter prediction model is constructed. This model is based on a state-space model and consists of state transition equations and observation equations, including:

[0022] Step S2.21: Calculate the historical reliability weight factor for each sensor involved in the observation equation in step S2.2. The historical reliability of the sensor is determined by calculating the deviation between the measured value and the true value of the sensor over a period of time. Sensors with small and stable deviations are assigned the first weight factor, while sensors with large deviations and large fluctuations are assigned the second weight factor.

[0023] Step S2.22: Based on the weight factors calculated in step S2.21, update the observation noise covariance matrix. This matrix describes the statistical characteristics of the observation noise. The diagonal elements of the matrix are inversely proportional to the weight factors, so as to assign different weights according to the reliability of the sensors in the fusion calculation.

[0024] Further, step S3 involves fusing the multi-source data from step S1 into four-channel input data, inputting it into the pre-trained U-Net model for semantic segmentation, generating a water surface obstruction segmentation mask, identifying the obstruction type based on the mask, and calculating the obstruction area ratio, including:

[0025] Step S3.1: Fuse the RGB image and the infrared grayscale image in the four-channel input data to obtain the image input data. The RGB image provides the color and texture information of the object, while the infrared grayscale image reflects the temperature distribution of the object.

[0026] Step S3.2: Input the image input data from step S3.1 into the U-Net model for processing. The U-Net model consists of a shrinking path and an expanding path. The shrinking path is used to extract deep features of the image, and the expanding path is used to restore the spatial dimension of the feature map and stitch together the features in the shrinking path. Finally, the output is an occlusion probability map of the same size as the input image.

[0027] Step S3.3: Process the occlusion probability map output in step S3.2 according to the preset threshold to generate a binary mask to divide the occluded area and the unoccluded area.

[0028] Step S3.4: Extract color and texture features from the occluded areas segmented in step S3.3;

[0029] Step S3.5: Input the features extracted in step S3.4 into a lightweight classifier for classification to determine the type of occlusion. The lightweight classifier is an ensemble learning method based on decision trees, which consists of multiple decision trees. The final classification result is obtained by voting on the prediction results of multiple decision trees.

[0030] Step S3.6: Count the number of pixels marked as occluders in the binary mask generated in step S3.3, and calculate the proportion of the occluded area in the total image area as a quantitative basis for assessing the severity of occlusion.

[0031] Further, in step S4, using the occlusion segmentation mask generated in step S3, the water level edge point set of the unoccluded area is extracted from the original image. A continuous water level line is reconstructed through linear fitting. The occluded area is then filled using interpolation. The reliability of the visual water level measurement result is evaluated based on the identified occlusion type, including:

[0032] Step S4.1: Using a segmentation mask M, where pixels with a value of 0 represent unobstructed areas and pixels with a value of 1 represent obstructed areas, the unobstructed water level edge points are extracted by performing calculations on the mask M and the water level image, forming a point set P to obtain reliable water level information.

[0033] Step S4.2: Take the point set P from step S4.1 as input, use the RANSAC algorithm for linear fitting, select a small number of points by random sampling to fit the straight line, calculate the distance from other points to the straight line, determine the inliers according to the preset threshold, and select the straight line with the most inliers as the final fitting result through multiple iterations to obtain an accurate water level line equation that describes the actual position trend of the water level.

[0034] Step S4.3: Obtain the occlusion area ratio S calculated in step S3.6. When S is less than the preset value, based on the water level equation fitted in step S4.2, use bilinear interpolation to fill the pixel values ​​of the occlusion area. Fill the occlusion area by calculating the weighted average of known pixels around the occlusion area, so as to smoothly fill the occlusion area while preserving the trend of the fitted water level line.

[0035] Step S4.4: When the occlusion area ratio S in step S4.3 is greater than or equal to the preset value, the area is marked as "severely occluded" and visual data is disabled.

[0036] Further, in step S5, the fusion strategy weights are dynamically adjusted based on the occlusion segmentation mask and area ratio obtained in step S3. Combined with the preliminary water level estimate and its confidence index output in step S2, and the visual water level confidence assessment value evaluated in step S4, a weighted fusion calculation is performed to output the final water level estimate, including:

[0037] Step S5.1: When there are floating objects obstructing the water surface and the proportion of obstructed area S calculated in step S3.6 is less than the preset proportion value, the weights of the pressure level gauge, ultrasonic sensor and visual data in the final water level estimate are dynamically adjusted according to S, and the data are fused to obtain the final water level estimate.

[0038] Step S5.2: When the proportion of the area obstructed by floating objects on the water surface calculated in step S3.6 is greater than or equal to the preset proportion value, the data of the pressure level gauge is directly used as the final water level estimate.

[0039] Step S5.3: When it is determined that underwater weeds are entangled and affecting the water level monitoring, the infrared temperature gradient and ultrasonic echo complexity are combined to determine whether the weeds affect the pressure level gauge.

[0040] Step S5.4: If step S5.3 determines that weeds affect the pressure level gauge, then based on the visual data confidence assessment value evaluated in step S4, dynamically adjust the weights of visual data and ultrasonic data in the final water level estimate, and fuse these data to obtain the final water level estimate in order to correct the error caused by underwater weed entanglement.

[0041] Further, in step S5.4, if step S5.3 determines that weeds affect the pressure level gauge, then based on the visual data reliability assessment value evaluated in step S4, the weights of visual data and ultrasonic data in the final water level estimate are dynamically adjusted, and these data are fused to obtain the final water level estimate, in order to correct the error caused by underwater weed entanglement, including:

[0042] Step S5.41: Select a time series database to store water level data, and store the final water level data output in step S5.4 into the database;

[0043] Step S5.42: Based on the water level data stored in the database in step S5.41, use a plotting tool to draw a real-time water level curve to show the dynamic changes of the water level over time, and attach a data quality indicator bar to reflect the reliability of the data; at the same time, based on the obstruction segmentation mask generated in step S3, generate an obstruction distribution heat map to show the distribution of obstructions in the monitoring area.

[0044] Further, in step S6, based on the data quality score from step S5 and the occlusion area ratio from step S3, the measured data from the backup mechanical water gauge is compared with the current water level estimate to update the sensor calibration coefficients; graded warnings are issued based on the degree of occlusion and data quality deviation, and typical occlusion scenario data is stored, including:

[0045] Step S6.1: Based on the data quality score output in step S5 and the occlusion area ratio in step S3.6, determine whether to trigger automatic calibration. When the data quality score is lower than the preset score within the preset time, start the backup mechanical water gauge to obtain the reference water level and calculate the calibration coefficient to update the water level value.

[0046] Step S6.2: Based on the occlusion area ratio in step S3.6, classify the early warning into levels:

[0047] If the percentage of the obstructed area is less than the first preset threshold, log the information.

[0048] If the percentage of the obstructed area is between the first preset threshold and the second preset threshold, a text message will be sent to remind the maintenance personnel.

[0049] If the proportion of the obstructed area is greater than the second preset threshold, an audible and visual alarm will be triggered and a work order will be generated and pushed to the maintenance APP.

[0050] Step S6.3: Store the image, sensor data and processing results of the current occluded scene into the sample library, and automatically acquire new data weekly based on the sample library to update the U-Net model and Kalman filter parameters, so as to improve the accuracy of occlusion detection and segmentation and the precision of multi-sensor data fusion.

[0051] Furthermore, in step S6.2, based on the occlusion area ratio from step S3.6, the warning is classified into levels, including:

[0052] Step S6.21: Sort the graded warning information in step S6.2 according to severity and display it in a scrolling list on the visualization interface;

[0053] Step S6.22: Provide a historical query function, allowing users to specify time range and occlusion type identified in step S3.5 to filter data, and display the original image and processing process of the filtered data, including intermediate results and processing parameters from multi-sensor data acquisition to final decision.

[0054] In a second aspect, a computing device includes:

[0055] One or more processors;

[0056] A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to implement the method.

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

[0058] (1) This scheme integrates multiple sensor data such as visible light images, infrared thermal imaging, ultrasonic ranging and pressure water level values ​​to build a multi-source data fusion mechanism. By dynamically adjusting the weights of each sensor through a Kalman filter, data mutual calibration and fault tolerance are achieved. Even when some sensors fail or data is abnormal, accurate and reliable water level estimates can still be output, which greatly improves the robustness of water level monitoring.

[0059] (2) This scheme introduces the U-Net model for semantic segmentation, automatically identifies the types of obstructions on the water surface and calculates the proportion of the obstructed area. It can intelligently distinguish the impact of different obstructions such as leaves, weeds, and plastic bags on water level measurement and take corresponding processing strategies to ensure the continuity and accuracy of water level monitoring. This intelligent identification and processing mechanism significantly enhances the system's adaptability to complex environments. Attached Figure Description

[0060] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0061] Figure 1 This is a schematic diagram of the processing method for intelligent sensing data based on electronic water level gauges according to the present invention. Detailed Implementation

[0062] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0063] Please see Figure 1 A smart sensing data processing method based on electronic water level gauges, comprising:

[0064] Step S1: Acquire visible light images, infrared thermal imaging, ultrasonic ranging, and pressure-based water level values ​​to form multi-source data.

[0065] In this embodiment, corresponding sensors, such as cameras, infrared thermal imagers, ultrasonic ranging modules, and underwater pressure sensors, are installed in advance at the corresponding positions of the water gauge. High-definition cameras are usually installed in electronic water gauge monitoring terminals. They rely on natural light or auxiliary lighting during the day and turn on low-power supplementary lighting at night. The camera captures visible light reflection signals of the water surface and surrounding scene through an optical lens. After converting the light signals into electrical signals, it generates pixelated image data for qualitative description of the water surface state: for example, identifying whether there are floating objects on the water surface, such as garbage, aquatic plants, and the intensity of water surface ripples. However, the accuracy of the camera is easily affected by the weather. Heavy rain and fog will cause the image to be blurred, and it cannot effectively image at night without supplementary lighting.

[0066] Infrared thermal imagers work by capturing the infrared radiation emitted by objects themselves, without relying on external light sources. Temperatures differ between the water surface and its surrounding environment, such as banks and air. For example, water has a high specific heat capacity, resulting in more gradual temperature changes. Infrared thermal imagers use infrared detectors to sense the intensity of thermal radiation corresponding to these temperature differences and convert it into grayscale or pseudo-color images. Different colors represent different temperatures. This data is adaptable to all weather conditions; even at night, in heavy rain, or in dense fog where visible light is ineffective, the water surface outline can still be clearly identified through temperature boundaries. Simultaneously, it can indirectly determine the water flow state, such as the slight temperature differences that can occur in areas where water flows converge.

[0067] The ultrasonic ranging module is installed at a fixed height above the water level gauge to calculate the water level through a "transmit-reflect-receive" sound wave signal. During operation, the ultrasonic transmitter emits high-frequency sound waves vertically towards the water surface. The sound waves are reflected upon reaching the surface and captured by the ultrasonic receiver. The module calculates the vertical distance from the sensor to the water surface using the formula "distance = (propagation time × speed of sound) / 2" based on the sound wave propagation time and speed of sound in air. This distance is then combined with the sensor's installation height (a preset fixed value) to finally convert it into a water level value: water level = installation height - distance from sensor to water surface. The advantages of this method are non-contact measurement, avoiding water corrosion of the sensor, and immunity to slight obstruction from floating debris. However, it should be noted that strong winds or drastic changes in air temperature may cause sound speed errors, requiring real-time calibration of the sound speed parameter using a temperature sensor.

[0068] Pressure-based water level monitoring relies on underwater pressure sensors, typically fixed to the bottom or underwater portion of a gauge. Its principle is based on the positive correlation between liquid pressure and depth, expressed as: Pressure = Liquid Density × Gravitational Acceleration × Depth. The sensor directly contacts the water, sensing the pressure exerted on it. After eliminating atmospheric pressure interference, only the water pressure signal is retained. This pressure signal is converted into an electrical signal, and the water level value is calculated using preset pressure and depth conversions. This requires prior calculation based on the water density. This method involves direct underwater measurement, unaffected by surface fluctuations or air conditions, making it particularly suitable for turbulent or wave-filled environments. Fluctuations are offset by the water pressure averaging effect. However, regular maintenance is necessary to prevent the sensor from being covered in silt.

[0069] The above four types of data, working together to form multi-source data, can "complement each other's strengths." Visible light and infrared thermal imaging cover weather scenarios under different lighting conditions from a "visual dimension," such as relying primarily on visible light during the day and infrared light at night or in severe weather, providing a qualitative reference for water surface conditions. Ultrasonic and pressure sensors output water level values ​​from a "quantitative dimension" through different measurement principles, reducing the impact of single sensor failures or errors. For example, if ultrasonic ranging deviates due to strong winds, it can be calibrated using pressure-based water level values; if pressure sensor readings are abnormal due to silt, the water surface contour identified by infrared thermal imaging can be used to assist in the judgment. The collaboration of multi-source data not only solves the problems of "poor environmental adaptability and weak anti-interference" of single monitoring methods, but also builds a highly reliable sensing system through "data cross-calibration, scene complementarity, and anomaly tolerance."

[0070] In some embodiments, step S2 involves constructing a Kalman filter and defining a water level state vector based on the multi-source data from step S1. The weighting factor and noise covariance matrix of each sensor are dynamically adjusted according to the real-time confidence level of each sensor. After fusion calculation, a preliminary water level estimate and the corresponding confidence index are output.

[0071] Step S2 further includes the following steps:

[0072] Step S2.1: Define a state vector, which consists of water level height and water level change rate, and is used to comprehensively describe the state of the water level system.

[0073] Step S2.2: Based on the state vector defined in step S2.1, construct a Kalman filter prediction model. The Kalman filter prediction model is based on a state-space model and consists of a state transition equation and an observation equation. The state transition equation describes how the system state changes over time, and the observation equation describes the relationship between the system state and the sensor observations.

[0074] Step S2.3: Perform Kalman filtering iteration based on the prediction model constructed in step S2.2, including a prediction step and a correction step. The prediction step calculates the prior state estimate at the current time based on the state estimate and state transition equation of the previous time step, and calculates the prior estimate covariance. The correction step uses the weighted fusion principle to weight the residuals using the weight factors of each sensor, calculates the Kalman gain, and uses the Kalman gain to correct the prior state estimate to obtain the posterior state estimate.

[0075] Step S2.4: Based on the Kalman filter iteration results of step S2.3, update the state estimate, including updating the posterior estimate covariance. The covariance reflects the uncertainty of the corrected state estimate and is used for the iteration calculation at the next time step.

[0076] Step S2.5: Based on the updated state estimate in step S2.4, output the fused water level estimate, which is a water level height estimate that takes into account the measurement information of multiple sensors and has been processed by noise reduction.

[0077] In this embodiment, the state vector contains two key pieces of information: water level height and water level change rate. Water level height reflects the actual height of the current water surface, while the water level change rate reflects the speed at which the water level rises or falls, indicating the trend of change. These two parameters together describe the "state" of the water level, including both the current value and the trend of change, providing a basis for prediction and correction.

[0078] The Kalman filter is a two-equation model based on state space:

[0079] State transition equations describe how the state of a system evolves naturally over time. For example, if the current water level is 10 meters and rises by 0.5 meters per hour, the equation will predict that the water level will become 10.5 meters at the next moment. This model relies on historical data and physical laws, such as the principle of water flow continuity.

[0080] Observation equations: Establish the relationship between system state and sensor measurements. For example, the water pressure value measured by the pressure sensor needs to be converted into water level height through a physical formula, while the ultrasonic ranging value directly corresponds to the water level height.

[0081] Regarding the iterative process:

[0082] Prediction steps: Using the optimal state estimate and state transition equation from the previous time step, calculate the prior state estimate for the current time step, which is the preliminary prediction based on the model. At the same time, calculate the prior estimate covariance, which represents the uncertainty of the prediction, such as the bias caused by model error.

[0083] Residual calculation: Compare the actual measured value of the sensor with the model prediction value. For example, if the ultrasonic ranging value is 10.2 meters and the model prediction value is 10.5 meters, the residual is -0.3 meters.

[0084] Regarding dynamic weighted fusion, weights are assigned based on the real-time confidence level of each sensor. For example, if the confidence level of an infrared thermal imager decreases due to fog interference, its weight will be reduced, while the pressure sensor will receive a higher weight due to its high stability.

[0085] Regarding the calculation of Kalman gain, a fusion coefficient is first generated by combining sensor weights and prediction uncertainty. This coefficient determines the proportion of contribution of the residual to the final correction. For example, when the gain is 0.7, 70% of the residual is used to correct the predicted value.

[0086] Posterior estimation update: The weighted residuals are added to the prior estimate through the gain coefficient to obtain the posterior state estimate. For example, the corrected water level is 10.5 + 0.7 × (-0.3) = 10.29 meters. This result is the optimal estimate at the current moment.

[0087] After correction, the posterior estimate covariance needs to be updated to quantify the uncertainty of this state estimation. For example, if the sensor data noise is large or the model error is significant, the covariance value will increase, reflecting a decrease in the reliability of the estimation result. This value directly affects the confidence weight allocation of the prediction step at the next time step.

[0088] The final output is a fused water level estimate, which is the water level height in the posterior estimate and its confidence index. For example, an output value of 10.29 meters with a confidence level of 90% indicates that the result integrates multi-sensor data and significantly reduces random noise, such as ultrasonic measurement fluctuations caused by wave swaying, and has high reliability. The confidence level is calculated as follows: Where σ is the standard deviation of the current water level measurement (unit: cm / cm), where σ 2 The variance, representing the water level height, directly quantifies the degree of uncertainty of the system regarding the results of this water level measurement; σ max 2The maximum allowable variance threshold of the system is represented by σ, which is the preset tolerance limit for water level monitoring accuracy. max This can be simply understood as the maximum allowable error; σ 2 The smaller the value, the higher the confidence level. 2 The larger the value, the lower the confidence level.

[0089] The weighting factors and noise covariance matrices of each sensor are adjusted in real time. For example, when a visible light camera fails due to nighttime conditions, its noise covariance is increased, indicating that the data is unreliable, and its weight is reduced accordingly. Conversely, the underwater pressure sensor is less affected by light, so its weight is increased. This mechanism ensures that the system remains robust when some sensors malfunction.

[0090] In a preferred embodiment of the present invention, step S2.2 includes the following:

[0091] Step S2.21: Calculate the historical reliability weight factor for each sensor involved in the observation equation in step S2.2. The historical reliability of the sensor is determined by calculating the deviation between the measured value and the true value of the sensor over a period of time. Sensors with small and stable deviations are assigned the first weight factor, while sensors with large deviations and large fluctuations are assigned the second weight factor.

[0092] Step S2.22: Based on the weight factors calculated in step S2.21, update the observation noise covariance matrix. This matrix describes the statistical characteristics of the observation noise. The diagonal elements of the matrix are inversely proportional to the weight factors, so as to assign different weights according to the reliability of the sensors in the fusion calculation.

[0093] In this embodiment, the measurement values ​​of each sensor over a period of time are continuously recorded and compared with independently verified real water level values, such as manually calibrated data. For example, in the past 100 measurements, the pressure sensor had a deviation of less than 0.5 cm in 98 of them, demonstrating high stability and low deviation. Due to nighttime light interference, the visible light camera had a measurement deviation of more than 2 cm in 50% of its measurements, demonstrating low stability and high deviation. For sensors with low deviation and stability, such as the aforementioned pressure sensor, a first weighting factor is assigned, indicating high weight, such as 0.9, representing highly reliable data. For sensors with high deviation or instability, such as the visible light camera, a second weighting factor is assigned, indicating low weight, such as 0.3, representing data that should be used with caution.

[0094] The specific evaluation criteria are as follows:

[0095] Small deviation: The average error between the measured value and the true value is lower than the set threshold, such as 1 cm;

[0096] High stability: The measured values ​​fluctuate within a small range, such as a standard deviation of <0.5 cm.

[0097] The diagonal elements of the observation noise covariance matrix represent the noise level of each sensor, and the values ​​of the diagonal elements are inversely proportional to the weighting factors. That is, a sensor with a high weight corresponds to the first weighting factor, and its noise covariance value is reduced, indicating that its measurement noise is low.

[0098] For sensors with low weights, the second weighting factor is increased, indicating high measurement noise. For example, a pressure sensor with a weight of 0.9 has a noise covariance of 0.01, a very small value, indicating high confidence; a visible light camera with a weight of 0.3 has a noise covariance of 0.5, a relatively large value, indicating low confidence.

[0099] During the calibration step, the Kalman gain is automatically adjusted based on the updated noise covariance matrix: sensors with low noise covariance (i.e., high weight) are assigned a larger gain, and their measurements have a stronger corrective effect on the final fusion result; sensors with high noise covariance (i.e., low weight) are assigned a smaller gain, and their measurements have a weaker impact on the fusion result.

[0100] If an infrared thermal imager encounters a sudden rainstorm that causes a jump in real-time data, its historical weight, which was originally 0.8, will be temporarily increased after the system detects the anomaly. For example, it will be increased from 0.1 to 0.8, so that it is marginalized in the current fusion and the overall estimate is not polluted.

[0101] In a preferred embodiment of the present invention, step S3 involves fusing the multi-source data from step S1 into four-channel input data, inputting it into a pre-trained U-Net model for semantic segmentation, generating a water surface obstruction segmentation mask, identifying the obstruction type based on the mask, and calculating the obstruction area ratio.

[0102] Step S3 further includes the following steps:

[0103] Step S3.1: Fuse the RGB image and the infrared grayscale image in the four-channel input data to obtain the image input data. The RGB image provides the color and texture information of the object, while the infrared grayscale image reflects the temperature distribution of the object.

[0104] Step S3.2: Input the image input data from step S3.1 into the U-Net model for processing. The U-Net model consists of a shrinking path and an expanding path. The shrinking path is used to extract deep features of the image, and the expanding path is used to restore the spatial dimension of the feature map and stitch together the features in the shrinking path. Finally, the output is an occlusion probability map of the same size as the input image.

[0105] Step S3.3: Process the occlusion probability map output in step S3.2 according to the preset threshold to generate a binary mask to divide the occluded area and the unoccluded area.

[0106] Step S3.4: Extract color and texture features from the occluded areas segmented in step S3.3;

[0107] Step S3.5: Input the features extracted in step S3.4 into a lightweight classifier for classification to determine the type of occlusion. The lightweight classifier is an ensemble learning method based on decision trees, which consists of multiple decision trees. The final classification result is obtained by voting on the prediction results of multiple decision trees.

[0108] Step S3.6: Count the number of pixels marked as occluders in the binary mask generated in step S3.3, and calculate the proportion of the occluded area in the total image area as a quantitative basis for assessing the severity of occlusion.

[0109] In this embodiment, the four-channel input includes three channels of RGB image and one channel of infrared grayscale image. The RGB channels provide the color of objects, such as color differences in water, and texture information, such as the surface structure of occluded objects, used to identify object categories under visible light, such as aquatic plants, garbage, and oil stains. The infrared channel reflects the temperature distribution of objects; for example, there is a significant temperature difference between plastic floating objects under sunlight and water, while temperature differences in shadow areas can help distinguish between real occluded objects and optical shadows. The infrared data is normalized to the same numerical range as RGB, and then concatenated along the channel dimension to form a four-channel tensor. This fusion preserves both spectral and thermodynamic features, enhancing the model's ability to discriminate occluded objects.

[0110] Regarding the U-Net model processing, local features are extracted through repeated 3×3 convolutional layers and downsampling through 2×2 max pooling layers, progressively compressing the spatial dimension and increasing the number of channels. For example, an input 572×572 image is downsampled four times to generate a high-dimensional feature map of 28×28×1024, capturing the abstract semantics of occluded objects, such as their global shape. Spatial resolution is progressively restored through 2×2 transposed convolutional upsampling. After each upsampling, the feature maps of the same layer's contracted path are cropped and concatenated through skip connections, fusing deep semantics with shallow details, such as the edge texture of occluded objects, to avoid information loss.

[0111] Finally, a probability map of occlusions with the same size as the input image is generated through 1×1 convolution, where each pixel value represents the probability of belonging to an occluded object. By stitching together shallow and deep features, the boundaries of occlusions are accurately located, solving the problem of missed detection of small targets, such as scattered floating objects. The input image is mirror-padded to 572×572, and a 388×388 probability map is output, ensuring the integrity of edge region segmentation.

[0112] Regarding the generation of binary masks:

[0113] Set a fixed threshold, such as 0.5, to convert the probability map into a binary mask:

[0114] Pixels with a probability ≥ 0.5: marked as occluded areas, with a value of 1;

[0115] Pixels with a probability < 0.5 are marked as unobstructed areas with a value of 0.

[0116] For mask optimization, morphological operations, such as opening, are used to remove small noise points and fill holes in the mask, improving the connectivity of the occluded area. Regarding feature extraction of occluded objects, the mean and standard deviation of the occluded area in the RGB channels are statistically analyzed; for example, green aquatic plants have a high G channel mean, while oil stains have low brightness. The contrast and entropy values ​​of the gray-level co-occurrence matrix are calculated to distinguish smooth surfaces, such as plastic film, from rough surfaces, such as piles of branches.

[0117] A random forest is used, consisting of multiple decision trees. Each tree is trained based on a different feature subset, extracting color and texture feature vectors. For example, if the color mean and texture entropy value are greater than 1.5, the tree is classified as "aquatic plants". The predictions of all decision trees are then voted on by majority vote to output the final category, such as "aquatic plants", "plastic waste", or "oil pollution".

[0118] Regarding the calculation of the occlusion area ratio, iterate through all pixels of the binary mask and accumulate the number of pixels marked as 1 (N). The ratio formula is: Occlusion area ratio = N / total number of pixels in the image × 100%. For example, if 30% of the pixels in the mask are marked, the occlusion ratio is 30%, which can be used to quantitatively assess the severity of water pollution or siltation.

[0119] In a preferred embodiment of the present invention, step S4 involves using the occlusion segmentation mask generated in step S3 to extract the water level edge point set of the unoccluded area from the original image, reconstructing the continuous water level line through linear fitting, interpolating and filling the occluded area, and evaluating the credibility value of the visual water level measurement result in combination with the identified occlusion type.

[0120] Step S4 further includes the following steps:

[0121] Step S4.1: Using a segmentation mask M, where pixels with a value of 0 represent unobstructed areas and pixels with a value of 1 represent obstructed areas, the unobstructed water level edge points are extracted by performing calculations on the mask M and the water level image, forming a point set P to obtain reliable water level information.

[0122] Step S4.2: Take the point set P from step S4.1 as input, use the RANSAC algorithm for linear fitting, select a small number of points by random sampling to fit the straight line, calculate the distance from other points to the straight line, determine the inliers according to the preset threshold, and select the straight line with the most inliers as the final fitting result through multiple iterations to obtain an accurate water level line equation that describes the actual position trend of the water level.

[0123] Step S4.3: Obtain the occlusion area ratio S calculated in step S3.6. When S is less than the preset value, based on the water level equation fitted in step S4.2, use bilinear interpolation to fill the pixel values ​​of the occlusion area. Fill the occlusion area by calculating the weighted average of known pixels around the occlusion area, so as to smoothly fill the occlusion area while preserving the trend of the fitted water level line.

[0124] Step S4.4: When the occlusion area ratio S in step S4.3 is greater than or equal to the preset value, the area is marked as "severely occluded" and visual data is disabled.

[0125] In this embodiment, the set of edge points of the unobstructed water level line is extracted, and the segmentation mask (M) is logically ANDed with the original water level image pixel by pixel. The area with a mask value of 0 is considered to be unobstructed, and the water level line pixel at that position is retained and marked as a valid edge point; the area with a mask value of 1 is considered to be obstructed, and is directly ignored and not included in the subsequent calculation.

[0126] A point set P is formed from all unobstructed waterline pixels, such as 200 discrete pixels at the waterfront boundary. Two points are randomly selected from point set P to generate a candidate straight line, i.e., the initial waterline model. The vertical distance from other points in point set P to this straight line is calculated. If the distance is less than a preset threshold, such as 1 pixel, it is marked as an interior point, supporting the current straight line. This process is repeated 500 times, and the number of times can be adjusted according to the actual situation. The straight line with the most interior points is retained.

[0127] Example, first iteration: sampling points generate line L1, and 180 interior points are selected;

[0128] Second iteration: Generate line L2, select 195 interior points, and then retain L2;

[0129] Final output: Line L with 200 interior points final .

[0130] The equation of the straight line is recalculated based on the interior points, such as y = 0.5x + 10, as the actual water level trend.

[0131] When the occlusion area S < 30%, 30% is the preset threshold, and a repair operation is performed, as follows:

[0132] Locate the occluded area: the pixel area with a mask value of 1;

[0133] Neighborhood reference: For each pixel to be repaired within the occluded area, select its four nearest unoccluded pixels in the top, bottom, left, and right directions;

[0134] If the coordinates of the pixel to be repaired are (x, y), and the reference pixels are (X1, Y1), (X1, Y2), (X2, Y1), (X2, Y2), the average value is calculated based on the inverse of the distance weight. If the reference point is closer, the weight is higher. A new pixel value is generated. After repair, the waterline transitions smoothly in the occluded area, and the fitted straight line has no abrupt inflection point.

[0135] When S≥30%, perform the following operation:

[0136] Marking the area as "severely occluded" indicates that the visual data for that period is invalid in the data report. Camera and infrared data are no longer used, and only the multi-sensor fusion results from step S2, such as pressure and ultrasound, are relied upon. The reliability of the visual water level results is reduced to 0, and due to the unreliability of the data, it is no longer used in the final water level calculation. Meanwhile, the weight of the pressure sensor is increased from 0.9 to 0.95 to strengthen the dominance of reliable data sources.

[0137] Scenario 1 Demonstration: When 30㎡ of garbage floats on the river surface, with an occlusion ratio S = 25%, after masking and filtering, 70% of the unoccluded water level edge points are retained. The point set P contains 350 points. After iteration, the fitted line is y = -0.01x + 15.2, at which point the water level is 15.2 meters. The 25% occlusion area is repaired, the water level line is continuous and smooth, the maximum repair error is <0.1 pixels, the visual water level value is 15.2 meters, and the confidence level is 85%. The confidence level of the visual water level value = 100% - occlusion ratio S × discount coefficient, the discount coefficient is 0.6, and the discount coefficient can be adjusted according to the actual situation.

[0138] Scenario 2 Demonstration: After a heavy rain, 70% of the water surface is covered with duckweed, S = 70%.

[0139] The area was marked as severely obstructed, and an alarm log was generated: "2025-07-17 17:30 Area A severely obstructed". The visual data was discarded, and the final water level was taken from the ultrasonic ranging value of 14.8 meters.

[0140] In a preferred embodiment of the present invention, step S5 involves dynamically adjusting the fusion strategy weights based on the occlusion segmentation mask and area ratio obtained in step S3, combining the preliminary water level estimate and its confidence index output in step S2 with the visual water level confidence assessment value evaluated in step S4, and performing a weighted fusion calculation to output the final water level estimate.

[0141] Step S5 further includes the following steps:

[0142] Step S5.1: When there are floating objects obstructing the water surface and the proportion of obstructed area S calculated in step S3.6 is less than the preset proportion value, the weights of the pressure level gauge, ultrasonic sensor and visual data in the final water level estimate are dynamically adjusted according to S, and the data are fused to obtain the final water level estimate.

[0143] Step S5.2: When the proportion of the area obstructed by floating objects on the water surface calculated in step S3.6 is greater than or equal to the preset proportion value, the data of the pressure level gauge is directly used as the final water level estimate.

[0144] Step S5.3: When it is determined that underwater weeds are entangled and affecting the water level monitoring, the infrared temperature gradient and ultrasonic echo complexity are combined to determine whether the weeds affect the pressure level gauge.

[0145] Step S5.4: If step S5.3 determines that weeds affect the pressure level gauge, then based on the visual data confidence assessment value evaluated in step S4, dynamically adjust the weights of visual data and ultrasonic data in the final water level estimate, and fuse these data to obtain the final water level estimate in order to correct the error caused by underwater weed entanglement.

[0146] Step S5.4 includes the following steps:

[0147] Step S5.41: Select a time series database to store water level data, and store the final water level data output in step S5.4 into the database;

[0148] Step S5.42: Based on the water level data stored in the database in step S5.41, use a plotting tool to draw a real-time water level curve to show the dynamic changes of the water level over time, and attach a data quality indicator bar to reflect the reliability of the data; at the same time, based on the obstruction segmentation mask generated in step S3, generate an obstruction distribution heat map to show the distribution of obstructions in the monitoring area.

[0149] In this embodiment, in scenario one, when slight occlusion occurs, S < preset value, such as S < 30%;

[0150] The rules for dynamically adjusting weights can be defined as follows:

[0151] Regarding underwater pressure sensors, the baseline weight is W. P =0.7-0.2×S, the greater the occlusion, the higher the weight. Example: when S=25%, then W P =0.7-0.05=0.65.

[0152] Regarding ultrasonic sensors: W U =0.2 + 0.1 × S, sound waves have strong penetrating power, and the weight increases when there is slight obstruction. Example: S = 25%, then W U =0.2 + 0.025 = 0.225.

[0153] Regarding the camera: W V =0.1×(1-S), the greater the occlusion, the lower the visual credibility. Example: S=25%, then W V =0.075.

[0154] The weights are normalized to ensure that W P +W U +W V =1, then merge the calculations, and finally the water level = pressure value × W P + Ultrasound value × W U +Visual Value × W V .

[0155] If the pressure value is 15.15 meters, the ultrasound value is 15.20 meters, and the visual value is 15.2 meters, the fusion result is 15.15 × 0.65 + 15.20 × 0.225 + 15.2 × 0.075 = 15.18 meters.

[0156] Scenario 2: When severe occlusion occurs, S≥30%, visual data is disabled, W V =0, the ultrasonic weight is reduced to 0.1 to avoid interference from floating objects on the water surface. At this point, the pressure sensor dominates: W P =0.9, W U =0.1, output final water level = pressure measurement value, such as 15.15 meters.

[0157] If aquatic plants attach to the pressure sensor probe, it will cause local temperature anomalies. Aquatic plants will cause the echo signal to oscillate with multiple peaks, while the normal water surface echo is a single peak. For example, when the number of peaks is ≥3 when weeds are entangled, if both are abnormal at the same time, it will be marked as "weeds affect the pressure sensor" and trigger weight adjustment.

[0158] The specific weight adjustment process is as follows:

[0159] Pressure sensor weights reset to zero: W due to data corruption. P =0;

[0160] Dynamic allocation of visual and ultrasound weights: Visual weight W V =Visual credibility, output from step S4. For example, if the credibility is 80%, then W V =0.8;

[0161] Ultrasonic weight W U =1-W V , such as W V =0.2;

[0162] Ultrasound value × W U +Visual Value × W V For example, ultrasound 15.20m × 0.2 + vision 15.2m × 0.8 = 15.20m.

[0163] Regarding data storage, it stores the corresponding final water level and data quality label at the same timestamp. Regarding the visualization interface, it aims to create a water level curve chart. The X-axis can represent time (hours / days), and the Y-axis can represent the water level height. For data quality indicators, for example, green indicates a confidence level ≥90%, yellow indicates a confidence level of 70-89%, and red indicates a confidence level <70%.

[0164] Convert the U-Net segmentation mask into a pseudo-color image, for example:

[0165] Orange indicates areas with high-density shielding, such as areas where garbage accumulates;

[0166] Blue indicates unobstructed waters.

[0167] In a preferred embodiment of the present invention, step S6 involves comparing the measured data from the backup mechanical water gauge with the current water level estimate based on the data quality score in step S5 and the occlusion area ratio in step S3, and updating the sensor calibration coefficient; tiered early warnings are issued based on the degree of occlusion and data quality deviation, and typical occlusion scenario data is stored.

[0168] Step S6 further includes the following steps:

[0169] Step S6.1: Based on the data quality score output in step S5 and the occlusion area ratio in step S3.6, determine whether to trigger automatic calibration. When the data quality score is lower than the preset score within the preset time, start the backup mechanical water gauge to obtain the reference water level and calculate the calibration coefficient to update the water level value.

[0170] Step S6.2: Based on the occlusion area ratio in step S3.6, classify the early warning into levels:

[0171] If the percentage of the obstructed area is less than the first preset threshold, log the information.

[0172] If the percentage of the obstructed area is between the first preset threshold and the second preset threshold, a text message will be sent to remind the maintenance personnel.

[0173] If the proportion of the obstructed area is greater than the second preset threshold, an audible and visual alarm will be triggered and a work order will be generated and pushed to the maintenance APP.

[0174] Step S6.3: Store the image, sensor data and processing results of the current occluded scene into the sample library, and automatically acquire new data weekly based on the sample library to update the U-Net model and Kalman filter parameters, so as to improve the accuracy of occlusion detection and segmentation and the precision of multi-sensor data fusion.

[0175] Step S6.2 further includes the following steps:

[0176] Step S6.21: Sort the graded warning information in step S6.2 according to severity and display it in a scrolling list on the visualization interface;

[0177] Step S6.22: Provide a historical query function, allowing users to specify time range and occlusion type identified in step S3.5 to filter data, and display the original image and processing process of the filtered data, including intermediate results and processing parameters from multi-sensor data acquisition to final decision.

[0178] In this embodiment, the mechanical water gauge trigger conditions are set in advance. For example, if the data quality score is less than 80 points for 24 consecutive hours, and step S5 outputs a current score of 75 points, while the occlusion rate S = 25%, which is within the calibration range, the backup mechanical water gauge is activated. The hydraulic drive device lowers the graduated physical water gauge, and the staff measures the water level, for example, 15.5 meters. If the current merged water level is 15.2 meters, the deviation is 15.5 - 15.2 = 0.3 meters. The calibration coefficient is updated, the pressure sensor reference value is increased by 0.3 meters, and subsequent measurements automatically compensate for this deviation, recalculating the data quality score to bring it back to the safe range.

[0179] For tiered early warnings, for example, when the occlusion area S < 20%, the early warning level is log recording, and the response measure is to store it in the database without issuing a notification;

[0180] For example, when the obstruction area accounts for 20% ≤ S < 40%, the warning level is medium warning, and the response measure is to send an SMS to the maintenance personnel;

[0181] For example, when the obstruction area accounts for S≥40%, the warning level is an emergency alarm, and the response measures are an audible and visual alarm plus automatic generation of a maintenance work order.

[0182] The aforementioned graded early warning information is sorted by severity and displayed as a scrolling list on the visualization interface. It also provides a historical query function, allowing users to specify a time range and filter data based on conditions such as the type of occlusion identified. The original images and processing of the filtered data are displayed, including intermediate results and processing parameters from multi-sensor data acquisition to the final decision.

[0183] In addition, the images, sensor data and processing results of the current occluded scene are stored in the sample library, and then the model is iteratively optimized, for example, automatically trained every week. When 500 new sets of samples are added to the U-Net model, the accuracy is improved.

[0184] Embodiments of the present invention also provide a computing device, including: a processor and a memory storing a computer program, wherein the computer program, when executed by the processor, performs the method described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.

[0185] Embodiments of the present invention also provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.

[0186] The above description is merely a preferred embodiment of the present invention; however, the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and its improved concepts, should be covered within the scope of protection of the present invention.

Claims

1. A method for intelligent sensing data processing based on electronic water level gauges, characterized in that, include: Step S1: Acquire visible light images, infrared thermal imaging, ultrasonic ranging, and pressure-based water level values ​​to form multi-source data; Step S2: Based on the multi-source data from Step S1, a Kalman filter is constructed and a water level state vector is defined. The weighting factors and noise covariance matrix of each sensor are dynamically adjusted according to their real-time confidence levels. After fusion calculation, a preliminary water level estimate and corresponding confidence index are output, including: Step S2.1: Define a state vector, which consists of water level height and water level change rate, and is used to comprehensively describe the state of the water level system. Step S2.2: Based on the state vector defined in step S2.1, construct a Kalman filter prediction model. The Kalman filter prediction model is based on a state-space model and consists of state transition equations and observation equations. The state transition equations describe how the system state changes over time, and the observation equations describe the relationship between the system state and sensor observations, including: Step S2.21: Calculate the historical reliability weight factor for each sensor involved in the observation equation in step S2.

2. The historical reliability of the sensor is determined by calculating the deviation between the measured value and the true value of the sensor over a period of time. Sensors with small and stable deviations are assigned the first weight factor, while sensors with large deviations and large fluctuations are assigned the second weight factor. Step S2.22: Based on the weight factors calculated in step S2.21, update the observation noise covariance matrix. This matrix describes the statistical characteristics of the observation noise. The diagonal elements of the matrix are inversely proportional to the weight factors, so as to assign different weights according to the reliability of the sensors in the fusion calculation. Step S3: The visible light image and infrared thermal image obtained in step S1 are fused into four-channel input data, which are then input into the pre-trained U-Net model for semantic segmentation to generate a water surface occlusion segmentation mask. Based on the mask, the type of occlusion is identified and the occlusion area ratio is calculated. Step S4: Using the occlusion segmentation mask generated in step S3, extract the water level edge point set of the unoccluded area from the original image, reconstruct the continuous water level line through linear fitting, interpolate and fill the occluded area, and evaluate the credibility value of the visual water level measurement result in combination with the identified occlusion type. Step S5: Based on the occlusion segmentation mask and area ratio obtained in Step S3, dynamically adjust the fusion strategy weights, combine the preliminary water level estimate and its confidence index output in Step S2, and the visual water level confidence assessment value evaluated in Step S4, perform weighted fusion calculation, and output the final water level estimate. Step S6: Based on the data quality score in step S5 and the occlusion area ratio in step S3, compare the measured data of the backup mechanical water gauge with the current water level estimate and update the sensor calibration coefficient; conduct graded early warnings based on the degree of occlusion and data quality deviation, and store typical occlusion scenario data.

2. The intelligent sensing data processing method based on electronic water level gauges according to claim 1, characterized in that, Step S2: Based on the multi-source data from Step S1, a Kalman filter is constructed and a water level state vector is defined. The weighting factors and noise covariance matrices of each sensor are dynamically adjusted according to their real-time reliability. After fusion calculation, a preliminary water level estimate and corresponding confidence index are output, including: Step S2.3: Perform Kalman filtering iteration based on the prediction model constructed in step S2.2, including a prediction step and a correction step. The prediction step calculates the prior state estimate at the current time based on the state estimate and state transition equation of the previous time step, and calculates the prior estimate covariance. The correction step uses the weighted fusion principle to weight the residuals using the weight factors of each sensor, calculates the Kalman gain, and uses the Kalman gain to correct the prior state estimate to obtain the posterior state estimate. Step S2.4: Based on the Kalman filter iteration results of step S2.3, update the state estimate, including updating the posterior estimate covariance. The covariance reflects the uncertainty of the corrected state estimate and is used for the iteration calculation at the next time step. Step S2.5: Based on the updated state estimate in step S2.4, output the fused water level estimate, which is a water level height estimate that takes into account the measurement information of multiple sensors and has been processed by noise reduction.

3. The intelligent sensing data processing method based on electronic water level gauges according to claim 2, characterized in that, Step S3: Fuse the multi-source data from Step S1 into four-channel input data, input it into the pre-trained U-Net model for semantic segmentation, generate a water surface obstruction segmentation mask, identify the obstruction type based on the mask and calculate the obstruction area ratio, including: Step S3.1: Fuse the RGB image and the infrared grayscale image in the four-channel input data to obtain the image input data. The RGB image provides the color and texture information of the object, while the infrared grayscale image reflects the temperature distribution of the object. Step S3.2: Input the image input data from step S3.1 into the U-Net model for processing. The U-Net model consists of a shrinking path and an expanding path. The shrinking path is used to extract deep features of the image, and the expanding path is used to restore the spatial dimension of the feature map and stitch together the features in the shrinking path. Finally, the output is an occlusion probability map of the same size as the input image. Step S3.3: Process the occlusion probability map output in step S3.2 according to the preset threshold to generate a binary mask to divide the occluded area and the unoccluded area. Step S3.4: Extract color and texture features from the occluded areas segmented in step S3.3; Step S3.5: Input the features extracted in step S3.4 into a lightweight classifier for classification to determine the type of occlusion. The lightweight classifier is an ensemble learning method based on decision trees, which consists of multiple decision trees. The final classification result is obtained by voting on the prediction results of multiple decision trees. Step S3.6: Count the number of pixels marked as occluders in the binary mask generated in step S3.3, and calculate the proportion of the occluded area in the total image area as a quantitative basis for assessing the severity of occlusion.

4. The intelligent sensing data processing method based on electronic water level gauges according to claim 3, characterized in that, Step S4: Using the occlusion segmentation mask generated in step S3, extract the water level edge point set of the unoccluded area from the original image, reconstruct the continuous water level line through linear fitting, interpolate and fill the occluded area, and evaluate the reliability of the visual water level measurement result based on the identified occlusion type, including: Step S4.1: Using a segmentation mask M, where pixels with a value of 0 represent unobstructed areas and pixels with a value of 1 represent obstructed areas, the unobstructed water level edge points are extracted by performing calculations on the mask M and the water level image, forming a point set P to obtain reliable water level information. Step S4.2: Take the point set P from step S4.1 as input, use the RANSAC algorithm for linear fitting, select a small number of points by random sampling to fit the straight line, calculate the distance from other points to the straight line, determine the inliers according to the preset threshold, and select the straight line with the most inliers as the final fitting result through multiple iterations to obtain an accurate water level line equation that describes the actual position trend of the water level. Step S4.3: Obtain the occlusion area ratio S calculated in step S3.

6. When S is less than the preset value, based on the water level equation fitted in step S4.2, use bilinear interpolation to fill the pixel values ​​of the occlusion area. Fill the occlusion area by calculating the weighted average of known pixels around the occlusion area, so as to smoothly fill the occlusion area while preserving the trend of the fitted water level line. Step S4.4: When the occlusion area ratio S in step S4.3 is greater than or equal to the preset value, the area is marked as "severely occluded" and visual data is disabled.

5. The intelligent sensing data processing method based on electronic water level gauges according to claim 4, characterized in that, Step S5: Based on the occlusion segmentation mask and area ratio obtained in Step S3, dynamically adjust the fusion strategy weights. Combine the preliminary water level estimate and its confidence index output in Step S2, and the visual water level confidence assessment value evaluated in Step S4, perform weighted fusion calculation, and output the final water level estimate, including: Step S5.1: When there are floating objects obstructing the water surface and the proportion of obstructed area S calculated in step S3.6 is less than the preset proportion value, the weights of the pressure level gauge, ultrasonic sensor and visual data in the final water level estimate are dynamically adjusted according to S, and the data are fused to obtain the final water level estimate. Step S5.2: When the proportion of the area obstructed by floating objects on the water surface calculated in step S3.6 is greater than or equal to the preset proportion value, the data of the pressure level gauge is directly used as the final water level estimate. Step S5.3: When it is determined that underwater weeds are entangled and affecting the water level monitoring, the infrared temperature gradient and ultrasonic echo complexity are combined to determine whether the weeds affect the pressure level gauge. Step S5.4: If step S5.3 determines that weeds affect the pressure level gauge, then based on the visual data confidence assessment value evaluated in step S4, dynamically adjust the weights of visual data and ultrasonic data in the final water level estimate, and fuse these data to obtain the final water level estimate in order to correct the error caused by underwater weed entanglement.

6. The intelligent sensing data processing method based on electronic water level gauges according to claim 5, characterized in that, Step S5.4: If step S5.3 determines that weeds affect the pressure level gauge, then based on the visual data reliability assessment value evaluated in step S4, dynamically adjust the weights of visual data and ultrasonic data in the final water level estimate, and fuse these data to obtain the final water level estimate, in order to correct the error caused by underwater weed entanglement, including: Step S5.41: Select a time series database to store water level data, and store the final water level data output in step S5.4 into the database; Step S5.42: Based on the water level data stored in the database in step S5.41, use a plotting tool to draw a real-time water level curve to show the dynamic changes of the water level over time, and attach a data quality indicator bar to reflect the reliability of the data; at the same time, based on the obstruction segmentation mask generated in step S3, generate an obstruction distribution heat map to show the distribution of obstructions in the monitoring area.

7. The intelligent sensing data processing method based on electronic water level gauges according to claim 6, characterized in that, Step S6: Based on the data quality score in Step S5 and the occlusion area ratio in Step S3, compare the measured data from the backup mechanical water gauge with the current water level estimate to update the sensor calibration coefficients; issue graded warnings based on the degree of occlusion and data quality deviation, and store typical occlusion scenario data, including: Step S6.1: Based on the data quality score output in step S5 and the occlusion area ratio in step S3.6, determine whether to trigger automatic calibration. When the data quality score is lower than the preset score within the preset time, start the backup mechanical water gauge to obtain the reference water level and calculate the calibration coefficient to update the water level value. Step S6.2: Based on the occlusion area ratio in step S3.6, classify the early warning into levels: If the percentage of the obstructed area is less than the first preset threshold, log the information. If the percentage of the obstructed area is between the first preset threshold and the second preset threshold, a text message will be sent to remind the maintenance personnel. If the proportion of the obstructed area is greater than the second preset threshold, an audible and visual alarm will be triggered and a work order will be generated and pushed to the maintenance APP. Step S6.3: Store the image, sensor data and processing results of the current occluded scene into the sample library, and automatically acquire new data weekly based on the sample library to update the U-Net model and Kalman filter parameters, so as to improve the accuracy of occlusion detection and segmentation and the precision of multi-sensor data fusion.

8. The intelligent sensing data processing method based on electronic water level gauges according to claim 7, characterized in that, Step S6.2: Based on the occlusion area ratio in step S3.6, classify the early warning into levels, including: Step S6.21: Sort the graded warning information in step S6.2 according to severity and display it in a scrolling list on the visualization interface; Step S6.22: Provide a historical query function, allowing users to specify a time range and the occlusion type conditions identified in step S3.5 to filter data, and display the original images and processing process of the filtered data, including intermediate results and processing parameters from multi-sensor data acquisition to the final decision.

9. A computing device, characterized in that, include: One or more processors; A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to perform the method as described in claim 8.

Citation Information

Patent Citations

  • Water gauge water level machine vision detection method and device with free shooting visual angle

    CN115578695A

  • Water level monitoring alarm

    CN118129862A