Industrial wastewater discharge water quality prediction method based on tensor feature reconstruction
By using a tensor feature-based reconstruction method, combining block Hankel matrix and low-rank Tucker tensor decomposition with tensor ARIMA model, the problem of existing water quality prediction methods failing to fully utilize parameter relationships and adapt to environmental changes is solved, thus improving the accuracy and efficiency of water quality prediction.
Patent Information
- Application Number
- CN202210805469.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-02-21
- Filing Date
- 2022-07-08
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2042-07-08
AI Technical Summary
Existing water quality prediction methods, such as LSTM and SVR models, fail to fully utilize the intrinsic relationships between water quality parameters. The ARIMA model has low prediction accuracy when facing complex and nonlinear environments and is difficult to adapt to real-time changes in the water quality environment.
A method based on tensor feature reconstruction is adopted. By combining block Hankel matrix and low-rank Tucker tensor decomposition with tensor ARIMA model, water quality index data is optimized. Iterative calculation is performed using alternating direction multiplier method to predict the water quality status at the next time point.
It improves the accuracy of water quality prediction, reduces relative error, enhances prediction accuracy, and better captures the intrinsic correlation between multiple indicators, adapting to the complex environmental changes in industrial wastewater discharge.
Smart Images

Figure CN115130770B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of industrial wastewater monitoring parameter prediction, and particularly relates to an industrial wastewater discharge water quality prediction method based on tensor feature reconstruction. BACKGROUND
[0002] With the continuous development of industrial process, industrial wastewater needs to be treated before being discharged into the river. Due to the failure of wastewater treatment equipment or the behavior of enterprises secretly discharging wastewater, the industrial wastewater is discharged without reaching the standard, which directly destroys the water ecological environment and seriously pollutes the river and affects the water source for residents. Therefore, industrial wastewater discharge monitoring and prediction, as an important part of the water resource protection system, is conducive to pollution control.
[0003] The national environmental protection department requires that the factories discharging polluted wastewater should be treated by a wastewater treatment system to improve the water quality and discharge after improving the water quality. These systems use sensors to monitor the concentration of water quality parameters and provide a large amount of multivariate time series data of water quality parameter indexes. Due to the complex composition of wastewater and the complex mechanism of the treatment system, as well as the nonlinearity, dynamics and periodicity of environmental data, it is difficult to accurately monitor the equipment or sensors. Water quality prediction is to use the historical monitoring water quality data to predict the water quality in the future period of time through mathematical models and computer technology. Predicting the characteristics of wastewater treatment in advance can effectively guide the operation of the wastewater treatment equipment, and mark potential abnormal events when deviating from the model prediction, so as to give an early warning of water pollution.
[0004] At present, the methods for water quality prediction mainly include neural network model and support vector regression (SVR) model prediction. The LSTM model has good accuracy in water quality concentration prediction, but it has certain limitations, such as not fully utilizing the internal relationship between the prediction parameters and the influence of water quality indexes at different periods on the prediction results. The SVR prediction model has the problem of parameter selection and is difficult to adapt to the real-time changes and complexity of the water quality environment. In recent years, ARIMA (Autoregressive Integrated Moving Average model) is used for analyzing and predicting time series data, which is a relatively perfect and accurate prediction algorithm. This algorithm mainly uses the relationship between the current value and the historical value, and uses the historical time data of the variable itself to predict itself. The condition that must be met by the time series analyzed and predicted by the ARMA model is a stationary non-white noise sequence. ARMA uses its own data for prediction. Since the time series used lacks the extraction and use of historical data features, the prediction accuracy is not ideal. SUMMARY
[0005] To solve the above problems, the application provides an industrial wastewater discharge water quality prediction method based on tensor feature reconstruction, which reduces the relative error in water quality prediction and improves the prediction accuracy.
[0006] The application achieves the above-mentioned purpose by adopting the following technical scheme: the industrial wastewater discharge water quality prediction method based on tensor feature reconstruction comprises the following steps:
[0007] Step 1: Collect water quality index data of a factory wastewater discharge port.
[0008] Step 2: Standardize the collected water quality index data to obtain standardized water quality index data G t , G t ∈R N×V , and multiply the water quality index data G t along the time direction by a matrix to obtain a time series tensor N, V and M are respectively a historical data amount, an index number of collected vector data and a time dimension segmentation matrix number.
[0009] Step 3: Perform difference calculation on the tensor to obtain a difference tensor set Δ is a difference operator.
[0010] Step 4: Perform low-rank Tucker tensor decomposition on the difference tensor set , construct a Tucker tensor decomposition objective function through tensor ARIMA and low-rank regularization constraint.
[0011] Step 5: Optimize the objective function by using an alternating direction multiplier method, decompose into , wherein represents a decomposed core tensor, are three orthogonal factor matrices, and convergence is determined, iterative calculation is performed, and and U (1) , U (2) , U (3) are obtained, and the error Δ d ε t of each iteration is calculated.
[0012] Step 6: According to the core tensor and the iterative error Δ d ε t , the core tensor of the next time point is predicted through a tensor ARIMA model.
[0013] Step 7: Multiply the core tensor by the orthogonal factors U (1) , U (2) to obtain the water quality index data of the next time point.U (3) Multiplication, get the next time point tensor Inverse Tucker decomposition operation and inverse difference operation are performed on the tensor , and the tensor
[0014] Step 8, the tensor is unfolded in the time dimension to form a matrix, and then multiplied by the block Hankel inverse matrix to obtain the prediction data result G of the next time point t+1 .
[0015] Further, in order to strengthen the stationarity of the data, in step 2, the specific method for obtaining the water quality index data G t after standardization processing includes:
[0016] According to the emission value T x of the national comprehensive wastewater discharge standard as the reference, the formula is used to calculate G t , wherein g' i is the collected original value at the t i time, g is the data value from t1 to t n time, and n is an integer greater than 1.
[0017] The specific method for obtaining the time series tensor includes multiplying G t with the block Hankel matrix, and dividing the calculation result into multiple matrices with a size of N x V, and overlapping to form the time series tensor
[0018] Further, in step 4, the specific method for constructing the Tucker tensor decomposition objective function by the tensor ARIMA and the low-rank regularization constraint includes:
[0019] Step 401, set the values of R1, R2 and R3, and randomly generate a group of matrix groups The joint orthogonal factor matrix is used to project into the core tensor , and the calculation formula is:
[0020] Wherein I is a unit matrix whose main diagonal elements are all 1 and other elements are 0.
[0021] Step 402, extend the linear ARIMA to a multi-dimensional model, convert it to a tensor form, use its connection with the current core tensor and the calculated core tensor , and calculate the sequence error and the sequence error Δ dε t2 ..., Δ d ε t-n ; the tensor ARIMA model with parameters (m, d, n) is described as
[0022]
[0023] Step 403, according to the model of step 401 and step 402, the target function is combined with the low rank of the core tensor:
[0024]
[0025] Further, in step 5, the specific method of optimizing the target function by using the alternating direction multiplier method includes:
[0026] Step 501, transform each tensor variable along the time dimension-mode expansion into a matrix, and re-optimize as
[0027]
[0028] And use the augmented Lagrange method to solve the value of each variable;
[0029] Step 502, initialize the parameters of the alternating direction multiplier method, set the loop parameter k=0, t=m+d+n+1, j=1, 2, 3, the iteration termination threshold error value tol, the parameter μ, and set the maximum parameter value as μ max ;
[0030] Step 503, execute the loop, update the variable, and obtain the target function.
[0031] Further, the specific method of updating the variable and obtaining the target function includes:
[0032] Step 503-1, update the variable Fixing other variables, the target function is:
[0033] Take the partial derivative of and equal to zero, then is calculated as
[0034] Step 503-2, update the variable Fixing other variables, the target function is: Using matrix singular value decomposition, get U, V and diag(σ),
[0035] Step 503-3, update the variable U' (j) , fixing other variables, the target function is:
[0036] transformed into global optimal solution, for singular value decomposition into respectively, the left and right singular vectors after decomposition, and the calculation of
[0037] Step 503-4, update variable fixing other variables, the objective function is:
[0038] the partial derivative of the objective function is zero, and the calculation of
[0039] Step 503-5, update variable and ρ i and β′ i are the parameters of AR and MA models, respectively, using Yule-Walker equation, the first 1 to m sample data constructing sample autocovariance from the sample Yule-Walker equation of autocovariance function regression calculation of unique parameters using the first 1 to n error data constructing sample autocovariance function from the sample Yule-Walker equation of autocovariance function regression calculation, get
[0040] Step 503-6, when μ k+1 = min(1.05 μ k , μ max ), k++, j = 3, the corresponding combined into the corresponding three-dimensional tensor and the corresponding combined into the corresponding three-dimensional tensor Δ d ε t-i ; if return to step 503-1; otherwise, exit the loop.
[0041] Further, in step 6, the core tensor at the next time point is predicted by the tensor ARIMA model, and the specific formula includes:
[0042]
[0043] Further, in step 7, the tensor The inverse Tucker decomposition operation and the inverse difference operation are performed to obtain the tensor The specific method comprises the following steps:
[0044] The inverse Tucker decomposition operation is utilized to obtain the difference tensor at the t+1 moment The d-order inverse difference calculation is performed on to obtain
[0045] The present application uses the block Hankel matrix operation result to express the historical time sequence data of the industrial wastewater discharge water quality index as a tensor, extracts the discharge wastewater index characteristics through the Tucker tensor decomposition with a low rank characteristic constraint, predicts the water quality index value on the integrated moving average autoregressive model ARIMA according to the optimized characteristic kernel tensor, and adopts the decomposed kernel tensor data to replace the original data, thereby reducing the relative error during water quality prediction and improving the prediction accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0046] Figure 1 The present application is based on the tensor characteristic reconstruction of the industrial wastewater discharge water quality prediction method flow;
[0047] Figure 2 The present application is a block Hankel matrix schematic diagram;
[0048] Figure 3 The present application is a sewage index monitoring data tensorization schematic diagram;
[0049] Figure 4 The present application is a tensor data restoration monitoring data matrix schematic diagram;
[0050] Figure 5 The present application is a chemical oxygen demand (COD) and ammonia nitrogen (NH) prediction data test effect diagram. DETAILED DESCRIPTION
[0051] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the present application.
[0052] The drawings in the embodiments of the present application will be described below in combination with the drawings in the embodiments of the present application. Figures 1-5 The embodiments of the present application will be further described in detail.
[0053] The present application is based on the tensor characteristic reconstruction of the industrial wastewater discharge water quality prediction method, as shown in the drawings, comprising: Figure 1
[0054] Step 1: Collect water quality sensor data from the wastewater discharge outlet of a factory over a period of time;
[0055] Step 2, for the sensor from t1 to t n The data at any given time undergoes data standardization processing, and the standardized data is then processed. For time t i The standardized index data vector at any given time, where R represents a real number (e.g., water temperature, pH, conductivity, dissolved oxygen, nitrate nitrogen, TN (total nitrogen), TP (total phosphorus), etc.), is represented using a block Hankel matrix S, with the matrix structure as follows: Figure 2 As shown, data G t Multiplying the matrix S along the time direction yields the time series tensor. N, V, and M represent the historical data volume, the number of metrics for collecting vector data, and the number of time dimension segmentation matrices, respectively.
[0056] Step 3: Convert the tensor Perform d-order difference calculations. Obtain a stationary set of difference tensors. Δ is the difference operator;
[0057] Step 4, for We utilize low-rank Tucker tensor decomposition and construct the objective function of Tucker tensor decomposition through tensor ARIMA and low-rank regularization constraints;
[0058] Step 5: Solve by optimizing the objective function. The objective function model is optimized using the Alternating Direction Method of Multipliers (ADMM). Decomposed into in, This represents the core tensor after decomposition. These are three orthogonal factor matrices. Using convergence criteria and iterative calculations, we obtain... and U (1) U (2) U (3) And calculate the error Δ for each iteration. d ε t This step maps the low-rank features of the tensor to a small-dimensional core tensor. R1, R2, and R3 are respectively The rank of the matrix is expanded according to the three modes. To better cluster tensor features in a lower dimension, tensor kernel canonical constraints are used. The compressed kernel tensor is learned by using the orthogonal factor (projection) matrix, and the low-dimensional eigenker kernel tensor is obtained by iterative optimization using the alternating direction multiplier method. Due to the joint use of these projection matrices, the feature continuity between core tensors is maximally maintained, which can capture the intrinsic data structure correlation better than the original time series data;
[0059] Step 6, learning the optimization in the function model of step 5 and error Δ d ε t , the tensor ARIMA model directly applies the core tensor at the current time t to calculate the new tensor core at the next time point t+1
[0060] Step 7: According to the orthogonal factor U (1) solved in step 5 (2) solved in step 5 (3) , obtain the tensor Calculate the inverse Tucker decomposition operation, inverse difference operation to obtain
[0061] Step 8: The predicted tensor form result is expanded in time dimension to form a large matrix, and multiplied by the block Hankel inverse matrix S -1 , to obtain the prediction result G t+1 of each index at time t+1 t+2 , G t+3 .
[0062] In order to strengthen the stationarity of data, in step 2, the specific method for obtaining the standardized water quality index data G t includes: first, standardizing the collected data, taking the discharge value T x of the national comprehensive wastewater discharge standard as the benchmark, and using the formula to obtain G t , wherein g' i is the original value collected at time t i , and g is the data value from time t1 to time t n .
[0063] The specific method for obtaining the time series tensor includes:
[0064] G t is multiplied by the block Hankel matrix S, and the calculation result is divided into multiple matrices with a size of N x V, and is overlapped into a time series tensor The matrix S describes the tensorization process of the wastewater index monitoring data, and the specific process is shown in Figure 3 .
[0065] The specific method of constructing the Tucker tensor decomposition objective function in step 4 includes:
[0066] Step 401, set R1=10, R2=12, R3=12, and randomly generate a set of matrix groups By jointly orthogonalizing the factor matrix through Tucker decomposition, projecting to the core tensor The calculation formula is:
[0067]
[0068] Step 402, in order to preserve the time correlation between the core tensors, extend the linear ARIMA to a multi-dimensional model, convert it to a tensor form, and use it to connect the current core tensor and the calculated core tensor and calculate the sequence error Similarly, Δ d ε t-2 ,..., Δ d ε t-n can be calculated. The tensor ARIMA model with parameters (m, d, n) is described as
[0069]
[0070] Step 403, since the sequence data is transformed in the high-dimensional space through the block Hankel matrix, the core tensor has a low-rank characteristic, therefore, according to the function model of step 401 and step 402, combined with the low-rank of the core tensor, the objective function is:
[0071]
[0072] In step 5, the specific method of optimizing the objective function by using the alternating direction multiplier method includes:
[0073] Step 501, transform each tensor variable along the time dimension-matrix expansion into a matrix, and restate the optimization problem as
[0074]
[0075] And use the augmented Lagrange method to solve the values of each variable;
[0076] Initialize the parameters of the alternating direction multiplier method, set the loop parameters k=0, d=2, m=5, n=5, t=m+d+n+1, j=1, 2, 3, and the iteration termination threshold error value tol=2*10 -3 , the parameter μ=0.05, set the maximum parameter value as μ max =0.8, m, n, d are all integers greater than 0;
[0077] Step 503, execute a loop, update variables, and obtain an objective function.
[0078] The specific method for updating variables and obtaining an objective function includes:
[0079] Step 503-1, update variables Fixing other variables, the objective function is:
[0080] For Take the partial derivative and equal to zero, then the can be calculated
[0081] Step 503-2, update variables Fixing other variables, the objective function is:
[0082] Using matrix singular value decomposition,
[0083] Get U, V and diag(σ),
[0084] Step 503-3, update variable U ( ' j) , fixing other variables, the objective function is:
[0085] Transformed into Solve the global optimal solution, for singular value decomposition is are the left and right singular vectors after decomposition, respectively, and is calculated
[0086] Step 503-4, update variables Fixing other variables, the objective function is:
[0087] For the Take the partial derivative and make it equal to zero, get the calculation
[0088] Step 503-5, update variables and ρ i and β′ i are the parameters of AR (Autoregressive Model) and MA (moving average model) models, using Yule-Walker equation, for the first 1 to m sample data Construct the sample autocovariance from the sample Yule-Walker equations of the autocovariance function Regression calculation of the unique parameters Using the first n error data Constructing the sample autocovariance function from the sample Yule-Walker equations of the autocovariance function Regression calculation, resulting in
[0089] Step 503-6, when μ k+1 = min(1.05 μ k , μ max ), k++, j = 3, the corresponding is combined into the corresponding three-dimensional tensor Similarly, the corresponding is combined into the corresponding three-dimensional tensor Δ d ε t-i ; if return to step 503-1; otherwise, exit the loop.
[0090] In step 6, the core tensor at the next time point is predicted by the tensor ARIMA model The specific formula includes: using the three-dimensional ARIMA model, predicting the latest core tensor at time t+1 using
[0091] In step 7, the tensor is subjected to inverse Tucker decomposition operation and inverse difference operation to obtain the tensor The specific method includes:
[0092] Using U1', U2', and U3' obtained in step 5, the Tucker inverse decomposition operation is used to obtain the difference tensor at time t+1 is subjected to d-order inverse difference calculation to obtain The predicted tensor form result is unfolded in the time dimension to form a large matrix, which is multiplied by the block Hankel inverse matrix S -1 to obtain the prediction result G t+1 of each index at time t+1. Refer to the above steps to calculate again to obtain the prediction results G t+2 , G t+3 at times t+2, t+3, etc. Figure 4 The tensor data restoration monitoring data matrix diagram is shown in
[0093] The function model of the present application utilizes the data of a factory sewage quality monitoring sensor, which is collected every 10 minutes within 50 days, including PH value, temperature, chemical oxygen demand (COD) and ammonia nitrogen (NH) in total 6 kinds, Figure 5 The effect picture of the prediction data test of the chemical oxygen demand (COD) and ammonia nitrogen (NH) of the present model is shown, including the comparison and difference display of the original data and the predicted data.
[0094] The present application has the following beneficial effects:
[0095] (1) The time series data of the monitoring indexes of the factory sewage discharge is converted into three-dimensional high-order tensor by using the Hankel matrix method, which is beneficial to find the data structure characteristics and low rank characteristics in the high-dimensional data space.
[0096] (2) The low rank Hankel tensor is further obtained by using Tucker decomposition along the time mode to capture the inherent correlation between multiple indexes, and is used for training the tensor ARIMA model, so as to improve the prediction accuracy of the factory wastewater discharge water quality and reduce the calculation speed, and the method is better than the existing prediction method, and has the effect of significantly improving the performance.
[0097] (3) The present application can solve the problem that the traditional method cannot fully utilize the characteristics of the historical data, and can also solve the problem that the prediction accuracy of ARIMA is low when predicting irregular fluctuations.
Claims
1. A method for predicting the water quality of industrial wastewater discharge based on tensor feature reconstruction, characterized in that, Comprise: Step 1, collect the water quality index data of the factory wastewater discharge port; Step 2, standardize the collected water quality index data to obtain standardized water quality index data , , multiply the water quality index data along the time direction with the matrix to obtain a time series tensor , , N, V, and M are respectively the historical data volume, the index number of the collected vector data, and the time dimension segmentation matrix number; Step 3, tensor performing difference calculation to obtain a difference tensor set , is a difference operator; Step 4, performing a differential tensor set Performing a low-rank Tucker tensor decomposition, constructing a Tucker tensor decomposition objective function by tensor ARIMA and low-rank regularization constraints: Step 401, Settings The value of the matrix is used to randomly generate a set of matrices. By using Tucker decomposition of the joint orthogonal factor matrix, Projected onto the core tensor In the formula, the calculation method is: where I is an identity matrix with all elements of the main diagonal equal to 1 and all other elements equal to 0. Step 402, extend the linear ARIMA to a multi-dimensional model, convert to tensor form, use its connection to the current core tensor , and the calculated core tensor , , …, , and calculate the sequence error , and calculate the sequence error ; the tensor ARIMA model with parameters m, d, n is described as: ; wherein, and are parameters of the AR and MA models, respectively; Step 403, according to the model of step 401 and step 402, combined with the low rank of core tensor, the objective function is: ; Step 5, the objective function is optimized by using alternating direction multiplier method, and is decomposed into , wherein, represents the decomposed core tensor, is three orthogonal factor matrices, the convergence criterion is used to obtain and by iterative calculation, and the error of each iteration is calculated. Step 6, predicting the core tensor at the next time point from the core tensor and the iteration error by a tensor ARIMA model ; Step 7, multiply the core tensor with the orthogonal factors to obtain the tensor at the next time point , perform an inverse Tucker decomposition operation and an inverse difference operation on the tensor to obtain the tensor ; Step 8, tensor The matrix is unfolded in time dimension, and then multiplied by the block Hankel inverse matrix to get the predicted data result at the next time point .
2. The method for predicting the water quality of industrial wastewater discharge based on tensor feature reconstruction according to claim 1, characterized in that, In step 2, the water quality index data after standardization processing is obtained The specific method includes: According to the national sewage comprehensive discharge standard discharge value T x As a benchmark, the formula , the calculation is obtained , wherein, The original value of the t i time, The data value from t1 to t n time, n is an integer greater than 1.
3. The method for predicting the water quality of industrial wastewater discharge based on tensor feature reconstruction according to claim 1, characterized in that, In step 2, the time series tensor The specific method includes: will be multiplied by the block Hankel matrix and the result will be split into multiple matrices of size and overlapped into a time series tensor .
4. The method for predicting the water quality of industrial wastewater discharge based on tensor feature reconstruction according to claim 1, characterized in that, In step 5, the specific method for optimizing the objective function by using the alternating direction multiplier method includes: Step 501, transform each tensor variable along the time dimension-mode unfolding into a matrix, re-optimized as ; And use the augmented Lagrange method to solve each variable value; Step 502, initialize parameters of the alternate direction multiplier method, set loop parameter k = 0, t = m + d + n + 1, j = 1, 2, 3, iteration termination threshold error value tol, parameter , set the maximum parameter value as ; Step 503, execute the loop, update the variable, and obtain the objective function.
5. The method for predicting the water quality of industrial wastewater discharge based on tensor feature reconstruction according to claim 4, characterized in that, The specific method for updating the variable and obtaining the objective function includes: Step 503-1, updating variables , fixing other variables, the objective function is: , and , and , and ; Step 503-2, update variable , fix other variables, the objective function is: , using matrix singular value decomposition, , get U, V and , ; Step 503-3, updating variables , fixing other variables, the objective function is: , transform to find global optimal solution, to singular value decomposition into , left and right singular vectors after decomposition, respectively, to calculate ; Step 503-4, updating variables , fixing other variables, the objective function is: , the partial derivative of the objective function with respect to the variable is taken and set equal to zero, resulting in the calculation ; Step 503-5, update variables and , and are parameters of AR and MA models, respectively, and are calculated using the Yule-Walker equations on the first m sample data constructing the sample autocovariance function from the sample Yule-Walker equations for the autocovariance function regression to uniquely determine the parameters ; and using the first n error data constructing the sample autocovariance function from the sample Yule-Walker equations for the autocovariance function regression to obtain ; Step 503-6, when , k++, j = 3, the corresponding , , are combined into a corresponding three-dimensional tensor ; and the corresponding , , are combined into a corresponding three-dimensional tensor ; If then go back to step 503-1; otherwise, exit the loop.
6. The method for predicting the water quality of industrial wastewater discharge based on tensor feature reconstruction according to claim 4, characterized in that, In step 6, the core tensor at the next time point is predicted by the tensor ARIMA model The specific formula includes: 。 7. The industrial wastewater discharge water quality prediction method based on tensor feature reconstruction according to claim 4, characterized in that, In step 7, the inverse Tucker decomposition operation and the inverse difference operation are performed on the tensor to obtain a tensor The specific method includes: The inverse Tucker decomposition operation is used to obtain the difference tensor at time t+1 The inverse difference calculation of order d is performed on to obtain .
Citation Information
Patent Citations
Neural network processing method and related equipment
CN111652349A
Low-rank tensor completion method based on three-dimensional total variation and Tucker decomposition
CN113870130A