A method for saltwater tide upstream forecasting in estuary areas using machine learning algorithms

Through machine learning algorithms and GRU models, the salt tide trajectory in the estuary area is predicted, and the problem of salinity exceeding the standard in the existing technology is solved, scientific prediction and early warning are achieved, and the safe utilization of freshwater resources is ensured.

CN118674101BActive Publication Date: 2025-09-05SOUTHERN MARINE SCI & ENG GUANGDONG LAB (ZHUHAI) +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410730759.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2025-09-05
Estimated Expiration
2044-06-06

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively predict and predict the upward phenomenon of salt tides in the estuary area, resulting in an excessive salinity and affecting the utilization of freshwater resources and human health.

Method used

Using machine learning algorithms, the GRU model is used to combine partial correlation coefficient and Pearson correlation coefficient preferred forecast factors to conduct salinity forecasts traced from salt tides in the estuary area. By collecting and pre-processing hydrological meteorological data, the GRU model is input to the GRU model for salinity prediction.

Benefits of technology

Accurate prediction of salty tides in the estuary area of ​​the dry water period has been achieved, providing a scientific basis for salinity exceeding the standard, supporting timely intervention and prevention and control, and ensuring the safety of freshwater resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118674101B_ABST
    Figure CN118674101B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of hydrological and water resource application technology, and more specifically, to a method for predicting upstream saltwater tides in estuaries using a machine learning algorithm. Partial correlation coefficients and Pearson correlation coefficients are used to optimize forecasting factors with appropriate lead times. These optimized forecasting factors are then input into a GRU (Gated Recurrent Unit) model to perform salinity forecasts for different forecast periods. This method can effectively predict the salinity of upstream saltwater tides in estuaries during the dry season, providing a scientific basis for early warning of salinity exceeding standards in estuaries and enabling timely intervention and prevention.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of hydrology and water resources application technology, and more specifically, to a method for predicting saltwater tide upstream in estuary areas by using a machine learning algorithm. Background Art

[0002] Saltwater upstreaming refers to the phenomenon of tidal seawater flowing upstream into freshwater rivers at estuaries. In recent years, with the increasing impact of global climate change and human activities, this phenomenon has become increasingly severe, causing significant economic losses and social impacts to coastal areas. Estuaries, where the coast meets inland waters, are subject to complex hydrodynamic conditions due to the combined influence of upstream water and offshore tidal forces. During high tide, high-salinity seawater, driven by tidal forces, intrudes from the estuary into the river channel, causing a sharp increase in the chloride content of the water. During low tide, saltwater in the river channel is transported to the open sea by the tidal current and upstream water, with freshwater runoff also having a strong diluting effect on the saltwater. During the dry season, runoff is weak, allowing the highly concentrated saltwater to mix and diffuse with upstream freshwater in the estuary, causing salt to flow upstream and increase the salinity of the river channel. This process is known as salt upstreaming. The upstream movement of saltwater can have a significant negative impact on freshwater resource utilization, industrial and agricultural production, and aquatic habitats in estuaries. According to national water supply standards, the chloride content in drinking water sources should not exceed 250 mg / L. Long-term consumption of water with excessive chloride levels can seriously harm human health. Summary of the Invention

[0003] In order to overcome the above-mentioned defects in the prior art, the present invention provides a method for predicting the upstream saltwater tide in estuary areas by using a machine learning algorithm, and uses a machine learning model to quickly and effectively predict the upstream saltwater tide in estuary areas.

[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0005] A method for predicting saltwater tide upstream in estuary areas using a machine learning algorithm comprises the following steps:

[0006] S1. Select the research area and collect relevant data;

[0007] S2. Preprocess the collected data accordingly to prepare for data input into the model;

[0008] S3. Select several salinity series with different lag times as self-source regression items;

[0009] S4. Select several other predictor sequences at different times as exogenous driving factors;

[0010] S5. Using the above selected prediction factor sequence to input the gated recurrent unit (GRU) model to predict salinity for different forecast periods;

[0011] S6. Evaluate the forecast accuracy of the model. Once the expected accuracy is achieved, use the real-time data of the region to predict future salinity values ​​as needed.

[0012] According to the above technical solution, the present invention collects data from the target area during the dry season, uses the partial correlation coefficient and the Pearson correlation coefficient to optimize the prediction factors with appropriate lead times, and then uses the optimized prediction factors to input into the GRU (Gated Recurrent Unit) model to predict salinity at different forecast periods. The method of the present invention can effectively predict the salinity value of the salt tide upstream in the estuary during the dry season, providing a scientific basis for early warning of salinity exceeding the standard in the estuary and timely intervention and prevention.

[0013] Furthermore, step S1 includes: by analyzing the influencing factors of the physical process of saltwater tide upstream, collecting the measured hydrological and meteorological data of the target area during the dry season, including daily salinity data, daily minimum tide level and hourly tide level data, daily flow data, and daily wind speed and direction data.

[0014] Furthermore, the data preprocessing in step S2 includes the following steps:

[0015] S21. Calculate the daily skewness of the hourly tide data as the tidal wave asymmetry index; the calculation formula is:

[0016]

[0017] Where: x i is the time derivative of water level; N is the sequence length; γ is positive, indicating the dominance of rising tide, and vice versa, the dominance of falling tide;

[0018] S22. Project the wind speed to the north-south direction, defining south wind as positive, as the wind speed and direction factor;

[0019] S23. Determine the input factors including salinity factor, tide level factor, runoff factor, wind speed and direction factor, and tidal wave asymmetry factor.

[0020] Furthermore, step S3 includes: calculating and visualizing the partial correlation coefficients between salinity sequences with different lag times, and selecting the sequence corresponding to the lag time with the higher partial correlation coefficient as the input data sequence of the model.

[0021] Furthermore, step S4 includes calculating the Pearson correlation coefficient between the tide level factor sequence, runoff factor sequence, wind speed and direction factor sequence, tidal wave asymmetry factor sequence and salinity factor sequence at different lead times. The calculation method of the Pearson correlation coefficient is as follows:

[0022]

[0023] O i With P i are the salinity on the i-th day and the prediction factors at different lead times, and the R value range is [-1,1], which indicates the degree of linear correlation. Its absolute value close to 1 indicates that the greater the correlation, the better the fit;

[0024] The exogenous driving items of the advance time series with larger correlation coefficients, including tide level series, flow series, wind speed and direction series, and tidal wave asymmetry index series, are taken as the input data series of the model.

[0025] Furthermore, the step S5 includes:

[0026] S51. First, import the Python libraries needed for prediction, and then import the preprocessed input data sequence;

[0027] S52. After normalizing the input data, the training and test sets are divided into training and test sets in an 8:2 ratio. The lag salinity with high partial autocorrelation coefficients and the lead tidal level, discharge, wind speed and direction, and tidal wave asymmetry index sequences with high Pearson correlation coefficients are used as the training and test sample feature vectors X, and the target salinity is used as the corresponding training and test sample Y, in preparation for the input model.

[0028] S53. Build the GRU model and set the corresponding model parameters. The GRU (Gated Recurrent Unit), also known as the gated recurrent unit structure, is a variant of the traditional recurrent neural network (RNN). Like the long short-term memory network (LSTM), it can effectively capture the associations between long sequences and alleviate the phenomenon of vanishing or exploding gradients. Its structure and calculations are simpler than those of the LSTM. Its basic structure is shown in the figure below. The GRU memory unit contains two gates: the update gate and the reset gate. The formula for its output is as follows:

[0029] z t =σ(w z ·[h t-1 ,x t ])

[0030] r t =σ(w r ·[h t-1 ,x t ])

[0031]

[0032] Where z t is the input of the update gate, wz is the weight of the update gate, σ is the S-shaped function, x t is the input value of the neuron structure, y t is the output value of the neuron structure, h t-1 is the output value of the previous hidden layer, h t is the output value of the next hidden layer, r t is the output of the reset gate, w r To reset the gate weights, is the current memory and tanh is the activation function.

[0033] Furthermore, the prediction accuracy of the evaluation model in step S6 includes:

[0034] The Nash efficiency coefficient NSE, root mean square error RMSE, mean absolute error MAE, and correlation coefficient R are used to evaluate the salinity forecast of the model. The calculation methods of NSE, RMSE, and MAE are as follows:

[0035]

[0036] Where, P i With O i are the predicted and observed salinity values ​​for day i, respectively; and are the average values ​​of salinity forecast and observation respectively; n is the total number of samples; NSE ranges from (-∞,1], when NSE=1, it indicates that the model forecast is completely consistent; when NSE=0, it indicates that the forecast result has the same explanatory power as the mean of the observation; when NSE<0, it indicates that the model forecast effect is lower than the mean forecast method; RMSE and MAE are used to express the difference between the forecast and the observation, and when the difference increases, they gradually increase from 0 to +∞.

[0037] Furthermore, in step S6, the Kling–Gupta efficiency coefficient KGE is used to evaluate the prediction accuracy of the model:

[0038]

[0039] Where r is the correlation coefficient between the observation and forecast series; α represents the variability of the two series, and its value is the ratio of the standard deviation of the forecast series to the standard deviation of the observation series; β is the bias term, and its value is the ratio of the mean of the forecast series to the mean of the observation series; when KGE = 1, it indicates that the model forecast is completely consistent; when KGE ≈ -0.41, it indicates that the explanatory power of the forecast results is the same as the mean of the observations; when KGE < -0.41, it indicates that the model forecast effect is lower than the mean forecast method.

[0040] The present invention further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-described method when executing the computer program.

[0041] The present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.

[0042] Compared with the existing technology, the present invention has the following advantages: the method provided by the present invention uses a machine learning algorithm to predict the upstream salt tide in estuaries, uses the partial correlation coefficient and the Pearson correlation coefficient to optimize the prediction factors with appropriate lead time, and then uses the optimized prediction factors to input the GRU (Gated Recurrent Unit) model to predict salinity at different forecast periods. The method of the present invention can effectively predict the salinity value of the upstream salt tide in estuaries during the dry season, providing a scientific basis for early warning of salinity exceeding the standard in estuaries and timely intervention and prevention. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a schematic flow chart of the method of the present invention.

[0044] Figure 2 It is the basic structure of the gated recurrent unit neuron.

[0045] Figure 3 is the partial autocorrelation coefficient of the salinity series with different lags in Example 2.

[0046] Figure 4 These are the model forecast results for different forecast periods in Example 2. DETAILED DESCRIPTION

[0047] 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, rather than all the embodiments. The present invention is described in one of the embodiments below in combination with the specific implementation methods. Among them, the drawings are only for illustrative purposes and represent only schematic diagrams rather than physical drawings, and cannot be understood as limiting the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.

[0048] In the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", etc. indicate an orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, it is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the positional relationship in the accompanying drawings are only for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to the specific circumstances. In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features specified as "first" or "second" can explicitly or implicitly include at least one of the features. In addition, the meaning of "and / or" appearing throughout the text includes three parallel solutions. Taking "A and / or B" as an example, it includes solution A, solution B, or solutions that meet both A and B.

[0049] Example 1:

[0050] like Figure 1 As shown, a method for predicting saltwater tide upstream in estuary areas using a machine learning algorithm includes the following steps:

[0051] Step 1. Select the research area and collect relevant data.

[0052] By analyzing the influencing factors of the physical process of saltwater tide upstream, we collected hydrological and meteorological data during the dry season in the target area, including daily salinity data, daily minimum tide level and hourly tide level data, daily flow data, and daily wind speed and direction data.

[0053] Step 2. Preprocess the collected data accordingly to prepare for data input into the model.

[0054] The data preprocessing includes the following steps:

[0055] S21. Calculate the daily skewness of the hourly tide data as the tidal wave asymmetry index; the calculation formula is:

[0056]

[0057] Where: x i is the time derivative of water level; N is the sequence length; γ is positive, indicating the dominance of rising tide, and vice versa, the dominance of falling tide;

[0058] S22. Project the wind speed to the north-south direction, defining south wind as positive, as the wind speed and direction factor;

[0059] S23. Determine the input factors including salinity factor, tide level factor, runoff factor, wind speed and direction factor, and tidal wave asymmetry factor.

[0060] Step 3. Select several salinity series with different lags as auto-source regression items.

[0061] The partial correlation coefficients between salinity series at different lag times were calculated and visualized, and the series corresponding to the lag time with the higher partial correlation coefficient were selected as the input data series of the model.

[0062] Step 4. Select several other predictor sequences at different times as exogenous driving items.

[0063] The Pearson correlation coefficients between the tide level factor sequence, runoff factor sequence, wind speed and direction factor sequence, tidal wave asymmetry factor sequence and salinity factor sequence at different lead times are calculated. The calculation method of the Pearson correlation coefficient is as follows:

[0064]

[0065] O i With P i are the salinity on the i-th day and the prediction factors at different lead times, and the R value range is [-1,1], which indicates the degree of linear correlation. Its absolute value close to 1 indicates that the greater the correlation, the better the fit;

[0066] The exogenous driving items of the advance time series with larger correlation coefficients, including tide level series, flow series, wind speed and direction series, and tidal wave asymmetry index series, are taken as the input data series of the model.

[0067] Step 5. Use the prediction factor sequence selected above to input the gated recurrent unit (GRU) model to predict salinity for different forecast periods.

[0068] S51. First, import the Python libraries needed for prediction, and then import the preprocessed input data sequence;

[0069] S52. After normalizing the input data, the training and test sets are divided into training and test sets in an 8:2 ratio. The lag salinity with high partial autocorrelation coefficients and the lead tidal level, discharge, wind speed and direction, and tidal wave asymmetry index sequences with high Pearson correlation coefficients are used as the training and test sample feature vectors X, and the target salinity is used as the corresponding training and test sample Y, in preparation for the input model.

[0070] S53. Build the GRU model and set the corresponding model parameters. The GRU (Gated Recurrent Unit), also known as the gated recurrent unit structure, is a variant of the traditional recurrent neural network (RNN). Like the long short-term memory network (LSTM), it can effectively capture the associations between long sequences and alleviate the phenomenon of vanishing or exploding gradients. Its structure and calculations are simpler than those of the LSTM. Its basic structure is shown in the figure below. The GRU memory unit contains two gates: the update gate and the reset gate. The formula for its output is as follows:

[0071] z t =σ(w z ·[h t-1 ,x t ])

[0072] r t =σ(w r ·[h t-1 ,x t ])

[0073]

[0074]

[0075] Where z t is the input of the update gate, w z is the weight of the update gate, σ is the S-shaped function, x t is the input value of the neuron structure, y t is the output value of the neuron structure, h t-1 is the output value of the previous hidden layer, h t is the output value of the next hidden layer, r t is the output of the reset gate, w r To reset the gate weights, is the current memory, and tanh is the activation function. The basic structure diagram of the gated recurrent unit neuron is as follows Figure 2 shown.

[0076] Step 6. Evaluate the forecast accuracy of the model. Once the expected accuracy is achieved, use the real-time data of the region to predict future salinity values ​​as needed.

[0077] The Nash efficiency coefficient NSE, root mean square error RMSE, mean absolute error MAE, and correlation coefficient R are used to evaluate the salinity forecast of the model. The calculation methods of NSE, RMSE, and MAE are as follows:

[0078]

[0079] Where, P i With Oi are the predicted and observed salinity values ​​for day i, respectively; and are the average values ​​of salinity forecast and observation respectively; n is the total number of samples; NSE ranges from (-∞,1], when NSE=1, it indicates that the model forecast is completely consistent; when NSE=0, it indicates that the forecast result has the same explanatory power as the mean of the observation; when NSE<0, it indicates that the model forecast effect is lower than the mean forecast method; RMSE and MAE are used to express the difference between the forecast and the observation, and when the difference increases, they gradually increase from 0 to +∞.

[0080] In addition, the Kling–Gupta efficiency coefficient KGE can also be used to evaluate the prediction accuracy of the model:

[0081]

[0082] Where r is the correlation coefficient between the observation and forecast series; α represents the variability of the two series, and its value is the ratio of the standard deviation of the forecast series to the standard deviation of the observation series; β is the bias term, and its value is the ratio of the mean of the forecast series to the mean of the observation series; when KGE = 1, it indicates that the model forecast is completely consistent; when KGE ≈ -0.41, it indicates that the explanatory power of the forecast results is the same as the mean of the observations; when KGE < -0.41, it indicates that the model forecast effect is lower than the mean forecast method.

[0083] This method collects dry season data from a target region and uses partial correlation coefficients and Pearson correlation coefficients to select predictors with appropriate lead times. These predictors are then input into a GRU (Gated Recurrent Unit) model to predict salinity at different forecast times. This method effectively predicts the salinity of saltwater tides upstream in estuaries during the dry season, providing a scientific basis for early warning of salinity violations in estuaries and enabling timely intervention and prevention.

[0084] Example 2:

[0085] This embodiment provides a method for predicting saltwater tides using a machine learning algorithm, comprising the following steps:

[0086] Step 1. Collect the measured hydrological and meteorological historical data of the Modaomen Waterway during the dry season from 2012 to 2022, including the daily average salinity data of Pinggang Station, the daily minimum tide and hourly tide data of Sanzao Station, the daily average flow data of Makou Station, and the wind direction and speed data of Macao, China. The wind speed and direction data of Macao, China were downloaded from the Geophysical and Meteorological Bureau of the Macao Special Administrative Region of China ( https: / / www.smg.gov.mo / en ).

[0087] Step 2. Calculate the daily skewness of the hourly tide data as the tidal wave asymmetry index. Project the wind speed to the north-south direction, assuming south winds are positive, to use this as the wind speed and direction factor. The input factors for training and testing the forecast model are determined to be salinity, tide level, runoff, wind speed and direction, and tidal wave asymmetry.

[0088] Step 3. Calculate the partial autocorrelation coefficient of the salinity series at different lags. The calculation results are as follows: Figure 3 shown.

[0089] Step 4. Calculate the Pearson correlation coefficients between the tide level factor sequence, runoff factor sequence, wind speed and direction factor sequence, and tidal wave asymmetry factor sequence and salinity factor sequence at different lead times, and make salinity forecasts with a forecast period of 1 day, 2 days, and 3 days respectively. The selected forecast factors are shown in Table 1.

[0090] Table 1 Prediction factor optimization results

[0091]

[0092] Where, S is the salinity of Pinggang Station (mg / L); F is the combined flow of Sanshui Makou (m 3 / s); T is the daily lowest tide level at Sanzao station (m); W is the projection of the wind speed in Macao, China in the north-south direction (m / s); K is the daily tidal wave asymmetry index, dimensionless; S(t-1) represents the salinity one time step ahead of the salinity forecast value, and the same applies to other variables.

[0093] Step 5. Next, prepare the data and build the model. First, import the Python library required for prediction and import the preprocessed input data. After normalizing the input data, divide the training set and test set into 8:2. Use the salinity with high partial autocorrelation coefficient for the corresponding lag time and the tide level factor, flow factor, wind speed and direction factor, and tidal wave asymmetry factor sequence with high Pearson correlation coefficient for the corresponding lead time as the training and test sample feature vector X, and use the target salinity as the corresponding training and test sample Y to prepare for the input model. Before all data is input, in order to avoid the dimensional influence between the various forecast factors, it is necessary to normalize the data. The results of the training set and test set division of the historical data sequence used in this case are shown in Table 2.

[0094] Table 2: Partition of training set and test set

[0095]

[0096]

[0097] Construct a GRU model, set the corresponding model parameters, and train the model using different parameter combinations to construct an appropriate model. The 1-day forecast model directly uses the selected predictor factors for model training and forecasting. The 2-day forecast model first uses the selected predictor sequence to call the trained 1-day forecast model for forecasting, resulting in a 1-day salinity forecast result sequence. This salinity forecast result sequence is then input along with the selected predictor sequence for training and testing the 2-day forecast model. The 3-day forecast model first uses the selected predictor sequence to call the trained 1-day and 2-day forecast models for forecasting, resulting in 1-day and 2-day salinity forecast result sequences. These two salinity forecast result sequences are then input along with the selected predictor sequence for training and testing the 3-day forecast model. Each prediction using the model requires denormalization of the prediction result data.

[0098] Step 6. Use NSE, KGE, RMSE, MAE, and R to evaluate the model prediction accuracy, and obtain the model prediction results for the forecast period of 1 day, 2 days, and 3 days respectively. Figure 2 The model accuracy evaluation is shown in Table 3.

[0099] Table 3 Model prediction accuracy evaluation

[0100]

[0101] The prediction results of the model are visualized as follows Figure 4 As shown. Figure 2 As can be seen from Table 3, the method for predicting saltwater tides using machine learning algorithms according to the present invention can effectively predict saltwater tides in estuaries at different forecast periods. The trained salinity prediction model can be saved and directly called when applied, and the calculation is fast and effective.

[0102] Example 3

[0103] This embodiment provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the method described in Example 1 when executing the computer program.

[0104] Example 4

[0105] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method described in Embodiment 1 are implemented.

[0106] In the description of this specification, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.

[0107] Obviously, the above embodiments of the present invention are merely examples for the purpose of clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. Those skilled in the art will appreciate that other variations or modifications can be made based on the above description. It is not necessary and impossible to enumerate all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the claims of the present invention.

Claims

1. A method for predicting saltwater tide upstream in estuary areas using a machine learning algorithm, characterized in that: The following steps are involved: S1. Select a research area and collect relevant regional data. By analyzing the factors affecting the physical process of saltwater upwelling, collect hydrological and meteorological data during the dry season in the target area, including daily salinity data, daily minimum and hourly tide data, daily flow data, and daily wind speed and direction data. S2. Preprocess the collected data accordingly to prepare for data input into the model; The following steps are involved: S21. Calculate the daily skewness of the hourly tide data as the tidal wave asymmetry index; the calculation formula is: Where: x i is the time derivative of water level; N is the sequence length; γ is positive, indicating the dominance of rising tide, and vice versa, the dominance of falling tide; S22. Project the wind speed to the north-south direction, defining south wind as positive, as the wind speed and direction factor; S23. Determine the input factors including salinity factor, tidal level factor, runoff factor, wind speed and direction factor, and tidal wave asymmetry factor; S3. Select several salinity series with different lags as autoregressive terms; calculate and visualize the partial correlation coefficients between the salinity series with different lags, and select the series corresponding to the lag with the higher partial correlation coefficient as the input data series of the model; S4. Select several other prediction factor sequences at different times as exogenous driving factors; calculate the Pearson correlation coefficients between the tide level factor sequence, runoff factor sequence, wind speed and direction factor sequence, tidal wave asymmetry factor sequence, and salinity factor sequence at different lead times. The calculation method of the Pearson correlation coefficient is as follows: O i With P i are the salinity on the i-th day and the prediction factors at different lead times, and the R value range is [-1,1], which indicates the degree of linear correlation. Its absolute value close to 1 indicates that the greater the correlation, the better the fit; The exogenous driving items of the advance time series with larger correlation coefficients, including tide level series, flow series, wind speed and direction series, and tidal wave asymmetry index series, are taken as the input data series of the model; S5. Using the above selected prediction factor sequence to input the gated recurrent unit (GRU) model to predict salinity for different forecast periods; including: S51. First, import the Python libraries needed for prediction, and then import the preprocessed input data sequence; S52. After normalizing the input data, the training and test sets are divided into training and test sets in an 8:2 ratio. The lag salinity with high partial autocorrelation coefficients and the lead tidal level, discharge, wind speed and direction, and tidal wave asymmetry index sequences with high Pearson correlation coefficients are used as the training and test sample feature vectors X, and the target salinity is used as the corresponding training and test sample Y, in preparation for the input model. S53. Build the GRU model and set the corresponding model parameters. The GRU memory unit contains two gates, namely the update gate and the reset gate. The formula for its output is as follows: z t =σ(w z ·[h t-1 ,x t ]) r t =σ(w r ·[h t-1 ,x t ]) Where z t is the input of the update gate, w z is the weight of the update gate, σ is the S-shaped function, x t is the input value of the neuron structure, h t-1 is the output value of the previous hidden layer, h t is the output value of the next hidden layer, r t is the output of the reset gate, w r To reset the gate weights, is the current memory, tanh is the activation function; S6. Evaluate the forecast accuracy of the model. Once the expected accuracy is achieved, use the real-time data of the region to predict future salinity values ​​as needed.

2. The method for predicting saltwater tide upstream in estuary areas using a machine learning algorithm according to claim 1, wherein: The prediction accuracy of the evaluation model in step S6 includes: The Nash efficiency coefficient NSE, root mean square error RMSE, mean absolute error MAE, and correlation coefficient R are used to evaluate the salinity forecast of the model. The calculation methods of NSE, RMSE, and MAE are as follows: Where, P i With O i are the predicted and observed salinity values ​​for day i, respectively; and are the average values ​​of salinity forecast and observation respectively; n is the total number of samples; NSE ranges from (-∞,1], when NSE=1, it indicates that the model forecast is completely consistent; when NSE=0, it indicates that the forecast result has the same explanatory power as the mean of the observation; when NSE<0, it indicates that the model forecast effect is lower than the mean forecast method; RMSE and MAE are used to express the difference between the forecast and the observation, and when the difference increases, they gradually increase from 0 to +∞.

3. The method for predicting saltwater tide upstream in estuary areas using a machine learning algorithm according to claim 2, wherein: In step S6, the Kling–Gupta efficiency coefficient KGE is used to evaluate the prediction accuracy of the model: Where r is the correlation coefficient between the observation and forecast series; α represents the variability of the two series, and its value is the ratio of the standard deviation of the forecast series to the standard deviation of the observation series; β is the bias term, and its value is the ratio of the mean of the forecast series to the mean of the observation series; when KGE = 1, it indicates that the model forecast is completely consistent; when KGE ≈ -0.41, it indicates that the explanatory power of the forecast results is the same as the mean of the observations; when KGE < -0.41, it indicates that the model forecast effect is lower than the mean forecast method.

4. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 are implemented.

5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Multi-feature-factor red tide prediction model based on GRU deep learning

    CN112365093A