Sewage treatment process water quality soft measurement method, device and equipment based on integrated deep learning
By integrating the deep learning model to analyze the time series characteristics of sewage data, it solves the real-time and accuracy problems of water quality parameter measurement in traditional sewage treatment, achieves high-precision and intelligent water quality monitoring and prediction, and assists sewage treatment plants to improve control accuracy.
Patent Information
- Application Number
- CN202410673719.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-09-20
AI Technical Summary
It is difficult to achieve high precision, real-time and intelligence in the measurement of water quality parameters in the traditional sewage treatment process. Existing sewage measuring instruments have low real-time performance, complex operations and high consumption of consumables.
A soft measurement method of water quality in the sewage treatment process based on integrated deep learning is used to analyze the temporal characteristics of sewage data through STL decomposition, CEEMDAN decomposition and temporal stacking methods, build an integrated deep learning model, and use temporal convolutional networks and gated neural networks to analyze water quality parameters. predict.
It improves the measurement accuracy and prediction accuracy of water quality parameters in the sewage treatment process, realizes real-time and accurate monitoring of water quality parameters, and assists sewage treatment plants to achieve precise control.
Smart Images

Figure CN118673377A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of sewage detection, and in particular to a soft measurement method, device and equipment for water quality in a sewage treatment process based on integrated deep learning. Background Art
[0002] With the development of society and industry, sewage treatment has become an important environmental protection issue.
[0003] The sewage treatment process is affected by a variety of environmental factors, showing a variety of characteristics such as time series and nonlinearity. The traditional single model sewage soft measurement method is difficult to achieve accurate measurement. At the same time, the traditional monitoring instruments used in the sewage treatment process use chemical and electrochemical measurement technology, which is difficult to meet the requirements of high precision, real-time and intelligence at the same time. Therefore, there is an urgent need for a soft measurement method and equipment for water quality parameters in the sewage treatment process that can achieve real-time and accurate measurement.
[0004] The present invention proposes a soft measurement method, device and equipment for water quality in a sewage treatment process based on integrated deep learning. The present invention establishes an integrated deep learning model, uses STL decomposition to analyze the time series characteristics of water quality data in the sewage treatment process, uses a time series convolutional network to learn trends and seasonal characteristics, uses a fully adaptive noise set empirical mode decomposition residual component, uses the ability of a gated neural network to predict nonlinear data, and uses a time series stacking method to learn residual components. The method proposed by the present invention effectively analyzes the time series characteristics in sewage data, improves prediction accuracy, and solves the problems of low real-time performance, complex operation, and large consumption of consumables in existing sewage measuring instruments. Summary of the invention
[0005] The purpose of the present invention is to solve the problems of low real-time performance, complex operation, and large consumption of consumables in existing sewage measuring instruments, and propose a soft measurement method, device and equipment for water quality in sewage treatment process based on integrated deep learning. Among them, the integrated deep learning model proposed in the present invention is based on STL decomposition, CEEMDNAN decomposition method and time series stacking method to specifically analyze the trend, seasonality and other time series characteristics of sewage data, thereby improving the soft measurement accuracy.
[0006] To achieve the above object, the present invention is implemented through the following technical solutions:
[0007] In a first aspect, the present invention provides a soft measurement method for water quality parameters in sewage treatment based on integrated deep learning, the method comprising:
[0008] S10, obtaining historical sewage data collected by measuring instruments to form a historical database;
[0009] S20, sorting the data in the historical database in chronological order for data preprocessing, and dividing the data into a training set and a data set;
[0010] S30, build an integrated deep learning model;
[0011] S40, training an integrated deep learning model based on the pre-processed historical sewage data to verify the accuracy of the model;
[0012] S50, obtaining real-time sewage data collected by a measuring instrument, inputting the real-time sewage data into an integrated deep learning model, and obtaining soft measurement results of sewage quality indicators;
[0013] Furthermore, the sewage data includes flow rate, pH value, conductivity, chemical oxygen demand (COD), water temperature, salinity, residual chlorine, turbidity, redox potential, dissolved oxygen, total dissolved solids content; atmospheric temperature and atmospheric humidity of the environment where the measuring instrument is located;
[0014] Furthermore, the step S20 includes the following steps:
[0015] S201, deleting abnormal data in the historical sewage data using the 3σ criterion:
[0016] If the deviation v between the historical data x and the average value of the database data satisfies v>3σ, where σ is the standard deviation of the database data, then x is considered to be abnormal data and the abnormal data is deleted.
[0017] S202, normalizing the cleaned historical sewage data by using a Z-Score standardization method:
[0018] The formula is: where d Z is the normalized value, d is the original data, is the mean value of the database data, σ is the standard deviation of the database data;
[0019] S203, sorting the data in the database in chronological order;
[0020] S204, using 70% of the database data as a training set and using 30% of the database data as a test set;
[0021] Furthermore, the step S30 includes the following steps:
[0022] S301, STL decomposition algorithm decomposes the input data into trend component, seasonal component and residual component, distinguishing components with different characteristics in the input data;
[0023] The STL decomposition algorithm can decompose the input data into three components: trend, season, and residual. Analyzing the three components separately can achieve detailed analysis of sewage time series data;
[0024] Furthermore, the specific steps of the STL data decomposition are:
[0025] The preprocessed data is Y i , the trend component is T i , the seasonal component is S i , the residual component is R i , where i = (1, 2, ..., N), N represents the total number of input data;
[0026] Detrend the original sequence, that is, subtract the trend T of the sequence at the previous moment i k : Y i `=Y i -T i k , where Y i ` is the detrended sequence at this moment, T i k It is the trend of the previous moment;
[0027] Detrended series Y i Each periodic subsequence of `is smoothed using Loess, and each subsequence is locally weighted regressed. At the same time, each subsequence is extended forward and backward by one value to obtain a temporary seasonal sequence
[0028] right Do 3 moving averages and then use Loess smoothing to identify the remaining trend
[0029] Subtract the residual trend to get the seasonal component at this moment
[0030] From Y i Subtract seasonal components Get the deseasonalized series
[0031] Use Loess to smooth the deseasonalized series Y i ``, get the trend component T i k+1 ;
[0032] Original sequence Y i Subtract the trend component and seasonal component obtained in the above steps to get the residual component: R i =Y i -T i -S i;
[0033] S302, establish a TCN neural network, send the trend component and seasonal component data into the TCN, and obtain the trend component and seasonal component prediction results;
[0034] Furthermore, the specific structure of TCN includes:
[0035] Use one-dimensional causal convolution and dilated convolution as standard convolution layers, encapsulate every two standard convolution layers into a residual module, stack the deep network with residual modules, and use full convolution layers instead of full connection layers; the last layer is the output layer, which performs linear regression on the output of the last dimension of the hidden layer and outputs the prediction result;
[0036] S303, using CEEMDAN to decompose the residual component, establishing a GRU neural network, sending the residual component data to the GRU, and using a time series stacking method to obtain a residual component prediction result;
[0037] Furthermore, the CEEMDAN algorithm is usually used for noise processing and time series problems. The CEEMDAN algorithm is selected to process the residual component. The specific decomposition process of CEEMDAN is as follows:
[0038] First, define the residual component original signal Q(t), where t = (1, 2, ..., N`), N` represents the total number of Q(t); add M groups of paired positive and negative Gaussian white noise, M is the number of white noise groups, and according to experience, M is 250;
[0039] Perform the first EMD decomposition on the original signal, where IMF j1 (t) is the jth modal component of the first decomposition, where j = (1, 2, ..., M); calculate the average value of the modal components to obtain the first modal component
[0040]
[0041] Calculate the residual R1(t) obtained from the first decomposition: R1(t) = Q(t) - IMF1(t);
[0042] Assume E k (·) is the k-th EMD decomposition; add M groups of paired positive and negative Gaussian white noises from the previous step to R1(t), and decompose the signal to obtain the modal components:
[0043]
[0044] In the formula, ε2 represents the standard deviation of the noise added in the second decomposition, is the jth Gaussian white noise satisfying the standard normal distribution in the second decomposition;
[0045] The data is then continuously decomposed to obtain the value of the k+1 modal component:
[0046]
[0047] In the formula, ε k+1 represents the standard deviation of the noise added to the k+1th decomposition, R k (t) represents the k-th decomposition residual, is the jth Gaussian white noise that satisfies the standard normal distribution in the k+1th decomposition;
[0048] If the stopping condition is met, that is, the residual R of the k+1th decomposition k+1 If it is a monotonic signal, the iteration stops and the CEEMDAN algorithm decomposition ends;
[0049] At this point, the original signal is the sum of k modal components and the residual, completing the decomposition: IMF k is the IMF obtained from the k-th decomposition, and R(t) is the final residual obtained;
[0050] Furthermore, the specific structure of GRU includes two gate functions, update gate and reset gate:
[0051] Update Gate t Determines the discarding and updating of the state information at the previous moment: r i =sigmoid(W r x i +U r h t-1 +b r );
[0052] Among them, W r is the update gate weight matrix. U r is the previous state h t-1 The update gate weight matrix of b. r is the update gate bias term.
[0053] Reset Gate Z t Controls how much information is written to the previous state: Z t =sigmoid(W Z x i +U Z h t-1 +b Z );
[0054] Among them, W Z is the reset gate weight matrix. U Z is the previous state h t-1 The reset gate weight matrix of b. Z is the reset gate bias term;
[0055] Furthermore, group time series segmentation assigns a group label to each sample and divides the dataset in the order of the group labels. In each step, it assigns the current group label to the test set and the previous group label to the training set to avoid data leakage in time.
[0056] Use support vector machine as meta-learner, start from the first group, use the first group as training set, and the second group as test set to implement the training of meta-learner.
[0057] In the second aspect, based on the same concept, the present invention also provides a soft measurement device for water quality in a sewage treatment process based on integrated deep learning, comprising:
[0058] The data acquisition module collects sewage water quality index monitoring data and environmental data; uses a water pump to extract water samples and measures water quality parameters through sensors;
[0059] The data preprocessing module deletes and normalizes the collected data and saves them in the historical database;
[0060] Model building module, which uses pre-treated sewage water quality indicator monitoring data and environmental data to train an integrated deep learning model;
[0061] The prediction module uses an integrated deep learning model to achieve soft measurement of water quality parameters in the sewage treatment process based on pre-treated sewage quality indicator monitoring data and environmental data;
[0062] In the third aspect, based on the same concept, the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the soft measurement method for water quality parameters of the sewage treatment process as described in the first aspect is implemented.
[0063] In the fourth aspect, based on the same concept, the present invention also provides a computer-readable storage medium storing a computer program; wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the soft measurement method for water quality parameters of the sewage treatment process as described in the first aspect.
[0064] Compared with the prior art, the sewage treatment water quality soft measurement method, device and equipment based on integrated deep learning described in the present invention have the following beneficial effects:
[0065] The soft measurement method, device and equipment for water quality in the sewage treatment process based on integrated deep learning described in the present invention can collect sewage data of the sewage treatment process in real time, use the integrated deep learning model to accurately predict the results of the sewage data, realize soft measurement of water quality parameters in the sewage treatment process, and assist sewage treatment plants to achieve precise control of the sewage treatment process. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0067] Figure 1 A schematic diagram of the process flow of the soft measurement method for water quality in a sewage treatment process based on integrated deep learning provided by the present invention;
[0068] Figure 2 A schematic diagram of the structure of the integrated deep learning neural network model provided by the present invention;
[0069] Figure 3 A training flow chart of the integrated deep learning neural network model provided by the present invention;
[0070] Figure 4 A schematic diagram of the structure of a soft measurement device for water quality parameters in a sewage treatment process provided by the present invention; DETAILED DESCRIPTION
[0071] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.
[0072] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present invention should have the common meanings understood by persons having ordinary skills in the field to which the present invention belongs.
[0073] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0074] Embodiment 1:
[0075] Embodiment 1 of the present invention provides a soft measurement method for water quality in a sewage treatment process based on integrated deep learning, referring to Figure 1 ; Figure 1 A schematic flow chart of a soft measurement method for water quality in a sewage treatment process based on integrated deep learning provided in Example 1.
[0076] In the first embodiment, the soft measurement method of water quality in the sewage treatment process based on integrated deep learning comprises the following steps:
[0077] S10, obtaining historical sewage data collected by measuring instruments to form a historical database;
[0078] Specifically, in this embodiment, the sensors in the measuring instrument collect various parameters of the sewage, including: flow rate, pH value, conductivity, resistivity, water temperature, salinity, residual chlorine, turbidity, redox potential, dissolved oxygen, total dissolved solids content; atmospheric temperature and atmospheric humidity of the environment in which the measuring instrument is located;
[0079] The collected sewage water quality parameters are stored to form a historical database;
[0080] S20, performing data preprocessing on the acquired historical sewage data;
[0081] The step S20 comprises the following steps:
[0082] S201, deleting abnormal data in the historical sewage data using the 3σ criterion:
[0083] If the deviation v between the historical data x and the average value of the database data satisfies v>3σ, where σ is the standard deviation of the database data, then x is considered to be abnormal data and the abnormal data is deleted.
[0084] S202, normalizing the cleaned historical sewage data by using a Z-Score standardization method:
[0085] The formula is: where x Z is the normalized value, x is the original data, is the mean value of the database data, σ is the standard deviation of the database data;
[0086] S203, sorting the data in the database in chronological order;
[0087] S204, using 70% of the database data as a training set and using 30% of the database data as a test set;
[0088] S30, build an integrated deep learning model;
[0089] It can be understood that the training of the integrated deep learning model is a process of deep learning and algorithm iteration. In this embodiment, the TCN neural network model and the GRU neural network model are trained, and the parameters of the model are continuously adjusted. Finally, after multiple iterations, the optimal neural network model is obtained, that is, the trained soft measurement model of water quality parameters in the sewage treatment process.
[0090] Figure 2 A training structure diagram of an integrated deep learning model provided in an embodiment of the present invention;
[0091] like Figure 2 As shown in the figure, building an integrated deep learning model includes the following steps:
[0092] S301, STL data decomposition decomposes the input data into trend component, period component and residual component, and distinguishes components with different characteristics in the input data;
[0093] Furthermore, the specific steps of the STL data decomposition are:
[0094] The preprocessed data is Y i , the trend component is T i , the seasonal component is S i , the residual component is R i , where i = (1, 2, ..., N), N represents the total number of input data;
[0095] Detrend the original sequence, that is, subtract the trend T of the sequence at the previous moment i k : Y i `=Y i -T i k , where Y i ` is the detrended sequence at this moment, T i k It is the trend of the previous moment;
[0096] Detrended series Y i Each periodic subsequence of `is smoothed using Loess, and each subsequence is locally weighted regressed. At the same time, each subsequence is extended forward and backward by one value to obtain a temporary seasonal sequence k+1
[0097] S i ;
[0098] right Do 3 moving averages and then use Loess smoothing to identify the remaining trend
[0099] Subtract the residual trend to get the seasonal component at this moment
[0100] From Y i Subtract seasonal components Get the deseasonalized series
[0101] Use Loess to smooth the deseasonalized series Y i ``, get the trend component
[0102] Original sequence Y i Subtract the trend component and seasonal component obtained in the above steps to get the residual component: R i =Y i -Ti -S i ;
[0103] S302, establish a TCN neural network, send the trend component and seasonal component data into the TCN, and obtain the trend component and seasonal component prediction results;
[0104] Furthermore, the specific structure of TCN includes:
[0105] Use one-dimensional causal convolution and dilated convolution as standard convolution layers, encapsulate every two standard convolution layers into a residual module, stack the deep network with residual modules, and use full convolution layers instead of full connection layers; the last layer is the output layer, which performs linear regression on the output of the last dimension of the hidden layer and outputs the prediction result;
[0106] Preferably, the convolution layer in the TCN in this embodiment adopts one-dimensional convolution, the number of channels is 25; the convolution kernel size is set to 3, the convolution kernel expansion settings are [1, 2, 4, 8] in sequence, the number of layers is 4, the training batch size is set to 30, and the training rounds are 50;
[0107] S303, using CEEMDAN to decompose the residual component, establishing a GRU neural network, sending the residual component data to the GRU, and using a time series stacking method to obtain a residual component prediction result;
[0108] Furthermore, the CEEMDAN algorithm is usually used for noise processing and time series problems. The present invention selects the CEEMDAN algorithm to process the residual component. The specific decomposition process of CEEMDAN is as follows:
[0109] First, define the residual component original signal Q(t), where t = (1, 2, ..., N`), N` represents the total number of Q(t); add M groups of paired positive and negative Gaussian white noise, M is the number of white noise groups, and according to experience, M is 250;
[0110] Perform the first EMD decomposition on the original signal, where IMF j1 (t) is the jth modal component of the first decomposition, where j = (1, 2, ..., M); calculate the average value of the modal component to obtain the first modal component
[0111]
[0112] Calculate the residual R1(t) obtained from the first decomposition: R1(t) = Q(t) - IMF1(t);
[0113] Assume E k (·) is the k-th EMD decomposition. M groups of paired positive and negative Gaussian white noises in the previous step are added to R1(t) to decompose the signal to obtain the modal components:
[0114]
[0115] In the formula, ε1 represents the standard deviation of the noise added in the second decomposition, is the jth Gaussian white noise satisfying the standard normal distribution in the second decomposition;
[0116] The data is then continuously decomposed to obtain the value of the k+1 modal component:
[0117]
[0118] In the formula, ε k+1 represents the standard deviation of the noise added to the k+1th decomposition, R k (t) represents the k-th decomposition residual, is the jth Gaussian white noise that satisfies the standard normal distribution in the k+1th decomposition;
[0119] If the stopping condition is met, that is, the residual R of the k+1th decomposition k+1 If it is a monotonic signal, the iteration stops and the CEEMDAN algorithm decomposition ends;
[0120] At this point, the original signal is the sum of k modal components and the residual, completing the decomposition: IMF k is the IMF obtained from the k-th decomposition, and R(t) is the final residual obtained;
[0121] Furthermore, a GRU model is established for each IMF, and the IMF and auxiliary variables are fed into the GRU;
[0122] Furthermore, the specific structure of GRU includes two gate functions, update gate and reset gate:
[0123] Update Gate t Determines the discarding and updating of the state information at the previous moment: r i =sigmoid(W r x i +U r h t-1 +b r );
[0124] Among them, W r is the weight matrix. r is the previous state h t-1 The weight matrix of b. r is the bias term.
[0125] Reset Gate Z t Controls how much information is written to the previous state: Z t =sigmoid(W Z xi +U Z h t-1 +b Z );
[0126] Among them, W Z is the weight matrix. Z is the previous state h t-1 The weight matrix of b. Z is the bias term;
[0127] Preferably, the GRU in this embodiment has 50 hidden units and one fully connected layer, and the ReLu function is selected as the activation function;
[0128] The ReLu function is: f(x) = max(0,X);
[0129] Furthermore, the prediction results of each GRU are combined using the time series stacking algorithm to obtain the residual component prediction results;
[0130] The stacking algorithm can effectively fuse the results of multiple base learners. The ordinary stacking algorithm uses the K-fold method for stacking, which has problems such as information leakage for time series prediction. The present invention optimizes the stacking algorithm based on the group time series segmentation method to achieve the time series stacking of GRU prediction results.
[0131] Group time series segmentation assigns a group label to each sample and divides the dataset sequentially according to the order of the group labels. In each step, it assigns the current group label to the test set and the previous group label to the training set to avoid data leakage in time.
[0132] The number of folds n_splits for the group time series splitting method specifies the number of groups to create;
[0133] Preferably, n_splits=5, splitting all GRU prediction results into 5 groups;
[0134] Use support vector machine as meta-learner, start from the first group, use the first group as training set, and the second group as test set to implement the training of meta-learner.
[0135] S40, training an integrated deep learning model based on the pre-processed historical sewage data to verify the accuracy of the model;
[0136] Figure 3 A training flow chart of an integrated deep learning model provided by an embodiment of the present invention;
[0137] like Figure 3 As shown, the integrated deep learning model training process provided in the embodiment includes the following steps:
[0138] S401. Use the STL decomposition algorithm on the input variables:
[0139] The target parameters for soft measurement in this embodiment are biological oxygen demand (BOD), total phosphorus and total nitrogen;
[0140] The Pearson correlation coefficient represents the covariance of two variables divided by the product of their standard deviations, which can achieve translation invariance. It measures the linear correlation between two variables and gives a value between -1 and 1. The specific formula for calculating the Pearson correlation coefficient ρ(x,y) of each target variable x and measurement parameter y is as follows:
[0141] where x l is the lth data of the target variable, y l is the lth data of the measurement parameter, where l = (1, 2, ..., N``), N`` is the total number of measurement parameters, is the mean value of the target variable, is the mean value of the measured parameter;
[0142] The input variables for predicting the target variable were selected by comparing the Pearson correlation coefficient of each measured parameter, and five input variables were calculated: pH, conductivity, water temperature, COD, and redox potential;
[0143] The STL decomposition algorithm is used for each input variable to decompose it into trend component, seasonal component and residual component;
[0144] S402, importing the training set into the model for training;
[0145] Step 1, train the TCN model using trend component and seasonal component;
[0146] Step 2: Use CEEMDAN to decompose the residual components, use the decomposed IMFs to train the GRU neural network, and use the time series stacking algorithm to integrate the training results of the GRU neural network:
[0147] Repeat steps 1-2 until all batches of the training dataset have participated in model training and the specified number of iterations has been reached.
[0148] S403, importing the test set data into the trained model to verify the model training effect;
[0149] At the end of each round of cyclic training, the test set is imported into the integrated deep learning model to evaluate the model training effect, and the model prediction result is output;
[0150] T i and S iAnd five input variables are input into TCN to obtain the prediction result T i and S i ;
[0151] R i And five input variables are input into the GRU neural network to obtain the prediction result R i ;
[0152] Add the output of the TCN-GRU model to get the final prediction result: Y i =T i +S i +R i ;
[0153] Among them, T i , S i and R i are the predicted trend component, predicted seasonal component and predicted residual component of the i-th input data respectively. i The final prediction result;
[0154] Compare the verified prediction result output by the integrated deep learning model with the preset target prediction result;
[0155] When the prediction error does not decrease for 5 consecutive times, the training is stopped and the optimal integrated deep learning model is obtained; otherwise, iterative training is performed again to update the network weights and bias of the integrated deep learning model until the prediction error does not decrease for 5 consecutive times, and the optimal integrated deep learning model is obtained;
[0156] S50. Acquire real-time sewage data collected by a measuring instrument, input the current sewage data into a pre-trained integrated deep learning model, and obtain soft measurement results of sewage water quality data.
[0157] The real-time sewage data collected by the measuring instrument is obtained, and data deletion and normalization are performed; the processed data samples are input into the trained water quality index prediction model, and the water quality indexes of BOD, total phosphorus and total nitrogen in the sewage treatment process are predicted to obtain the final sewage water quality soft measurement results.
[0158] Embodiment 2
[0159] Embodiment 2 provides a soft measurement device for water quality in a sewage treatment process based on integrated deep learning, comprising:
[0160] The data acquisition module collects sewage water quality index monitoring data and environmental data; uses a water pump to extract water samples and measures water quality parameters through sensors;
[0161] The data preprocessing module deletes and normalizes the collected data and saves them in the historical database;
[0162] Model building module, which uses pre-treated sewage water quality indicator monitoring data and environmental data to train an integrated deep learning model;
[0163] The prediction module uses an integrated deep learning model to achieve soft measurement of water quality parameters in the sewage treatment process based on pre-treated sewage quality indicator monitoring data and environmental data;
[0164] It should be noted that when the soft measurement device for water quality in the sewage treatment process based on integrated deep learning provided in the above embodiment predicts the water quality indicators of the sewage treatment process, the division of the above-mentioned functional modules should be used as an example to illustrate that the above-mentioned functions can be allocated to different functional modules as needed, that is, the internal structure of the terminal is divided into different functional modules to complete all or part of the functions described above.
[0165] Embodiment three:
[0166] Reference Figure 4 , Figure 4 This is a schematic diagram of the structure of a soft measurement device for water quality in a sewage treatment process based on integrated deep learning in the hardware operating environment involved in the third embodiment of the present invention.
[0167] like Figure 4 As shown, the soft measurement device for water quality in the sewage treatment process based on integrated deep learning may include: a measuring instrument 3001, a processor 3002, such as a central processing unit (CPU), a communication bus 3003, a user interface 3004, and a memory 3005. Among them, the communication bus 3002 is used to realize the connection and communication between these components. The user interface 3003 may include a display screen (Display), an input unit such as a keyboard (Keyboard). The memory 3005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable read-only memory (ReadOnly Memory, ROM), such as a disk storage.
[0168] Those skilled in the art will understand that Figure 4 The structure shown in does not constitute a limitation on the soft measurement device for water quality in the sewage treatment process based on integrated deep learning, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0169] Optional, such as Figure 4 As shown, the measuring instrument 3001 may include a water pump, a sensor, and a bus interface program.
[0170] Optional, such as Figure 4As shown, the memory 3005 as a storage medium may include an operating system, a user interface program, and a soft measurement program for water quality parameters in a sewage treatment process.
[0171] exist Figure 4 In the soft measurement device for water quality in sewage treatment process based on integrated deep learning shown, the user interface 3004 is mainly used for data interaction with the user. The measuring instrument 3001, the processor 3002 and the memory 3005 can be set in the soft measurement device for water quality parameters in sewage treatment process. The soft measurement device for water quality in sewage treatment process based on integrated deep learning controls the operation of the measuring instrument 3001 through the processor 3002, and calls the soft measurement program for water quality in sewage treatment process based on integrated deep learning stored in the memory 3005, and executes the soft measurement method for water quality in sewage treatment process based on integrated deep learning provided in Example 3.
[0172] Embodiment 4:
[0173] A computer-readable storage medium; wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the soft measurement method for water quality parameters in a sewage treatment process as described in the first aspect.
[0174] The soft measurement method, device and equipment for water quality in a sewage treatment process based on integrated deep learning provided by the present invention collect real-time water quality parameters in the sewage treatment process and environmental factors affecting water quality indicators, and combine the STL decomposition algorithm, the time series convolution model and the gated neural network to predict the water quality indicators in the sewage treatment process, and compare the theoretical sewage parameters with the actual sewage parameters. If the error is too large, it is considered that the sewage treatment process needs to be adjusted. Experimental data proves that the soft measurement method for water quality parameters in a sewage treatment process based on integrated deep learning proposed by the present invention has good prediction effect and can help improve the control accuracy of the sewage treatment plant over the sewage treatment process.
[0175] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0176] The specific implementation methods described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A soft measurement method for water quality in sewage treatment process based on integrated deep learning, characterized in that: include: S10, acquiring historical sewage data collected by the measuring instrument to form a historical database; the sewage water quality index data includes flow rate, pH value, conductivity, resistivity, water temperature, salinity, residual chlorine, turbidity, redox potential, dissolved oxygen, total dissolved solids content; the atmospheric temperature and atmospheric humidity of the environment where the measuring instrument is located; S20, sorting the data in the historical database in chronological order for data preprocessing, and dividing the data into a training set and a data set; S30, build an integrated deep learning model; S40, training an integrated deep learning model based on the pre-processed historical sewage data to verify the accuracy of the model; S50, obtaining real-time sewage data collected by a measuring instrument, inputting the real-time sewage data into an integrated deep learning model, and obtaining soft measurement results of sewage quality indicators; The step S20 comprises the following steps: S201, deleting abnormal data in the historical sewage data by using the 3σ criterion: If the deviation v between the historical data x and the average value of the database data satisfies v>3σ, where σ is the standard deviation of the database data, then x is considered to be abnormal data and the abnormal data is deleted; S202, normalizing the cleaned historical sewage data by using a Z-Score standardization method: The formula is: where d Z is the normalized value, d is the original data, is the mean value of the database data, σ is the standard deviation of the database data; S203, sorting the data in the database in chronological order; S204, using 70% of the database data as a training set and using 30% of the database data as a test set; The step S30 comprises the following steps: Furthermore, the specific steps of the STL data decomposition are: The STL decomposition algorithm decomposes the input parameters into trend components, seasonal components, and residual components. Let N be the total number of input parameters and the preprocessed data be Y i , the trend component is T i , the seasonal component is S i , the residual component is R i , where i = (1, 2, ..., N), N represents the total number of input data; Detrend the original sequence, that is, subtract the trend T of the sequence at the previous moment i k : Y i `=Y i -T i k , where Y i ` is the detrended sequence at this moment, T i k It is the trend of the previous moment; Detrended series Y i Each periodic subsequence of `is smoothed using Loess, and each subsequence is locally weighted regressed. At the same time, each subsequence is extended forward and backward by one value to obtain a temporary seasonal sequence right Do 3 moving averages and then use Loess smoothing to identify the remaining trend Subtract the residual trend to get the seasonal component at this moment From Y i Subtract seasonal components Get the deseasonalized series Use Loess smoothing to deseasonalize the series Y i ``, get the trend component T i k+1 ; Original sequence Y i Subtract the trend component and seasonal component obtained in the above steps to get the residual component: R i =Y i -T i -S i ; S302, establish a TCN neural network, send the trend item and period item data into the TCN, and obtain the trend item and period item prediction results; The specific structure of TCN includes: Use one-dimensional causal convolution and dilated convolution as standard convolution layers, encapsulate every two standard convolution layers into a residual module, stack the deep network with residual modules, and use full convolution layers instead of full connection layers; the last layer is the output layer, which performs linear regression on the output of the last dimension of the hidden layer and outputs the prediction result; S303, using CEEMDAN to decompose the residual component, establishing a GRU neural network, sending the residual component data to the GRU, and using a time series stacking method to obtain a residual component prediction result; The specific decomposition process of the CEEMDAN algorithm is as follows: First, define the residual component original signal Q(t), where t = (1, 2, ..., N`), N` represents the total number of Q(t); add M groups of paired positive and negative Gaussian white noise, M is the number of white noise groups, and according to experience, M is 250; Perform the first EMD decomposition on the original signal, where IMF j1 (t) is the jth modal component of the first decomposition, where j = (1, 2, ..., M); calculate the average value of the modal component to obtain the first modal component Calculate the residual R1(t) obtained from the first decomposition: R1(t) = Q(t) - IMF1(t); Assume E k (·) is the k-th EMD decomposition. M groups of paired positive and negative Gaussian white noises in the previous step are added to R1(t) to decompose the signal to obtain the modal components: In the formula, ε1 represents the standard deviation of the noise added in the second decomposition, is the jth Gaussian white noise satisfying the standard normal distribution in the second decomposition; The data is then continuously decomposed to obtain the value of the k+1 modal component: In the formula, ε k+1 represents the standard deviation of the noise added to the k+1th decomposition, R k (t) represents the k-th decomposition residual, is the jth Gaussian white noise that satisfies the standard normal distribution in the k+1th decomposition; If the stopping condition is met, that is, the residual R of the k+1th decomposition k+1 If it is a monotonic signal, the iteration stops and the CEEMDAN algorithm decomposition ends; At this point, the original signal is the sum of k modal components and the residual, completing the decomposition: IMF k is the IMF obtained from the k-th decomposition, and R(t) is the final residual obtained; The specific structure of GRU includes two gate functions, update gate and reset gate: Update Gate t Determines the discarding and updating of the state information at the previous moment: r i =sigmoid(W r x i +U r h t-1 +b r ); Among them, W r is the update gate weight matrix; U r is the previous state h t-1 The update gate weight matrix of b r is the update gate bias term; Reset Gate Z t Controls how much information is written to the previous state: Z t =sigmoid(W Z x i +U Z h t-1 +b Z ); Among them, W Z is the reset gate weight matrix; U Z is the previous state h t-1 The reset gate weight matrix of b Z is the reset gate bias term; Use the time series stacking algorithm to combine the prediction results of each GRU to obtain the residual component prediction results; Optimize the stacking algorithm based on the group time series segmentation method to achieve the time series stacking of GRU prediction results; Group time series segmentation assigns a group label to each sample and divides the dataset in the order of the group labels. In each step, it assigns the current group label to the test set and the previous group label to the training set to avoid data leakage in time. The number of folds n_splits for the group time series splitting method specifies the number of groups to create; n_splits=5, that is, all GRU prediction results are split into 5 groups; Use support vector machine as meta-learner, start from the first group, use the first group as training set, and the second group as test set to implement the training of meta-learner.
2. According to claim 1, a soft measurement method for water quality in a sewage treatment process based on integrated deep learning is characterized in that: The step S40 comprises the following steps: S401. Use the STL decomposition algorithm on the input variables: The Pearson correlation coefficient represents the covariance of two variables divided by the product of their standard deviations, which can achieve translation invariance. It measures the linear correlation between two variables and gives a value between -1 and 1. The specific formula for calculating the Pearson correlation coefficient ρ(x,y) of each target variable x and measurement parameter y is as follows: where x l is the lth data of the target variable, y l is the lth data of the measurement parameter, where l = (1, 2, ..., N``), N`` is the number of measurement parameters, is the mean value of the target variable, is the mean value of the measured parameter; The input variables for predicting the target variable were selected by comparing the Pearson correlation coefficient of each measured parameter, and five input variables were calculated: pH, conductivity, water temperature, COD, and redox potential; The STL decomposition algorithm is used for each input variable to decompose it into trend component, seasonal component and residual component; S402, importing the training set into the model for training; Step 1, train the TCN model using trend component and seasonal component; Step 2: Use the residual component to train the GRU neural network: Repeat steps 1-2 until all batches of the training dataset have participated in model training and the specified number of iterations has been reached; S403, importing the test set data into the trained model to verify the model training effect; At the end of each round of cyclic training, the test set is imported into the integrated deep learning model to evaluate the model training effect, and the model prediction result is output; T i and S i And five input variables are input into TCN to obtain the prediction result T i and S i ; R i And five input variables are input into the GRU neural network to obtain the prediction result R i ; Add the output of the TCN-GRU model to get the final prediction result: Y i =T i +S i +R i ; Among them, T i , S i and R i are the predicted trend component, predicted seasonal component and predicted residual component of the i-th input parameter respectively; Y i The final prediction result; Compare the verified prediction result output by the integrated deep learning model with the preset target prediction result to determine whether a preset prediction threshold is met; When the prediction error does not decrease for five consecutive times, the training is stopped and the optimal integrated deep learning model is obtained; otherwise, iterative training is performed again to update the network weights and biases of the integrated deep learning model until the prediction error does not decrease for five consecutive times and the optimal integrated deep learning model is obtained.
3. A soft measurement device for water quality in sewage treatment process based on integrated deep learning, characterized in that: include: Data collection module, collecting sewage quality index monitoring data and environmental data; Use a water pump to extract water samples and use sensors to measure water quality parameters; The data preprocessing module deletes and normalizes the collected data and saves them in the historical database; Model building module, which uses pre-treated sewage water quality indicator monitoring data and environmental data to train an integrated deep learning model; The prediction module uses an integrated deep learning model to achieve soft measurement of water quality parameters in the sewage treatment process based on pre-treated sewage quality indicator monitoring data and environmental data; The device implements the method according to claim 1 or 2.
4. A computer device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor; when the computer program is executed by the processor, the method according to claim 1 or 2 is implemented.
5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to claim 1 or 2 can be implemented.
Citation Information
Patent Citations
Industrial sewage treatment soft measurement method based on feature structure optimization and deep learning
CN115758125A
CVT error prediction method based on weight coefficient distribution TCN-BiGRU model
CN117452310A
Mine water regimen prediction method and system based on neural network and component decomposition method
CN117875472A
Remote monitoring method, system and storage medium for sewage treatment process
US20230112496A1
Cited By
Modularized intelligent sewage treatment adjusting device and method
CN119240899A
