River ice condition state prediction method based on LSTM
Through the river ice condition prediction method based on LSTM, combined with meteorological and water condition forecasting, an LSTM river ice condition prediction model is constructed, which solves the problems of many parameters and large prediction errors in the existing ice condition forecasting methods, and achieves high-precision and high-speed ice condition prediction, supporting decisions on ice prevention and disaster reduction.
Patent Information
- Application Number
- CN202411873623.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-11
AI Technical Summary
The existing ice situation forecasting methods have problems such as many parameters, complex modeling processes and large prediction errors. Especially in extreme weather conditions, it is difficult to achieve accurate prediction of the ice situation status of the river.
The river ice condition state prediction method based on LSTM is adopted, combined with meteorological forecasting and water condition forecasting, by constructing the LSTM river ice condition prediction model, considering the physical mechanism of river ice condition, iterative training and model parameter tuning is carried out to achieve the prediction of river ice condition state.
It improves the prediction accuracy and speed of the river ice condition state, can effectively predict the ice condition state of the entire ice condition period, reduces the parameters and modeling complexity in traditional methods, and improves the decision-making support ability for preventing and disaster reduction.
Smart Images

Figure CN119809115A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of ice condition prediction based on deep learning, and in particular to a method for predicting river ice conditions based on LSTM. Background Art
[0002] River closure and river opening are important seasonal hydrological events in cold regions. When a river is closed, ice jams and ice dams may form to block the water flow and cause the water level to rise. When a river is opened, ice may hit hydraulic structures. Both may cause ice disasters, seriously threatening the safety of both sides of the river. Whether the river ice conditions can be predicted (forecasted) in a timely and accurate manner and the status of ice in the river is the key to ice prevention decision-making and command and dispatch.
[0003] Traditional ice forecasting methods mainly include numerical simulation and mathematical statistics. The numerical simulation method predicts river ice conditions by establishing one-dimensional and two-dimensional mathematical physics equations. This method has many input parameters and high boundary conditions, which greatly limits the actual application of this method in ice forecasting. The mathematical statistics method is based on the physical causes of ice conditions. It uses measured data to establish empirical formulas for ice conditions and related factors to forecast river ice conditions. However, due to the complexity of hydrological and meteorological factors each year, the model prediction results are unstable, especially under extreme weather conditions, and the prediction error is large.
[0004] In recent years, LSTM (Long Short Term Memory) based on time series has been tried to be applied to ice forecasting research. Ma Zhijin et al. used LSTM recurrent neural network to construct a prediction method for the closure date of the Ningmeng River section of the Yellow River. Ding Hong et al. proposed a method that combines signal decomposition technology with LSTM to construct a model for predicting the opening date of rivers in northern China. However, the above methods still have the following limitations.
[0005] First, the above model only uses the time series of the dates of river closure or opening for modeling and prediction, but does not or rarely considers the influencing factors and process mechanisms of river closure and opening, and lacks effective physical meaning support, which leads to large prediction errors of the model.
[0006] Second, the model established by the above method is only used to predict the date of river closure or river opening, and it does not realize the prediction of the entire ice flow process from ice floe to freezing and then to river opening. Summary of the invention
[0007] To solve the above technical problems, the embodiment of the present application proposes a method for predicting river ice conditions based on LSTM, which can combine weather forecasts and water situation forecasts to quickly predict the river ice conditions and river opening and closing dates in the future, which is of great significance for ice prevention and disaster reduction.
[0008] To achieve the above-mentioned purpose, an embodiment of the present application proposes a method for predicting river ice conditions based on LSTM, the method comprising: collecting river ice condition data, constructing river ice condition characteristics and river ice condition based on the collected river ice condition data, and obtaining sample data; dividing the sample data into a training set and a test set according to a preset ratio, and preprocessing them respectively; based on the physical mechanism of river ice condition prediction, constructing an LSTM river ice condition prediction model, initializing model parameters, and using the training set to iteratively train the LSTM river ice condition prediction model until convergence; based on the test set and preset accuracy evaluation indicators, performing accuracy evaluation on the LSTM river ice condition prediction model, and optimizing model parameters of the LSTM river ice condition prediction model based on the accuracy evaluation results; inputting the river ice condition data of the target river into the LSTM river ice condition prediction model to obtain a prediction result of the river ice condition of the target river.
[0009] To achieve the above-mentioned purpose, an embodiment of the present application also proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a river ice condition prediction method based on LSTM as described above.
[0010] To achieve the above objectives, an embodiment of the present application further proposes a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement a river ice condition prediction method based on LSTM as described above.
[0011] The embodiment of the present application proposes a method for predicting the ice condition of a river channel based on LSTM, which takes the LSTM recurrent network model as the basic architecture, and designs an LSTM river channel ice condition prediction model that uses the model prediction results as the model input at the same time on the basis of considering the main physical factors affecting the ice condition of the river channel. The model can predict the ice condition of the river channel during the entire ice condition period, with high prediction accuracy and fast prediction speed, avoiding the problems of many parameters, complex modeling process and low accuracy of the traditional ice condition prediction model. The LSTM river channel ice condition prediction model constructed by the present application is used to predict the ice condition of the river channel, which can be combined with weather forecasts and water condition forecasts to predict the ice condition of the river channel and the date of river opening and closing in a certain period in the future, which is of great significance for ice prevention and disaster reduction.
[0012] In some optional embodiments, the collected river ice data includes the daily maximum temperature T max , daily minimum temperature T min , daily average temperature T a, average daily flow Q, river channel curvature coefficient s, river channel upper and lower section width ratio g, and river channel ice condition O; the river channel ice condition characteristics constructed based on the collected river channel ice condition data are expressed by the formula: in, is the accumulated negative temperature, R is the river parameter, R = s × g, and the river ice state O is both a component of the input river ice feature F of the LSTM river ice prediction model and the output of the LSTM river ice prediction model. This design can continuously predict the river ice state based on the output of the LSTM river ice prediction model, combined with meteorological forecasts and water conditions forecasts, until the river ice state from the beginning of ice flow to the complete opening of the river is predicted.
[0013] In some optional embodiments, during the ice flow period of the river channel, the ice condition O of the river channel is expressed by the ice flow density, that is, the ratio of the ice flow width of the river channel section to the water flow section. During the frozen period of the river channel, the ice condition O of the river channel is expressed by the normalized ice surface thickness, and the normalized ice surface thickness is calculated by the following formula: in, represents the average ice thickness on the third day of the river closure period in the past 10 years, h represents the actual ice thickness on that day, and h * Represents the normalized ice thickness of the day. Normalizing the ice thickness can make the ice conditions of the river channel during the floating ice period and the frozen period uniform and continuous in value, thus better realizing the prediction of the ice conditions of the river channel.
[0014] In some optional embodiments, the collected river ice condition data is the river ice condition data of the sample river in the past 10 years, and the constructed sample data is the sample data of the past 10 years;
[0015] The sample data is divided into training set and test set according to the preset ratio, including:
[0016] The sample data of the first 8 years constitute the training set, and the sample data of the last 2 years constitute the test set;
[0017] The preprocessing of the training set is z-score standardization, which is achieved by the following formula:
[0018]
[0019] Where n represents the total number of features in the training set, represents the i-th feature of the j-th sample data in the training set, mu i Represents the mean of the i-th feature in the training set, sig i represents the standard deviation of the i-th feature in the training set, It represents the feature after z-score normalization of the i-th feature of the j-th sample data in the training set.
[0020] In some optional embodiments, preprocessing the test set is implemented by the following formula:
[0021]
[0022] in, represents the i-th feature of the j-th sample data in the test set, mu i Represents the mean of the i-th feature in the training set, sig i represents the standard deviation of the i-th feature in the training set, Represents the feature after preprocessing of the i-th feature of the j-th sample data in the test set.
[0023] In some optional embodiments, the constructed LSTM river ice prediction model includes 1 input layer, 2 LSTM layers, 2 Dropout layers, 1 fully connected layer and 1 output layer, and the model parameters mainly include the maximum number of cycles, the minimum batch size, the number of hidden layer neurons, the dropout ratio and the learning rate; the LSTM river ice prediction model is iteratively trained to convergence using the training set, including: determining the input time step t of the LSTM river ice prediction model, and gradually combining the sample data in the training set according to the input time step t to obtain several groups of short-time sample data; inputting several groups of short-time sample data into the LSTM river ice prediction model, iteratively training the LSTM river ice prediction model, and adjusting the model parameters of the LSTM river ice prediction model with the prediction accuracy and loss as the measurement indicators until the prediction accuracy is greater than 90% and the loss is reduced to the 1e-4 level. Different input time steps t will make the model have different prediction capabilities, and reasonable adjustment of the input time step t will enable the model to obtain stronger prediction capabilities and improve the prediction accuracy and prediction speed of the model.
[0024] In some optional embodiments, based on the test set and the preset accuracy evaluation index, the accuracy of the LSTM river ice condition prediction model is evaluated, and the model parameters of the LSTM river ice condition prediction model are tuned based on the accuracy evaluation result, including: selecting the average relative error as the accuracy evaluation index, using the measured value of the river ice condition of the sample data in the test set, and the predicted value of the river ice condition of the sample data in the test set output by the LSTM river ice condition prediction model to perform accuracy evaluation, and the accuracy evaluation formula is expressed as: Among them, Y(τ) represents the measured value of the river ice state on the τth day, y0(τ) represents the predicted value of the river ice state on the τth day, T is the total number of calculated days, and MRE represents the accuracy evaluation result. By changing the input time step t and the model parameters of the LSTM river ice prediction model, the model training and model parameter tuning process are repeated until the accuracy evaluation result reaches the preset target, and the optimal LSTM river ice prediction model is obtained.
[0025] In some optional embodiments, the river ice condition data of the target river is input into the LSTM river ice condition prediction model to obtain a prediction result of the river ice condition of the target river, including: determining a prediction period d, which is the forecast period of the LSTM river ice condition prediction model; inputting the river ice condition characteristics of the target river into the LSTM river ice condition prediction model, and in each round of prediction period, each step of the prediction result will update the river ice condition of the next day, and the river ice condition prediction is performed day by day by continuously updating the river ice condition characteristics input into the LSTM river ice condition prediction model at each step until the dth day is predicted, thereby obtaining a prediction result of the river ice condition of the target river. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the related technologies, the drawings required for use in the embodiments of the present application or the related technical descriptions will be briefly introduced below. Obviously, the following drawings are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. The drawings described here are only used to explain the present application and are not used to limit the present application.
[0027] Figure 1 is a flow chart of a method for predicting river ice conditions based on LSTM provided in one embodiment of the present application;
[0028] Figure 2 It is a schematic diagram of a model structure of an LSTM river ice condition prediction model provided in an embodiment of the present application;
[0029] Figure 3 It is a schematic diagram of the principle of predicting river ice conditions using the LSTM river ice condition prediction model provided in one embodiment of the present application;
[0030] Figure 4 It is a comparison chart of the first-day predicted value and the measured value of the river ice condition at the Sanhu River Estuary from 2023 to 2024 provided in an embodiment of the present application;
[0031] Figure 5It is a comparison chart of the second-day predicted value and the measured value of the river ice condition at the Sanhu River Estuary from 2023 to 2024 provided in an embodiment of the present application;
[0032] Figure 6 It is a comparison chart of the third-day predicted value and the measured value of the river ice condition at the Sanhu River Estuary from 2023 to 2024 provided in an embodiment of the present application;
[0033] Figure 7 is a schematic diagram of a river ice condition prediction system based on LSTM provided in another embodiment of the present application;
[0034] Figure 8 It is a structural schematic diagram of an electronic device provided in another embodiment of the present application. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. It will be appreciated by those skilled in the art that in the embodiments of the present application, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can also be implemented. The division of the following embodiments is for the convenience of description, and the specific implementation of the present application should not be limited in any way. The various embodiments can be combined and referenced with each other without contradiction.
[0036] An embodiment of the present application proposes a method for predicting river ice conditions based on LSTM, which is applied to an electronic device, wherein the electronic device may be a terminal or a server, and this embodiment and the following embodiments are all described by taking the server as an example. The following is a specific description of the implementation details of the method for predicting river ice conditions based on LSTM proposed in this embodiment, and the following content is only provided for the convenience of understanding the implementation details, and is not necessary for the implementation of this solution.
[0037] The specific process of the river ice condition prediction method based on LSTM proposed in this embodiment can be as follows: Figure 1 As shown, including:
[0038] Step 101, collecting river ice condition data, constructing river ice condition characteristics and river ice condition status based on the collected river ice condition data, and obtaining sample data.
[0039] In the specific implementation, the server first needs to obtain sample data, which is achieved by collecting river ice data. The server selects a sample river, collects the historical river ice data of the sample river, and constructs river ice characteristics and river ice status based on the collected river ice data to obtain sample data. It should be noted that the river ice characteristics are actually the input of the LSTM river ice prediction model to be constructed later, and the river ice status is the output of the LSTM river ice prediction model to be constructed later. However, the river ice status predicted in the current step will also be used as part of the river ice characteristics to predict the river ice status in the next step.
[0040] In one example, taking the Sanhu River Estuary as an example, the Sanhu River Estuary enters the ice drift period from mid-November every year and the river is completely open in mid-to-late March of the following year. For modeling purposes, the server needs to collect river ice data from November 6 to March 30 of the following year, so the river ice data obtained each year totals 145 days (leap year data is collected until March 29).
[0041] In one example, the river ice condition data collected by the server includes the daily maximum temperature T max , daily minimum temperature T min , daily average temperature T a , average daily flow Q, channel curvature coefficient s, channel upper and lower section width ratio g, and channel ice state O, where the channel ice state O is the measured value. During the ice flow period, the channel ice state O is expressed by the ice flow density, and during the frozen period, the channel ice state O is expressed by the normalized ice surface thickness.
[0042] In one example, the channel curvature coefficient s = actual length of the channel / straight length of the channel, and the upper and lower section width ratio of the channel g = width of the channel at its narrowest point / width of the channel at its widest point.
[0043] In an example, the river ice condition characteristics constructed by the server based on the collected river ice condition data can be expressed by the following formula:
[0044]
[0045] in, is the accumulated negative air temperature, R is the river parameter, R = s × g, and the river ice state O is both a component of the input river ice feature F of the LSTM river ice prediction model and the output of the LSTM river ice prediction model.
[0046] The river ice state O is both the output of the model and a component of the model's input. In this way, the river ice state can be continuously predicted based on the model's output, combined with weather forecasts and water situation forecasts, until the river ice state from the beginning of ice flow to the complete opening of the river is predicted.
[0047] In one example, the cumulative negative temperature The meaning is to calculate the average daily temperature T on the date a It is the sum of negative values. For example, if the calculation date is 4 days, the average daily temperature on the first day is T a is 1℃, and the average daily temperature on the second day is T a The average daily temperature on the third day is -1℃. a The average daily temperature on the fourth day is -1.5℃. a is -2.2℃, then the cumulative negative temperature The value is -4.7℃.
[0048] In one example, the channel curvature coefficient s, the upper and lower section width ratio g, and the channel parameter R are not obtained by calculating the entire river channel. Taking the Sanhu Estuary as an example, we can generally select a 10km long river channel upstream and downstream of the Sanhu Estuary hydrological station for calculation.
[0049] In one example, during the ice-flowing period, the river begins to form ice but is not completely frozen. The ice state O of the river can be expressed by the ice density, that is, the ratio of the ice width of the river section to the water-passing section. During the freezing period, the river surface is completely frozen and there is no water passing through. Therefore, the ice state O of the river can be expressed by the normalized ice surface thickness. The normalized ice surface thickness can be calculated by the following formula:
[0050]
[0051] in, represents the average ice thickness on the third day of the river closure period in the past 10 years, h represents the actual ice thickness on that day, and h * Represents the normalized ice thickness for the day.
[0052] It is worth noting that the ice surface on the third day of the river closure period is already frozen solid, which is more reliable than the first two days, while the ice thickness will continue to grow after the third day and is not suitable for normalization. Normalizing the ice thickness can make the ice conditions of the river in the floating ice period and the frozen period unified and continuous in numerical value, thereby better realizing the prediction of the river ice conditions.
[0053] Step 102: divide the sample data into a training set and a test set according to a preset ratio, and preprocess them separately.
[0054] In a specific implementation, after completing the construction of the sample data, the server can divide the sample data into a training set and a test set according to a preset ratio, and pre-process them separately.
[0055] In one example, the Sanhu Estuary was selected as a sample river. The server collected river ice data from the Sanhu Estuary for the past 10 years and constructed sample data from the Sanhu Estuary for the past 10 years. The Sanhu Estuary enters the ice drift period from mid-November every year and the river is completely open in mid-to-late March of the following year. A total of 145 days of river ice data were collected each year. The server formed a training set with sample data from the first 8 years, so there were 145×8=1160 sample data in the training set, and formed a test set with sample data from nearly 2 years, so there were 145×2=290 sample data in the test set.
[0056] In one example, the server preprocesses the training set by z-score normalization, which can be implemented by the following formula:
[0057]
[0058] Where n represents the total number of features in the training set, represents the i-th feature of the j-th sample data in the training set, mu i Represents the mean of the i-th feature in the training set, sig i represents the standard deviation of the i-th feature in the training set, It represents the feature of the i-th feature of the j-th sample data in the training set after z-score standardization. After z-score standardization, the mean of the river ice condition feature of each sample data in the training set is 0 and the variance is 1.
[0059] In one example, the server's preprocessing of the test set needs to refer to the preprocessing of the training set, which is implemented by the following formula:
[0060]
[0061] in, represents the i-th feature of the j-th sample data in the test set, mu i Represents the mean of the i-th feature in the training set, sig i represents the standard deviation of the i-th feature in the training set, Represents the feature after preprocessing of the i-th feature of the j-th sample data in the test set.
[0062] Step 103, based on the physical mechanism of river ice condition prediction, construct an LSTM river ice condition prediction model, initialize the model parameters, and use the training set to iteratively train the LSTM river ice condition prediction model until convergence.
[0063] In the specific implementation, after completing the construction and preprocessing of the training set and test set, the server can build an LSTM river ice condition prediction model based on the physical mechanism of river ice condition prediction. After initializing the model parameters, the training set is used to iteratively train the LSTM river ice condition prediction model until convergence.
[0064] In an example, Figure 2 As shown in Figure 2, the LSTM river ice condition prediction model built by the server mainly consists of 1 input layer, 2 LSTM layers ( Figure 2 LSTM1 and LSTM2 in ), 2 Dropout layers ( Figure 2 The model parameters mainly include the maximum number of cycles, the minimum batch size, the number of hidden layer neurons, the dropout ratio and the learning rate. After the LSTM river ice prediction model is constructed, the server needs to initialize these model parameters.
[0065] In one example, when the server uses the training set to iteratively train the LSTM river ice prediction model until convergence, it first needs to determine the input time step t of the LSTM river ice prediction model, and gradually combine the sample data in the training set according to the input time step t to obtain several groups of short-term sample data. Taking t=3 as an example, the server needs to gradually combine the three consecutive days of sample data in the training set, such as combining the first to third days into the first group of short-term sample data, the second to fourth days into the second group of short-term sample data, and the third to fifth days into the third group of short-term sample data. For the Sanhu Estuary, there are 145 sample data per year. After combination, 143 groups of short-term sample data will be obtained, and the size of the training set becomes 143×8=1144.
[0066] Different input time steps t will give the model different prediction capabilities. Reasonable adjustment of the input time step t will enable the model to obtain stronger prediction capabilities, thereby improving the model's prediction accuracy and prediction speed.
[0067] After completing the step-by-step combination of sample data in the training set, the server needs to input several groups of short-term sample data into the LSTM river ice prediction model, iteratively train the LSTM river ice prediction model, and use prediction accuracy and loss as measurement indicators to adjust the model parameters of the LSTM river ice prediction model until the prediction accuracy is greater than 90% and the loss is reduced to the 1e-4 level. As the number of iterations continues to increase, the loss will become more and more stable.
[0068] In one example, the selected loss may be cross entropy loss, L2 loss, etc.
[0069] In an example, the working principle of the LSTM river ice forecasting model can be as follows: Figure 3 As shown, Figure 3 The d in represents the prediction period, and m represents the total number of sample data in the training set.
[0070] Step 104, based on the test set and the preset accuracy evaluation index, the accuracy of the LSTM river ice condition prediction model is evaluated, and the model parameters of the LSTM river ice condition prediction model are tuned based on the accuracy evaluation result.
[0071] In the specific implementation, after the server trains the LSTM river ice condition prediction model to a prediction accuracy greater than 90% and the loss is reduced to the 1e-4 level, it is necessary to evaluate the accuracy of the LSTM river ice condition prediction model based on the test set and preset accuracy evaluation indicators, and optimize the model parameters of the LSTM river ice condition prediction model based on the accuracy evaluation results.
[0072] In one example, the server selects the average relative error as the accuracy evaluation index, and uses the measured values of the river ice conditions of the sample data in the test set and the predicted values of the river ice conditions of the sample data in the test set output by the LSTM river ice condition prediction model to perform accuracy evaluation. The accuracy evaluation formula is expressed as:
[0073]
[0074] Among them, Y(τ) represents the measured value of the river ice condition on the τth day, y0(τ) represents the predicted value of the river ice condition on the τth day, T is the total number of calculated days, and MRE represents the accuracy evaluation result.
[0075] In one example, during the parameter tuning process, the server changes the input time step t and the model parameters of the LSTM river ice condition prediction model, repeats the model training and model parameter tuning process until the accuracy evaluation result reaches the preset target, and the optimal LSTM river ice condition prediction model can be obtained.
[0076] In one example, the server sets the input time step t to 2, 3, 4, and 5, and performs different combinations of the sample data in the training set to perform parameter tuning. Finally, it is determined that when t = 3, the ice condition of the river is The best prediction effect can be achieved when the cumulative negative temperature is 4 days. The optimal model parameters are the maximum number of cycles of 1000, the minimum batch size of 143, which is the number of annual data samples, the number of hidden layers of 128, the dropout ratio of 0.2, and the learning rate of 0.001.
[0077] Step 105, inputting the river ice condition data of the target river into the LSTM river ice condition prediction model to obtain a prediction result of the river ice condition of the target river.
[0078] In the specific implementation, after the server obtains the optimal LSTM river ice condition prediction model, the model can be put into use, and the river ice condition data of the target river can be input into the LSTM river ice condition prediction model to obtain the prediction result of the river ice condition of the target river.
[0079] In one example, the server needs to determine the prediction period d, which is the forecast period of the LSTM river ice prediction model. The prediction period d can be determined during model training or during the model usage phase. The server inputs the ice condition characteristics of the target river into the LSTM river ice prediction model. In each round of prediction cycle, each prediction result will update the river ice condition of the next day. By continuously updating the river ice condition in the river ice condition characteristics input into the LSTM river ice prediction model at each step, the river ice condition is predicted day by day until the dth day is predicted, and the prediction result of the river ice condition of the target river is obtained.
[0080] It can be understood that, assuming t=3, d=7, and the prediction time is December 4, the server will use the sample data of December 1, December 2, and December 3 to form a set of short-term sample data to predict the river ice state on December 4, then based on the weather forecast, water forecast, and the predicted river ice state on December 4, construct the sample data of December 4, use the sample data of December 2, December 3, and December 4 to form a set of short-term sample data to predict the river ice state on December 5, and so on, until the river ice state on December 10 is predicted. The next round of prediction time will be December 11, and the server will use the sample data of December 8, December 9, and December 10 to form a set of short-term sample data to predict the river ice state on December 11.
[0081] In one example, the server used the optimal LSTM river ice condition prediction model to predict the ice conditions at the Three Lakes Estuary from 2022 to 2023 and from 2023 to 2024. Table 1 shows the average errors on different prediction days from 2022 to 2023 and from 2023 to 2024. Figure 4 , Figure 5 , Figure 6They are respectively the comparison of the prediction results and the measured values on the first, second and third days of the entire ice period from 2023 to 2024. According to the actual production of river ice forecast, during the river closure period, when the ice density reaches 0.1, the river is considered to have begun to flow, when the ice density is greater than 0.7, the river is considered to have begun to close, and during the river opening period, when the ice density is less than 0.1, the river is considered to be completely open. Based on this, the river opening and closing dates from 2022 to 2023 and 2023 to 2024 were counted, and the results are shown in Table 2.
[0082] Table 1: Average error of ice state prediction at the three lake estuaries from 2022 to 2024
[0083]
[0084] Table 2: Comparison of observed dates and predicted dates for ice conditions at the three lake estuaries from 2022 to 2024
[0085]
[0086]
[0087] Based on Tables 1 and 2, it can be seen that from the perspective of the prediction period, as the prediction date is gradually postponed, the prediction error tends to increase gradually, but the increasing trend is not very obvious. For different ice periods, the prediction error of the floating ice period is relatively small, followed by the freezing period, and the prediction error of the river opening period is the largest. Although the prediction errors of the ice state values are different, and even the largest average error is 0.28, the predictions of the dates such as the beginning of floating ice, the beginning of freezing, and the complete river opening are relatively accurate, and the maximum prediction error of the model is only 1 day. Even under extreme weather conditions, the model prediction accuracy is still accurate. For example, from 2022 to 2023, the river channel floating ice date is only 2 days. From the model results, the error of the prediction one day in advance is 0, and the error of the prediction three days in advance is only 1 day. The model accuracy can meet the needs of ice prevention production.
[0088] The present embodiment proposes a method for predicting the ice condition of a river channel based on LSTM, which takes the LSTM cyclic network model as the model infrastructure. On the basis of considering the main physical factors affecting the ice condition of the river channel, an LSTM river channel ice condition prediction model is designed that uses the model prediction results as the model input at the same time. The model can effectively predict the ice condition of the river channel during the entire ice condition period, with high prediction accuracy and fast prediction speed, avoiding the problems of many parameters, complex modeling process and low accuracy of the traditional ice condition prediction model. The LSTM river channel ice condition prediction model constructed by the present embodiment is used to predict the ice condition of the river channel, which can be combined with weather forecasts and water condition forecasts to quickly predict the ice condition of the river channel and the dates of opening and closing the river in the future, which is of great significance for ice prevention and disaster reduction.
[0089] The steps of the above methods are divided only for the purpose of clear description. They can be combined into one step or some steps can be decomposed into multiple steps during implementation. As long as they include the same logical relationship, they are all within the scope of protection of this application. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but not changing the core design of the algorithm and process, are all within the scope of protection of this application.
[0090] Accordingly, another embodiment of the present application proposes a river ice condition prediction system based on LSTM. The details of the river ice condition prediction system based on LSTM proposed in this embodiment are specifically described below. The following content is only the implementation details provided for the convenience of understanding and is not necessary for the implementation of this example. Figure 7 It is a structural diagram of a river ice condition prediction system based on LSTM proposed in this embodiment, including: a sample acquisition module 201, a sample division module 202, a model training module 203, a model parameter tuning module 204 and a model use module 205.
[0091] The sample acquisition module 201 is used to collect river ice condition data, construct river ice condition characteristics and river ice condition status based on the collected river ice condition data, and obtain sample data.
[0092] The sample division module 202 is used to divide the sample data into a training set and a test set according to a preset ratio, and pre-process them respectively.
[0093] The model training module 203 is used to construct an LSTM river ice condition prediction model based on the physical mechanism of river ice condition prediction, initialize model parameters, and iteratively train the LSTM river ice condition prediction model using a training set until convergence.
[0094] The model parameter tuning module 204 is used to evaluate the accuracy of the LSTM river ice condition prediction model based on the test set and the preset accuracy evaluation index, and to tune the model parameters of the LSTM river ice condition prediction model based on the accuracy evaluation result.
[0095] The model using module 205 is used to input the river ice condition data of the target river into the LSTM river ice condition prediction model to obtain the prediction result of the river ice condition of the target river.
[0096] It is not difficult to find that this embodiment is a system embodiment corresponding to the above method embodiment, and this embodiment can be implemented in conjunction with the above method embodiment. The relevant technical details and technical effects mentioned in the above embodiments are still valid in this embodiment, and in order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the above embodiments.
[0097] It is worth mentioning that all modules involved in this embodiment are logic modules. In practical applications, a logic unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of this application, this embodiment does not introduce units that are not closely related to solving the technical problems proposed by this application, but this does not mean that there are no other units in this embodiment.
[0098] Accordingly, another embodiment of the present application provides an electronic device, the specific structure of which can be as follows: Figure 8 As shown, it includes: at least one processor 301; and a memory 302 that is communicatively connected to the at least one processor 301; wherein the memory 302 stores instructions that can be executed by the at least one processor 301, and the instructions are executed by the at least one processor 301 so that the at least one processor 301 can execute a river ice condition prediction method based on LSTM as described in the above-mentioned method embodiments.
[0099] The memory and the processor are connected by a bus, which includes any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories. The bus can also connect various other circuits such as peripherals, voltage regulators and power management circuits, which are well known in the art and are not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium.
[0100] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.
[0101] Correspondingly, another embodiment of the present application proposes a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement a river ice condition prediction method based on LSTM as described in the above method embodiments.
[0102] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including a number of instructions to enable a device (such as a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. Storage media include: U disk, mobile hard disk, read-only memory, random access memory, disk or optical disk and other media that can store program codes.
[0103] It can be understood by those skilled in the art that the above embodiments are specific embodiments for implementing the present application, and in actual applications, various changes can be made to them in form and detail without departing from the spirit and scope of the present application. For those skilled in the art, several improvements and modifications can be made without departing from the principles of the present application, and these improvements and modifications are also considered to be within the scope of protection of the present application.
Claims
1. A method for predicting river ice conditions based on LSTM, characterized in that: include: Collect river ice condition data, construct river ice condition characteristics and river ice condition status based on the collected river ice condition data, and obtain sample data; Divide the sample data into training set and test set according to the preset ratio, and preprocess them respectively; Based on the physical mechanism of river ice prediction, an LSTM river ice prediction model was constructed, the model parameters were initialized, and the LSTM river ice prediction model was iteratively trained using the training set until convergence. Based on the test set and the preset accuracy evaluation indicators, the accuracy of the LSTM river ice prediction model is evaluated, and the model parameters of the LSTM river ice prediction model are optimized based on the accuracy evaluation results; The river ice condition data of the target river is input into the LSTM river ice condition prediction model to obtain the prediction result of the river ice condition of the target river.
2. The method for predicting river ice conditions based on LSTM according to claim 1, characterized in that: The river ice condition data collected include the daily maximum temperature T max , daily minimum temperature T min , daily average temperature T a , average daily flow Q, river channel curvature coefficient s, upper and lower section width ratio g, and river channel ice condition O; The river ice condition characteristics constructed based on the collected river ice condition data are expressed by the formula: in, is the accumulated negative air temperature, R is the river parameter, R = s × g, and the river ice state O is both a component of the input river ice feature F of the LSTM river ice prediction model and the output of the LSTM river ice prediction model.
3. The method for predicting river ice conditions based on LSTM according to claim 2, characterized in that: During the period of river ice flow, the river ice state O is expressed by the ice density, that is, the ratio of the ice width of the river section to the water section. During the period of river freezing, the river ice state O is expressed by the normalized ice surface thickness, which is calculated by the following formula: in, represents the average ice thickness on the third day of the river closure period in the past 10 years, h represents the actual ice thickness on that day, and h * Represents the normalized ice thickness for the day.
4. The method for predicting river ice conditions based on LSTM according to claim 1, characterized in that: The river ice condition data collected are the river ice condition data of the sample river in the past 10 years, and the constructed sample data are the sample data of the past 10 years; The sample data is divided into training set and test set according to the preset ratio, including: The sample data of the first 8 years constitute the training set, and the sample data of the last 2 years constitute the test set; The preprocessing of the training set is z-score standardization, which is achieved by the following formula: Where n represents the total number of features in the training set, represents the i-th feature of the j-th sample data in the training set, mu i Represents the mean of the i-th feature in the training set, sig i represents the standard deviation of the i-th feature in the training set, It represents the feature after z-score normalization of the i-th feature of the j-th sample data in the training set.
5. The method for predicting river ice conditions based on LSTM according to claim 4, characterized in that: The preprocessing of the test set is achieved by the following formula: in, represents the i-th feature of the j-th sample data in the test set, mu i Represents the mean of the i-th feature in the training set, sig i represents the standard deviation of the i-th feature in the training set, Represents the feature after preprocessing of the i-th feature of the j-th sample data in the test set.
6. The method for predicting river ice conditions based on LSTM according to claim 1, characterized in that: The constructed LSTM river ice condition prediction model includes 1 input layer, 2 LSTM layers, 2 Dropout layers, 1 fully connected layer and 1 output layer. The model parameters mainly include the maximum number of cycles, the minimum batch size, the number of hidden layer neurons, the dropout ratio and the learning rate. The LSTM river ice condition prediction model is iteratively trained using the training set until convergence, including: Determine the input time step t of the LSTM river ice condition prediction model, and gradually combine the sample data in the training set according to the input time step t to obtain several groups of short-term sample data; Several groups of short-term sample data are input into the LSTM river ice condition prediction model, and the LSTM river ice condition prediction model is iteratively trained. The prediction accuracy and loss are used as measurement indicators to adjust the model parameters of the LSTM river ice condition prediction model until the prediction accuracy is greater than 90% and the loss is reduced to the 1e-4 level.
7. The method for predicting river ice conditions based on LSTM according to claim 6, characterized in that: Based on the test set and the preset accuracy evaluation indicators, the accuracy of the LSTM river ice prediction model is evaluated, and the model parameters of the LSTM river ice prediction model are optimized based on the accuracy evaluation results, including: The average relative error is selected as the accuracy evaluation index, and the accuracy evaluation is performed using the measured values of the river ice conditions of the sample data in the test set and the predicted values of the river ice conditions of the sample data in the test set output by the LSTM river ice prediction model. The accuracy evaluation formula is expressed as: Among them, Y(τ) represents the measured value of the river ice state on the τth day, y0(τ) represents the predicted value of the river ice state on the τth day, T is the total number of days calculated, and MRE represents the accuracy evaluation result; By changing the input time step t and the model parameters of the LSTM river ice condition prediction model, the model training and model parameter tuning process are repeated until the accuracy evaluation result reaches the preset target, and the optimal LSTM river ice condition prediction model is obtained.
8. A method for predicting river ice conditions based on LSTM according to any one of claims 1 to 7, characterized in that: The ice condition data of the target river is input into the LSTM river ice condition prediction model to obtain the prediction results of the ice condition of the target river, including: Determine the prediction period d, which is the forecast period of the LSTM river ice condition prediction model; The ice condition characteristics of the target river are input into the LSTM river ice condition prediction model. In each round of prediction cycle, each prediction result will update the river ice condition of the next day. By continuously updating the river ice condition characteristics input into the LSTM river ice condition prediction model at each step, the river ice condition is predicted day by day until the dth day is predicted, and the prediction result of the river ice condition of the target river is obtained.
9. An electronic device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a method for predicting river ice conditions based on LSTM as described in any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it can implement a method for predicting river ice conditions based on LSTM as described in any one of claims 1 to 8.
Citation Information
Cited By
Flow real-time automatic measurement method under influence of canal ice cover
CN122237697A