Wide-depth fusion learning-based BOD prediction method for sewage treatment process
Through the wide-depth fusion learning method, combined with sparse width learning and self-attention mechanism to optimize the network structure, the accuracy and efficiency problems of BOD prediction in sewage treatment by traditional models are solved, and efficient and accurate BOD prediction is achieved.
Patent Information
- Application Number
- CN202510876663.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-09-26
AI Technical Summary
In traditional sewage treatment processes, BOD prediction models are difficult to achieve accurate predictions in complex sewage treatment environments, and traditional deep learning models have redundancy problems in node settings, resulting in high model complexity and low computational efficiency, making it difficult to adapt to the time-varying nature of the sewage treatment process.
A wide-depth fusion learning method is adopted, combined with sparse width learning and self-attention mechanism. The network structure is optimized through the sparse width learning module, the linear regression analysis method LASSO is used to optimize the weights, and the self-attention mechanism is combined to assign weights to different features. A deep learning model is constructed through a multi-layer perceptron, and a loss function is designed for training.
It significantly reduces the complexity of model training, improves prediction accuracy, can more accurately focus on the core factors affecting BOD, and provides an efficient and accurate BOD prediction solution.
Smart Images

Figure CN120706271A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a BOD prediction method for a sewage treatment process based on wide-depth fusion learning, and belongs to the technical field of sewage treatment. Background Art
[0002] As an important branch of environmental protection, the effectiveness of sewage treatment technology is directly related to environmental quality. In the process of ensuring that the effluent quality of sewage treatment plants meets standards, key variables are often used to measure the effectiveness of sewage treatment (such as the biochemical oxygen demand (BOD) that measures the organic matter content in water bodies). These key variables are currently measured mainly through two methods: 1) Direct measurement: Using online analyzers to directly measure the required parameters; however, online analyzers are expensive and have large measurement errors. 2) Indirect measurement: Using easily measurable auxiliary variables to estimate key variables, that is, using soft measurement models to estimate key variables. In sewage treatment systems, the use of soft measurement technology to predict the key variable BOD in the sewage treatment process can significantly reduce the cost of traditional hardware measurement.
[0003] Within the realm of soft sensing technology, there are generally two modeling approaches. One is mechanistic modeling, which applies specific laws and principles based on the inherent operating mechanisms of a specific industrial process to construct a mathematical model of the process, clarifying the relationship between quality variables and auxiliary variables. However, actual wastewater treatment processes are influenced by a complex network of factors, making the mathematical models of actual production processes extremely complex. Traditional mechanistic modeling and optimization methods struggle to construct accurate mathematical models for complex wastewater treatment processes, making it difficult to obtain precise measurement results. The other approach is data-driven modeling. Unlike traditional mechanistic modeling methods, data-driven soft sensing models do not require prior knowledge. Typical data-driven modeling methods include artificial neural networks, support vector regression, and principal component regression. While these methods, particularly artificial neural networks, have been successfully implemented in soft sensing applications, their shallow structure makes it difficult to effectively extract satisfactory features in complex chemical processes.
[0004] Data in the field of sewage treatment is characterized by high dimensionality, strong nonlinearity, and high noise. Traditional prediction models, such as linear regression and models based on empirical formulas, have difficulty accurately depicting the complex relationships between data when faced with such complex data. For example, when predicting BOD, sewage quality and volume will fluctuate significantly over time, and there are complex interactions between sewage components. Traditional models find it difficult to accurately predict such dynamic changes. Deep learning methods, as a data-driven soft sensor modeling method, can extract deep features using multiple hidden layer structures and have strong feature extraction capabilities. In order to effectively conduct in-depth analysis and screening of these features, accurately capture the complex relationships between data, and significantly improve the model's adaptability to complex data, deep learning methods often introduce multi-layer perceptrons to achieve accurate estimation of key variables.
[0005] On the other hand, the wastewater treatment process is time-varying, with wastewater quality and quantity constantly changing. Treatment processes require timely adjustments to ensure stable treatment results. Traditional modeling methods, however, are largely based on experience and fixed parameters, making it difficult to track process changes in real time. This can lead to poor treatment results and even excessive discharges. Broad Learning (BLS) features incremental learning, allowing it to incorporate new data and update model parameters in real time, promptly reflecting dynamic changes in wastewater quality. However, the performance of BLS models depends heavily on their network structure. Appropriate hidden layer node configuration is crucial for building predictive models. Insufficient nodes can reduce the model's learning ability, making it difficult to fully exploit data features and affecting prediction accuracy. Therefore, in practical modeling, excessive nodes are often configured to fully extract variable feature information and ensure model approximation and generalization performance. However, as the number of nodes increases, node redundancy can occur. Node redundancy not only increases model complexity and reduces computational efficiency, but can also lead to overfitting. Node configuration in traditional BLS and its improved algorithms is typically determined using a grid search method, which is computationally expensive and relies heavily on prior knowledge. Therefore, reasonable and efficient node selection is also a difficult problem that needs to be solved urgently in the BLS modeling process. Summary of the Invention
[0006] In order to solve the existing problems, the present invention provides a BOD prediction method for sewage treatment process based on wide-depth fusion learning, including:
[0007] Step 1: Obtain sewage treatment process data, including process variables X=[x1,x2,...,x N ] T and target variable y=[y1,y2,...,y N ] T , where the target variable is the effluent BOD; N represents the amount of process data, and T represents the transposition operation;
[0008] Step 2: Use sparse width learning to map the process variables, and use the linear regression analysis method LASSO to optimize the width network structure to obtain the output weights, completing the construction of the sparse width learning module;
[0009] Step 3: Combine the process variables with the sparse width learning module Fusion as input for deep learning Design a fusion solution based on the self-attention mechanism. By calculating the similarity between features in the fused data, the importance weights of different features are automatically learned, and different weights are assigned to different features according to their importance.
[0010] Step 4: Use the multi-layer perceptron to build the deep learning model in the BDFL model;
[0011] Step 5: Design the BDFL model training loss function and complete the construction of the BDFL model through gradient descent of the loss function;
[0012] Step 6: Collect process variables in the sewage treatment process as input to the BDFL model to predict the target variables.
[0013] Optionally, step 2 includes:
[0014] According to formula (1), the process variable X is mapped into a characteristic node:
[0015] Z=φ(XW e +β e ) (1)
[0016] Among them, Z is the feature node matrix, φ is the mapping function sigmoid, W e and β e are random weight and bias matrices generated from a uniform distribution;
[0017] Cascade n groups of feature nodes to obtain feature node group Z n ,Using formula (2), the feature node group is connected to the enhanced node layer to form an enhanced node, and the enhanced node group is obtained by cascading;
[0018] H m =ξ(Z n W h +β h ) (2)
[0019] Among them, ξ j is the nonlinear activation function tanh, W h and β h To enhance the weight and bias of the node;
[0020] The feature node group and the enhancement node group are cascaded, and the linear regression analysis method LASSO is used to optimize the width network structure to obtain the output weights and complete the construction of the sparse width learning module.
[0021] Optionally, the step 2 uses a linear regression analysis method LASSO to optimize the width network structure to obtain output weights, including:
[0022]
[0023] in, is the parameter value of a function that takes the minimum value in its domain, y is the output variable, and λ L is the regularization parameter, λ L >0, is the coefficient vector, A=[Z n ,H m ] represents the system state equation;
[0024] The alternating direction multiplier method is used to transform the LASSO output weight formula into a general problem solution.
[0025] Optionally, in step 3, different weights are assigned to different features according to their importance by using the following formula:
[0026] Q=X'W Q (7)
[0027] K=X'W K (8)
[0028] V=X'W V (9)
[0029]
[0030] in, are three learnable linear transformation matrices used to convert the input into intermediate parameters Q, K, and V, respectively, and d is the scaling factor.
[0031] Optionally, Q, K, and V are the target that currently needs to calculate attention, the object to be compared, and the information that actually needs to be aggregated. First, the correlation is matched through Q and K, and then V is weighted and summarized according to the correlation. Q and K are used to calculate the correlation (similarity), and V stores the actual information to be extracted to achieve dynamic weight allocation.
[0032] Optionally, the loss function in step 5 is in Used to indicate the gap between the overall predicted value of the BDFL model and the true value. Used to represent the gap between the predicted value obtained in the sparse width learning module and the true value.
[0033] Optionally, the process variable X includes the suspended solids concentration RD-SS-G of the global performance input, the chemical oxygen demand RD-DQO-G of the global performance input, the biological oxygen demand RD-DBO-G of the global performance input, the degradable solids concentration RD-SED-G of the global performance input, the biological oxygen demand RD-DBO-P of the performance input, the suspended solids concentration RD-SS-P of the performance input, the biological oxygen demand RD-DBO-S of the performance input secondary sedimentation tank, the chemical oxygen demand RD-DQO-S of the performance input secondary sedimentation tank, the influent biological oxygen demand DBO-E, the influent chemical oxygen demand DQO-E, the biological oxygen demand DBO-P of the primary sedimentation tank, the pH value PH-D entering the reaction tank, the biological oxygen demand DBO-D entering the reaction tank, the chemical oxygen demand DQO-D entering the reaction tank, the suspended solids concentration SS-D entering the reaction tank, the degradable solids concentration SED-D entering the reaction tank, the effluent pH value PH-S and the effluent degradable solids concentration SED-S.
[0034] The present invention also provides application of the method in the field of sewage treatment.
[0035] The beneficial effects of the present invention are:
[0036] By constructing a BDFL (Broad and Deep Fused Learning) model, during the model training process, relying on the lightweight architecture and fast parallel computing mechanism of the sparse width learning module, the complex hierarchical training of the traditional deep learning model is transformed into efficient feature mapping and weight calculation, significantly reducing the overall training complexity. The fusion module based on the self-attention mechanism of the present invention assigns weights to different features according to the importance of the data, focusing on strengthening the ability to extract nonlinear coupling features, so that the model can focus more accurately on the core elements that affect BOD. For the first time, the present invention systematically applies wide and deep fusion learning technology to the prediction of BOD for sewage treatment, providing the industry with an intelligent solution that is both efficient and accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0038] Figure 1 This is the structure diagram of the width learning system.
[0039] Figure 2 This is the structure diagram of the wide-depth fusion learning model.
[0040] Figure 3 This is the structural diagram of sewage treatment equipment.
[0041] Figure 4 It is a prediction curve tracking effect diagram of the sewage treatment process results.
[0042] Figure 5 It is a scatter plot of the results of the sewage treatment process. DETAILED DESCRIPTION
[0043] To make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
[0044] Example 1
[0045] This embodiment provides a method for predicting BOD in a sewage treatment process using broad and deep fused learning. This method constructs a BDFL (Broad and Deep Fused Learning) model, which includes three modules: a sparse broad learning module, a fusion module based on a self-attention mechanism, and a deep learning module. This model is then used to predict BOD in the sewage treatment process, including:
[0046] Step S1: Obtain sewage treatment process data, process missing values, outliers, and perform data standardization to obtain a data set;
[0047] According to the mechanism of sewage treatment process, 18 process variables shown in Table 1 are selected as auxiliary variables, and the target variable is effluent BOD. The obtained data set is the input data X=[x1,x2,...,x N ] T and y=[y1,y2,...,y N ] T ,in is an M-dimensional input vector, in this embodiment, M=18, represents the M-dimensional real space, y i ∈R(i=1,2,...,N) is the output.
[0048] It should be noted that by processing missing values and outliers, and performing data standardization, the quality and reliability of the data can be ensured, the impact of these values on model training and prediction results can be avoided, and the model performance can be improved; by analyzing and processing the data, more accurate data support can be provided for decision-making in the sewage treatment process, thereby improving the accuracy of decision-making.
[0049] Step S2: Map the input data X into feature nodes according to formula (1):
[0050] Z=φ(XW e +βe ) (1)
[0051] Among them, Z is the feature node matrix, φ is the mapping function sigmoid, X is the input data, that is, the process variable collected in step S1, W e and β e are random weight and bias matrices generated from a uniform distribution;
[0052] Cascade n groups of feature nodes to obtain feature node group Z n ,Using formula (2), the feature node group is connected to the enhanced node layer to form an enhanced node, and the enhanced node group is obtained by cascading;
[0053] H m =ξ(Z n W h +β h ) (2)
[0054] Among them, ξ j is the nonlinear activation function tanh, W h and β h To enhance the weight and bias of the node.
[0055] Step S3: Cascade the feature node group and the enhanced node group, use the linear regression analysis method LASSO (Least Absolute Shrinkage and Selection Operator) to optimize the width network structure to obtain the output weight, and complete the construction of the sparse width learning module;
[0056] Furthermore, LASSO is used to solve the output weight, which is expressed as:
[0057]
[0058] in, is the parameter value of a function that obtains the minimum value in its domain, y is the system output variable, and λ L is the regularization parameter, λ L >0, is the coefficient vector, A=[Z n ,H m ] represents the system state equation, is the mean square error loss calculation, is the calculation of L1 regularization term;
[0059] Furthermore, the alternating direction multiplier method is used to transform the LASSO output weight formula into a general problem, which is solved by the following iterative steps. The k+1th iteration is expressed as:
[0060]
[0061] Where I is the identity matrix, A=[Z n ,H m ] represents the system state equation, A Τ is the transposed matrix of A, ρ>0 is the shrinkage coefficient, S is the soft threshold operator symbol, and ω is the variable to be solved;
[0062] Preferably, the alternating direction multiplier method is used to transform the LASSO output weight formula into a general problem, which can be expressed as follows:
[0063]
[0064] in, g(ω)=λ L ||ω||1, The parameter value for a function to achieve its minimum value in its domain;
[0065] Preferably, S is defined as:
[0066]
[0067] Among them, ρ>0 is the shrinkage coefficient, S is the soft threshold operator symbol, λ L is the regularization parameter, a=(ω k+1 +u k );
[0068] Step S4: Combine the auxiliary variable (i.e., process variable) with the sparse width learning result Fusion as input for deep learning A fusion scheme based on the self-attention mechanism is designed. By calculating the similarity between features (QK dot product) on the fused data, the importance weights of different features are automatically learned, key features are enhanced, and irrelevant / noise features are suppressed. Different weights are assigned to different features based on their importance. The following formula is used to implement weight distribution:
[0069] Q=X'W Q (7)
[0070] K=X'W K (8)
[0071] V=X'W V (9)
[0072]
[0073] in, are three learnable linear transformation matrices that convert the input into intermediate parameters Q, K, and V, respectively, and d is the scaling factor.
[0074] Q, K, and V are respectively: the target that currently needs to calculate attention, the object to be compared, and the information that actually needs to be aggregated. First, the correlation is matched through Q and K, and then V is weighted and summarized according to the correlation. Q and K are used to calculate the correlation (similarity), and V stores the actual information to be extracted to achieve dynamic weight allocation.
[0075] Step S5: Use a multi-layer perceptron to build the BDFL deep learning model.
[0076] For a multilayer perceptron with L layers, suppose the input layer n0 has a neuron and the lth layer has n l neurons. The input vector of layer l is The weight matrix is The bias vector is Then the weighted input sum vector F of the lth layer is (l) It can be expressed as:
[0077]
[0078] The weighted input sum vector F (l) Input into the activation function σ to get the output vector of the lth layer
[0079]
[0080] The final output prediction
[0081] Step S6: In order to make the deep learning module training process pay more attention to the unprocessed parts in the sparse width learning module, the model training loss function is designed as Through the gradient descent of the loss function, the construction of the BDFL model is finally completed.
[0082] In the loss function Used to indicate the gap between the overall predicted value of the BDFL model and the true value. It is used to represent the gap between the predicted value and the true value obtained in the sparse width learning module. The introduction of this item allows the unprocessed part of the sparse width learning module to participate in the training process of the deep learning module, explicitly guides the deep learning module to focus on the residual features of the sparse width learning module, and uses dual supervision signals to promote feature complementarity learning.
[0083] To verify the predictive performance of the BDFL model proposed in this application in sewage treatment, this example uses the activated sludge sewage treatment plant data included in the machine learning database of the University of California, Irvine (UCI). This dataset was collected by Blake and Merz in 1998 from a municipal sewage treatment plant in Barcelona, Spain. Its process flow is as follows: Figure 3As shown, it includes pretreatment tank, primary sedimentation tank, aeration tank, secondary sedimentation tank and sludge return link, with a designed treatment capacity of 35,000m 3 / day. Due to the lack of online monitoring equipment, the variable sampling period was 1 day, which lasted for 527 days. 38 process parameters related to organic matter degradation and microbial activity were collected. Based on the analysis of the wastewater biochemical treatment mechanism, 18 key auxiliary variables were screened out, as shown in Table 1, and Figure 3 The underlined lines show that the root mean square error (RMSE), mean absolute error (MAE) and correlation coefficient (R) of the effluent biochemical oxygen demand (BOD) are used as the prediction target. 2 ) is used as a performance evaluation indicator to evaluate the prediction results.
[0084] The calculation formula for each indicator is:
[0085]
[0086] The auxiliary variables used in this application are shown in Table 1.
[0087] Table 1 Auxiliary variables of sewage treatment process
[0088]
[0089] In order to more clearly demonstrate the superiority of the method proposed in the present invention, Figure 4 BOD prediction curves obtained using the method of the present invention and four other existing methods are shown. For a detailed introduction to the traditional deep learning model BLS, please refer to "Broad learning system: an effective and efficient incremental learning system without the need for deep architecture." For the L1BLS and ENBLS algorithm models, please refer to "Sparse network structure method for wide learning system based on lasso and elastic net." For a detailed introduction to the MLP algorithm model, please refer to "MLP modeling for search advertising price prediction."
[0090] from Figure 4It can be seen that compared with the traditional BLS, the L1BLS algorithm model and the ENBLS algorithm model, as BLS variant improved algorithms, have significantly improved the performance of the models built. In addition, compared with the ENBLS algorithm, the prediction accuracy of the L1BLS algorithm is slightly improved, indicating that obtaining the network output weight through LASSO can effectively improve the prediction accuracy of the model. The BDFL algorithm proposed in the present invention performs the best and has the best fitting effect with the true value, indicating that the solution of the present invention fully utilizes and effectively combines the advantages of wide learning and deep learning, and the fusion mechanism proposed in the present invention enables the model to assign weights to different features according to the importance of the data, strengthen the extraction of nonlinear coupling features, and thus provide a possibility for improving prediction accuracy.
[0091] Figure 5 The following is a scatter plot of the BOD predicted and true values using the method of the present invention and other existing methods, reflecting the advantages of the method of the present invention over other existing related methods. It can be seen that the scatter plots of the method of the present invention are more closely distributed around the 45° line. The comparison results of the method of the present invention with BLS, L1BLS, ENBLS, and MLP are shown in Table 2.
[0092] Table 2 Prediction results of sewage BOD values by various methods
[0093]
[0094] It can be seen from Table 2 that the model proposed in the present invention has the highest prediction accuracy and can better predict the BOD value in the sewage treatment process.
[0095] Some steps in the embodiments of the present invention may be implemented using software, and the corresponding software program may be stored in a readable storage medium, such as a CD or a hard disk.
[0096] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A BOD prediction method for sewage treatment process based on wide and deep fusion learning, characterized by: The method is implemented based on the constructed BDFL model, which includes a sparse width learning module and a deep learning module. The method includes: Step 1: Obtain sewage treatment process data, including process variables X=[x1,x2,...,x N ] T and target variable y=[y1,y2,…,y N ] T , where the target variable is the effluent BOD; N represents the amount of process data, and T represents the transposition operation; Step 2: Use sparse width learning to map the process variables, and use the linear regression analysis method LASSO to optimize the width network structure to obtain the output weights, completing the construction of the sparse width learning module in the BDFL model; Step 3: Combine the process variables with the sparse width learning module Fusion as input for deep learning Design a fusion solution based on the self-attention mechanism. By calculating the similarity between features in the fused data, the importance weights of different features are automatically learned, and different weights are assigned to different features according to their importance. Step 4: Use multi-layer perceptron to build the deep learning module in the BDFL model; Step 5: Design the BDFL model training loss function and complete the construction of the BDFL model through gradient descent of the loss function; Step 6: Collect process variables in the sewage treatment process as input to the BDFL model to predict the target variables.
2. The method according to claim 1, characterized in that The step 2 includes: According to formula (1), the process variable X is mapped into a characteristic node: Z=φ(XW e +β e ) (1) Among them, Z is the feature node matrix, φ is the mapping function sigmoid, W e and β e are random weight and bias matrices generated from a uniform distribution; Cascade n groups of feature nodes to obtain feature node group Z n ,Using formula (2), the feature node group is connected to the enhanced node layer to form an enhanced node, and the enhanced node group is obtained by cascading; H m =ξ(Z n W h +b h ) (2) Among them, ξ j is the nonlinear activation function tanh, W h and β h To enhance the weight and bias of the node; The feature node group and the enhanced node group are cascaded, and the linear regression analysis method LASSO is used to optimize the width network structure to obtain the output weights and complete the construction of the sparse width learning module.
3. The method according to claim 2, characterized in that The step 2 uses the linear regression analysis method LASSO to optimize the width network structure to obtain the output weight, including: in, is the parameter value of a function that takes the minimum value in its domain, y is the output variable, and λ L is the regularization parameter, λ L >0, is the coefficient vector, A=[Z n ,H m ] represents the system state equation; The alternating direction multiplier method is used to transform the LASSO output weight formula into a general problem solution.
4. The method according to claim 3, characterized in that In step 3, different weights are assigned to different features according to their importance by using the following formula: Q=X’W Q (7) K=X’W K (8) V=X’W V (9) Among them, W Q ,W K ,W V are three learnable linear transformation matrices, Q, K, and V are intermediate parameters, and d is the scaling factor.
5. The method according to claim 4, characterized in that The loss function in step 5 is: in Used to indicate the gap between the overall predicted value of the BDFL model and the true value. Used to represent the gap between the predicted value obtained in the sparse width learning module and the true value.
6. The method according to claim 5, characterized in that The process variable X includes the suspended solids concentration RD-SS-G of the global performance input, the chemical oxygen demand RD-DQO-G of the global performance input, the biological oxygen demand RD-DBO-G of the global performance input, the degradable solids concentration RD-SED-G of the global performance input, the biological oxygen demand RD-DBO-P of the performance input, the suspended solids concentration RD-SS-P of the performance input, the biological oxygen demand RD-DBO-S of the performance input secondary sedimentation tank, the chemical oxygen demand RD-DQO-S of the performance input secondary sedimentation tank, the influent biological oxygen demand DBO-E, the influent chemical oxygen demand DQO-E, the biological oxygen demand DBO-P of the primary sedimentation tank, the pH value PH-D entering the reaction tank, the biological oxygen demand DBO-D entering the reaction tank, the chemical oxygen demand DQO-D entering the reaction tank, the suspended solids concentration SS-D entering the reaction tank, the degradable solids concentration SED-D entering the reaction tank, the effluent pH value PH-S and the effluent degradable solids concentration SED-S.
7. Application of the method according to any one of claims 1 to 6 in the field of sewage treatment.
Citation Information
Patent Citations
Width learning semi-supervised soft measurement modeling method fusing attention mechanism and adaptive composition
CN115186584A
Sewage treatment process fault monitoring method of width learning network for efficiently extracting dynamic characteristics
CN115660074A
Sewage treatment process soft measurement method and system based on adaptive sparse BLS
CN117951652A
Width learning-based water quality index BOD5 monitoring method for efficiently extracting data feature information
CN119089182A
Explainable transducer transformers
US20220198254A1