Intelligent water level early warning method for water conservancy project
By collecting real-time water level images in water conservancy projects, building a water level line identification model, and calculating the wave stability coefficient and change coefficient, and adjusting the water level line data with the trend coefficient weighted, the water level measurement problem caused by dynamic water surface fluctuations is solved, and a high-accurate intelligent water level warning is achieved.
Patent Information
- Application Number
- CN202510667804.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2045-05-23
AI Technical Summary
Dynamic water surface fluctuations make it difficult to reflect the true average water level, and existing time-series prediction models are difficult to accurately describe the characteristics of water surface changes, resulting in early warning lag or increased false alarm rates.
By collecting real-time water level images, building a water level line recognition model, obtaining real-time water level lines, calculating wave stability coefficients and change coefficients, and adjusting water level line data with the trend coefficient weight to achieve intelligent water level warning.
Through dynamic water surface stability evaluation and trend coefficient weighting treatment, the robustness and accuracy of water level warning are improved and the false alarm rate is reduced.
Smart Images

Figure CN120183144A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water level early warning, and particularly to an intelligent water level early warning method for water conservancy projects. Background Art
[0002] Water level monitoring in water conservancy projects is an important basis for flood control and disaster reduction, water resource scheduling, and the safe operation of projects. With the development of computer vision technology, non-contact water level monitoring based on images has gradually become a research hotspot. However, the dynamic fluctuation of the water surface makes it difficult to reflect the true average water level.
[0003] Existing methods introduce time series prediction algorithms to compensate for the fluctuation error by establishing a water surface motion model. However, due to the non-stationary characteristics of the water surface fluctuation, it is difficult to accurately describe the water surface change characteristics through the time series prediction model, resulting in a lag in early warning or an increase in false alarm rate in the continuous rising and falling water conditions. Summary of the Invention
[0004] To solve the technical problem that it is difficult to obtain effective water level measurement results due to the dynamic fluctuation of the water surface, the present invention provides solutions in the following aspects.
[0005] In a first aspect, an intelligent water level early warning method for water conservancy projects includes: Collect the real-time water level image at the first moment, obtain the abscissa value of the warning line in the real-time water level image, construct a water level line recognition model, and use the water level line recognition model to obtain the real-time water level line; Continuously collect the real-time water level lines at multiple moments, obtain the volatility of the real-time water level lines, and calculate the wave stability coefficient at each moment; Perform linear fitting on the real-time water level line at each moment to obtain the linear fitting result at each moment, and obtain the change coefficient at each moment according to the change of the linear fitting results at consecutive moments; Obtain the trend coefficient at the first moment according to the trend of the change coefficients at consecutive moments; Obtain the average value of the abscissa values of the real-time water level line, adjust the average value of the abscissa values of the real-time water level line data with the trend coefficient as the weight to obtain the water level line measurement value, and complete the intelligent water level early warning method according to the water level line measurement value.
[0006] Preferably, the abscissa value of the warning line in the real-time water level image includes: Use the checkerboard calibration method to perform spatial calibration on the camera between the camera coordinate system and the real-world coordinate system to obtain the abscissa value of the warning line in the real world in the camera imaging.
[0007] Preferably, the real-time water level line includes: Collect the water level line by setting an RGB camera above the water surface to obtain a real-time water level image. Input the collected real-time water level image into the trained water level line recognition model to obtain the recognition result of the water level line, and preprocess the recognition result of the water level line to obtain the real-time water level line.
[0008] Preferably, the wave stability coefficient includes: Obtain the upper envelope sequence and the lower envelope sequence of the real-time water level line, calculate the variance values corresponding to the abscissa data in the upper envelope sequence and the lower envelope sequence respectively, and obtain the mean value of the two variances as the wave stability coefficient for collecting the real-time water level line.
[0009] Preferably, the change coefficient at each moment includes: Perform linear fitting on the real-time water level line at each moment to obtain the linear fitting result at each moment, and calculate the change coefficient of the linear fitting results corresponding to the real-time water level images at two consecutive moments: ; Denote the traversal of the value; is the linear fitting result at the moment; is the slope value of the corresponding linear fitting function ; is the linear fitting result at the moment; is the slope value of the corresponding linear fitting function ; Denote the cosine similarity between; is the step function; Take as the change coefficient at the moment to obtain the change coefficient at each moment.
[0010] Preferably, the trend coefficient at the first moment includes: After decomposing the change coefficient at each moment obtained by using the STL algorithm, obtain the trend term in the STL decomposition result; Obtain the change coefficient at each moment, obtain the wave stability coefficient at each moment, and normalize the reciprocal of the wave stability coefficients at all collected moments; Use the normalized value of the wave stability coefficient at each moment to perform linear weighted fitting on the change coefficient at each moment to obtain the fitted linear function, and obtain the slope value of the linear function; Obtain the angle value corresponding to the slope value, calculate the ratio of this angle value to 90 degrees, multiply the ratio by a hyperparameter to adjust the ratio, and use 1 minus the adjusted ratio as the trend coefficient at the first moment.
[0011] Preferably, the normalization includes: Obtain the sum of the reciprocals of the wave stability coefficients collected at all moments, calculate the ratio of the reciprocal of the wave stability coefficient at each moment to the sum of the reciprocals of all wave stability coefficients as the normalized value of the wave stability coefficient at each moment. The numerator of the ratio is the reciprocal of the wave stability coefficient at each moment, and the denominator is the sum of the reciprocals of the wave stability coefficients at all moments.
[0012] Preferably, the water level intelligent warning includes: Calculate the abscissa mean of the water level line data at the first moment, multiply the obtained abscissa mean by the trend coefficient at the first moment to obtain the water level line measurement result in the image; When the water level line measurement result in the image is less than the abscissa value corresponding to the warning line, water situation alarm is carried out to complete the water level intelligent warning method.
[0013] Compared with the prior art, the water level intelligent warning method for water conservancy projects in the embodiments of the present invention has the beneficial effects that: The present invention dynamically evaluates the water surface stability: by quantifying the degree of water surface fluctuation, proposing a wave stability coefficient, and weighted combining the trend change of the horizontal plane to calculate the trend coefficient, so as to obtain a stable and effective water surface measurement result and improve the robustness of water level warning. Description of the Drawings
[0014] Figure 1 is the flowchart of the method from step S1 to step S5 in the water level intelligent warning method for water conservancy projects in the embodiments of the present invention. Detailed Embodiments
[0015] The following combines the drawings and embodiments to further describe in detail the specific embodiments of the present invention. The following embodiments are used to illustrate the present invention, but not to limit the scope of the present invention.
[0016] As Figure 1 shown, a water level intelligent warning method for water conservancy projects in the preferred embodiment of the embodiments of the present invention is as follows:
[0017] S1: Collect the real-time water level image at the first moment, obtain the abscissa value of the warning line in the real-time water level image, construct a water level line recognition model, and use the water level line recognition model to obtain the real-time water level line.
[0018] In one embodiment, an RGB camera is set above the water surface to collect the water level line. To ensure that the RGB camera can collect the water level line, when setting the RGB camera, the RGB camera is directly facing the junction of the sea surface and the water level scale, so that the RGB camera can capture the water level scale and the water surface.
[0019] After the RGB camera collects the real-time water level image, it transmits the collected image to the data processing center through wireless transmission to obtain the collected real-time water level image. Among them, the corresponding moment of the latest real-time water level image collected in real time is the first moment.
[0020] When using a camera for water level warning in a water conservancy project, it is necessary to calibrate the camera coordinate system and the real-world coordinate system using the checkerboard calibration method, and then obtain the abscissa value of the warning line in the real world in the camera imaging. In the collected real-time water level image, the upper left corner is used as the origin of the image coordinates, the vertical direction is the abscissa, and the horizontal direction from left to right is the ordinate.
[0021] Build an instance segmentation model as the water level line recognition model. The instance segmentation model can choose to use instance segmentation network models such as the fast-rcnn network model and the u-net network model. When the instance segmentation model performs water level line recognition, it is pixel-level image segmentation and recognition. Therefore, when constructing the dataset of the water level line recognition model, the pixel points belonging to the water level line in the dataset are marked as 1, and the pixel points not belonging to the water level line are marked as 0. After completing the dataset annotation, the annotated dataset is used to train the instance segmentation model to obtain the trained water level line recognition model. Among them, the training process of the instance segmentation model is well-known content and will not be elaborated in this invention.
[0022] Input the real-time water level image at the first moment into the trained water level line recognition model to obtain the recognition result of the water level line at the first moment, and obtain the coordinate sequence of the pixel points belonging to the water level line in the recognition result of the water level line at the first moment , where t represents the t-th moment, and the first moment is the latest moment, so t = 1, is the coordinate sequence of the water level line pixel points at the t-th moment, so is a two-dimensional data, which consists of the abscissa and ordinate of each pixel point belonging to the water level pixel points.
[0023] Since in water level line recognition, the water level line is often difficult to distinguish, which will lead to the problem that multiple ordinates correspond to the same abscissa value. Therefore, when there are multiple ordinates corresponding to the same abscissa value, the mean value of the multiple ordinate values in the same abscissa value is calculated as the unique mean value corresponding to a single abscissa, and used as the ordinate corresponding to this abscissa, to obtain the abscissa and ordinate sequence with a one-to-one correspondence between the abscissa and the ordinate, denoted as .
[0024] For data preprocessing is performed to obtain a complete and smooth water level line. Specifically: for data interpolation is performed using the least squares method so that when the water level line is missing, the missing water level line data can be filled, and then the interpolated abscissa and ordinate are obtained. The interpolated abscissa and ordinate are smoothed using mean filtering to obtain the smoothed abscissa and ordinate, which are used as the real-time water level line at the t-th moment , is the real-time water level line data sequence of the current real-time water level image, so is a two-dimensional data Each data point in consists of an abscissa and an ordinate with a one-to-one correspondence
[0025] S2: Continuously collect the real-time water level lines at multiple moments, obtain the volatility of the real-time water level line, and calculate the wave stability coefficient at each moment
[0026] In one embodiment, after obtaining , since when measuring the water level, the water level is not necessarily stable but in a continuous fluctuating state. If the mean value of the ordinates in is directly used as the water level measurement result, there are often large measurement errors when the water surface is not calm, thus affecting the accuracy of water level warning in water conservancy projects
[0027] In order to reduce the influence of the unstable state of the water surface on water level measurement, the stable state of the water surface can be evaluated and weighted according to the overall change trend of the water surface, so that when measuring the water surface, a stable water level measurement result can be obtained to improve the accuracy of water level measurement
[0028] For using the peak point detection method, the peak sequence and valley sequence of are obtained. The first data point and the last data point in and the corresponding peak sequence form the upper envelope sequence of .
[0029] The first data point and the last data point in and the corresponding valley sequence form the lower envelope sequence of .
[0030] After obtaining the upper envelope sequence and the lower envelope sequence of the real-time water level line at the tth moment, since the water surface appears wavy when it moves irregularly, the mean of the two variance values corresponding to the two envelope sequences in the upper envelope sequence and the lower envelope sequence of the real-time water level line are calculated as the wave stability coefficient of the real-time water level image, which represents the water surface stability assessment result.
[0031] Get and The variance values corresponding to the horizontal coordinate data and ,calculate and The mean of the two variances is used as the wave stability coefficient at the current moment t .
[0032] S3: Perform linear fitting on the real-time water level line at each moment to obtain the linear fitting result at each moment, and obtain the variation coefficient at each moment according to the change of the linear fitting result at consecutive moments.
[0033] In one embodiment, after the wave stability coefficient of the real-time water level image is obtained, since the water surface fluctuation is unstable, when performing water level measurement for water level warning, a stable water level measurement result is required to improve the stability of the water level warning.
[0034] The overall trend change of the water surface can be obtained, and the overall trend change is weighted according to the wave stability coefficient to obtain a stable water level change trend. According to the water level change trend, a stable water level measurement result is obtained.
[0035] In order to obtain a stable horizontal plane at time t, the real-time water level at time t is Perform linear fitting as the stable horizontal plane at the tth moment, so The least squares method is used for linear fitting to obtain the fitting function ,Will Substitute the horizontal coordinates in the fitting function The linear fitting result is .in, is a slope-intercept function with a slope value and the intercept Because the water surface is not actually horizontal when it is moving. Although linear, It is not parallel to the absolute horizontal line, which makes it impossible to directly Used to calculate water surface measurement results, and then for accurate water surface measurement based on stable water surface changes.
[0036] Obtain the linear fitting result at the previous moment, where an empirical value of 20 is taken, which can be adjusted by the implementer according to the specific implementation manner.
[0037] In order to obtain the change in the linear fitting results corresponding to the real-time water level images at two consecutive moments, indicating the overall upward or downward trend of the water surface.
[0038] Calculate the change coefficient of the linear fitting results corresponding to the real-time water level images at two consecutive moments, where the and change coefficient of the linear fitting results corresponding to the real-time water level images at two consecutive moments : Indicates the traversal of the value, so the value range of the value is
[0039] is the linear fitting result at the moment, representing the flat horizontal plane corresponding to the real-time water level image collected at the moment.
[0040] is the corresponding linear fitting function slope value, representing the inclination of the flat horizontal plane corresponding to the real-time water level image collected at the moment.
[0041] is the linear fitting result at the moment, representing the flat horizontal plane corresponding to the real-time water level image collected at the
[0042] is the corresponding linear fitting function slope value, representing the inclination of the flat horizontal plane corresponding to the real-time water level image collected at the moment.
[0043] Indicates the cosine similarity between indicating the similarity of two sets of data sequences between the larger the The smaller the difference between them, the smaller the change in the linear fitting results at two consecutive moments, and the real-time water level lines at two consecutive moments are relatively stable. Therefore, by using 1 minus , the negative correlation mapping is completed.
[0044] is a step function. When , is -1, indicating that the real-time water level line at two consecutive moments is in a downward trend.
[0045] When , is 0, indicating that the real-time water level line at two consecutive moments is in a stable trend.
[0046] When , is 1, indicating that the real-time water level line at two consecutive moments is the above-mentioned trend.
[0047] The change coefficient at two consecutive moments is obtained. .
[0048] Among them, since the water level measurement is time-series data and for the convenience of subsequent data processing, is used as the change coefficient at the
[0049] S4: According to the trend of the change coefficient at consecutive moments, the trend coefficient at the first moment is obtained.
[0050] In one embodiment, after obtaining the change coefficient sequence, a trend analysis is performed on the change coefficient to obtain the overall upward trend or overall downward trend of the water surface.
[0051] The change coefficient sequence is decomposed by using the STL algorithm to obtain the seasonality, trend term, and residual in the STL decomposition result, where the seasonality represents the short-term cycle of the water surface fluctuation change, and the trend term represents the overall upward and overall downward trends of the water surface.
[0052] However, if the wave stability coefficient collected at a single moment is larger, it means that the real-time water level line at the single moment is inaccurate. Therefore, when using the trend line of the change coefficient sequence for the overall trend change analysis of the water surface, the trend term corresponding to the wave stability coefficient can be used for weighted linear fitting to obtain a fitting function, and the slope value of the fitting function is scaled as the trend coefficient at a single moment.
[0053] Specifically, the change coefficient at each moment is obtained, the wave stability coefficient at each moment is obtained, and the reciprocals of all wave stability coefficients at the moments are normalized.
[0054] The normalization method is as follows: obtain the sum of the reciprocals of the wave stability coefficients at all times, calculate the ratio of the reciprocal of each wave stability coefficient to the sum of the reciprocals of all wave stability coefficients as the weight value of the wave stability coefficient at each time. The numerator of the ratio is the reciprocal of each wave stability coefficient, and the denominator is the sum of the reciprocals of all wave stability coefficients.
[0055] Take the normalized value of the wave stability coefficient at each time as the linear fitting weight at each time, and use the linear weighted fitting algorithm to perform linear weighted fitting on the change coefficient collected at each time to obtain the fitted linear function, and obtain the slope value of this linear function.
[0056] Use the arctangent function to calculate the angle value corresponding to the slope value, calculate the ratio of this angle value to 90 degrees, multiply the ratio by the hyperparameter 1.2 to adjust the ratio, and use 1 minus the adjusted ratio as the trend coefficient at the first time.
[0057] Among them, the hyperparameter 1.2 is an empirical value and can be adjusted by the implementer according to the specific implementation scenario. Using 1 minus the adjusted ratio is to adjust the range of the trend coefficient. And since the upper left corner in the image is the origin of the image coordinates, when the overall horizontal plane trend decreases, the ratio is negative, and thus the trend coefficient is greater than 1. When the overall horizontal plane trend increases, the ratio is positive, and thus the trend coefficient is less than 1.
[0058] S5: Obtain the mean value of the abscissa values of the real-time water level line data, adjust the mean value of the abscissa values of the real-time water level line data with the trend coefficient as the weight to obtain the water level measurement value, and complete the water level intelligent warning method according to the water level measurement value.
[0059] In one embodiment, after obtaining the trend coefficient at the first time, obtain the real-time water level line data at the first time, calculate the abscissa mean value of this water level line data, and multiply the obtained abscissa mean value by the trend coefficient at the first time to obtain the water level measurement result in the image.
[0060] When the water level measurement result in the image is less than the abscissa value corresponding to the warning line, a water situation alarm is issued to complete the water level intelligent warning method.
[0061] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the counting principle of the present invention, several improvements and replacements can still be made, and these improvements and replacements should also be regarded as the protection scope of the present invention.
Claims
1. An intelligent water level warning method for water conservancy projects, characterized in that, Including: Collect the real-time water level image at the first moment, obtain the abscissa value of the warning line in the real-time water level image, construct a water level line recognition model, and use the water level line recognition model to obtain the real-time water level line; Continuously collect the real-time water level lines at multiple moments, obtain the volatility of the real-time water level lines, and calculate the wave stability coefficient for each moment; Perform linear fitting on the real-time water level line at each moment to obtain the linear fitting result at each moment, and obtain the change coefficient at each moment according to the change of the linear fitting results at consecutive moments; Obtain the trend coefficient at the first moment according to the trend of the change coefficients at consecutive moments; Obtain the mean value of the abscissa values of the real-time water level line, adjust the mean value of the abscissa values of the real-time water level line data with the trend coefficient as the weight to obtain the water level line measurement value, and complete the intelligent water level warning method according to the water level line measurement value.
2. The intelligent water level warning method for water conservancy projects according to claim 1, characterized in that: The abscissa value of the warning line in the real-time water level image includes: Use the checkerboard calibration method to perform spatial calibration on the camera coordinate system and the real-world coordinate system of the camera to obtain the abscissa value of the warning line in the real world in the camera imaging.
3. The intelligent water level warning method for water conservancy projects according to claim 1, characterized in that: The real-time water level line includes: Collect the water level line through an RGB camera set above the water surface to obtain a real-time water level image, input the collected real-time water level image into the trained water level line recognition model to obtain the recognition result of the water level line, and preprocess the recognition result of the water level line to obtain the real-time water level line.
4. The intelligent water level warning method for water conservancy projects according to claim 1, characterized in that: The wave stability coefficient includes: Obtain the upper envelope line sequence and the lower envelope line sequence of the real-time water level line, calculate the variance values corresponding to the abscissa data in the upper envelope line sequence and the lower envelope line sequence respectively, and obtain the mean value of the two variances as the wave stability coefficient of the collected real-time water level line.
5. The intelligent water level warning method for water conservancy projects according to claim 1, characterized in that: The change coefficient at each moment includes: Perform linear fitting on the real-time water level line at each moment to obtain the linear fitting result at each moment, and calculate the change coefficient of the linear fitting results corresponding to the real-time water level images at two consecutive moments: Indicates traversal of values; is the linear fitting result at the th moment; is the slope value of the corresponding linear fitting function ; is the linear fitting result at the th moment; is the slope value of the corresponding linear fitting function ; Indicates the cosine similarity between ; is the step function; Take as the change coefficient at each moment to obtain the change coefficient at each moment.
6. The intelligent water level warning method for water conservancy projects according to claim 1, characterized in that: The trend coefficient at the first moment includes: After decomposing the change coefficient at each moment obtained by using the STL algorithm, obtain the trend term in the STL decomposition result; Obtain the change coefficient at each moment, obtain the wave stability coefficient at each moment, and normalize the reciprocals of the wave stability coefficients at all collection moments; Use the normalized value of the wave stability coefficient at each moment to perform linear weighted fitting on the change coefficient at each moment to obtain a fitted linear function, and obtain the slope value of the linear function; Obtain the angle value corresponding to the slope value, calculate the ratio of the angle value to 90 degrees, multiply the ratio by a hyperparameter to adjust the ratio value, and use 1 minus the adjusted ratio value as the trend coefficient at the first moment.
7. The intelligent water level warning method for water conservancy projects according to claim 6, characterized in that: Normalization includes: Obtain the sum of the reciprocals of the wave stability coefficients collected at all moments, calculate the ratio of the reciprocal of the wave stability coefficient at each moment to the sum of the reciprocals of all wave stability coefficients as the normalized value of the wave stability coefficient at each moment, where the numerator of the ratio is the reciprocal of the wave stability coefficient at each moment and the denominator is the sum of the reciprocals of the wave stability coefficients at all moments.
8. The intelligent water level warning method for water conservancy projects according to claim 1, characterized in that: Intelligent water level warning includes: Calculate the abscissa mean of the water level line data at the first moment, and multiply the obtained abscissa mean by the trend coefficient at the first moment to obtain the water level line measurement result in the image; When the water level line measurement result in the image is less than the abscissa value corresponding to the warning line, a water situation alarm is issued to complete the intelligent water level warning method.
Citation Information
Patent Citations
Reservoir water level trend prediction method based on time sequence
CN111310981A
Method for identifying water level without scale by using machine vision
CN115760850A
Self-adaptive environment water level identification method, device and equipment
CN116129430A
Real-time river water level monitoring and early warning method and system based on deep learning
CN119418508A
Water conservancy project operation trend prediction method and system
CN119476620A