River channel water body dissolved oxygen prediction method based on information construction
By constructing and pre-processing the dissolved oxygen data of river water, combined with the LSTM neural network model, the problem of unquantitled day-night change characteristics in dissolved oxygen prediction is effectively solved, and the prediction accuracy is improved.
Patent Information
- Application Number
- CN202411878769.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-08
AI Technical Summary
The existing dissolved oxygen prediction model fails to effectively consider the day-night alternation of dissolved oxygen data in water, resulting in limitations in prediction accuracy.
Using an information-based construction method, data preprocessing of dissolved oxygen data in river water bodies is carried out, including linear interpolation method, local outlier factor algorithm and SG filter, and the LSTM neural network prediction model is further constructed, and the day-night change characteristics and time-change laws of dissolved oxygen are input.
By quantifying the day-night volatility and daily change patterns of dissolved oxygen, the accuracy of the prediction of dissolved oxygen is improved, and the limitations of prediction accuracy caused by the large day-night volatility of dissolved oxygen is overcome.
Smart Images

Figure CN119782740A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of environmental information processing, and in particular to a method for predicting dissolved oxygen in river water based on information construction. Background Art
[0002] The concentration of dissolved oxygen (DO) in river water directly affects the quality of water. Dissolved oxygen is a necessary condition for the survival, growth and reproduction of fish and invertebrates, and is an important indicator for evaluating water quality. Usually, when the concentration of dissolved oxygen in water is too high, fish will suffer from bubble disease due to inhaling too many bubbles, and even die in severe cases. When the concentration of dissolved oxygen in water is too low, the self-purification ability of the water body will be weakened, increasing the probability of aquatic organisms getting sick. Therefore, accurate prediction and control of dissolved oxygen is particularly important.
[0003] In previous studies, people often use machine learning methods for dissolved oxygen prediction, such as extreme learning machines, support vector machines, etc. In recent years, deep learning models are more capable of capturing long-term dependencies, nonlinear relationships, and temporal relationships in time series data, and have strong adaptability to high-dimensional time series data, mainly including convolutional neural networks (CNN), gated recurrent units (GRU), temporal convolutional networks (TCN), and long short-term memory networks (LSTM).
[0004] Long short-term memory (LSTM) networks are widely used in dissolved oxygen prediction as an efficient deep learning neural network. However, most of these prediction models only consider the seasonal periodic variation trend of dissolved oxygen in the time dimension. In fact, dissolved oxygen data in water bodies also have obvious diurnal alternation. However, its diurnal variation characteristics and daily time variability have not been quantified and applied to the prediction research of dissolved oxygen. The large diurnal fluctuation of dissolved oxygen will lead to the problem of limited prediction accuracy. Summary of the invention
[0005] In order to solve the above technical problems, the present invention provides a method for predicting dissolved oxygen in river water based on information construction, comprising the following steps:
[0006] S1. Preprocess the original time series data collected by the water quality sensor and the automatic weather station in the river. First, use the linear interpolation method to interpolate the original time series data. Then use the local outlier factor algorithm to detect the outliers. Finally, use the SG filter to smooth the water quality time series to obtain the preprocessed dissolved oxygen time series.
[0007] S2, quantifying the difference between the maximum and minimum values of daily dissolved oxygen concentration and the daily time point into numerical values as information construction;
[0008] S3, build LSTM neural network prediction model;
[0009] S4, initializing the LSTM neural network prediction model, taking the preprocessed dissolved oxygen time series and the two time series features for information construction as inputs of the LSTM neural network prediction model, and taking dissolved oxygen as output of the LSTM neural network prediction model;
[0010] S5. Initialize the network parameters of the LSTM neural network prediction model, use the error output by the LSTM neural network prediction model as the iteration basis, so as to determine the hyperparameters, and then use the hyperparameters for the LSTM neural network prediction model to finally output the dissolved oxygen prediction results.
[0011] The technical solution further defined in the present invention is:
[0012] Furthermore, in step S1, the missing data is filled using linear interpolation, and the calculation formula is as follows:
[0013]
[0014] Among them, q represents the number of interpolation steps, which is used to determine the relative position of the interpolation point; r represents the total number of steps in the interpolation interval, which defines the number of division steps between two known points; k represents the known point x k The index of k+q Indicates that the water quality sensor loses data at time k+q; x k and x k+r They represent the original data collected by the water quality sensor at the kth and k+rth moments respectively.
[0015] As described above, in the method for predicting dissolved oxygen in river water based on information construction, in step S1, a density-based local outlier factor algorithm is used to detect outliers in the original time series data. Given a data set O and an object p, the method for calculating the LOF value of p specifically includes the following steps:
[0016] S1.1.1. Calculate the k-distance of object p:
[0017] d k (p) = d(p, o)
[0018] Where point o is the kth neighbor of point p, and d(p, o) is the Euclidean distance between point p and point o;
[0019] S1.1.2. Calculate the reachable distance:
[0020] reach_dist k (p, o) = max{d k (o), d(p, o)}
[0021] Among them, d k (o) represents the k-distance of point o;
[0022] S1.1.3. Calculate the local reachability density:
[0023]
[0024] Among them, N k (p) is the set of k nearest neighbors of point p, |N k (p)| is the number of k nearest neighbors of point p;
[0025] S1.1.4. Calculate the local outlier factor:
[0026]
[0027] Among them, lrd k (o) is the local reachability density of point o, lrd k (p) is the local reachability density of point p.
[0028] As described above, in the method for predicting dissolved oxygen in river water based on information construction, in step S1, using the SG filter to smooth the water quality time series specifically includes the following steps:
[0029] S1.2.1. The subsequence x with a window size of w=2m+1 is expressed as:
[0030] {x s-m , ..., x s ,...x s+m}, s∈[-m,m]
[0031] Where x is the input sequence data, m is the radius of the window, s is the current center point index of the sliding window, sm and s+m represent the starting index and ending index of the data point in the sliding window in the sequence x;
[0032] S1.2.2. Define the R-order polynomial p(i) used to fit the data points in the window as follows:
[0033]
[0034] Among them, a v is the vth coefficient of the SG filter, i represents the relative position of the point relative to the center of the window;
[0035] S1.2.3. Use the least squares method to minimize the error. The formula is as follows:
[0036]
[0037] Among them, ∈ represents the sum of errors, xs+i Represents the value of the actual data point at position i;
[0038] By calculating a 0 Find the best fit p(0) for the center point x of the window. By sliding the window, each point in the sequence x will become the center point of the window until all values in the sequence are smoothed.
[0039] As described above, in the method for predicting dissolved oxygen in river water based on information construction, in step S2, the daily time points are quantified into time features as information construction, and the formula is as follows:
[0040]
[0041] Among them, x.hour is the hour of the date, and x.minute is the minute of the date.
[0042] As described above, in the method for predicting dissolved oxygen in river water based on information construction, in step S2, the difference between the maximum and minimum values of daily dissolved oxygen concentration is used as information construction, and the formula is as follows:
[0043] DO_different=max(DO)-min(DO)
[0044] Among them, max(DO) is the maximum value of dissolved oxygen per day, and min(DO) is the minimum value of dissolved oxygen per day.
[0045] As described above, in a method for predicting dissolved oxygen in river water based on information construction, in step S3, the LSTM neural network prediction model includes three gating units, namely a forget gate, an input gate, and an output gate. The forget gate is used to decide when to forget the previous cell state information, the input gate is used to decide when to update the cell state, and the output gate is used to decide when to output the hidden state and cell state information.
[0046] As mentioned above, in the method for predicting dissolved oxygen in river water based on information construction, in the LSTM neural network prediction model, the forget gate is used to decide when to forget the information of the previous cell state. The formula is as follows:
[0047] f t =σ(W f [h t-1 , x t ]+b f )
[0048] Among them, f t is the output of the forget gate, σ is the sigmoid activation function, x t is the input of the current time step, h t-1 is the output of the hidden state at the previous time step, W fand b f is the weight parameter and bias of the forget gate;
[0049] The input gate is used to decide when to update the cell state, and the formula is as follows:
[0050] i t =σ(W i [h t-1 , x t ]+b i )
[0051]
[0052] Among them, i t is the output of the input gate, is the candidate value vector, W i and b i is the weight parameter and bias of the input gate, W C and b C are the weight parameters and bias of the candidate value vector;
[0053] Update the cell status, the formula is as follows:
[0054]
[0055] Among them, C t and C t-1 is the cell state at the current time step and the previous time step;
[0056] The output gate is used to decide when to output the hidden state and cell state information. The formula is as follows:
[0057] o t =σ(w o [h t-1 , x t ]+b o )
[0058] h t =o t *tanh(C t )
[0059] Among them, t is the output of the output gate, h t and h t-1 is the output of the hidden state of the current time step and the previous time step, w o and b o are the weight parameters and bias of the output gate.
[0060] As described above, in the method for predicting dissolved oxygen in river water based on information construction, in step S4, the number of layers of the LSTM neural network prediction model is n, and the hidden state dimension of each layer of LSTM is hj where \(0 \lt j \lt n + 1\), the input of the LSTM neural network prediction model is denoted as \(x\) 1 , \(x\) 2 ,..., \(x\) n , and the expected output is denoted as \(y\); the pre - processed dissolved oxygen time - series data includes dissolved oxygen, pH, water temperature, air temperature, humidity, air pressure, total radiation, wind direction, wind speed, rainfall, PM2.5, and PM10.
[0061] For a method for predicting dissolved oxygen in river water bodies based on information construction as described above, in step S5, taking the error of the output of the LSTM neural network prediction model as the iteration basis, the hyperparameters batch size, number of iterations, and learning rate are determined, and then the hyperparameters are used in the LSTM neural network prediction model to finally output the dissolved oxygen prediction result.
[0062] The beneficial effects of the present invention are:
[0063] In the present invention, 11 index parameters related to water quality data and weather environment data related to the prediction of dissolved oxygen in river water bodies are involved. Since there may be data missing and noise in river water body and meteorological data, the density - based local outlier factor (LOF) algorithm and linear interpolation method are used for outlier detection and data filling, and SG filtering is used to denoise the data. According to the diurnal volatility of dissolved oxygen and the daily change law of dissolved oxygen, the difference between the highest value and the lowest value of dissolved oxygen per day and the daily time are quantified as numerical values as the characteristics of the time series for information construction, quantifying the daily change characteristic information of dissolved oxygen, and introducing it into the prediction model. Taking the dissolved oxygen concentration as the output, an LSTM neural network prediction model is determined. Thus, it can effectively start from the diurnal change characteristics and time change law of dissolved oxygen in river water bodies per day, overcome the problem of limited prediction accuracy caused by the large diurnal volatility of dissolved oxygen, and effectively improve the prediction accuracy. Description of the Drawings
[0064] Figure 1 is the overall flow schematic diagram of the present invention;
[0065] Figure 2 is the schematic diagram of the change curve of dissolved oxygen in the embodiment of the present invention;
[0066] Figure 3 is the radar chart of the daily dissolved oxygen difference in different months in the embodiment of the present invention. Detailed Embodiments
[0067] A method for predicting dissolved oxygen in river water bodies based on information construction provided in this embodiment, as Figure 1 shown, includes the following steps:
[0068] S1. The original time series data collected by the water quality sensors and automatic weather stations in the river are preprocessed. First, the linear interpolation method is used to interpolate the original time series data. Secondly, the local outlier factor algorithm is used to detect outliers. Finally, the SG filter is used to smooth the water quality time series to obtain the preprocessed dissolved oxygen time series.
[0069] The water quality sensors in the river channel include dissolved oxygen sensors, pH sensors and water temperature sensors, which are used to collect dissolved oxygen, pH and water temperature data respectively. The automatic weather station can simultaneously collect various weather environment data such as temperature, humidity, air pressure, total radiation, wind direction, wind speed, rainfall, particulate matter (PM2.5, PM10), etc.
[0070] In this embodiment, the water quality sensor for measuring water quality is placed at a water depth of 1.5m. The river bank is equipped with an automatic weather station. The data collection time is from 15:00 on June 29, 2023 to 24:00 on November 16, 2023. The collection interval is 30 minutes, and a total of 5066 original time series data are collected.
[0071] The online collection of river water quality and environmental data may be affected by various factors, such as equipment power outages, equipment failures, and bad weather, which may easily lead to data loss and abnormal values. In order to improve the quality of data and reduce the impact on the prediction effect, the missing data in the data collection process is interpolated using linear interpolation. First, the missing data is filled using linear interpolation. The calculation formula is as follows:
[0072]
[0073] Among them, q represents the number of interpolation steps, which is used to determine the relative position of the interpolation point; r represents the total number of steps in the interpolation interval, which defines the number of division steps between two known points; k represents the known point x k The index of k+q Indicates that the water quality sensor loses data at time k+q; x k and x k+r They represent the original data collected by the water quality sensor at the kth and k+rth moments respectively.
[0074] Secondly, the density-based local outlier factor algorithm LOF is used to detect outliers in the original time series data. Given a data set O and an object p, the method for calculating the LOF value of p specifically includes the following steps:
[0075] S1.1.1. Calculate the k-distance of object p:
[0076] d k (p) = d(p, o)
[0077] Among them, point o is the kth neighbor of point p, and d(p, o) is the Euclidean distance between point p and point o.
[0078] S1.1.2. Calculate the reachable distance:
[0079] reach_dist k (p, o) = max{d k (o), d(p, o)}
[0080] Among them, d k (o) represents the k-distance of point o.
[0081] S1.1.3. Calculate the local reachability density:
[0082]
[0083] Among them, N k (p) is the set of k nearest neighbors of point p, |N k (p)| is the number of k nearest neighbors of point p.
[0084] S1.1.4. Calculate the local outlier factor:
[0085]
[0086] Among them, lrd k (o) is the local reachability density of point o, lrd k (p) is the local reachability density of point p.
[0087] Then, since water quality is easily affected by natural factors such as seasonal changes, climate conditions, rainfall, etc., which may cause water quality parameters to fluctuate and generate noise, this embodiment uses an SG filter to smooth the water quality time series and denoise the data to reduce the impact of noise and improve the reliability and accuracy of the data.
[0088] Using SG filter to smooth the water quality time series specifically includes the following steps:
[0089] S1.2.1. The subsequence x with a window size of w=2m+1 is expressed as:
[0090] {x s-m , ..., x s ,...x s+m}, s∈[-m,m]
[0091] Among them, x is the input sequence data, m is the radius of the window, s is the current center point index of the sliding window, sm and s+m represent the starting index and ending index of the data points in the sliding window in the sequence x.
[0092] S1.2.2. Define the R-order polynomial p(i) used to fit the data points in the window as follows:
[0093]
[0094] Among them, a v is the vth coefficient of the SG filter, and i represents the relative position of the point relative to the center of the window. S1.2.3. Use the least squares method to minimize the error, and the formula is as follows:
[0095]
[0096] Among them, ∈ represents the sum of errors, x s+i Represents the value of the actual data point at position i.
[0097] By calculating a 0 Find the best fit p(0) for the center point x of the window. By sliding the window, each point in the sequence x will become the center point of the window until all values in the sequence are smoothed.
[0098] Finally, in order to eliminate the differences in dimensions and value ranges between different features and to ensure that the model can learn the relationship between features more effectively, the data is normalized. The formula is as follows:
[0099]
[0100] Among them, x is the original data, x min is the minimum value of the original data, x max is the maximum value of the original data, is the normalized data.
[0101] S2. In aquatic water bodies, dissolved oxygen is affected by water quality and meteorological environment, showing a regular diurnal variation trend, such as Figure 2 As shown in the figure, the dissolved oxygen concentration of 5 consecutive days was randomly selected for observation. It was found that the peak value of dissolved oxygen usually appeared at 12 noon and 3 a.m. The peak value at 12 noon was the maximum value. The dissolved oxygen showed a significant downward trend from 12 noon to 3 a.m., and was usually the minimum value at 3 a.m. The dissolved oxygen showed a significant upward trend from 3 a.m. to 12 noon. The dissolved oxygen concentration of each day showed a similar trend of change. It was observed that the dissolved oxygen concentration was related to the daily time characteristics. Therefore, the daily time points were quantified as time characteristics as information construction. The formula is as follows:
[0102]
[0103] Among them, x.hour is the hour of the date, and x.minute is the minute of the date.
[0104] In order to better study the changing pattern of dissolved oxygen, the daily dissolved oxygen difference from August to October in the monitoring period is displayed as follows: Figure 3 In the radar chart shown in the figure, under different weather conditions and seasonal conditions, the fluctuation range of daily dissolved oxygen concentration is still different, that is, the difference between the maximum and minimum values of daily dissolved oxygen concentration is different; and a single dissolved oxygen concentration value at a certain moment cannot reflect the change of dissolved oxygen in the water body. Therefore, the daily dissolved oxygen difference and the daily time point are quantified as numerical values as time series features, and the constructed information is introduced into the dissolved oxygen prediction index system to improve the prediction accuracy of the model. For this purpose, the difference between the maximum and minimum values of daily dissolved oxygen concentration is used as information construction, and the formula is as follows:
[0105] DO_different=max(DO)-min(DO)
[0106] Among them, max(DO) is the maximum value of dissolved oxygen per day, and min(DO) is the minimum value of dissolved oxygen per day.
[0107] S3. Build an LSTM neural network prediction model. LSTM introduces a gating mechanism that allows the network to retract or ignore specific parts of the input information and control when to output information about the hidden state. The LSTM neural network prediction model includes three gating units, namely the forget gate, input gate, and output gate. The forget gate determines when to forget the previous cell state information. The formula is as follows:
[0108] f t =σ(W f [h t-1 , x t ]+b f )
[0109] Among them, f t is the output of the forget gate, σ is the sigmoid activation function, x t is the input of the current time step, h t-1 is the output of the hidden state at the previous time step, W f and b f are the weight parameters and bias of the forget gate.
[0110] The input gate determines when to update the cell state. The formula is as follows:
[0111] i t =σ(W i [h t-1 , x t ]+b i )
[0112]
[0113] Among them, i t is the output of the input gate, is the candidate value vector, W i and b i are the weight parameters and biases of the input gate, W C and b C are the weight parameters and biases of the candidate value vector;
[0114] Update the cell state, the formula is as follows:
[0115]
[0116] Among them, C t and C t-1 are the cell states at the current time step and the previous time step.
[0117] The output gate determines when to output the information of the hidden state and the cell state, and the formula is as follows:
[0118] o t = σ(W o [h t-1 , x t +b o )
[0119] h t = o t * tanh(C t )
[0120] Among them, o t is the output of the output gate, h t and h t-1 are the outputs of the hidden states at the current time step and the previous time step, W o and b o are the weight parameters and biases of the output gate.
[0121] S4. Initialize the LSTM neural network prediction model. Use the preprocessed dissolved oxygen time series (including dissolved oxygen, PH, water temperature, air temperature, humidity, air pressure, total radiation, wind direction, wind speed, rainfall, PM2.5, and PM10) and the two time series features for information construction as the input of the LSTM neural network prediction model, and use dissolved oxygen as the output of the LSTM neural network prediction model.
[0122] Determine that the number of layers of the LSTM neural network is n, and the hidden state dimension of each layer of LSTM is h j , 0 < j < n + 1, the input of the LSTM neural network is represented as x 1 , x 2 ,..., x n , and the expected output is represented as y.
[0123] S5. Initialize the network parameters of the LSTM neural network prediction model, and use the error output by the LSTM neural network as the iteration basis to determine the hyperparameter batch size batch_size, iteration number epoch and learning rate learning_rate value, and then use the hyperparameters for the LSTM neural network to finally output the dissolved oxygen prediction results that meet the accuracy requirements.
[0124] Dissolved oxygen (D0) is an important water quality parameter in water bodies and has a significant impact on the assessment and control of river water quality. Although current dissolved oxygen prediction methods take its diurnal variability into account, the diurnal patterns and temporal variability of dissolved oxygen are rarely quantified, that is, the temporal variation patterns and diurnal variation characteristics of daily dissolved oxygen have not been quantitatively applied to the prediction research of dissolved oxygen.
[0125] This embodiment starts from the historical data of dissolved oxygen in river water bodies, as well as the daily diurnal variation characteristics and time variation laws of dissolved oxygen in river water bodies, proposes an LSTM neural network algorithm based on information construction to predict dissolved oxygen in river water bodies, uses a density-based local outlier factor (LOF) algorithm and a linear interpolation method for outlier detection and data filling, and uses SG filtering to denoise the data. According to the diurnal volatility of dissolved oxygen and the daily variation law of dissolved oxygen, the difference between the daily maximum and minimum values of dissolved oxygen and the daily time are quantized into numerical values as the features of the time series, and finally constructs an LSTM neural network model. This method can effectively start from the daily diurnal variation characteristics and time variation laws of dissolved oxygen in river water bodies, overcome the problem of limitations in prediction accuracy due to the large diurnal volatility of dissolved oxygen, and effectively improve the prediction accuracy.
[0126] In addition to the above embodiments, the present invention may also have other implementation modes. Any technical solution formed by equivalent replacement or equivalent transformation falls within the protection scope required by the present invention.
Claims
1. A method for predicting dissolved oxygen in river water based on information construction, characterized in that: The following steps are involved: S1. Preprocess the original time series data collected by the water quality sensor and the automatic weather station in the river. First, use the linear interpolation method to interpolate the original time series data. Then use the local outlier factor algorithm to detect the outliers. Finally, use the SG filter to smooth the water quality time series to obtain the preprocessed dissolved oxygen time series. S2, quantifying the difference between the maximum and minimum values of daily dissolved oxygen concentration and the daily time point into numerical values as information construction; S3, build LSTM neural network prediction model; S4, initializing the LSTM neural network prediction model, taking the preprocessed dissolved oxygen time series and the two time series features for information construction as inputs of the LSTM neural network prediction model, and taking dissolved oxygen as output of the LSTM neural network prediction model; S5. Initialize the network parameters of the LSTM neural network prediction model, use the error output by the LSTM neural network prediction model as the iteration basis, so as to determine the hyperparameters, and then use the hyperparameters for the LSTM neural network prediction model to finally output the dissolved oxygen prediction results.
2. The method for predicting dissolved oxygen in river water based on information construction according to claim 1, characterized in that: In step S1, the missing data is filled using linear interpolation, and the calculation formula is as follows: Among them, q represents the number of interpolation steps, which is used to determine the relative position of the interpolation point; r represents the total number of steps in the interpolation interval, which defines the number of division steps between two known points; k represents the known point x k The index of k+q Indicates that the water quality sensor loses data at time k+q; x k and x k+r They represent the original data collected by the water quality sensor at the kth and k+rth moments respectively.
3. The method for predicting dissolved oxygen in river water based on information construction according to claim 1, characterized in that: In step S1, a density-based local outlier factor algorithm is used to detect outliers in the original time series data. Given a data set O and an object p, the method for calculating the LOF value of p specifically includes the following steps: S1.1.
1. Calculate the k-distance of object p: d k (p)=d(p,o) Where point o is the kth neighbor of point p, and d(p, o) is the Euclidean distance between point p and point o; S1.1.
2. Calculate the reachable distance: reach_dist k (p,o)=max{d k (o),d(p,o)} Among them, d k (o) represents the k-distance of point o; S1.1.
3. Calculate the local reachability density: Among them, N k (p) is the set of k nearest neighbors of point p, |N k (p)| is the number of k nearest neighbors of point p; S1.1.
4. Calculate the local outlier factor: Among them, lrd k (o) is the local reachability density of point o, lrd k (p) is the local reachability density of point p.
4. The method for predicting dissolved oxygen in river water based on information construction according to claim 1, characterized in that: In step S1, using the SG filter to smooth the water quality time series specifically includes the following steps: S1.2.
1. The subsequence x with a window size of w=2m+1 is expressed as: {x s-m ,...,x s ,...x s+m },s∈[-m,m] Where x is the input sequence data, m is the radius of the window, s is the current center point index of the sliding window, sm and s+m represent the starting index and ending index of the data point in the sliding window in the sequence x; S1.2.
2. Define the R-order polynomial p(i) used to fit the data points in the window as follows: Among them, a v is the vth coefficient of the SG filter, i represents the relative position of the point relative to the center of the window; S1.2.
3. Use the least squares method to minimize the error. The formula is as follows: Among them, ∈ represents the sum of errors, x s+i Represents the value of the actual data point at position i; By calculating a0, we find the best fit p(0) for the window center point x. By sliding the window, each point in the sequence x will become the center point of the window until all values in the sequence are smoothed.
5. The method for predicting dissolved oxygen in river water based on information construction according to claim 1, characterized in that: In step S2, the daily time points are quantified into time features as information structures, and the formula is as follows: Among them, x.hour is the hour of the date, and x.minute is the minute of the date.
6. The method for predicting dissolved oxygen in river water based on information construction according to claim 1, characterized in that: In step S2, the difference between the maximum and minimum values of daily dissolved oxygen concentration is used as information construction, and the formula is as follows: DO_different=max(DO)-min(DO) Among them, max(DO) is the maximum value of dissolved oxygen per day, and min(DO) is the minimum value of dissolved oxygen per day.
7. The method for predicting dissolved oxygen in river water based on information construction according to claim 1, characterized in that: In step S3, the LSTM neural network prediction model includes three gating units, namely a forget gate, an input gate and an output gate. The forget gate is used to decide when to forget the previous cell state information, the input gate is used to decide when to update the cell state, and the output gate is used to decide when to output the hidden state and cell state information.
8. A method for predicting dissolved oxygen in river water based on information construction according to claim 7, characterized in that: In the LSTM neural network prediction model, the forget gate is used to decide when to forget the previous cell state information. The formula is as follows: f t =σ(W f [h t-1 ,x t ]+b f ) Among them, f t is the output of the forget gate, σ is the sigmoid activation function, x t is the input of the current time step, h t-1 is the output of the hidden state at the previous time step, W f and b f is the weight parameter and bias of the forget gate; The input gate is used to decide when to update the cell state, and the formula is as follows: i t =σ(W i [h t-1 ,x t ]+b i ) Among them, i t is the output of the input gate, is the candidate value vector, W i and b i is the weight parameter and bias of the input gate, W C and b C are the weight parameters and bias of the candidate value vector; Update the cell status, the formula is as follows: Among them, C t and C t-1 is the cell state at the current time step and the previous time step; The output gate is used to decide when to output the hidden state and cell state information. The formula is as follows: the t =σ(W o [h t-1 ,x t ]+b o ) h t =o t *tanh(C t ) Among them, t is the output of the output gate, h t and h t-1 is the output of the hidden state of the current time step and the previous time step, W o and b o are the weight parameters and bias of the output gate.
9. The method for predicting dissolved oxygen in river water based on information construction according to claim 1, characterized in that: In the step S4, the number of layers of the LSTM neural network prediction model is n, and the hidden state dimension of each layer of LSTM is h j , 0 < j < n + 1, the input of the LSTM neural network prediction model is represented as x1, x2,..., x n , the expected output is represented as y; the preprocessed dissolved oxygen time series data includes dissolved oxygen, PH, water temperature, air temperature, humidity, air pressure, total radiation, wind direction, wind speed, rainfall, PM2.5, and PM10.
10. The method for predicting dissolved oxygen in river water based on information construction according to claim 1, characterized in that: In step S5, the error output by the LSTM neural network prediction model is used as an iteration basis to determine the hyperparameter batch size, number of iterations and learning rate, and then the hyperparameters are used in the LSTM neural network prediction model to finally output the dissolved oxygen prediction result.
Citation Information
Cited By
River and lake state evaluation method and system based on digital twinning
CN120373674A