Water level recognition method and system based on dual-stream feature extraction model

By adopting a dual-flow feature extraction model in water level recognition, combining static and optical flow dynamic water features, the problem of water shoreline identification and segmentation in complex water environments is solved, and the accuracy and robustness of water level measurement are achieved.

CN119580104BActive Publication Date: 2025-04-29WUHAN DASHUIYUN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510133032.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-06
Publication Date
2025-04-29
Estimated Expiration
2045-02-06

AI Technical Summary

Technical Problem

In complex and changeable water environments, it is difficult for the prior art to accurately identify and segment irregular water coastlines, resulting in deviations in water level measurement results.

Method used

The water level recognition method based on the dual-flow feature extraction model is adopted, and the dual-flow feature extraction model is constructed by pre-processing the image data and optical flow field extraction. Combining the static and optical flow dynamic water features, the water segmentation mask image is output, and the water level value is obtained using the pixel-elevation fitting equation.

Benefits of technology

It significantly improves the generalization ability and robustness of water segmentation, ensuring the accuracy of water level measurement in complex and variable water environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119580104B_ABST
    Figure CN119580104B_ABST
Patent Text Reader

Abstract

The present invention provides a water level recognition method and system based on a dual-stream feature extraction model, including: collecting image data in different water environments, preprocessing the data, and obtaining preprocessed image data; using the optical flow method to calculate the optical flow field corresponding to the preprocessed image data, and forming a water feature data set with the preprocessed image data and its corresponding optical flow field; constructing a dual-stream feature extraction model, using the water feature data set to train and test the dual-stream feature extraction model, and obtaining a trained dual-stream feature extraction model; inputting the image data of the water area to be tested into the trained dual-stream feature extraction model, extracting the shoreline information in the output water area segmentation mask image, and combining the pixel-elevation fitting equation to obtain the water level value of the water area to be tested. The present invention can effectively improve the generalization ability and robustness of the visual water level recognition system in water bank segmentation and water level measurement in random, complex and changeable water areas.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of hydrological monitoring, and in particular relates to a water level recognition method and system based on a dual-stream feature extraction model. Background Art

[0002] At present, cutting-edge intelligent technologies such as computer vision and deep learning have been widely used in the field of hydrological monitoring. One way is to identify the physical water gauge, but the physical water gauge is easily affected by factors such as occlusion and contamination. Another way is to build a virtual water gauge. However, when facing a complex and changeable water environment, especially irregular water banks or large water surface fluctuations, the virtual water gauge is often difficult to accurately define the water shoreline, resulting in deviations in water level measurement results.

[0003] Caetano Mazzoni Ranieri et al. proposed integrating dense optical flow fields into deep learning workflows to improve the accuracy of flood risk assessment in the paper "A deep learning workflow enhanced with optical flow fields for flood risk estimation" (Applied Intelligence, 2024, 54, 5536-5557). This method obtains optical flow images by performing optical flow representation on image data, and inputs them into the Resnet neural network model as an additional data stream to identify the rising trend of water levels. However, it does not involve the identification and segmentation of water shorelines, and cannot obtain water level data. Summary of the invention

[0004] In order to cope with the problem that the water shoreline is difficult to accurately define in scenes with irregular water shorelines or large water surface fluctuations in complex and changeable water environments, the present invention provides a water level recognition method and system based on a dual-stream feature extraction model.

[0005] Based on the above purpose, the technical solution adopted by the present invention is as follows:

[0006] The water level recognition method based on the dual-stream feature extraction model includes the following steps:

[0007] S1, collecting image data in different water environments, and preprocessing the image data to obtain preprocessed image data;

[0008] S2, obtaining an optical flow field corresponding to the preprocessed image data, and marking water areas and river banks for the preprocessed image data and the optical flow field to construct a water area feature data set;

[0009] S3, randomly dividing the water feature data set into a training set and a test set in proportion, constructing a dual-stream feature extraction model, whose output is a water segmentation mask image, and using the training set to train the dual-stream feature extraction model to obtain a trained dual-stream feature extraction model;

[0010] S4, input the test set into the trained dual-stream feature extraction model to generate a test result, introduce a performance evaluation index to evaluate the test result, if it meets the evaluation criteria, then obtain a trained dual-stream feature extraction model and enter S5, if it does not meet the evaluation criteria, return to S3;

[0011] S5. Input the image data of the water area to be measured into the trained dual-stream feature extraction model to obtain the water level value of the water area to be measured.

[0012] Preferably, step S1 also includes: the image data includes water environment images of different environmental factors and different time periods and including shorelines; the image data preprocessing includes binarization, Gaussian filtering and histogram equalization of the image data in sequence.

[0013] Preferably, step S2 further comprises: processing the preprocessed image data by using a Horn-Schunck optical flow method to obtain an optical flow field corresponding to the preprocessed image data.

[0014] Preferably, the training set and the test set are randomly divided in a ratio of 9:1.

[0015] Preferably, step S3 further includes: the dual-stream feature extraction model includes a static water feature encoder, an optical flow dynamic water feature encoder and a mask decoder, and the dual-stream feature extraction model is expressed as:

[0016]

[0017] In the formula, and Respectively represent the input and output images of the two-stream feature extraction model, and represent the static water feature encoder and the optical flow dynamic water feature encoder respectively, represents the mask decoder;

[0018] The static water feature encoder and the optical flow dynamic water feature encoder are used to extract the static water feature of the preprocessed image data and the optical flow dynamic water feature of the preprocessed image data corresponding to the optical flow field, respectively, and both include 15 convolutional layers and 1 pooling layer. The specific expressions are as follows:

[0019]

[0020]

[0021] In the formula, and Respectively represent the static water area characteristics and the optical flow dynamic water area characteristics, represents the maximum pooling process, Indicates the processing of the nth convolutional layer;

[0022] The mask decoder is used to process the static water features and the optical flow dynamic water features, and output the water segmentation mask image, which includes 1 1×1 convolution layer and 3 transposed convolution layers. The specific expression is:

[0023]

[0024] In the formula, represents 1×1 convolution processing, Represents transposed convolution processing.

[0025] Preferably, step S3 further includes: the dual-stream feature extraction model also includes a loss function, and the loss function is a Focal Loss loss function, and its expression is:

[0026]

[0027] In the formula, It indicates the probability that the model predicts that the sample belongs to the positive class. represents the sample weight, represents adjustable parameters, It is called the tempering factor.

[0028] Preferably, step S4 further includes: the performance evaluation index includes IOU, and its calculation formula is as follows:

[0029]

[0030] Wherein, TP indicates the case where both the model prediction and the actual result are water areas, FP indicates the case where the model prediction is water areas but the actual result is non-water areas, and FN indicates the case where the model prediction is non-water areas but the actual result is water areas. The IOU threshold is set to 0.95. When IOU ≥ 0.95, S5 is entered. When IOU < 0.95, S3 is returned.

[0031] Preferably, step S5 further comprises: using a Canny operator to extract the shoreline in the water segmentation mask image of the water area to be measured, and calculating the average value of the vertical coordinates of the shoreline pixels;

[0032] The average value of the vertical coordinates of the water shoreline pixels is input into the pixel-elevation fitting equation to obtain the water level value of the water area to be measured.

[0033] Preferably, the calculation formula of the pixel-elevation fitting equation is as follows:

[0034]

[0035] In the formula, H represents the water level, m represents the pixel ordinate, A0, A1, A2, …, A n represents the coefficients of each term in the equation, and n represents the degree of the equation.

[0036] The present invention also provides a water level recognition system based on a dual-stream feature extraction model, comprising the following modules:

[0037] Data acquisition module, used to collect image data in different water environments;

[0038] An image processing module, used to preprocess the image data, obtain an optical flow field corresponding to the preprocessed image data, and mark water areas and river banks for the preprocessed image data and the optical flow field;

[0039] A model building module is used to build a two-stream feature extraction model, whose output is a water segmentation mask image;

[0040] A model training module, used to train, test and evaluate the dual-stream feature extraction model to obtain a trained dual-stream feature extraction model;

[0041] The water level acquisition module is used to input the image data of the water area to be measured into the trained dual-stream feature extraction model to obtain the water level value of the water area to be measured.

[0042] Compared with the existing methods, the present invention is beneficial in that most existing water segmentation algorithms mainly process single images, but this method can only obtain static image features. When encountering scenes where the water bank and the water body are similar in color, there are water stains on the bank slope, or the bank slope is irregular, the segmentation effect is likely to be unsatisfactory.

[0043] The present invention takes into account the water flow movement trend, uses the Horn-Schunck optical flow method to obtain the optical flow field of the water area to be measured, performs a fusion analysis on the static water area characteristics and the optical flow dynamic water area characteristics, and obtains the water level value of the water area to be measured based on the output water area segmentation mask image and the pixel-elevation fitting equation. This method significantly improves the generalization ability and robustness of water area segmentation, and ensures the accuracy of water level measurement in complex and changeable water environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0045] Figure 1 is a flow chart of a water level identification method based on a dual-stream feature extraction model according to an embodiment of the present invention;

[0046] Figure 2 is a structural diagram of a dual-stream feature extraction model according to an embodiment of the present invention;

[0047] Figure 3 It is a schematic diagram of the structure of a water level recognition system based on a dual-stream feature extraction model according to an embodiment of the present invention. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solutions and advantages of the present invention more obvious and understandable, the technical solutions in the present invention will be clearly and completely described below in conjunction with the accompanying drawings and specific embodiments. It should be pointed out that the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0049] See also Figure 1 As shown, the water level recognition method based on the dual-stream feature extraction model provided by the present invention includes the following steps:

[0050] S1. Collect image data in different water environments, and preprocess the image data to obtain preprocessed image data.

[0051] Step S1 in the embodiment of the present invention specifically includes:

[0052] The river surface image data in different water environments are collected by using devices such as cameras or video cameras. The river surface image data covers different lighting conditions, weather conditions and time periods and includes water shoreline information.

[0053] The image data is binarized and converted into a grayscale image, and then the grayscale image is denoised using a Gaussian filter to retain the edge information of the image data and prevent edge blur from interfering with subsequent image recognition tasks. Finally, the denoised image is subjected to histogram equalization to improve image contrast and overall quality. By binarizing, Gaussian filtering, and histogram equalization of the image data, the impact of adverse meteorological factors such as heavy rain, fog, and low light on image recognition can be effectively reduced, the texture details of the image data can be enhanced, and the accuracy of subsequent waterside recognition and segmentation can be improved.

[0054] S2. Obtain an optical flow field corresponding to the preprocessed image data, and annotate the water area and riverbank on the preprocessed image data and the optical flow field to construct a water area feature data set.

[0055] Step S2 in the embodiment of the present invention specifically includes:

[0056] By analyzing the pixel changes of the preprocessed image data in the time domain and the correlation between adjacent frames, combined with the grayscale invariance and optical flow field smoothness constraints, the Horn-Schunck optical flow method is used to calculate the optical flow field corresponding to the preprocessed image data, so as to achieve effective distinction between non-water area and water flow area.

[0057] Specifically, based on the grayscale invariance constraint, that is, within a small time period and spatial displacement, the grayscale value of the same pixel of the image data remains unchanged, the movement speed of the grayscale value of the pixel is solved to obtain the flow velocity data of the river surface, and the solution process is as follows:

[0058] Let I(x, y, t) represent the pixel grayscale value of the image data, where (x, y) is the spatial coordinate of the image domain and t is the time index. According to the grayscale invariant constraint, we have

[0059]

[0060] Where Δt represents the unit time interval, Δx and Δy represent the displacement in the x and y directions in the pixel coordinate system after the Δt interval, respectively.

[0061] Using Taylor's formula to expand the above formula at x and y, we can get

[0062]

[0063] In the formula, \omega =\left [ {u,v} \right ]^{T}=\left [ {\frac {dx} {dt},\frac {dy} {dt}} \right ]^{T} Represents the instantaneous velocity of any pixel (x, y) in the image data at time t.

[0064] Based on the smoothness constraint of the optical flow field, that is, the change of the pixel gray value in the entire image data is smooth, the optical flow velocity field corresponding to each frame of the image is obtained by calculating the minimized energy function of two adjacent frames of the image data, and the optical flow velocity field is averaged in the time domain to obtain the dense optical flow field corresponding to the image data. The expression of the minimized energy function is as follows:

[0065]

[0066] For the preprocessed image data and the optical flow field, the labeling tool Label Studio is used to label the water area and river bank, and the labeled preprocessed image data and the corresponding optical flow field constitute a water area feature data set.

[0067] S3. Randomly divide the water feature data set into a training set and a test set in proportion, construct a dual-stream feature extraction model, whose output is a water segmentation mask image, and use the training set to train the dual-stream feature extraction model to obtain a trained dual-stream feature extraction model.

[0068] Step S3 in the embodiment of the present invention specifically includes:

[0069] See also Figure 2 As shown, the water feature dataset is randomly divided into a training set and a test set in a ratio of 9:1, and a dual-stream feature extraction model is constructed based on static and optical flow dynamic water feature encoders and a mask decoder. The input of the dual-stream feature extraction model is the preprocessed image data and its corresponding optical flow field, and the output is a water segmentation mask image.

[0070] The expression of the dual-stream feature extraction model is:

[0071]

[0072] In the formula, and Respectively represent the input and output images of the two-stream feature extraction model, and represent the static water feature encoder and the optical flow dynamic water feature encoder respectively, Represents the mask decoder.

[0073] The static water feature encoder and the optical flow dynamic water feature encoder are used to extract the static water feature of the preprocessed image data and the optical flow dynamic water feature of the preprocessed image data corresponding to the optical flow field, respectively, and both include 15 convolutional layers and 1 pooling layer. The specific expressions are as follows:

[0074]

[0075]

[0076] In the formula, and Respectively represent the static water area characteristics and the optical flow dynamic water area characteristics, represents the maximum pooling process, Indicates the processing of the nth convolutional layer.

[0077] The mask decoder is used to process the static water features and the optical flow dynamic water features, and output the water segmentation mask image, which includes 1 1×1 convolution layer and 3 transposed convolution layers. The specific expression is:

[0078]

[0079] In the formula, represents 1×1 convolution processing, Represents transposed convolution processing.

[0080] The dual-stream feature extraction model is trained using the training set, and the Focal Loss loss function is used to improve the sample category imbalance problem and focus on difficult samples, solve the problems of blurred boundary pixels and unclear features that may exist in the preprocessed image data, reduce the difference between the labeled image and the mask image, and obtain the trained dual-stream feature extraction model. The expression of the Focal Loss loss function is as follows:

[0081]

[0082] In the formula, It indicates the probability that the model predicts that the sample belongs to the positive class. represents the sample weight, represents adjustable parameters, It is called the tempering factor. The Focal Loss function is based on the sample weights To suppress the imbalance in the number of positive and negative samples, the adjustable parameter Used to control the imbalance in the number of easy / difficult samples.

[0083] For the , when its value is close to 1, it indicates that the sample is easy to classify. is close to 0, which can effectively reduce the loss value of easy-to-classify samples; on the contrary, for difficult samples, The value of is small, and the tempering factor The value of is close to 1, keeping the original weight, thus paying more attention to difficult samples.

[0084] S4. Input the test set into the trained dual-stream feature extraction model to generate a test result, introduce a performance evaluation index to evaluate the test result, and if it meets the evaluation criteria, obtain a trained dual-stream feature extraction model and enter S5. If it does not meet the evaluation criteria, return to S3.

[0085] Step S4 in the embodiment of the present invention specifically includes:

[0086] The test set is input into the trained dual-stream feature extraction model to generate a corresponding test result, i.e., the water segmentation mask image corresponding to the test set. The water segmentation mask image corresponding to the test set is evaluated by the performance evaluation indicator IOU (intersection over union). If it meets the evaluation criteria, the trained dual-stream feature extraction model is obtained and S5 is entered. Otherwise, if it does not meet the evaluation criteria, S3 is entered to retrain the dual-stream feature extraction model.

[0087] The calculation formula of the IOU is as follows:

[0088]

[0089] Wherein, TP indicates the case where both the model prediction and the actual result are water areas, FP indicates the case where the model prediction is water areas but the actual result is non-water areas, and FN indicates the case where the model prediction is non-water areas but the actual result is water areas. In the embodiment of the present invention, the IOU threshold is set to 0.95. When IOU ≥ 0.95, the process proceeds to S5, and when IOU < 0.95, the process returns to S3.

[0090] S5. Input the image data of the water area to be measured into the trained dual-stream feature extraction model to obtain the water level value of the water area to be measured.

[0091] Step S5 in the embodiment of the present invention specifically includes:

[0092] The image data of the water area to be tested is subjected to image preprocessing, and the optical flow field corresponding to the preprocessed image data of the water area to be tested is calculated using the Horn-Schunck optical flow method. The preprocessed image data of the water area to be tested and the corresponding optical flow field are input into the trained dual-stream feature extraction model, and a water area segmentation mask image corresponding to the water area to be tested is output.

[0093] According to the pixel ordinate position m of the known or preset calibration point in the image data of the water area to be measured and the actual water level elevation H, the pixel-elevation fitting equation can be expressed as:

[0094]

[0095] In the formula, H represents the water level, m represents the pixel ordinate, A0, A1, A2, …, A n represents the coefficients of each term in the equation, and n represents the order of the equation. The order of the equation n can be adjusted according to the number of calibration points and the fitting requirements. The more calibration points there are, the larger the n value is, and the better the fitting accuracy is.

[0096] Calculate the sum of squares of the errors between the actual water level and the fitted value, and minimize the sum of squares of the errors by the least squares method to obtain A0, A1, A2, ..., A n The optimal solution of each coefficient of the equation is obtained to obtain the optimized pixel-elevation fitting equation.

[0097] The Canny operator is used to extract the shoreline in the water segmentation mask image of the water area to be measured, and the average value of the vertical coordinate of the water shoreline pixels is obtained. The average value of the vertical coordinate of the water shoreline pixels is input into the optimized pixel-elevation fitting equation to obtain the water level value of the water area to be measured.

[0098] The embodiment of the present invention obtains river surface image data in different water environments, performs binarization, Gaussian filtering and histogram equalization processing on it, calculates the dense optical flow field corresponding to the image data, uses the static and optical flow dynamic water feature encoders in the dual-stream feature extraction model to extract the static water features in the image data and the optical flow dynamic water features in the optical flow field, uses a mask decoder to obtain a water segmentation mask image, and combines the pixel-elevation fitting equation to obtain the water level value of the water area to be measured. This method can improve the generalization ability and robustness of water bank segmentation, and can obtain accurate water level data in conventional water level monitoring and scenes with irregular water banks or large water surface fluctuations in complex and changeable environments.

[0099] The water level recognition system based on the dual-stream feature extraction model provided by the present invention is described below. The water level recognition system based on the dual-stream feature extraction model described below and the water level recognition method based on the dual-stream feature extraction model described above can be compared with each other.

[0100] See also Figure 3 As shown, it includes: a data acquisition module 31, an image processing module 2, a model building module 33, a model training module 34, and a water level acquisition module 35, wherein:

[0101] Data acquisition module, used to collect image data in different water environments;

[0102] An image processing module, used to preprocess the image data, obtain an optical flow field corresponding to the preprocessed image data, and mark water areas and river banks for the preprocessed image data and the optical flow field;

[0103] A model building module is used to build a two-stream feature extraction model, whose output is a water segmentation mask image;

[0104] A model training module is used to train, test and evaluate the dual-stream feature extraction model to obtain a trained dual-stream feature extraction model;

[0105] The water level acquisition module is used to input the image data of the water area to be measured into the trained dual-stream feature extraction model to obtain the water level value of the water area to be measured.

[0106] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims

1. The water level recognition method based on the dual-stream feature extraction model is characterized by: The steps include: S1, collecting image data in different water environments, and preprocessing the image data to obtain preprocessed image data; S2, obtaining an optical flow field corresponding to the preprocessed image data, and marking water areas and river banks for the preprocessed image data and the optical flow field to construct a water area feature data set; S3, randomly dividing the water feature data set into a training set and a test set in proportion, constructing a dual-stream feature extraction model, whose output is a water segmentation mask image, and using the training set to train the dual-stream feature extraction model to obtain a trained dual-stream feature extraction model; The dual-stream feature extraction model includes a static water feature encoder, an optical flow dynamic water feature encoder and a mask decoder. The expression of the dual-stream feature extraction model is: I out =F SD (F SWE (I in )+F DWE (I in )) In the formula, I in and I out Respectively represent the input and output images of the two-stream feature extraction model, F SWE and F DWE Respectively represent the static water feature encoder and the optical flow dynamic water feature encoder, F SD represents the mask decoder; The static water feature encoder and the optical flow dynamic water feature encoder are used to extract the static water feature of the preprocessed image data and the optical flow dynamic water feature of the preprocessed image data corresponding to the optical flow field, respectively, and both include 15 convolutional layers and 1 pooling layer. The specific expressions are as follows: In the formula, I SWF and I DWF represent the static water area characteristics and the optical flow dynamic water area characteristics respectively, and F maxpool represents the maximum pooling process, F convn Indicates the processing of the nth convolutional layer; The mask decoder is used to process the static water features and the optical flow dynamic water features, and output the water segmentation mask image, which includes 1 1×1 convolution layer and 3 transposed convolution layers. The specific expression is: I out =F conv (F TC (F TC (F TC (I SWF +I DWF )))) In the formula, F conv represents 1×1 convolution processing, F TC Represents transposed convolution processing; S4, input the test set into the trained dual-stream feature extraction model to generate a test result, introduce a performance evaluation index to evaluate the test result, if it meets the evaluation criteria, then obtain a trained dual-stream feature extraction model and enter S5, if it does not meet the evaluation criteria, return to S3; S5. Input the image data of the water area to be measured into the trained dual-stream feature extraction model to obtain the water level value of the water area to be measured.

2. The water level recognition method based on the dual-stream feature extraction model according to claim 1 is characterized in that: Step S1 also includes: the image data includes water environment images of different environmental factors and different time periods and including water shorelines; the image data preprocessing includes binarization, Gaussian filtering and histogram equalization of the image data in sequence.

3. The water level recognition method based on the dual-stream feature extraction model according to claim 1 is characterized in that: Step S2 also includes: processing the preprocessed image data by using the Horn-Schunck optical flow method to obtain an optical flow field corresponding to the preprocessed image data.

4. The water level recognition method based on the dual-stream feature extraction model according to claim 1 is characterized in that: The training set and the test set are randomly divided in a ratio of 9:

1.

5. The water level recognition method based on the dual-stream feature extraction model according to claim 1 is characterized in that: Step S3 also includes: the dual-stream feature extraction model also includes a loss function, and the loss function is a Focal Loss loss function, and its expression is: L FL (p t )=-a t (1-p t ) γ log(p t ) In the formula, p t Represents the probability that the model predicts that the sample belongs to the positive class, α t represents the sample weight, γ represents the adjustable parameter, (1-p t ) γ It is called the tempering factor.

6. The water level recognition method based on the dual-stream feature extraction model according to claim 1 is characterized in that: Step S4 also includes: the performance evaluation index includes IOU, and its calculation formula is as follows: Wherein, TP indicates the case where both the model prediction and the actual result are water areas, FP indicates the case where the model prediction is water areas but the actual result is non-water areas, and FN indicates the case where the model prediction is non-water areas but the actual result is water areas. The IOU threshold is set to 0.

95. When IOU ≥ 0.95, S5 is entered. When IOU < 0.95, S3 is returned.

7. The water level recognition method based on the dual-stream feature extraction model according to claim 1 is characterized in that: Step S5 also includes: using the Canny operator to extract the shoreline in the water segmentation mask image of the water area to be tested, and calculating the average value of the vertical coordinates of the shoreline pixels; The average value of the vertical coordinates of the water shoreline pixels is input into the pixel-elevation fitting equation to obtain the water level value of the water area to be measured.

8. The water level recognition method based on the dual-stream feature extraction model according to claim 7 is characterized in that: The calculation formula of the pixel-elevation fitting equation is as follows: H=A0+A1m+A2m 2 +…+A n m n In the formula, H represents the water level, m represents the pixel ordinate, A0, A1, A2, …, A n represents the coefficients of each term in the equation, and n represents the degree of the equation.

9. The water level recognition system based on the dual-stream feature extraction model is characterized by: Includes the following modules: Data acquisition module, used to collect image data in different water environments; An image processing module, used to preprocess the image data, obtain an optical flow field corresponding to the preprocessed image data, and mark water areas and river banks for the preprocessed image data and the optical flow field; A model building module is used to build a two-stream feature extraction model, whose output is a water segmentation mask image; The dual-stream feature extraction model includes a static water feature encoder, an optical flow dynamic water feature encoder and a mask decoder. The expression of the dual-stream feature extraction model is: I out =F SD (F SWE (I in )+F DWE (I in )) In the formula, I in and I out Respectively represent the input and output images of the two-stream feature extraction model, F SWE and F DWE Respectively represent the static water feature encoder and the optical flow dynamic water feature encoder, F SD represents the mask decoder; The static water feature encoder and the optical flow dynamic water feature encoder are used to extract the static water feature of the preprocessed image data and the optical flow dynamic water feature of the preprocessed image data corresponding to the optical flow field, respectively, and both include 15 convolutional layers and 1 pooling layer. The specific expressions are as follows: In the formula, I SWF and I DWF represent the static water area characteristics and the optical flow dynamic water area characteristics respectively, and F maxpool represents the maximum pooling process, Indicates the processing of the nth convolutional layer; The mask decoder is used to process the static water features and the optical flow dynamic water features, and output the water segmentation mask image, which includes 1 1×1 convolution layer and 3 transposed convolution layers. The specific expression is: I out =F conv (F TC (F TC (F TC (I SWF +I DWF )))) In the formula, F conv represents 1×1 convolution processing, F TC Represents transposed convolution processing; A model training module, used to train, test and evaluate the dual-stream feature extraction model to obtain a trained dual-stream feature extraction model; The water level acquisition module is used to input the image data of the water area to be measured into the trained dual-stream feature extraction model to obtain the water level value of the water area to be measured.

Citation Information

Patent Citations

  • Urban flood disaster monitoring and early warning method and device

    CN117218801A

  • Image sequence analysis-based gas turbine engine combustion chamber stability analysis method

    WO2022151154A1