Dissolved oxygen concentration prediction method based on data decomposition and deep learning
By combining octanometric geometric modal decomposition and deep learning technology, the historical data of dissolved oxygen concentration is decomposed and feature extraction is established, and the composite deep learning model is solved, which solves the accuracy and response speed problems of traditional dissolved oxygen concentration prediction methods, and achieves efficient and accurate prediction of dissolved oxygen concentration.
Patent Information
- Application Number
- CN202411406462.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-02-25
AI Technical Summary
The traditional method of predicting dissolved oxygen concentrations has problems such as low prediction accuracy, slow response speed, high calculation cost, and failure to consider periodicity, seasonality and trend.
Combining octyl geometric modal decomposition (SGMD) and deep learning technology, the historical data of dissolved oxygen is decomposed through SGMD, the main changing characteristics on different time scales are extracted, and the decomposed data is input into a composite deep learning model composed of convolutional neural network (CNN) and time convolutional network (TCN), and a complex relationship model between dissolved oxygen concentration and environmental factors is established.
It realizes efficient and accurate dissolved oxygen concentration prediction, meets the needs of real-time monitoring and rapid response, and improves prediction accuracy and generalization capabilities of the model.
Smart Images

Figure CN119513507A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of water quality monitoring and environmental science, and in particular to a method for predicting dissolved oxygen concentration based on data decomposition and deep learning. Background Art
[0002] Dissolved oxygen is the amount of oxygen dissolved in water and is a key indicator for evaluating the self-purification capacity, biological activity and water quality of water. Real-time monitoring and accurate prediction of dissolved oxygen concentration are of great significance in the fields of water treatment, aquaculture, ecological protection of rivers and lakes, and water quality monitoring.
[0003] With the development of information technology, data-driven prediction methods have begun to be applied in the field of water quality monitoring. Machine learning technology, especially deep learning, is widely used in water quality prediction problems due to its advantages in dealing with complex nonlinear relationships. However, traditional machine learning models have problems such as difficulty in feature extraction, weak model generalization ability, and low computational efficiency when processing time series data. Summary of the invention
[0004] In view of the shortcomings of the prior art, the present invention aims to provide an efficient and accurate dissolved oxygen concentration prediction method by combining symplectic geometric mode decomposition (SGMD) and deep learning technology. The method of the present invention can solve the problems of low prediction accuracy, slow response speed, high computational cost, etc. in traditional dissolved oxygen prediction methods, meet the needs of real-time monitoring and rapid response, and solve the problem that most traditional dissolved oxygen prediction methods only consider time series characteristics but not periodicity, seasonality and trend.
[0005] The present invention uses the symplectic geometric mode decomposition (SGMD) method to decompose the historical data of dissolved oxygen and extract the main change characteristics on different time scales; the decomposed data is input into a composite deep learning model composed of a convolutional neural network (CNN) and a temporal convolutional network (TCN), and by learning the patterns in the historical data, a complex relationship model between dissolved oxygen concentration and various environmental factors is established. The technical solution of the present invention is as follows.
[0006] The present invention provides a method for predicting dissolved oxygen concentration based on data decomposition and deep learning, comprising the following steps:
[0007] S1. Obtain historical data of dissolved oxygen concentration and other water quality parameters and meteorological parameters in a certain area, establish a feature database, remove outliers and fill missing values in the original data, and use the Z-Score method to normalize all data due to the different dimensions of different features;
[0008] S2. Using Pearson correlation analysis, we selected strongly correlated water quality parameters and meteorological parameters; considering the autocorrelation of dissolved oxygen concentration, we introduced dissolved oxygen concentration and constructed delayed input features;
[0009] S3. Taking advantage of the symplectic geometric mode decomposition (SGMD) method to process nonlinear unsteady sequences, water temperature, total nitrogen, total phosphorus, pH, ammonia nitrogen, permanganate index, turbidity, conductivity, air temperature, humidity, rainfall, and dissolved oxygen at the measured location are decomposed into a group of relatively stable subsequences to eliminate some error components with large fluctuations.
[0010] S4. Construct a multi-layer modal subsequence feature matrix that can better reflect the temporal variation characteristics of historical data based on the decomposition results, and form a subsequence input matrix with corresponding subsequences of different input features and dissolved oxygen concentrations;
[0011] S5. The CNN-TCN neural network is used for feature extraction and dissolved oxygen concentration prediction. Then, the final prediction result is obtained through denormalization and subsequence reconstruction, and an error evaluation is performed on it.
[0012] Furthermore, the step 1 performs data cleaning on the historical data, removes outliers and completes the data. The Laida criterion method is used to remove outliers to obtain historical dissolved oxygen concentration data, water quality historical data, and meteorological historical data; on the basis of removing outliers, the bilinear interpolation method is used to fill in the missing data of the data set, and the processed complete dissolved oxygen concentration data and other water quality parameter historical data and meteorological parameter data are obtained.
[0013] Then the cleaned data is normalized. The normalization formula is expressed as:
[0014]
[0015] Where: X is the data before standardization, X' is the corresponding normalized data, m and s represent the mean and standard deviation of the original data respectively.
[0016] Furthermore, the step 2 uses the Pearson correlation coefficient to analyze the correlation between dissolved oxygen concentration and water quality data and meteorological data, so as to determine the strong correlation meteorological factor, and the calculation formula is:
[0017]
[0018] Where: P XY is the Pearson correlation coefficient, X and Y are correlation factors; are the means of the two factors respectively;
[0019] Considering that the dissolved oxygen concentration has a strong temporal continuity within the cycle, the dissolved oxygen concentration at the time t to be measured has a strong correlation with the historical dissolved oxygen concentration, and it is necessary to introduce the historical dissolved oxygen concentration as a delayed input feature for prediction. The delay step will directly affect the prediction effect of the model. If the delay step is too long, it will cause the prediction model to overfit. If the delay step is too short, the model will not be able to fully learn the time dependence of the input feature. According to the selection result of the delay step of dissolved oxygen concentration, the delayed input feature is expanded, and the historical dissolved oxygen concentration is introduced as the input feature;
[0020] Furthermore, step 3 takes into account that dissolved oxygen concentration and pH are highly oscillating and unstable signals, and their volatility makes it difficult to predict such signals. This paper uses the method of modal decomposition to decompose the time series signal into multiple components, which will produce a more stable and less volatile time series. These time sub-series signals will improve the prediction accuracy.
[0021] Assume that the time series data of dissolved oxygen concentration data, water quality data, and meteorological data are x=[x 1 ,x 2 ,......,x n ], where n is the length of the time series signal, and a d-dimensional trajectory matrix X is constructed as shown below:
[0022] m=n-(d-1)
[0023]
[0024] Where: λ is the delay time.
[0025] Construct the Hamiltonian matrix M based on the matrix A:
[0026] A=X T X
[0027]
[0028] Then let N = M 2 , to construct the symplectic orthogonal matrix Q:
[0029]
[0030] Where: B is an upper triangular matrix, and its eigenvalue is calculated as λ 1 ,λ 2 ,......,λ d , then the eigenvalues of matrix A are:
[0031]
[0032] Where: iAccording to the symplectic geometric spectrum distribution of matrix A, Q(i=1,2...,d) is composed of σ i The eigenvectors of , then the reconstruction steps of each component matrix are as follows:
[0033]
[0034] Z i =Q i S i
[0035] Where: i = 1, 2, ..., d. Then the initial single-component trajectory matrix Z is as follows:
[0036] Z=Z 1 +Z 2 +·+Z d
[0037] Where: Z∈R m×d . Define Z i Element z ij , 1≦i≦d, 1≦j≦m, and d * =min(m,d),m * =max(m,d), n=m+(d-1)τ, then:
[0038]
[0039] Then the diagonal average transformation matrix can be obtained as follows:
[0040]
[0041] The matrix Z can be transformed into a d×n dimensional matrix Y by diagonal averaging, thereby decomposing the input variable signal x into d symplectic geometric mode components with different center frequencies:
[0042] Y=Y 1 +Y 2 +…+Y d
[0043] Furthermore, in order to better explore the periodicity of meteorological factors, water quality factors and dissolved oxygen concentration, the step 4 adopts CNN-TCN composed of convolutional neural network and time convolutional network as the feature extraction and dissolved oxygen concentration prediction model, and takes dissolved oxygen concentration, other water quality parameter data and meteorological data as its input, so that the model can deeply explore the correlation between input features and the changing trend of feature time series.
[0044] The convolutional neural network model is mainly composed of three layers: input layer, hidden layer and output layer. The hidden layer is the feature extraction layer, which is mainly composed of convolution layer and pooling layer. In order to improve the feature extraction ability of the model, a multi-layer convolution layer is designed. Its mathematical expression is as follows:
[0045] f i =σ(W i *X i +b i )
[0046] Where: X i Input features for the i-th convolutional layer; "*" indicates convolution operation; W i and b i and represent the weight matrix and bias vector of the convolution kernel of the i-th convolution layer respectively; f i is the output feature of the i-th convolutional layer; σ represents the ReLU activation function.
[0047] As periodic data, dissolved oxygen concentration shows great time series correlation. Therefore, the feature vector extracted by the CNN module is flattened by the Flatten layer and then input into the TCN to extract the time series characteristics of the input features, calculate the forward propagation characteristics and the reverse propagation characteristics, and further improve the prediction accuracy. The mathematical expression is shown below.
[0048]
[0049] Where y t is the output at time step t, x t-i is the input at time step t, w i is the weight of the convolution kernel, corresponding to different time delays i, * represents the convolution operation, and b is the bias term.
[0050] One of the key features of TCN is its causal convolution and dilated convolution, which allows the network to capture information at a higher temporal resolution while keeping the number of parameters unchanged. The formula for dilated convolution can be expressed as:
[0051]
[0052] Where r is the dilation rate, which controls the spacing of elements in the convolution kernel, and d is the depth of the current convolution layer.
[0053] The present invention also provides a computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned method for predicting dissolved oxygen concentration based on data decomposition and deep learning.
[0054] Furthermore, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the above-mentioned method for predicting dissolved oxygen concentration based on data decomposition and deep learning is implemented.
[0055] Compared with the prior art, the present invention has the following advantages:
[0056] The present invention proposes a method for predicting dissolved oxygen concentration based on data decomposition and deep learning, comprehensively considers the periodicity, seasonality and trend of dissolved oxygen concentration, collects water quality data and meteorological data, and mines the influence of different factors on dissolved oxygen concentration; uses the symplectic geometric mode decomposition SGMD method to decompose dissolved oxygen concentration data, water quality data and meteorological data respectively. SGMD is a time series analysis method that can decompose different frequency components in the time series, which helps to extract the intrinsic pattern of dissolved oxygen concentration changes, better extract the time series change characteristics in historical data, and reduce the volatility and instability of the original data series; uses the CNN-TCN combined prediction model to mine the potential laws and time series dependencies of input features. The model performs well in processing sequence data and prediction tasks, can learn complex spatiotemporal relationships, can not only accurately predict future dissolved oxygen concentration changes, but also has good generalization ability and robustness. Compared with other prediction models, it has higher prediction accuracy and feasibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 It is a schematic diagram of the process of the present invention.
[0058] Figure 2 Enter the characteristic schematic for the delay.
[0059] Figure 3 This is the SGMD-CNN-TCN model diagram. DETAILED DESCRIPTION
[0060] The present invention will be further explained below in conjunction with the accompanying drawings and embodiments.
[0061] Figure 1 The present invention provides a flow chart of a method for predicting dissolved oxygen concentration based on data decomposition and deep learning, which includes the following steps:
[0062] (1) Obtain historical data on dissolved oxygen concentration and other water quality parameters and meteorological parameters in a certain area, establish a feature database, remove outliers and fill in missing values in the original data, and use the Z-Score method to normalize all data due to the different dimensions of different features;
[0063] (2) Using Pearson correlation analysis, strongly correlated water quality parameters and meteorological parameters were selected; considering the autocorrelation of dissolved oxygen concentration, dissolved oxygen concentration was introduced to construct delayed input characteristics;
[0064] (3) Taking advantage of the SGMD in processing nonlinear and unsteady sequences, water temperature, total nitrogen, total phosphorus, pH, ammonia nitrogen, permanganate index, turbidity, conductivity, air temperature, humidity, rainfall, and dissolved oxygen at the measured location are decomposed into a group of relatively stable subsequences to eliminate some error components with large fluctuations;
[0065] (4) Based on the decomposition results, a multi-layer modal subsequence feature matrix that can better reflect the temporal variation characteristics of historical data is constructed, and the corresponding subsequences of different input features and water quality data and meteorological data are combined into a subsequence input matrix;
[0066] (5) The CNN-TCN neural network is used for feature extraction and dissolved oxygen concentration prediction. The final prediction result is then obtained through denormalization and subsequence reconstruction, and an error evaluation is performed.
[0067] The specific contents are as follows:
[0068] (1) Clean the historical data, remove outliers and complete the data. Use the Laida criterion method to remove outliers. Obtain historical data on dissolved oxygen concentration and other historical data on water quality parameters and meteorological parameters; on the basis of removing outliers, use the bilinear interpolation method to fill in the missing data of the data set, and obtain processed dissolved oxygen concentration, water quality data and meteorological data.
[0069] Then the cleaned data is normalized. The normalization formula is expressed as:
[0070]
[0071] Where: X is the data before standardization, X' is the corresponding normalized data, m and s represent the mean and standard deviation of the original data respectively.
[0072] (2) The Pearson correlation coefficient was used to analyze the correlation between dissolved oxygen concentration and water quality parameters and meteorological data, thereby determining the strongly correlated water quality parameters and meteorological data. The calculation formula is:
[0073]
[0074] Where: P XY is the Pearson correlation coefficient, X and Y are correlation factors; are the means of the two factors respectively;
[0075] like Figure 2As shown, considering that the dissolved oxygen concentration has a strong temporal continuity within the period, the dissolved oxygen concentration at the time t to be measured has a strong correlation with the historical dissolved oxygen concentration, and it is necessary to introduce the historical dissolved oxygen concentration as a delayed input feature for prediction. The delay step will directly affect the prediction effect of the model. If the delay step is too long, it will cause the prediction model to overfit. If the delay step is too short, the model will not be able to fully learn the time dependence of the input feature. According to the selection result of the delay step of dissolved oxygen concentration, the delayed input feature is expanded, and the historical dissolved oxygen concentration is introduced as the input feature;
[0076] (3) Considering that the input characteristics and water quality data and meteorological data are highly oscillating and unstable signals, their volatility makes it difficult to predict such signals. This paper uses the modal decomposition method to decompose the time series signal into multiple components, which will produce a more stable and less volatile time series. These time subseries signals will improve the prediction accuracy.
[0077] Assume that the time series data of dissolved oxygen concentration, water quality data, and meteorological data are x=[x 1 ,x 2 ,……,x n ], where n is the length of the time series signal, and a d-dimensional trajectory matrix X is constructed as shown below:
[0078] m=n-(d-1)
[0079]
[0080] Where: λ is the delay time.
[0081] Construct the Hamiltonian matrix M based on the matrix A:
[0082] A=X T X
[0083]
[0084] Then let N = M 2 , to construct the symplectic orthogonal matrix Q:
[0085]
[0086] Where: B is an upper triangular matrix, and its eigenvalue is calculated as λ 1 ,λ 2 ,……,λ d , then the eigenvalues of matrix A are:
[0087]
[0088] Where: iAccording to the symplectic geometric spectrum distribution of matrix A, Q(i=1,2...,d) is composed of σ i The eigenvectors of , then the reconstruction steps of each component matrix are as follows:
[0089]
[0090] Z i =Q i S i
[0091] Where: i = 1, 2, ..., d. Then the initial single-component trajectory matrix Z is as follows:
[0092] Z=Z 1 +Z 2 +…+Z d
[0093] Where: Z∈R m×d . Define Z i Element z ij , 1≦i≦d, 1≦j≦m, and d * =min(m,d),m * =max(m,d), n=m+(d-1)τ, then:
[0094]
[0095] Then the diagonal average transformation matrix can be obtained as follows:
[0096]
[0097] The matrix Z can be transformed into a d×n dimensional matrix Y by diagonal averaging, thereby decomposing the input variable signal x into d symplectic geometric mode components with different center frequencies:
[0098] Y=Y 1 +Y 2 +…+Y d
[0099] (4) In order to better explore the periodicity of meteorological factors, water quality factors and dissolved oxygen concentration, this paper adopts CNN-TCN composed of convolutional neural network and time convolutional network as the feature extraction and dissolved oxygen concentration prediction model, and takes dissolved oxygen concentration, other water quality parameter data and meteorological data as its input, so that the model can deeply explore the correlation between input features and the changing trend of feature time series.
[0100] The convolutional neural network model is mainly composed of three layers: input layer, hidden layer and output layer. The hidden layer is the feature extraction layer, which is mainly composed of convolution layer and pooling layer. In order to improve the feature extraction ability of the model, a multi-layer convolution layer is designed. Its mathematical expression is as follows:
[0101] f i =σ(W i *X i +b i )
[0102] Where: X i Input features for the i-th convolutional layer; "*" indicates convolution operation; W i and b i and represent the weight matrix and bias vector of the convolution kernel of the i-th convolution layer respectively; f i is the output feature of the i-th convolutional layer; σ represents the ReLU activation function.
[0103] As periodic data, dissolved oxygen concentration shows great time series correlation. Therefore, the feature vector extracted by the CNN module is flattened by the Flatten layer and then input into the TCN to extract the time series characteristics of the input features, calculate the forward propagation characteristics and the reverse propagation characteristics, and further improve the prediction accuracy. The mathematical expression is shown in -.
[0104]
[0105] Where y t is the output at time step t, x t-i is the input at time step t, w i is the weight of the convolution kernel, corresponding to different time delays i, * represents the convolution operation, and b is the bias term.
[0106] One of the key features of TCN is its causal convolution and dilated convolution, which allows the network to capture information at a higher temporal resolution while keeping the number of parameters unchanged. The formula for dilated convolution can be expressed as:
[0107]
[0108] Where r is the dilation rate, which controls the spacing of elements in the convolution kernel, and d is the depth of the current convolution layer.
[0109] In the present invention, the loss function used in training the CNN-TCN neural network is the mean square error (MSE).
[0110] In a specific embodiment, historical data was obtained through the national surface water quality automatic monitoring real-time data release system, and the dissolved oxygen concentration prediction method based on data decomposition and deep learning of the present invention was used for testing. The prediction accuracy of the model for river DO concentration reached r2=0.9532, showing excellent prediction effect. The results show that the addition of SGMD significantly enhances the prediction ability of the CNN-TCN model, with MAE increased by 7.8%, MSE increased by 12.9%, RMSE increased by 6.7%, and r2 increased by 0.7%.
Claims
1. A method for predicting dissolved oxygen concentration based on data decomposition and deep learning, characterized in that: The steps include: S1. Obtain historical data of water quality parameters and meteorological parameters in a certain area, establish a feature database, remove outliers and fill missing values in the original data, and normalize all data; water quality parameters include dissolved oxygen concentration, water temperature, total nitrogen, total phosphorus, pH, ammonia nitrogen, permanganate index, turbidity and conductivity, and meteorological parameters include temperature, humidity and rainfall; S2. Use the Pearson correlation coefficient to analyze the correlation between dissolved oxygen concentration and other water quality parameters and meteorological parameter data, and select strongly correlated water quality parameters and meteorological parameters; consider the autocorrelation of dissolved oxygen concentration, introduce dissolved oxygen concentration, and construct delayed input features; S3, using the symplectic geometric mode decomposition (SGMD) method to decompose the time series data features into a set of relatively stable smaller time subsequences to eliminate some error components with large volatility; S4. Construct a multi-layer modal subsequence feature matrix that can better reflect the temporal variation characteristics of historical data based on the decomposition results, and form a subsequence input matrix with corresponding subsequences of different input features and dissolved oxygen concentrations; S5. A CNN-TCN neural network consisting of a convolutional neural network (CNN) and a temporal convolutional network (TCN) is used to extract features and predict dissolved oxygen concentration. The final prediction result is then obtained through denormalization and subsequence reconstruction, and an error assessment is performed.
2. The method for predicting dissolved oxygen concentration based on data decomposition and deep learning according to claim 1, characterized in that: In step S1, the Laida criterion method is used to give a confidence probability and determine a confidence limit. It is considered that errors exceeding this limit do not belong to the range of random errors and are considered as outliers and removed to obtain data without outliers. On the basis of eliminating outliers, the bilinear interpolation method was used to fill in the missing data in the dissolved oxygen concentration data and other historical data of water quality parameters and meteorological parameter data.
3. The method for predicting dissolved oxygen concentration based on data decomposition and deep learning according to claim 1, characterized in that: In step S1, all data are normalized using the Z-Score method.
4. The method for predicting dissolved oxygen concentration based on data decomposition and deep learning according to claim 1, characterized in that: In step S2, considering that the dissolved oxygen concentration has a strong temporal continuity within the cycle, the dissolved oxygen concentration at the measured time t has a strong correlation with the historical dissolved oxygen concentration. According to the selection result of the delay step of the dissolved oxygen concentration, the delayed input feature is expanded and the historical dissolved oxygen concentration is introduced as the input feature.
5. The method for predicting dissolved oxygen concentration based on data decomposition and deep learning according to claim 1, characterized in that: In step S3, the time series data of dissolved oxygen concentration, other water quality data, and meteorological data are assumed to be x=[x1, x2, ..., x n ], where n is the length of the time series signal, and a d-dimensional trajectory matrix X is constructed as shown below: m=n-(d-1) Where: λ is the delay time; Construct the Hamiltonian matrix M based on the matrix A: A=X T X Then let N = M 2 , to construct the symplectic orthogonal matrix Q: Where: B is an upper triangular matrix, and its eigenvalues are calculated as λ1,λ2,…,λ d , then the eigenvalues of matrix A are: σ1>σ2>…>σ d Where: i According to the symplectic geometric spectrum distribution of matrix A, Q(i=1,2...,d) is composed of σ i The eigenvectors of , then the reconstruction steps of each component matrix are as follows: Z i =Q i S i Where: i = 1, 2, ..., d, then the initial single-component trajectory matrix Z is as follows: Z=Z1+Z2+…+Z d Where: Z∈R m×d , define Z i Element z ij , 1≦i≦d, 1≦j≦m, and d * =min(m,d),m * =max(m,d), n=m+(d-1)τ, then: The diagonal average transformation matrix is obtained as follows: The matrix Z can be transformed into a d×n dimensional matrix Y by diagonal averaging, thereby decomposing the input variable signal x into d symplectic geometric mode components with different center frequencies: Y=Y1+Y2+…+Y d 。 6. The method for predicting dissolved oxygen concentration based on data decomposition and deep learning according to claim 1, characterized in that: In step S4, the feature vector extracted by the CNN network is flattened by the Flatten layer and then input into the TCN network to extract the temporal characteristics of the input features, calculate the forward propagation characteristics and the backward propagation characteristics, and further improve the prediction accuracy.
7. The method for predicting dissolved oxygen concentration based on data decomposition and deep learning according to claim 1, characterized in that: In step S4, the loss function used for training the CNN-TCN neural network is the mean square error MSE.
8. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements a dissolved oxygen concentration prediction method based on data decomposition and deep learning as described in any one of claims 1 to 7.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, a dissolved oxygen concentration prediction method based on data decomposition and deep learning as described in any one of claims 1 to 7 is implemented.