Method and device for predicting energy intensity of sewage treatment plant, equipment and medium

Embedding domain knowledge into the energy intensity prediction of sewage treatment plants through a variable cross-layer machine learning model solves the problems of model complexity and poor interpretability in the existing technology, and achieves more efficient energy intensity prediction and management support.

CN118761541AInactive Publication Date: 2024-10-11FUJIAN HAIXIA ENVIRONMENTAL PROTECTION GRP +1

Patent Information

Application Number
CN202410745766.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-10-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing wastewater treatment plants lack effective energy intensity prediction models. Traditional mechanism models rely on complex parameters and are difficult to interpret. Data-driven models are difficult to directly connect biochemical processes and energy consumption due to high computational resource consumption and poor interpretability.

Method used

The variable cross-layer machine learning model (VCL-ML) is used to obtain and preprocess data, create new features and embed domain knowledge, and combine it with the machine learning model to build a model that can predict the energy intensity of sewage treatment plants.

Benefits of technology

It improves the accuracy and interpretability of the model, identifies key factors affecting energy consumption, reduces the computational resource requirements of the model, and enhances the understanding of energy consumption in sewage treatment plants and management decision support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118761541A_ABST
    Figure CN118761541A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a sewage treatment plant energy intensity prediction method and device, equipment and a storage medium. According to the method, a machine learning (ML) model with a variable cross layer (VCL) architecture is designed, the VCL performs knowledge creation by using known monitoring indexes (such as chemical oxygen demand and the like), and the knowledge is embedded into the input of the machine learning model to predict the energy intensity of the sewage treatment plant. Results show that an ML model with a variable cross layer (VCL) architecture combines ten new features including domain knowledge, 0.021 root mean square error (RMSE) is realized, and the RMSE is improved by 8.7% compared with traditional machine learning. The importance of the created domain knowledge features (such as productivity utilization rate and ten-thousand-ton wastewater sludge quantity) is in the front, and the relevant interaction between the features contributes to the interpretability of the VCL-ML model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to a method, device, equipment and storage medium for predicting energy intensity of a sewage treatment plant, and belongs to the technical field of intelligent sewage treatment. Background Art

[0002] Wastewater treatment is an energy-intensive industry, and energy consumption accounts for 50-80% of the carbon emissions of wastewater treatment plants. Reducing carbon emissions related to energy consumption is the key to achieving low-carbon development of wastewater treatment plants (Bao et al., 2016; Chen, 2019; Qu et al., 2022; Yan et al., 2017; Zhu et al., 2022). As a complex system, the energy consumption of wastewater treatment plants is affected by multiple factors, including treatment processes, influent water quality, and operating parameters (Harrou et al., 2020; Yang et al., 2022a; Zhang et al., 2021). Therefore, elucidating the interrelationships between them poses a huge challenge and obstacle. In addition, the intricate biological and physicochemical processes lead to obvious nonlinear phenomena within wastewater treatment plants, making it difficult to make an accurate and comprehensive interpretation of system characteristics (Borzooei et al., 2019; Panepinto et al., 2016; Rout et al., 2021). Therefore, to achieve the goal of reducing energy consumption in WWTPs, it is imperative to develop accurate and interpretable energy intensity prediction models.

[0003] First, energy intensity prediction models were established based on traditional mechanism models (such as the activated sludge model No. 1). Traditional mechanism models integrate physical and empirical knowledge and usually provide relatively robust data, so they dominate the field of prediction models for wastewater treatment plants. For example, Póvoa et al. combined actual energy consumption costs with the activated sludge model No. 1 (ASM1) to facilitate the decision-making process and achieve energy savings (Póvoa et al., 2017). Aymerich et al. combined tariffs with the SIMBA# simulator to evaluate the costs of Spanish plants in more detail (Aymerich et al., 2015). However, these models rely heavily on complex parameters and face challenges such as calibration difficulties and structural uncertainties (Larsen et al., 2016; Miller et al., 2018; Quaghebeur et al., 2022). Therefore, traditional mechanism models based on established knowledge are complex due to the large number of parameters.

[0004] As the available data continues to increase, data-driven approaches become increasingly attractive. Unlike mechanistic models, machine learning models can simulate and predict time series by observing the relationship between input and target variables (mainly nonlinear relationships), through a large amount of data (Heo et al., 2020; Newhart et al., 2019; Zhong et al., 2021a; Zhou, 2022). Recently, researchers have been trying to apply machine learning methods to simulate the operation of wastewater treatment plants (Niu et al., 2020) and predict their effluent water quality (Yang et al., 2022b). Dairi et al. combined recurrent neural networks (RNN) and restricted Boltzmann machines (RBM) with various classifiers to identify abnormal influent conditions in wastewater treatment plants. They found that the OCSVM (one-class support vector machine) based on RNN-RBM outperformed all other models (Dairi et al., 2019)(Dairi et al., 2019). In addition, machine learning has been used to reduce the operating costs and energy consumption of wastewater treatment plants (Wang et al., 2022; Zhang et al., 2021). Previous studies have mainly focused on a variety of machine learning or deep learning hybrid methods. Although these methods improve the accuracy and efficiency of the models, they require a lot of computing resources due to their complexity. In addition, the interpretability of these complex models is limited ( et al., 2018). Therefore, data-driven models are limited by the scarcity of monitoring indicator data and poor model performance.

[0005] At present, the hybrid model paradigm combining mechanism and data-driven methods integrates domain knowledge into data learning, overcomes the problem of data scarcity, and enhances the performance of machine learning models (Raissi et al., 2019; Yang et al., 2021). Studies have incorporated the biochemical processes of microbial reactions into data-driven hybrid models, thereby improving the prediction accuracy of nitrous oxide (N2O) emissions from wastewater treatment plants (Li et al., 2022). However, there is currently no direct or indirect mechanistic connection between the biochemical processes in wastewater treatment projects and the energy consumption of the system, which poses a challenge to the embedding of domain knowledge. On the other hand, there are limitations in monitoring high-quality data indicators, because actual wastewater treatment plants usually only monitor major variables such as water quality and water quantity. Therefore, the lack of exploration of unknown knowledge related to energy consumption has hindered the application of mechanism data fusion models to the practice of simulating energy consumption in wastewater treatment plants.

[0006] In the field of sewage treatment plants, there is a lack of comprehensive and effective energy intensity prediction models. This application intends to create knowledge features based on traditional monitoring variables to address the above limitations. Summary of the invention

[0007] To solve the above technical problems, the embodiments of the present application respectively provide a method, device, equipment and storage medium for predicting the energy intensity of a sewage treatment plant, embedding domain knowledge into the design of a machine learning model, and formulating a sewage treatment plant energy intensity prediction model.

[0008] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0009] According to one aspect of an embodiment of the present application, a method for predicting energy intensity of a sewage treatment plant is provided, the method comprising:

[0010] Acquiring data, and preprocessing the data to obtain a basic data set;

[0011] Creating new features based on the basic data set to achieve knowledge creation and build a variable cross-layer structure, wherein the new features include energy intensity, cross-variables, sewage characteristics, pollutant removal and time series characteristics;

[0012] Embedding the new features into the basic data set to obtain a new data set;

[0013] Combining the knowledge creation and knowledge embedding process with the machine learning model to construct a VCL-ML model, wherein the VCL-ML model includes a variable cross-layer structure and an ML model;

[0014] Energy intensity prediction of sewage treatment plants is achieved based on the VCL-ML model.

[0015] Furthermore, the sewage characteristics include biochemical oxygen demand, chemical oxygen demand, suspended solids, total phosphorus, total nitrogen, ammonia nitrogen and pH value, and the data set includes flow rate, energy consumption, water temperature, sludge volume and energy intensity, and the energy intensity is calculated by the ratio of energy consumption to flow rate.

[0016] Further, the ML model is trained using the new data set to obtain a trained variable cross-layer machine learning model, specifically including:

[0017] sorting the input variables according to the gain values ​​of the respective input variables, wherein the gain values ​​of the input variables are used to characterize the influence of the corresponding input variables on the energy intensity prediction accuracy of the ML model;

[0018] Based on the sorted input variables, according to the gain values ​​of the input variables, the ML model is trained with the input variable with the highest gain value as the first key feature, and the input variables are added in sequence according to the gain values ​​to iteratively train the ML model, and the performance of the ML model after each training is evaluated, and the trained ML model with the best performance is used as the optimal reduced-order model for predicting energy intensity.

[0019] Furthermore, the input variables are sorted according to the gain values ​​of the input variables, specifically including:

[0020] Get the input variable X∈R N×m , which means that there is a sample x i =[x i1 ,x i2 ,...,x ij ,...,x im ] T i=1,2,...,N and m-dimensional input variable data matrices;

[0021] Calculating a gain value of the input variable using a tree model, wherein the gain value represents a relative importance of the corresponding input variable in segmenting data in the tree model;

[0022] Arrange the input variables in descending order of their impact on the energy intensity prediction accuracy of the ML model, and obtain in Represents the column vector of the jth feature, that is

[0023] Furthermore, based on the sorted input variables, according to the gain values ​​of the input variables, the input variable with the highest gain value is used as the first key feature to train the ML model, and the input variables are added in sequence according to the gain values ​​to iteratively train the ML model, and the performance of the ML model after each training is evaluated, and the ML model after training with the best performance is used as the best reduced-order model for predicting energy intensity, specifically including:

[0024] In the first iteration, the ML model is trained using the input variable with the highest gain value as the first key feature and the performance of the trained ML model is evaluated. In the next iteration, based on the sorted input variables, the next input variable is appended to the first key feature for training and the performance of the trained ML model is evaluated. The above process is repeated until adding input variables no longer improves the performance of the ML model.

[0025] Furthermore, the method further comprises:

[0026] The performance of the ML model was evaluated based on the root mean square error on the test data across iterations.

[0027] Furthermore, the method further comprises:

[0028] Using the root mean square error RMSE, mean absolute error MAE and determination coefficient R 2 The performance of the ML model was evaluated and the root mean square error, mean absolute error and coefficient of determination were calculated using the following formulas:

[0029]

[0030] Among them, N represents the total number of samples, Y i and i Indicate the predicted output and actual output of sample i respectively, Represents the average of the actual values ​​of N samples.

[0031] According to one aspect of an embodiment of the present application, a device for predicting energy intensity of a sewage treatment plant is provided, comprising:

[0032] A data acquisition unit is configured to acquire data and preprocess the data to obtain a basic data set;

[0033] A knowledge creation unit is configured to create new features based on the basic data set, realize knowledge creation, and construct a variable cross-layer structure, wherein the new features include energy intensity, cross-variables, sewage characteristics, pollutant removal, and time series characteristics;

[0034] A knowledge embedding unit, configured to embed the new feature into a basic data set to obtain a new data set;

[0035] A model building unit is configured to combine the knowledge creation and knowledge embedding process with the machine learning model to build a VCL-ML model, wherein the VCL-ML model includes a variable cross-layer structure and an ML model;

[0036] The intensity prediction unit is configured to realize energy intensity prediction of the sewage treatment plant based on the VCL-ML model.

[0037] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a controller; and a memory for storing one or more programs, wherein when the one or more programs are executed by the controller, the controller implements the above-mentioned method for predicting energy intensity of a sewage treatment plant.

[0038] According to one aspect of an embodiment of the present application, a computer-readable storage medium is also provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the above-mentioned method for predicting energy intensity of a sewage treatment plant.

[0039] According to one aspect of the embodiment of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned sewage treatment plant energy intensity prediction method.

[0040] The technical solution provided in the embodiments of the present application has at least the following advantages:

[0041] 1) The embodiment of the present application first developed a VCL-ML model, took the traditional data-driven model as a control group, and compared their prediction accuracy and model interpretability. The partial dependence plot (PDP) and Shapley additive interpretation (SHAP) methods were further used to interpret the model. According to the model interpretation results, the contribution of input features to energy intensity prediction was quantitatively evaluated to identify the key factors affecting energy consumption. In addition, the input feature differences between VCL-ML and traditional data-driven models were analyzed. In addition, we conducted a systematic error analysis to review the deficiencies of the model and explore strategies to further improve model performance. The framework of creating knowledge features and embedding them into the machine learning model not only improves the accuracy of the model, but also significantly improves the interpretability of the model through systematic and effective knowledge integration. At the same time, this application demonstrates the potential for expanding the application of machine learning to energy management in sewage treatment plants in terms of knowledge discovery and strategy design.

[0042] 2) This application designs a machine learning model with a variable cross layer (VCL) architecture, called variable cross layer machine learning (VCL-ML). VCL uses known monitoring indicators (such as chemical oxygen demand, etc.) for knowledge creation and embeds knowledge into the input of the machine learning model to predict the energy consumption of WWTPs. The results show that the ML model with a variable cross layer (VCL) architecture combines ten new features containing domain knowledge and achieves a root mean square error (RMSE) of 0.021, which is 8.7% higher than traditional machine learning. The importance of the domain knowledge features created (such as capacity utilization, 10,000 tons of wastewater sludge) is at the forefront, and the correlation interactions between features contribute to the interpretability of the VCL-ML model. In addition, the embodiment of the present application quantitatively compares the feature classification between the VCL-ML model and the traditional machine learning model. Time and pollutant removal information (such as month and TP residual rate) play an important role in improving the model performance. This highlights the strong correlation between the energy intensity of the wastewater treatment plant and the pollutant removal and time information, while weakening the contribution of redundant features. This study demonstrates the effectiveness of the knowledge creation and embedding dual-driven ML approach in understanding the energy consumption of WWTPs. This approach can provide decision support for the optimal management of wastewater treatment plants and is expected to provide support for carbon emission control and carbon neutrality in the wastewater treatment sector.

[0043] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0045] Figure 1 is a flow chart of a method for predicting energy intensity of a sewage treatment plant shown in an exemplary embodiment of the present application;

[0046] Figure 2 is a schematic diagram of the structure of a variable cross layer shown in an exemplary embodiment of the present application;

[0047] Figure 3 is a schematic diagram of an ML model development method shown in an exemplary embodiment of the present application;

[0048] Figure 4 is a workflow diagram of a method for predicting energy intensity of a sewage treatment plant shown in an exemplary embodiment of the present application;

[0049] Figure 5 is an exemplary embodiment of the present application showing (a) input feature ranking based on traditional machine learning model variable importance analysis; (b) R of the best input feature determined by performance evaluation of the traditional machine learning model 2 ; (c) MAE; (d) RMSE;

[0050] Figure 6 is an exemplary embodiment of the present application showing (a) input feature ranking based on VCL-LGBMR model variable importance analysis; (b) R of the best input feature determined by performance evaluation of the VCL-LGBMR model 2 ; (c) MAE; (d) RMSE;

[0051] Figure 7 1 is a performance comparison between a traditional machine learning model and a VCL-LGBMR model shown in an exemplary embodiment of the present application, (a) the prediction of energy consumption by the model before the cross-layer is changed and (b) after the cross-layer is changed, the input feature numbers of the traditional machine learning model and the VCL-LGBMR model are 15 and 10 respectively;

[0052] Figure 8 SHAP summary diagrams of (a) a traditional machine learning model and (b) a VCL-LGBMR model are shown in an exemplary embodiment of the present application. Features are sorted by the sum of the SHAP values ​​of all samples;

[0053] Fig. 9 It is a partial dependency diagram of the main features of the VCL-LGBMR model shown in an exemplary embodiment of the present application: (a) CU, (b) TTWS, (c) pH_in, (d) TP_Wqm, (e) T, (f) TP_rr, (g) TN_Wqm, (h) TN_rr, (i) month;

[0054] Fig.10 is the interactive effect of the main features (CU, TTWS, pH_in, TP_Wqm, TN_Wqm, TN_rr and TP_rr) on energy intensity shown in an exemplary embodiment of the present application;

[0055] Fig.11 It is the quantitative contribution of energy consumption modeling in different models shown in an exemplary embodiment of the present application, where (a) the traditional machine learning model, (b) the VCL-LGBMR model;

[0056] Fig.12 is the identified error types and patterns in two ML categories shown in an exemplary embodiment of the present application, where the width of each box reflects the proportion of error samples in the test set, rather than their absolute number;

[0057] Fig.13 It is a schematic diagram of the structure of a sewage treatment plant energy intensity prediction device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0058] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0059] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0060] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0061] The term "multiple" as used in this application refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0062] See also Figure 1 , Figure 1 This is a flowchart of a method for predicting energy intensity of a sewage treatment plant shown in an exemplary embodiment of the present application. The embodiment of the present invention provides a method for predicting energy intensity of a sewage treatment plant. The core of the method is to develop a new model with high reliability to realize energy intensity prediction of a sewage treatment plant. The method includes the following steps S100 to S500, which are described in detail as follows:

[0063] Step S100: acquiring data and preprocessing the data to obtain a basic data set.

[0064] The preprocessing described herein in this embodiment includes but is not limited to the deletion / filling of missing values ​​and outliers.

[0065] Exemplarily, the dataset used for model development is from a wastewater treatment plant in Wuxi, China. The core process of the plant is the improved anaerobic-anoxic-aerobic (AAO) process, which is the most commonly used wastewater treatment process in urban wastewater treatment plants. Wastewater characteristics including biochemical oxygen demand (BOD5, mg / L), chemical oxygen demand (COD, mg / L), suspended solids (SS, mg / L), total phosphorus (TP, mg / L), total nitrogen (TN, mg / L), ammonia nitrogen (NH3-N, mg / L) and pH were measured in real time. During the modeling and calculation process of this study, the interval of these wastewater characteristics was set to 24 hours. In addition, other parameters, such as influent (Q, m 3 ), energy consumption (E, kW·h), water temperature (T, ℃) and sludge quality (S, t) are also automatically collected within 24 hours. Subsequently, energy intensity (EI, kW·h / m 3 ) is calculated by the ratio of energy consumption to water intake. A comprehensive dataset of 3652 observations was collected from January 1, 2010 to December 31, 2019 for model development. After removing some missing values ​​and outliers, 3633 records remained in the dataset.

[0066] Step S200, creating new features based on the basic data set, realizing knowledge creation, and constructing a variable cross-layer structure, wherein the new features include energy intensity, cross-variables, sewage characteristics, pollutant removal, and time series characteristics.

[0067] Step S300: embed the new features into a basic data set to obtain a new data set.

[0068] Typically, datasets obtained from wastewater treatment plants face significant challenges with limited dimensional features and difficult to interpret internal complex correlations. Unfortunately, this shortcoming hinders the optimal use of big data technology and machine learning models. In addition, traditional monitoring indicator data from wastewater treatment plants are not conducive to comprehensive simulation of energy intensity. Traditional data-driven models exhibit low accuracy and poor interpretability.

[0069] In this embodiment, in order to provide the ML model with valuable domain knowledge from the sewage treatment plant before training, the embodiment of the present application uses multiple mathematical models representing different processes in the VCL model to create new variables with specific environmental and physical interpretations. The basic data set includes 17 variables, and the knowledge creation and embedded data set includes 27 variables, of which energy intensity is the target variable, and the input variables include new cross variables, sewage characteristics, pollutant removal, and time series characteristics.

[0070] Step S400, combining the knowledge creation and knowledge embedding process with the machine learning model to construct a VCL-ML model, wherein the VCL-ML model includes a variable cross-layer structure and an ML model;

[0071] After data preprocessing, the dataset was randomly divided into two parts: 85% for machine learning model training and the remaining 15% for final model testing. A 10-fold cross-validation technique was used to train and optimize the model. All subsequent modeling work was performed on the training set data, and the test set was only used to test the performance of the model. Different models were trained using the R software package in this study, including two linear models (multiple linear regression (MLR), lasso regression (LASSO)), two nonlinear models (kernel ridge regression (KRR), support vector regression (SVR)) and four ensemble models (random forest regression (RFR), gradient boosted decision tree regression (GBDTR), extreme gradient boosted regression (XGBR) and lightweight gradient boosted regression (LightGBMR)). Knowledge creation and embedding datasets were used to construct data-knowledge dual-driven models to improve performance and interpretability. The training method and machine learning algorithm of the VCL-ML model were consistent with the Con-ML model.

[0072] Therefore, the present application embodiment proposes a method for creating and embedding domain knowledge based on VCL (see Figure 2 ). By integrating VCL and basic machine learning models, eight VCL-ML models were developed.

[0073] Specifically, first, different linear, nonlinear, and ensemble models are trained and their performance is optimized through a systematic cross-validation and grid search process to identify the most suitable machine learning model for the studied case. Second, a feature importance analysis for ranking input variables is proposed, and the optimal input features are evaluated through an iterative, sequential addition procedure that maximizes the predictive accuracy of the previously identified best performing machine learning model. Figure 3 , a schematic diagram of a method for machine learning model development is shown, wherein the first part represents the process of ranking input variables, and the second part represents the evaluation of optimal input variables and the process of developing a machine learning model.

[0074] For example, let X∈R N×m Represents a sample x i =[x i1 ,x i2 ,...,x ij ,...,x im ] TThe feature importance analysis in this paper is a tree-based approach to rank the input features. The model calculates a gain value for each feature, which represents the relative importance of the feature in splitting the data in the decision tree model. It measures the degree to which the model prediction accuracy is improved based on the split of the feature at each node. A higher gain value indicates that the feature has a more significant impact on the model. Features can be ranked in descending order of their impact, and they can be rearranged as in represents the column vector of the jth feature, that is

[0075] Furthermore, in order to determine the optimal number of key features, a sequential iterative descriptor addition procedure is considered. In this process, each iteration of the model is trained with the corresponding key feature data and based on Figure 3 The method shown in the second part of this paper evaluates its best performance. Figure 3 As shown, in the first iteration, the ML model uses the first key feature data The training is performed and its best performance is evaluated. In the next iteration, the previous data is appended with the next most important key feature and used to build an ML model with the first two key features. The process is repeated until adding additional features does not further improve the model performance.

[0076] The performance of the ML model is measured by the root mean square error (e j ) for evaluation. This iterative process can be repeated for all m features and compared (ML) j The performance of the k )’s best reduced-order model (ML) k The k relevant key features are considered as the best key features Corresponding (ML) k The model can be considered as the best reduced-order model for predicting energy consumption.

[0077] Finally, in step S500, energy intensity prediction of the sewage treatment plant is implemented based on the VCL-ML model.

[0078] In some embodiments, the prediction accuracy and robustness of different models can be evaluated by statistical quantitative indicators, such as root mean square error (RMSE), mean absolute error (MAE), and coefficient of determination (R 2 ), these indicators can be calculated using formulas 1-3. 2 Represents the strength of the correlation between the actual value and the predicted value, and its value range is between 0 and 1. The model with the lowest error value is more favored, and R close to 1 is more likely to be2 A value of indicates a good model.

[0079] The root mean square error, mean absolute error, and coefficient of determination are calculated using the following formulas:

[0080]

[0081] Among them, N represents the total number of samples, Y i and i Indicate the predicted output and actual output of sample i respectively, Represents the average of the actual values ​​of N samples.

[0082] Reliability and transparency are crucial for machine learning algorithms. Cramer et al. suggested that explainability is the degree to which humans can understand the reasons for decisions (Cramer et al., 2008). The principle of explainability was listed as one of the ethical principles of artificial intelligence systems by the European Commission in 2019, and transparency is one of the requirements for trustworthy artificial intelligence. The embodiment of this application uses the Shapley Additive Explanation (SHAP) algorithm and partial dependency graph (PDP) to explain the relationship between input features and model impact.

[0083] Shapley Additive Explanation (SHAP): The SHAP algorithm is a model based on Shapley values ​​that provides additive feature attribution (Lundberg and Lee, 2017). It can capture the contribution pattern of individual features to the prediction results and visualize it intuitively, thereby gaining insight into feature impact.

[0084] Partial Dependence Plot (PDP): Friedman first proposed the concept of PDP, which mainly shows how features affect model predictions (Friedman, 2001). This method is calculated after fitting the model. PDP can be used to evaluate the marginal effect of a single feature on the model output. These charts reveal different trends in the model output with respect to changes in different features, and illustrate the linear, monotonic or other complex correlations between features and model output parameters. In addition, this method can also generate an interaction plot between two features to analyze the interactive relationship between features on the predicted target.

[0085] In addition, for small data sets, a classification mapping strategy can be used to highlight the collective impact of closely related attributes to avoid over-analysis of the physical meaning of individual features (Ritt et al., 2022). Therefore, based on domain knowledge, the input features are classified into the most relevant mechanisms, and the results are divided into five categories: influent information, effluent information, pollutant removal information, sludge information, and time series information. The sum of the SHAP values ​​for each category represents the quantitative contribution of the corresponding mechanism.

[0086] Systematic error analysis was conducted to further explore strategies to improve model performance (Al-khresheh, 2016). The specific error types include four types such as Figure 4 As shown. Subsequently, in order to identify the potential causes of these inaccuracies, the embodiment of the present application adopts the SHAP method to analyze the prediction process of these erroneous samples. By comparing the decision-making process of the inaccurately predicted samples with the correctly predicted samples, the embodiment of the present application analyzes the potential causes of model prediction errors under the guidance of domain knowledge.

[0087] The following examples will be combined with specific experimental tests to demonstrate the accuracy and effectiveness of the method proposed in this application.

[0088] According to the specific steps of the method described in the above embodiments, the embodiments of the present application are as follows: Figure 4 The workflow shown in the figure was implemented. Specifically, based on the original dataset, eight Con-ML models were established as soft sensing models for real-time energy intensity prediction. These models rely only on the available raw data, and preliminary results show that they have the potential to predict energy consumption (see Table 1). Among the three categories of Con-ML models, the integrated model showed the best average performance, followed by nonlinear models and linear models. Interestingly, it is worth noting that the Con-LGBMR model based on the integrated machine learning model performed the best among the eight models, with RSEM, MAE and R 2 are 0.023, 0.017, and 0.765, respectively. In contrast, the classical linear ML model failed to accurately predict energy consumption, especially due to the observed low R 2 values, indicating that energy intensity forecasting is not a simple linear problem. These findings highlight the diversity of learning between different models in the training set. The training sets of these ML models show that different types of models produce different predictions.

[0089] Table 1. Comparative analysis of the performance of Con-ML models

[0090]

[0091] Based on the optimal prediction model Con-LGBMR, the present embodiment evaluates the importance of the original variables and ranks them in descending order. The specific results are as follows Figure 5 As shown in a, a bar graph is shown. Figure 3 This example evaluates the optimal number of key input features in Con-LGBMR by gradually adding the key input feature data in each sorting iteration to the previously existing key input feature data ( Figure 5In subsequent iterations, as the number of key input features increases, the performance of the Con-LGBMR model improves significantly, and this trend is Figure 5 This is demonstrated by the sharp decrease in RMSE in d. In addition, in order to obtain the best performing Con-LGBMR model, the present embodiment selected a model with 15 key input features as the best model for predicting energy consumption in this embodiment.

[0092] After generating new features through the variable cross layer, the embodiment of the present application explores the relationship between these new features and the prediction target. Among the ML models containing variable cross layers, the LGBMR model exhibits excellent performance characteristics and higher stability, as shown in Table 2 for details. Although the initial dataset showed satisfactory prediction accuracy for the VCL-ML model (especially the VCL-LGBMR model), some less important features and the use of too many input features may reduce the generalization ability of the model. Therefore, the embodiment of the present application performed a feature importance analysis based on the VCL-LGBMR model to identify and remove those less important features, simplifying the ML model to enhance its performance.

[0093] Table 2. Comparative analysis of the performance of VCL-ML models

[0094]

[0095] According to the optimal prediction model VCL-LGBMR, the importance of features was evaluated and ranked in descending order, such as Figure 6 As shown in the bar graph in Figure a. Figure 3 The method described in , evaluates the optimal number of features to improve the performance of the VCL-LGBMR model. Feature data is incrementally added to the existing feature data through each iteration of sorting. Figure 6 b, c, and d show the number of features and the R of the VCL-LGBMR model, respectively. 2 , MAE, and RMSE. In subsequent iterations, the performance of the descending VCL-LGBMR model significantly improves as the number of features increases. In the test dataset, for the descending VCL-LGBMR model with ten key input features, R 2 , MAE and RMSE values, after which these indicators remain stable. Therefore, the VCL-LGBMR model with ten key input features is selected as the best model for predicting energy consumption in the embodiment of the present application. Some of the identified features include CU, TTWS and T.

[0096] The Con-LGBMR and VCL-LGBMR models are developed based on the daily operation data of the wastewater treatment plant. The Con-LGBMR model relies only on the available data, while the VCL-LGBMR model uses domain knowledge to generate new combined features. In order to study the impact of domain knowledge on model performance, a comprehensive and fair evaluation of the model performance on the test set is conducted, see Figure 7 By comparison Figure 7 It is obvious that creating and embedding domain knowledge reduces the number of high-bias samples. By embedding domain knowledge, R 2 The value increased from 0.765 to 0.798, indicating that the model performance has improved. In addition, reducing the number of input features makes VCL-LGBMR modeling more efficient, and the input features of the VCL-LGBMR model avoid unnecessary monitoring of wastewater quality indicators, thereby expanding the applicability of the model. These further emphasize the importance of domain knowledge in model development. It can provide additional information and insights, help reduce the bias of the model, and improve prediction performance.

[0097] To reveal the impact of domain knowledge creation and embedding on model understanding, the embodiment of the present application uses the SHAP method to explain the Con-LGBMR and VCL-LGBMR models. Figure 8 The SHAP summary plot in shows the ranking of feature importance and its impact on the entire dataset. Observing the results in the figure, it is obvious that the new features generated by the variable cross layer are higher in the feature importance ranking. In the VCL-LGBMR model, CU (capacity utilization) is considered to be the most critical feature for predicting energy consumption, which is consistent with the model-based importance analysis results. In addition, the importance of effluent COD concentration (COD_eff) and effluent NH3_N concentration (NH3_N_eff) decreased, while water temperature (T) and effluent TN concentration (TN_eff) remained relatively stable, and the importance of inlet pH concentration (pH_in) increased. It is worth noting that a positive SHAP value indicates that the feature leads to an increase in energy consumption, while a negative value indicates that the feature leads to a decrease in energy consumption. According to the SHAP summary results, it was found that an increase in the key feature CU led to a decrease in energy consumption, while an increase in key features such as pH_in, TTWS, and TP water quality margin (TP_Wqm) was associated with an increase in energy consumption. The explanatory results obtained using the SHAP method can help gain insight into the basis of model predictions and provide guidance for intervention and optimization of specific features.

[0098] Based on the nonlinear response characteristics of energy consumption in a wastewater treatment plant to different input variables, which changes with the changes of these input variables, once the important variables are determined, the relationship between key characteristics and energy consumption can be visualized through PDP. Fig. 9The results of PDP are presented, which effectively reveal the marginal effect relationship between daily energy consumption and key characteristics of WWTPs. Fig. 9 The nine sub-figures in Figure 1 show the partial dependence of each key feature when predicting daily energy consumption using the VCL-LGBMR model. These plots show the impact of changes in key features on energy consumption when other features remain constant. This helps to gain a deeper understanding of the nonlinear relationship between features and energy consumption, and helps understand the trend and changes in energy consumption at different feature values.

[0099] according to Fig. 9 The observations in a show that the relationship between CU and energy consumption shows a nonlinear interaction. When CU increases between 40% and 80%, the energy consumption intensity tends to be higher, exceeding 0.3kW·h / m 3 However, when CU exceeds 80%, the predicted energy consumption trend decreases monotonically. Similarly, Fig. 9 Figure b shows the complex relationship between TTWS and energy consumption. As TTWS increases from 0 to 12.5t / 10 4 m 3 , energy consumption tends to increase. Fig. 9 As can be seen in Figure c, the dependence curve between the key feature pH_in and energy consumption is S-shaped. This indicates that the change in energy consumption is more significant within a specific range of pH_in values. Fig. 9 Figures d and g show similar trends in energy intensity for TP_Wqm and TN_Wqm. The changes in energy intensity are more significant within a specific range of TP_Wqm and TN_Wqm. Specifically, pollutants with TP_Wqm ranging from 40% to 70% seem to be unfavorable for reducing energy consumption, while pollutants with TN_Wqm ranging from 60% to 80% lead to higher energy consumption.

[0100] also, Fig. 9 Figures f and h show that the dependence curves of the key features TP_rr and TN_rr on energy consumption also show some similarities, but there are also some differences. The PDP of TP_rr ( Fig. 9 f) shows a monotonically decreasing trend and then becomes stable, while the PDP of TN_rr ( Fig. 9 h) shows a nonlinear curve, which fluctuates at first and then gradually stabilizes. Fig. 9 Figure (e) shows that the partial dependence between T and energy consumption shows a U-shaped trend. Temperatures in the range of 15°C to 22.5°C are conducive to obtaining lower energy consumption. By observing these partial dependence plots, we can better understand the impact of different characteristics on energy consumption.

[0101] There are interactions between features, which means that the effect of one feature on the target feature may change with the change of other features. The embodiment of the present application draws a partial dependence interaction effect diagram between features ( Fig.10 ) to reveal these interactions and analyze the impact of features on energy consumption. Fig.10 The interaction between CU and TTWS is revealed in a, where CU has a more significant effect on energy consumption. When CU is lower than 60%, it reaches 7.5t / 10 4 m 3 or higher TTWS will result in higher energy consumption. Fig.10 In b, a significant interaction between TTWS and pH_in was observed. 4 m 3 and below and pH_in below 7.6 to control lower energy consumption. The interaction between pH_in and T is more complex. When T is between 15℃ and 28℃ and pH_in is below 7.5, lower energy consumption can be observed ( Fig.10 c). The interactions between other features with similar dependence curves, such as the interaction between TP_Wqm and TN_Wqm, are relatively direct. When the concentration of the imported pollutant increases, the energy consumption also increases accordingly ( Fig.10 (d) Fig.10 Figure e shows the combined effect of TN_Wqm and TN_rr on energy consumption. When TN_Wqm is higher than 60%, a lower TN_rr needs to be controlled to ensure safe water discharge, resulting in higher energy consumption. Fig.10 The significant interaction between TN_rr and TP_rr was confirmed in Figure f. It is necessary to control TN_rr greater than 25% and TP_rr greater than 4% to achieve lower energy consumption while ensuring safe effluent quality. These observations help to better understand the complex associations between different characteristics and how they jointly affect energy consumption.

[0102] The present embodiment further classifies and quantitatively compares the contributions of the features in the two hybrid models, using classification mapping to emphasize the combined impact of related attributes ( Fig.11 (a, b) Compared with the three types of information features in Con-LGBMR, the input feature classification in VCL-ML is increased to five categories, adding pollutant removal information and time information, highlighting a more comprehensive and extensive range of information features. It is worth noting that Fig.11 Figure a shows that the inlet information features play a dominant role in the Con-LGBMR model for predicting energy consumption. Similarly, the inlet information features generated by the variable cross layer also play an important role in the VCL-LGBMR model for predicting energy consumption. However, their contribution has slightly decreased ( Fig.11In addition, the pollutant removal information and time information features added by the variable cross-layer jointly contributed 12.9%, resulting in a decrease in the contribution of the effluent information feature.

[0103] To further explore and compare the improvement strategies of Con-LGBMR and VCL-LGBMR models, this embodiment of the application conducted a systematic error analysis based on a set of typical error samples (prediction deviation > 20%) obtained from 10 repeated predictions, which enabled us to identify the error types and patterns in the two ML categories ( Fig.12 ). Among these error samples, overestimation (90.35%) was more common than underestimation (9.65%), and this difference was particularly significant in the Con-LGBMR model. To elucidate the potential causes of these errors, we used the SHAP method to analyze the decision-making process of the error samples. The results showed that the main error modes included overfitting errors, missing data, insufficient features, and incorrect labels. The main error modes of both ML models were overfitting errors and insufficient features. However, in the VCL-LGBMR model, the insufficient feature errors were much less than those in the Con-LGBMR model. Similarly, both ML models exhibited a significant proportion of overfitting errors. In addition, for the Con-LGBMR model, the insufficient feature error mode was as high as 38%, indicating that key information in the data was missed due to the omission of some key features.

[0104] Therefore, the present application embodiment discloses a new method for constructing and interpreting ML models driven by data and domain knowledge. The VCL-ML model constructed by variable cross-layer embedding based on domain knowledge can accurately predict the energy consumption of sewage treatment plants, while clarifying the qualitative and quantitative relationship between input data and energy consumption.

[0105] In combination with the specific examples made above, the method disclosed in the embodiments of the present application has the following advantages over the prior art:

[0106] 1. Enhance model performance through VCL interaction

[0107] The integrated model LGBMR showed the best performance in both Con-ML and VCL-ML, and the accuracy of the VCL-LGBMR model was significantly improved compared with the Con-LGBMR model. This significant improvement indicates that high-bias samples are reduced by embedding domain knowledge. At the same time, the VCL-ML model further explored the potential of existing data by combining variables across levels. This model integration of domain knowledge and mathematical calculations provides the right guidance for training a single data-driven ML model. For example, adding capacity utilization features (Yang et al., 2022a), which includes knowledge of wastewater treatment plant design, can guide the design planning of wastewater treatment plants based on its relationship with energy consumption. The innovative knowledge integration model proposed in this study can be classified as a guidance model, similar to the integration of physical information in the context of physical information neural network research (Raissi et al., 2019). In addition, some studies have combined mechanism models with deep learning techniques to predict N2O emissions, thereby improving the accuracy of N2O emission prediction models (Li et al., 2022). Another study proposed a new method to establish sufficient boundary conditions for sewage pipe heat exchange models. This method learns a simple data-driven model from the mechanistic sewage pipe heat transfer model to predict the temperature at the soil boundary, which significantly improves the accuracy and speed of sewage pipe heat transfer modeling (Li et al., 2023). Therefore, this variable cross-layer method combines data-driven and knowledge-driven methods. This collaborative modeling approach provides an accurate and effective framework for energy consumption simulation and prediction of sewage treatment plants.

[0108] The domain knowledge features created and embedded through the variable cross-layer significantly enhance the training efficiency of the model. The feasibility of the information gain feature importance selection analysis method used in this study has been proven to simplify the degraded ML model and improve its robustness. The present application example identified 15 and 10 key features required for the Con-LGBMR and VCL-LGBMR models, respectively (see Figure 5 and Figure 6). Improved generalization and higher computational efficiency were achieved by simplifying the input feature set. This result can be attributed to the redundancy of some input features (e.g., COD_eff) in the Con-LGBMR model, which weakened the generalization and robustness of the model (Mehtab et al., 2023). Lv et al. enhanced the performance of the wastewater treatment plant effluent quality prediction model by simplifying the input variables through factor analysis (Lv et al., 2024). Bagherzadeh et al. studied the effects of various feature selection methods on the performance of machine learning models, aiming to improve prediction accuracy by selecting appropriate features (Bagherzadeh et al., 2021a). In addition, the addition of cross-features involves more relevant information. Knowledge represents a higher-order or more effective form of information than the original data, generally leading to higher model training efficiency (Raissi et al., 2019; Yang et al., 2021; Zhong et al., 2021b).

[0109] 2. Embedded knowledge improves model interpretability

[0110] After creating and embedding domain knowledge through the variable cross layer, the importance contribution of model features changes significantly ( Figure 8 ). This result shows that domain knowledge changes the decision-making process of the model (Lundberg and Lee, 2017), and that embedding domain knowledge makes an important contribution to the model, which helps to better understand the results of the model. For the key features added, CU measures the operational efficiency and resource utilization of the WWTP. A higher CU value indicates that the plant fully utilizes its design capacity, thereby reducing energy consumption (Foladori et al., 2015; Krampe, 2013; Longo et al., 2016). On the contrary, a lower CU value indicates that there is excess treatment capacity, increasing energy consumption. It is worth noting that when the CU value exceeds 80%, achieving low-energy operation is more beneficial for the WWTP, a view supported by relevant research and industry consensus (Hernández-Chover et al., 2021; Panepinto et al., 2016; Torregrossa et al., 2019). As for TTWS, this feature combines the sludge volume with the amount of treated water, revealing the relationship between sludge volume and energy consumption. As the TTWS value increases, the energy consumption increases linearly because more energy is needed for sludge dewatering. To optimize the operation of the sewage treatment plant, it is recommended to control the TTWS value below 10t / 10 4 m 3However, specific control parameters such as the reflux ratio need to be further optimized through mathematical modeling (Borzooei et al., 2019; Shen et al., 2023; Yang and Chen, 2021).

[0111] The newly added knowledge features show strong interactions and fully reveal the impact of multiple features on multiple prediction targets, which is also one of the important factors to improve the interpretability of the model. CU can reflect the match between the design of the sewage treatment plant and the actual operating water volume. At the same time, TTWS is related to the water quality and regulation of the sewage treatment plant (Oliveira et al., 2021; Zhang et al., 2021). Without endangering the safety of effluent, higher CU and lower TTWS are conducive to reducing energy consumption. The impact of TTWS on energy consumption is weaker than that of CU, highlighting the dominant role of CU. The multi-feature interaction analysis method used in this study is similar to that of Kumuduni N. Palansooriya et al. (Palansooriya et al., 2022). In addition, with regard to energy intensity, there is a trade-off relationship between the influent water quality recovery capacity and pollutant removal efficiency of the sewage treatment plant. This is reflected in the interaction between the influent water quality recovery capacity and the pollutant removal efficiency on energy intensity. For example, TP_Wqm and TN_Wqm have similar dependence curves ( Fig. 9 d and g), leading to a relatively simple interaction. In theory, the higher the ratio of the influent pollutant concentration to the design parameter, the more energy is required to treat the pollutant load, thereby increasing energy consumption (Bagherzadeh et al., 2021b; Xu et al., 2022). Another example is the interaction between the key characteristics TN_Wqm and TN_rr, which is crucial to simultaneously control energy consumption and ensure effluent safety ( Fig.10 e). According to the optimization scenario, in the case of the sewage treatment plant in the application embodiment, when TN_Wqm reaches 80%, it is only necessary to control TN_rr < 30% to meet the effluent safety standard while maintaining low energy consumption. However, in actual treatment processes, sewage treatment plants often over-control pollutant removal, resulting in unnecessary energy consumption (Bernardelli et al., 2020; Wang et al., 2021; Zhang et al., 2021).

[0112] 3. Key factors of the model and improvement strategies.

[0113] Incorporating domain knowledge information into the model has led to an increase in feature categories and changes in their contributions, fully demonstrating the combined impact of the differences in classification mapping between the two mechanism-driven models. This helps to indirectly improve the interpretability of the model. The results show that the influent information features significantly affect the energy intensity prediction in both models ( Fig. 9 ). In addition, the present embodiment observed that the pollutant removal information and time information added in the variable cross layer contributed to both models, reducing the contribution of the effluent water quality information index ( Fig.11 b). This highlights the strong correlation between wastewater treatment plant energy consumption and pollutant removal as well as temporal information, while reducing the contribution of redundant features. Implicit information represents the efficiency of the wastewater treatment system, which affects the prediction of energy consumption. Studies have shown that the efficiency of wastewater treatment systems is susceptible to various factors, such as hydraulic shock or pollution load (Barber and Stuckey, 1999; Jiang et al., 2023), and the results of feature interactions also support this. The operation process of wastewater treatment plants produces temporal data that is highly affected by weather or extreme events (Bagherzadeh et al., 2021b; Bollmann et al., 2014; Subramanian, 2022). The temporal information feature reflects the impact of seasonality on energy consumption and daily fluctuation trends (Bagherzadeh et al., 2021b), while the pollutant removal information feature further indicates the efficiency of biological treatment in wastewater treatment plants (Hernández-Sancho et al., 2011; Molinos-Senante et al., 2014).

[0114] Therefore, the embodiment of the present application introduces pollutant removal information and time information features to explain the predictive relationship of energy consumption fluctuations. By comparing the classification and quantitative contribution of features in the two mechanism-driven models, we can better understand the impact of different features on system energy consumption (Li and Tufts, 1997), and further optimize and adjust the system to improve performance and efficiency. By analyzing the energy efficiency of sewage treatment plants, we can determine which measures have the greatest potential to reduce energy consumption and therefore greenhouse gas emissions, as well as improve the production costs of such facilities to make them more competitive.

[0115] In summary, the embodiments of this application reveal a novel method to build and interpret machine learning models driven by data and domain knowledge. By creating and embedding knowledge into machine learning models, a clearer simulation of energy consumption indicators in sewage treatment plants is achieved. The results show that all VCL-ML models perform better than traditional machine learning models in all indicators (including RMSE, MAE and R 2) have been improved. Among the tested machine learning models, the LGBMR model showed the best prediction performance. In addition, the embedding of knowledge creation enhances the interpretability of the machine learning model. Quantitative classification of the contribution of input features further enhances the interpretability of the model. The model proposed in the embodiment of the present application provides a method to identify the key factors affecting the energy consumption indicators of sewage treatment plants and quantitatively evaluate the contribution of input features. These insights can guide the formulation of strategies for reducing energy consumption. The creation and embedding of domain knowledge introduced in the field of sewage treatment plants provides an effective way to solve the challenges caused by sparse monitoring indicator data and poor model performance, thereby expanding the application field of machine learning technology.

[0116] Another aspect of the present application also provides a sewage treatment plant energy intensity prediction device, such as Fig.13 As shown, the device 1300 includes:

[0117] The data acquisition unit 1301 is configured to acquire data and pre-process the data to obtain a basic data set;

[0118] A knowledge creation unit 1302 is configured to create new features based on the basic data set, realize knowledge creation, and construct a variable cross-layer structure, wherein the new features include energy intensity, cross-variables, sewage characteristics, pollutant removal, and time series characteristics;

[0119] The knowledge embedding unit 1303 is configured to embed the new feature into the basic data set to obtain a new data set;

[0120] A model building unit 1304 is configured to combine the knowledge creation and knowledge embedding process with the machine learning model to build a VCL-ML model, wherein the VCL-ML model includes a variable cross-layer structure and an ML model;

[0121] The intensity prediction unit 1305 is configured to implement energy intensity prediction of the sewage treatment plant based on the VCL-ML model.

[0122] It should be noted that the sewage treatment plant energy intensity prediction device provided in the above embodiment and the sewage treatment plant energy intensity prediction method provided in the aforementioned embodiment belong to the same concept, and the specific manner in which each module or unit performs the operation has been described in detail in the method embodiment and will not be repeated here.

[0123] Another aspect of the present application provides an electronic device, including: a controller; a memory for storing one or more programs, which, when executed by the controller, perform the energy intensity prediction of the sewage treatment plant in the above-mentioned embodiments.

[0124] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU) 701, various functions defined in the system of the present application are executed.

[0125] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0126] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0127] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0128] Another aspect of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned method for predicting the energy intensity of a sewage treatment plant is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0129] Another aspect of the present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for predicting energy intensity of a sewage treatment plant provided in each of the above embodiments.

[0130] According to one aspect of an embodiment of the present application, a computer system is also provided, including a central processing unit (CPU), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage portion into a random access memory (RAM), such as executing the method in the above embodiment. In RAM, various programs and data required for system operation are also stored. CPU, ROM and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.

[0131] The following components are connected to the I / O interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication part performs communication processing via a network such as the Internet. A drive is also connected to the I / O interface as needed. Removable media, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive as needed so that the computer program read therefrom is installed into the storage part as needed.

[0132] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.

Claims

1. A method for predicting energy intensity of a sewage treatment plant, characterized in that: The method comprises: Acquiring data, and preprocessing the data to obtain a basic data set; Creating new features based on the basic data set to achieve knowledge creation and build a variable cross-layer structure, wherein the new features include energy intensity, cross-variables, sewage characteristics, pollutant removal and time series characteristics; Embedding the new features into the basic data set to obtain a new data set; Combining the knowledge creation and knowledge embedding process with the machine learning model to construct a VCL-ML model, wherein the VCL-ML model includes a variable cross-layer structure and an ML model; Energy intensity prediction of sewage treatment plants is achieved based on the VCL-ML model.

2. The method for predicting energy intensity of a sewage treatment plant according to claim 1, characterized in that: The sewage characteristics include biochemical oxygen demand, chemical oxygen demand, suspended solids, total phosphorus, total nitrogen, ammonia nitrogen and pH value, and the data set includes flow rate, energy consumption, water temperature, sludge volume and energy intensity. The energy intensity is calculated by the ratio of energy consumption to flow rate.

3. The method for predicting energy intensity of a sewage treatment plant according to claim 1, characterized in that: The knowledge creation and knowledge embedding process is combined with the machine learning model to construct a VCL-ML model, which includes a variable cross-layer structure and an ML model, specifically including: sorting the input variables according to the gain values ​​of the respective input variables, wherein the gain values ​​of the input variables are used to characterize the influence of the corresponding input variables on the energy intensity prediction accuracy of the ML model; Based on the sorted input variables, according to the gain values ​​of the input variables, the ML model is trained with the input variable with the highest gain value as the first key feature, and the input variables are added in sequence according to the gain values ​​to iteratively train the ML model, and the performance of the ML model after each training is evaluated, and the trained ML model with the best performance is used as the optimal reduced-order model for predicting energy intensity.

4. The method for predicting energy intensity of a sewage treatment plant according to claim 3, characterized in that: The input variables are sorted according to the gain values ​​of the input variables, specifically including: Get the input variable X∈R N×m , which means that there is a sample x i =[x i1 ,x i2 ,...,x ij ,...,x im ] T i=1,2,...,N and m-dimensional input variable data matrices; Calculating a gain value of the input variable using a tree model, wherein the gain value represents a relative importance of the corresponding input variable in segmenting data in the tree model; Arrange the input variables in descending order of their impact on the energy intensity prediction accuracy of the ML model, and obtain in Represents the column vector of the jth feature, that is 5. The method for predicting energy intensity of a sewage treatment plant according to claim 4, characterized in that: Based on the sorted input variables, according to the gain values ​​of the input variables, the input variable with the highest gain value is used as the first key feature to train the ML model, and the input variables are added in sequence according to the gain values ​​to iteratively train the ML model, and the performance of the ML model after each training is evaluated, and the ML model after training with the best performance is used as the best reduced-order model for predicting energy intensity, specifically including: In the first iteration, the ML model is trained using the input variable with the highest gain value as the first key feature and the performance of the trained ML model is evaluated. In the next iteration, based on the sorted input variables, the next input variable is appended to the first key feature for training and the performance of the trained ML model is evaluated. The above process is repeated until adding input variables no longer improves the performance of the ML model.

6. The method for predicting energy intensity of a sewage treatment plant according to claim 5, characterized in that: The method further comprises: The performance of the ML model was evaluated based on the root mean square error on the test data across iterations.

7. The method for predicting energy intensity of a sewage treatment plant according to claim 3, characterized in that: The method further comprises: Using the root mean square error RMSE, mean absolute error MAE and determination coefficient R 2 The performance of the ML model was evaluated and the root mean square error, mean absolute error and coefficient of determination were calculated using the following formulas: Among them, N represents the total number of samples, Y i and i Indicate the predicted output and actual output of sample i respectively, Represents the average of the actual values ​​of N samples.

8. A device for predicting energy intensity of a sewage treatment plant, characterized in that: include: A data acquisition unit is configured to acquire data and preprocess the data to obtain a basic data set; A knowledge creation unit is configured to create new features based on the basic data set, realize knowledge creation, and construct a variable cross-layer structure, wherein the new features include energy intensity, cross-variables, sewage characteristics, pollutant removal, and time series characteristics; A knowledge embedding unit, configured to embed the new features into a basic data set to obtain a new data set; A model building unit is configured to combine the knowledge creation and knowledge embedding process with the machine learning model to build a VCL-ML model, wherein the VCL-ML model includes a variable cross-layer structure and an ML model; The intensity prediction unit is configured to realize energy intensity prediction of the sewage treatment plant based on the VCL-ML model.

9. An electronic device, characterized in that: include: Controller; A memory for storing one or more programs, which, when executed by the controller, enables the controller to implement the method for predicting energy intensity of a sewage treatment plant as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is enabled to execute the method for predicting energy intensity of a sewage treatment plant according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Transform model-based short-term building cold load prediction model establishment method, prediction method and computer equipment

    CN115391875A

  • Sewage treatment dosage prediction method and system based on LSTM-Attention

    CN117235595A

  • Carbon source delivery model based on LSTM neural network prediction fuzzy control

    CN117311151A

  • Method for improving effluent prediction precision of sewage plant by coupling hydraulic retention time

    CN117388457A

  • Carbon emission accounting method, device and platform for sunken sewage treatment plant

    CN118037513A

Cited By

  • Sewage treatment operation energy consumption optimization method and system based on deep learning

    CN122175084A