A wastewater treatment plant model transfer learning method and system based on causal structure perception
By employing a transfer learning method for wastewater treatment plant models based on causal structure awareness, we have solved the problems of negative transfer and staticization caused by different causal structures, achieved multi-objective optimization and continuous evolution, and improved the prediction accuracy and interpretability of wastewater treatment plants.
Patent Information
- Application Number
- CN202611156217.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-31
- Publication Date
- 2026-11-06
AI Technical Summary
Existing transfer learning schemes for wastewater treatment plants suffer from problems such as negative transfer due to different causal structures, static transfer learning, fragmented multi-objective optimization, and failure of pure data-driven models when data is sparse.
A transfer learning method based on causal structure perception for wastewater treatment plant models is adopted. A causal structure graph is constructed through a time-series causal discovery algorithm. The source domain is screened by combining graph editing distance and causal direction consistency. A multi-objective joint loss function is constructed, and causal structure alignment and continuous transfer learning are implemented, with constraints embedded in the activated sludge model.
It improves the effectiveness and reliability of transfer learning, enables continuous model evolution and multi-objective optimization, and enhances predictive ability and interpretability under changing operating conditions.
Smart Images

Figure CN123049049A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of wastewater treatment and artificial intelligence, and in particular to a transfer learning method and system for wastewater treatment plant models based on causal structure perception. Background Technology
[0002] Wastewater treatment is a crucial link in ensuring water environment safety. With the rapid increase in the number of wastewater treatment plants in my country and increasingly stringent discharge standards, accurately predicting effluent quality and optimizing operational control have become core challenges for the industry. However, newly built wastewater treatment plants or those with limited data acquisition conditions often face insufficient historical data, making it difficult to train high-precision water quality prediction models. Transfer learning provides an effective approach to solving these problems. Its basic idea is to transfer knowledge from source domain wastewater treatment plants (those with mature operational data) to target domain wastewater treatment plants (newly built plants or those with insufficient data) with scarce data, thereby improving the predictive performance of the target domain.
[0003] Currently, researchers have proposed several transfer learning schemes for wastewater treatment scenarios. For example, Chinese invention patent CN121687302A proposes a "wastewater treatment parameter prediction method based on plant group collaborative knowledge transfer." This method considers parameters from three aspects: water quality status, environmental status, and operational status of the target plant and source plants, establishes a corresponding similarity model, and selects source plants for knowledge transfer based on similarity values. Another example is Chinese invention patent CN121526396A, which proposes a "multi-source transfer learning water quality prediction method based on domain alignment and low-rank optimization." This method aligns data features from different water plants through multi-source domain feature extraction algorithms and domain consistency loss functions, and adjusts model parameters using a low-rank fine-tuning algorithm. Furthermore, there are schemes that employ dynamic multi-objective optimization methods based on transfer learning to optimize neural network models, and collaborative optimization control methods that utilize Pareto optimal solutions to construct knowledge information and generate an initial population through knowledge transfer strategies. However, the above-mentioned existing technologies still have the following shortcomings:
[0004] 1) Similarity assessment remains at the level of surface statistical features: Existing schemes mainly rely on statistical distribution similarity (such as maximum mean difference (MMD), feature distribution similarity, etc.) to measure the similarity between the source domain and the target domain, lacking modeling of the deep causal mechanisms of wastewater treatment systems. Wastewater treatment processes involve complex biochemical reaction chains. Two wastewater treatment plants may have similar statistical distributions, but their process causal structures may be completely different—for example, the main influencing factor of effluent COD in plant A is influent COD, while in plant B, dissolved oxygen may become the dominant factor due to process differences. Migrating source domains that are statistically similar but have different causal structures will lead to a serious "negative migration" problem, which will reduce the prediction accuracy of the target domain.
[0005] 2) Static transfer strategies lack continuous evolution capabilities: Existing solutions are mostly "one-time transfers"—selecting the source domain, training the model, and transferring it to the target domain, then no longer updating it. However, the influent water quality, operating conditions, and equipment status of wastewater treatment plants change continuously over time, causing static models to gradually drift and prediction accuracy to decline. Although some solutions introduce the concept of continuous learning, they fail to deeply integrate it with the transfer learning process and lack specific design for the dynamic characteristics of wastewater treatment plants;
[0006] 3) Disconnect between multi-objective optimization and transfer learning: The core contradiction in wastewater treatment is the multi-objective trade-off between achieving water quality standards and saving energy. Although existing technologies involve multi-objective optimization, most treat transfer learning and multi-objective optimization as two independent modules processed sequentially—transfer learning only serves to improve prediction accuracy, while multi-objective optimization is performed separately at the control level, failing to directly embed the multi-objective trade-off between water quality and energy consumption into the loss function of transfer learning;
[0007] 4) Neglecting the integration of domain-specific mechanistic knowledge: Existing solutions rely entirely on data-driven approaches, ignoring the rich mechanistic knowledge already available in the wastewater treatment field (such as the ASM series of activated sludge models). Purely data-driven models are prone to failure when data is sparse or operating conditions change abruptly, and they lack interpretability.
[0008] Therefore, there is an urgent need for a method and system that can systematically solve the problem of model generalization across wastewater treatment plants. Summary of the Invention
[0009] The technical problem to be solved by the present invention is to provide a transfer learning method and system for sewage treatment plant models based on causal structure perception, which addresses the shortcomings of the prior art. The aim is to solve the following technical problems: (1) overcome the negative transfer problem caused by the prior art's reliance on statistical distribution similarity for source domain screening, which results in "statistical similarity but different causality"; (2) overcome the static defect of the existing transfer learning scheme, which is "one-time transfer and cannot continuously evolve"; (3) overcome the problem of the separation between transfer learning and multi-objective optimization in the prior art, so that transfer learning can directly serve the multi-objective optimization of water quality and energy consumption; (4) overcome the problem of the failure of pure data-driven models when data is sparse, and integrate domain mechanism knowledge to improve the robustness and interpretability of the model.
[0010] The technical solution of this invention to solve the above-mentioned technical problems is as follows: A transfer learning method for wastewater treatment plant models based on causal structure perception, comprising the following steps:
[0011] Collect time-series operational data from multiple source and target wastewater treatment plants and perform data preprocessing.
[0012] For each source domain wastewater treatment plant and target domain wastewater treatment plant, a causal structure graph of their respective key variables is constructed based on a time-series causal discovery algorithm;
[0013] Calculate the causal structure similarity between each source domain wastewater treatment plant and the target domain wastewater treatment plant, and select the source domain wastewater treatment plants participating in the migration based on the causal structure similarity as a candidate source domain set. The causal structure similarity is determined based on the temporal causal graph edit distance and causal direction consistency.
[0014] Construct a joint loss function for transfer learning of multi-objective perception, which includes water quality prediction accuracy loss, effluent water quality exceeding constraint loss and energy consumption assessment constraint loss;
[0015] Based on the selected candidate source domain set and the data of the target wastewater treatment plant, the water quality prediction model is trained using the transfer learning joint loss function. During the training process, causal structure orientation alignment constraints and continuous transfer learning based on matrix low-rank decomposition and elastic weight consolidation are implemented.
[0016] The trained water quality prediction model is deployed to the target wastewater treatment plant.
[0017] Based on the above technical solution, the present invention can be further improved as follows:
[0018] Further: The specific steps for constructing the causal structure graph of key variables for each source domain wastewater treatment plant and target domain wastewater treatment plant based on the time-series causal discovery algorithm include the following:
[0019] For any wastewater treatment plant Let its key variable set be ,in The number of variables;
[0020] Collect variables from the set of key variables within a time window. Time series data within ;
[0021] Constraint-based or rating-based causal discovery algorithms are employed, combined with prior knowledge of wastewater treatment processes, to learn the directed acyclic graph structure between variables. ,in For a set of variable nodes, Let be a set of directed edges, each directed edge Representing variables It is a variable The direct cause;
[0022] Based on the aforementioned directed acyclic graph structure Introducing a time delay parameter Construct a time-series cause-effect graph , among which the side express exist The change of time exist The value at any given time has a causal effect.
[0023] The beneficial effects of the above-mentioned further scheme are as follows: by introducing a time-series causal discovery algorithm to construct a causal structure diagram of key variables for each wastewater treatment plant, and by introducing a time delay parameter to characterize the time delay characteristics of the wastewater treatment process, the causal structure diagram can accurately reflect the causal dependence between influent water quality, process parameters and effluent water quality, providing a reliable quantitative basis at the mechanism level for subsequent source domain screening based on causal structure similarity, and fundamentally overcoming the defect of traditional statistical distribution similarity in being unable to distinguish between "statistical correlation" and "causal correlation".
[0024] Further: The calculation of the causal structure similarity between each source region wastewater treatment plant and the target region wastewater treatment plant, and the selection of source region wastewater treatment plants participating in the migration as a candidate source region set based on the causal structure similarity, specifically includes the following steps:
[0025] Calculate the time-series cause-effect graph of the source region wastewater treatment plant Time-series cause-effect graph with the target domain wastewater treatment plant Image editing distance ;
[0026] Calculate the time-series cause-effect graph of the source region wastewater treatment plant Time-series cause-effect graph with the target domain wastewater treatment plant :
[0027]
[0028] in, It must be a very small positive number to prevent division by zero; Indicates source area wastewater treatment plant The set of all directed causal relationships in the temporal causal structure graph; Indicates source area wastewater treatment plant The set of all directed causal relationships in the temporal causal structure graph;
[0029] Edit distance based on the map and Calculate the comprehensive causal structure similarity (CSS):
[0030]
[0031] in, For the weighting coefficients, satisfying , ;
[0032] The source domain factories are sorted and filtered based on the comprehensive causal structure similarity CSS. Wastewater treatment plants in the source region with a causal similarity greater than a preset threshold are considered as candidate source regions. .
[0033] The beneficial effects of the above-mentioned further scheme are as follows: It characterizes the overall similarity of the causal graph structure through graph edit distance, and ensures that the direction of causal relationships remains consistent between the source and target domains through the directional consistency ratio. The weighted sum of these two factors, resulting in the causal structure similarity (CSS), comprehensively quantifies the consistency between the source and target domains at the causal mechanism level from both "structure" and "direction" dimensions. Using CSS as the primary indicator for source domain selection ensures that the transferred knowledge is consistent with the target domain at the mechanistic level, fundamentally solving the negative transfer problem of "statistically similar but causally different" caused by existing technologies that rely solely on statistical distribution similarity.
[0034] Further: The multi-objective joint loss function of the water quality prediction model for:
[0035]
[0036] in, and These are weighting coefficients used to adjust the proportion of water quality constraints and energy consumption constraints in the total loss. To predict accuracy loss, For the loss of effluent quality, Losses are due to energy consumption constraints.
[0037] The loss of prediction accuracy for:
[0038]
[0039] in, This is the set of all directed causal relationships in the causal structure graph of the source wastewater treatment plants involved in the migration. For the prediction loss function, The target domain loss weight coefficient; The water quality prediction model is as follows. These are the model parameters for the water quality prediction model. and The water quality prediction model is defined by the input features of the given source area wastewater treatment plant and the target area wastewater treatment plant, respectively. and The corresponding output water quality prediction value;
[0040] The effluent water quality constraint loss for:
[0041]
[0042] in, This is a set of effluent water quality indicators. For the water quality prediction model, the water quality indicators The predicted value, These are the emission standard limits for the corresponding water quality indicators;
[0043] The energy consumption constraint loss for:
[0044]
[0045] in, This is an energy consumption function estimated based on water quality prediction results, including aeration energy consumption AE and pumping energy consumption PE.
[0046] The beneficial effect of the above-mentioned further solution is that by weighting and combining the loss of prediction accuracy, the loss of effluent water quality exceeding the standard, and the loss of energy consumption assessment, the transfer learning process directly serves the multi-objective optimization of "water quality compliance" and "energy saving". Unlike the traditional solution that processes transfer learning and multi-objective optimization as two independent modules in sequence, the joint loss function of this invention enables the model to optimize towards Pareto optimality during the transfer training stage. The model output naturally takes into account both water quality compliance rate and operational economy, solving the technical problem of the separation between transfer learning and multi-objective optimization.
[0047] Furthermore: The aforementioned implementation of causal structure orientation alignment constraints during training is achieved by incorporating causal consistency loss into the loss function. accomplish:
[0048]
[0049] in, Let be the set of directed edges in the causal graph of the target domain wastewater treatment plant. The output of the water quality prediction model represents the first... Water quality indicators For input The partial derivatives, For the cause-effect graph of the target domain wastewater treatment plant The causal direction symbol.
[0050] The beneficial effect of the above-mentioned further scheme is that by applying alignment constraints at the causal structure level on top of data domain alignment, the model is forced to maintain an input-output relationship consistent with the causal structure of the target domain during training. Causal consistency loss ensures that the mapping relationship learned by the model not only fits the data distribution but also respects the causal chain of biochemical reactions in the wastewater treatment process, thereby improving the model's extrapolation ability and interpretability under changing operating conditions.
[0051] Furthermore, the continuous transfer learning based on low-rank matrix decomposition and elastic weight consolidation includes:
[0052] A continuous learning strategy based on low-rank matrix factorization is adopted to transform the model parameter matrix of the water quality prediction model. Decomposed into a fixed parameter matrix and dynamic parameter matrix :
[0053]
[0054] in, These are the basic parameters learned from the source wastewater treatment plant data. Dynamic parameters are used to fine-tune the relocation task of the target domain's wastewater treatment plant, and Constrained to be a low-rank matrix: ,in , , ;
[0055] Introducing an Elastic Weight Consolidation (EWC) regularization term based on the Fisher information matrix into the multi-objective joint loss function. To protect key parameters of historically learned transfer tasks, flexible weights reinforce regularization terms. for:
[0056]
[0057] in These are the model parameters of the water quality prediction module. Fisher Information Matrix The diagonal elements, the current optimal parameters , To reinforce the regularization strength coefficient for elastic weights.
[0058] The beneficial effects of the above-mentioned further approach are as follows: by decomposing the model parameters into fixed basic parameters and low-rank dynamic parameters through low-rank matrix factorization, the number of parameters that need to be updated is significantly reduced, thereby lowering the computational cost of incremental learning and the risk of overfitting; at the same time, by using elastic weights to consolidate regularization and protect parameters important to historical tasks, catastrophic forgetting is effectively prevented while adapting to new working conditions. The combination of these two approaches enables the model to have the ability to continuously evolve, overcoming the static defect of traditional approaches that are "one-time transfer and unable to evolve continuously".
[0059] Furthermore, the aforementioned wastewater treatment plant model transfer learning method based on causal structure perception also includes the following steps:
[0060] During model deployment and operation, the prediction error drift of the model in the target domain wastewater treatment plant is monitored in real time. When preset drift conditions are met, a new round of source domain screening and incremental transfer learning is automatically triggered, specifically including:
[0061] Calculate the average prediction error within the sliding window. :
[0062]
[0063] in, For window size; Define the start time of the calculation window; The water quality prediction model represents the first... Predicted values of water quality indicators at all times; The water quality prediction model represents the first... Real-time recording of water quality indicators;
[0064] when At that time, the judgment model experienced a significant drift, among which and These represent the mean and standard deviation of the prediction error in the initial stage after migration, respectively. The preset drift sensitivity coefficient;
[0065] After determining the drift, the current causal structure graph of the target domain wastewater treatment plant is reconstructed, and the screening and incremental migration of the source domain wastewater treatment plant are retried, and the model parameters of the water quality prediction model are updated.
[0066] The beneficial effects of the above-mentioned further solutions are: by monitoring the mean and standard deviation of the prediction error online through a sliding window, the degree of model performance degradation can be quantified in real time. When a significant drift is detected, a new round of causal structure reconstruction, source domain re-selection, and incremental transfer training is automatically triggered, enabling the model to continuously track the operating conditions of the target domain wastewater treatment plant. This upgrades transfer learning from a "one-time project" to a "continuously evolving system," solving the engineering pain point of the gradual performance degradation of static models in actual long-term deployment.
[0067] Furthermore, the aforementioned wastewater treatment plant model transfer learning method based on causal structure perception also includes the following steps:
[0068] Constructing Physical Consistency Constraint Loss Using an Activated Sludge Model :
[0069]
[0070] in, Based on the activated sludge model mechanism model, given input and process parameters The theoretical output below, The allowable deviation threshold, It is an indicator function;
[0071] When the prediction output of the water quality prediction model violates the material balance or kinetic constraints of the activated sludge model, the physical consistency constraint loss is introduced into the multi-objective joint loss function. Perform correction;
[0072] Virtual operating condition data was generated using a calibrated activated sludge model and then combined with real sampling data for data augmentation training.
[0073] The beneficial effects of the above-mentioned further scheme are: by embedding the mechanistic knowledge of the activated sludge model as a physical constraint into the transfer learning process, the model output maintains physical rationality in terms of biochemical reaction kinetics, avoiding abnormal predictions that violate the basic material balance when the pure data-driven model produces data sparsity or sudden changes in operating conditions; at the same time, the virtual data generated by the mechanistic model is used to expand the training set, which significantly improves the model's generalization ability and robustness under data sparsity conditions.
[0074] This invention also provides a wastewater treatment plant model transfer learning system based on causal structure awareness, comprising:
[0075] The data acquisition and preprocessing module is used to collect time-series operational data from multiple source and target wastewater treatment plants and to perform data preprocessing.
[0076] The causal structure learning module is used to construct the causal structure graph of key variables for each source domain wastewater treatment plant and target domain wastewater treatment plant based on the time-series causal discovery algorithm.
[0077] The source domain screening module is used to calculate the causal structure similarity between each source domain wastewater treatment plant and the target domain wastewater treatment plant, and to screen the source domain wastewater treatment plants participating in the migration based on the causal structure similarity as a candidate source domain set. The causal structure similarity is determined based on the temporal causal graph edit distance and the consistency of causal direction.
[0078] The multi-objective transfer learning module constructs a joint loss function for multi-objective perception transfer learning, which includes water quality prediction accuracy loss, effluent water quality exceeding constraint loss, and energy consumption assessment constraint loss.
[0079] The multi-objective transfer learning module is also used to transfer train the water quality prediction model based on the selected candidate source domain set and the data of the target domain wastewater treatment plant using the transfer learning joint loss function, and to implement causal structure orientation alignment constraints and continuous transfer learning based on matrix low-rank decomposition and elastic weight consolidation during the training process.
[0080] The deployment module is used to deploy the trained water quality prediction model to the target wastewater treatment plant.
[0081] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the aforementioned transfer learning method for wastewater treatment plant models based on causal structure perception.
[0082] Compared with the prior art, the present invention has the following beneficial effects:
[0083] (1) This invention constructs a causal structure graph for each wastewater treatment plant by introducing a temporal causal discovery algorithm, and uses causal structure similarity (CSS) as the primary indicator for source domain selection, fundamentally solving the negative transfer problem caused by "statistical similarity but different causality". Compared with existing technologies that rely solely on data distribution similarity (such as MMD) for source domain selection, CSS comprehensively quantifies the consistency between the source domain and the target domain at the causal mechanism level from two dimensions: "structure" and "direction" through graph edit distance and directional consistency ratio, ensuring that the transferred knowledge is consistent with the target domain at the mechanism level, and greatly improving the effectiveness and reliability of transfer learning.
[0084] (2) This invention decomposes the model parameters into fixed basic parameters and low-rank dynamic parameters through low-rank matrix factorization, which greatly reduces the number of parameters that need to be updated; at the same time, it consolidates regularization through elastic weights to protect parameters that are important to historical tasks, effectively preventing catastrophic forgetting while adapting to new working conditions. The combination of the two enables the model to have the ability to continuously evolve, overcoming the static defect of traditional schemes that are "one-time migration and cannot continuously evolve".
[0085] (3) This invention combines the prediction accuracy loss, the effluent water quality exceedance constraint loss, and the energy consumption assessment constraint loss in a weighted manner, so that the transfer learning process directly serves the multi-objective optimization of "water quality compliance" and "energy saving". Unlike the traditional scheme that separates transfer learning from multi-objective optimization, the joint loss function of this invention enables the model to optimize towards Pareto optimality during the transfer training stage, and the model output naturally takes into account both water quality compliance rate and operational economy.
[0086] (4) This invention applies alignment constraints at the causal structure level on the basis of data domain alignment, forcing the model to maintain an input-output relationship consistent with the causal structure of the target domain during the learning process, thereby improving the extrapolation ability and interpretability of the model when operating conditions change.
[0087] (5) This invention embeds the mechanistic knowledge of the activated sludge model as a physical constraint into the transfer learning process, so that the model output maintains physical rationality in terms of biochemical reaction kinetics; at the same time, it uses the mechanistic model to generate virtual data to expand the training set, which significantly improves the generalization ability and robustness of the model under data sparsity conditions. Attached Figure Description
[0088] Figure 1 This is a schematic diagram of the transfer learning method for a wastewater treatment plant model based on causal structure perception, according to an embodiment of the present invention.
[0089] Figure 2 This is a schematic diagram of the transfer learning system for a wastewater treatment plant model based on causal structure perception, according to an embodiment of the present invention. Detailed Implementation
[0090] The principles and features of the present invention are described below with reference to the accompanying drawings. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.
[0091] like Figure 1 As shown, a transfer learning method for wastewater treatment plant models based on causal structure perception includes the following steps:
[0092] S1: Collect time-series operational data from multiple source and target wastewater treatment plants and perform data preprocessing;
[0093] S2: For each source domain wastewater treatment plant and target domain wastewater treatment plant, construct their respective key variable causal structure graphs based on the time-series causal discovery algorithm;
[0094] S3: Calculate the causal structure similarity between each source domain wastewater treatment plant and the target domain wastewater treatment plant, and select the source domain wastewater treatment plants participating in the migration based on the causal structure similarity as a candidate source domain set. The causal structure similarity is determined based on the temporal causal graph edit distance and causal direction consistency.
[0095] S4: Construct a joint loss function for transfer learning of multi-target perception, wherein the joint loss function includes water quality prediction accuracy loss, effluent water quality exceeding constraint loss and energy consumption assessment constraint loss;
[0096] S5: Based on the selected candidate source domain set and the data of the target domain wastewater treatment plant, the water quality prediction model is trained using the transfer learning joint loss function, and causal structure orientation alignment constraints and continuous transfer learning based on matrix low-rank decomposition and elastic weight consolidation are implemented during the training process.
[0097] S6: Deploy the trained water quality prediction model to the target wastewater treatment plant.
[0098] In one or more embodiments of the present invention, in step S1, multiple source wastewater treatment plants (denoted as the source set) are collected. ,in ) and target area wastewater treatment plant The time-series operational data includes at least: ① Influent water quality parameters: influent chemical oxygen demand (COD), influent ammonia nitrogen, etc. ① Influent total nitrogen (TN), influent pH, influent suspended solids (SS), etc.; ② Biochemical reactor parameters: dissolved oxygen concentration (DO), nitrate nitrogen concentration (SNO), oxidation-reduction potential (ORP), mixed liquor suspended solids concentration (MLSS), sludge age (SRT), reflux ratio, etc.; ③ Effluent water quality parameters: effluent COD, effluent... ④ Energy consumption parameters: aeration energy consumption (AE), pumping energy consumption (PE), total energy consumption (EC), etc.
[0099] The collected time-series data is then preprocessed, including but not limited to: missing value handling (such as linear interpolation, mean imputation, or time-series-based interpolation methods), outlier detection and removal (such as based on the 3σ criterion or box plot method), data normalization or standardization (such as Z-score standardization or Min-Max normalization), and time series alignment and resampling. The preprocessed data is then used to construct a water quality prediction model.
[0100] In one or more embodiments of the present invention, the step of constructing a causal structure graph of key variables for each source domain wastewater treatment plant and target domain wastewater treatment plant based on a time-series causal discovery algorithm specifically includes the following steps:
[0101] S21: For any wastewater treatment plant Let its key variable set be ,in The number of variables;
[0102] S22: Collect variables from the set of key variables within a time window. Time series data within ;
[0103] S23: Employ constraint-based causal discovery algorithms (such as the PC algorithm) or score-based causal discovery algorithms (such as the NOTEARS algorithm, GES algorithm, etc.), combined with prior knowledge of wastewater treatment processes (such as the causal relationships between dissolved oxygen in aerobic tanks affecting nitrification and nitrate nitrogen in anoxic tanks affecting denitrification), to learn the directed acyclic graph structure between variables. ,in For a set of variable nodes, Let be a set of directed edges, each directed edge Representing variables It is a variable The direct cause;
[0104] S24: Considering the time-delay characteristics of the wastewater treatment process, based on the aforementioned directed acyclic graph structure... Introducing a time delay parameter Construct a time-series cause-effect graph , among which the side express exist The change of time exist The value at any given time has a causal effect.
[0105] By introducing a time-series causal discovery algorithm to construct causal structure diagrams of key variables for each wastewater treatment plant, and by introducing a time delay parameter to characterize the time lag characteristics of the wastewater treatment process, the causal structure diagrams can accurately reflect the causal dependencies between influent water quality, process parameters and effluent water quality. This provides a reliable quantitative basis at the mechanistic level for subsequent source domain screening based on causal structure similarity, fundamentally overcoming the deficiency of traditional statistical distribution similarity in being unable to distinguish between "statistical correlation" and "causal correlation".
[0106] In one or more embodiments of the present invention, the step of calculating the causal structure similarity between each source domain wastewater treatment plant and the target domain wastewater treatment plant, and screening the source domain wastewater treatment plants participating in the migration as a candidate source domain set based on the causal structure similarity, specifically includes the following steps:
[0107] S31: Calculate the time-series cause-effect graph of the source region wastewater treatment plant. Time-series cause-effect graph with the target domain wastewater treatment plant Image editing distance That is, through node insertion, deletion, and replacement operations, as well as edge insertion, deletion, and replacement operations, Convert to Minimum required operating cost;
[0108] S32: Calculate the time-series cause-effect graph of the source region wastewater treatment plant. Time-series cause-effect graph with the target domain wastewater treatment plant :
[0109]
[0110] in, It must be a very small positive number to prevent division by zero; Indicates source area wastewater treatment plant The set of all directed causal relationships in the temporal causal structure graph; Indicates source area wastewater treatment plant The set of all directed causal relationships in the temporal causal structure graph;
[0111] S33: Edit distance based on map and Calculate the Comprehensive Causal Structure Similarity (CSS):
[0112]
[0113] in, For the weighting coefficients, satisfying , ;
[0114] Here, the Comprehensive Causal Structure Similarity (CSS) is used to measure the similarity of source domain wastewater treatment plants. Wastewater treatment plant in the target area The degree of similarity in causal structures between them.
[0115] S34: Sort the source domain factories according to the comprehensive causal structure similarity CSS and filter them out. Greater than the preset causal similarity threshold Wastewater treatment plants in the source region are used as a candidate source region set. .
[0116] In addition, as a supplement, traditional data distribution similarity (such as MMD) can still be calculated for auxiliary screening, and finally, the set of source domain factories participating in the migration can be comprehensively determined. ( ).
[0117] The graph edit distance characterizes the overall similarity of the causal graph structure, while the directional consistency ratio ensures that the direction of causal relationships remains consistent between the source and target domains. The weighted sum of these two metrics, resulting in the causal structure similarity (CSS), comprehensively quantifies the consistency between the source and target domains at the causal mechanism level from both "structure" and "direction" dimensions. Using CSS as the primary indicator for source domain selection ensures that the transferred knowledge is consistent with the target domain at the mechanistic level, fundamentally solving the negative transfer problem of "statistically similar but causally different" caused by existing technologies that rely solely on statistical distribution similarity.
[0118] In one or more embodiments of the present invention, the multi-objective joint loss function of the water quality prediction model for:
[0119]
[0120] in, and These are weighting coefficients used to adjust the proportion of water quality constraints and energy consumption constraints in the total loss. They can be dynamically adjusted according to actual operational needs (e.g., increased during periods of strict environmental inspections). Increase electricity prices during peak periods ), To predict accuracy loss, For the loss of effluent quality, Losses are due to energy consumption constraints.
[0121] The loss of prediction accuracy for:
[0122]
[0123] in, This is the set of all directed causal relationships in the causal structure graph of the source wastewater treatment plants involved in the migration. The prediction loss function (such as mean squared error MSE or mean absolute error MAE). The target domain loss weight coefficient; The water quality prediction model is as follows. These are the model parameters for the water quality prediction model. and The water quality prediction model is defined by the input features of the given source area wastewater treatment plant and the target area wastewater treatment plant, respectively. and The corresponding output water quality prediction value;
[0124] The effluent water quality constraint loss for:
[0125]
[0126] in, A set of effluent water quality indicators (COD, , TN, etc. For the water quality prediction model, the water quality indicators The predicted value, These are the emission standard limits for the corresponding water quality indicators;
[0127] The energy consumption constraint loss for:
[0128]
[0129] in, This is an energy consumption function estimated based on water quality prediction results, including aeration energy consumption AE and pumping energy consumption PE. Specifically, based on the predicted effluent water quality indicators and combined with the process parameters of the wastewater treatment plant (such as treatment volume, aeration volume, return ratio, etc.), the energy consumption required to achieve the predicted effluent water quality is estimated.
[0130] By weighting and combining the losses from prediction accuracy, effluent quality exceedance constraints, and energy consumption assessment constraints, the transfer learning process directly serves the multi-objective optimization of "water quality compliance" and "energy saving." Unlike traditional solutions that process transfer learning and multi-objective optimization as two independent modules sequentially, the joint loss function of this invention enables the model to optimize towards Pareto optimality during the transfer training phase. The model output naturally balances water quality compliance rate and operational economy, solving the technical problem of the separation between transfer learning and multi-objective optimization.
[0131] In embodiments of the present invention, during the training process of the water quality prediction model, in addition to performing domain alignment at the data level (minimizing the feature distribution difference between the source domain and the target domain through a domain discriminator or MMD loss), alignment constraints are also applied at the causal structure level.
[0132] In one or more embodiments of the present invention, the implementation of causal structure orientation alignment constraints during training is achieved by adding causal consistency loss to the loss function. accomplish:
[0133]
[0134] in, Let be the set of directed edges in the causal graph of the target domain wastewater treatment plant. The output of the water quality prediction model represents the first... Water quality indicators For input The partial derivatives (i.e., causal effects) of . For the cause-effect graph of the target domain wastewater treatment plant The causal direction symbol.
[0135] By imposing alignment constraints at the causal structure level on top of data domain alignment, the model is forced to maintain an input-output relationship consistent with the causal structure of the target domain during training. Causal consistency loss ensures that the mapping relationship learned by the model not only fits the data distribution but also respects the causal chain of biochemical reactions in the wastewater treatment process, thereby improving the model's extrapolation ability and interpretability under changing operating conditions.
[0136] In one or more embodiments of the present invention, the continuous transfer learning based on low-rank matrix decomposition and elastic weight consolidation includes:
[0137] A continuous learning strategy based on low-rank matrix factorization is adopted to transform the model parameter matrix of the water quality prediction model. Decomposed into a fixed parameter matrix and dynamic parameter matrix :
[0138]
[0139] in, These are the basic parameters learned from the source wastewater treatment plant data (to be determined after migration). Dynamic parameters are used to fine-tune the relocation task of the target domain's wastewater treatment plant, and Constrained to be a low-rank matrix: ,in , , ;
[0140] An Elastic Weight Consolidation (EWC) regularization term based on the Fisher information matrix is introduced into the multi-objective joint loss function. To protect key parameters of historically learned transfer tasks, flexible weights reinforce regularization terms. for:
[0141]
[0142] in These are the model parameters of the water quality prediction module. Fisher Information Matrix The diagonal elements, the current optimal parameters , This strengthens the regularization strength coefficient for the elastic weights. The regularization term is used to penalize the parameters. Deviating from the optimal parameters of the learned task This behavior allows them to retain historical knowledge while adapting to new tasks.
[0143] By decomposing the model parameters into fixed basic parameters and low-rank dynamic parameters through low-rank matrix factorization, the number of parameters that need to be updated is significantly reduced, lowering the computational cost of incremental learning and the risk of overfitting. At the same time, elastic weights reinforce regularization to protect parameters important to historical tasks, effectively preventing catastrophic forgetting while adapting to new conditions. The combination of these two approaches enables the model to continuously evolve, overcoming the static defect of traditional solutions that are "one-time transfers and cannot continuously evolve."
[0144] Optionally, in one or more embodiments of the present invention, the wastewater treatment plant model transfer learning method based on causal structure awareness further includes the following steps:
[0145] S7: During model deployment and operation, monitor the prediction error drift of the model in the target domain wastewater treatment plant in real time. When the preset drift conditions are met, automatically trigger a new round of source domain screening and incremental transfer learning, specifically including:
[0146] S71: Calculate the average prediction error within the sliding window. :
[0147]
[0148] in, For window size; Define the start time of the calculation window; The water quality prediction model represents the first... Predicted values of water quality indicators (such as effluent COD) at all times; The water quality prediction model represents the first... Real-time recording of water quality indicators;
[0149] S72: When At that time, the judgment model experienced a significant drift, among which and These represent the mean and standard deviation of the prediction error in the initial stage after migration, respectively. The preset drift sensitivity coefficient (recommended value is 2~3);
[0150] S73: After determining the drift, reconstruct the current causal structure graph of the target domain wastewater treatment plant and re-trigger the screening and incremental migration of the source domain wastewater treatment plant, and update the model parameters of the water quality prediction model.
[0151] By using a sliding window to monitor the mean and standard deviation of prediction errors online, the degree of model performance degradation is quantified in real time. When significant drift is detected, a new round of causal structure reconstruction, source domain re-selection, and incremental transfer training is automatically triggered, enabling the model to continuously track the operating conditions of the target domain wastewater treatment plant. This upgrades transfer learning from a "one-time project" to a "continuously evolving system," solving the engineering pain point of static models gradually degrading in actual long-term deployment.
[0152] Optionally, in one or more embodiments of the present invention, the wastewater treatment plant model transfer learning method based on causal structure awareness further includes the following steps:
[0153] S81: Construct physical consistency constraint loss using activated sludge models (including ASM1, ASM2, ASM3, or their simplified versions). :
[0154]
[0155] in, Based on the activated sludge model mechanism model, given input and process parameters The theoretical output below, The allowable deviation threshold, It is an indicator function;
[0156] S82: When the prediction output of the water quality prediction model violates the material balance or kinetic constraints of the activated sludge model, the physical consistency constraint loss is introduced into the multi-objective joint loss function. Perform correction;
[0157] S83: Use the calibrated activated sludge model to generate virtual operating condition data, and combine it with real sampling data for data augmentation training.
[0158] By embedding the mechanistic knowledge of the activated sludge model as a physical constraint into the transfer learning process, the model output maintains physical rationality in terms of biochemical reaction kinetics, avoiding abnormal predictions that violate the basic material balance when the pure data-driven model produces data sparsity or sudden changes in operating conditions. At the same time, virtual data generated by the mechanistic model is used to expand the training set, which significantly improves the model's generalization ability and robustness under data sparsity conditions.
[0159] The final output of the trained water quality prediction model includes:
[0160] ① Water quality prediction values: Predicted values and confidence intervals for various effluent water quality indicators of the wastewater treatment plant in the target area; ② Causal explanation: Based on model parameters and causal structure diagrams, output the key causal paths affecting various water quality indicators, providing interpretable decision-making basis for operators; ③ Multi-objective assessment: Simultaneously provide the estimated energy consumption and compliance risk level under the current predicted water quality, assisting operators in making multi-objective trade-off decisions on water quality and energy consumption.
[0161] Taking three wastewater treatment plants in a certain city as an example, namely Plant A (A²O process, treatment capacity 100,000 tons / day), Plant B (oxidation ditch process, treatment capacity 50,000 tons / day), and Plant C (A²O process, treatment capacity 80,000 tons / day), the target domain is the newly constructed Plant D (A²O process, treatment capacity 60,000 tons / day, with only 3 months of historical data). Time-series data of key variables for each plant over the past 12 months were collected, including influent COD, influent... Influent TN, Dissolved Oxygen DO, Nitrate Nitrogen (SNO), Sludge Concentration (MLSS), Effluent COD, Effluent Nine key variables, including effluent TN.
[0162] For any wastewater treatment plant D, let its set of key variables be... These correspond to the nine key variables mentioned above. Time-series data X(1:T) = {x(1), x(2), ..., x(180)} for each variable were collected within a time window T (T=180 days), with a sampling interval of one day. A time-series causal discovery algorithm based on NOTEARS was used, combined with prior knowledge of the A²O process (such as DO → nitrate nitrogen in the aerobic tank, nitrate nitrogen → total nitrogen removal in the anoxic tank, etc.), to learn the directed acyclic graph structure between variables. In the causal discovery process, a time delay parameter τ (t=1 day) is introduced to construct a time-series causal graph. , among which the side express exist The change of time exist The value at any given time has a causal effect.
[0163] Taking Plant D as an example, the constructed time-series cause-effect graph contains the following key causal paths: influent COD(t-1) → effluent COD(t), influent →Water output DO(t-1)→SNO(t), SNO(t-1)→effluent TN(t), etc. These causal pathways are consistent with the biochemical reaction mechanism of the A²O process, verifying the rationality of the causal structure diagram.
[0164] After constructing the time-series causal structure graphs for plants A, B, C, and D respectively, the causal structure similarity (CSS) between each source domain plant and plant D is calculated, with α=0.6 and β=0.4.
[0165] (1) CSS(Plant A, Plant D) = 0.87. Plant A and Plant D are both A² / O processes, and their causal structures are highly similar. The causal graphs of the two plants have a high proportion of common directed edges and the directions are consistent.
[0166] (2) CSS(Plant B, Plant D) = 0.52. Plant B uses an oxidation ditch process, which differs from the biochemical reaction pathway of the A²O process. The causal structure is significantly different, the graph editing distance is large, and the directional consistency is low.
[0167] (3) CSS(Plant C, Plant D) = 0.91. Plant C uses the same A²O process and has a similar processing scale to Plant D, so the causal structure similarity is the highest.
[0168] Set causal similarity threshold = 0.70, selecting Factory A (CSS=0.87) and Factory C (CSS=0.91) as the candidate source domain set. Factory B (CSS=0.52) was excluded because its causal structure similarity was below the threshold.
[0169] In contrast, if only the traditional data distribution similarity (MMD) method is used for evaluation, Plant B might be mistakenly selected as the source domain due to its similar statistical distribution of influent water quality to Plant D. Practical verification shows that if Plant B is used as the source domain for migration, the model's prediction accuracy at Plant D is actually lower than the baseline model without migration. This verifies that the causal structure similarity evaluation method of this invention effectively avoids the negative migration problem caused by "statistical similarity but different causality".
[0170] Taking the prediction of effluent COD and effluent TN of target domain D plant as an example, a water quality prediction model based on multilayer perceptron (MLP) is constructed. Water quality prediction model Input features include influent COD, influent The system uses six variables, including influent TN, DO, SNO, and MLSS, and has two output nodes to predict effluent COD and effluent TN.
[0171] Mean squared error (MSE) is used as the prediction loss function. The source domain data comes from factories A and C (each with data from the past 6 months, totaling approximately 720 samples), while the target domain data comes from factory D (only 3 months of data, totaling approximately 90 samples). =0.3 to balance the loss contributions of the source and target domains.
[0172] According to the Class A standard of the "Discharge Standard of Pollutants for Municipal Wastewater Treatment Plants" (GB 18918-2002), the limit for effluent COD is 50 mg / L, and the limit for effluent TN is 15 mg / L. The system penalizes cases where predicted values exceed limits: when A second penalty is applied when the value is >50. The same penalty applies when the value is >15.
[0173] Based on the predicted effluent COD and TN values, and combined with the process parameters of Plant D (treatment capacity of 60,000 tons / day, aeration tank volume of 8,000 m³, internal recirculation ratio of 200%, etc.), an energy consumption estimation function was used. Calculate the required aeration energy consumption (AE) and pumping energy consumption (PE). Specifically, AE is calculated based on the difference between the predicted effluent COD and TN and the target values to estimate the required oxygen and aeration volume, and PE is calculated based on the return ratio and treatment capacity to estimate the pumping power.
[0174] set up = 0.5 (water quality constraint weight). = 0.3 (energy consumption constraint weight). = 0.3, trained using the Adam optimizer with a learning rate of 0.001 and 200 training epochs. After training, the model's RMSE for effluent COD prediction on the D plant validation set was 4.8 mg / L, and the RMSE for effluent TN prediction was 2.1 mg / L, which is better than the baseline model trained using only prediction accuracy loss (RMSEs of 6.2 mg / L and 2.8 mg / L, respectively).
[0175] During model training, in addition to data-level alignment (minimizing the feature distribution difference between the source and target domains through MMD loss), a causal structure orientation alignment constraint is further applied. Specifically, the temporal causal graph of factory D in Example 1 is... The set of directed edges in As an alignment target:
[0176] Includes the following key causal edges: Influent COD → Effluent COD, Influent →Water output DO→SNO, SNO→effluent TN, influent COD→DO (aerobic stage carbon oxidation oxygen consumption), etc.
[0177] Add causal consistency loss to the training loss For each causal edge Calculation model output For input partial derivatives The sign of the partial derivative is required to be consistent with that in the causal graph of the target domain. Direction symbols Consistent.
[0178] In this embodiment, the weight of the causal consistency loss is set to 0.1. After adding causal alignment, the causal direction consistency rate of the model increased from 68% at the beginning of training to 89% at the end of training, indicating that the input-output relationship learned by the model tends to be consistent with the causal structure of the wastewater treatment process in the target domain. At the same time, the model's prediction robustness under the fluctuation of the operating conditions of Plant D is significantly improved—in the test scenario where the influent COD suddenly increases by 20%, the prediction error of the model with causal alignment increases by 12%, while the error of the baseline model without causal alignment increases by 28%.
[0179] During model training, a low-rank continuous transfer learning strategy is employed. The parameter matrix of the MLP prediction model is... (Input layer dimension 6, hidden layer dimension 64, output layer dimension 2, total number of parameters approximately 500) Decomposed into a fixed parameter matrix and dynamic parameter matrix .
[0180] Specifically, the model parameters obtained from pre-training data from factories A and C will be used as... These parameters remain fixed after migration to Plant D. Dynamic parameters It is constrained to be a low-rank matrix, with the rank r=4 (which is much smaller than min(6,64)=6). ,in , This reduces the number of parameters that need to be updated from approximately 500 to approximately 280 (6×4+64×4), a reduction of approximately 44%.
[0181] Elastic Weight Consolidation (EWC) regularization is introduced during the model's subsequent continuous learning process. After each incremental update, the diagonal elements of the Fisher information matrix of the model parameters are calculated. In the next update, EWC regularization is applied to penalize parameters that deviate from the learned task-optimal parameters. Behavior. Settings = 1000. With EWC protection, the model's prediction accuracy on the first task decreased by only 3.5% after learning three incremental tasks consecutively, while the accuracy of the model without EWC decreased by 18.7%.
[0182] After the model was deployed and running at Plant D, its prediction error was continuously monitored. The average prediction error for the first month after initial deployment was [value missing]. = 4.2 mg / L (RMSE of COD), standard deviation is = 1.1 mg / L. Set the drift sensitivity coefficient. = 2.5, drift detection threshold is +2.5× = 4.2 + 2.75 = 6.95 mg / L.
[0183] By the eighth month of operation, due to the renovation of the urban water supply network in the city where Plant D is located, the influent water quality changed significantly. The average COD of the influent increased from 350 mg / L to 420 mg / L. The mean value increased from 25 mg / L to 38 mg / L. The mean prediction error within the sliding window (W=30 days) increased to 7.3 mg / L, exceeding the threshold of 6.95 mg / L, and the system automatically triggered a new round of transfer learning.
[0184] After triggering a new round of migration, the system reconstructs the current causal structure graph of Plant D. Due to changes in influent water quality, the causal edge strength of influent COD→DO in the new causal graph is significantly enhanced, and at the same time, the influent... →A new branch appears in the causal path of the effluent TN. The system recalculates the CSS values of the new causal graph between each source domain plant and plant D. It finds that the CSS of plant C remains at a high level (0.88), while the CSS of plant A has decreased (0.79), but is still above the threshold of 0.70. Using plants A and C as source domains, the system performs incremental transfer learning training using the latest data from plant D over the past three months (using low-rank updates, only updating...). (In part, EWC protects historical parameters), the model prediction error recovered to 4.5 mg / L after training.
[0185] This embodiment demonstrates that the online assessment and automatic triggering mechanism for transfer suitability of the present invention can detect model performance degradation in real time and automatically trigger a new round of source domain screening and incremental transfer based on causal structure perception, thereby realizing the upgrade of transfer learning from a "one-off project" to a "continuously evolving system".
[0186] In the early stages when data for Plant D was particularly sparse (only one month's worth of data was available), a purely data-driven model was difficult to train. This embodiment utilizes the ASM1 model to establish a simplified mechanistic model of Plant D. This model is based on the design parameters of Plant D (treatment capacity 60,000 tons / day, aerobic tank volume 8000 m³, anoxic tank volume 4000 m³, design influent COD 350 mg / L, design influent...). (e.g., 30 mg / L), key kinetic parameters for calibrating the ASM1 model: maximum specific growth rate of heterotrophic bacteria. Maximum specific growth rate of autotrophic bacteria Hydrolysis rate wait.
[0187] Introducing physical consistency constraints into the loss function When model predictions violate the material balance described by the ASM1 model (e.g., effluent COD prediction is higher than influent COD prediction, violating COD mass conservation) or biochemical reaction kinetic constraints (e.g., nitrification rate exceeds the theoretical maximum under substrate limitations), a penalty is imposed on the excess. An allowable deviation threshold is set. = 5.0 mg / L (COD) and 1.0 mg / L ( ).
[0188] Simultaneously, using the calibrated ASM1 model, 500 sets of virtual operating condition data under different influent conditions were generated using the Monte Carlo method, including variations in influent COD within the range of 200–600 mg / L, and influent... Combinations of 20–60 mg / L variation and influent TN variation within the 25–50 mg / L range were used, with each data set including a 24-hour time-series curve. These virtual data were then mixed with real data for model training.
[0189] Under the condition of having only one month of extremely sparse real data, the mechanism-data fusion method of the present invention improved the R² of the prediction model on the test set from 0.52 to 0.84 (COD) and from 0.48 to 0.81 (TN) for the pure data-driven model, while reducing the physical consistency violation rate from 22% to 3.5%, thus verifying the effectiveness of ASM mechanism constraints and virtual data augmentation.
[0190] like Figure 2 As shown, the present invention also provides a wastewater treatment plant model transfer learning system based on causal structure perception, comprising:
[0191] The data acquisition and preprocessing module is used to collect time-series operational data from multiple source and target wastewater treatment plants and to perform data preprocessing.
[0192] The causal structure learning module is used to construct the causal structure graph of key variables for each source domain wastewater treatment plant and target domain wastewater treatment plant based on the time-series causal discovery algorithm.
[0193] The source domain screening module is used to calculate the causal structure similarity between each source domain wastewater treatment plant and the target domain wastewater treatment plant, and to screen the source domain wastewater treatment plants participating in the migration based on the causal structure similarity as a candidate source domain set. The causal structure similarity is determined based on the temporal causal graph edit distance and the consistency of causal direction.
[0194] The multi-objective transfer learning module constructs a joint loss function for multi-objective perception transfer learning, which includes water quality prediction accuracy loss, effluent water quality exceeding constraint loss, and energy consumption assessment constraint loss.
[0195] The multi-objective transfer learning module is also used to transfer train the water quality prediction model based on the selected candidate source domain set and the data of the target domain wastewater treatment plant using the transfer learning joint loss function, and to implement causal structure orientation alignment constraints and continuous transfer learning based on matrix low-rank decomposition and elastic weight consolidation during the training process.
[0196] The deployment module is used to deploy the trained water quality prediction model to the target wastewater treatment plant.
[0197] Optionally, the wastewater treatment plant model transfer learning system based on causal structure awareness further includes an online transfer suitability assessment and triggering module, used to monitor model prediction error drift in real time and automatically trigger a new round of transfer learning, specifically including:
[0198] During model deployment and operation, the prediction error drift of the model in the target domain wastewater treatment plant is monitored in real time. When preset drift conditions are met, a new round of source domain screening and incremental transfer learning is automatically triggered, specifically including:
[0199] Calculate the average prediction error within the sliding window. :
[0200]
[0201] in, For window size; Define the start time of the calculation window; The water quality prediction model represents the first... Predicted values of water quality indicators (such as effluent COD) at all times; The water quality prediction model represents the first... Real-time recording of water quality indicators;
[0202] when At that time, the judgment model experienced a significant drift, among which and These represent the mean and standard deviation of the prediction error in the initial stage after migration, respectively. The preset drift sensitivity coefficient;
[0203] After determining the drift, the current causal structure graph of the target domain wastewater treatment plant is reconstructed, and the screening and incremental migration of the source domain wastewater treatment plant are retried, and the model parameters of the water quality prediction model are updated.
[0204] Optionally, the wastewater treatment plant model transfer learning system based on causal structure awareness further includes a consistency constraint calibration module, used to construct a physical consistency constraint loss using the activated sludge model. :
[0205]
[0206] in, Based on the activated sludge model mechanism model, given input and process parameters The theoretical output below, The allowable deviation threshold, It is an indicator function;
[0207] When the prediction output of the water quality prediction model violates the material balance or kinetic constraints of the activated sludge model, the physical consistency constraint loss is introduced into the multi-objective joint loss function. Perform correction;
[0208] Virtual operating condition data was generated using a calibrated activated sludge model and then combined with real sampling data for data augmentation training.
[0209] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the aforementioned transfer learning method for wastewater treatment plant models based on causal structure perception.
[0210] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A transfer learning method for wastewater treatment plant models based on causal structure perception, characterized in that, Includes the following steps: Collect time-series operational data from multiple source and target wastewater treatment plants and perform data preprocessing. For each source domain wastewater treatment plant and target domain wastewater treatment plant, a causal structure graph of their respective key variables is constructed based on a time-series causal discovery algorithm; Calculate the causal structure similarity between each source domain wastewater treatment plant and the target domain wastewater treatment plant, and select the source domain wastewater treatment plants participating in the migration based on the causal structure similarity as a candidate source domain set. The causal structure similarity is determined based on the temporal causal graph edit distance and causal direction consistency. Construct a joint loss function for transfer learning of multi-objective perception, which includes water quality prediction accuracy loss, effluent water quality exceeding constraint loss and energy consumption assessment constraint loss; Based on the selected candidate source domain set and the data of the target wastewater treatment plant, the water quality prediction model is trained using the transfer learning joint loss function. During the training process, causal structure orientation alignment constraints and continuous transfer learning based on matrix low-rank decomposition and elastic weight consolidation are implemented. The trained water quality prediction model is deployed to the target wastewater treatment plant.
2. The wastewater treatment plant model transfer learning method based on causal structure perception according to claim 1, characterized in that, The specific steps for constructing a causal structure graph of key variables for each source domain wastewater treatment plant and target domain wastewater treatment plant based on the time-series causal discovery algorithm include the following: For any wastewater treatment plant Let its key variable set be , in The number of variables; Collect variables from the set of key variables within a time window. Time series data within ; Constraint-based or rating-based causal discovery algorithms are employed, combined with prior knowledge of wastewater treatment processes, to learn the directed acyclic graph structure between variables. ,in For a set of variable nodes, Let be a set of directed edges, each directed edge Representing variables It is a variable The direct cause; Based on the aforementioned directed acyclic graph structure Introducing a time delay parameter Construct a time-series cause-effect graph , among which the side express exist The change of time exist The value at any given time has a causal effect.
3. The wastewater treatment plant model transfer learning method based on causal structure perception according to claim 1, characterized in that, The calculation of the causal structure similarity between each source domain wastewater treatment plant and the target domain wastewater treatment plant, and the selection of source domain wastewater treatment plants participating in the migration as a candidate source domain set based on the causal structure similarity, specifically includes the following steps: Calculate the time-series cause-effect graph of the source region wastewater treatment plant Time-series cause-effect graph with the target domain wastewater treatment plant Image editing distance ; Calculate the time-series cause-effect graph of the source region wastewater treatment plant Time-series cause-effect graph with the target domain wastewater treatment plant Commonly agreed-upon proportion of directional consistent edges : ; in, It must be a very small positive number to prevent division by zero; Indicates source area wastewater treatment plant The set of all directed causal relationships in the temporal causal structure graph; Indicates source area wastewater treatment plant The set of all directed causal relationships in the temporal causal structure graph; Edit distance based on the map and direction consistency ratio Calculate the comprehensive causal structure similarity (CSS): ; in, For the weighting coefficients, satisfying , ; The source domain factories are sorted and filtered based on the comprehensive causal structure similarity CSS. Wastewater treatment plants in the source region with a causal similarity greater than a preset threshold are considered as candidate source regions. .
4. The wastewater treatment plant model transfer learning method based on causal structure perception according to claim 1, characterized in that, The multi-objective joint loss function of the water quality prediction model for: ; in, and These are weighting coefficients used to adjust the proportion of water quality constraints and energy consumption constraints in the total loss. To predict accuracy loss, For the loss of effluent quality, Losses are due to energy consumption constraints. The loss of prediction accuracy for: ; in, This is the set of all directed causal relationships in the causal structure graph of the source wastewater treatment plants involved in the migration. For the prediction loss function, The target domain loss weight coefficient; The water quality prediction model is as follows. These are the model parameters for the water quality prediction model. and The water quality prediction model is defined by the input features of the given source area wastewater treatment plant and the target area wastewater treatment plant, respectively. and The corresponding output water quality prediction value; The effluent water quality constraint loss for: ; in, This is a set of effluent water quality indicators. For the water quality prediction model, the water quality indicators The predicted value, These are the emission standard limits for the corresponding water quality indicators; The energy consumption constraint loss for: ; in, This is an energy consumption function estimated based on water quality prediction results, including aeration energy consumption AE and pumping energy consumption PE.
5. The wastewater treatment plant model transfer learning method based on causal structure perception according to claim 1, characterized in that, The implementation of causal structure orientation alignment constraints during training involves adding causal consistency loss to the loss function. accomplish: ; in, Let be the set of directed edges in the causal graph of the target domain wastewater treatment plant. The output of the water quality prediction model represents the first... Water quality indicators For input The partial derivatives, For the cause-effect graph of the target domain wastewater treatment plant The causal direction symbol.
6. The wastewater treatment plant model transfer learning method based on causal structure perception according to claim 1, characterized in that, The continuous transfer learning based on low-rank matrix decomposition and elastic weight consolidation includes: A continuous learning strategy based on low-rank matrix factorization is adopted to transform the model parameter matrix of the water quality prediction model. Decomposed into a fixed parameter matrix and dynamic parameter matrix : ; in, These are the basic parameters learned from the source wastewater treatment plant data. Dynamic parameters are used to fine-tune the relocation task of the target domain's wastewater treatment plant, and Constrained to be a low-rank matrix: ,in , , ; Introducing an Elastic Weight Consolidation (EWC) regularization term based on the Fisher information matrix into the multi-objective joint loss function. To protect key parameters of historically learned transfer tasks, flexible weights reinforce regularization terms. for: ; in These are the model parameters of the water quality prediction module. Fisher Information Matrix The diagonal elements, the current optimal parameters , To reinforce the regularization strength coefficient for elastic weights.
7. The wastewater treatment plant model transfer learning method based on causal structure perception according to claim 1, characterized in that, It also includes the following steps: During model deployment and operation, the prediction error drift of the model in the target domain wastewater treatment plant is monitored in real time. When preset drift conditions are met, a new round of source domain screening and incremental transfer learning is automatically triggered, specifically including: Calculate the average prediction error within the sliding window. : ; in, For window size; Define the start time of the calculation window; The water quality prediction model represents the first... Predicted values of water quality indicators at all times; The water quality prediction model represents the first... Real-time recording of water quality indicators; when At that time, the judgment model experienced a significant drift, among which and These represent the mean and standard deviation of the prediction error in the initial stage after migration, respectively. The preset drift sensitivity coefficient; After determining the drift, the current causal structure graph of the target domain wastewater treatment plant is reconstructed, and the screening and incremental migration of the source domain wastewater treatment plant are retried, and the model parameters of the water quality prediction model are updated.
8. The wastewater treatment plant model transfer learning method based on causal structure perception according to any one of claims 1-7, characterized in that, It also includes the following steps: Constructing Physical Consistency Constraint Loss Using an Activated Sludge Model : ; in, Based on the activated sludge model mechanism model, given input and process parameters The theoretical output below, The allowable deviation threshold, It is an indicator function; When the prediction output of the water quality prediction model violates the material balance or kinetic constraints of the activated sludge model, the physical consistency constraint loss is introduced into the multi-objective joint loss function. Perform correction; Virtual operating condition data was generated using a calibrated activated sludge model and then combined with real sampling data for data augmentation training.
9. A wastewater treatment plant model transfer learning system based on causal structure perception, characterized in that, include: The data acquisition and preprocessing module is used to collect time-series operational data from multiple source and target wastewater treatment plants and to perform data preprocessing. The causal structure learning module is used to construct the causal structure graph of key variables for each source domain wastewater treatment plant and target domain wastewater treatment plant based on the time-series causal discovery algorithm. The source domain screening module is used to calculate the causal structure similarity between each source domain wastewater treatment plant and the target domain wastewater treatment plant, and to screen the source domain wastewater treatment plants participating in the migration based on the causal structure similarity as a candidate source domain set. The causal structure similarity is determined based on the temporal causal graph edit distance and the consistency of causal direction. The multi-objective transfer learning module constructs a joint loss function for multi-objective perception transfer learning, which includes water quality prediction accuracy loss, effluent water quality exceeding constraint loss, and energy consumption assessment constraint loss. The multi-objective transfer learning module is also used to transfer train the water quality prediction model based on the selected candidate source domain set and the data of the target domain wastewater treatment plant using the transfer learning joint loss function, and to implement causal structure orientation alignment constraints and continuous transfer learning based on matrix low-rank decomposition and elastic weight consolidation during the training process. The deployment module is used to deploy the trained water quality prediction model to the target wastewater treatment plant.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the wastewater treatment plant model transfer learning method based on causal structure perception as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Multi-source transfer learning water quality prediction method based on domain alignment and low-rank optimization
CN121526396A
Sewage treatment parameter prediction method based on plant group collaborative knowledge migration
CN121687302A
