Water level real-time prediction method and system, electronic equipment and storage medium
By introducing neural network-based water level monitoring and prediction models into traditional flood control monitoring equipment, the problems of low accuracy, high failure rate and limited service life of traditional equipment are solved, and the accuracy and reliability of water level monitoring and prediction are achieved.
Patent Information
- Application Number
- CN202411665905.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-11-20
AI Technical Summary
Traditional flood control monitoring equipment has problems such as low accuracy, high failure rate and limited service life, which affects the accuracy of flood control decisions and increases operating costs.
The water level monitoring model based on residual neural network is used to extract the water level images feature, and the water level prediction model of long and short-term memory network is combined to predict future water level changes.
Accurate monitoring and accurate prediction of water level heights are achieved, and support capabilities for flood control and disaster reduction and water resource management are improved, with high scalability and flexibility.
Smart Images

Figure CN119540770A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of smart city construction and information technology, and specifically relates to a real-time water level prediction method, system, electronic equipment and storage medium. Background Art
[0002] In the process of building smart cities, the flood control system is an important part of urban infrastructure, and its accuracy and efficiency are directly related to the city's flood control capabilities and the safety of residents' lives and property. Although traditional flood control monitoring equipment, such as water level meters and flow meters, can achieve real-time monitoring of water levels to a certain extent, they have many limitations.
[0003] The accuracy of traditional monitoring equipment is affected by many factors, such as environmental interference and equipment aging, which leads to errors in monitoring data and makes it difficult to accurately reflect the actual water level. This not only affects the accuracy of flood control decisions, but also may bring safety hazards to the city. The failure rate of traditional monitoring equipment is high, especially in severe weather conditions, the equipment is easily damaged or fails, resulting in interruption or distortion of monitoring data. This not only increases maintenance costs, but may also delay the implementation of flood control work. The service life of traditional monitoring equipment is limited. As the use time increases, the performance of the equipment gradually decreases and cannot meet the long-term and stable monitoring needs. This requires urban management departments to continuously invest funds to update and replace equipment, increasing operating costs. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a real-time water level prediction method, system, electronic device and storage medium, which are used to fully or at least partially solve the problems of low accuracy, high failure rate and limited service life of traditional flood control monitoring equipment in the above-mentioned prior art.
[0005] In a first aspect, an embodiment of the present application provides a method for real-time water level prediction, comprising: Collecting a water level image of the monitored area and preprocessing the water level image to obtain a target water level image; A pre-built water level monitoring model is used to extract features from a target water level image, characteristic data corresponding to the target water level data is obtained, and real-time information of the current water level is determined based on the characteristic data, wherein the water level monitoring model is built based on a residual neural network; The time series data corresponding to the real-time information of the current water level is input into a pre-trained water level prediction model so that the water level prediction model can predict future water level changes, wherein the water level prediction model is constructed based on a long short-term memory network.
[0006] Optionally, the process of constructing the water level monitoring model includes: Collect and annotate a water level image dataset, normalize the water level image dataset, and divide the normalized water level image dataset into training set images, validation set images, and test set images; Load the pre-trained residual neural network and change the number of fully connected layers to two to meet the output requirements of the water level classification task; Input the training set images into the residual neural network, perform forward propagation to calculate the prediction results, use the loss function to calculate the difference between the prediction results and the true labels, and calculate the gradient; The gradient is propagated back to the residual neural network through the back-propagation algorithm, and the parameters are updated. At the end of each training round, the performance of the water level monitoring model is evaluated using the validation set images, and the initial water level monitoring model that meets the requirements is recorded; After the training is completed, the test set images are used to evaluate the performance of the initial water level monitoring model and obtain the target water level monitoring model; Among them, the architecture of the water level monitoring model includes: input layer, convolution layer, pooling layer, residual block and fully connected layer.
[0007] Optionally, the process of propagating the gradient back to the residual neural network through the back-propagation algorithm and updating the parameters includes: The loss function is used to calculate the error between the predicted value of the water level monitoring model and the true label to guide the back propagation process; Calculate the partial derivative of the loss function with respect to the activation value of the output layer to obtain the gradient of the output layer; Using the chain rule, the gradient of the output layer is propagated back to the hidden layer and the gradient of the hidden layer is calculated; According to the gradient of the hidden layer, the gradient of the weights and biases in the residual neural network is calculated, and the weights and biases are updated according to the gradient descent method.
[0008] Optionally, the gradient descent update formula is:
[0009] In the formula, represents the parameter value at time t, represents the parameter value at time t+1, represents the learning rate, Represents the loss function exist The gradient at .
[0010] Optionally, the loss function of the water level prediction model is as follows:
[0011] In the formula, n represents the number of samples, Represents the actual observation value of the i-th sample; Represents the predicted value of the i-th sample.
[0012] Optionally, the time series data corresponding to the real-time information of the current water level is input into a pre-trained water level prediction model so that the water level prediction model predicts future water level changes, including: Inputting the time series data corresponding to the real-time information of the current water level into the input layer of the water level prediction model, and inputting the output of the input layer into the short-term memory network layer in the water level prediction model to obtain the output of the short-term memory network layer; Inputting the output of the short-term time memory network layer into the long-term time memory network layer in the water level prediction model to obtain the output of the long-term time memory network layer; The output of the long-term time memory network layer is input into the prediction layer in the water level prediction model, and the water level prediction results at a series of time nodes are output. The trend and law of water level change are determined based on the water level prediction results.
[0013] In a second aspect, the embodiment of the present application further provides a water level real-time prediction system, comprising: A data acquisition unit is used to acquire a water level image of the monitored area and pre-process the water level image to obtain a target water level image; A feature extraction unit, used to extract features from a target water level image using a pre-built water level monitoring model, obtain feature data corresponding to the target water level data, and determine real-time information of the current water level based on the feature data, wherein the water level monitoring model is built based on a residual neural network; The water level prediction unit is used to input the time series data corresponding to the real-time information of the current water level into a pre-trained water level prediction model so that the water level prediction model can predict future water level changes, wherein the water level prediction model is constructed based on a long short-term memory network.
[0014] Optionally, the water level prediction unit is specifically used for: Inputting the time series data corresponding to the real-time information of the current water level into the input layer of the water level prediction model, and inputting the output of the input layer into the short-term memory network layer in the water level prediction model to obtain the output of the short-term memory network layer; Inputting the output of the short-term time memory network layer into the long-term time memory network layer in the water level prediction model to obtain the output of the long-term time memory network layer; The output of the long-term time memory network layer is input into the prediction layer in the water level prediction model, and the water level prediction results at a series of time nodes are output. The trend and law of water level change are determined based on the water level prediction results.
[0015] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for real-time water level prediction when executing the program.
[0016] In a fourth aspect, an embodiment of the present application further provides a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned real-time water level prediction method are implemented.
[0017] It can be seen from the above technical solutions that the present invention has the following advantages: The real-time water level prediction method, system, electronic device and storage medium provided in this application combine the powerful image processing capabilities of ResNet and the analysis capabilities of LSTM for time series data, thereby achieving precise monitoring and accurate prediction of water level heights, providing strong support for flood prevention and disaster reduction, water resources management and other fields. It is highly scalable and flexible and can be applied to water level monitoring and prediction needs in different scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0019] Figure 1 A flow chart of a method for real-time water level prediction provided by an embodiment of the present invention; Figure 2 A schematic diagram of a process of constructing a water level monitoring model provided by an embodiment of the present invention; Figure 3 A flow chart of water level prediction using a water level prediction model provided by an embodiment of the present invention; Figure 4 A detailed flow chart of a method for real-time water level prediction provided by an embodiment of the present invention; Figure 5 This is an experimental result data comparison diagram provided by an embodiment of the present invention; Figure 6 A schematic diagram of the structure of a real-time water level prediction system provided by an embodiment of the present invention; Figure 7 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In the detailed description below, various embodiments of the present disclosure will be described more fully. The present disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of the present disclosure to the specific embodiments disclosed herein, but rather the present disclosure should be understood to cover all adjustments, equivalents and / or alternatives that fall within the spirit and scope of the various embodiments of the present disclosure.
[0021] Hereinafter, the terms "include" or "may include" that may be used in various embodiments of the present disclosure indicate the presence of the disclosed functions or operations, and do not limit the addition of one or more functions or operations. In addition, as used in various embodiments of the present disclosure, the terms "include", "have" and their cognates are intended only to indicate specific features, numbers, steps, operations, or combinations of the foregoing items, and should not be understood as first excluding the presence of one or more other features, numbers, steps, operations, or combinations of the foregoing items or the possibility of adding one or more features, numbers, steps, operations, or combinations of the foregoing items.
[0022] In various embodiments of the present disclosure, the expression "or" or "at least one of A or / and B" includes any combination or all combinations of the words listed at the same time. For example, the expression "A or B" or "at least one of A or / and B" may include A, may include B, or may include both A and B.
[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, 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 creative work are within the scope of protection of the present invention.
[0024] See also Figure 1 The figure is a flow chart of a method for real-time water level prediction in a specific embodiment, which includes the following execution steps: Step 100: Acquire a water level image of a monitoring area, and pre-process the water level image to obtain a target water level image.
[0025] Specifically, use a high-definition network camera or other image acquisition equipment to capture the water level in the monitoring area, ensure that the image is clear, complete, and contains sufficient water level information, convert the acquired color water level image into a grayscale image, filter the grayscale image to remove noise and blur components in the image, and enhance the filtered image to improve the contrast and clarity of the image. If the acquired image has geometric distortion, such as tilt, distortion, etc., geometric correction is performed to transform the image into a standard shape through operations such as rotation, scaling, and translation for subsequent processing and analysis.
[0026] Exemplarily, when filtering a grayscale image, the filtering methods that can be used include mean filtering, median filtering or Gaussian filtering, and when enhancing the filtered image, the image enhancement methods that can be used include histogram equalization or contrast stretching.
[0027] Step 101: Use a pre-built water level monitoring model to perform feature extraction on a target water level image, obtain feature data corresponding to the target water level data, and determine real-time information of the current water level based on the feature data, wherein the water level monitoring model is built based on a residual neural network.
[0028] In one embodiment of the present invention, based on the construction process of the water level monitoring model, a possible embodiment is given below to illustrate its specific implementation scheme in a non-limiting manner. Figure 2 As shown, the following execution steps are included: S1: Collect and annotate a water level image dataset, normalize the water level image dataset, and divide the normalized water level image dataset into training set images, validation set images, and test set images.
[0029] Exemplarily, an automated tool is used to mark the position of a water level line or the height of a water level in an image to obtain a labeled water level image dataset.
[0030] S2: Load the pre-trained residual neural network and change the number of fully connected layers to two to meet the output requirements of the water level classification task.
[0031] S3: Input the training set images into the residual neural network, perform forward propagation to calculate the prediction results, use the loss function to calculate the difference between the prediction results and the true labels, and calculate the gradient.
[0032] S4: The gradient is propagated back to the residual neural network through the back-propagation algorithm, and the parameters are updated. At the end of each training round, the performance of the water level monitoring model is evaluated using the validation set images, and the initial water level monitoring model that meets the requirements is recorded.
[0033] Specifically, when executing step S4, the following steps may be specifically performed: S40: Use the loss function to calculate the error between the predicted value of the water level monitoring model and the true label to guide the back propagation process.
[0034] Exemplarily, the loss function formula used in this embodiment is as follows:
[0035] In the formula, n is the number of samples, is the model's predicted value for the ith sample, and y(i) is the actual value of the ith sample.
[0036] S41: Calculate the partial derivative of the loss function with respect to the activation value of the output layer to obtain the gradient of the output layer.
[0037] S42: Use the chain rule to propagate the gradient of the output layer back to the hidden layer and calculate the gradient of the hidden layer.
[0038] S43: According to the gradient of the hidden layer, the gradient of the weights and biases in the residual neural network is calculated, and the weights and biases are updated according to the gradient descent method.
[0039] Specifically, the gradient descent update formula is:
[0040] In the formula, represents the parameter value at time t, represents the parameter value at time t+1, represents the learning rate, Represents the loss function exist The gradient at .
[0041] S5: After the training is completed, the test set images are used to evaluate the performance of the initial water level monitoring model to obtain the target water level monitoring model. The architecture of the water level monitoring model includes: input layer, convolution layer, pooling layer, residual block and fully connected layer.
[0042] In some embodiments, a water level monitoring model based on a residual neural network (ResNet) selects a ResNet architecture of ResNet-18. The ResNet-18 architecture is mainly composed of the following key parts: Input layer: usually receives an image input of a fixed size; Convolution layer: includes a 7X7 convolution layer for extracting local features in the image; Pooling layer: used to reduce the resolution of the feature map, reduce the amount of calculation, and extract more abstract features; Residual Blocks: to alleviate the gradient vanishing problem in deep network training. Each residual block contains two convolution layers and a shortcut connection that adds the input directly to the output. Fully connected layer: At the end of the network, there is usually a fully connected layer for mapping the extracted features to the final output.
[0043] Step 102: Input the time series data corresponding to the real-time information of the current water level into a pre-trained water level prediction model so that the water level prediction model can predict future water level changes, wherein the water level prediction model is constructed based on a long short-term memory network.
[0044] Specifically, the loss function of the water level prediction model is as follows:
[0045] In the formula, n represents the number of samples, Represents the actual observation value of the i-th sample; Represents the predicted value of the i-th sample.
[0046] In some embodiments, before executing step 102, the following steps are also performed: Designing a water level prediction model based on a long short-term memory network (LSTM) and combining the water level information sequence generated by ResNet as input data is a complex but effective process. The following will elaborate on the training and optimization process of the LSTM model: Loss function selection: Select the mean absolute error (MAE) as the loss function to measure the difference between the model prediction result and the true water level value. Optimizer selection: Select SGD as the optimizer to update the weights and bias items of the model. Training process: 1) Input the training set data into the LSTM model and perform forward propagation to calculate the prediction result. 2) Use the loss function to calculate the difference between the prediction result and the true water level value, and calculate the gradient. 3) Propagate the gradient back to the network through the back propagation algorithm, and update the weights and bias items of the model. 4) Repeat the above process until the preset number of training rounds is reached or other stopping conditions are met. Through the grid search method, adjust the number of neurons, the number of layers, and the learning rate of the LSTM model to find the best model configuration. Regularization method: Use L1 or L2 regularization method to prevent model overfitting. Regularization method can be implemented by adding regularization term in loss function. Data enhancement: Perform data enhancement on water level information sequence and historical water level data, increase data diversity and model robustness by adding noise and time shift. Early stopping method: During training, if the loss of validation set no longer decreases or starts to increase, stop training to avoid model overfitting.
[0047] Specifically, the SGD function is as follows:
[0048] In the formula, represents the model parameters; represents the learning rate; Represents the loss function, which measures the model's performance in samples The prediction error on ; Represents the loss function with respect to the parameter The gradient of and Represent the features and labels of the i-th sample respectively.
[0049] In one embodiment, see Figure 3 As shown, when executing step 102, the following steps may be specifically performed: S1020: Input the real-time information of the current water level, historical water level data, rainfall data, water level-flow relationship data, topographic data, and time series data corresponding to meteorological data into the input layer of the water level prediction model, and input the output of the input layer into the short-term time memory network layer in the water level prediction model to obtain the output of the short-term time memory network layer.
[0050] Among them, historical water level data is the basis for predicting future water levels. By analyzing past water level changes, we can understand the laws and trends of water level changes, so as to predict future water levels. These data usually come from long-term water level monitoring stations, which record water level heights in different time periods. Rainfall is one of the main factors leading to rising water levels, so accurate rainfall data is crucial for predicting water levels. These data can be collected in real time through rain sensors, rain gauges and other equipment, or obtained through forecasts and observation data from meteorological departments. The water level-flow relationship refers to the corresponding relationship between water level and river flow. By analyzing this relationship, we can understand the flow of rivers at different water levels, so as to predict future water level changes. These data are usually obtained through water level and flow measurement equipment at hydrological monitoring stations. Topography has an important influence on water level changes. For example, the direction of the river, the shape of the riverbed, the slope of the two banks, etc. will affect the rise and fall of the water level. Therefore, when predicting water levels, it is necessary to consider topographic factors and obtain relevant topographic data. Meteorological conditions such as wind speed, wind direction, and air pressure will also affect water level changes. For example, strong winds may cause the water surface to fluctuate, thus affecting water level measurements; changes in air pressure may affect the density and volume of the water body, which in turn affects the water level. Therefore, when predicting water levels, meteorological factors need to be considered comprehensively.
[0051] S1021: Input the output of the short-term time memory network layer to the long-term time memory network layer in the water level prediction model to obtain the output of the long-term time memory network layer.
[0052] S1022: Input the output of the long-term time memory network layer into the prediction layer in the water level prediction model, output the water level prediction results at a series of time nodes, and determine the trend and law of water level changes based on the water level prediction results.
[0053] In this embodiment, neural network technology is used to solve the shortcomings of traditional flood control monitoring equipment in terms of accuracy, reliability and real-time performance. It aims to accurately analyze and predict water level data through deep learning algorithms to ensure the accuracy and real-time performance of water level monitoring data. It can also provide scientific and reasonable decision-making support for flood control work, so as to formulate response measures in advance, effectively prevent the impact of flood disasters on cities, and improve the level of intelligent urban management.
[0054] Furthermore, the real-time monitored water level information and the predicted results of future water level changes are displayed to users in a visual form, such as water level change curves and forecast trend graphs. Based on the forecast results, decision support for flood control work is provided, such as warning level classification and response measures. As time goes by and data accumulates, the water level monitoring model and water level forecasting model are regularly optimized and updated to improve the accuracy and robustness of the model. The performance of the monitoring model is monitored, and abnormal situations are promptly checked and handled.
[0055] In one embodiment, Figure 4 This is a detailed flow chart of a real-time water level prediction method provided according to an embodiment of the present invention. This embodiment is further optimized and expanded on the basis of the above embodiments. First, data collection and preprocessing are performed, ResNet model training is performed, model parameters are adjusted to obtain the optimal model, water level image features are extracted using the optimal model, a water level information time series is obtained, and the LSTM model is trained using the water level information time series and historical water level data. The optimal prediction model is obtained by adjusting and optimizing the model parameters, and the future water level change trend is predicted based on the model.
[0056] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0057] In a specific embodiment, in order to verify the effectiveness of the ResNet model proposed in this article in the field of reservoir water level monitoring and its feasibility in practical applications, a large reservoir, a medium-sized reservoir and a small reservoir were selected as experimental objects from May 1, 2024 to May 10, 2024 to ensure the comprehensiveness and representativeness of the experimental results. During the experiment, the water levels of the three reservoirs were monitored in real time using high-precision water level gauges, and the ResNet model was run at the same time to predict the water level. By comparing and analyzing the actual monitoring data of the water level gauge and the monitoring data of the ResNet model, the accuracy and reliability of the ResNet model in water level monitoring can be evaluated. For example, the experimental results data comparison Figure 5 shown.
[0058] The water level prediction model based on the long short-term memory network (LSTM) uses the monitored water level information sequence generated by ResNet as input data and combines it with historical water level data to train the LSTM model. To predict future water level changes, the water level meter monitoring data and prediction data, detailed comparison information is shown in Table 1 below.
[0059] Table 1: Comparison of monitoring data and LSTM model prediction data
[0060] like Figure 6 As shown, the following is an embodiment of the real-time water level prediction system provided by the embodiment of the present disclosure, which belongs to the same inventive concept as the real-time water level prediction method of the above-mentioned embodiments. For details not described in detail in the embodiment of the real-time water level prediction system, please refer to the embodiment of the above-mentioned real-time water level prediction method.
[0061] The data acquisition unit 60 is used to acquire a water level image of the monitoring area and pre-process the water level image to obtain a target water level image; A feature extraction unit 61 is used to extract features from a target water level image using a pre-built water level monitoring model, obtain feature data corresponding to the target water level data, and determine real-time information of the current water level based on the feature data, wherein the water level monitoring model is built based on a residual neural network; The water level prediction unit 62 is used to input the time series data corresponding to the real-time information of the current water level into a pre-trained water level prediction model so that the water level prediction model can predict future water level changes, wherein the water level prediction model is constructed based on a long short-term memory network.
[0062] In some implementations, the water level prediction unit 62 is specifically used to: Inputting the time series data corresponding to the real-time information of the current water level into the input layer of the water level prediction model, and inputting the output of the input layer into the short-term memory network layer in the water level prediction model to obtain the output of the short-term memory network layer; Inputting the output of the short-term time memory network layer into the long-term time memory network layer in the water level prediction model to obtain the output of the long-term time memory network layer; The output of the long-term time memory network layer is input into the prediction layer in the water level prediction model, and the water level prediction results at a series of time nodes are output. The trend and law of water level change are determined based on the water level prediction results.
[0063] Figure 7 It is a schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention.
[0064] The water level real-time prediction method provided in the embodiment of the present application can be applied to electronic devices. It will be appreciated by those skilled in the art that the electronic device structure involved in the embodiment of the present invention does not constitute a limitation on the electronic device, and the electronic device may include more or less components than shown, or combine certain components, or arrange different components. In the embodiment of the present invention, the electronic device includes but is not limited to a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples, and are not intended to limit the implementation of the embodiments of the present application described and / or required herein.
[0065] The electronic device may include a processor, an external memory interface, an internal memory, a universal serial bus (USB) interface, a charging management module, a power management module, a battery, a wireless communication module, an audio module, a speaker, a microphone, a sensor module, buttons, a camera, a display, and a SIM card interface, etc.
[0066] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0067] The processor may include one or more processing units, for example, the processor may include a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated into one or more processors.
[0068] The processor can be the nerve center and command center of the electronic device. The controller can generate an operation control signal according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0069] A memory may also be provided in the processor for storing instructions and data. In some embodiments, the memory in the processor is a cache memory. The memory may store instructions or data that the processor has just used or is cyclically used. If the processor needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor, and thus improves system efficiency.
[0070] The external memory interface can be used to connect an external memory card, such as a MicroSD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor through the external memory interface to implement data storage functions. For example, files such as music and videos can be saved in the external memory card.
[0071] The internal memory can be used to store computer executable program codes, which include instructions. The processor executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory. The internal memory may include a program storage area and a data storage area. The internal memory may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0072] The wireless communication function of an electronic device can be realized through an antenna, a wireless communication module, a modem processor, and a baseband processor.
[0073] The wireless communication module can provide wireless communication solutions for electronic devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc.
[0074] Electronic devices can implement audio functions, etc. through audio modules, speakers, receivers, microphones, headphone jacks, and application processors.
[0075] Electronic devices can achieve shooting functions through ISP, camera, video codec, GPU, display and application processor.
[0076] Electronic devices can achieve display functions through GPU, display screen and application processor.
[0077] The GPU is a microprocessor for image processing that connects the display screen and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor may include one or more GPUs that execute program instructions to generate or change display information.
[0078] The display screen is used to display images, videos, etc. The display screen includes a display panel.
[0079] The electronic device above implements the technical solution of the subject name of the real-time water level prediction method of this application, achieves accurate monitoring and prediction of water level height, and provides strong support for flood prevention and disaster reduction, water resources management and other fields. It has high scalability and flexibility, and can be applied to water level monitoring and prediction needs in different scenarios.
[0080] The storage medium provided in the present application stores a program product that can implement a real-time water level prediction method.
[0081] The real-time water level prediction method includes: collecting water level images of the monitored area, and preprocessing the water level images to obtain target water level images; using a pre-constructed water level monitoring model to extract features of the target water level image to obtain feature data corresponding to the target water level data, and determining the real-time information of the current water level based on the feature data, wherein the water level monitoring model is constructed based on a residual neural network; inputting the time series data corresponding to the real-time information of the current water level into a pre-trained water level prediction model so that the water level prediction model can predict future water level changes, wherein the water level prediction model is constructed based on a long short-term memory network.
[0082] In some possible implementations, the subject name of the present disclosure, real-time water level prediction method, can be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps described in the above "Exemplary Method" section of this specification according to various exemplary implementations of the present disclosure.
[0083] The storage medium of the present disclosure can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0084] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A real-time water level prediction method, characterized in that: include: Collecting a water level image of the monitored area and preprocessing the water level image to obtain a target water level image; A pre-built water level monitoring model is used to extract features from a target water level image, characteristic data corresponding to the target water level data is obtained, and real-time information of the current water level is determined based on the characteristic data, wherein the water level monitoring model is built based on a residual neural network; The time series data corresponding to the real-time information of the current water level is input into a pre-trained water level prediction model so that the water level prediction model can predict future water level changes, wherein the water level prediction model is constructed based on a long short-term memory network.
2. The real-time water level prediction method according to claim 1, characterized in that: The construction process of the water level monitoring model includes: Collect and annotate a water level image dataset, normalize the water level image dataset, and divide the normalized water level image dataset into training set images, validation set images, and test set images; Load the pre-trained residual neural network and change the number of fully connected layers to two to meet the output requirements of the water level classification task; Input the training set images into the residual neural network, perform forward propagation to calculate the prediction results, use the loss function to calculate the difference between the prediction results and the true labels, and calculate the gradient; The gradient is propagated back to the residual neural network through the back-propagation algorithm, and the parameters are updated. At the end of each training round, the performance of the water level monitoring model is evaluated using the validation set images, and the initial water level monitoring model that meets the requirements is recorded; After the training is completed, the test set images are used to evaluate the performance of the initial water level monitoring model and obtain the target water level monitoring model; Among them, the architecture of the water level monitoring model includes: input layer, convolution layer, pooling layer, residual block and fully connected layer.
3. The real-time water level prediction method according to claim 2, characterized in that: The process of propagating the gradient back to the residual neural network through the back-propagation algorithm and updating the parameters includes: The loss function is used to calculate the error between the predicted value of the water level monitoring model and the true label to guide the back propagation process; Calculate the partial derivative of the loss function with respect to the activation value of the output layer to obtain the gradient of the output layer; Using the chain rule, the gradient of the output layer is propagated back to the hidden layer and the gradient of the hidden layer is calculated; According to the gradient of the hidden layer, the gradient of the weights and biases in the residual neural network is calculated, and the weights and biases are updated according to the gradient descent method.
4. The real-time water level prediction method according to claim 3, characterized in that: The gradient descent update formula is: In the formula, represents the parameter value at time t, represents the parameter value at time t+1, represents the learning rate, Represents the loss function exist The gradient at .
5. The method for real-time water level prediction according to claim 1, characterized in that: The loss function of the water level prediction model is as follows: In the formula, n represents the number of samples, represents the actual observed value of the i-th sample; Represents the predicted value of the i-th sample.
6. The real-time water level prediction method according to claim 1, characterized in that: Inputting the time series data corresponding to the real-time information of the current water level into a pre-trained water level prediction model so that the water level prediction model can predict future water level changes, including: Input the real-time information of the current water level, historical water level data, rainfall data, water level-flow relationship data, topographic data, and time series data corresponding to meteorological data into the input layer of the water level prediction model, and input the output of the input layer into the short-term memory network layer in the water level prediction model to obtain the output of the short-term memory network layer; Inputting the output of the short-term time memory network layer into the long-term time memory network layer in the water level prediction model to obtain the output of the long-term time memory network layer; The output of the long-term time memory network layer is input into the prediction layer in the water level prediction model, and the water level prediction results at a series of time nodes are output. The trend and law of water level change are determined based on the water level prediction results.
7. A water level real-time prediction system, characterized in that: include: A data acquisition unit is used to acquire a water level image of the monitored area and pre-process the water level image to obtain a target water level image; A feature extraction unit, used to extract features from a target water level image using a pre-built water level monitoring model, obtain feature data corresponding to the target water level data, and determine real-time information of the current water level based on the feature data, wherein the water level monitoring model is built based on a residual neural network; The water level prediction unit is used to input the time series data corresponding to the real-time information of the current water level into a pre-trained water level prediction model so that the water level prediction model can predict future water level changes, wherein the water level prediction model is constructed based on a long short-term memory network.
8. The water level real-time prediction system according to claim 7, characterized in that: The water level prediction unit is specifically used for: Input the real-time information of the current water level, historical water level data, rainfall data, water level-flow relationship data, topographic data, and time series data corresponding to meteorological data into the input layer of the water level prediction model, and input the output of the input layer into the short-term memory network layer in the water level prediction model to obtain the output of the short-term memory network layer; Inputting the output of the short-term time memory network layer into the long-term time memory network layer in the water level prediction model to obtain the output of the long-term time memory network layer; The output of the long-term time memory network layer is input into the prediction layer in the water level prediction model, and the water level prediction results at a series of time nodes are output. The trend and law of water level change are determined based on the water level prediction results.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the real-time water level prediction method according to any one of claims 1 to 6 are implemented.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the real-time water level prediction method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Water level monitoring method and device, electronic device and storage medium
CN109543596A
Waterwheel chamber water level intelligent prediction method based on long-short-term memory network
CN111340284A
Reservoir level time sequence prediction method and system
CN112990598A
River water quality inversion method based on deep learning, electronic equipment and storage medium
CN117392564A
Underground water level multi-step prediction method based on convolutional attention long-short term neural network
CN117520784A
Cited By
Underground water level monitoring device and underground water level monitoring method
CN120213164A
Space-air-ground integrated flood runoff remote sensing monitoring method, system, equipment and medium
CN121564538A