A sewage greenhouse gas hybrid proxy model and a construction method thereof
By constructing a mixed surrogate model for greenhouse gases in wastewater, using LightGBM and ANN models to predict greenhouse gas emissions in parallel, and employing non-negative least squares fusion, the problems of low accuracy and insufficient physical constraints in existing technologies are solved, and high-precision greenhouse gas prediction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG UNIV OF TECH
- Filing Date
- 2026-04-16
- Publication Date
- 2026-07-10
AI Technical Summary
Existing technologies cannot accurately capture greenhouse gas emission characteristics under fluctuating operating conditions in wastewater treatment, and machine learning models lack physical constraints, resulting in low accuracy of calculation results and failing to meet the needs of refined low-carbon operation management.
A mixed surrogate model for greenhouse gases in wastewater is constructed. By introducing a physical constraint mechanism, the LightGBM and ANN models are used to predict greenhouse gas emissions in parallel. The non-negative least squares method is used for fusion to ensure that the prediction results conform to the law of conservation of mass and achieve high-precision prediction.
It achieves high accuracy and physical consistency in greenhouse gas prediction, improves the interpretability and engineering credibility of the model, and enables accurate prediction under complex dynamic conditions.
Smart Images

Figure CN122369693A_ABST
Abstract
Description
Technical Field
[0001] This invention provides a wastewater greenhouse gas hybrid proxy model and its construction method. Specifically, it is a wastewater greenhouse gas proxy model construction method that integrates physical constraints and sparse data, belonging to the interdisciplinary field of environmental engineering and artificial intelligence. Background Technology
[0002] Municipal wastewater treatment is a key source of urban greenhouse gas (GHG) emissions, primarily releasing carbon dioxide, methane, and nitrous oxide. The global warming potential (GWP) of methane and nitrous oxide are 28 times and 265 times that of carbon dioxide, respectively, significantly impacting regional carbon balance. This treatment process encompasses core units such as biochemical reactions, sludge digestion, and dewatering, with strong inter-unit coupling and exhibiting highly nonlinear and dynamic time-varying characteristics. In actual operation, factors such as influent load shocks, dissolved oxygen concentration fluctuations, and changes in ambient temperature introduce significant uncertainties into microbial kinetic parameters, posing a substantial challenge to accurate greenhouse gas calculation and prediction.
[0003] Currently, quantitative methods in wastewater treatment mainly rely on empirical coefficient-based accounting systems, with the IPCC emission factor method being a typical example. While widely used, this method simplifies complex microbial biochemical processes into static functions linearly related to influent load or removal rate, neglecting the dynamic nonlinear effects of key process parameters such as dissolved oxygen (DO), sludge time (SRT), and pH. This results in calculations that often only reflect macroscopic trends, failing to accurately capture real-time emission characteristics under fluctuating operating conditions, and exhibiting low calculation accuracy, thus failing to meet the needs of refined low-carbon operation and management.
[0004] In recent years, machine learning methods have been widely used due to their advantages in nonlinear modeling. However, existing single or ensemble models still face technical bottlenecks in their construction and application, such as the blindness and lack of representativeness in training data construction, the "black box" risk of lacking physical constraints, and the limitations of optimization algorithms. Summary of the Invention
[0005] Based on this, the present invention provides a method for constructing a mixed proxy model of greenhouse gases in wastewater. This method integrates physical constraint mechanisms to construct the mixed proxy model of greenhouse gases in wastewater. This method realizes the leap from "data fitting" to "physical perception" and effectively solves the problem of the difficulty in achieving both physical consistency and high accuracy in greenhouse gas prediction.
[0006] The present invention is specifically implemented using the following technical solutions: A method for constructing a wastewater greenhouse gas mixing proxy model includes the following steps: S1. Use a wastewater treatment process simulation model to generate an input and output sample set containing influent water quality variables, process operation variables, and greenhouse gas emissions; introduce process operation limits as physical boundary conditions, and perform physical validity screening on the sample set to remove invalid samples that violate the law of conservation of mass or equipment operating limits, so as to provide a data foundation that conforms to physical laws for model construction. S2, Training Feature Decoupling and Benchmark Regression Submodel A LightGBM model is constructed as a baseline predictor, and its histogram algorithm is used to filter and decouple the importance of high-dimensional input features. The model is used to fit the first-order nonlinear relationship between input variables and greenhouse gas emissions, and output the baseline prediction value to capture the main trend information in the data. S3. Constructing a high-order nonlinear complementary sub-model We construct an artificial neural network that runs parallel to the LightGBM benchmark model. Using only the selected key features as input, we perform high-order nonlinear full prediction of greenhouse gas emissions and output the full prediction value of the ANN to capture the deep nonlinear fluctuation patterns in the data that are difficult to be represented by the benchmark model. S4. Construct a physically constrained adaptive fusion metamodel A fusion meta-model is constructed using the non-negative least squares method, taking the baseline predictions of LightGBM and the full predictions of ANN as inputs. A non-negative weight constraint mechanism is introduced to adaptively and non-negatively weight the prediction results of the two sub-models, ensuring that the final output is a non-negative linear combination of the two physically valid predictions. This results in a final prediction of greenhouse gas emissions that is both highly accurate and conforms to the law of conservation of mass.
[0007] Preferably, the influent water quality variables in step S1 include biochemical oxygen demand, chemical oxygen demand, total nitrogen, alkalinity, total suspended solids, influent flow rate, and temperature; the process operation variables include the oxygen transfer coefficient of the aerobic reactor, dissolved oxygen concentration, carbon source dosage, excess sludge flow rate, internal circulation flow rate, and external circulation flow rate.
[0008] Preferably, step S1 involves using a Copula function to construct a tail-based nonlinear correlation structure among multidimensional variables, and combining this with Latin hypercube sampling to generate initial samples; then, a clustering algorithm is used to perform sparsity filtering and representative extraction on the physically screened samples.
[0009] Preferably, step S3 further includes optimizing the hyperparameters of the artificial neural network using a genetic algorithm incorporating a long-tail mutation mechanism, specifically including the following steps: (1) Define the dual-indicator constraint optimization objective A fitness evaluation function is constructed, with the core optimization objective being the minimization of the mean square error of the validation set, and a coefficient of determination is introduced. R2 As a hard constraint threshold, solutions that do not meet the goodness-of-fit criteria are eliminated; (2) The long-tail variation mechanism of Cauchy distribution In the mutation operation, the Cauchy distribution is used instead of the standard Gaussian distribution to generate a variable-length asynchrony. This invention utilizes the mathematically significant long-tail property of the Cauchy distribution to generate large-scale perturbations in the later stages of population evolution, enabling the algorithm to escape local extremum traps in the complex non-convex solution space of wastewater treatment.
[0010] (3) Adaptive mapping of network structure The optimized hyperparameters are decoded and mapped to a topology of "double hidden layer + Dropout + L2 regularization", where the number of nodes in the first hidden layer is an explicit optimization variable, and the number of nodes in the second hidden layer is set through an adaptive decay strategy to construct a deep neural network resistant to overfitting.
[0011] Preferably, step S4 constructs a physical constraint fusion model based on the non-negative least squares method, and incorporates the LightGBM baseline prediction values. Compared with the full prediction value of ANN The weighted sum is used as the final predicted value; the optimal weights are determined by solving the following optimization problem with non-negativity constraints: ;
[0012] in To obtain the actual greenhouse gas emissions, the optimal non-negative weighting coefficients are calculated. The final greenhouse gas emission forecast is calculated using a weighted summation formula. The calculation yielded the result.
[0013] Compared with the prior art, the present invention has the following beneficial effects: This invention achieves a leap from "data fitting" to "physical perception": Unlike traditional models that only pursue fitting accuracy at the mathematical level, this invention constructs a dual-channel full-scale prediction architecture to ensure that the outputs of both the LightGBM and ANN sub-models have clear physical meaning (i.e., both are non-negative emissions); on this basis, a non-negative weight constraint mechanism (NNLS) is introduced into the model fusion layer, which guarantees from the algorithm principle that the final prediction result must be a non-negative linear combination of two physical effective values, completely eliminating logical errors that might be output by a purely data-driven model, such as "negative emissions," which violate the law of conservation of mass, and significantly improving the interpretability and engineering credibility of the model; This invention constructs a parallel fusion prediction system based on "heterogeneous complementarity": Unlike the traditional "trend + residual" serial patching structure, this invention leverages the advantages of LightGBM (based on tree structure) in capturing discrete rules and step features, and the advantages of ANN (based on weighted connections) in fitting continuous high-order nonlinearities. This allows both to independently predict greenhouse gas emissions, forming a complementary advantage. Finally, through adaptive weighted fusion, the model automatically tilts towards the better-performing sub-model when dealing with complex dynamic conditions such as fluctuating influent water quality and seasonal changes. Its prediction accuracy and robustness are significantly better than single models or simple average ensemble models. This invention introduces an enhanced genetic algorithm based on the Cauchy mutation mechanism: it effectively overcomes the problem that traditional algorithms are prone to getting trapped in local optima in the optimization of high-dimensional parameters in wastewater treatment. By leveraging the long-tail perturbation characteristics of the Cauchy distribution, it enhances the population's ability to escape, ensuring the global optimality of the ANN nonlinear prediction network topology and maximizing the function approximation potential of deep neural networks. Attached Figure Description
[0014] Figure 1 This is a flowchart illustrating the construction method of the wastewater greenhouse gas mixing proxy model of the present invention; Figure 2 This is a schematic diagram of the LightGBM-ANN dual-model fusion structure; Figure 3 This is a comparison chart of the prediction results of the surrogate model of this invention and the simulation results of BSM2; Figure 4 A graph illustrating the importance of input features based on LightGBM analysis; Figure 5 This is a graph showing the loss curves of each model during the training process. Detailed Implementation
[0015] To make the objectives, technical solutions, and advantages of this invention clearer, the preferred embodiments of this invention will be described in further detail below with reference to the examples. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.
[0016] A method for constructing a wastewater greenhouse gas mixing proxy model includes the following steps: S1. Obtain a physically valid simulation training dataset; This step aims to establish a training database that conforms to physical laws and is statistically representative: 1) Variable definition and data preparation: Constructing a municipal wastewater treatment process model using the BSM2 simulation platform: The influent dataset includes: biochemical oxygen demand (BOD), chemical oxygen demand (COD), total nitrogen, ammonia nitrogen, alkalinity, total suspended solids, influent flow rate, and temperature.
[0017] The manipulated variable dataset includes: oxygen transfer coefficient, dissolved oxygen concentration, carbon source dosage, excess sludge flow rate, internal and external circulation flow rates, and carbon source dosage for aerobic reactors No. 3, No. 4, and No. 5.
[0018] The output dataset includes: total greenhouse gas emissions (including...) , , and (total equivalent).
[0019] 2) Construct a t-Copula multidimensional correlation sampling space. Unlike independent random sampling, this embodiment first analyzes the historical statistical distribution characteristics of each influent variable and the manipulated variable. The tail nonlinear correlation structure between multidimensional variables is constructed using the t-Copula function to capture the coupled fluctuation characteristics of influent water quality under extreme conditions. Based on this correlation structure, an initial sample set was generated using Latin hypercube sampling (LHS). The initial sampling size was set to 100,000 groups to ensure that the samples covered multiple operating conditions of the wastewater treatment system, including low load, normal load, and high load.
[0020] 3) Process physical boundary constraint trimming: The initial sample set is filtered for physical validity, removing noisy samples that violate mass conservation or equipment operating limits, including: Constraints: Set the physical extreme values for each variable.
[0021] Solution: Remove samples that violate the constraints directly, and ensure that all retained samples are physically executable.
[0022] 4) Distribution Consistency Sparse Screening: In order to retain the richness of information while reducing the amount of data, this embodiment adopts the mini-batch mean drift clustering algorithm instead of the traditional K-means algorithm.
[0023] Screening process: The algorithm is used to divide the sample into feature spaces, identify dense and sparse regions of the sample, and combine the nearest neighbor algorithm to extract representative backbone samples, thus sparsifying 100,000 sets of original data into 5,000 sets of representative samples.
[0024] Feedback verification: The Kolmogorov-Smirnov test is introduced to calculate the difference in cumulative distribution function between the generated sparse sample set and the original working condition data. If the p-value is greater than the preset significance level of 0.05, it is considered that the sparse sample set retains the statistical topological structure of the original high-dimensional space, and the final simulation training dataset is output.
[0025] 5) Simulation execution: Input the selected 5,000 sets of samples into the BSM2 model for steady-state simulation (solver ode45, sampling interval 60 minutes). After running to steady state, collect the output data of each greenhouse gas to form the final "input-output" training pair.
[0026] S2: Constructing Feature Decoupling and Benchmark Regression Sub-models: 1) Data preprocessing: StandardScaler was used to standardize the input features, and the output labels were also standardized independently. The dataset was divided into training and test sets in an 8:2 ratio (random seed 42). 2) LightGBM Model Construction Parameter settings: n_estimators=300, learning_rate=0.05.
[0027] Feature decoupling: After training the model, features are ranked based on gain importance. The top 10 high-contribution features are selected as a subset of key features. A Pearson correlation heatmap is also plotted to help verify low collinearity among features. S3: Constructing a higher-order nonlinear complementary sub-model: This step constructs an ANN model as a nonlinear predictor parallel to LightGBM, leveraging its powerful function approximation ability to capture complex biochemical reaction fluctuations, and employs an enhanced genetic algorithm based on Cauchy mutation for hyperparameter optimization.
[0028] 1) Model target construction: The preprocessed real greenhouse gas emission values are directly used as the target output of the ANN. LightGBM focuses on tree-based rule extraction, while ANN focuses on weight-based nonlinear mapping. The two form a complementary full prediction for the same physical object; 2) Optimization of genetic algorithm based on Cauchy mutation: Perform 5-fold cross-validation within the training set to find the optimal ANN hyperparameters; Optimization variables: number of hidden layer nodes (8~128), learning rate (1e-4~1e-2), batch size (8~128), dropout rate (0.1~0.5), L2 regularization coefficient (1e-5~1e-2). Dual-index fitness function: The objective is to minimize the validation set MSE, while simultaneously using R... 2 A value greater than 0.9 is used as a hard constraint to eliminate suboptimal solutions. Cauchy mutation mechanism: In the mutation operation, the standard Gaussian distribution is abandoned, and a Cauchy distribution is used instead to generate variable-length arithmetic. By utilizing the long-tail property of the Cauchy distribution probability density function, the algorithm still has a probability of generating large parameter perturbations in the later stages of evolution, thereby escaping the local extremum trap; Typical variation rate: 0.15; Cauchy mutation strategy: Cauchy mutation is triggered when the population stagnates and the optimal fitness remains unchanged for 3 consecutive generations.
[0029] 1) The adaptive mapping of the ANN network structure maps the optimal hyperparameters to the following topology: Input layer: Receives the key features selected by S2; First hidden layer: The number of nodes is an optimized value, combined with ReLU activation and BatchNormalization; Dropout layer: The ratio is an optimized value; The second hidden layer uses an adaptive decay strategy to set the number of nodes to half that of the first layer to prevent overfitting. Output layer: Outputs the full predicted value of greenhouse gas emissions.
[0030] S4. Construct a physically constrained adaptive fusion metamodel 1) Physically Constrained Fusion Mechanism: In municipal wastewater treatment, greenhouse gas emissions are physically strictly limited by the law of conservation of mass, and negative values are impossible. Traditional unconstrained linear regression fusion may lead to negative weights due to overfitting, resulting in predictions that violate physical principles. To address the issue that linear regression might assign negative weights to another sub-model to offset over-predictions, this invention employs Non-Negative Least Squares (NNLS) to construct a meta-model. Input: LightGBM predictions The predicted value of ANN is .
[0031] Target: Real greenhouse gas emissions .
[0032] Constraint equations: ;
[0033] By forcing weights , The fact that the contribution of each sub-model to the final result is always non-negative ensures that the direction of contribution is consistent with the physical facts.
[0034] 2) Model Evaluation and Output: A full-indicator evaluation (R) is performed on the fused model. 2 The algorithm evaluates genetic algorithms (RMSE, MAE, RAAE) and outputs model files and visualizations (including genetic algorithm convergence curves, correlation heatmaps, etc.). S5. Reproducibility and Environmental Description The entire training process ensures that the results are repeatable by using a fixed random seed (42). Specifically, the Python built-in random number generator, NumPy random number generator, and TensorFlow random number generator all use the same random seed. The dataset partitioning (training / testing, CV partitioning within the training set, and final training / validation set partitioning) all use this random seed.
[0035] The model implementation environment is configured as follows: Python 3.9, TensorFlow 2.10, LightGBM 4.6, scientific computing libraries (NumPy 1.26, Pandas 2.1, Scikit-learn 1.3) and a custom genetic algorithm module; the input feature data and output gas data used for training and simulation are preprocessed based on the MATLAB 2022a platform, and the entire model training and prediction are implemented in the Python environment.
[0036] Table 1. 21 components in ASM1
[0037] Table 2. Stoichiometric parameters
[0038] Table 3. Reaction kinetic parameters
[0039] The embodiments described above are some, but not all, embodiments of the present invention. The detailed description of the embodiments of the present invention is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
Claims
1. A method for constructing a wastewater greenhouse gas mixing proxy model, characterized in that, Includes the following steps: S1. Use a wastewater treatment process simulation model to generate an input and output sample set containing influent water quality variables, process operation variables, and greenhouse gas emissions; introduce process operation limits as physical boundary conditions to screen the sample set for physical validity and remove invalid samples that violate the law of conservation of mass or equipment operating limits. S2, Training Feature Decoupling and Benchmark Regression Submodel A LightGBM model is constructed as a baseline predictor, and its histogram algorithm is used to filter and decouple high-dimensional input features based on their importance. S3. Constructing a high-order nonlinear complementary sub-model Using the key feature subset selected by S2, an artificial neural network (ANN) is constructed as a high-order nonlinear complementary predictor; the actual greenhouse gas emissions are used as the target value to train the artificial neural network to capture the deep nonlinear fluctuation patterns in the data that are difficult to be represented by the LightGBM benchmark model, and output the full prediction value of the ANN. S4. Construct a physically constrained adaptive fusion metamodel The non-negative least squares (NNLS) method is used to construct the fusion meta-model, and the baseline prediction value of LightGBM and the full prediction value of ANN are used as parallel physical prediction components as input. A non-negative weight constraint mechanism is introduced to force the weight coefficients of each sub-model to always be non-negative, ensuring that the final output is a non-negative linear combination of two prediction values that conform to physical laws.
2. The method for constructing the wastewater greenhouse gas mixing proxy model as described in claim 1, characterized in that, The influent water quality variables mentioned in step S1 include biochemical oxygen demand, chemical oxygen demand, total nitrogen, alkalinity, total suspended solids, influent flow rate, and temperature; the process operation variables include the oxygen transfer coefficient of the aerobic reactor, dissolved oxygen concentration, carbon source dosage, excess sludge flow rate, internal circulation flow rate, and external circulation flow rate.
3. The method for constructing the wastewater greenhouse gas mixing proxy model as described in claim 1, characterized in that, Step S1 involves using the Copula function to construct the tail nonlinear correlation structure between multidimensional variables and combining it with Latin hypercube sampling to generate initial samples; then, a clustering algorithm is used to perform sparsity screening and representative extraction on the physically screened samples.
4. The method for constructing the wastewater greenhouse gas mixing proxy model as described in claim 1, characterized in that, Step S3 also includes optimizing the hyperparameters of the artificial neural network using a genetic algorithm incorporating a long-tail mutation mechanism, specifically including the following steps: (1) Define the dual-indicator constraint optimization objective A fitness evaluation function is constructed, with the core optimization objective being the minimization of the mean square error of the validation set, and a coefficient of determination is introduced. R 2 As a hard constraint threshold, solutions that do not meet the goodness-of-fit criteria are eliminated; (2) The long-tail variation mechanism of Cauchy distribution In the mutation operation, the Cauchy distribution is used instead of the standard Gaussian distribution to generate the variable asynchronous length; (3) Adaptive mapping of network structure The optimized hyperparameters are decoded and mapped to a topology of "double hidden layer + Dropout + L2 regularization", where the number of nodes in the first hidden layer is an explicit optimization variable, and the number of nodes in the second hidden layer is set through an adaptive decay strategy to construct a deep neural network resistant to overfitting.
5. The method for constructing the wastewater greenhouse gas mixing proxy model as described in claim 1, characterized in that, Step S4 constructs a physical constraint fusion model based on the non-negative least squares method, and integrates the LightGBM benchmark predictions. Compared with the full prediction value of ANN The weighted sum is used as the final predicted value; The optimal weights are determined by solving the following optimization problem with non-negativity constraints: ; in To obtain the actual greenhouse gas emissions, the optimal non-negative weighting coefficients are calculated. The final greenhouse gas emission forecast is calculated using a weighted summation formula. The calculation yielded the result.
6. A wastewater greenhouse gas mixing proxy model, characterized in that, Obtained using any one of claims 1 to 5.