River water quality prediction method combining dual signal decomposition and deep learning

By combining dual signal decomposition and deep learning methods, relevant features of river water quality data are extracted, and predictions are made through dual signal decomposition and optimization of neural network model, the problem of low water quality prediction accuracy in the existing technology is solved, and high precision is achieved and water quality prediction effect with strong generalization performance.

CN119397901APending Publication Date: 2025-02-07ZHENGZHOU UNIV
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411502057.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The prior art has the problem of low prediction accuracy in river water quality prediction, especially poor performance when processing complex signals and long-term forecasts.

Method used

The method combining dual signal decomposition and deep learning is used to predict river water quality. The specific steps include extracting relevant features through random forest feature selection, using time-varying filter empirical modal decomposition and sparrow search algorithm-variant modal decomposition for double signal decomposition, and finally using sparrow algorithm to optimize the convolutional length short-term memory neural network model for predict.

Benefits of technology

It significantly improves the accuracy and generalization performance of water quality prediction, especially in short-term prediction, which can accurately capture the dynamic changes of water quality indicators and provide a reliable decision-making basis for water quality pollution prevention and control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119397901A_ABST
    Figure CN119397901A_ABST
Patent Text Reader

Abstract

The invention discloses a river water quality prediction method combining dual signal decomposition and deep learning, which comprises the following steps: S1, carrying out feature selection through random forest feature selection (RF), and extracting water quality data related to water quality prediction; s2, in the preprocessing of the water quality data, performing preliminary decomposition on the water quality data by adopting time-varying filter empirical mode decomposition (TVF-EMD), enabling an internal mode function (IMF) component generated by decomposition to contain a large number of complex signals, and performing secondary decomposition on the complex internal mode function (IMF) component by adopting sparrow search algorithm-variational mode decomposition (SSA-VMD); and S3, using a sparrow algorithm to optimize a convolutional long short-term memory neural network model (SSA-CNN-LSTM) to predict the data processed in the step S2. The constructed prediction model is excellent in performance in water quality prediction, particularly in short-term prediction, the prediction precision of the prediction model on the water quality index is remarkably superior to that of a single decomposition model, and short-term dynamic changes of the water quality index can be accurately captured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of water quality prediction, and in particular relates to a river water quality prediction method combining dual signal decomposition and deep learning. Background Art

[0002] With the rapid development of the global economy and the acceleration of industrialization, water pollution is becoming increasingly serious, and river water quality has become the focus of global attention. Water pollution not only threatens the safety of human drinking water, but also leads to significant degradation of aquatic ecosystems, thereby affecting biodiversity and ecological balance. In view of the complexity and extensiveness of water pollution, it is difficult to effectively control the harm it brings by relying solely on post-event governance. Therefore, it is particularly necessary to establish an effective water quality prediction system. By making long-term forecasts of water pollutants, potential risk areas can be identified in a timely manner, thereby significantly improving emergency response capabilities and reducing the harm of water pollution to the ecological environment and human health. This is of great significance to global water resources management and environmental protection.

[0003] In recent years, with the rapid development of artificial intelligence and machine learning technologies, deep learning neural network models have shown new potential in long-term water quality prediction. Many researchers have begun to use technologies such as long short-term memory networks (LSTM), gated recurrent units (GRU), and temporal convolutional networks (TCN) to build water quality prediction models. However, since water quality is affected by a variety of factors such as meteorological conditions, geological characteristics, and pollution sources, and there are complex nonlinear relationships between these factors, traditional single models have obvious limitations in dealing with this complexity and it is difficult to accurately capture the changing trends in time series.

[0004] The multi-feature prediction model combining convolutional neural network and long short-term memory network (CNN-LSTM) has been successfully applied in the field of water quality prediction due to its advantages in data feature extraction, long-term dependency capture, fault tolerance and prediction accuracy. Nevertheless, the prediction accuracy of the neural network model alone still has certain limitations, especially in the long-term prediction capability, which urgently needs further optimization. Combining signal decomposition methods such as empirical mode decomposition (EMD), fully adaptive ensemble empirical mode decomposition of noise (CEEMDAN), variational mode decomposition (VMD) and time-varying filter empirical mode decomposition (TVF-EMD) with the neural network model to construct an integrated model can significantly improve the prediction accuracy.

[0005] However, existing research mostly focuses on single signal decomposition. Although this method improves the prediction performance of the model to a certain extent, the internal model function (IMF) components generated by the decomposition still contain a large number of complex signals. Directly using these internal model functions (IMFs) for prediction may weaken the prediction ability of the model. Summary of the invention

[0006] The object of the present invention is to solve the problems of a large number of complex signals and low prediction accuracy in the prior art; the technical solution adopted to achieve the above object is:

[0007] A river water quality prediction method combining dual signal decomposition and deep learning, comprising the following steps:

[0008] Step S1: Perform feature selection through random forest feature selection (RF) to extract water quality data related to water quality prediction;

[0009] Step S2: In the preprocessing of water quality data, use time-varying filter empirical mode decomposition (TVF-EMD) to preliminarily decompose the water quality data. The intrinsic mode function (IMF) components generated by the decomposition contain a large number of complex signals. Use the sparrow search algorithm-variational mode decomposition (SSA-VMD) to perform secondary decomposition on the complex intrinsic mode function (IMF) components;

[0010] Step S3: Use the sparrow algorithm to optimize the convolutional long short-term memory neural network model (SSA-CNN-LSTM) to predict the data processed in Step S2.

[0011] Preferably, the random forest feature selection (RF) algorithm comprises the following steps:

[0012] Step S11: Randomly sample with replacement from the data set N, select n (n < N) samples, and perform k samplings in total to generate k training sets, where the remaining data constitutes the out-of-bag data set out-of-bag data set (OOB);

[0013] Step S12: Construct decision trees and train the k training sets, a total of k decision trees are formed, and calculate the voting results of each decision tree in its corresponding out-of-bag data set (OOB);

[0014] Step S13: Randomly change the order of the features Xi (i = 1, 2, 3,..., M) in the out-of-bag data set (OOB) (M is the number of data set features) to form a new out-of-bag data set (OOB) sample, and then vote on the new out-of-bag data set (OOB) through the established RF model to obtain the voting results;

[0015] Step S14: Calculate the importance score IMP of X according to the formula i of i , select the feature combination with IMP i > 0.1 as the input variable;

[0016]

[0017] In the formula: IMP i importance score; k is the number of decision trees; Sk is the voting result of each decision tree in its corresponding out-of-bag data set (OOB); S k,i It is the voting result of the decision tree in its corresponding out-of-bag (OOB) dataset after randomly changing the feature order.

[0018] Preferably, in step S2, in the preprocessing of water quality data, the non-stationarity and noise problems of the signal lead to a decrease in prediction accuracy, and the water quality data is preliminarily decomposed by using a time-varying filter empirical mode decomposition (TVF-EMD). The time-varying filter empirical mode decomposition (TVF-EMD) method uses a non-uniform B-spline approximation as a time-varying filter to complete the selection of the cutoff frequency. The time-varying filter empirical mode decomposition (TVF-EMD) includes the following steps:

[0019] Step S21: Use B-spline approximation to calculate the local cutoff frequency, expressed as:

[0020]

[0021] Where: φ′ bis (t) is the cutoff frequency; φ′1(t) and φ′2(t) are both instantaneous frequency components; in order to solve the problem of modal aliasing, the local cutoff frequency φ′ needs to be recalculated. bis (t) make adjustments;

[0022] Step S22: Reconstruct φ′ bis (t), and obtain the new signal g(t), g(t) = cos[∫φ′ bis (t)dt], the input signal is further filtered using a time-varying filter to obtain a local mean function;

[0023] Step S23: Check whether the remaining signal meets the stop condition. t When it is less than or equal to the set threshold ξ, a component signal IMF can be determined, which meets the stop condition;

[0024]

[0025] Where: B Loughlin (t) is the instantaneous bandwidth of Loughlin, φ avg (t) is the weighted average of the instantaneous frequency.

[0026] Preferably, in step S2, the sparrow search algorithm (SSA) divides the sparrow population into three roles: discoverers, joiners and guards, each of which undertakes different tasks in the algorithm and works together to complete the optimization process;

[0027] When using the Sparrow Search Algorithm (SSA), for the discoverers, traverse i discoverers and update the position information of the j-th dimension in the (t + 1)-th iteration, which is represented by the following formula:

[0028]

[0029] In the formula: is the position information of the j-th dimension of the i-th sparrow in the t-th iteration; t max is the maximum number of iterations; a is a random number within the range of [0, 1]; ST is a constant within the range of [0.5, 1], representing the safety value; R2 is a random value within the range of [0, 1], representing the warning value. When R2 < ST, the foraging environment is safe, and the searchers search for food; otherwise, when R2 ≥ ST, the sentinels issue an alarm, the searchers stop searching, immediately fly away from the foraging area, and fly to the safe area; Q is a random number that follows a normal distribution; L is a 1×d matrix with all elements being 1;

[0030] The main task of the followers is to follow the discoverers to obtain food and adjust their positions during the process to seek the optimal solution; the position update formula for the followers is as follows:

[0031]

[0032] In the formula: is the worst individual in the t-th iteration; is the position of the optimal searcher in the (t + 1)-th iteration; A is a 1×d matrix, and the elements are randomly assigned 1 or -1; A + is a matrix that satisfies A + = A T (AA T ) -1 ; n is the number of followers; when , it means that the current position of the sparrow is not good and it may starve, so it needs to fly to a farther place to forage; when , it means that the current position of the sparrow is good, and it only needs to approach the sparrow with the best position;

[0033] The task of the sentinels is to issue an alarm when the population is in danger and lead the whole group to fly to the safe area. The movement method of the sentinels is as follows:

[0034]

[0035] In the formula: is the most excellent individual in the t-th iteration; β is a random number that follows a normal distribution with a mean of 0 and a variance of 1; K is a random number within the range of [-1, 1], and the positive or negative sign represents the movement direction of the sparrow, and the magnitude represents the step size control parameter; f i is the fitness value of the current individual; f gis the maximum fitness value of individuals in the current group; f w is the minimum fitness value of individuals in the current population; ε is the minimum constant to avoid the denominator being 0.

[0036] Preferably, in step S2, variational mode decomposition (VMD) realizes effective separation of signal components by adaptively determining the number of mode decompositions, and can reduce the non-stationarity of the signal; its decomposition performance is mainly related to the number of modes K and the penalty factor α;

[0037] The first task of variational mode decomposition (VMD) is to decompose the original signal into multiple modal components, each corresponding to a specific frequency range; the construction of variational mode decomposition (VMD) for variational problems includes the following steps:

[0038]

[0039] Where: K is the number of modes to be decomposed; u k (t) is the kth modal component after decomposition; w k is the center frequency of the Kth modal component; δ t is the Dirac function; * is the convolution symbol; f(t) is the original signal, (δ t +j / πt)*u k (t) To obtain the analytical signal of the original signal; is to shift the spectrum to the baseband; j is the imaginary unit 40;

[0040] (9)

[0041]

[0042] In order to obtain the optimal solution of the variational mode decomposition (VMD) problem, the Lagrangian multiplier method λ and the penalty factor α are introduced to transform the constrained variational problem into an unconstrained variational problem. The augmented Lagrangian function is shown in Formula 9. On this basis, the alternating direction multiplier method (ADMM) is used to calculate the modal component u k (t) and center frequency w k Perform iterative updates, see formulas 10 and 11 respectively;

[0043] Where: for Wiener filtering of the residual signal; w is the frequency; IFFT is the inverse Fourier transform; are the Fourier transforms of the original signal and the kth modal component, respectively; in this way, variational mode decomposition (VMD) can adaptively adjust the modal components and center frequencies to ensure the accuracy and stability of signal decomposition.

[0044] Preferably, in the water quality prediction of step S3, the convolutional neural network (CNN) improves the prediction accuracy of the model by extracting local features; the convolutional layer and the pooling layer in the convolutional neural network (CNN) model are through the data processing layer, and the local features of the data are extracted and the feature dimension is reduced by alternately using the convolutional layer and the pooling layer; the calculation formula of the convolutional neural network (CNN) is as follows:

[0045]

[0046] Where: T is the time feature sequence after convolution; n is the input data X k Length; W k is the kernel function sequence of convolution.

[0047] Preferably, in the water quality prediction in step S3, the long short-term memory network (LSTM) solves the gradient vanishing and gradient exploding problems through three gating units including forget gate, input gate and output gate and cell states, so that the network can maintain a stable training effect over a longer time series.

[0048] Preferably, the forget gate is used to determine which information is discarded from the cell state. The forget gate reads the previous output h t-1 and the current input value x t , a vector f with a value between 0 and 1 is generated through a Sigmoid function t , each value in this vector represents the degree of information retention. The closer it is to 0, the more information is discarded, and the closer it is to 1, the more information is retained. Finally, this vector is related to the cell state C t-1 Multiply to determine which information needs to be forgotten; the forget gate calculation is expressed by formula 13;

[0049] f t =σ(W f ·[h t-1 ,x t ]+b f ) (13)

[0050] Where: W f is the weight matrix of the forget gate; b f is the bias vector of the forget gate; σ represents the Sigmoid activation function;

[0051] The input gate determines how new information will be updated to the cell state; the input gate includes a Sigmoid layer and a tanh layer: the Sigmoid layer is called the "input gate layer" and determines which values ​​will be updated; the tanh layer is used to generate a new candidate value vector The candidate value will be added to the cell state; the calculation process of the input gate is shown in Formula 14 and Formula 15:

[0052] i t =σ(W i ·[h t-1 ,x t ]+b i ) (14)

[0053]

[0054] Among them, W i and W c are the weight matrices of the input gate and candidate values ​​respectively; b i and b c are the corresponding bias vectors respectively; tanh represents the hyperbolic tangent activation function.

[0055] Preferably, the cell state is the key to the long short-term memory network (LSTM), and the cell state carries the information accumulated from a time sequence; the new cell state C t is the cell state C at the previous moment. t-1 And the output f of the forget gate t Multiply and add the output i of the input gate t With candidate value The result of the multiplication represents the memory update at the current moment, and the process is expressed by formula 16;

[0056]

[0057] The output gate determines the hidden state h at the current moment t The output content; it first calculates the output based on the current cell state, then passes through a Sigmoid layer to determine which parts of the information will be output, and finally processes the cell state through the Tanh function and multiplies it with the output of the Sigmoid layer to obtain the final output result h t ; The operation process is shown in Formula 17 and Formula 18;

[0058] o t =σ(W o [h t-1, x t ]+b o ) (17)

[0059] h t =o t tanh(C t ) (18)

[0060] Where W o is the weight matrix of the output gate; b o is the bias vector of the output gate.

[0061] As a preference, in order to describe the accuracy and generalization of model prediction, the regression model evaluation index is used: R 2 (fitting effect), RMSE (root mean square error), MAE (mean absolute error), the formulas are shown in formulas 19-21 respectively; R 2 The value is between [0,1]. The closer it is to 1, the better the fitting effect is, and the closer it is to 0, the worse the fitting effect is. It is used to verify the stability of the model. The smaller the value of MAE and RMSE, the better the prediction effect is, which is used to verify the accuracy of the model.

[0062]

[0063] Where: y i is the true value; i ′ is the predicted value; is the average of the true value; i is the sample number; n is the number of samples.

[0064] The beneficial effects of the present invention are:

[0065] The prediction model constructed by the river water quality prediction method combining dual signal decomposition and deep learning in the present invention performs well in water quality prediction, especially in short-term prediction. Its prediction accuracy of water quality indicators is significantly better than that of the single decomposition model, and it can accurately capture the short-term dynamic changes of water quality indicators.

[0066] The prediction model constructed by the river water quality prediction method combining dual signal decomposition and deep learning in the present invention has strong generalization performance, is applicable to most conventional water quality indicators in water bodies, and has good prediction ability. It can also provide a reliable decision-making basis for water pollution prevention and control with a forecast period of at least 3 days. It has excellent prediction and generalization capabilities, provides strong technical support for water quality prediction and water pollution prevention and control, and is of great significance for grasping water quality dynamics and promoting regional economic development. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 is a flow chart of the prediction model of the present invention;

[0068] Figure 2 It is a convolutional neural network (CNN) structure diagram;

[0069] Figure 3 This is the structure diagram of the long short-term memory network (LSTM);

[0070] Figure 4 It is the decomposition result of time-varying filter empirical mode decomposition (TVF-EMD);

[0071] Figure 5 It is the decomposition result of Sparrow Search Algorithm-Variational Mode Decomposition (SSA-VMD);

[0072] Figure 6 Predictions of TP by different models;

[0073] Figure 7 Comparison of the prediction accuracy of TP by different models;

[0074] Figure 8 Prediction of TN water quality by different models;

[0075] Fig. 9 Predictions of NH3-N by different models;

[0076] Fig.10 Effects of different models on COD Mn predictions;

[0077] Fig.11 Prediction of DO by different models;

[0078] Fig.12 Predictions of EC by different models;

[0079] Fig.13 Prediction of TB by different models. DETAILED DESCRIPTION

[0080] The river water quality prediction method combining dual signal decomposition and deep learning of the present invention is further described below with reference to the accompanying drawings.

[0081] like Figure 1 As shown, a river water quality prediction method combining dual signal decomposition and deep learning includes the following steps:

[0082] Step S1: Perform feature selection through random forest feature selection (RF) to extract water quality data related to water quality prediction;

[0083] Step S2: In the preprocessing of water quality data, the time-varying filter empirical mode decomposition (TVF-EMD) is used to perform preliminary decomposition of the water quality data. The internal model function (IMF) components generated by the decomposition contain a large number of complex signals. The sparrow search algorithm-variational mode decomposition (SSA-VMD) is used to perform secondary decomposition on the complex internal model function (IMF) components;

[0084] Step S3: Use the Sparrow algorithm to optimize the convolutional long short-term memory neural network model (SSA-CNN-LSTM) to predict the data processed in step S2.

[0085] In complex water quality prediction tasks, selecting appropriate features is crucial for improving the prediction performance of the model. Random Forest Feature Selection (RF) is a simple and efficient decision tree-based ensemble learning method. Its feature importance calculation module can calculate the importance of each feature variable and sort them, with the advantage that overfitting is less likely to occur during the prediction process. By using Random Forest Feature Selection (RF), the importance degrees of other water quality indicators for the target indicator are calculated, the multivariate correlations among water quality indicators are mined, and the features that contribute most to water quality prediction are effectively identified and utilized, thus laying a solid foundation for subsequent model construction. The steps for implementing Random Forest Feature Selection (RF) are as follows:

[0086] Step S11: Randomly sample with replacement from the dataset N to select n (n < N) samples, and perform sampling k times to generate k training sets. The data remaining forms the Out-of-Bag (OOB) dataset.

[0087] Step S12: Construct and train decision trees for the k training sets to form a total of k decision trees, and calculate the voting results of each decision tree in its corresponding Out-of-Bag (OOB) dataset.

[0088] Step S13: Randomly change the order of the features X i (i = 1, 2, 3,..., M) (where M is the number of dataset features) in the Out-of-Bag (OOB) dataset to form new Out-of-Bag (OOB) dataset samples, and then vote on the new Out-of-Bag (OOB) dataset through the established RF model to obtain the voting results.

[0089] Step S14: Calculate the importance score IMP i of X according to the formula, and select the feature combination with IMP i > 0.1 as the input variable. i

[0090]

[0091] In the formula: IMP i is the importance score; k is the number of decision trees; S k is the voting result of each decision tree in its corresponding Out-of-Bag (OOB) dataset; S k,i is the voting result of the decision tree in its corresponding Out-of-Bag (OOB) dataset after randomly changing the feature order.

[0092] ​In step S2, in the preprocessing of water quality data, the non-stationarity and noise problems of the signal lead to a decrease in prediction accuracy. Time-varying filter empirical mode decomposition (TVF-EMD) provides an effective solution for processing these complex time series data. Time-varying filter empirical mode decomposition (TVF-EMD) can well solve the problem of modal aliasing and low efficiency at low sampling rate in the decomposition process of modal decomposition (EMD), and does not require artificial setting of the modal function K. At the same time, filtering can also be performed during the signal decomposition process. The time-varying filter empirical mode decomposition (TVF-EMD) is used to perform a preliminary decomposition of water quality data. The time-varying filter empirical mode decomposition (TVF-EMD) method uses non-uniform B-spline approximation as a time-varying filter to complete the selection of the cutoff frequency. The time-varying filter empirical mode decomposition (TVF-EMD) includes the following steps:

[0093] Step S21: Use B-spline approximation to calculate the local cutoff frequency, expressed as:

[0094]

[0095] Where: φ′ bis (t) is the cutoff frequency; φ′1(t) and φ′2(t) are both instantaneous frequency components; in order to solve the problem of modal aliasing, the local cutoff frequency φ′ needs to be recalculated. bis (t) make adjustments;

[0096] Step S22: Reconstruct φ′ bis (t), and obtain the new signal g(t), g(t) = cos[∫φ′ bis (t)dt], the input signal is further filtered using a time-varying filter to obtain a local mean function;

[0097] Step S23: Check whether the remaining signal meets the stop condition. t When it is less than or equal to the set threshold ξ, a component signal IMF can be determined, which meets the stop condition;

[0098]

[0099] Where: B Loughlin (t) is the instantaneous bandwidth of Loughlin, φ avg (t) is the weighted average of the instantaneous frequency.

[0100] As a swarm intelligence optimization algorithm, the Sparrow Search Algorithm (SSA) has attracted much attention due to its performance in global search and local optimization. In step S2, the Sparrow Search Algorithm (SSA) divides the sparrow population into three roles: discoverers, joiners, and guards. Each role undertakes different tasks in the algorithm and works together to complete the optimization process;

[0101] When using the Sparrow Search Algorithm (SSA), for the discoverers, traverse i discoverers and update the position information of the j-th dimension in the (t + 1)-th iteration, which is represented by the following formula:

[0102]

[0103] In the formula: is the position information of the j-th dimension of the i-th sparrow in the t-th iteration; t max is the maximum number of iterations; a is a random number within the range of [0, 1]; ST is a constant within the range of [0.5, 1], representing the safety value; R2 is a random value within the range of [0, 1], representing the warning value. When R2 < ST, the foraging environment is safe, and the searchers search for food; otherwise, when R2 ≥ ST, the vigilant sparrows issue an alarm, and the searchers stop searching, immediately fly away from the foraging area, and fly to the safe area; Q is a random number subject to a normal distribution; L is a 1×d matrix with all elements being 1;

[0104] The main task of the followers is to follow the discoverers to obtain food and adjust their positions during the process to seek the optimal solution; the position update formula for the followers is as follows:

[0105]

[0106] In the formula: is the worst individual in the t-th iteration; is the position of the optimal searcher in the (t + 1)-th iteration; A is a 1×d matrix with elements randomly assigned as 1 or -1; A+ is the matrix that satisfies A + = A T (AA T ) -1 ; n is the number of followers; when it means that the current sparrow position is not good and it may starve, so it needs to fly to a farther place to forage; when it means that the current sparrow position is good, and it only needs to approach the sparrow with the best position;

[0107] The task of the vigilant sparrows is to issue an alarm when the population is in danger and lead the whole group to fly to the safe area. The movement mode of the vigilant sparrows is as follows:

[0108]

[0109] In the formula: is the most excellent individual in the t-th iteration; β is a random number subject to a normal distribution with a mean of 0 and a variance of 1; K is a random number within the range of [-1, 1], where the positive or negative sign represents the movement direction of the sparrow, and the magnitude represents the step size control parameter; f i is the fitness value of the current individual; fg is the maximum fitness value of individuals in the current group; f w is the minimum fitness value of individuals in the current population; ε is the minimum constant to avoid the denominator being 0.

[0110] Variational Mode Decomposition (VMD) is an adaptive, fully non-recursive mode decomposition method, which is mainly used to process complex, nonlinear and non-stationary time series signals.

[0111] In step S2, variational mode decomposition (VMD) realizes effective separation of signal components by adaptively determining the number of mode decompositions, and can reduce the non-stationarity of the signal; its decomposition performance is mainly related to the number of modes K and the penalty factor α;

[0112] The first task of variational mode decomposition (VMD) is to decompose the original signal into multiple modal components, each corresponding to a specific frequency range; the construction of variational mode decomposition (VMD) for variational problems includes the following steps:

[0113]

[0114] Where: K is the number of modes to be decomposed; u k (t) is the kth modal component after decomposition; w k is the center frequency of the Kth modal component; δ t is the Dirac function; * is the convolution symbol; f(t) is the original signal, (δ t +j / πt)*u k (t) To obtain the analytical signal of the original signal; is to shift the spectrum to the baseband; j is the imaginary unit 40;

[0115]

[0116] In order to obtain the optimal solution of the variational mode decomposition (VMD) problem, the Lagrangian multiplier method λ and the penalty factor α are introduced to transform the constrained variational problem into an unconstrained variational problem. The augmented Lagrangian function is shown in Formula 9. On this basis, the alternating direction multiplier method (ADMM) is used to calculate the modal component u k (t) and center frequency w k Perform iterative updates, see formulas 10 and 11 respectively;

[0117] Where: for Wiener filtering of the residual signal; w is the frequency; IFFT is the inverse Fourier transform; are the Fourier transforms of the original signal and the kth modal component, respectively; in this way, variational mode decomposition (VMD) can adaptively adjust the modal components and center frequencies to ensure the accuracy and stability of signal decomposition.

[0118] Convolutional neural networks (CNNs) have become an important tool in the field of deep learning due to their outstanding performance in image recognition and time series processing.

[0119] In the water quality prediction of step S3, the convolutional neural network (CNN) improves the prediction accuracy of the model by extracting local features; the convolutional layer and the pooling layer in the convolutional neural network (CNN) model are through the data processing layer, and the local features of the data are extracted and the feature dimension is reduced by alternately using the convolutional layer and the pooling layer; the principle of the convolutional neural network (CNN) is as follows Figure 2 As shown, the calculation formula of the convolutional neural network (CNN) is as follows:

[0120]

[0121] Where: T is the time feature sequence after convolution; n is the input data X k Length; W k is the kernel function sequence of convolution.

[0122] Long Short-Term Memory (LSTM) is a special type of Recurrent Neural Network (RNN) that excels in capturing long-term dependencies in time series data.

[0123] In the water quality prediction of step S3, the long short-term memory network (LSTM) solves the gradient vanishing and gradient exploding problems through the three gate control units of the forget gate, input gate, and output gate and the cell state, so that the network can maintain a stable training effect on a longer time series. The hidden layer structure of the long short-term memory network (LSTM) is as follows: Figure 3 shown.

[0124] The forget gate is used to decide which information to discard from the cell state. The forget gate reads the previous output h t-1 and the current input value x t , a vector f with a value between 0 and 1 is generated through a Sigmoid function t , each value in this vector represents the degree of information retention. The closer it is to 0, the more information is discarded, and the closer it is to 1, the more information is retained. Finally, this vector is related to the cell state C t-1 Multiply to determine which information needs to be forgotten; the forget gate calculation is expressed by formula 13;

[0125] f t =σ(W f ·[h t-1,x t ]+b f ) (13)

[0126] Where: W f is the weight matrix of the forget gate; b f is the bias vector of the forget gate; σ represents the Sigmoid activation function;

[0127] The input gate determines how new information will be updated to the cell state; the input gate includes the Sigmoid layer and the tanh layer: the Sigmoid layer is called the "input gate layer" and determines which values ​​will be updated; the tanh layer is used to generate a new candidate value vector The candidate value will be added to the cell state; the calculation process of the input gate is shown in Formula 14 and Formula 15:

[0128] i t =σ(W i ·[h t-1 ,x t ]+b i ) (14)

[0129]

[0130] Among them, W i and W c are the weight matrices of the input gate and candidate values ​​respectively; b i and b c are the corresponding bias vectors respectively; tanh represents the hyperbolic tangent activation function.

[0131] The cell state is the key to the long short-term memory network (LSTM). The cell state carries the information accumulated from a period of time. The new cell state C t is the cell state C at the previous moment. t-1 And the output f of the forget gate t Multiply and add the output i of the input gate t With candidate value The result of the multiplication represents the memory update at the current moment, and the process is expressed by formula 16;

[0132]

[0133] The output gate determines the hidden state h at the current moment t The output content; it first calculates the output based on the current cell state, then passes through a Sigmoid layer to determine which parts of the information will be output, and finally processes the cell state through the Tanh function and multiplies it with the output of the Sigmoid layer to obtain the final output result h t ; The operation process is shown in Formula 17 and Formula 18;

[0134] ot=σ(Wo[ht-1,xt]+bo) (17)

[0135] ht=ot·tanh(Ct) (18)

[0136] Where Wo is the weight matrix of the output gate; bo is the bias vector of the output gate.

[0137] In order to describe the accuracy and generalization of model prediction, the regression model evaluation index is used: R 2 (fitting effect), RMSE (root mean square error), MAE (mean absolute error), the formulas are shown in formulas 19-21 respectively; R 2 The value is between [0,1]. The closer it is to 1, the better the fitting effect is, and the closer it is to 0, the worse the fitting effect is. It is used to verify the stability of the model. The smaller the value of MAE and RMSE, the better the prediction effect is, which is used to verify the accuracy of the model.

[0138]

[0139] Where: y i is the true value; i ′ is the predicted value; is the average of the true value; i is the sample number; n is the number of samples.

[0140] Random Forest Feature Selection (RF) feature selection results:

[0141] Before model training, the importance between the target variable and other features is calculated using the random forest feature selection (RF) algorithm. Based on the importance evaluation, features that are irrelevant or redundant to the target variable are eliminated, and features with importance values ​​greater than 0.1 are selected as the optimal input feature combination for the model. The results of feature selection are shown in Table 1.

[0142] Table 1. Results of feature selection

[0143]

[0144] Varying filter empirical mode decomposition (TVF-EMD) decomposition and dimensionality reduction:

[0145] The target sequence is decomposed using the variable filter empirical mode decomposition (TVF-EMD) algorithm. This algorithm can adaptively decompose the target sequence into intrinsic mode functions (IMFs) of different frequencies. During the decomposition process, the B-spline order is set to , the smoothing factor α (alpha) is set to 0.5, the tolerance sift-tol is set to 1e-5, and other parameters are kept at the default values.

[0146] Sample entropy is an algorithm that characterizes the complexity of a signal's time series. The closer the sample entropy value is to 0, the simpler and more regular the time series is. The larger the sample entropy value is, the more likely the time series is to change, that is, the more complex and unstable it is, and the less obvious the regularity is. After decomposition by variable filter empirical mode decomposition (TVF-EMD), the sample entropy of the modal components IMFs generated by the decomposition of each indicator to be measured was calculated, and the calculation results are shown in Table 2. The complexity of the IMFs generated by the decomposition of each indicator to be measured is gradually decreasing and finally tends to be stable. In order to improve the operating efficiency of the prediction model and reduce the number of total prediction sequences, it is necessary to perform dimensionality reduction on the signal, and reconstruct the IMF5~IMF8 (or IMF5~IMF7) obtained after decomposition into Co-IMF5 according to the entropy value. The decomposition of the data of each indicator to be measured after the signal dimensionality reduction is shown in the figure. Figure 4 shown.

[0147] Table 2 Sample entropy

[0148]

[0149] SSA-VMD decomposition results:

[0150] It can be seen from Table 2 above that the entropy value of IMF1 is the largest among the modal components generated by the decomposition of each indicator, and the complexity contained in its signal is relatively high. In order to improve the prediction performance of the model and reduce the complexity of the time series, IMF1 is decomposed twice by SSA-VMD to reduce its entropy value. The minimum sample entropy of each IMF is used as the fitness function for optimizing VMD, and the penalty factor α and the number of decomposed IMF components k in VMD are optimized by SSA. The main parameter settings are: the population size in the SSA algorithm is 20, and the number of iterations is 50; the α range in the VMD algorithm is [500,3000], k is [3,12], the noise tolerance tau is 0, the DC component DC is 0, the modal center frequency initialization value int is 1, and the control error size tol is le-7. SSA-VMD decomposes the IMF1 of all indicators into 5 IMFs (SVMD1~SVMD5), and the decomposition results are shown in Figure 5 .

[0151] RF-TVSV-SCL prediction results:

[0152] The predicted water quality indicators after feature selection and double decomposition are normalized and input into the SSA-CNN-LSTM (SCL) model to predict the forecast period of 1 day, 3 days, 5 days and 7 days. In the CNN part of the SCL model: the output dimension of the fully connected layer is 64, the activation function is Relu, and the convolution kernel size is 9; the LSTM part: the LSTM network and the fully connected layer are used for time series data modeling, the loss function is Huber, and the optimizer is Adam; the SSA part: the population number is set to 20 and the maximum number of iterations is 300; the training loss parameters of the CNN-LSTM model for each indicator are shown in Table 3, and the other hyperparameter ranges of the SSA optimized LSTM model are shown in Table 4.

[0153] Table 3 Training loss parameters of CNN-LSTM model for each index

[0154]

[0155] Table 4 SSA optimized LSTM model parameters

[0156]

[0157]

[0158] The water quality data used in this invention comes from a monitoring station located at a certain estuary. The collected water quality indicators include temperature (Temp), pH, dissolved oxygen (DO), electrical conductivity (EC), turbidity (TB), permanganate index (COD Mn ), ammonia nitrogen (NH3-N), total phosphorus (TP) and total nitrogen (TN). A total of 1050 daily data were obtained, of which the first 80% of the data were used for model training and the last 20% of the data were used for model testing to verify the performance of the model.

[0159] In order to better test the generalization ability of the model, this paper focuses on temperature (Temp), total nitrogen (TN), ammonia nitrogen (NH3-N), dissolved oxygen (DO), permanganate index (COD Mn ), electrical conductivity (EC) and turbidity (TB) were predicted and analyzed. The statistical characteristic values ​​of these indicators are shown in Table 5. Predicting the time series changes of river water quality indicators is of great significance for understanding water quality dynamics and promoting regional economic development.

[0160] Table 5 Statistical characteristics of each indicator sequence

[0161]

[0162] Model comparison:

[0163] In order to fully verify the performance of the RF-TVSV-SCL model, the same data is used to compare TVSV-SCL, RF-SCL, RF-TV-SCL, RF-SV-SCL and RF-CE-SCL. The RF, TVSV and SCL in the abbreviations of these models respectively represent the random forest feature selection module, the dual decomposition module based on TVF-EMD and SSA-VMD, and the prediction module based on SSA-CNN-LSTM; TV, SV and CE respectively represent TVF-EMD, SSA-VMD and CEEMDAN, all of which are single decomposition modules. Among them, the CEEMDAN parameter settings are: standard deviation threshold is 0.2, number of iterations is 500, maximum number of iterations is 5000, and other parameters are default values. The parameter settings of other models remain unchanged. Taking TP as an example, Figure 6 and Figure 7 The prediction results of the test set with different models with a forecast period of 1, 3, 5, and 7 days are shown. The other indicators (TN, NH3-N, DO, COD Mn The prediction results of , EC and TB are shown in the Appendix Figure 8-Figure 13 and Table 6.

[0164] Table 6 summarizes the prediction effect information of different models for each indicator under different forecast periods. The RF-TVSV-SCL model proposed in this invention has the following prediction effect information for different forecast indicators: R 2 Between 0.93 and 0.96, with a 3-day forecast period, R 2 Between 0.79 and 0.87, with a 5-day forecast period, R 2 Between 0.63 and 0.72, R 2 Between 0.56 and 0.64. MAE and RMSE also reflect similar rules, that is, as the prediction period increases, the prediction accuracy of the model gradually decreases (the error increases). 2 The prediction accuracy of 0.7 and above is considered appropriate in water quality prediction. It can be seen that the model performs well in water quality prediction within the 1-3 day forecast period and has high prediction accuracy. 2 The values ​​indicate that the model can capture the characteristics of water quality changes well at these time scales. As the forecast period increases, the prediction accuracy of the model gradually decreases, showing certain limitations in water quality forecasts for 5-day and 7-day forecast periods.

[0165] Table 6 Comparison of model accuracy of different water quality indicators in each prediction period

[0166]

[0167]

[0168]

[0169] Verify the effectiveness of feature selection

[0170] In order to reduce the difficulty of training and improve the prediction accuracy, the original water quality indicators were firstly selected by the RF module before signal decomposition and prediction. In order to verify the effect of the RF algorithm on improving the prediction accuracy of the model, the RF-TVSV-SCL model and the TVSV-SCL model were compared to conduct a feature selection effectiveness analysis test.

[0171] By comparison Figure 6 and Figure 7 The prediction results and prediction accuracy of the two models (i.e., RF-TVSV-SCL and TVSV-SCL) show that the TP prediction result curve of the RF-TVSV-SCL model is more consistent with the actual value curve. In addition, combined with Table 1, it can be seen that the prediction accuracy (R 2.0) of the model (i.e., RF-TVSV-SCL) after feature selection for the TP index in the one-day forecast period is better. 2 =0.95, MAE = 0.004, RMSE = 0.005) is significantly better than TVSV-SCL without feature selection (R 2 =0.848, MAE=0.007, RMSE=0.008), and RF-TVSV-SCL is also better in the other forecast periods (3 days, 5 days and 7 days). Therefore, it is proved that feature selection through RF can effectively improve the prediction accuracy of the model by eliminating features that are irrelevant or redundant to the target variable.

[0172] Verify the validity of the dual decomposition

[0173] To verify the effectiveness of the double decomposition, RF-TVSV-SCL was compared with models containing single decomposition (RF-TV-SCL, RF-SV-SCL and RF-CE-SCL) and a model without decomposition (RF-SCL). Overall, the TP prediction accuracy is ranked as double decomposition model > single decomposition model > no decomposition model. Compared with the model without decomposition RF-SCL, the R 2The prediction accuracy of TP increased by 7.72%, 11.87%, 25.89% and 45.43% in the 1, 3, 5 and 7 day forecast periods, respectively. Among the three models of single decomposition, the prediction accuracy of TP is ranked as RF-TV-SCL>RF-SV-SCL>RF-CE-SCL. It can be seen that TVF-EMD performs best in signal decomposition, followed by SSA-VMD, while CEEMDAN performs the weakest. It shows that TVF-EMD performs well in processing nonlinear and non-stationary signals, and can better extract effective information related to water quality prediction, so it performs best in prediction accuracy. Although SSA-VMD also has good decomposition ability, the prediction effect may be affected by excessive decomposition or computational complexity. Although CEEMDAN can provide a basic decomposition method, its anti-noise ability and modal separation effect are weak, resulting in relatively poor prediction accuracy.

[0174] The double decomposition RF-TVSV-SCL model combines two different decomposition methods, TVF-EMD and SSA-VMD, to extract features more comprehensively, effectively suppress noise, capture complex nonlinear relationships, and enhance the robustness of the model. These advantages make it significantly better than the single decomposition model and the non-decomposition model in terms of prediction accuracy.

[0175] In addition, according to Figure 8-Figure 13 The comparison between the predicted value and the actual monitoring value and the prediction accuracy of each model shown in Table 6 are shown in Table 6. For the other six water quality indicators TN, NH3-N, DO, COD Mn , EC and TB, the RF-TVSV-SCL model showed the best prediction effect compared with the other five models; and it performed well in water quality prediction within the 1-3 day forecast period. Specifically, under the 1-day forecast period, the R 2 They reached 0.951, 0.958, 0.949, 0.953, 0.930 and 0.941 respectively; under the 3-day forecast period, R 2 They are 0.810, 0.798, 0.836, 0.820, 0.786 and 0.870 respectively. In the 5-day forecast period, except for DO and EC, R 2 All of them exceed 0.7. It can be seen that the RF-TVSV-SCL model constructed by the present invention has a strong generalization performance, is applicable to most conventional water quality indicators in water bodies, has good prediction ability, and can also provide a reliable decision-making basis for water pollution prevention and control with a forecast period of at least 3 days.

[0176] The RF-TVSV-SCL model constructed in the present invention performs well in water quality prediction, especially in short-term prediction (1-day and 3-day forecast period), and its predictions for total phosphorus (TP), total nitrogen (TN), ammonia nitrogen (NH3-N), dissolved oxygen (DO), permanganate index (CODMn ), conductivity (EC) and turbidity (TB), the prediction accuracy of water quality indicators such as the single decomposition model (such as RF-TV-SCL, RF-SV-SCL, RF-CE-SCL) and the non-decomposition model (RF-SCL). In the 1-day forecast period, the R 2 The value reached 0.93-0.96, and the R 2 The values ​​are 0.79-0.87, indicating that the model can accurately capture the short-term dynamic changes of water quality indicators.

[0177] In terms of signal decomposition, TVF-EMD and SSA-VMD outperform CEEMDAN. The first two decomposition methods are more capable in processing nonlinear and non-stationary signals, with better noise immunity, higher decomposition accuracy, and lower modal aliasing risk. These decomposition advantages make the prediction accuracy of the RF-TVSV-SCL model significantly better than that of the RF-SCL model. Taking TP as an example, the R of the RF-TVSV-SCL model in the 1, 3, 5, and 7-day forecast periods is 1.3 times that of the RF-TVSV-SCL model. 2 The values ​​are increased by 7.72%, 11.87%, 25.89% and 45.43% respectively, further demonstrating the effectiveness of the dual decomposition strategy in improving the prediction performance of the model.

[0178] In terms of feature selection, the RF algorithm eliminates features that are irrelevant or redundant to the target variable, making the prediction accuracy of the RF-TVSV-SCL model better than that of the TVSV-SCL model without feature selection in all forecast periods. For example, in the 1, 3, 5, and 7-day forecast periods, the prediction accuracy of the RF-TVSV-SCL model for TP is R 2 Compared with the model without feature selection, the improvements were 11.9%, 26.0%, 18.8% and 19.7%, respectively, which effectively demonstrated the necessity and effectiveness of the RF algorithm in improving the performance of water quality prediction models.

[0179] The river water quality prediction method combining dual signal decomposition and deep learning of the present invention has shown strong adaptability and application potential in water quality prediction.

[0180] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein, but these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A river water quality prediction method combining dual signal decomposition and deep learning, characterized in that: It includes the following steps: Step S1: Feature selection is performed through Random Forest Feature Selection (RF) to extract water quality data related to water quality prediction; Step S2: In the preprocessing of water quality data, Time-Varying Filter Empirical Mode Decomposition (TVF-EMD) is used to perform preliminary decomposition on the water quality data. The Intrinsic Mode Function (IMF) components generated by the decomposition contain a large number of complex signals. The Sparrow Search Algorithm-Variational Mode Decomposition (SSA-VMD) is used to perform secondary decomposition on the complex Intrinsic Mode Function (IMF) components; Step S3: The Sparrow Algorithm Optimized Convolutional Long Short-Term Memory Neural Network Model (SSA-CNN-LSTM) is used to predict the data processed in Step S2.

2. The river water quality prediction method combining dual signal decomposition and deep learning according to claim 1 is characterized in that: The Random Forest Feature Selection (RF) algorithm includes the following steps: Step S11: Randomly sample with replacement from the dataset N, select n (n < N) samples, and perform k samplings in total to generate k training sets. The remaining data constitutes the Out-of-Bag (OOB) dataset; Step S12: Construct decision trees for the k training sets and train them to form k decision trees in total. Calculate the voting results of each decision tree in its corresponding Out-of-Bag (OOB) dataset; Step S13: The feature X in the out-of-bag dataset (OOB) i The sequence of (i=1, 2, 3, ..., M) is randomly changed (M is the number of data set features) to form a new out-of-bag data set (OOB) sample, and then the new out-of-bag data set (OOB) is voted through the established RF model to obtain the voting result; Step S14: Calculate X according to the formula i Importance score IMP i , select IMP i >0.1 feature combinations as input variables; Where: IMP i is the importance score; k is the number of decision trees; S k is the voting result of each decision tree in its corresponding out-of-bag data set (OOB); S k,i It is the voting result of the decision tree in its corresponding out-of-bag (OOB) dataset after randomly changing the feature order.

3. The river water quality prediction method combining dual signal decomposition and deep learning according to claim 2 is characterized in that: In Step S2, in the preprocessing of water quality data, the non-stationarity of the signal and the noise problem lead to a decrease in prediction accuracy. Time-Varying Filter Empirical Mode Decomposition (TVF-EMD) is used to perform preliminary decomposition on the water quality data. The Time-Varying Filter Empirical Mode Decomposition (TVF-EMD) method uses non-uniform B-spline approximation as a time-varying filter to complete the selection of the cut-off frequency. The Time-Varying Filter Empirical Mode Decomposition (TVF-EMD) includes the following steps: Step S21: Calculate the local cut-off frequency using B-spline approximation, expressed as: Where: φ′ bis (t) is the cutoff frequency; φ′1(t) and φ′2(t) are both instantaneous frequency components; in order to solve the problem of modal aliasing, the local cutoff frequency φ′ needs to be recalculated. bis (t) make adjustments; Step S22: Reconstruct φ′ bis (t), and obtain the new signal g(t), g(t) = cos[∫φ″ bis (t)dt], the input signal is further filtered using a time-varying filter to obtain a local mean function; Step S23: Check whether the remaining signal meets the stop condition. t When it is less than or equal to the set threshold ξ, a component signal IMF can be determined, which meets the stop condition; Where: B Loughlin (t) is the instantaneous bandwidth of Loughlin, φ avg (t) is the weighted average of the instantaneous frequency.

4. The river water quality prediction method combining dual signal decomposition and deep learning according to claim 3 is characterized in that: In Step S2, the Sparrow Search Algorithm (SSA) divides the sparrow population into three types of roles: discoverers, joiners, and guards. Each type of role undertakes different tasks in the algorithm and collaborates to complete the optimization process; When using the Sparrow Search Algorithm (SSA), for discoverers, traverse i discoverers and update the position information of the j-th dimension in the (t + 1)-th iteration, expressed by the following formula: Where: is the position information of the i-th sparrow at the j-th dimension in the t-th iteration; t max is the maximum number of iterations; a is a random number within the range of [0, 1]; ST is a constant within [0.5, 1], representing the safety value; R2 is a random value within [0, 1], representing the warning value. When R2 < ST, the predation environment is safe, and the searchers search for food; otherwise, when R2 ≥ ST, the sentinels issue an alarm, the searchers stop searching, immediately fly away from the predation area, and fly to the safe area; Q is a random number that follows a normal distribution; L is a 1×d matrix with all elements being 1; The main task of joiners is to follow discoverers to obtain food and adjust their positions during the process to seek the optimal solution. The position update formula for joiners is as follows: Where: is the worst individual in the tth iteration; is the position of the best searcher in the t+1th iteration; A is a 1×d matrix, and its elements are randomly assigned 1 or -1; A + For a matrix that satisfies A + =A T (AA T ) -1 ; n is the number of participants; when When , it means that the current sparrow is in a bad position and may starve, so it needs to fly farther to find food; when When , it means the current sparrow is in a good position, and you just need to move closer to the sparrow with the best position; The task of guards is to sound an alarm when the population is in danger and lead the entire group to fly to a safe area. The movement method of guards is as follows: Where: is the best individual in the tth iteration; β is a random number that obeys a normal distribution with a mean of 0 and a variance of 1; K is a random number in [-1,1], where the positive and negative numbers represent the moving direction of the sparrow, and the size represents the step length control parameter; f i is the fitness value of the current individual; f g is the maximum fitness value of individuals in the current group; f w is the minimum fitness value of individuals in the current group; ε is the smallest constant to avoid a denominator of 0.

5. The river water quality prediction method combining dual signal decomposition and deep learning according to claim 4 is characterized in that: In Step S2, Variational Mode Decomposition (VMD) adaptively determines the number of mode decompositions to achieve effective separation of signal components and can reduce the non-stationarity of the signal; Its decomposition performance is mainly related to the number of modes K and the penalty factor α; The primary task of Variational Mode Decomposition (VMD) is to decompose the original signal into multiple mode components, and each component corresponds to a specific frequency range. The construction of the variational problem of Variational Mode Decomposition (VMD) includes the following steps: Where: K is the number of modes to be decomposed; u k (t) is the kth modal component after decomposition; w k is the center frequency of the Kth modal component; δ t is the Dirac function; * is the convolution symbol; f(t) is the original signal, (δ t +j / πt)*u k (t) To obtain the analytical signal of the original signal; is to shift the spectrum to the baseband; j is the imaginary unit 40; In order to obtain the optimal solution of the variational mode decomposition (VMD) problem, the Lagrangian multiplier method λ and the penalty factor α are introduced to transform the constrained variational problem into an unconstrained variational problem. The augmented Lagrangian function is shown in Formula 9. On this basis, the alternating direction multiplier method (ADMM) is used to calculate the modal component u k (t) and center frequency w k Perform iterative updates, see formulas 10 and 11 respectively; Where: for Wiener filtering of the residual signal; w is the frequency; IFFT is the inverse Fourier transform; are the Fourier transforms of the original signal and the kth modal component, respectively; in this way, variational mode decomposition (VMD) can adaptively adjust the modal components and center frequencies to ensure the accuracy and stability of signal decomposition.

6. The river water quality prediction method combining dual signal decomposition and deep learning according to claim 5 is characterized in that: In the water quality prediction of step S3, the convolutional neural network (CNN) improves the prediction accuracy of the model by extracting local features; the convolution layer and pooling layer in the convolutional neural network (CNN) model are through the data processing layer, and the local features of the data are extracted and the feature dimension is reduced by alternately using the convolution layer and the pooling layer; the calculation formula of the convolutional neural network (CNN) is as follows: Where: T is the time feature sequence after convolution; n is the input data X k Length; W k is the kernel function sequence of convolution.

7. The river water quality prediction method combining dual signal decomposition and deep learning according to claim 6 is characterized in that: In the water quality prediction in step S3, the long short-term memory network (LSTM) solves the gradient vanishing and gradient exploding problems through three gating units and cell states, namely the forget gate, input gate, and output gate, so that the network can maintain a stable training effect over a longer time series.

8. The river water quality prediction method combining dual signal decomposition and deep learning according to claim 7, characterized in that: The forget gate is used to decide which information to discard from the cell state. The forget gate reads the previous output h t-1 and the current input value x t , a vector f with a value between 0 and 1 is generated through a Sigmoid function t , each value in this vector represents the degree of information retention. The closer it is to 0, the more information is discarded, and the closer it is to 1, the more information is retained. Finally, this vector is related to the cell state C t-1 Multiply to determine which information needs to be forgotten; the forget gate calculation is expressed by formula 13; f t =σ(W f ·[h t-1 ,x t ]+b f ) (13) Where: W f is the weight matrix of the forget gate; B f is the bias vector of the forget gate; σ represents the Sigmoid activation function; The input gate determines how new information will be updated to the cell state; the input gate includes a Sigmoid layer and a tanh layer: the Sigmoid layer is called the "input gate layer" and determines which values ​​will be updated; the tanh layer is used to generate a new candidate value vector The candidate value will be added to the cell state; the calculation process of the input gate is shown in Formula 14 and Formula 15: i t =σ(W i ·[h t-1 ,x t ]+b i ) (14) Among them, W i and W c are the weight matrices of the input gate and candidate values ​​respectively; b i and b c are the corresponding bias vectors respectively; tanh represents the hyperbolic tangent activation function.

9. The river water quality prediction method combining dual signal decomposition and deep learning according to claim 8, characterized in that: The cell state is the key to the long short-term memory network (LSTM), and the cell state carries the information accumulated from a period of time; the new cell state C t is the cell state C at the previous moment. t-1 And the output f of the forget gate t Multiply and add the output i of the input gate t With candidate value The result of the multiplication represents the memory update at the current moment, and the process is expressed by formula 16; The output gate determines the hidden state h at the current moment t The output content; it first calculates the output based on the current cell state, then passes through a Sigmoid layer to determine which parts of the information will be output, and finally processes the cell state through the Tanh function and multiplies it with the output of the Sigmoid layer to obtain the final output result h t ; The operation process is shown in Formula 17 and Formula 18; the t =σ(W o [h t-1 ,x t ]+b o ) (17) h t =o t ·tanh(C t ) (18) Where W o is the weight matrix of the output gate; b o is the bias vector of the output gate.

10. The river water quality prediction method combining dual signal decomposition and deep learning according to claim 9, characterized in that: In order to describe the accuracy and generalization of model prediction, the regression model evaluation index is used: R 2 (fitting effect), RMSE (root mean square error), MAE (mean absolute error), the formulas are shown in formulas 19-21 respectively; R 2 The value is between [0,1]. The closer it is to 1, the better the fitting effect is, and the closer it is to 0, the worse the fitting effect is. It is used to verify the stability of the model. The smaller the value of MAE and RMSE, the better the prediction effect is, which is used to verify the accuracy of the model. Where: y i is the true value; i ′ is the predicted value; is the average of the true value; i is the sample number; n is the number of samples.

Citation Information

Cited By

  • Efficient solving method for flood control optimal scheduling of basin complex reservoir group

    CN119809141A

  • Multi-feature coupling fault prediction method for power generation steam turbine

    CN120144991A

  • Method and system for dynamically predicting surrounding rock stress of deep large-mining-height working face

    CN120408790A

  • Control method of water supply raw water treatment system

    CN121413886A