A method and system for evaluating ecological efficiency of a sewage treatment plant based on a fuzzy random forest efficiency evaluation tree
Patent Information
- Application Number
- CN202611117949.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-27
- Publication Date
- 2026-10-02
AI Technical Summary
[0011]本发明为克服现有技术中EAT和RFEAT方法因硬划分机制导致的前沿面阶跃失真问题,以及大规模异质性污水处理数据下全局建模对标失效的等问题
本发明所述的基于模糊随机森林效率评估树的污水处理厂生态效率评估方法以Sigmoid型模糊隶属度函数替代传统树模型的二元硬阈值分裂准则,将样本在分裂边界处的归属从"非左即右"的刚性决策重构为基于概率权重的软过渡,使拟合出的生态前沿面从传统方法的阶跃离散形态转变为连续平滑曲面,从根本上消除了硬边界引起的效率得分阶跃失真。
Smart Images

Figure CN122864904A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of environmental data analysis and wastewater treatment operation assessment technology, specifically to a method and system for assessing the ecological efficiency of wastewater treatment plants based on a fuzzy random forest efficiency assessment tree. Background Technology
[0002] As the global goal of carbon neutrality progresses, wastewater treatment plants, while achieving pollutant reduction and compliance, are also significant sources of greenhouse gas emissions. How to maximize pollutant removal efficiency while minimizing greenhouse gas emissions—that is, the accurate measurement of eco-efficiency—has become a core technological requirement for the wastewater treatment industry's low-carbon transformation.
[0003] Currently, the mainstream technical approaches used for wastewater treatment plant efficiency assessment both domestically and internationally mainly fall into the following three categories: (1) Traditional nonparametric front surface method.
[0004] Data Envelopment Analysis (DEA) and Free Disposal Hull (FDH) are the most widely used efficiency evaluation techniques. These two methods do not require pre-setting the specific form of the production function; they only need to follow the axioms of the disposability of inputs and outputs and the monotonicity of the frontier surface to construct an empirical production possibility frontier based on observed data. However, when the dimensionality of the input-output variables is too high relative to the evaluation sample size, the ability of FDH and DEA to distinguish the envelope of data points decreases sharply, and a large number of samples are incorrectly identified as frontier efficient units—the "curse of dimensionality" problem. At the same time, these methods lack filtering mechanisms for random noise and outliers in the data, making it very easy to misclassify samples affected by measurement errors as frontier optimal solutions, leading to a serious risk of overfitting.
[0005] (2) Tree-based efficiency frontier method.
[0006] To overcome the limitations of nonparametric methods, the Efficiency Analysis Trees (EAT) method embeds the recursive partitioning logic of classification and regression trees into a linear programming framework. While ensuring the flexibility of output disposal, it adaptively partitions the production space using a data-driven tree structure. Random Forest-EAT (RFEAT) further reduces model variance by constructing multiple independent EAT trees through a Bagging ensemble strategy and replacing the output of a single tree with aggregated predictions. However, both EAT and RFEAT methods are inherently limited by the hard partitioning mechanism of the tree model: when a node splits, the tree model uses a strict binary hard threshold to determine the path assignment of a sample—samples on either side of the split threshold are forcibly assigned to distinct subspaces, and their predicted values depend only on the single leaf node they ultimately fall into. This mechanism leads to the following technical drawbacks: Frontier step distortion: Hard boundary division forces similar water plants near the splitting critical point to be assigned to different frontier steps with huge differences in expected outputs due to only small fluctuations in influent indicators. This breaks the inherent continuity of the biochemical reaction in wastewater treatment and leads to systematic bias in efficiency scores. Critical region discrimination is unstable: within the neighborhood of the split threshold, the model's efficiency score is highly sensitive to small perturbations of the input variables and lacks the ability to explicitly model the uncertainty of sample attribution in the boundary transition region. Extreme value anchoring effect: In highly heterogeneous data scenarios, hard splitting strategies tend to anchor observations at extreme positions, constructing local boundary fragments that lack generalization ability, resulting in insufficient consistency of efficiency evaluation results when applied across scenarios.
[0007] (3) The shortcomings of existing technologies in the treatment of heterogeneous wastewater.
[0008] The daily treatment capacity of urban wastewater treatment plants in my country spans four orders of magnitude (10²–10²). 6 The main processes cover more than ten technical routes, and the emission standards vary significantly with regional climate conditions. Existing methods fit a single frontier on a global scale, which can easily mask the true performance of local water plants: micro-facilities are incorrectly anchored to the efficiency frontier due to their near-zero absolute input (the "pseudo-efficiency" phenomenon), while ultra-large facilities suffer unreasonable model penalties due to their excessively large emission base. This results in a lack of a fair and benchmarked scientific basis for efficiency assessments across scales and processes.
[0009] In summary, existing nonparametric methods (FDH, DEA) are limited by the curse of dimensionality and the risk of noise overfitting, making it difficult to maintain reliable discriminative power in high-dimensional variable spaces. Although the tree-based EAT method introduces data-driven recursive partitioning, its single tree structure and hard partitioning mechanism cause the frontier to exhibit a discontinuous step shape, leading to a systematic bias in efficiency scores in the critical splitting region. RFEAT reduces model variance through ensemble learning; however, its underlying structure still uses the traditional binary hard threshold splitting strategy of trees, failing to fundamentally solve the problem of step distortion on the frontier. Furthermore, it suffers from extreme value anchoring effects in highly heterogeneous data scenarios, causing the output sensitivity ranking to deviate from the biochemical dynamics mechanism of wastewater treatment.
[0010] To address the technical bottlenecks of the aforementioned methods, this invention proposes the Fuzzy-RFEAT method, which differs fundamentally from existing technologies in that: (1) The binary hard threshold splitting criterion of the traditional tree model is replaced by the Sigmoid fuzzy membership function, which reconstructs the rigid decision of "either left or right" at the splitting boundary of the sample into a soft transition based on probability weight, so that the fitted ecological frontier surface changes from the step discrete form of the traditional method to a continuous smooth surface, fundamentally eliminating the step distortion of efficiency score caused by hard boundary. (2) A non-recursive fuzzy roaming mechanism based on an explicit stack structure was established, which enables samples to traverse multiple paths in the tree in a weighted manner and aggregate multi-leaf node information. Compared with the traditional single-path deterministic prediction, it greatly improves the stability and anti-disturbance capability of the efficiency evaluation of the critical region. (3) A frontier translation correction mechanism is introduced to compensate for the local sinking of the reference surface that may be caused by fuzzy weighted averaging, ensuring that the envelope axiom of production economics is strictly satisfied while obtaining a continuous and smooth frontier. In addition, this invention uses consensus matrix clustering as a pre-module to robustly classify the large-scale heterogeneous wastewater treatment plant data before efficiency assessment, and constructs a homogeneous reference space for subsequent fuzzy frontier benchmarking. Thus, from a methodological perspective, a complete technical loop of "heterogeneity isolation - soft boundary frontier construction - efficiency measurement and sensitivity analysis" is realized, providing a complete technical solution for the accurate, robust and fair measurement of greenhouse gas ecoefficiency in the wastewater treatment industry. Summary of the Invention
[0011] This invention aims to overcome the problems of frontier step distortion caused by hard partitioning mechanisms in existing EAT and RFEAT methods, as well as the failure of global modeling benchmarking under large-scale heterogeneous wastewater treatment data. To this end, this invention proposes a wastewater treatment plant eco-efficiency assessment method and system based on a fuzzy random forest efficiency evaluation tree, achieving accurate, robust, and fair measurement of carbon efficiency for wastewater treatment plants of different sizes and process types. To solve the above-mentioned technical problems, this invention is implemented through the following technical solution: Option 1: This invention proposes a method for evaluating the ecological efficiency of wastewater treatment plants based on a fuzzy random forest efficiency evaluation tree. The method includes the following steps: Step 1: Obtain the operational data of the wastewater treatment plant to be evaluated, remove missing values and perform quality control on the operational data, and implement dual-track preprocessing to meet the differentiated needs of the cluster analysis stage and the efficiency evaluation stage, respectively generating a standardized feature matrix for cluster analysis and an input-output dataset for efficiency evaluation that retains the original physical dimensions. Step 2: Perform consensus matrix clustering analysis on the clustering analysis standardized feature matrix obtained in Step 1. Construct a consensus matrix through Monte Carlo resampling and determine the optimal number of clusters K by combining multiple quantitative criteria. Divide the original wastewater treatment plant dataset into K wastewater treatment plant subgroups with homogeneous operating characteristics. Step 3: Based on the efficiency evaluation dataset of the wastewater treatment plant subgroup obtained in Step 2, divide the efficiency evaluation dataset into a training set and a test set, and perform three-stage cascaded hyperparameter adaptive optimization on the EAT model, RFEAT model and Fuzzy-RFEAT model in turn to determine the optimal hyperparameter combination for each model. Step 4: Based on the optimal hyperparameter combination described in Step 3, construct the final EAT model, RFEAT model, and Fuzzy-RFEAT model for each subgroup. The construction of the Fuzzy-RFEAT model is achieved through the collaborative implementation of four subroutines: fuzzy weighted splitting criterion, fuzzy random forest ensemble, non-recursive fuzzy roaming prediction based on explicit stack, and frontier translation correction. This reconstructs the hard-boundary step frontier of the traditional tree model into a continuous and smooth ecological efficiency evaluation benchmark surface. Step 5: Using the smoothed frontier of the Fuzzy-RFEAT model constructed in Step 4 after translation correction as a reference, and combining the frontiers of the RFEAT and EAT models, construct and solve the input-oriented Banker-Charnes-Cooper linear programming model for each decision unit in each subgroup, and obtain the greenhouse gas eco-efficiency score of each wastewater treatment plant under different frontier references. Step 6: Based on the Fuzzy-RFEAT model and the fixed frontier of the RFEAT model that have been trained in Step 4, and the baseline efficiency score calculated in Step 5, perform an importance analysis of the output variables based on the efficiency score for each subgroup. Randomly shuffle the order of the observed values of each output variable and recalculate the efficiency score. Quantify the average absolute shift of the efficiency score caused by the perturbation of each output variable to obtain the carbon efficiency sensitivity ranking map of each output variable. Step 7: Summarize the analysis results from Steps 3 to 6, and simultaneously output the multi-dimensional comparative evaluation results of the four models FDH, EAT, RFEAT and Fuzzy-RFEAT for each operating phenotypic subgroup. This includes model fit index, efficiency score distribution characteristics, output sensitivity ranking map, optimal hyperparameter configuration and complete efficiency score data table, thus completing the comprehensive evaluation and output of the greenhouse gas eco-efficiency of the wastewater treatment plant.
[0012] Furthermore, a preferred embodiment is provided, wherein the dual-track preprocessing method in step 1, which addresses the differentiated needs of the cluster analysis stage and the efficiency evaluation stage, is as follows: The preprocessing steps in the cluster analysis stage include performing a logarithmic transformation on continuous skewed distribution variables to smooth the distribution, and performing Z-score standardization on all numerical variables to a mean of 0 and a standard deviation of 1; performing one-hot encoding on categorical variables to transform them into orthogonal binary sparse matrices. The preprocessing phase of the efficiency assessment includes retaining the original physical dimensions of input and output variables without standardization or logarithmic transformation.
[0013] Furthermore, a preferred embodiment is provided, wherein step 2 specifically includes the following steps: Step 2.1: Construct a multidimensional feature variable space for heterogeneous analysis by considering the treated water volume, the reduction load of various pollutants, the main treatment process category, the effluent discharge standard level, and the annual average temperature of the plant site. Perform logarithmic transformation on continuous skewed variables, perform one-hot encoding on categorical variables, and perform Z-score standardization on all numerical variables. Step 2.2: Perform N Monte Carlo resampling iterations, randomly selecting 70% of the samples each time for K-Means clustering, and constructing a consensus matrix M, where the element M(i,j) represents the probability that water plant i and water plant j are assigned to the same cluster in multiple resampling iterations. Step 2.3: By combining three complementary criteria—cumulative distribution function curve morphology test, fuzzy clustering ratio minimization, and average intra-cluster consensus score maximization—the optimal number of clusters K is determined, resulting in K subgroups of wastewater treatment plants with homogeneous operational characteristics.
[0014] Furthermore, a preferred implementation method is provided, wherein in step 3, the efficiency evaluation dataset is divided into a training set and a test set, and a three-stage cascaded hyperparameter adaptive optimization method is performed sequentially on the EAT model, the RFEAT model, and the Fuzzy-RFEAT model as follows: The EAT and RFEAT models were tuned using grid search cross-validation based on the training set. The hyperparameters to be tuned for the EAT model included the minimum number of leaf nodes and the maximum depth of the trees. The hyperparameters to be tuned for the RFEAT model included the minimum number of leaf nodes and the number of trees in the forest.
[0015] Furthermore, a preferred implementation method is provided, wherein in step 5, an input-oriented Banker-Charnes-Cooper linear programming model is constructed and solved for each decision unit within each subgroup to obtain the greenhouse gas ecoefficiency score of each wastewater treatment plant under different frontier benchmarks.
[0016]
[0017]
[0018] in The input-oriented efficiency score of the target water plant under the translational correction front; N is the total number of reference water plants participating in the construction of the global production possibility set; This represents the vector of actual GHG emissions and actual output of the target water plant. The actual input vector of the j-th water plant in the reference set; The final fuzzy theoretical maximum output vector of the j-th water plant in the reference set after front surface translation correction; is the convex combination weight coefficient of the j-th reference water plant, used to fit a smooth and continuous ecological efficiency evaluation benchmark surface in multidimensional space.
[0019] Furthermore, a preferred embodiment is provided, wherein the method for performing an importance analysis of output variables based on efficiency scores on each subgroup in step 6 is as follows: Step 6.1: Fix the front surface of the trained Fuzzy-RFEAT model and calculate the baseline carbon efficiency score for each water plant. Step 6.2: Randomly shuffle the order of the observations of each output variable across all water plants and recalculate the efficiency score after the disturbance. Step 6.3: Calculate the efficiency sensitivity score for each output variable.
[0020] Furthermore, a preferred embodiment is provided, wherein the method for calculating the efficiency sensitivity score of each output variable in step 6.3 is as follows:
[0021] in, Let r be the efficiency sensitivity score for the r-th output variable. The baseline carbon efficiency score for water plant i based on the original data; The perturbation efficiency score is obtained by randomly shuffling the values of the r-th output variable among all water plants. The number of valid samples is calculated for both the baseline and perturbation scores.
[0022] Option 2: A wastewater treatment plant ecological efficiency assessment system based on a fuzzy random forest efficiency assessment tree, the system including a storage device for executing the method and steps of claim 1.
[0023] Option 3: A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in Option 1.
[0024] Option 4: A computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes the method described in Option 1.
[0025] The advantages of this invention are: The wastewater treatment plant ecological efficiency assessment method based on fuzzy random forest efficiency assessment tree described in this invention replaces the binary hard threshold splitting criterion of the traditional tree model with a Sigmoid-type fuzzy membership function. It reconstructs the rigid decision of "either left or right" at the splitting boundary of the sample from a soft transition based on probability weights. This transforms the fitted ecological frontier from the step discrete form of the traditional method into a continuous smooth surface, fundamentally eliminating the step distortion of efficiency scores caused by hard boundaries.
[0026] The wastewater treatment plant ecological efficiency assessment method based on fuzzy random forest efficiency assessment tree described in this invention establishes a non-recursive fuzzy roaming mechanism based on an explicit stack structure, which enables samples to traverse multiple paths within the tree in a weighted manner and aggregate multi-leaf node information. Compared with the traditional deterministic prediction of a single path, this method significantly improves the stability and anti-disturbance capability of the efficiency assessment in the critical area.
[0027] The wastewater treatment plant eco-efficiency assessment method based on a fuzzy random forest efficiency evaluation tree, as described in this invention, introduces a frontier translation correction mechanism to compensate for the local sinking of the baseline that may be caused by fuzzy weighted averaging, ensuring that a continuous and smooth frontier is obtained while strictly satisfying the envelope axiom of production economics. Furthermore, this invention uses consensus matrix clustering as a pre-module to robustly classify the large-scale heterogeneous wastewater treatment plant data before efficiency assessment, constructing a homogeneous baseline space for subsequent fuzzy frontier benchmarking. This methodologically achieves a complete technical loop of "heterogeneity isolation—soft boundary frontier construction—efficiency measurement and sensitivity analysis," providing a comprehensive technical solution for the accurate, robust, and fair measurement of greenhouse gas eco-efficiency in the wastewater treatment industry.
[0028] The wastewater treatment plant eco-efficiency assessment method based on fuzzy random forest efficiency evaluation tree described in this invention further reduces the TestRMSE of Fuzzy-RFEAT by 63.6% compared to the traditional RFEAT method (from 1.36 × 10⁻⁶). 7 Reduced to 4.97×10 6 The MSE of the entire dataset achieved convergence by more than an order of magnitude (reducing from 3.85×10¹³ to 2.61×10¹²). Among all eight running phenotypic models, Fuzzy-RFEAT achieved the best fitting accuracy, verifying the consistent improvement effect of the fuzzy soft boundary strategy on the accuracy of front surface reconstruction.
[0029] In the wastewater treatment plant eco-efficiency assessment method based on fuzzy random forest efficiency evaluation tree described in this invention, the cross-cluster RMSE coefficient of Fuzzy-RFEAT (CV=0.50) was the lowest among the four models in the sensitivity test of the one-out method, significantly lower than RFEAT (0.55), FDH (0.96), and EAT (1.01), indicating that the soft boundary strategy has the highest cross-scenario predictability in response behavior to different data structures. Meanwhile, Fuzzy-RFEAT exhibits significant perturbation suppression ability in sparse or highly heterogeneous scenarios (C8: 0.031 vs. RFEAT's 0.044; C6: 0.033 vs. RFEAT's 0.055).
[0030] In the wastewater treatment plant eco-efficiency assessment method based on fuzzy random forest efficiency evaluation tree described in this invention, the traditional EAT model only considers 0.24% of the DMUs in the entire sample as valid, almost losing its ability to identify high-efficiency benchmark water plants. Although RFEAT recovers to 0.70%, its increased cross-cluster score variance reflects more the noise fluctuations within homogeneous clusters than the structured separation between heterogeneous clusters. In contrast, the Fuzzy-RFEAT output of this application shows a clear 2.11-fold difference between the lowest carbon efficiency micro-facility cluster (mean 0.078) and the second lowest (mean 0.164) clusters, the highest among the four models, reflecting the ideal distribution topology of "significant separation of inferior facilities and reasonable clustering of superior facilities".
[0031] This invention, Fuzzy-RFEAT, correctly identifies ammonia nitrogen removal (NH3-NR) as the primary sensitive variable—it directly couples aeration oxygen demand (AOD) with the N2O production flux in the nitrification-denitrification pathway, demonstrating a high degree of consistency with biochemical kinetics. In ultra-large hub clusters, Fuzzy-RFEAT reduces the highest / lowest sensitivity score ratio from 45.0 times that of RFEAT to 6.5 times, effectively filtering out the spurious anchoring effect of hard splitting models on extreme values in highly heterogeneous scenarios.
[0032] This invention, through the synergy of consensus clustering pre-module and Fuzzy-RFEAT output sensitivity analysis, reveals three structural types of carbon efficiency bottlenecks in my country's wastewater treatment system: physical pretreatment constraint type, single variable dominant type, and multi-variable synergistic constraint type. It provides a data-based quantitative decision-making benchmark for "classification-based policy making and targeted intervention" in the wastewater treatment industry toward carbon neutrality, avoiding the technical irrationality of a "one-size-fits-all" uniform emission reduction target.
[0033] This invention is also applicable to applications such as the accurate, robust, and fair measurement of carbon efficiency in wastewater treatment plants of different sizes and process types. Attached Figure Description
[0034] Figure 1 This is a flowchart illustrating the wastewater treatment plant ecological efficiency assessment method based on a fuzzy random forest efficiency assessment tree as described in Implementation Method 1.
[0035] Figure 2 This is a schematic diagram of the multidimensional quantitative evaluation based on consensus matrix clustering as described in Implementation Method 1. Figure 2 In the diagram, (a) shows the changes in the fuzzy clustering ratio and CLC score under different K values, (b) shows the changes in the cumulative distribution function of the consensus index, and (c) shows the heat map of the consensus matrix when the optimal value K=8.
[0036] Figure 3This is a schematic diagram comparing the prediction accuracy and global fitting performance of the tree-based algorithm models EAT, RFEAT, and Fuzzy-RFEAT described in Implementation Method 1.
[0037] Figure 3 In the figure, (a) represents the root mean square error of the test set, and (b) represents the root mean square error of the entire dataset.
[0038] Figure 4 This is a schematic diagram showing the score distribution of the four eco-efficiency analysis models for different clusters described in Implementation Method 1.
[0039] Figure 5 This is a schematic diagram of the output sensitivity spectrum of the Fuzzy-RFEAT model described in Implementation Method 1. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them.
[0041] Implementation Method 1, see [link] Figures 1 to 5 This embodiment describes a method for assessing the ecological efficiency of wastewater treatment plants based on a fuzzy random forest efficiency evaluation tree. The method includes the following steps: Step 1: Obtain the operational data of several wastewater treatment plants to be evaluated, remove missing values and perform quality control on the data, and implement dual-track preprocessing to meet the differentiated needs of the cluster analysis stage and the efficiency evaluation stage, respectively obtaining a standardized feature matrix suitable for cluster analysis and an efficiency evaluation input-output dataset that retains the original physical dimensions. Operational data from several wastewater treatment plants to be evaluated were obtained, including: greenhouse gas emissions (GHG), chemical oxygen demand removal (CODR), total nitrogen removal (TNR), ammonia nitrogen removal (NH3-NR), total phosphorus removal (TPR), suspended solids removal (SSR), biochemical oxygen demand removal (BODR), and wastewater treatment volume. Missing values were removed and quality control was performed on the operational data. GHG emissions were used as input variables, and the removal rates of various pollutants and wastewater treatment volume were used as output variables. During the efficiency assessment phase, the original physical units of input and output variables were strictly preserved without standardization or logarithmic transformation to ensure the physical meaning of the frontier and its realistic reference value for subsequent emission reduction targets.
[0042] Step 2: Perform consensus matrix clustering analysis on the clustering analysis standardized feature matrix obtained in Step 1. Construct a consensus matrix through Monte Carlo resampling and determine the optimal number of clusters K by combining multiple quantitative criteria. Divide the original wastewater treatment plant dataset into K wastewater treatment plant subgroups (operational phenotypes) with homogeneous operating characteristics, and construct a homogeneous benchmark space for subsequent efficiency assessment. To eliminate the size of wastewater treatment plants (span 10²–10²) 6 To mitigate the impact of system heterogeneity in the dimensions of m³ / d and main processes (more than 10 types) on the fairness of efficiency benchmarking, consensus matrix clustering is introduced as a pre-module before efficiency evaluation. This step includes: Step 2.1: Construct a multidimensional feature variable space for heterogeneous analysis by considering the treated water volume, the reduction load of various pollutants, the main treatment process category, the effluent discharge standard level, and the annual average temperature of the plant site. Perform logarithmic transformation on continuous skewed variables, perform one-hot encoding on categorical variables, and perform Z-score standardization on all numerical variables. Step 2.2: Perform N Monte Carlo resampling iterations (N≥50), and randomly select 70% of the samples each time to perform K-Means clustering, construct a consensus matrix M, where the element M(i,j) represents the probability that water plant i and water plant j are assigned to the same cluster in multiple resamplings; Step 2.3: Using three complementary criteria—cumulative distribution function (CDF) curve morphology test, fuzzy clustering proportion (PAC) minimization, and average intra-cluster consensus score (CLC) maximization—to determine the optimal number of clusters K, we obtain K wastewater treatment plant subgroups (operational phenotypes) with homogeneous operational characteristics.
[0043] Step 3: Based on the efficiency evaluation datasets of each subgroup of the running phenotype obtained in Step 2, divide the training set and test set proportionally, and perform three-stage cascaded hyperparameter adaptive optimization on the EAT model, RFEAT model and Fuzzy-RFEAT model in turn to determine the optimal hyperparameter combination of each model. Among them, the Fuzzy-RFEAT model further optimizes the fuzzy smoothing parameter β based on the optimal RFEAT hyperparameter combination. Perform the following hyperparameter tuning for each subgroup of running tables: S3.1. Divide the subgroup data into training and test sets proportionally, and perform grid search cross-validation to fine-tune the EAT and RFEAT models based on the training set. The hyperparameters to be tuned for the EAT model include the minimum number of leaf nodes (numStop) and the maximum tree depth (max.depth); the hyperparameters to be tuned for the RFEAT model include the minimum number of leaf nodes (numStop) and the number of trees in the forest (m). S3.2 Using the optimal numStop, m, and s_mtry obtained from RFEAT tuning as fixed parameters, perform grid search tuning on the fuzzy smoothing parameter β of the Fuzzy-RFEAT model. With the goal of minimizing the root mean square error of out-of-bag data (OOBRMSE), determine the optimal fuzzy smoothing parameter from the preset β candidate set, so that the model achieves the optimal balance between the smoothness of the boundary transition and the strictness of the envelope of the front surface.
[0044] Step 4: Using the optimal hyperparameter combinations of each model determined in step S3, construct the final EAT model, RFEAT model, and Fuzzy-RFEAT model for each subgroup. The construction of the Fuzzy-RFEAT model is achieved through the collaborative implementation of four subroutines: fuzzy weighted splitting criterion, fuzzy random forest ensemble, non-recursive fuzzy roaming prediction based on explicit stack, and frontier translation correction. This reconstructs the hard-boundary step frontier of the traditional tree model into a continuous and smooth ecological efficiency evaluation benchmark surface. For each subgroup of running phenotypes, the final EAT model, RFEAT model, and Fuzzy-RFEAT model are constructed using the optimal hyperparameter combination determined in step S3. The construction of the Fuzzy-RFEAT model includes the following sub-steps: Step 4.1, Fuzzy Weighted Splitting Criterion—During the growth of each fuzzy efficiency evaluation tree in Fuzzy-RFEAT, for candidate splitting features k and splitting thresholds s, a Sigmoid-type fuzzy membership function is introduced to calculate the membership weights of samples to the right and left child nodes:
[0045]
[0046] in, : The value of the current i-th sample on the candidate splitting feature k; The core smoothing parameter is used to control the steepness of soft boundaries; s: the candidate splitting threshold of the current tree node. The algorithm finds the optimal splitting threshold by minimizing the weighted fuzzy mean square error (MSE). :
[0047] Where, The optimal splitting threshold that minimizes the fuzzy weighted mean square error; : The total number of water plant samples contained in the current parent node t; The total number of output variables predicted by the model; : The true observed value of the i-th water plant on the r-th output variable; The left and right child nodes represent the local maximum expected output set to maintain free disposal. Step 4.2: Fuzzy Random Forest Ensemble – Using the Bagging strategy, m training subsets are randomly selected with replacement from the subgroup data, and m independent fuzzy efficiency evaluation trees are trained to form a fuzzy random forest. When a node splits, a subset of candidate split variables is randomly selected from all input variables to ensure the diversity of trees in the forest. Step 4.3: Fuzzy Roaming Prediction Mechanism – For the feature vector of the water plant to be evaluated, a non-recursive fuzzy roaming algorithm based on an explicit stack structure is used for prediction: the sample starts from the root node of each tree, and at the internal node, it simultaneously enters the left and right child nodes according to the Sigmoid fuzzy membership weights (instead of the single path of the traditional tree model). At the leaf node, the product of the local maximum expected output of the leaf node and the cumulative weight of the path is accumulated, and finally the weighted average output prediction of all m trees in the forest is obtained. This non-recursive roaming mechanism replaces the traditional recursive call with an explicit stack structure, eliminating the risk of C stack overflow under deep tree structure and improving the computational stability of the algorithm on large-scale datasets; Step 4.4: Front Surface Translation Correction – Because the fuzzy roaming mechanism weights and mixes the output levels of different leaf nodes, even if each leaf node maintains a local maximum output, the weighted average across leaf nodes may still cause the initial smoothed reference surface to be lower than the output level of the actual observed samples in some regions. Therefore, the initial predicted output vector is adjusted accordingly. Apply adaptive frontal plane translation correction:
[0048] Where yi is the actual output vector of the i-th water plant, and the correction measure is the maximum non-negative deviation between the actual and predicted values in each output dimension. This correction ensures that the corrected fuzzy frontier, while maintaining continuous nonlinear characteristics (soft boundary), is precisely calibrated to the true physical boundary that encompasses all actual observations, thus forming a strict upper bound for production.
[0049] Step 5: Using the smoothed frontier of the Fuzzy-RFEAT model constructed in Step 4 after translation correction as a reference, and combining the frontiers of the RFEAT and EAT models, construct and solve the input-oriented Banker-Charnes-Cooper linear programming model for each decision unit in each subgroup, and obtain the greenhouse gas eco-efficiency score of each wastewater treatment plant under different frontier references. Based on the final EAT, RFEAT, and Fuzzy-RFEAT models constructed in step 4, an input-oriented Banker-Charnes-Cooper linear programming model is used to solve for the efficiency score of each decision unit (DMU) within each subgroup. Taking the Fuzzy-RFEAT model as an example:
[0050]
[0051]
[0052] in : Input-oriented efficiency score of the target water plant under the translational correction front; N: Total number of reference water plants (DMUs) participating in the construction of the global production possibility set (PPS); The target water plant's actual GHG emissions (single input) and actual output vector (removal of seven pollutants and treated water volume); : The actual input vector of the j-th water plant in the reference set; The final fuzzy theoretical maximum output vector of the j-th water plant in the reference set after frontier translation calibration; : The convex combination multiplier of the j-th reference water plant This is used to fit a smooth and continuous benchmark surface for evaluating ecological efficiency in a multidimensional space. Constraints This ensures that the model is under the assumption of variable-scale returns (VRS).
[0053] Step 6: Based on the Fuzzy-RFEAT model and the fixed frontier of the RFEAT model that have been trained in Step 4, and the baseline efficiency score calculated in Step 5, perform an importance analysis of the output variables based on the efficiency score for each subgroup, randomly shuffle the order of the observed values of each output variable and re-solve the efficiency score, quantify the average absolute shift of the efficiency score caused by the perturbation of each output variable, and obtain the carbon efficiency sensitivity ranking map of each output variable. To quantify the marginal impact of each output indicator on carbon efficiency assessment, a ranking importance analysis based on efficiency scores was performed on each subgroup: Step 6.1: Fix the front surface of the trained Fuzzy-RFEAT model and calculate the baseline carbon efficiency score for each water plant. Step 6.2: Randomly shuffle the order of observations of each output variable across all water plants (i.e., disrupt the true pairing relationship between output and input variables) and recalculate the efficiency score after the disturbance. Step 6.3: Calculate the efficiency sensitivity score for each output variable using the following formula:
[0054] in, The efficiency sensitivity score for the r-th output variable is given. The larger the value, the more significant the impact of the measurement accuracy of this output dimension on the efficiency assessment results. The baseline carbon efficiency score for water plant i based on the raw data; The perturbation efficiency score is obtained by randomly shuffling the values of the r-th output variable among all water plants. Calculate the number of valid samples for both the baseline and perturbation scores (excluding samples where the LP solution failed).
[0055] Step 7: Summarize all the analysis results from Steps 3 to 6, and simultaneously output the multi-dimensional comparative evaluation results of the four models FDH, EAT, RFEAT and Fuzzy-RFEAT for each running subgroup. This includes model fit index, efficiency score distribution characteristics, output sensitivity ranking map, optimal hyperparameter configuration and complete efficiency score data table, thus completing the comprehensive evaluation and output of the greenhouse gas ecoefficiency of the wastewater treatment plant.
[0056] For each subgroup of running phenotypes, efficiency scores for four models—FDH, EAT, RFEAT, and Fuzzy-RFEAT—are calculated simultaneously, and the following results are output: Step 7.1: Comparison of goodness-of-fit metrics for each model, including root mean square error of the test set (Test RMSE) and root mean square error of the full dataset (Full Data MSE). Step 7.2: Distribution density plots and violin plots of the efficiency scores of the four models, visually demonstrating the differences in efficiency discriminative power and score distribution stability among the models; Step 7.3: Sensitivity ranking plot of each output variable to Fuzzy-RFEAT and RFEAT efficiency scores; Step 7.4: Summarize the optimal hyperparameter configurations, model evaluation indicators, and efficiency score data tables for each subgroup and all water plants.
[0057] Example 1: This embodiment provides an example to explain the above-described method for assessing the greenhouse gas eco-efficiency of a single-input, multi-output wastewater treatment plant. This embodiment uses 4,999 urban wastewater treatment plants in China as the evaluation objects, with greenhouse gas emissions (GHG) as the only input variable, and chemical oxygen demand removal (CODR), total nitrogen removal (TNR), and ammonia nitrogen removal (CNR) as the evaluation parameters. The invention uses seven indicators as output variables, including total phosphorus removal (TPR), suspended solids removal (SSR), biochemical oxygen demand removal (BODR), and wastewater treatment volume, to explain the complete implementation process of the invention in detail.
[0058] Step 1: Data Acquisition and Dual-Track Preprocessing Step 1.1: Obtain annual operational data for each wastewater treatment plant from the urban wastewater treatment management information system. Samples with missing values for core operational parameters are removed, and valid evaluation samples are retained after quality control.
[0059] Step 1.2: Implement a dual-track data preprocessing strategy, that is, use different preprocessing schemes for the cluster analysis stage and the efficiency evaluation stage: Cluster analysis preprocessing track: Logarithmic transformation is performed on continuous skewed distribution variables (such as water quality indicators such as COD and TN) to smooth the distribution. Then, all numerical variables are Z-score standardized to a mean of 0 and a standard deviation of 1. Categorical variables (treatment process category, emission standard level) are one-heat encoded and transformed into orthogonal binary sparse matrices.
[0060] Efficiency assessment pretreatment track: Strictly retain the original physical dimensions of input variables (GHG emissions, unit: kg CO2-eq / yr) and output variables (removal of various pollutants, unit: kg pollutant removed / yr), without standardization or logarithmic transformation, to ensure the physical interpretability of the frontier and the realistic reference value of subsequent emission reduction targets.
[0061] Step 2: Heterogeneity Isolation Based on Consensus Matrix Clustering Step 2.1: Combine the treated water volume, the reduction load of the six core pollutants, the main treatment process (after unique thermal coding), the tailwater discharge standard level (after unique thermal coding), and the annual average temperature of the plant site to construct a multidimensional feature matrix X∈R^{N×d} for heterogeneity analysis, where N is the total number of water plants and d is the feature dimension.
[0062] Step 2.2: Set the number of Monte Carlo resampling iterations to 50. In each iteration, perform the following operations: randomly select 70% of the samples from the entire dataset to form a subset, perform K-Means clustering on this subset, and record the cluster label of each sample. After the iteration is complete, construct the consensus matrix M∈R^{N×N}, where the element M(i,j) is calculated using the following formula:
[0063] Where N is the total number of Monte Carlo resampling iterations; It is a subset of samples randomly selected in the nth resampling iteration; These are the clustering labels assigned to WWTP i and j in the clustering results of the nth iteration; It is an indicator function. It takes the value 1 when the condition in parentheses is true, and 0 otherwise. The numerator represents the number of times the two WWTPs belong to the same cluster, and the denominator represents the number of times they were selected in the same resampling.
[0064] Step 2.3: Iterate through the candidate cluster numbers K from 2 to 15, and determine the optimal K value by combining the following three criteria: Cumulative Distribution Function (CDF) Curve Shape Verification: Plot the CDF curve of the consensus index for each K value. An ideal CDF curve shows a steep rise in the two extremes close to 0 and 1, and remains highly stable in the middle range, forming an "approximate step function" shape. Fuzzy clustering proportion (PAC) minimization: PAC values are calculated at strict thresholds [0,1] and lenient thresholds [0.1,0.9], respectively. The lower the PAC value, the clearer the cluster boundaries. Maximizing the average intra-cluster consensus score (CLC): This measures the mean of consensus among samples within each cluster. A higher CLC indicates stronger intra-cluster homogeneity.
[0065] The optimal number of clusters is K, which has the lowest PAC value and the highest CLC value. In this embodiment, K=8 is determined, corresponding to 8 significantly different operating phenotypes (Cluster1 to Cluster8).
[0066] Step 3: Three-stage cascaded hyperparameter adaptive optimization For each subgroup of running phenotypes obtained in step 2, they are randomly divided into training and testing sets in an 80%:20% ratio. Then, a three-stage cascaded hyperparameter tuning process is performed. Step 3.1: First stage, EAT hyperparameter grid search. Perform a full combinatorial grid search for the minimum number of leaf nodes numStop∈{10,30,50} and the maximum tree depth max.depth∈{4,5,7,10}. Combined with 5-fold cross-validation, determine the optimal (numStop, max.depth) EAT model based on minimizing the test set RMSE.
[0067] Step 3.2: Second stage, RFEAT hyperparameter grid search. Perform a full combinatorial grid search for the minimum number of leaf nodes numStop∈{10,30} and the number of trees in the forest m∈{30,50,100}. The candidate splitting variable selection strategy is fixed as the "BRM" mode (i.e., randomly select ceil(nX / 3) candidate input variables each time a node splits). The optimal (numStop, m, s_mtry) of the RFEAT model is determined based on minimizing the RMSE of the test set.
[0068] Step 3.3: Third Stage, Adaptive Optimization of Fuzzy Smoothing Parameter β. Using the optimal hyperparameter combination of RFEAT determined in the second stage (numStop, m, s_mtry) as the fixed parameters of the Fuzzy-RFEAT model, a grid search is performed on the fuzzy smoothing parameter β in the candidate set {0.1, 0.5, 1, 2, 5, 10, 50}. For each candidate value of β, a Fuzzy-RFEAT model is constructed based on the training data, and the root mean square error of the out-of-bag data (OOBRMSE) is calculated.
[0069] Where OOB(i) is the set of indices of trees that were not trained using the i-th sample. Let be the fuzzy prediction value of the r-th output variable for the i-th sample from the k-th tree. The β value that minimizes the OOBRMSE is chosen as the optimal fuzzy smoothing parameter β* for this subgroup.
[0070] Step 4: Construction of the Fuzzy-RFEAT Fuzzy Random Forest Efficiency Evaluation Tree Model Using the optimal hyperparameter combination (numStop, m, s_mtry, β) determined in step 3, the final Fuzzy-RFEAT model is constructed for this subgroup. The core subroutine for model construction is as follows: Subroutine 1: Weighted splitting evaluation function based on Sigmoid fuzzy membership (estimFuzzyEAT_safe) This function is the core module that distinguishes this invention from traditional EAT / RFEAT hard splitting. Its inputs include: current node data (data), parent node (t), candidate splitting feature name (xi_name), candidate splitting threshold (s), all output variable names (y_names), and fuzzy smoothing parameter (β). The function's processing flow is as follows: (a) Filter samples within the current node based on the parent node index: index_logic ← data ∈ t_index; (b) The samples are divided into two groups according to the traditional hard boundary partitioning method: the left group consists of samples with feature values less than the splitting threshold s, and the right group consists of samples with feature values greater than or equal to the splitting threshold s. (c) If the number of samples on either side is zero, then the error on both sides is returned as infinite (Inf) to avoid invalid splits; (d) If there are samples on both sides, then perform the following fuzzy error calculation: Calculate the maximum value of each output variable on both the left and right sides, and use it as the local maximum expected output vector on both sides. and —This maximum value operation guarantees the axiom of free disposal in production economics; For each sample i within the parent node, based on its value x_i on the candidate splitting feature, the fuzzy membership weight w_R(i) and the left-side weight w_L(i) belonging to the right child node are calculated using the Sigmoid function:
[0071]
[0072] Calculate the fuzzy weighted mean square error:
[0073]
[0074] Where N_total is the total number of samples in the entire dataset, and nY is the number of output variables; (e) Return the left and right child nodes and their corresponding fuzzy weighted errors R_L and R_R.
[0075] The key technical feature of this subroutine is that the assignment of samples near the split threshold is no longer a hard binary decision of "either left or right," but rather a probability weight that continuously decays according to the Sigmoid function. When β→∞, the Sigmoid function degenerates into a step function, and this method degenerates into the hard splitting mode of traditional RFEAT; when β takes a finite positive value, samples near the split threshold contribute to the error calculation on both sides with a smooth transition weight, thereby fitting a continuous and smooth frontier.
[0076] Subroutine 2: Non-recursive fuzzy walk prediction function based on explicit stack (fuzzy_walk_internal) Traditional tree prediction uses recursive traversal, which may trigger a call stack overflow when the tree depth is large. This invention establishes a non-recursive fuzzy roaming algorithm based on an explicit stack structure, completely eliminating this risk. The function input includes: a single fuzzy efficiency evaluation tree (tree), the root node position index (t_idx), the feature row vector of the sample to be predicted (row_data), and the fuzzy smoothing parameter (β). The processing flow is as follows: (a) Initialize an empty stack and push the root node and its cumulative weight 1.0 as the first element onto the stack: stack ← [(idx=1,w=1.0)]; (b) Initialize the prediction result vector result to be empty (NULL); (c) While the stack is not empty, execute the following loop: Pop the top element of the stack, and get the current node position idx and the current cumulative weight w_accum; Get the current node t_node ← tree[[idx]]; If the node is a leaf node (SL==-1), then multiply its local maximum expected output vector by the cumulative weight and add it to result: result←result+w_accum×t_node_y; If the node is an internal node (SL≠-1), then: Obtain the split feature index xi_idx and the split threshold split_val; Extract the value x_val of this feature from the sample to be predicted; Calculate the fuzzy membership weights: w_R←1 / (1+exp(-β×(x_val-split_val))), w_L←1-w_R; Push the right child node and its accumulated weight (w_accum×w_R) onto the stack; Push the left child node and its accumulated weight (w_accum×w_L) onto the stack; (d) After the loop ends, return result as the fuzzy weighted prediction output vector of the sample on this single tree.
[0077] The key technical features of this subroutine are: (1) It uses an explicit stack structure to replace recursive calls, which eliminates the risk of C language call stack overflow when dealing with large-scale datasets and deep tree structures; (2) The sample roams along all possible paths of the tree at the same time, and the final predicted value is a fuzzy weighted mixture of leaf nodes of multiple paths, rather than a definite value of a single path - this is the core mechanism for realizing a soft boundary continuous frontier.
[0078] Subroutine 3: Growth function for a single fuzzy efficiency evaluation tree (Fuzzy_RandomforestEAT_Internal) This function constructs a complete fuzzy efficiency evaluation tree. The inputs include: training data (data), input variable name vectors (x_names), output variable name vectors (y_names), minimum number of samples per leaf node (numStop), candidate splitting variable selection strategy (s_mtry), and fuzzy smoothing parameter (β). The processing flow is as follows: (a) Initialize the root node: Assign the index of all training samples to the root node, calculate the maximum value of each output variable of the whole sample as the expected output of the root node, and add the root node to the tree list tree and the leaf node queue to be split. (b) While the leaves queue is not empty, execute the following loop: Retrieve the current node to be split, t, from the head of the queue and obtain its node index position, curr_idx; If the number of samples in the node is less than numStop, skip (do not split) and continue to the next round of the loop; The number of candidate input variables mtry_val for this split is determined according to the s_mtry strategy, and mtry_val effective variables with a standard deviation greater than zero are randomly selected from all input variables to form a candidate set arrayK; For each candidate variable xi in arrayK, iterate through all its unique values in the sample of that node as candidate splitting thresholds s_val (excluding the minimum value), and call subroutine 1 (estimFuzzyEAT_safe) to calculate the sum of fuzzy weighted errors (tL_R+tR_R) corresponding to the (xi,s_val) combination. The optimal fuzzy splitting scheme for a node is selected as (xi*, s*) that minimizes the sum of fuzzy weighted errors. Add the left and right child nodes to the tree list and the leaves queue respectively, record the position index of the child node in the tree list (SL_pos and SR_pos), and set the left and right child node identifiers of the parent node (SL=1, SR=1). (c) Return the completed fuzzy efficiency evaluation tree.
[0079] The key technical features of this subroutine are: it adopts "native s_mtry logic" - which is completely aligned with the candidate variable selection strategy of traditional RFEAT (supporting five predefined modes, BRM, DEA1, DEA2, DEA3, and DEA4, as well as arbitrary integer values), ensuring that the tree growth process after fuzzy transformation is fully compatible with traditional methods at the variable sampling level, so that the gain of fuzzy logic can be attributed and quantitatively evaluated separately.
[0080] Subroutine 4: Fuzzy Random Forest Ensemble and OOB Error Calculation Function (Fuzzy_RFEAT) This function constructs a fuzzy random forest containing m fuzzy efficiency evaluation trees. The inputs include: data, input variable index (x), output variable index (y), minimum number of samples per leaf node (numStop), forest size (m), candidate splitting variable selection strategy (s_mtry), and fuzzy smoothing parameter (β). The processing flow is as follows: (a) Data preprocessing: Call the preProcess function to perform necessary format conversions on the data and assign a unique identifier id (1 to N) to each record. (b) Forest building phase—for k cycling from 1 to m: The Bagging (Boot Strap Aggregating) strategy is adopted to randomly select N samples with replacement from N samples to form the training set df_train of the k-th tree. The samples that are not selected are automatically formed into the out-of-bag test set (OOBset) of the tree. Record the out-of-bag indicator vector forestArray[[k]]∈{0,1}^N, where a value of 1 indicates that the i-th sample did not participate in the training of the k-th tree (i.e., it belongs to the out-of-bag sample), and a value of 0 indicates that it participated in the training; Call subroutine 3 (Fuzzy_RandomforestEAT_Internal) to train the k-th fuzzy efficiency evaluation tree using df_train and save it to forest[[k]]. (c) OOB error calculation stage – looping from 1 to N for each sample i: Collect the predicted values of all trees whose samples i are outside the bag (i.e., all trees k that satisfy forestArray[[k]][i]==1); For each tree that meets the conditions, subroutine 2 (fuzzy_walk_internal) is called to perform fuzzy walk prediction; Calculate the mean of the predictions from these trees as the OOB prediction output vector for sample i. ; Sum the squared prediction errors of this sample across all output variables: err←
[0081] (d) Final OOB mean square error: error ← err / N; (e) Encapsulation Return: Construct a Fuzzy_RFEAT model object containing a list of forests, an OOB error, and a list of control parameters (control={beta,m,s_mtry}), and label it as "Fuzzy_RFEAT" to ensure compatibility with the interface of downstream analysis functions.
[0082] Subroutine 5: Efficiency Solution of Front Surface Translation Correction and Input-Oriented Linear Programming Since the essence of the fuzzy roaming mechanism in subroutine 4 is to weight and mix the local maximum expected outputs of different leaf nodes according to the fuzzy membership weights, even if the maximum output value of the sample envelope is strictly taken within each leaf node to maintain local discretion, the weighted averaging operation across leaf nodes may still introduce a certain degree of smoothing attenuation effect—that is, the output prediction value of the initially generated smoothed reference surface in some regions may be lower than the actual output level of some actual observed samples in that region, resulting in "local sinking" of the frontier. Under the strict framework of operations research frontier analysis, the production possibility set must satisfy the boundary envelope axiom, that is, all actual observed samples must be located below the frontier or exactly on the frontier, and no sample is allowed to "penetrate" the frontier and become an inefficient outlier. Therefore, this invention establishes the following two-step post-processing flow to eliminate the envelope bias that may be introduced by fuzzy smoothing.
[0083] The first step is frontier shifting and correction. For all N wastewater treatment plant samples within each subgroup, a pre-trained Fuzzy-RFEAT forest is used to predict the initial expected output vector (i.e., the weighted average predicted value of each output dimension) under the current fuzzy frontier. Then, each output dimension (e.g., seven indicators such as CODR, TNR, and NH3-NR) is checked one by one: the difference between the actual observed value and the corresponding initial predicted value of all N wastewater treatment plants in that output dimension is calculated, and the largest non-negative value among all differences is taken (if all differences are negative—that is, all predicted values are higher than the actual values—the correction amount is zero). Finally, the initial predicted value of each wastewater treatment plant in each output dimension is uniformly shifted upwards by the corresponding correction amount of that dimension to obtain the final fuzzy frontier output value after shifting and correction. After this translation operation, the corrected smooth frontier surface, while maintaining the continuous nonlinear characteristics (i.e., "soft boundary") imparted by fuzzy wandering, is lifted upwards to precisely encompass the true physical boundary of all actual observation samples, ensuring that it constitutes a strict upper production bound without altering the shape and relative structure of the frontier surface. The physical meaning of this correction operation can be understood as follows: the smoothing bias caused by fuzzy weighted averaging is a systematic global translation bias (rather than a local distortion), therefore it can be completely compensated for by independently applying a consistent upward translation to each output dimension without destroying the methodological gain of the fuzzy soft boundary in terms of the continuity of the frontier surface morphology.
[0084] The second step is to solve the efficiency problem of input-oriented linear programming. Using the smoothed frontier obtained from the translation correction in the first step as a reference, the greenhouse gas eco-efficiency score is solved for each decision unit (i.e., each wastewater treatment plant) within this subgroup. Specifically, for the target plant, an input-oriented Banker-Charnes-Cooper linear programming problem is constructed. The optimization objective of this problem is to minimize the proportional reduction coefficient θ (i.e., the efficiency score) of greenhouse gas emissions. Its constraints include three levels: the first level is the input constraint, requiring that the greenhouse gas emissions of the target plant after proportional reduction θ are not lower than the emission level achievable by the reference plant set through a convex combination; the second level is the output constraint, requiring that the reference plant set, through a convex combination, achieves emissions of no less than the actual output level of the target plant in terms of pollutant removal and treated water volume; the third level is the convexity constraint, requiring that the sum of the convex combination weights of the reference plants equals 1, to ensure that the model operates under the assumption of variable returns to scale and adapts to the technological heterogeneity of water plants of different sizes. The economic meaning of this linear programming problem is: to find the maximum feasible proportional reduction in the greenhouse gas emissions (input) of the water plant while ensuring that the output of various pollutant removal services is not reduced. When the solution is successful, the optimal value θ of the objective function is the input-oriented carbon efficiency score of the water plant (ranging from 0 to 1, with values closer to 1 indicating higher carbon efficiency; θ=1 indicates that the water plant is on the optimal frontier). If the linear programming problem fails to be solved (e.g., due to numerical issues resulting in no feasible solution), the efficiency score of the water plant is marked as a missing value and is not included in subsequent statistical analysis. This embodiment uses the lpSolveAPI solver to perform the above linear programming problem.
[0085] Step 5: Importance analysis of output variables ranked according to efficiency scores To analyze the marginal impact of various output indicators on carbon efficiency assessment, this invention establishes a ranking importance assessment method based on efficiency scores. Unlike the standard practice in traditional random forests that assesses feature importance by perturbing input features and measuring changes in predicted MSE, the core feature of this method is that it keeps the frontier of the trained model fixed and only perturbs the pairing relationships of observed output variables. The specific process is as follows: Step 5.1: Calculate the baseline efficiency score. Using the Fuzzy-RFEAT model constructed in step S4 and the linear programming solution in subroutine 5, obtain the baseline carbon efficiency score vectors for all N samples under the current frontier. .
[0086] Step 5.2: For each output variable r (r=1,...,nY), perform the following operations: Create a perturbation dataset: Keep the original observations of the input variables and all other output variables unchanged, and only randomly rearrange the N observations of the r-th output variable among all samples (permutation), that is, destroy the true pairing relationship between the output variable and the input variable; Using the same fixed leading edge surface (i.e., the same group) in step 4 (Reference value), resolve the linear programming problem on the perturbed dataset to obtain the perturbation efficiency score vector. ; Calculate the efficiency sensitivity score of the r-th output variable:
[0087] in, The efficiency sensitivity score for the r-th output variable is given. The larger the value, the more significant the impact of the measurement accuracy of this output dimension on the efficiency assessment results. The baseline carbon efficiency score for water plant i based on the raw data; The perturbation efficiency score is obtained by randomly shuffling the values of the r-th output variable among all water plants. Calculate the number of valid samples for both the baseline and perturbation scores (excluding samples where the LP solution failed).
[0088] Step 5.3: Sort each output variable in descending order of I_r value. The larger the I_r value, the more significant the impact of the measurement accuracy and value change of the output dimension on the efficiency assessment results, which constitutes the "sensitive bottleneck" dimension of carbon efficiency measurement.
[0089] Step 6: Multi-model comparison and result output Step 6.1: For each running phenotypic subgroup, simultaneously construct three benchmark models: FDH, EAT, and RFEAT. Calculate the test set RMSE and full dataset MSE of each model and perform a quantitative comparison with Fuzzy-RFEAT.
[0090] Step 6.2: Output the efficiency score distribution density map for each model to visually demonstrate the structural differences in efficiency discriminative power among the models.
[0091] Step 6.3: Draw a comparison chart of the output sensitivity ranking of the Fuzzy-RFEAT and RFEAT models to verify the structural advantages of the fuzzy soft boundary strategy at the mechanism discrimination level.
[0092] Step 6.4: Summarize the optimal hyperparameter configuration table (Best_Params_Summary) for each subgroup, the efficiency score comparison table for all models (All_Models_Comparison), and the model evaluation metric summary table (Model_Evaluation_Metrics), and output the complete evaluation results in spreadsheet format.
[0093] Example 2: Evaluation of the operational efficiency of a wastewater treatment plant with high input and high output (Extended implementation method) This embodiment demonstrates the applicability of the method of the present invention under input-output configurations different from those of Embodiment 1. Unlike Embodiment 1, which uses a single greenhouse gas emission as an input variable, this embodiment employs a broader multi-input variable configuration, for example, using multiple indicators such as greenhouse gas emissions, energy consumption, and chemical reagent consumption as input variables, and using the removal of multiple pollutants as output variables.
[0094] The difference between this embodiment and Embodiment 1 lies in the setting of input variables in step 1: The input variables are expanded to multiple (nX>1), including but not limited to greenhouse gas emissions, electricity consumption, and pesticide consumption; The quantity and combination of output variables can be adjusted accordingly.
[0095] The remaining steps 2 through 6 are consistent with those in Example 1. The key technical adaptability of this example lies in the fact that the candidate splitting variable selection strategy (s_mtry) in subroutine 1 (estimFuzzyEAT_safe) and subroutine 3 (Fuzzy_RandomforestEAT_Internal) will automatically adjust according to the increase in the number of input variables—for example, when s_mtry="DEA3", mtry_val will automatically take the value nX+nY to adapt to a higher-dimensional variable space. The constraints of the input-oriented linear programming (subroutine 5) will be automatically expanded to a proportional reduction of the multidimensional inputs.
[0096] This embodiment demonstrates the universality of the method of the present invention for different input-output variable configurations, and its fuzzy soft boundary strategy and consensus clustering heterogeneity isolation mechanism do not depend on a specific number or combination of variables.
[0097] The computer program described in this embodiment is written in R (version ≥ 4.0) and depends on the following publicly available extension packages: lpSolveAPI (linear programming solver), openxlsx (spreadsheet reader / writer), ggplot2 (scientific visualization), dplyr (data processing), and readxl (data retrieval). The consensus matrix clustering module is written in Python (version ≥ 3.9) and depends on the Scikit-learn and SciPy libraries. All of the above software environments can be deployed on general-purpose computers equipped with Windows, Linux, or macOS operating systems, without requiring dedicated hardware support.
[0098] Those skilled in the art will understand that the above description is merely a preferred embodiment of the present invention, and the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. This is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0099] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention. Clearly, those skilled in the art can make various alterations and modifications to the invention without departing from its spirit and scope. Thus, if these modifications and modifications of the invention fall within the scope of the claims and their equivalents, the invention is also intended to include these modifications and modifications.
Claims
1. A method for evaluating the ecological efficiency of wastewater treatment plants based on a fuzzy random forest efficiency evaluation tree, characterized in that, The method includes the following steps: Step 1: Obtain the operational data of the wastewater treatment plant to be evaluated, remove missing values and perform quality control on the operational data, and implement dual-track preprocessing to meet the differentiated needs of the cluster analysis stage and the efficiency evaluation stage, respectively generating a standardized feature matrix for cluster analysis and an input-output dataset for efficiency evaluation that retains the original physical dimensions. Step 2: Perform consensus matrix clustering analysis on the clustering analysis standardized feature matrix obtained in Step 1. Construct a consensus matrix through Monte Carlo resampling and determine the optimal number of clusters K by combining multiple quantitative criteria. Divide the original wastewater treatment plant dataset into K wastewater treatment plant subgroups with homogeneous operating characteristics. Step 3: Based on the efficiency evaluation dataset of the wastewater treatment plant subgroup obtained in Step 2, divide the efficiency evaluation dataset into a training set and a test set, and perform three-stage cascaded hyperparameter adaptive optimization on the EAT model, RFEAT model and Fuzzy-RFEAT model in turn to determine the optimal hyperparameter combination for each model. Step 4: Based on the optimal hyperparameter combination described in Step 3, construct the final EAT model, RFEAT model, and Fuzzy-RFEAT model for each subgroup. The construction of the Fuzzy-RFEAT model is achieved through the collaborative implementation of four subroutines: fuzzy weighted splitting criterion, fuzzy random forest ensemble, non-recursive fuzzy roaming prediction based on explicit stack, and frontier translation correction. This reconstructs the hard-boundary step frontier of the traditional tree model into a continuous and smooth ecological efficiency evaluation benchmark surface. Step 5: Using the smoothed frontier of the Fuzzy-RFEAT model constructed in Step 4 after translation correction as a reference, and combining the frontiers of the RFEAT and EAT models, construct and solve the input-oriented Banker-Charnes-Cooper linear programming model for each decision unit in each subgroup, and obtain the greenhouse gas eco-efficiency score of each wastewater treatment plant under different frontier references. Step 6: Based on the Fuzzy-RFEAT model and the fixed frontier of the RFEAT model that have been trained in Step 4, and the baseline efficiency score calculated in Step 5, perform an importance analysis of the output variables based on the efficiency score for each subgroup. Randomly shuffle the order of the observed values of each output variable and recalculate the efficiency score. Quantify the average absolute shift of the efficiency score caused by the perturbation of each output variable to obtain the carbon efficiency sensitivity ranking map of each output variable. Step 7: Summarize the analysis results from Steps 3 to 6, and simultaneously output the multi-dimensional comparative evaluation results of the four models FDH, EAT, RFEAT and Fuzzy-RFEAT for each operating phenotypic subgroup. This includes model fit index, efficiency score distribution characteristics, output sensitivity ranking map, optimal hyperparameter configuration and complete efficiency score data table, thus completing the comprehensive evaluation and output of the greenhouse gas eco-efficiency of the wastewater treatment plant.
2. The method for assessing the ecological efficiency of wastewater treatment plants based on a fuzzy random forest efficiency evaluation tree according to claim 1, characterized in that, The dual-track preprocessing method implemented in step 1 to address the differentiated needs of the cluster analysis and efficiency evaluation stages is as follows: The preprocessing steps in the cluster analysis stage include performing a logarithmic transformation on continuous skewed distribution variables to smooth the distribution, and performing Z-score standardization on all numerical variables to a mean of 0 and a standard deviation of 1. The categorical variables are one-hot encoded and transformed into orthogonal binary sparse matrices; The preprocessing phase of the efficiency assessment includes retaining the original physical dimensions of input and output variables without standardization or logarithmic transformation.
3. The method for assessing the ecological efficiency of wastewater treatment plants based on a fuzzy random forest efficiency evaluation tree according to claim 1, characterized in that, Step 2 specifically includes the following steps: Step 2.1: Construct a multidimensional feature variable space for heterogeneous analysis by considering the treated water volume, the reduction load of various pollutants, the main treatment process category, the effluent discharge standard level, and the annual average temperature of the plant site. Perform logarithmic transformation on continuous skewed variables, perform one-hot encoding on categorical variables, and perform Z-score standardization on all numerical variables. Step 2.2: Perform N Monte Carlo resampling iterations, randomly selecting 70% of the samples each time for K-Means clustering, and constructing a consensus matrix M, where the element M(i,j) represents the probability that water plant i and water plant j are assigned to the same cluster in multiple resampling iterations. Step 2.3: By combining three complementary criteria—cumulative distribution function curve morphology test, fuzzy clustering ratio minimization, and average intra-cluster consensus score maximization—the optimal number of clusters K is determined, resulting in K subgroups of wastewater treatment plants with homogeneous operational characteristics.
4. The method for assessing the ecological efficiency of wastewater treatment plants based on a fuzzy random forest efficiency evaluation tree according to claim 1, characterized in that, In step 3, the efficiency evaluation dataset is divided into a training set and a test set. The three-stage cascaded hyperparameter adaptive optimization method is then applied to the EAT model, RFEAT model, and Fuzzy-RFEAT model in sequence as follows: The EAT and RFEAT models were tuned using grid search cross-validation based on the training set. The hyperparameters to be tuned for the EAT model included the minimum number of leaf nodes and the maximum depth of the trees. The hyperparameters to be tuned for the RFEAT model included the minimum number of leaf nodes and the number of trees in the forest.
5. The method for assessing the ecological efficiency of wastewater treatment plants based on a fuzzy random forest efficiency evaluation tree according to claim 1, characterized in that, In step 5, the method for constructing and solving an input-oriented Banker-Charnes-Cooper linear programming model for each decision unit within each subgroup to obtain the greenhouse gas ecoefficiency score of each wastewater treatment plant under different frontier benchmarks is as follows: in The input-oriented efficiency score of the target water plant under the translational correction front surface; N represents the total number of reference water plants participating in the construction of the global production possibility set; This represents the vector of actual GHG emissions and actual output of the target water plant. The actual input vector of the j-th water plant in the reference set; The final fuzzy theoretical maximum output vector of the j-th water plant in the reference set after front surface translation correction; is the convex combination weight coefficient of the j-th reference water plant, used to fit a smooth and continuous ecological efficiency evaluation benchmark surface in multidimensional space.
6. The method for evaluating the ecological efficiency of wastewater treatment plants based on a fuzzy random forest efficiency evaluation tree according to claim 1, characterized in that, The method described in step 6 for performing an importance analysis of output variables based on efficiency scores on each subgroup is as follows: Step 6.1: Fix the front surface of the trained Fuzzy-RFEAT model and calculate the baseline carbon efficiency score for each water plant. Step 6.2: Randomly shuffle the order of the observations of each output variable across all water plants and recalculate the efficiency score after the disturbance. Step 6.3: Calculate the efficiency sensitivity score for each output variable.
7. The method for assessing the ecological efficiency of wastewater treatment plants based on a fuzzy random forest efficiency evaluation tree according to claim 5, characterized in that, The method for calculating the efficiency sensitivity scores of each output variable in step 6.3 is as follows: in, Let r be the efficiency sensitivity score for the r-th output variable. The baseline carbon efficiency score for water plant i based on the raw data; The perturbation efficiency score is obtained by randomly shuffling the values of the r-th output variable among all water plants. The number of valid samples is calculated for both the baseline and perturbation scores.
8. A wastewater treatment plant ecological efficiency assessment system based on a fuzzy random forest efficiency assessment tree, characterized in that, The system includes a storage device for performing the method and steps of claim 1.
9. A computer storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-7.
10. A computer device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the method of any one of claims 1-7.