Sewage effluent prediction method based on learnable decomposition and causal graph network

By constructing a learnable decomposition and causal graph network, the problem of neglecting variable dependencies in existing wastewater quality prediction methods is solved. This achieves accurate prediction of the wastewater treatment process and improves the robustness of the model, adapting to changes in operating conditions and enhancing the ability to characterize the causal influence between variables in the wastewater treatment process.

CN122364928APending Publication Date: 2026-07-10HUNAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610698960.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-20
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing wastewater quality prediction methods ignore the dependencies between variables, making it difficult to handle both long-term trends and short-term disturbances simultaneously. This results in poor generalization ability of the models during wastewater treatment, and existing methods fail to effectively characterize the causal effects between influent water quality, process operating parameters, and effluent water quality.

Method used

We employ learnable decomposition and causal graph networks. By constructing a learnable temporal decomposition module, we decompose the input tensor into trend components and residual components. We utilize Granger causal adjacency matrices and adaptive adjacency matrices to mine spatial dependencies between variables. We combine gated dilated convolution to capture long-distance temporal dependencies and use a composite loss function for model training.

Benefits of technology

It achieves accurate prediction of wastewater treatment processes under complex operating conditions, improves the robustness of long-term prediction and the generalization performance of the model, can adapt to changes in operating conditions, and enhances the ability to characterize the causal effects between variables in the wastewater treatment process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122364928A_ABST
    Figure CN122364928A_ABST
Patent Text Reader

Abstract

This application provides a wastewater effluent prediction method based on learnable decomposition and causal graph networks, comprising: acquiring multivariate time-series monitoring data of a wastewater treatment plant, performing missing value imputation, outlier correction, and standardization processing to construct a normalized input tensor; constructing a learnable time-series decomposition module to decompose the input tensor into trend components and residual components; constructing a Granger causal adjacency matrix between variables based on a training set, and combining it with an adaptive adjacency matrix to form a graph convolution support set; based on the residual components, using the Granger causal adjacency matrix and the adaptive adjacency matrix to mine the implicit spatial dependencies between variables, and capturing long-distance temporal dependencies through gated dilated convolution to obtain the prediction results of the residual components; based on the trend components, using a simple linear mapping method to capture the smooth long-term variation law of the wastewater treatment plant to obtain the prediction results of the trend components; fusing the trend component prediction results and the residual component prediction results to output future multi-step multivariate prediction results; and using a composite loss function to train the model and update its parameters, wherein the composite loss includes mean absolute error and dynamic rate of change error. This application can improve the prediction accuracy of key effluent indicators and the reliability of online early warning under complex operating conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent monitoring and prediction technology for wastewater treatment, and in particular to a wastewater effluent prediction method based on learnable decomposition and causal graph networks. Background Technology

[0002] Currently, global freshwater resources are extremely limited. Of the Earth's total water volume of approximately 1.4 billion cubic kilometers, freshwater accounts for only 2.5%, and the freshwater resources truly available for direct human use comprise only 0.0075% of the total. Wastewater treatment plants can transform wastewater into usable water resources, simultaneously breaking the vicious cycle of water pollution exacerbating water scarcity. Therefore, monitoring the effluent quality of wastewater treatment plants is crucial. However, in actual wastewater treatment processes, effluent quality is comprehensively affected by multiple variables, including influent water quality, water load, and environmental factors. These variables exhibit significant nonlinear relationships and time dependence, and their interactions can change with seasonal variations, adjustments to operating conditions, and external environmental disturbances.

[0003] Existing wastewater quality prediction methods mostly employ mechanistic models, statistical models, or time-series prediction models based on neural networks. These methods have several limitations: First, current mainstream deep learning methods (such as LSTM and GRU) typically treat multivariate data as simple vector time series, ignoring the dependencies between variables, resulting in poor generalization ability when dealing with coupled fluctuations in multiple variables. Second, wastewater quality data simultaneously contains two types of features: a long-term trend influenced by seasonality and a short-term disturbance caused by influent impacts, equipment start-ups and shutdowns, etc. Current mainstream methods usually use a single network to fit these two distinct trends simultaneously, making it impossible for both to achieve optimal performance at the same time, thus limiting the effectiveness of online prediction and early warning. Summary of the Invention

[0004] This application provides a wastewater effluent prediction method based on learnable decomposition and causal graph networks. To solve the above-mentioned technical problems, this application adopts the following technical methods:

[0005] Firstly, this application provides a wastewater effluent prediction method based on learnable decomposition and causal graph networks, including:

[0006] S1. Obtain multivariate time-series monitoring data from the wastewater treatment plant, perform missing value filling, outlier correction and standardization, and construct a normalized input tensor.

[0007] S2. In order to reduce the mutual interference between low-frequency trend changes and high-frequency disturbance changes in the sewage treatment process, a learnable time series decomposition module is constructed to decompose the input tensor into trend components and residual components.

[0008] S3. Construct Granger causal adjacency matrices between variables based on the training set, and combine them with adaptive adjacency matrices to form a graph convolution support set;

[0009] S4. Based on the residual components, the Granger causal adjacency matrix and the adaptive adjacency matrix are used to mine the implicit spatial dependencies between variables, and gated dilated convolution is used to capture long-distance temporal dependencies to obtain the prediction results of the residual components.

[0010] S5. Based on the trend components, a simple linear mapping method is used to capture the smooth long-term variation pattern of the wastewater treatment plant and obtain the prediction results of the trend components.

[0011] S6. Combine the trend component prediction results and the residual component prediction results to output the multi-step multivariate prediction results of wastewater in the future.

[0012] S7. The model is trained and its parameters are updated using a composite loss function, which includes mean absolute error and dynamic rate of change error.

[0013] Optionally, multivariate time-series monitoring data from wastewater treatment plants are acquired, and missing value imputation, outlier correction, and standardization are performed to construct a normalized input tensor, including:

[0014] S1-1. Obtain water quality monitoring data and process operation parameters from multiple monitoring points at different time points in the wastewater treatment plant to form an initial data matrix. ,in, Indicates time All observed values ​​of monitored variables, To monitor the total duration, To monitor the number of variable nodes;

[0015] S1-2. Due to sensor outages and maintenance at the wastewater treatment plant, some monitoring data is missing. To ensure the continuity of the time series, the initial data matrix is ​​filled using linear interpolation to obtain the target data matrix.

[0016] S1-3. Since the monitoring data mainly comes from online sensors, it is easily affected by factors such as sensor drift and equipment failure during long-term continuous acquisition, resulting in abrupt outliers. To reduce their impact on model training and prediction results, extreme monitoring values ​​in the target matrix are corrected or replaced to obtain a calibration data matrix. ;

[0017] S1-4. To eliminate the influence of dimensional differences on modeling, the calibration matrix is ​​standardized. ,in, For the first The mean of each variable on the training set. For the first The standard deviation of each variable on the training set. For the first Time of the first Calibration data after correction of individual variables For the first Time of the first The standardized values ​​of the variables;

[0018] S1-5. After standardization, regularized water quality monitoring time-series data are obtained, and the dimensions are rearranged based on a sliding window of length L to construct the input tensor. The corresponding prediction target is ,in, H represents the prediction step size, where H is the number of target variables to be predicted.

[0019] Optionally, to reduce the mutual interference between low-frequency trend changes and high-frequency disturbance changes in the wastewater treatment process, a learnable time series decomposition module is constructed to decompose the input tensor into trend components and residual components, including:

[0020] S2-1. Constructing a one-dimensional learnable convolutional integral kernel. Meanwhile, Gaussian distribution is used to initialize the weights of the convolution kernel to ensure that the convolution kernel remains highly sensitive to the center time.

[0021] S2-2. Normalize the weights using the Softmax function to ensure that the sum of the weights within the kernel is 1.

[0022] S2-3, Regarding the input tensor Boundary padding is performed to ensure that the sequence lengths before and after convolution are consistent. This padding operation is denoted as... The trend term can then be obtained by solving the kernel of a one-dimensional learnable convolution: ;

[0023] S2-4. The residual term can be expressed as the difference between the original input and the trend term, i.e. .

[0024] Optionally, a Granger causal adjacency matrix between variables is constructed based on the training set, and combined with an adaptive adjacency matrix to form a graph convolutional support set, including:

[0025] S3-1. Construct a Granger causal adjacency matrix using the data in the training set. This matrix not only describes whether variables are correlated, but also further characterizes the contribution of the historical changes of one variable to the prediction of the future state of another variable;

[0026] S3-2. To address the issue that static Granger causality graphs are ill-suited to adapting to varying operating conditions, an adaptive adjacency matrix is ​​further constructed. This is used to learn the potential dependencies between variable nodes;

[0027] S3-3. Construct a graph convolutional support set based on the Granger causal adjacency matrix and the adaptive adjacency matrix. .

[0028] Optionally, based on the residual components, the Granger causal adjacency matrix and the adaptive adjacency matrix are used to mine the implicit spatial dependencies between variables, and gated dilated convolution is used to capture long-distance temporal dependencies to obtain the prediction results of the residual components, including:

[0029] S4-1. To capture the long-term dependencies of residual components in the time dimension, gated dilated convolution is used for temporal modeling to obtain gated temporal features. ;

[0030] S4-2. Perform diffusion graph convolution on the gated time features to fuse the causal and adaptive dependencies between different variable nodes;

[0031] S4-3. Aggregate the features of multi-layer spatiotemporal modeling through residual connections and skip connections to obtain the residual spatiotemporal feature representation. ;

[0032] S4-4, Through the output mapping function The output residual components in the future Prediction results at each time step .

[0033] Optionally, based on the trend component, a simple linear mapping method is used to capture the smooth long-term variation pattern of the wastewater treatment plant, and the prediction result of the trend component is obtained. .

[0034] Optionally, the trend prediction results and residual prediction results can be fused to obtain the future multi-step effluent water quality prediction results. .

[0035] Optionally, a composite loss can be used for model training and parameter updates, with a total loss. ,in, Indicates the mean absolute error. Indicates the error of the rate of dynamic change. This represents the weight balancing hyperparameter.

[0036] Secondly, this application also provides a computer system, comprising:

[0037] Memory is used to store instructions that can be executed by the processor;

[0038] A processor for executing the instructions to implement the method as described in any of the first aspects.

[0039] Thirdly, this application also provides a computer-readable medium storing computer program code that, when executed by a processor, implements the method as described in any of the first aspects.

[0040] This application has the following beneficial effects:

[0041] ① Existing technologies mostly use fixed-weight moving average kernels for time series decomposition, which keeps the receptive field unchanged throughout the process and is prone to feature extraction lag. This application introduces a learnable one-dimensional convolutional kernel based on Gaussian distribution initialization, which realizes accurate adaptive separation of smooth low-frequency trends and high-frequency disturbance components under complex working conditions. Among them, the low-frequency trend part uses a simple linear model to model the trend component, so as to enhance the ability to characterize long-term dependence under steady-state working conditions and significantly improve the robustness of long-term step prediction.

[0042] ② Unlike previous deep learning models that only focus on the temporal dimension of correlation and ignore the influence between variables, the adaptive graph structure is introduced into the wastewater treatment process. It can learn the potential dependencies between variables by data-driven learning during the training process, and can adapt to changes in working conditions through periodic model updates. This helps to improve the modeling ability and generalization performance in complex processes and scenarios where the mechanism is not completely transparent.

[0043] ③ This application constructs a Granger causal adjacency matrix based on the training set to characterize the directed causal relationship between different monitored variables. Compared with the method of using only the correlation coefficient matrix or relying entirely on the data-driven learning graph structure, the Granger causal adjacency matrix can not only reflect the correlation between variables, but also further describe the contribution of the historical change of one variable to the prediction of the future state of another variable. This is more in line with the actual process mechanism of the transmission lag and causal influence between influent water quality, process operating parameters and effluent water quality in the sewage treatment process. Attached Figure Description

[0044] Figure 1 A schematic diagram of a wastewater effluent prediction method based on learnable decomposition and causal graph network provided in this application embodiment;

[0045] Figure 2 Trend components and residual components after adaptive decomposition of influent COD variable;

[0046] Figure 3 This is a comparison of the model's prediction results for effluent water quality; Detailed Implementation

[0047] To facilitate understanding by those skilled in the art, the present application will be further described below in conjunction with embodiments and accompanying drawings. The content mentioned in the embodiments is not intended to limit the present application.

[0048] To solve the above technical problems, such as Figure 1 As shown, this application proposes a wastewater effluent prediction method based on learnable decomposition and causal graph networks, including:

[0049] S1. Obtain multivariate time-series monitoring data from the wastewater treatment plant, perform missing value filling, outlier correction and standardization, and construct a normalized input tensor.

[0050] S1-1. Obtain water quality monitoring data and process operation parameters from multiple monitoring points at different time points in the wastewater treatment plant to form an initial data matrix. ,in, Indicates time All observed values ​​of monitored variables, To monitor the total duration, To monitor the number of variable nodes;

[0051] Specifically, water quality monitoring data and process operation parameters usually come from the SCADA (Supervisory Control and Data Acquisition) system of wastewater treatment plants. Data is typically acquired using real-time sensors (mostly at the minute level), and the acquired data is stored in formats such as CSV, including timestamps and values ​​for each monitoring indicator. Water quality monitoring data includes influent COD, influent ammonia nitrogen, aerobic sludge concentration in the oxidation ditch, oxidation-reduction potential in the oxidation ditch, dissolved oxygen in the high-efficiency sedimentation tank, turbidity in the high-efficiency sedimentation tank, effluent COD, effluent ammonia nitrogen, effluent total nitrogen, effluent total phosphorus, and effluent pH. Process operation parameters include PAC (Potassium Acrylates) dosage and PAM (Potassium Ammonium Acrylates) dosage.

[0052] S1-2. Due to sensor outages and maintenance at the wastewater treatment plant, some monitoring data is missing. To ensure the continuity of the time series, the initial data matrix is ​​filled using linear interpolation to obtain the target data matrix.

[0053] Specifically, assuming the first The variables at time... monitoring values For missing values, linear interpolation is used to fill in the missing values, as shown in the following formula:

[0054] (1)

[0055] in, , These are the time step indices of the nearest valid data before and after the missing point. , These are the valid variable values ​​at the corresponding time points;

[0056] For real-time prediction, when valid observations after the missing points are temporarily unavailable, a filling strategy based on historical neighborhoods (such as forward filling) should be used first. After subsequent data arrives, offline filling can be performed for model retraining.

[0057] S1-3. Since the monitoring data mainly comes from online sensors, it is easily affected by factors such as sensor drift and equipment failure during long-term continuous acquisition, resulting in abrupt outliers. To reduce their impact on model training and prediction results, extreme monitoring values ​​in the target matrix are corrected or replaced to obtain a calibration data matrix. ;

[0058] Specifically, the mean and standard deviation of each monitored variable are calculated based on the training set. When the observed value at a certain moment is more than three times the standard deviation of the mean of the variable, the observed value is judged as an outlier. For the observed values ​​judged as outliers, the mean of the normal observed values ​​within a local sliding window is used to replace them to obtain the calibration data matrix.

[0059] For real-time prediction, the mean of the local sliding window is calculated using historical windows before the outlier to avoid relying on future neighborhood data.

[0060] S1-4. To eliminate the impact of dimensional differences on modeling, the calibration matrix is ​​standardized using the Z-Score standardization method. The mean and standard deviation required for standardization are calculated only from the training set and remain unchanged during the validation set, test set, and online prediction phases, as shown in the following formula:

[0061] (2)

[0062] in, For the first The mean of each variable on the training set. For the first The standard deviation of each variable on the training set. For the first Time of the first Calibration data after correction of individual variables For the first Time of the first The standardized values ​​of the variables;

[0063] S1-5. Standardized water quality monitoring time-series data are obtained, and based on length... The sliding window is used to rearrange dimensions and construct the input tensor. (In actual training, it is usually in batch form) (This is described using a single sample), and the corresponding prediction target is... ,in, To predict the number of target variables, To predict the step size.

[0064] S2. In order to reduce the mutual interference between low-frequency trend changes and high-frequency disturbance changes in the sewage treatment process, a learnable time series decomposition module is constructed to decompose the input tensor into trend components and residual components.

[0065] S2-1, Construct a convolution kernel with a stride of 1. One-dimensional learnable convolution kernel To enable the model to have smoothing filtering capabilities during the initial training phase, Gaussian distributions are used to initialize the convolution kernel weights. Then, the... The initial values ​​for each convolutional kernel position are:

[0066] (3)

[0067] in, Initialize the matrix for Gaussian. The hyperparameter for controlling the width of the Gaussian distribution; preferably, , ;

[0068] This initialization method results in larger weights near the center of the convolution kernel and relatively smaller weights at the edges. This allows the one-dimensional learnable convolution kernel to smooth the input time series during the initial stage of model training, making observations near the current time point contribute more to trend estimation, while observations farther from the center contribute less. This is beneficial for extracting low-frequency trend components in the wastewater treatment process.

[0069] S2-2. Normalize the weights using the Softmax function to ensure that the sum of the weights within the kernel is 1:

[0070] (4)

[0071] S2-3, Regarding the input tensor Boundary padding is performed in the time dimension to ensure that the sequence lengths before and after convolution are consistent. This padding operation is denoted as... Then the trend component It can be obtained by solving the kernel of a learnable convolutional integral:

[0072] (5)

[0073] S2-4. The residual component can be expressed as the difference between the original input and the trend component, i.e. ;

[0074] This module outputs two parts of the result. Among them, the trend component The residual components are fed into a linear mapping layer to fit the long-term macroscopic evolution baseline of the system. The input is a GraphWaveNet module based on causal graphs, used to extract high-frequency nonlinear spatiotemporal dependency features.

[0075] S3. Construct a Granger causal adjacency matrix between variables based on the training set. And combined with an adaptive adjacency matrix Forming graph convolutional support set ;

[0076] S3-1. Let the training set sequence be... ,in, Indicates the length of the training set. Indicates the moment of training concentration Multivariate observations; constructing a Granger causal adjacency matrix using data from the training set. ;

[0077] Specifically, let the maximum historical lag order be... For any source variable and target variable We constructed a restricted model containing only the historical lags of the target variable itself, and an unrestricted model containing both the historical lags of the target variable and the historical lags of the source variables. If the source variables are added to the unrestricted regression model... After obtaining historical information, the target variable If the prediction error decreases, then the variable is considered to be... For variables If Granger causality exists, then the effect is considered weak or nonexistent; variables are considered to have a causal relationship. Pointer variable The strength of causality is defined as:

[0078] (6)

[0079] in, This is the sum of squared residuals for the restricted regression model. This is the sum of squared residuals of the unrestricted regression model. To prevent extremely small constants with a denominator of zero; when When, it represents the source variable. Historical information can reduce the target variable The prediction error indicates that there is a Granger causal relationship between the two.

[0080] The Granger causal adjacency matrix is ​​obtained by calculating all variables. This matrix not only describes whether variables are correlated, but also further characterizes the contribution of the historical changes of one variable to the prediction of the future state of another variable, and can better describe the transmission relationship between influent water quality, process operating parameters and effluent water quality in the wastewater treatment system.

[0081] Preferably, it can be used for Threshold sparsification, self-loop supplementation, and normalization are performed to remove weak causal edges, preserve the historical information of variables, and improve the stability of subsequent diffusion graph convolution propagation.

[0082] S3-2. To address the issue that static Granger causality graphs are ill-suited to adapting to varying operating conditions, an adaptive adjacency matrix is ​​further constructed. This is used to learn the potential dependencies between variable nodes;

[0083] Specifically, two learnable node embedding matrices are defined: the source node embedding matrix and the source node embedding matrix. and target node embedding matrix ,in, For the embedding dimension; based on the above node embedding matrix, construct an adaptive adjacency matrix. The weights used to describe the directed associations between the variable nodes are shown in the following formula:

[0084] (7)

[0085] The ReLU function is used to suppress negative correlations and ensure that the weights are non-negative. The Softmax function normalizes each row so that the weights are interpreted as relative influence strengths. The adaptive adjacency matrix can be learned from data through gradient descent during training, thereby characterizing the potential dependencies between variables.

[0086] Preferably, it can be used for Top-k sparsity processing is performed to further suppress weak connections and improve stability;

[0087] S3-3, Construct a graph convolutional support set based on the Granger causal adjacency matrix and the adaptive adjacency matrix, and define the forward diffusion transition matrix and the backward diffusion transition matrix as shown in the following equation:

[0088] (8)

[0089] in, Indicates row normalization, This represents the forward diffusion matrix based on Granger causality. Represents the back diffusion matrix;

[0090] Combined with adaptive adjacency matrix Obtain the support set ,in, Provide explicit causal priors obtained from training data statistics. Provides implicit dependencies that are automatically learned during model training;

[0091] S4. Since the variables in the wastewater treatment process have spatiotemporal correlations, based on the residual components output by the time-series decomposition module... The Granger causal adjacency matrix and the adaptive adjacency matrix are used to mine the implicit spatial dependencies between variables, and gated dilated convolution is used to capture long-distance temporal dependencies.

[0092] S4-1, To capture residual components For the temporal dependencies, gated dilated convolution is used for temporal modeling to obtain gated temporal features. ;

[0093] Specifically, the dilated gated temporal convolution includes a filtering branch and a gate branch, assuming the first... Layer input features are expansion rate Then the filtering branch and the gating branch are represented as follows:

[0094] (9)

[0095] (10)

[0096] in, Indicates the expansion rate Temporal convolution, , These represent the convolution kernel parameters for the filtering branch and the gated branch, respectively. , For bias terms, Represents the Sigmoid function;

[0097] The outputs of the filtering branch and the gated branch are multiplied element-wise to obtain the gated time characteristics. ,in, This represents element-wise multiplication; it is achieved by setting an increasing expansion rate for each level. The model can expand the temporal receptive field without significantly increasing the number of parameters, thereby capturing long-distance temporal dependencies in the wastewater treatment process;

[0098] S4-2, Gating Time Characteristics Perform diffusion graph convolution to fuse causal and adaptive dependencies between nodes of different variables; let the diffusion order be... Then the diffusion map convolution can be represented as:

[0099] (11)

[0100] in, , , They represent the first Learnable linear transformation parameters corresponding to order diffusion;

[0101] S4-3. Aggregate the features of multi-layer spatiotemporal modeling through residual connections and skip connections to obtain the residual spatiotemporal feature representation. The specific process is as follows:

[0102] S4-3-1, Assuming the first The intermediate features are obtained by gated temporal convolution and diffusion map convolution of the layer, and the third feature is obtained by residual connection. Layer output features ,in, Indicates the first Layer output features, This indicates that the last part of the time dimension is truncated to a length of 1. The subsequence that is consistent with... Time length alignment;

[0103] S4-3-2. In each spatiotemporal modeling layer, intermediate feature outputs are aggregated to the output via skip connections. Then the... The skipping characteristics of the layer are ,in, The linear mapping parameters for skip connections are used; the skip features of all layers are time-aligned and summed to obtain the residual features. ,in, The total number of spatiotemporal modeling layers. For the final unified time length, This indicates that the last part of the time dimension is truncated to a length of 1. subsequence;

[0104] S4-4, Through the output mapping function The output residual components in the future The prediction results for each time step are shown in the following formula:

[0105] (12)

[0106] S5. The trend component obtained after adaptive decomposition mainly reflects the smooth long-term change pattern of the wastewater treatment plant operation. Compared with the residual component, it has stronger stability and predictability. Therefore, a simple linear mapping method is used for prediction, as shown in the following formula:

[0107] (13)

[0108] in, Choose a matrix for the target variable. The projected weight matrix is ​​a learnable matrix. For bias vectors, For the future Trend prediction results at each time step.

[0109] S6. Integrate the trend prediction results with the residual prediction results to obtain the future multi-step wastewater effluent water quality prediction results:

[0110] (14)

[0111] S7. In actual wastewater treatment SCADA data, due to the influence of complex operating conditions and weather environment, the data often exhibits strong non-stationarity. Traditional deep learning models always make conservative predictions of peak values. Therefore, a time-series first-order difference penalty term is introduced on the basis of the traditional loss function. The new loss function is composed of a weighted combination of the mean absolute error and the dynamic rate of change error, as shown in the following formula:

[0112] (15)

[0113] (16)

[0114] Total loss: (17)

[0115] in, This indicates the number of variables that predict the target effluent. Indicates the prediction step size. Indicates the prediction time step index. Indicates the index of the target variable. , Indicates the future number The time step, the first Predicted and true values ​​of several target water quality variables. , Indicates the future number The time step, the first Predicted and true values ​​of several target water quality variables. This represents the hyperparameter that balances the weights of the two components.

[0116] Model training and parameter updates specifically include the following steps:

[0117] The dataset is divided into three parts in chronological order: 70% training set, 10% validation set, and 20% test set. The validation set is used for early stopping and hyperparameter selection, while the test set is used only for the final generalization performance evaluation to avoid data leakage and evaluation bias.

[0118] Using batch training mode, the batch size is set to B (e.g., B=24, meaning 24 sample windows are input each time). The Adam optimizer is used to backpropagate and update the model parameters. The maximum number of training iterations is set to E (e.g., E=100 rounds) until the early stopping condition is met or the maximum number of rounds is reached. To avoid overfitting, an early stopping threshold P is set (e.g., P=10 rounds). When the validation set loss does not get a smaller value update within P consecutive rounds, training stops, and the model parameters corresponding to the minimum validation set loss are selected as the optimal model parameters.

[0119] During the model evaluation phase, the mean absolute error, mean absolute percentage error, root mean square error, and coefficient of determination are calculated on the test set to comprehensively analyze the prediction accuracy and generalization ability of the trained model.

[0120] After the model is trained, the optimal model parameters are loaded for real-time water quality prediction. The latest monitoring data from the sewage treatment plant is received in real time. After data preprocessing and feature extraction, a sliding window mechanism is used to construct the time series input, and the model is iteratively input to output the real-time prediction results at the corresponding time.

[0121] In summary, the method proposed in this application introduces a learnable one-dimensional convolutional decomposition kernel based on Gaussian distribution initialization, achieving accurate adaptive separation of smooth low-frequency trends and high-frequency disturbance components under complex operating conditions. The low-frequency trend component is modeled using a simple linear model to enhance the ability to characterize long-term dependencies under steady-state conditions, significantly improving the robustness of long-term predictions. By introducing an adaptive graph structure into the wastewater treatment process, the model can automatically learn the implicit directed dependencies between monitoring variable nodes through end-to-end training, updating with data distribution and operating condition changes. This helps improve modeling capabilities and generalization performance in complex processes and scenarios where mechanisms are not fully transparent. A Granger causal adjacency matrix is ​​constructed based on the training set to characterize the directed causal influence relationships between different monitoring variables. Compared to using only correlation coefficient matrices or relying entirely on data-driven learning graph structures, the Granger causal adjacency matrix not only reflects the correlation between variables but also further describes the contribution of one variable's historical changes to the prediction of another variable's future state.

[0122] In some embodiments, this application also provides a computer system including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0123] This application also provides a computer-readable storage medium for storing a computer program; the computer-readable storage medium can be applied to a computer device, and the computer program causes the computer device to execute the corresponding processes in the methods described above in the embodiments of this application, which will not be elaborated here for the sake of brevity.

[0124] The above embodiments are preferred implementations of this application. In addition, this application can be implemented in other ways. Any obvious substitutions without departing from the concept of this technical solution are within the protection scope of this application.

[0125] To facilitate understanding by those skilled in the art of the improvements made by this application compared to the prior art, some of the accompanying drawings and descriptions have been simplified, and for clarity, some other elements have been omitted from this application. Those skilled in the art should realize that these omitted elements may also constitute the content of this application.

Claims

1. A wastewater effluent prediction method based on learnable decomposition and causal graph networks, characterized in that, include: S1. Obtain multivariate time-series monitoring data from the wastewater treatment plant, perform missing value filling, outlier correction and standardization, and construct a normalized input tensor. S2. In order to reduce the mutual interference between low-frequency trend changes and high-frequency disturbance changes in the sewage treatment process, a learnable time series decomposition module is constructed to decompose the input tensor into trend components and residual components. S3. Construct Granger causal adjacency matrices between variables based on the training set, and combine them with adaptive adjacency matrices to form a graph convolution support set; S4. Based on the residual components, the Granger causal adjacency matrix and the adaptive adjacency matrix are used to mine the implicit spatial dependencies between variables, and gated dilated convolution is used to capture long-distance temporal dependencies to obtain the prediction results of the residual components. S5. Based on the trend components, a simple linear mapping method is used to capture the smooth long-term variation pattern of the wastewater treatment plant and obtain the prediction results of the trend components. S6. Combine the trend component prediction results and the residual component prediction results to output the future multi-step multivariate prediction results. S7. The model is trained and its parameters are updated using a composite loss function, which includes mean absolute error and dynamic rate of change error.

2. The method according to claim 1, characterized in that, In step S1, multivariate time-series monitoring data from the wastewater treatment plant are acquired, and missing value imputation, outlier correction, and standardization are performed to construct a normalized input tensor, including: S1-1. Obtain water quality monitoring data and process operation parameters from multiple monitoring points at different time points in the wastewater treatment plant to form an initial data matrix. ,in, Indicates time All observed values ​​of monitored variables, To monitor the total duration, To monitor the number of variable nodes; S1-2. Due to sensor outages and maintenance at the wastewater treatment plant, some monitoring data is missing. To ensure the continuity of the time series, the initial data matrix is ​​filled using linear interpolation to obtain the target data matrix. S1-3. Since the monitoring data mainly comes from online sensors, it is easily affected by factors such as sensor drift and equipment failure during long-term continuous acquisition, resulting in abrupt outliers. To reduce their impact on model training and prediction results, extreme monitoring values ​​in the target matrix are corrected or replaced to obtain a calibration data matrix. ; S1-4. To eliminate the influence of dimensional differences on modeling, the calibration matrix is ​​standardized. ,in, For the first The mean of each variable on the training set. For the first The standard deviation of each variable on the training set. For the first Time of the first Calibration data corrected for each variable For the first Time of the first The standardized values ​​of the variables; S1-5. After standardization, regularized water quality monitoring time-series data are obtained, and the dimensions are rearranged based on a sliding window of length L to construct the input tensor. The corresponding prediction target is ,in, To predict the number of target variables, To predict the step size.

3. The method according to claim 1, characterized in that, In step S2, to reduce the mutual interference between low-frequency trend changes and high-frequency disturbance changes in the wastewater treatment process, a learnable time-series decomposition module is constructed to decompose the input tensor into trend components and residual components, including: S2-1. Constructing a one-dimensional learnable convolutional integral kernel. Meanwhile, Gaussian distribution is used to initialize the weights of the convolution kernel to ensure that the convolution kernel remains highly sensitive to the center time. S2-2. Normalize the weights using the Softmax function to ensure that the sum of the weights within the kernel is 1. S2-3, Regarding the input tensor Boundary padding is performed to ensure that the sequence lengths before and after convolution are consistent. This padding operation is denoted as... The trend term can then be obtained by solving the kernel of a one-dimensional learnable convolution: ; S2-4. The residual term can be expressed as the difference between the original input and the trend term, i.e. .

4. The method according to claim 1, characterized in that, Step S3, which involves constructing a Granger causal adjacency matrix between variables based on the training set and combining it with an adaptive adjacency matrix to form a graph convolutional support set, includes: S3-1. Construct a Granger causal adjacency matrix using the data in the training set. This matrix not only describes whether variables are correlated, but also further characterizes the contribution of the historical changes of one variable to the prediction of the future state of another variable; S3-2. To address the issue that static Granger causality graphs are ill-suited to adapting to varying operating conditions, an adaptive adjacency matrix is ​​further constructed. This is used to learn the potential dependencies between variable nodes; S3-3. Construct a graph convolutional support set based on the Granger causal adjacency matrix and the adaptive adjacency matrix. .

5. The method according to claim 1, characterized in that, In step S4, based on the residual components, the Granger causal adjacency matrix and the adaptive adjacency matrix are used to mine the implicit spatial dependencies between variables, and gated dilated convolution is used to capture long-distance temporal dependencies to obtain the prediction results of the residual components, including: S4-1. To capture the long-term dependencies of residual components in the time dimension, gated dilated convolution is used for temporal modeling to obtain gated temporal features. ; S4-2. Perform diffusion graph convolution on the gated time features to fuse the causal and adaptive dependencies between different variable nodes; S4-3. Aggregate the features of multi-layer spatiotemporal modeling through residual connections and skip connections to obtain the residual spatiotemporal feature representation. ; S4-4, Through the output mapping function The output residual components in the future Prediction results at each time step .

6. The method according to claim 1, characterized in that, In step S5, based on the trend component, a simple linear mapping method is used to capture the smooth long-term variation pattern of the wastewater treatment plant, and the prediction result of the trend component is obtained. .

7. The method according to claim 1, characterized in that, In step S6, the trend prediction results and residual prediction results are fused to obtain the future multi-step effluent water quality prediction results.

8. The method according to claim 1, characterized in that, In step S7, a composite loss is used to train the model and update its parameters, with a total loss of [missing information]. ,in, Indicates the mean absolute error. Indicates the error of the rate of dynamic change. This represents the weight balancing hyperparameter.

9. A computer system, characterized in that, include: Memory is used to store instructions that can be executed by the processor; A processor for executing the instructions to implement the method as described in any one of claims 1 to 8.

10. A computer-readable medium, characterized in that, The system stores computer program code that, when executed by a processor, implements the method as described in any one of claims 1 to 8.