Water level monitoring method and device based on visual model, equipment and storage medium

By optimizing the water level monitoring method through multimodal data fusion and hydrological prior knowledge constraints, the problems of real-time performance and reliability of water level monitoring in complex water environments are solved, and efficient and accurate water level identification and output are achieved.

CN123178794APending Publication Date: 2026-11-27GUANGZHOU BAOLUN ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611287940.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-24
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing water level monitoring technologies suffer from poor real-time performance, low reliability, and insufficient model generalization ability in complex aquatic environments. In particular, they are difficult to accurately identify water level boundaries under conditions such as direct sunlight or obstruction by floating objects. Furthermore, they rely on single image information, leading to abnormal identification results. They also have high computational resource requirements, making it difficult to meet the needs of real-time monitoring.

Method used

By acquiring multimodal monitoring data, including water level image data, hydrological monitoring data, and environmental parameter data, preprocessing and time-series correlation are performed. A lightweight visual recognition model is used to identify water level boundaries. The initial results are constrained, verified, and optimized by combining pre-built hydrological prior knowledge, and abnormal results are corrected. Finally, the accurate water level value is output through the mapping relationship between image coordinates and physical water level.

Benefits of technology

It achieves highly reliable and stable water level monitoring in complex aquatic environments, reduces computational complexity, improves real-time performance and engineering application capabilities, reduces anomaly identification results, and improves the accuracy and stability of water level monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178794A_ABST
    Figure CN123178794A_ABST
Patent Text Reader

Abstract

The application provides a water level monitoring method and device based on a visual model, equipment and a storage medium, multi-modal monitoring data such as water level image data, hydrological monitoring data and environmental parameter data are obtained. And the visual recognition model obtained by adopting the lightweight processing based on the visual basic model is used to identify the water level boundary of the target water body area. Further, the initial water level recognition result is constrained and verified by introducing hydrological prior knowledge, and a constraint optimization model is constructed by combining historical water level information and water body physical characteristics, so that the recognition result that does not conform to the hydrological law is corrected, and the recognition error and water level abnormal jump problem caused by complex light, shielding, rain and fog and other factors are reduced. At the same time, the time sequence consistency optimization is carried out on the continuous time water level result, and the mapping relationship between the image coordinates and the physical water level is combined to realize stable and accurate physical water level output, and the reliability and long-term operation stability of the water level monitoring result are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water conservancy monitoring technology, and in particular to a water level monitoring method, device, equipment and storage medium based on a visual model. Background Technology

[0002] Water level monitoring is a crucial foundation for water resource management, flood control scheduling, reservoir operation management, and water ecological protection. With the development of smart water conservancy, rivers, lakes, reservoirs, and dams are increasingly adopting automated monitoring methods to obtain water level information, improving monitoring efficiency and data real-time performance. Existing water level monitoring methods mainly include manual measurement, contact sensor measurement, and image recognition-based non-contact measurement. Manual measurement suffers from high workload, poor real-time performance, and significant susceptibility to environmental conditions. Contact sensors, deployed long-term in complex aquatic environments, are susceptible to corrosion and floating debris impacts, resulting in high maintenance costs and insufficient equipment reliability.

[0003] With the development of computer vision and deep learning technologies, image recognition-based water level monitoring methods are increasingly being applied to water conservancy monitoring scenarios. Existing technologies typically analyze acquired water surface images using object detection models or semantic segmentation models to identify water level positions and further convert them into water level values. However, water conservancy monitoring scenarios are often highly complex. For example, strong direct sunlight causing water surface reflection, floating debris obscuring water level boundaries, shoreline vegetation interference, and rain, snow, and fog degrading image quality can all lead to unstable image features, making accurate identification of water level boundaries difficult. Furthermore, existing deep learning-based visual recognition models usually rely on a large number of labeled samples for training. When applying these models to different water bodies, seasons, and environmental conditions, data needs to be re-collected and re-labeled, resulting in insufficient model generalization ability.

[0004] Furthermore, most existing visual water level recognition methods rely on single image information for judgment, lacking prior information constraints such as hydrological patterns, historical trends, and water body physical characteristics. This makes the recognition results susceptible to anomalies in a single image frame. For example, under conditions of water surface reflection or partial occlusion, the visual model may misjudge water level boundaries, causing abnormal jumps in the output water level, which may not conform to actual hydrological changes. Although the basic visual model has strong feature extraction and generalization capabilities, its large parameter scale leads to high computational resource requirements and insufficient inference speed when directly deployed on edge devices in water conservancy projects, making it difficult to meet real-time monitoring needs.

[0005] In summary, the problems existing in the current technology urgently need to be solved. Summary of the Invention

[0006] This invention provides a water level monitoring method, device, equipment, and storage medium based on a visual model, which addresses the shortcomings of existing technologies and enables highly reliable and stable intelligent water level monitoring in complex aquatic environments.

[0007] This invention provides a water level monitoring method based on a visual model, comprising: Acquire multimodal monitoring data of the target monitoring area, including water level image data, hydrological monitoring data, and environmental parameter data; The multimodal monitoring data is preprocessed, and time-series correlation is performed based on the acquisition time of different types of monitoring data to obtain the fused monitoring data at the corresponding time. The fused monitoring data is input into a pre-trained lightweight visual recognition model to identify the water level boundary of the target water body area and obtain the initial water level recognition result. The lightweight visual recognition model is obtained by lightweighting the basic visual model. Based on pre-constructed hydrological prior knowledge, the initial water level identification result is constrained and verified to determine whether the initial water level identification result meets the preset hydrological rules. When the initial water level identification result does not meet the preset hydrological law, the initial water level identification result is corrected by a constraint optimization model to obtain the target water level result. The constraint optimization model is constructed based on the initial water level identification result, historical water level information, and water body physical characteristics. The target water level results at consecutive time points are optimized for temporal consistency. Based on the pre-established mapping relationship between image coordinates and physical water levels, the optimized water level results are converted into corresponding physical water level values ​​and output.

[0008] According to the water level monitoring method based on a visual model provided by the present invention, the step of preprocessing the multimodal monitoring data and performing time-series correlation based on the acquisition time of different types of monitoring data to obtain fused monitoring data at corresponding times specifically includes: The water level image data is subjected to image enhancement processing; The hydrological monitoring data and environmental parameter data are subjected to data standardization processing; Acquire the collection time information corresponding to the water level image data, hydrological monitoring data, and environmental parameter data. Using the collection time of the water level image data as a benchmark, perform time matching on monitoring data with different sampling frequencies to obtain associated data corresponding to the time of the water level image data. The preprocessed water level image data, time-correlated hydrological monitoring data, and environmental parameter data are fused to obtain the fused monitoring data.

[0009] According to the water level monitoring method based on a visual model provided by the present invention, the step of inputting the fused monitoring data into a pre-trained lightweight visual recognition model to identify the water level boundary of the target water body area and obtain an initial water level recognition result specifically includes: High-dimensional visual feature information is obtained by extracting features from the fused monitoring data using a visual basic model, and a teacher model is constructed based on the feature expression capability of the visual basic model. A student model is constructed using a lightweight network structure, and the visual feature information in the teacher model is transferred to the student model through knowledge distillation to obtain the lightweight visual recognition model. The fused monitoring data is input into the lightweight visual recognition model, and the corresponding water body area segmentation result is obtained by performing feature extraction and semantic segmentation on the target water body area. The location of the water body boundary is determined based on the water body region segmentation result, and the initial water level identification result is obtained based on the location of the water body boundary.

[0010] According to the water level monitoring method based on a visual model provided by the present invention, the step of constraining and verifying the initial water level identification result based on pre-constructed hydrological prior knowledge to determine whether the initial water level identification result meets the preset hydrological law specifically includes: Obtain a pre-constructed hydrological prior knowledge base, which includes water level time series change constraint information, water level change amplitude constraint information, and water body structure feature constraint information; Based on the hydrological prior knowledge base, the initial water level identification result is subjected to multi-dimensional consistency verification. The water level time-series change constraint information is used to determine whether there are abnormal fluctuations in the initial water level identification result based on the relationship between the water level changes at the current time and historical times; the water level change amplitude constraint information is used to determine whether the water level change between adjacent monitoring times exceeds a preset change range; and the water body structure feature constraint information is used to determine whether the initial water level identification result conforms to the physical characteristics of the water body based on the water surface flatness, water body connectivity, and / or the consistency of the water gauge scale. Anomaly determination information is generated based on the consistency verification results of each dimension, and the anomaly determination information is used to determine whether the initial water level identification result meets the preset hydrological rules.

[0011] According to the present invention, a water level monitoring method based on a visual model, the step of correcting the initial water level identification result by a constraint optimization model to obtain the target water level result when the initial water level identification result does not meet the preset hydrological law specifically includes: When the anomaly determination information corresponding to the initial water level identification result meets the preset anomaly conditions, the initial water level identification result, historical water level information, and current water body physical characteristic information are obtained. Based on the initial water level identification result, a data consistency constraint term is constructed. The data consistency constraint term is used to maintain the closeness between the corrected water level result and the visual identification result. Based on the historical water level information, a time-series change constraint term is constructed, which is used to limit the deviation between the corrected water level result and the historical water level change trend. Based on the physical characteristics of the water body, a physical consistency constraint term is constructed. The physical consistency constraint term is used to constrain the corrected water level result to meet the water surface structure characteristics. The constraint optimization model is constructed based on the data consistency constraint, time series change constraint, and physical consistency constraint, and the initial water level identification result is optimized and solved to obtain the target water level result that satisfies the constraints of visual recognition result, hydrological change law, and water body physical characteristics.

[0012] According to the visual model-based water level monitoring method provided by the present invention, the step of optimizing the temporal consistency of the target water level results at consecutive time intervals, and converting the optimized water level results into corresponding physical water level values ​​and outputting them based on a pre-established mapping relationship between image coordinates and physical water levels, specifically includes: Obtain the target water level results corresponding to multiple consecutive monitoring times, and construct time-series feature information based on the water level change relationship between adjacent times; Based on the time-series feature information, the consistency of the target water level result is verified, and a time-series smoothing method is used to reduce the impact of random fluctuations and abnormal jumps on the water level result, so as to obtain an optimized stable water level result. Obtain the pre-established mapping relationship between image coordinates and physical water level, the mapping relationship being established based on the water level boundary position in the image and the corresponding actual water level calibration information; Based on the mapping relationship, the image coordinates corresponding to the optimized stable water level result are converted into physical water level values, and the physical water level values ​​are output as monitoring results.

[0013] According to the present invention, a water level monitoring method based on a visual model is provided, wherein the lightweight visual recognition model is obtained by training through a pre-constructed multimodal training sample library; The multimodal training sample library includes water level image data, hydrological monitoring data, and environmental parameter data collected under different environmental conditions. The environmental conditions include at least normal scenes, strong light scenes, water surface reflection scenes, shading scenes, rain and snow scenes, and foggy scenes.

[0014] The present invention also provides a water level monitoring device based on a visual model, comprising: The data acquisition module is used to acquire multimodal monitoring data of the target monitoring area, including water level image data, hydrological monitoring data, and environmental parameter data. The data processing module is used to preprocess the multimodal monitoring data and perform time-series correlation based on the acquisition time of different types of monitoring data to obtain the fused monitoring data at the corresponding time. The preliminary identification module is used to input the fused monitoring data into a pre-trained lightweight visual recognition model to identify the water level boundary of the target water body area and obtain the initial water level identification result. The lightweight visual recognition model is obtained by lightweighting the basic visual model. The constraint verification module is used to perform constraint verification on the initial water level identification result based on pre-constructed hydrological prior knowledge, so as to determine whether the initial water level identification result meets the preset hydrological rules. The result correction module is used to correct the initial water level identification result by means of a constraint optimization model when the initial water level identification result does not meet the preset hydrological law, so as to obtain the target water level result. The constraint optimization model is constructed by means of the initial water level identification result, historical water level information and water body physical characteristics. The result optimization module is used to optimize the temporal consistency of the target water level results at consecutive time intervals, and convert the optimized water level results into corresponding physical water level values ​​and output them according to the pre-established mapping relationship between image coordinates and physical water levels.

[0015] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the visual model-based water level monitoring method as described above.

[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the visual model-based water level monitoring method as described above.

[0017] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the visual model-based water level monitoring method as described above.

[0018] The water level monitoring method, device, equipment, and storage medium based on visual models provided by this invention acquire multimodal monitoring data, including water level image data, hydrological monitoring data, and environmental parameter data, and preprocess and correlate different types of monitoring data in a timely manner. This enables the water level identification process to comprehensively utilize visual information, hydrological change information, and environmental impact information, thereby improving the integrity and effectiveness of monitoring data in complex aquatic environments.

[0019] This invention employs a lightweight visual recognition model obtained through lightweight processing of a basic visual model to identify water level boundaries in target water areas within fused monitoring data. While retaining the strong feature extraction capabilities of the basic visual model, it reduces the computational complexity of the model, making the water level recognition model suitable for deployment on-site edge devices and improving the real-time performance and engineering application capabilities of water level monitoring.

[0020] This invention further constrains and verifies the initial water level identification results based on pre-constructed hydrological prior knowledge, introduces hydrological prior information such as water level change patterns and water body physical characteristics into the visual recognition process, and makes a reasonable judgment on the output results of the visual model, reducing abnormal identification results caused by factors such as strong light reflection, occlusion, rain and fog, and improving the reliability of water level identification results.

[0021] When the initial water level identification result does not meet the preset hydrological rules, this invention constructs a constraint optimization model by combining the initial water level identification result, historical water level information, and water body physical characteristics to correct the abnormal identification result. This corrected water level result simultaneously meets the constraints of visual recognition result consistency, water level change trend, and water body physical rules, reducing water level data jumps and improving the stability of water level monitoring in complex environments.

[0022] This invention optimizes the temporal consistency of target water level results across consecutive time points and utilizes the mapping relationship between image coordinates and physical water levels to convert the optimization results into actual physical water level values. This automates the process from image water level boundary identification to standard water level data output, improving the accuracy and stability of water level data during long-term continuous monitoring. In summary, this invention enables highly reliable and stable intelligent water level monitoring in complex aquatic environments, reducing manual maintenance costs and enhancing the automation level of water conservancy monitoring. Attached Figure Description

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

[0024] Figure 1 This is a flowchart illustrating the water level monitoring method based on a visual model provided by the present invention. Figure 2 This is a schematic diagram of the structure of the water level monitoring device based on a visual model provided by the present invention; Figure 3 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

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

[0026] To address the problems in existing technologies, this invention proposes a visual model-based water level monitoring method to achieve highly reliable and stable intelligent water level monitoring in complex aquatic environments. The visual model-based water level monitoring method is described below, as follows: Figure 1 As shown, including but not limited to the following steps: Step 110: Obtain multimodal monitoring data of the target monitoring area, including water level image data, hydrological monitoring data, and environmental parameter data.

[0027] In step 110, corresponding multimodal monitoring data is acquired through monitoring equipment deployed in the target monitoring area. Specifically, the water level image data can be obtained by acquiring real-time images or video data of the target water area using camera equipment, used to characterize the water surface area and water level boundary information; the hydrological monitoring data may include hydrological information related to the target water area, such as water level change data and flow rate change data; and the environmental parameter data may include environmental information affecting image acquisition quality or water level changes.

[0028] In practical applications, corresponding data acquisition equipment can be set up according to the spatial range of the target monitoring area, monitoring needs, and on-site environmental conditions, so that different types of data can be continuously acquired, thereby providing a multi-dimensional data foundation for subsequent water level identification.

[0029] Step 120: Preprocess the multimodal monitoring data and perform time-series correlation based on the acquisition time of different types of monitoring data to obtain the fused monitoring data at the corresponding time.

[0030] In step 120, the acquired multimodal monitoring data is preprocessed to improve data quality and reduce the impact of environmental factors on the subsequent identification process. Specifically, corresponding data processing methods can be adopted for different types of data. For example, image quality optimization processing can be performed on water level image data, and data processing can be performed on hydrological monitoring data and environmental parameter data to ensure that data from different sources meet the requirements of subsequent analysis.

[0031] Since the data acquisition cycles of different monitoring devices may differ, in order to ensure the correspondence between various types of monitoring data, time-series correlation is performed based on the acquisition time information corresponding to each monitoring data. Data from different sampling times are converted into time states corresponding to the target water level image data, thereby obtaining fused monitoring data containing image information, hydrological information, and environmental information at the same monitoring time.

[0032] Through the above processing, the subsequent water level identification process no longer relies solely on a single image data, but can be comprehensively analyzed by combining multi-dimensional state information of the target monitoring area.

[0033] Step 130: Input the fused monitoring data into a pre-trained lightweight visual recognition model to identify the water level boundary of the target water body area and obtain the initial water level recognition result. The lightweight visual recognition model is obtained by lightweighting the basic visual model.

[0034] In step 130, the fused monitoring data obtained in step 120 is input into a pre-trained lightweight visual recognition model. The lightweight visual recognition model performs visual feature analysis on the water body area in the target monitoring area, identifies the boundary features corresponding to the target water body area, and generates an initial water level recognition result based on the identified water level boundary information.

[0035] The lightweight visual recognition model is obtained by lightweighting the basic visual model. It can inherit the basic visual model's ability to extract complex image features while reducing the computational resource requirements during model operation, making it suitable for real-time recognition scenarios in water conservancy monitoring.

[0036] In this embodiment, the initial water level identification result is used to characterize the preliminary water level status information obtained by the visual recognition model based on the current monitoring data, and can serve as the basic data for subsequent hydrological pattern verification and result optimization.

[0037] Step 140: Based on pre-constructed hydrological prior knowledge, perform constraint verification on the initial water level identification result to determine whether the initial water level identification result meets the preset hydrological rules.

[0038] In step 140, the rationality of the initial water level recognition result output by the lightweight visual recognition model is judged based on the pre-established hydrological prior knowledge.

[0039] Specifically, the hydrological prior knowledge is used to describe the basic laws that should be followed during water level changes in the target monitoring area, including information such as water level change trends, change ranges, and water body state change patterns. By matching and analyzing the initial water level identification results with the hydrological prior knowledge, it is determined whether the current identification results do not conform to the actual hydrological change patterns.

[0040] When the initial water level identification result conforms to the preset hydrological pattern, the current identification result can be considered to have high reliability; when the initial water level identification result does not conform to the preset hydrological pattern, it is determined that the current identification result may be affected by environmental interference or visual recognition error, and further optimization is required.

[0041] Step 150: When the initial water level identification result does not meet the preset hydrological law, the initial water level identification result is corrected by a constraint optimization model to obtain the target water level result. The constraint optimization model is constructed by the initial water level identification result, historical water level information and water body physical characteristics.

[0042] In step 150, when step 140 determines that the initial water level identification result does not meet the preset hydrological law, the initial water level identification result, historical water level information and current water body physical characteristic information corresponding to the current monitoring time are obtained, and a constrained optimization model is constructed.

[0043] The constraint optimization model comprehensively considers visual recognition results, historical water level changes, and the physical characteristics of the water body itself. By jointly constraining multiple factors, the optimized water level results can simultaneously satisfy visual detection results, hydrological change patterns, and water body state characteristics.

[0044] By solving the constrained optimization model, the target water level result that meets the preset constraints can be obtained, thereby reducing abnormal water level results caused by changes in image quality, environmental interference or model misidentification, and improving the reliability of water level monitoring results.

[0045] Step 160: Perform time-series consistency optimization on the target water level results at consecutive time points, and convert the optimized water level results into corresponding physical water level values ​​and output them according to the pre-established mapping relationship between image coordinates and physical water levels.

[0046] In step 160, the target water level results obtained from continuous monitoring are subjected to time series analysis. The consistency of the target water level results is optimized based on the water level changes over a continuous period of time, so that the output water level data conforms to the actual water level change trend and reduces data fluctuations caused by random errors.

[0047] Furthermore, based on the pre-established mapping relationship between image coordinates and physical water levels, the image position information corresponding to the optimized water level boundary is converted into the actual physical water level value. The mapping relationship describes the correspondence between the water level boundary position in image space and the actual water level height.

[0048] Finally, the converted physical water level value is output as the water level monitoring result of the target monitoring area, realizing automated water level monitoring based on a visual model.

[0049] As a further optional embodiment, the step of preprocessing the multimodal monitoring data and performing time-series correlation based on the acquisition time of different types of monitoring data to obtain fused monitoring data at corresponding times specifically includes: The water level image data is subjected to image enhancement processing; The hydrological monitoring data and environmental parameter data are subjected to data standardization processing; Acquire the collection time information corresponding to the water level image data, hydrological monitoring data, and environmental parameter data. Using the collection time of the water level image data as a benchmark, perform time matching on monitoring data with different sampling frequencies to obtain associated data corresponding to the time of the water level image data. The preprocessed water level image data, time-correlated hydrological monitoring data, and environmental parameter data are fused to obtain the fused monitoring data.

[0050] In this embodiment, the acquired multimodal monitoring data is first preprocessed to improve the quality and consistency of different types of monitoring data. Specifically, image enhancement processing is performed on the water level image data. By reducing image noise, improving image clarity, and minimizing the impact of factors such as illumination changes on image features, the water body area and water level boundary features are made more obvious, providing more accurate image input for subsequent visual recognition.

[0051] For the aforementioned hydrological monitoring data and environmental parameter data, since different types of data may have different data units and large differences in numerical range, data standardization processing is performed to convert different types of monitoring data into a unified data representation form, which facilitates subsequent data fusion processing.

[0052] Furthermore, the acquisition time information corresponding to the water level image data, hydrological monitoring data, and environmental parameter data is obtained. Since the data acquisition frequencies of different monitoring devices may differ—for example, image acquisition devices and hydrological sensing devices may use different data sampling periods—there may be time discrepancies in the data corresponding to the same monitoring area. Therefore, the acquisition time of the water level image data is used as a benchmark to perform time matching on other types of monitoring data to determine the hydrological monitoring data and environmental parameter data corresponding to the current water level image data at that moment.

[0053] After completing the time correlation, the water level image data after image enhancement processing, the hydrological monitoring data after time matching, and the environmental parameter data are fused to form fused monitoring data for the corresponding monitoring time. This method ensures that monitoring information from different sources and with different acquisition frequencies remains consistent over time, providing a more comprehensive and accurate data foundation for subsequent visual model-based water level identification.

[0054] As a further optional embodiment, the step of inputting the fused monitoring data into a pre-trained lightweight visual recognition model to identify the water level boundary of the target water body area and obtain an initial water level recognition result specifically includes: High-dimensional visual feature information is obtained by extracting features from the fused monitoring data using a visual basic model, and a teacher model is constructed based on the feature expression capability of the visual basic model. A student model is constructed using a lightweight network structure, and the visual feature information in the teacher model is transferred to the student model through knowledge distillation to obtain the lightweight visual recognition model. The fused monitoring data is input into the lightweight visual recognition model, and the corresponding water body area segmentation result is obtained by performing feature extraction and semantic segmentation on the target water body area. The location of the water body boundary is determined based on the water body region segmentation result, and the initial water level identification result is obtained based on the location of the water body boundary.

[0055] In this embodiment, a visual foundation model is first used to extract features from the fused monitoring data to obtain a high-dimensional feature representation containing visual information of the target water body area. The visual foundation model has strong image feature representation capabilities, enabling it to extract visual feature information related to water body areas, water surface boundaries, and environmental disturbance factors from complex aquatic environment images. A teacher model is then constructed based on this visual foundation model to provide feature guidance for subsequent lightweight model training.

[0056] Furthermore, a lightweight network structure is used to construct the student model, and knowledge distillation is employed to transfer the visual feature information from the teacher model to the student model. During training, by enabling the student model to learn the visual feature representation capabilities extracted by the teacher model, the student model retains its ability to recognize water features in complex aquatic scenarios while reducing the model parameter size and computational complexity, thereby obtaining a lightweight visual recognition model suitable for actual monitoring scenarios.

[0057] After model training is completed, the fused monitoring data is input into the lightweight visual recognition model. The lightweight visual recognition model extracts features from the input data and performs semantic analysis on the target water body area to obtain the corresponding water body area segmentation result. The water body area segmentation result is used to characterize the spatial relationship between water body areas and non-water body areas in the target monitoring area.

[0058] Furthermore, the water body region boundary positions are determined based on the water body region segmentation results, and these boundary positions are used as the basis for water level identification to obtain the corresponding initial water level identification results. Through this method, a lightweight visual recognition model is used to automatically identify water body regions in complex water scenarios, providing foundational data for subsequent result verification based on hydrological prior knowledge and water level optimization processing.

[0059] Specifically, a "teacher-student" knowledge distillation framework is adopted to transfer the feature extraction capabilities of SAM (teacher model) to MobileNetV3 (student model). The distillation loss function is:

[0060] The loss components are defined as follows: 1) Segmentation cross-entropy loss Lseg:

[0061] In the formula y i For real labels, i The predicted values ​​for the student model.

[0062] 2) Divergence distillation loss LKL:

[0063] In the formula , The outputs are soft labels for the teacher and student models, respectively.

[0064] 3) Intermediate layer feature alignment loss Lfeat:

[0065] In the formula , These are the feature maps of the teacher and student at the j-th layer, respectively. Here, C is the adaptive mapping function, and C is the total number of feature channels in the current alignment layer.

[0066] Performing feature distillation on all J intermediate layers of the network increases the total feature loss by increasing the layer weighting coefficients.

[0067] wj is the balancing weight of the j-th layer.

[0068]

[0069] L total This represents the overall total loss. α, β, and γ are balance coefficients that satisfy α + β + γ = 1. Recommended values ​​are α = 0.3, β = 0.5, and γ = 0.2. After distillation, the model volume is compressed by more than 75%, inference speed is increased by 5-8 times, and accuracy is retained by more than 95%.

[0070] The knowledge distillation training process is as follows: Teacher model: The original SAM image encoder (ViT-H / L level, complete parameters) is used. The weights are frozen during training, and only soft labels and intermediate layer features are provided in the forward pass without updating the parameters.

[0071] Student model: MobileNetV3-Large is used as a lightweight backbone to replace the SAM encoder, followed by the SAM cue encoder and mask decoder.

[0072] Training dataset: A multimodal sample library (six types of interference scenarios, 10,000+ groups) is used, and the water body mask is manually labeled as hard labels; and a public water segmentation dataset is superimposed to expand the cross-water generalization capability.

[0073] Each loss is calculated as follows: Lseg is the pixel-wise cross-entropy between the student mask prediction and the manually labeled hard label; LKL is the KL divergence between the teacher and the student soft label; Lfeat is the MSE distance between the student's j-th layer feature after being enlarged to the teacher's channel number by 1×1 convolution and the teacher's corresponding layer feature, which is then summed over all J intermediate layers.

[0074] Loss weights are determined by grid search on the validation set, using the segmentation of mIoU and water level edge F1 as indicators (satisfying α+β+γ=1).

[0075] Inference Deployment: Only the distilled MobileNetV3 student model is deployed for online inference. The SAM teacher model is only used during the training phase and does not participate in online inference, thereby achieving a real-time performance of 21.5 FPS on edge devices, with model size compression of more than 75% and accuracy retention of more than 95%.

[0076] SAM hints encoding and feature extraction are as follows: The input image is processed by the SAM image encoder to extract multi-scale features. The cue encoder fuses bounding box cue and point cue, and then fuses the image features and cue features through a cross-attention mechanism.

[0077] Where Ffused is the fused image; Fprompt is the prompting code output feature; Fimg is the SAM image encoder output image feature; and d is the feature dimension.

[0078] As a further optional embodiment, the step of constraining and verifying the initial water level identification result based on pre-constructed hydrological prior knowledge to determine whether the initial water level identification result meets the preset hydrological rules specifically includes: Obtain a pre-constructed hydrological prior knowledge base, which includes water level time series change constraint information, water level change amplitude constraint information, and water body structure feature constraint information; Based on the hydrological prior knowledge base, the initial water level identification result is subjected to multi-dimensional consistency verification. The water level time-series change constraint information is used to determine whether there are abnormal fluctuations in the initial water level identification result based on the relationship between the water level changes at the current time and historical times; the water level change amplitude constraint information is used to determine whether the water level change between adjacent monitoring times exceeds a preset change range; and the water body structure feature constraint information is used to determine whether the initial water level identification result conforms to the physical characteristics of the water body based on the water surface flatness, water body connectivity, and / or the consistency of the water gauge scale. Anomaly determination information is generated based on the consistency verification results of each dimension, and the anomaly determination information is used to determine whether the initial water level identification result meets the preset hydrological rules.

[0079] In this embodiment, a hydrological prior knowledge base is pre-constructed to provide hydrological constraints for the initial water level identification results output by the visual model. This hydrological prior knowledge base is established based on historical monitoring data of the target monitoring area, water type characteristics, and water level change patterns. It describes the temporal characteristics, range of change, and water body structure characteristics that should be satisfied during water level changes.

[0080] Specifically, the hydrological prior knowledge base includes water level temporal variation constraint information, water level variation amplitude constraint information, and water body structure feature constraint information. The water level temporal variation constraint information describes the trend relationship of water level changes between continuous monitoring times. By analyzing the changes between the current water level and historical water levels, it determines whether the initial water level identification result has abnormal fluctuations that do not conform to the actual situation. The water level variation amplitude constraint information describes the allowable range of water level changes between adjacent monitoring times. By comparing the relationship between the water level changes at adjacent times and the preset range, it determines whether the current identification result has abrupt changes. The water body structure feature constraint information describes the physical characteristics of the water body region in the image. By analyzing the flatness of the water surface, the continuity of the water body region, and the consistency of auxiliary features such as water gauges, it determines whether the initial water level identification result conforms to the actual water body state.

[0081] Furthermore, the initial water level identification result is input into a hydrological prior knowledge base for multi-dimensional consistency verification. By using different types of constraint information to judge the initial water level identification result, corresponding verification results are obtained, and anomaly judgment information is generated based on the verification results of each dimension.

[0082] When the anomaly determination information indicates that the initial water level identification result meets the preset hydrological rules, the current identification result is considered to have high reliability and can be used as the basis for subsequent water level output; when the anomaly determination information indicates that the initial water level identification result does not meet the preset hydrological rules, the current identification result is considered to be affected by image interference, environmental changes or visual recognition errors, and needs to be further corrected through optimization processing.

[0083] By incorporating prior knowledge of hydrology into the visual recognition process, the above methods avoid anomaly identification caused by relying solely on image features, thereby improving the reliability and stability of water level monitoring results.

[0084] Specifically, by constraining the inference results of large models with hydrological expertise, the shortcomings of purely data-driven methods are compensated for, thereby improving the reliability and interpretability of water level identification results.

[0085] (1) Construction of hydrological prior knowledge base 1) Time-series rate of change constraint: The rate of change of water level over a short period of time is limited by physical laws, defining a maximum allowable rate of change. v max (Unit: m / s):

[0086] Where ht is the water level at time t, and Δt is the sampling interval. For conventional waterways, v maxGenerally, a value of 0.01-0.05 m / s is used; for large water bodies such as reservoirs, v max Take 0.005-0.02 m / s.

[0087] Water level difference constraints between adjacent time periods:

[0088] in δ max This is the maximum allowable water level change between adjacent frames, set according to the hydrological characteristics of the monitored water area, and is generally taken as 0.005-0.02m.

[0089] 2) Constraints imposed by the physical characteristics of the water body: Water level constraint: In a monitoring scenario without drastic disturbances, the water level should be approximately horizontal. For the detected water level point set P... wl = {(xi, yi) | i=1,...,n}, calculate the standard deviation in the vertical direction:

[0090] in = (1 / n)·Σyi is the average ordinate of the water level line, ε horizon This is the horizontal tolerance threshold (generally set to 2-5 pixels).

[0091] Water connectivity constraint: The water segmentation mask Mwater should be a single connected region, i.e., Ncomponents(Mwater) = 1. If multiple isolated regions are detected, only the connected component with the largest area is retained.

[0092] Scale spacing consistency constraint: The water gauge scale should maintain an approximately equal spacing distribution in the image. For the detected N scale line positions:

[0093] Where d k Spacing between adjacent scale marks The average spacing is denoted as .

[0094] (2) Collaborative reasoning process of large models The MobileNetV3 lightweight model, after knowledge distillation, ultimately outputs a water segmentation mask, Mwater, a binary mask with the same resolution as the original image. Water pixels have a value of 1, and non-water pixels have a value of 0. It does not directly output the water level value. The process from the mask to the final water level value is as follows: Mask preprocessing and boundary extraction: Morphological opening operations are performed on Mwater to remove noise caused by water surface reflection and floating objects; for each column x, the y-coordinate of the topmost water pixel in that column is taken. top(x)This constitutes the candidate water level line point set P = {(x,y} top(x) )}.

[0095] Robust fitting of water level line: RANSAC robust regression is used to fit an approximate horizontal straight line to P. After removing outliers, the fitting intercept is taken as the ordinate of the water level line pixel ypixel for that frame. The fitting residual is also used as the input of the water level level index σy in the following text.

[0096] Water level gauge cross-verification: If a water level gauge is present on the screen, the scale sequence and the position of the water level gauge are obtained by scale detection. The scale reading corresponding to the intersection of the water level line and the water level gauge is used as the cross-verification of the water level value.

[0097] Pixel coordinate to physical water level mapping: A multi-point calibrated pixel-physical mapping model is used, and the physical water level h is calculated from ypixel. physical This value is used as the initial inference level hSAM and is then fed into the following collaborative inference process.

[0098] It should be noted that the hydrological prior knowledge base does not participate in the forward computation of the SAM network, but is used as a post-processing constraint: the SAM first independently infers the initial water level hSAM and the water level coordinates, and then the hydrological prior rules verify it and use constraint optimization to correct abnormal results.

[0099] 1) Initial inference of the large model: Based on the output feature map, the SAM large model outputs the initial water level value hSAM and the initial water level line coordinate set; 2) Hydrological prior rule verification: Perform multi-dimensional verification on the initial inference results and construct an anomaly marker vector A = [a1,a2, a3, a4]. A is a 4-dimensional 0-1 binary vector, and the 4 elements correspond to 4 hydrological prior verification rules. If a certain rule triggers an anomaly, the corresponding position is 1, and if it is normal, it is 0.

[0100] ① Time series change rate verification: v t The current frame's water level change rate. v max Set the maximum allowable rate of change of water level; when the current rate of change of water level exceeds the threshold, the time sequence anomaly flag a1 = 1, otherwise it is 0.

[0101]

[0102] ② Verification of adjacent water level differences: h SAM To identify the water level for this frame using the SAM model, h t-1 For the effective water level of the previous frame, δ max This represents the maximum permissible difference in water levels between adjacent frames. If the absolute value of the difference in water levels between two frames exceeds the threshold, an inter-frame jump anomaly is marked as a2 = 1; otherwise, it is 0.

[0103]

[0104] ③ Water surface levelness verification: δy is the standard deviation of the longitudinal coordinate of the water surface profile, ε horizon This represents the upper limit of permissible water surface smoothness; if the standard deviation of water surface undulation exceeds the threshold, an abnormal water surface tilt / folding is marked, a3 = 1, otherwise it is 0.

[0105]

[0106] ④ Check the consistency of scale spacing: δ scalse It is the standard deviation of the water gauge graduation interval, ε scale This represents the upper limit of allowable uniformity of the scale; if the dispersion of the scale spacing exceeds the standard, the scale distortion anomaly marker a4 = 1, otherwise it is 0.

[0107]

[0108] Comprehensive anomaly determination: Sum the four anomaly markers. If the number of rules that trigger an anomaly is greater than or equal to two, the current water level identification result is determined to be an overall anomaly.

[0109] 3) Anomaly Correction Optimization. When an anomaly is detected, a constrained optimization problem is constructed to solve for the corrected water level value:

[0110] h The optimized and corrected optimal water level value is the final output of the solution to the optimization problem; argmin h To find the value of h that minimizes the overall loss function within the range of values ​​for the variable h; h is the water level variable to be optimized; h SAM The original recognition water level is obtained directly from the SAM visual model; λ1 is the weight coefficient of the temporal smoothing regularization term, with a recommended value of 0.5 to control the strength of the temporal constraint; R temporal (h) is the temporal smoothing regularization term, which constrains water level changes in adjacent frames to conform to hydrological temporal patterns; λ2 is the weight coefficient of the physical consistency regularization term, with a recommended value of 0.3, controlling the strength of the constraints on the physical characteristics of the water surface; R physical (h) is a physical consistency regularization term that constrains the water surface in the image to satisfy the physical prior of being horizontal and flat.

[0111] The time-series smoothing regularization term is as follows:

[0112] h is the water level value to be determined; h t-1 δmax is the corrected and compliant water level value from the previous frame; δmax is the maximum allowable fluctuation threshold of the water level between two adjacent frames. The physical consistency regularization term is: Rphysical(h) = max(0, σy(h) - εhorizon)² δy: Standard deviation of the longitudinal coordinates of the water surface contour in the current image, representing the degree of undulation and tilt of the water surface; εhorizon: The upper limit of the allowable standard deviation of water surface smoothness; Branch decision logic: When is_abnormal=False, the inference result of the large model is used directly: h = hSAM, which means directly using the original SAM-identified water level as the output water level.

[0113] ⑤ The solution algorithm for the anomaly correction optimization problem and h Calculation process The optimization problem is a one-dimensional constrained optimization with respect to a scalar h: the data fidelity term (h) hSAM)² is a convex quadratic function. The temporal regularization term Rtemporal(h) and the physical regularization term Rphysical(h) are both convex functions of the form max(0, ·)². Therefore, the overall objective function is a convex function within the search interval and has a unique global minimum.

[0114] The specific expression for the time-series smoothing regularization term is: Rtemporal(h) = max(0, |h ht-1| δmax)², that is, only the part exceeding the maximum allowable fluctuation δmax is subject to secondary penalty, and the water level is allowed to fluctuate freely within δmax to avoid conflict with the data fidelity term; in the physical consistency regularization term, σy(h) is the longitudinal standard deviation of the water surface recalculated based on the water level line corresponding to the candidate water level h.

[0115] The optimization solution employs a one-dimensional search using the golden section method, with the search interval limited to [hSAM]. The convergence condition is that the interval length is less than 1×10[δmax, hSAM + δmax]. -4 m, accuracy 0.001m.

[0116] h The specific calculation process is as follows: Input the initial inference water level hSAM of SAM, the corrected water level of the previous frame ht-1, and the current longitudinal standard deviation of the water surface σy; If the comprehensive anomaly determination is_abnormal = False, then h = hSAM, skip optimization; If is_abnormal = True, let the search interval be [hSAM]. δmax, hSAM + δmax]; Minimize the objective function F(h) = (h) using the golden section method hSAM)² + λ1·R temporal (h) + λ2·Rphysical(h) yields the optimal water level h. ; Output hinitial = h And calculate confidence according to the confidence formula.

[0117] 4) Output the initial value and confidence level of the compliant water level: h initial = h

[0118]

[0119] h initial The final compliant corrected water level initial value output is equal to the optimal water level obtained by optimization. in, Here, is the global normalization parameter, and confidence ∈ (0,1] represents the confidence level of this inference.

[0120] As a further optional embodiment, the step of correcting the initial water level identification result using a constrained optimization model to obtain the target water level result when the initial water level identification result does not meet the preset hydrological law specifically includes: When the anomaly determination information corresponding to the initial water level identification result meets the preset anomaly conditions, the initial water level identification result, historical water level information, and current water body physical characteristic information are obtained. Based on the initial water level identification result, a data consistency constraint term is constructed. The data consistency constraint term is used to maintain the closeness between the corrected water level result and the visual identification result. Based on the historical water level information, a time-series change constraint term is constructed, which is used to limit the deviation between the corrected water level result and the historical water level change trend. Based on the physical characteristics of the water body, a physical consistency constraint term is constructed. The physical consistency constraint term is used to constrain the corrected water level result to meet the water surface structure characteristics. The constraint optimization model is constructed based on the data consistency constraint, time series change constraint, and physical consistency constraint, and the initial water level identification result is optimized and solved to obtain the target water level result that satisfies the constraints of visual recognition result, hydrological change law, and water body physical characteristics.

[0121] In this embodiment, when the anomaly determination information corresponding to the initial water level identification result meets the preset anomaly conditions, it indicates that the water level result obtained by the current visual recognition may be affected by environmental interference, image quality changes, or model recognition errors, and cannot be directly used as the final water level output result. Therefore, the initial water level identification result, historical water level information, and current water body physical characteristic information are further obtained, and the anomaly identification result is optimized and corrected based on the above information.

[0122] Specifically, a data consistency constraint term is first constructed based on the initial water level identification result to characterize the correlation between the optimized water level result and the initial identification result of the visual model, so that the optimization process can avoid excessive deviation between the corrected result and the original identification result while retaining the visual recognition information.

[0123] Furthermore, a time-series change constraint term is constructed based on the historical water level information. By analyzing the water level change trend between historical monitoring time and current monitoring time, a time-series constraint is applied to the water level result to be corrected, so that the optimized water level result conforms to the long-term water level change pattern of the target monitoring area, reducing abnormal water level jumps caused by single-frame recognition errors.

[0124] Meanwhile, physical consistency constraints are constructed based on the current physical characteristics of the water body. By utilizing the structural characteristics of the water body itself to restrict the water level results to be corrected, the corrected water level results conform to the actual water body morphological change patterns, thereby improving the physical rationality of the water level results.

[0125] Furthermore, the data consistency constraint, time-series change constraint, and physical consistency constraint are combined to construct a constraint optimization model, and the target water level that satisfies multiple constraint conditions is obtained by solving the constraint optimization model.

[0126] By using the above method, when the visual recognition results are abnormal, the output results of the visual model are not directly discarded. Instead, the visual information, hydrological change patterns, and water body physical characteristics are combined for joint optimization, so that the final target water level results have higher accuracy and stability. This can effectively reduce the impact of visual recognition errors on water level monitoring results in complex environments.

[0127] As a further optional embodiment, the step of performing time-series consistency optimization on the target water level results at consecutive time points, and converting the optimized water level results into corresponding physical water level values ​​and outputting them according to the pre-established mapping relationship between image coordinates and physical water levels, specifically includes: Obtain the target water level results corresponding to multiple consecutive monitoring times, and construct time-series feature information based on the water level change relationship between adjacent times; Based on the time-series feature information, the consistency of the target water level result is verified, and a time-series smoothing method is used to reduce the impact of random fluctuations and abnormal jumps on the water level result, so as to obtain an optimized stable water level result. Obtain the pre-established mapping relationship between image coordinates and physical water level, the mapping relationship being established based on the water level boundary position in the image and the corresponding actual water level calibration information; Based on the mapping relationship, the image coordinates corresponding to the optimized stable water level result are converted into physical water level values, and the physical water level values ​​are output as monitoring results.

[0128] In this embodiment, to further improve the stability of water level monitoring results during continuous operation, time-series consistency optimization processing is performed on the target water level results corresponding to multiple continuous monitoring times. Specifically, the target water level results corresponding to multiple continuous monitoring times within a preset time range are obtained, and time-series feature information is constructed based on the water level change relationship between adjacent monitoring times to characterize the continuity and trend of water level changes over time.

[0129] Furthermore, the consistency of the target water level results at each monitoring time is verified based on the time-series feature information, and the abnormal fluctuations in water level changes between adjacent time points are analyzed. When discontinuous changes in water level results due to image acquisition errors, environmental interference, or visual recognition errors are detected, a time-series smoothing process is used to optimize the target water level results, making the water level changes between adjacent time points more consistent with the actual hydrological change patterns, thereby obtaining optimized stable water level results.

[0130] After obtaining stable water level results, a pre-established mapping relationship between image coordinates and physical water levels is acquired. This mapping relationship describes the correspondence between water level boundary positions in image space and actual physical water level values, and it can be established based on known water level calibration information and corresponding image coordinate information in the target monitoring area.

[0131] Furthermore, based on the mapping relationship, the image coordinates corresponding to the optimized stable water level result are converted into actual physical water level values, and the converted physical water level values ​​are output as the final water level monitoring result of the target monitoring area.

[0132] By using the above method, the water level results obtained from visual recognition are continuously optimized over time. Combined with the conversion relationship between image coordinates and physical water level, an accurate mapping from image recognition results to actual hydrological parameters is achieved. This reduces the impact of single-frame recognition errors on the final output results and improves the continuity, accuracy, and reliability of water level monitoring data.

[0133] Specifically, based on the temporal continuity of water level changes, temporal smoothing optimization is performed on the single-frame detection results to eliminate random errors and abnormal jumps.

[0134] (1) Sliding window weighted filtering A 5-frame sliding window was used to perform weighted smoothing on the water level sequence:

[0135] The weighting function adopts an exponential decay form:

[0136] λ is the attenuation coefficient (recommended value: 0.3-0.5), which makes recent frames have a larger weight and distant frames have a smaller weight.

[0137] : The output water level of frame t after weighted smoothing by a sliding window of 5 frames; t: Current target frame number; i: Frame index within the sliding window, window range [t-4, t], total 5 frames; ti: The number of frames between the current frame t and the historical frame i; : The original water level identified in the i-th frame within the window; : The exponential decay weight corresponding to the i-th frame; The numerator is the weighted sum of all frame water levels within the window multiplied by their corresponding weights, and the denominator is the sum of all weights within the window. Normalization is performed to ensure that the dimensions of the output water level remain unchanged. (2) Time series feature verification matrix Extract the temporal features of water level boundaries from K consecutive frames (K=5) and construct a verification matrix:

[0138] Where Δhi = hi - hi-1 is the water level change of the i-th frame relative to the previous frame; T is the matrix transpose symbol.

[0139] Calculate the timing consistency index:

[0140] Where σΔh is the standard deviation of the 5-frame water level change sequence, representing the degree of dispersion of water level fluctuations; μΔh,max is the preset maximum allowable water level fluctuation amplitude; the closer C_temporal is to 1, the better the temporal consistency.

[0141] (3) Mutation detection and correction When the absolute value of the difference between the current frame's smooth water level and the previous frame's smooth water level is detected to be greater than the abrupt change threshold (| t- t-1|>θ, where θ is the mutation threshold, typically taken as 3σΔh), and constraint correction is performed:

[0142] Where sign(Δh) represents the direction of change, and min(|Δh|, θ) limits the magnitude of change to a reasonable range.

[0143] (4) Time series stability assessment The Nash efficiency coefficient (NSE) is used to evaluate the time series stability.

[0144] in: NSE: Nash efficiency coefficient, NSE ∈ (-∞, 1], the closer to 1, the better the time series fit, and it is used to quantitatively evaluate the time series fit effect between the algorithm output water level and the actual water level; T: Total number of time frames involved in the evaluation; The actual water level measured manually or by instruments in frame t; The predicted water level output after algorithm smoothing and correction; The average of the actual water levels over all time periods; The numerator is the sum of squared residuals between the algorithm's predicted values ​​and the actual values, representing the total error of the model. The denominator is the total variance of the actual water level itself, representing the baseline error of predicting directly using the mean without using the model.

[0145] 2.5 Water Level Quantification and Output The optimized water level boundary pixel coordinates are converted into standard water level physical values, and the data is output.

[0146] (1) Pixel-physical coordinate mapping model Establish the mapping relationship between pixel coordinates and physical water level through water gauge calibration:

[0147] in: h physical The output is the standard physical water level value (m); h ref The physical water level (m) is known at the reference point; y ref The reference point is represented by its pixel ordinate in the image. y pixel To optimize the pixel ordinates obtained from the water surface boundary detection; k is the pixel-to-physical conversion calibration coefficient, in m / pixel, expressed as the physical distance Δh between two known graduations on the water gauge. known Distance Δy from pixels pixel Calculated.

[0148]

[0149] To improve calibration accuracy, multi-point calibration least squares fitting is used:

[0150] in: m is the total number of calibration points involved in the fitting (m≥5), and multi-point fitting suppresses single-point calibration error; (yi, hi) represents the image pixel ordinate of the i-th calibration point and the actual physical water level value corresponding to the i-th calibration point; The average pixel coordinates of all calibration points; The average physical water level at all calibration points; (2) Millimeter-level water level quantification h final = round(h physical , 3) h physical : The original floating-point physical water level (in meters) obtained from pixel-physical mapping; round(.,3): Rounds the integer to 3 decimal places; h final The final output is a standard water level in millimeters, accurate to the millimeter (0.001m).

[0151] The accuracy of quantification is assessed using the mean absolute error.

[0152] MAE: Mean Absolute Error, in meters, used to quantify the overall deviation between the water level prediction algorithm and the actual value. N: Total number of sample frames used in accuracy evaluation; i: Sample index, traversing all N sets of data; The output water level hfinal is the quantized water level of the i-th sample group. The true water level of the i-th sample, measured manually or by instrument. As a further optional embodiment, the lightweight visual recognition model is obtained by training through a pre-built multimodal training sample library; The multimodal training sample library includes water level image data, hydrological monitoring data, and environmental parameter data collected under different environmental conditions. The environmental conditions include at least normal scenes, strong light scenes, water surface reflection scenes, shading scenes, rain and snow scenes, and foggy scenes.

[0153] In this embodiment, in order to improve the adaptability of the lightweight visual recognition model in different aquatic environments, a multimodal training sample library is pre-constructed, and the lightweight visual recognition model is trained using the multimodal training sample library.

[0154] Specifically, the multimodal training sample library is used to store water level image data, hydrological monitoring data, and environmental parameter data collected under different monitoring environments. The water level image data is used to characterize the visual features of the target water body area under different environmental conditions; the hydrological monitoring data is used to reflect the water level change status of the target monitoring area; and the environmental parameter data is used to describe the external environmental factors affecting the quality of water level image acquisition and water level changes.

[0155] When constructing the multimodal training sample library, sample data containing different environmental conditions are collected to address the complex environmental situations that may occur during actual water conservancy monitoring. These environmental conditions include, but are not limited to, normal monitoring scenarios, strong light irradiation scenarios, water surface reflection scenarios, target area obstruction scenarios, rain and snow weather scenarios, and foggy weather scenarios. By introducing sample data under different environmental conditions, the training samples can cover a variety of interference factors that may occur during actual monitoring.

[0156] Furthermore, the lightweight visual recognition model is trained using the multimodal training sample library, enabling the lightweight visual recognition model to learn the correspondence between water areas, water level boundaries, and related auxiliary features under different environmental conditions, thereby improving the model's feature extraction capability for complex water scenes.

[0157] By using the above methods, the model is trained with multimodal training samples covering various typical interference environments, enabling the lightweight visual recognition model to have better scene adaptability and generalization ability, reducing the problem of recognition performance degradation caused by changes in the monitoring environment, and improving the stability of the water level monitoring system in practical applications.

[0158] The following describes the water level monitoring device based on a visual model provided by the present invention, such as... Figure 2 As shown, the visual model-based water level monitoring device described below and the visual model-based water level monitoring method described above can be referred to in correspondence.

[0159] A water level monitoring device based on a visual model includes: The data acquisition module is used to acquire multimodal monitoring data of the target monitoring area, including water level image data, hydrological monitoring data, and environmental parameter data. The data processing module is used to preprocess the multimodal monitoring data and perform time-series correlation based on the acquisition time of different types of monitoring data to obtain the fused monitoring data at the corresponding time. The preliminary identification module is used to input the fused monitoring data into a pre-trained lightweight visual recognition model to identify the water level boundary of the target water body area and obtain the initial water level identification result. The lightweight visual recognition model is obtained by lightweighting the basic visual model. The constraint verification module is used to perform constraint verification on the initial water level identification result based on pre-constructed hydrological prior knowledge, so as to determine whether the initial water level identification result meets the preset hydrological rules. The result correction module is used to correct the initial water level identification result by means of a constraint optimization model when the initial water level identification result does not meet the preset hydrological law, so as to obtain the target water level result. The constraint optimization model is constructed by means of the initial water level identification result, historical water level information and water body physical characteristics. The result optimization module is used to optimize the temporal consistency of the target water level results at consecutive time intervals, and convert the optimized water level results into corresponding physical water level values ​​and output them according to the pre-established mapping relationship between image coordinates and physical water levels.

[0160] Figure 3 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 3 As shown, the electronic device may include: a processor 310, a communications interface 320, a memory 330, and a communication bus 340, wherein the processor 310, the communications interface 320, and the memory 330 communicate with each other via the communication bus 340. The processor 310 can call logical instructions in the memory 330 to execute a visual model-based water level monitoring method, which includes: Acquire multimodal monitoring data of the target monitoring area, including water level image data, hydrological monitoring data, and environmental parameter data; The multimodal monitoring data is preprocessed, and time-series correlation is performed based on the acquisition time of different types of monitoring data to obtain the fused monitoring data at the corresponding time. The fused monitoring data is input into a pre-trained lightweight visual recognition model to identify the water level boundary of the target water body area and obtain the initial water level recognition result. The lightweight visual recognition model is obtained by lightweighting the basic visual model. Based on pre-constructed hydrological prior knowledge, the initial water level identification result is constrained and verified to determine whether the initial water level identification result meets the preset hydrological rules. When the initial water level identification result does not meet the preset hydrological law, the initial water level identification result is corrected by a constraint optimization model to obtain the target water level result. The constraint optimization model is constructed based on the initial water level identification result, historical water level information, and water body physical characteristics. The target water level results at consecutive time points are optimized for temporal consistency. Based on the pre-established mapping relationship between image coordinates and physical water levels, the optimized water level results are converted into corresponding physical water level values ​​and output.

[0161] Furthermore, the logical instructions in the aforementioned memory 330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0162] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program that can be stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer is able to execute the visual model-based water level monitoring method provided by the above methods, the method comprising: Acquire multimodal monitoring data of the target monitoring area, including water level image data, hydrological monitoring data, and environmental parameter data; The multimodal monitoring data is preprocessed, and time-series correlation is performed based on the acquisition time of different types of monitoring data to obtain the fused monitoring data at the corresponding time. The fused monitoring data is input into a pre-trained lightweight visual recognition model to identify the water level boundary of the target water body area and obtain the initial water level recognition result. The lightweight visual recognition model is obtained by lightweighting the basic visual model. Based on pre-constructed hydrological prior knowledge, the initial water level identification result is constrained and verified to determine whether the initial water level identification result meets the preset hydrological rules. When the initial water level identification result does not meet the preset hydrological law, the initial water level identification result is corrected by a constraint optimization model to obtain the target water level result. The constraint optimization model is constructed based on the initial water level identification result, historical water level information, and water body physical characteristics. The target water level results at consecutive time points are optimized for temporal consistency. Based on the pre-established mapping relationship between image coordinates and physical water levels, the optimized water level results are converted into corresponding physical water level values ​​and output.

[0163] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the visual model-based water level monitoring method provided by the methods described above, the method comprising: Acquire multimodal monitoring data of the target monitoring area, including water level image data, hydrological monitoring data, and environmental parameter data; The multimodal monitoring data is preprocessed, and time-series correlation is performed based on the acquisition time of different types of monitoring data to obtain the fused monitoring data at the corresponding time. The fused monitoring data is input into a pre-trained lightweight visual recognition model to identify the water level boundary of the target water body area and obtain the initial water level recognition result. The lightweight visual recognition model is obtained by lightweighting the basic visual model. Based on pre-constructed hydrological prior knowledge, the initial water level identification result is constrained and verified to determine whether the initial water level identification result meets the preset hydrological rules. When the initial water level identification result does not meet the preset hydrological law, the initial water level identification result is corrected by a constraint optimization model to obtain the target water level result. The constraint optimization model is constructed based on the initial water level identification result, historical water level information, and water body physical characteristics. The target water level results at consecutive time points are optimized for temporal consistency. Based on the pre-established mapping relationship between image coordinates and physical water levels, the optimized water level results are converted into corresponding physical water level values ​​and output.

[0164] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0165] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0166] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A water level monitoring method based on a visual model, characterized in that, include: Acquire multimodal monitoring data of the target monitoring area, including water level image data, hydrological monitoring data, and environmental parameter data; The multimodal monitoring data is preprocessed, and time-series correlation is performed based on the acquisition time of different types of monitoring data to obtain the fused monitoring data at the corresponding time. The fused monitoring data is input into a pre-trained lightweight visual recognition model to identify the water level boundary of the target water body area and obtain the initial water level recognition result. The lightweight visual recognition model is obtained by lightweighting the basic visual model. Based on pre-constructed hydrological prior knowledge, the initial water level identification result is constrained and verified to determine whether the initial water level identification result meets the preset hydrological rules. When the initial water level identification result does not meet the preset hydrological law, the initial water level identification result is corrected by a constraint optimization model to obtain the target water level result. The constraint optimization model is constructed based on the initial water level identification result, historical water level information, and water body physical characteristics. The target water level results at consecutive time points are optimized for temporal consistency. Based on the pre-established mapping relationship between image coordinates and physical water levels, the optimized water level results are converted into corresponding physical water level values ​​and output.

2. The water level monitoring method based on a visual model according to claim 1, characterized in that, The step of preprocessing the multimodal monitoring data and performing time-series correlation based on the acquisition time of different types of monitoring data to obtain fused monitoring data at the corresponding time points specifically includes: The water level image data is subjected to image enhancement processing; The hydrological monitoring data and environmental parameter data are subjected to data standardization processing; Acquire the collection time information corresponding to the water level image data, hydrological monitoring data, and environmental parameter data. Using the collection time of the water level image data as a benchmark, perform time matching on monitoring data with different sampling frequencies to obtain associated data corresponding to the time of the water level image data. The preprocessed water level image data, time-series correlated hydrological monitoring data, and environmental parameter data are fused to obtain the fused monitoring data.

3. The water level monitoring method based on a visual model according to claim 1, characterized in that, The step of inputting the fused monitoring data into a pre-trained lightweight visual recognition model to identify the water level boundary of the target water body area and obtain the initial water level recognition result specifically includes: High-dimensional visual feature information is obtained by extracting features from the fused monitoring data using a visual basic model, and a teacher model is constructed based on the feature expression capability of the visual basic model. A student model is constructed using a lightweight network structure, and the visual feature information in the teacher model is transferred to the student model through knowledge distillation to obtain the lightweight visual recognition model. The fused monitoring data is input into the lightweight visual recognition model, and the corresponding water body area segmentation result is obtained by extracting features and semantic segmentation of the target water body area. The location of the water body boundary is determined based on the water body region segmentation result, and the initial water level identification result is obtained based on the location of the water body boundary.

4. The water level monitoring method based on a visual model according to claim 1, characterized in that, The step of constraining and validating the initial water level identification result based on pre-constructed hydrological prior knowledge to determine whether the initial water level identification result meets the preset hydrological rules specifically includes: Obtain a pre-constructed hydrological prior knowledge base, which includes water level time series change constraint information, water level change amplitude constraint information, and water body structure feature constraint information; Based on the hydrological prior knowledge base, the initial water level identification result is subjected to multi-dimensional consistency verification. The water level time-series change constraint information is used to determine whether there are abnormal fluctuations in the initial water level identification result based on the relationship between the water level changes at the current time and historical times; the water level change amplitude constraint information is used to determine whether the water level change between adjacent monitoring times exceeds a preset change range; and the water body structure feature constraint information is used to determine whether the initial water level identification result conforms to the physical characteristics of the water body based on the water surface flatness, water body connectivity, and / or the consistency of the water gauge scale. Anomaly determination information is generated based on the consistency verification results of each dimension, and the anomaly determination information is used to determine whether the initial water level identification result meets the preset hydrological rules.

5. The water level monitoring method based on a visual model according to claim 1, characterized in that, The step of correcting the initial water level identification result using a constrained optimization model to obtain the target water level result when the initial water level identification result does not meet the preset hydrological law specifically includes: When the anomaly determination information corresponding to the initial water level identification result meets the preset anomaly conditions, the initial water level identification result, historical water level information, and current water body physical characteristic information are obtained. Based on the initial water level identification result, a data consistency constraint term is constructed. The data consistency constraint term is used to maintain the closeness between the corrected water level result and the visual identification result. Based on the historical water level information, a time-series change constraint term is constructed, which is used to limit the deviation between the corrected water level result and the historical water level change trend. Based on the physical characteristics of the water body, a physical consistency constraint term is constructed. The physical consistency constraint term is used to constrain the corrected water level result to meet the water surface structure characteristics. The constraint optimization model is constructed based on the data consistency constraint, time series change constraint, and physical consistency constraint, and the initial water level identification result is optimized and solved to obtain the target water level result that satisfies the constraints of visual recognition result, hydrological change law, and water body physical characteristics.

6. The water level monitoring method based on a visual model according to claim 1, characterized in that, The step of optimizing the target water level results for consecutive time intervals based on temporal consistency, and converting the optimized water level results into corresponding physical water level values ​​and outputting them according to the pre-established mapping relationship between image coordinates and physical water levels, specifically includes: Obtain the target water level results corresponding to multiple consecutive monitoring times, and construct time-series feature information based on the water level change relationship between adjacent times; Based on the time-series feature information, the consistency of the target water level result is verified, and a time-series smoothing method is used to reduce the impact of random fluctuations and abnormal jumps on the water level result, so as to obtain an optimized stable water level result. Obtain the pre-established mapping relationship between image coordinates and physical water level, the mapping relationship being established based on the water level boundary position in the image and the corresponding actual water level calibration information; Based on the mapping relationship, the image coordinates corresponding to the optimized stable water level result are converted into physical water level values, and the physical water level values ​​are output as monitoring results.

7. The water level monitoring method based on a visual model according to claim 1, characterized in that, The lightweight visual recognition model is obtained by training a pre-built multimodal training sample library; The multimodal training sample library includes water level image data, hydrological monitoring data, and environmental parameter data collected under different environmental conditions. The environmental conditions include at least normal scenes, strong light scenes, water surface reflection scenes, shading scenes, rain and snow scenes, and foggy scenes.

8. A water level monitoring device based on a visual model, characterized in that, include: The data acquisition module is used to acquire multimodal monitoring data of the target monitoring area, including water level image data, hydrological monitoring data, and environmental parameter data. The data processing module is used to preprocess the multimodal monitoring data and perform time-series correlation based on the acquisition time of different types of monitoring data to obtain the fused monitoring data at the corresponding time. The preliminary identification module is used to input the fused monitoring data into a pre-trained lightweight visual recognition model to identify the water level boundary of the target water body area and obtain the initial water level identification result. The lightweight visual recognition model is obtained by lightweighting the basic visual model. The constraint verification module is used to perform constraint verification on the initial water level identification result based on pre-constructed hydrological prior knowledge, so as to determine whether the initial water level identification result meets the preset hydrological rules. The result correction module is used to correct the initial water level identification result by means of a constraint optimization model when the initial water level identification result does not meet the preset hydrological law, so as to obtain the target water level result. The constraint optimization model is constructed by means of the initial water level identification result, historical water level information and water body physical characteristics. The result optimization module is used to optimize the temporal consistency of the target water level results at consecutive time intervals, and convert the optimized water level results into corresponding physical water level values ​​and output them according to the pre-established mapping relationship between image coordinates and physical water levels.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the visual model-based water level monitoring method as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the visual model-based water level monitoring method as described in any one of claims 1 to 7.