Sewage treatment capacity prediction method based on spatial-temporal feature fusion and physical constraint

By combining structured feature engineering with physical constraint mechanisms, extracting lag, rolling statistics and interaction features, and constructing a sewage treatment volume prediction model, we solve the problems of simple feature extraction and lack of physical constraints in existing technologies, and achieve more accurate and interpretable sewage treatment volume prediction.

CN120764610APending Publication Date: 2025-10-10ANHUI WATER TECHNOLOGY DIGITAL INFORMATION TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510941323.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-10-10

AI Technical Summary

Technical Problem

When faced with nonlinear, asynchronous responses, mutations, and periodic changes, existing sewage treatment volume prediction methods have simple feature extraction and lack physical constraints, resulting in insufficient prediction accuracy and interpretability.

Method used

Combining structured feature engineering with physical constraint mechanisms, a multidimensional time series is constructed by extracting lag features, rolling statistical features, and interaction features. Causal convolutional neural networks and dynamic parameter prediction layers are used in combination with physical constraint layers for prediction, and joint loss functions and early stopping methods are used for model correction.

Benefits of technology

The model's ability to model nonlinear and complex time series data has been improved, and the prediction accuracy and interpretability have been enhanced, ensuring that the prediction results conform to actual physical laws.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120764610A_ABST
    Figure CN120764610A_ABST
Patent Text Reader

Abstract

The invention discloses a sewage treatment capacity prediction method based on spatial-temporal feature fusion and physical constraint, and relates to the technical field of sewage treatment. Comprising the following steps: extracting basic characteristics of obtained historical sewage treatment data of a target area; standardizing the basic features, constructing a multi-dimensional time sequence, inputting the multi-dimensional time sequence into a pre-trained neural network model, constructing a sewage treatment capacity prediction model in combination with a physical constraint mechanism, and outputting predicted sewage treatment capacity; and obtaining the actual sewage treatment capacity and combining with the predicted sewage treatment capacity to construct a physical constraint condition, and correcting the sewage treatment capacity prediction model. The method is used for solving the problems that in a conventional sewage treatment capacity prediction method, the feature extraction step is easy to operate, and feature extraction and physical rationality are insufficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of sewage treatment, and in particular to a sewage treatment volume prediction method based on spatiotemporal feature fusion and physical constraints. Background Art

[0002] With population growth and accelerated urbanization, domestic and industrial wastewater are surging, polluting water bodies, disrupting ecosystem balance, and threatening human health. Against this backdrop, accurately predicting wastewater treatment volumes has become crucial for safeguarding public health and maintaining ecological stability. Existing technologies have made considerable progress in this area. By collecting raw sewage treatment data, preprocessing operations such as data cleaning, labeling, encoding, normalization, and dataset segmentation are performed sequentially. An improved spatiotemporal attention graph convolution model is then used to predict sewage treatment outcomes. This model effectively captures key temporal features and analyzes complex spatial correlations during the treatment process. Finally, a hunting optimization algorithm is used to perform targeted tuning of model hyperparameters, significantly improving the efficiency of parameter space exploration for multivariate spatiotemporal coupled data.

[0003] For example, the invention patent with publication number CN119416066A discloses a sewage treatment effect prediction method and system based on deep learning, which includes the following steps: S1 data acquisition, obtaining the original sewage treatment data set through sensors and historical databases, including historical treatment data and current treatment data monitored in real time; S2 data preprocessing, performing cleaning, labeling, encoding, normalization and segmentation operations on the original data to generate three types of subsets: the data set to be predicted, the effect prediction training set, and the effect prediction test set; S3 treatment effect prediction model construction, designing an improved spatiotemporal attention graph convolution model (ST-AGCN), analyzing the evolution law of water quality parameters through the spatiotemporal dual-channel feature extraction mechanism, and constructing a sewage treatment effect prediction base model; S4 hyperparameter optimization, using a hunting optimization algorithm to perform a targeted search on the hyperparameter space of the ST-AGCN model, obtaining the globally optimal parameter combination, and generating an optimized prediction model; S5 sewage treatment effect prediction, inputting the data set to be predicted into the optimization model, outputting a hierarchical evaluation result of the sewage treatment effect, and generating decision-making reference data.

[0004] For example, the invention patent with publication number CN113837356B discloses an intelligent prediction method for sewage treatment based on a fusion neural network, which includes the following steps: S1, identifying and associating input variables and output variables according to the process flow of the sewage treatment unit; S2, collecting sewage index data based on the input variables, and constructing serialized training sets and test sets after cleaning, standardization and feature encoding preprocessing; S3, designing an NLSTM and Attention fusion neural network, inputting the training set into the model, and synchronously configuring the loss function and optimizer; S4, training the NLSTM and Attention fusion model according to the loss function and optimizer; S5, inputting the test set into the trained model, outputting the status prediction results of the sewage treatment unit, and generating a multi-dimensional evaluation report.

[0005] The above disclosed technical solutions have at least the following technical bottlenecks: Existing prediction methods rely on traditional feature extraction mechanisms, such as simple standardization and normalization of raw water quality data and historical treatment data. These methods may not fully exploit the complex relationships between different variables when faced with the nonlinear, asynchronous responses, sudden changes, and cyclical variations in the wastewater treatment process, thus affecting prediction accuracy. Furthermore, these methods often lack effective physical constraints. While the prediction results may be accurate, they lack physical interpretability and may not conform to the physical laws of actual wastewater treatment systems.

[0006] In view of the above problems, the present invention proposes a solution. Summary of the Invention

[0007] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides a sewage treatment volume prediction method based on spatiotemporal feature fusion and physical constraints. By combining structured feature engineering with physical constraint mechanism, it solves the problem that the feature extraction step in the conventional sewage treatment volume prediction method is simple to operate and the feature extraction and physical rationality are insufficient.

[0008] To achieve the above object, the present invention provides the following technical solutions: A sewage treatment volume prediction method based on spatiotemporal feature fusion and physical constraints includes the following steps: extracting basic features of historical sewage treatment data of a target area; standardizing the basic features, constructing a multidimensional time series, and inputting the data into a pre-trained neural network model; combining the physical constraint mechanism to construct a sewage treatment volume prediction model, and outputting the predicted sewage treatment volume; obtaining the actual sewage treatment volume and combining it with the predicted sewage treatment volume to construct physical constraint conditions, and correcting the sewage treatment volume prediction model.

[0009] In a preferred embodiment, the sewage treatment volume prediction method based on spatiotemporal feature fusion and physical constraints is characterized in that the basic features include lag features, rolling statistical features and interactive features.

[0010] In a preferred embodiment, the method for extracting lag features is as follows: constructing a lag feature vector; constructing an asynchronous collaborative lag feature vector set based on the asynchronous response characteristics between variables in a multidimensional time series, and performing outlier suppression and exponential weighted smoothing on the lag feature vector set; adding position coding information in the form of sine-cosine to the processed lag feature vector set, and splicing them in the time dimension to obtain a multivariate lag feature matrix.

[0011] In a preferred embodiment, the lag feature vector is specifically constructed as follows: periodic analysis and mutation detection are performed on the variables in the multidimensional time series respectively, and the main period range and abnormal response window of each variable are identified as candidate lag points; the information gain method is used to evaluate the correlation strength between the candidate lag points and the prediction target, and candidate lag points with high information gain are selected to construct the lag feature vector.

[0012] In a preferred embodiment, the method for extracting rolling statistical features is as follows: based on the extracted lag feature matrix, the rolling statistical window size is set; at each time point t, statistical operations are performed on the window specified in the lag feature vector to generate rolling statistical features, wherein the rolling statistical features include a rolling mean, a rolling standard deviation, and a rolling coefficient of variation; the lag feature vectors of all variables are counted separately to construct multidimensional rolling statistical features.

[0013] In a preferred embodiment, the method for obtaining the interactive features is as follows: variables are extracted from the hysteresis features and the rolling statistical features, and the interactive features are constructed based on the physical correlation between the water quantity and water quality concentration variables.

[0014] In a preferred embodiment, the basic features are normalized to construct a multidimensional time series, specifically: each basic feature is normalized using a Min-Max normalization method to obtain a multidimensional time series.

[0015] In a preferred embodiment, the physical constraint mechanism is combined to construct a sewage treatment volume prediction model, specifically as follows: using a causal convolutional neural network to extract the local temporal dependencies of the multidimensional time series; inputting the multidimensional time series dependencies into the dynamic parameter prediction layer, and outputting the water system efficiency indicators in parallel through feature decoupling, wherein the water system efficiency indicators include the water use reduction coefficient, the pipe network leakage rate and the rainfall inflow coefficient; based on the water system efficiency indicators, a physical constraint layer is embedded in the output layer to output the sewage treatment volume prediction results.

[0016] In a preferred embodiment, the actual sewage treatment volume is obtained and combined with the predicted sewage treatment volume to construct physical constraints, and the sewage treatment volume prediction model is corrected, specifically as follows: the actual sewage treatment volume data is obtained, and according to the sewage treatment volume prediction result, the error between the predicted treatment volume and the actual treatment volume is calculated using the main loss function to obtain the main loss value; the predicted value of the dynamic parameter in the model is obtained, and the boundary penalty mechanism is applied to the dynamic parameter using the preset constraint loss function to obtain the constraint loss value; the main loss value and the constraint loss value are weighted and fused to construct a joint loss function, and a verification set is constructed based on the early stopping method to train and correct the sewage treatment volume prediction model.

[0017] The technical effects and advantages of the sewage treatment capacity prediction method based on spatiotemporal feature fusion and physical constraints of the present invention are as follows: 1. The present invention accurately captures the nonlinear and asynchronous dependency between sewage treatment volume and its influencing factors through information gain-driven lag feature selection and asynchronous collaborative lag feature construction. Traditional methods mostly use fixed lag windows or simple delay features, ignoring the asynchronous responses between different variables. The present invention combines information gain analysis, periodicity and mutation detection to dynamically identify key lag features that affect predictions, and by constructing asynchronous collaborative lag features, it handles the response differences of variables on different time scales. It effectively improves the model's ability to model nonlinear, time-varying and complex time series data, and enhances the adaptability and accuracy of the model.

[0018] 2. By introducing rolling statistical features such as rolling mean, standard deviation, and coefficient of variation, the model's ability to capture local trends is enhanced. Real-time performance monitoring and early stopping based on a validation set are also used to effectively avoid overfitting and improve the stability of the training process. Traditional methods are relatively simple in processing time series data. By introducing rolling statistical features and optimized training strategies, this invention can better capture local trends and dynamic changes in the data, improving the model's performance in practical applications.

[0019] 3. By integrating a physical constraint mechanism and a joint loss function, the model ensures that it adheres to actual physical laws when predicting wastewater treatment volumes, significantly improving the model's interpretability, stability, and prediction accuracy. Traditional deep learning methods often lack physical constraints when predicting wastewater treatment volumes, which can easily lead to predictions that deviate from actual system laws. By incorporating a physical constraint mechanism into the neural network, this invention not only improves prediction accuracy but also enhances the model's physical interpretability and robustness. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a flow chart of the sewage treatment volume prediction method based on spatiotemporal feature fusion and physical constraints of the present invention.

[0021] Figure 2 Flowchart for hysteresis feature extraction.

[0022] Figure 3 Flowchart for rolling statistical feature extraction.

[0023] Figure 4 Build flowcharts for interactive features. DETAILED DESCRIPTION

[0024] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0025] Example 1, Figure 1 The present invention provides a sewage treatment capacity prediction method based on spatiotemporal feature fusion and physical constraints, which includes the following steps: S1, extract the basic features of the historical sewage treatment data of the target area; S2, standardizes the basic features, constructs a multidimensional time series, and inputs it into the pre-trained neural network model. Combined with the physical constraint mechanism, a sewage treatment capacity prediction model is constructed to output the predicted sewage treatment capacity; S3, obtain the actual sewage treatment volume and combine it with the predicted sewage treatment volume to construct physical constraints, and modify the sewage treatment volume prediction model.

[0026] In step S1 of this embodiment, historical sewage treatment data of the target area is obtained. The specific acquisition method is as follows: Obtain data on the instantaneous flow and cumulative treatment volume of sewage actually treated by the sewage treatment plant; obtain real-time water consumption information within the sewage treatment plant's service area; obtain rainfall intensity and cumulative rainfall by connecting to a weather station or deploying a rain gauge; and use an online water quality analyzer to obtain real-time concentrations of key pollutants such as COD and ammonia nitrogen in sewage. For all types of collected data, quality control steps are systematically performed to determine whether there are missing fields, data packet losses, or transmission interruptions. Abnormal data is detected and eliminated based on preset physical constraints and statistical rules (such as negative values, range out-of-limit, sudden changes, etc.); for missing records, linear interpolation, historical mean / median filling, or establishing regression relationships between variables are used for predictive filling to generate a complete and effective multi-source and multi-variable time series data set.

[0027] In this embodiment, the method for extracting the hysteresis feature is as follows: Construct lagged eigenvectors; According to the asynchronous response characteristics between variables in multidimensional time series, an asynchronous collaborative lag feature vector set is constructed, and outlier suppression and exponential weighted smoothing are performed on the lag feature vector set. The processed lagged feature vector set is appended with position coding information in the form of sine-cosine and concatenated in the time dimension to obtain a multivariate lagged feature matrix.

[0028] In this embodiment, the specific method for constructing the lag feature vector is as follows: Perform periodicity analysis and mutation detection on the variables in the multidimensional time series, and identify the main period range and abnormal response window of each variable as candidate hysteresis points; The information gain method is used to evaluate the association strength between candidate lag points and the predicted target, and candidate lag points with high information gain are selected to construct the lag feature vector.

[0029] In this embodiment, the periodicity analysis is performed on each time series variable through the autocorrelation function (ACF) or fast Fourier transform (FFT) to identify its main periodic characteristics, and combined with the sliding window to detect the mutation point to obtain the candidate hysteresis point with physical response significance; Based on the information gain principle, the correlation strength between each candidate hysteresis point and the prediction target is evaluated, the hysteresis point with the strongest information-driven ability is selected, and the information-driven hysteresis feature vector is constructed; According to the asynchronous response characteristics between variables in the multidimensional time series, an asynchronous cooperative lag structure is constructed to obtain the optimal lag point, and the optimal lag points of each variable are combined into an asynchronous cooperative lag feature vector set; It should be noted that the asynchronous response characteristic means that the changes between different variables do not occur simultaneously, but there is a time delay (lag) or advance. These time differences reflect the "asynchronous" impact of different variables on the target variable; The 3σ rule truncation is performed on the lagged characteristic sequence to suppress outliers and exponential weighted smoothing is adopted, and position coding information in the form of sine-cosine is introduced; Align and concatenate all processed lag feature vectors in the time dimension to construct a unified multivariate lag feature matrix ,in is the sample time step, is the lagging feature dimension. Figure 2 Flowchart for hysteresis feature extraction.

[0030] The autocorrelation function (ACF) calculation formula is as follows:

[0031] in: The original time series at time point The numerical value of is the number of days of lag, is the sample length, is the mean of the series, is the lag order, Pick / 4 to / 3, Reflects the variable in the lag The correlation strength of the day, the peak corresponds to This is the potential cycle point.

[0032] The Fast Fourier Transform (FFT) calculation formula is as follows:

[0033] in, The original time series at time point The numerical value of is the sample length, is the normalized frequency, is a complex exponential function, Frequency The complex Fourier coefficients on the main period corresponding to the maximum amplitude frequency .

[0034] The sliding window The test formula is as follows:

[0035] in: 、 is the mean of the samples in the front and back windows, 、 is the sample variance of the front and back windows, 、 is the number of samples in the front and back windows, is the current time step, which is in the middle of the two windows and is used to determine whether it is a mutation point. If the statistic is significant, the moment is marked as a mutation point.

[0036] The information gain formula is as follows:

[0037] in: is the entropy of the target variable, For variables with known lags The conditional entropy of the target variable.

[0038] The Shannon entropy calculation formula is as follows:

[0039] in: is the discretized sewage treatment capacity, The probability that a target quantity takes a certain value.

[0040] The conditional entropy calculation formula is as follows: in: is the discrete value of a lagged variable, To predict the target variable, is a lagged variable No. discrete values, is the target variable No. discrete values.

[0041] The 3σ rule truncation formula is as follows:

[0042] in: 、 is the mean and standard deviation of the variable in the training set.

[0043] The exponentially weighted smoothing formula is as follows:

[0044] in: Control short-term memory. is the smoothed value at the current moment, is the original value at the current moment, is the smoothing factor (weight coefficient).

[0045] The introduced sine and cosine position coding formula is as follows:

[0046] in, is the lag step position, is the 2i-th dimension sinusoidal code, is the cosine code of the 2i+1th dimension, is the total coding dimension, is the dimension index.

[0047] In this embodiment, the method for extracting the rolling statistical features is as follows: Based on the extracted lag feature matrix, set the rolling statistical window size; At each time point t, performing statistical operations on the window specified in the lagged feature vector to generate rolling statistical features, wherein the rolling statistical features include a rolling mean, a rolling standard deviation, and a rolling coefficient of variation; The lagged eigenvectors of all variables are counted separately to construct multi-dimensional rolling statistical features.

[0048] In this embodiment, based on the extraction of each variable lag feature, the historical lag feature vector of each time point is obtained ; The rolling window length is designed , satisfying , set to the complete lag window length according to the demand , or a shorter local window length; The rolling statistical operation is performed on each sub-window of the lag vector , and the rolling average, rolling standard deviation and rolling coefficient of variation are output. Figure 3 The flow chart of the rolling statistical feature extraction process is shown in the figure.

[0049] The rolling average calculation formula is as follows:

[0050] In the formula, is the rolling average, is the rolling window length, is the lag feature value at time .

[0051] The rolling standard deviation calculation formula is as follows:

[0052] In the formula, is the rolling standard deviation, is the rolling average, is the rolling window length, is the lag feature value at time .

[0053] The rolling coefficient of variation calculation formula is as follows:

[0054] In the formula, is the rolling coefficient of variation, is the rolling standard deviation, is the rolling average, is an extremely small constant to prevent division by zero.

[0055] In this embodiment, the method for obtaining the interaction feature is as follows: The variables are extracted from the lag features and the rolling statistical features, and the interaction features are constructed based on the physical correlation between the water quantity and the water quality concentration variables.

[0056] In this embodiment, the interaction features include the water quantity-water quality concentration ratio and the water quality-rainfall correlation.

[0057] An interaction feature is constructed based on a lag feature and a rolling statistical feature; It should be noted that the water quantity-water quality concentration ratio specifically includes a water quantity-COD concentration ratio and a water quantity-ammonia nitrogen concentration ratio, and the water quality-rainfall correlation includes a COD-rainfall interaction term and an ammonia nitrogen-rainfall interaction term based on a nonlinear relationship obtained through mutual information analysis. Figure 4 A flowchart is constructed for the interaction feature.

[0058] S2, standardizing the basic features, constructing a multi-dimensional time series, and inputting the pre-trained neural network model, combining a physical constraint mechanism to construct a sewage treatment capacity prediction model, and outputting the predicted sewage treatment capacity.

[0059] In this embodiment, the standardization of the basic features and the construction of the multi-dimensional time series are as follows: The Min-Max standardization method is used to normalize each basic feature to obtain a multi-dimensional time series.

[0060] In this embodiment, the multi-dimensional time series includes sewage treatment capacity, actual water consumption, rainfall, COD concentration, and ammonia nitrogen concentration.

[0061] In this embodiment, the basic features are standardized and a multi-dimensional time series is constructed as follows: The Min-Max standardization method is used to linearly map the original feature values to a fixed interval in proportion , eliminating the differences in numerical scales of different features to facilitate model convergence and stable training.

[0062] For each feature in the time series data , let the original feature value be (where is the time step, =1, 2, , is the total number of time steps).

[0063] The value of the Min-Max standardized feature is calculated as follows:

[0064] where: is the minimum value of the feature over the entire training set, is the maximum value of the feature over the entire training set, is the standardized feature value, ranging from ; After normalization, the data needs to be converted into time series samples to capture temporal dependencies. A sliding window method is used to construct the input sequence (historical window) and output sequence (forecast target) to form a supervised learning format.

[0065] In this embodiment, the physical constraint mechanism is combined to construct a sewage treatment capacity prediction model, which is as follows: Extract local temporal dependencies of multidimensional time series using causal convolutional neural networks; The multi-dimensional time series dependency is input into the dynamic parameter prediction layer, and water system efficiency indicators are output in parallel through feature decoupling. The water system efficiency indicators include water reduction coefficient, pipe network leakage rate and rainfall inflow coefficient; Based on the water system efficiency indicators, a physical constraint layer is embedded in the output layer to output the sewage treatment volume prediction results.

[0066] In this embodiment, the pre-trained neural network model is input and combined with the physical constraint mechanism to build a sewage treatment capacity prediction model, and the predicted sewage treatment capacity is output as follows: Input layer: This layer receives standardized multidimensional time series data. The tensor dimension of the input data is [historical window size × number of features]. Here, the historical window size represents the number of consecutive time steps required to construct a single training sample. The number of features represents the expanded features generated by lags, rolling statistics, and interactive operations.

[0067] Spatiotemporal feature extraction layer: This layer is divided into two sub-modules: 1. Conv1D convolutional layer: This layer uses one-dimensional causal convolution to extract local temporal features. This convolutional layer contains 128 convolution kernels, with a kernel size of 3 and a Reluctant Unit (ReLU) activation function. Causal convolution uses only information from the current and historical moments, ensuring temporal causality and preventing future information leakage.

[0068] 2. Two-layer LSTM network: After the convolution operation, two stacked LSTM (Long Short-Term Memory) layers are connected to extract long-term dependencies. The first LSTM layer has 64 units, which is responsible for extracting key trends and periodic signals. The second LSTM layer has 32 units, which further learns higher-order temporal dependencies and abstract temporal patterns. This structure is effective in identifying complex dynamic processes such as seasonal changes and drought / rainstorm responses in sewage systems.

[0069] Dynamic parameter prediction layer: Input the temporal dependency of multi-dimensional time series, and predict the water reduction coefficient, pipe network leakage rate and rainfall inflow rate respectively through feature decoupling.

[0070] It should be noted that feature decoupling refers to separating input features according to information type, physical properties, time and space dimensions, etc.

[0071] Physical Constraint Layer: Each parameter prediction layer outputs a scalar value and imposes specific physical constraints on each parameter: 1. Water reduction coefficient α: output value through Sigmoid activation function ∈(0,1), and then mapped to α∈[0.7,0.9] through a restriction layer (such as a Lambda layer), which represents the proportion of unit water consumption that is actually converted into sewage.

[0072] 2. Pipeline network leakage rate β: preliminary output ∈(0,1), and then truncated to β≤0.25 through the constraint layer. This parameter reflects the proportion of sewage lost due to leakage or illegal discharge during the transmission process of the pipeline network.

[0073] 3. Rainfall inflow coefficient γ: Output using Sigmoid function , and constrain its maximum value not to exceed 0.4. This parameter represents the proportion of unit rainfall that eventually enters the sewage system.

[0074] The Lambda layer embeds the coefficients α (water reduction coefficient), β (pipeline leakage rate), and γ (rainfall inflow rate) in real time to ensure that the predicted value complies with mass conservation and process constraints. In this embodiment, α∈[0.7,0.9], β≤0.25, and γ≤0.4 are set. The sewage treatment volume prediction model formula is as follows:

[0075] Where, is the predicted sewage treatment volume, is the actual water consumption, is the rainfall, is the water reduction factor, is the pipe network leakage rate, is the rainfall inflow rate.

[0076] Boundary checking rules are built into the calculation logic to ensure that the output value meets the following requirements: ,in Designed for maximum processing capacity.

[0077] S3, obtain the actual sewage treatment volume and combine it with the predicted sewage treatment volume to construct physical constraints, and modify the sewage treatment volume prediction model.

[0078] In this embodiment, the actual sewage treatment volume is obtained and combined with the predicted sewage treatment volume to construct physical constraints, and the sewage treatment volume prediction model is modified as follows: Obtain actual sewage treatment volume data, and based on the sewage treatment volume prediction results, use the principal loss function to calculate the error between the predicted treatment volume and the actual treatment volume to obtain the principal loss value; Obtain predicted values ​​of dynamic parameters in the model, and apply a boundary penalty mechanism to the dynamic parameters using a preset constraint loss function to obtain a constraint loss value; The main loss value and the constraint loss value are weighted and fused to construct a joint loss function. A validation set is constructed based on the early stopping method to train and correct the sewage treatment volume prediction model.

[0079] In this embodiment, it should be noted that the physical constraints include a joint loss function; The main loss function is used to calculate the mean square error between the predicted processing volume and the actual processing volume to obtain the main loss value. The constraint loss function is used to introduce a boundary penalty mechanism for the dynamic parameters α, β, and γ to obtain the constraint loss value. The main loss value and the constraint loss value are weighted and combined to form a joint loss function, and the sewage treatment volume prediction model is trained and corrected.

[0080] The main loss function formula is as follows:

[0081] Where, is the main loss function value, is the sample size, For the The predicted processing volume of samples, For the The actual processing volume of samples.

[0082] Constrained loss function: Boundary penalty terms are designed for the dynamic prediction parameters α, β, and γ. For the α parameter, when the predicted value exceeds the interval [0.7, 0.9], the penalty term applies a gradient penalty based on the degree of the excess. For the β parameter, if the predicted value exceeds 0.25, a penalty is also applied based on the magnitude of the excess. The penalty mechanism for the γ parameter is similar, triggering a penalty when the predicted value exceeds 0.4. These constraint loss terms are integrated with the main loss function through a weighted summation to form the final joint loss function. The weight coefficients can be adjusted according to actual needs.

[0083] The constraint loss function formula is as follows: α parameter penalty (interval ):

[0084] Ensure penalties for out-of-bounds values.

[0085] β parameter penalty (upper limit 0.25):

[0086] Gamma parameter penalty (upper limit 0.4):

[0087] In the formula, , , is the constraint loss value, is the number of samples.

[0088] Joint loss function:

[0089] In the formula, , , is an adjustable weight coefficient, which controls the influence strength of each penalty term.

[0090] In this embodiment, the validation set is constructed based on the early stopping method, and the training is terminated when the performance stagnates, and the optimal state of the model training is preserved, as follows: Early stopping method: To prevent model overfitting, the early stopping method strategy is adopted during training, and the patience value is set to 15 training cycles. That is, when the performance of the model on the validation set does not improve for 15 consecutive cycles, the training process is terminated in advance. The proportion of the validation set to the training data is 20%, and by monitoring the loss change on the validation set, overfitting signs can be found in time and training is stopped, so as to preserve the optimal state of the model in the training process.

[0091] Validation set setting: 20% of the training data is divided as a validation set for real-time evaluation of the generalization ability of the model on unseen data. The validation set is independent of the training set and the test set, and can provide objective performance feedback for the model training process, helping to adjust the model parameters and training strategy, The above formulas are all de-dimensioned to calculate their numerical values. The formula is obtained by software simulation of a large amount of data to obtain a formula of the latest real situation. The preset parameters in the formula are set by a person skilled in the art according to the actual situation.

[0092] The above embodiments can be realized wholly or partially by software, hardware, firmware or any other combination. When realized by software, the above embodiments can be realized in the form of a computer program product, wholly or partially.

[0093] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0094] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0095] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

[0096] Finally: 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 in the scope of protection of the present invention.

Claims

1. A sewage treatment capacity prediction method based on spatiotemporal feature fusion and physical constraints, characterized by: The following steps are involved: Extract the basic characteristics of the historical sewage treatment data of the target area; The basic features are standardized to construct a multidimensional time series, which is then input into a pre-trained neural network model. Combined with the physical constraint mechanism, a sewage treatment capacity prediction model is constructed to output the predicted sewage treatment capacity. The actual sewage treatment volume is obtained and combined with the predicted sewage treatment volume to construct physical constraints and modify the sewage treatment volume prediction model.

2. The sewage treatment capacity prediction method based on spatiotemporal feature fusion and physical constraints according to claim 1 is characterized in that: The basic features include hysteresis features, rolling statistical features and interaction features.

3. The sewage treatment capacity prediction method based on spatiotemporal feature fusion and physical constraints according to claim 2 is characterized in that: The method for extracting the hysteresis feature is as follows: Construct lagged eigenvectors; According to the asynchronous response characteristics between variables in multidimensional time series, an asynchronous collaborative lag feature vector set is constructed, and outlier suppression and exponential weighted smoothing are performed on the lag feature vector set. The processed lagged feature vector set is appended with position coding information in the form of sine-cosine and concatenated in the time dimension to obtain a multivariate lagged feature matrix.

4. The sewage treatment capacity prediction method based on spatiotemporal feature fusion and physical constraints according to claim 3 is characterized in that: The specific construction method of the lag eigenvector is as follows: Perform periodicity analysis and mutation detection on the variables in the multidimensional time series, and identify the main period range and abnormal response window of each variable as candidate hysteresis points; The information gain method is used to evaluate the association strength between candidate lag points and the prediction target, and candidate lag points with high information gain are selected to construct the lag feature vector.

5. The sewage treatment capacity prediction method based on spatiotemporal feature fusion and physical constraints according to claim 4 is characterized in that: The method for extracting the rolling statistical features is as follows: Based on the extracted lag feature matrix, set the rolling statistical window size; At each time point t, performing statistical operations on the window specified in the lagged feature vector to generate rolling statistical features, wherein the rolling statistical features include a rolling mean, a rolling standard deviation, and a rolling coefficient of variation; The lagged eigenvectors of all variables are counted separately to construct multi-dimensional rolling statistical features.

6. The sewage treatment capacity prediction method based on spatiotemporal feature fusion and physical constraints according to claim 5 is characterized in that: The method for obtaining the interaction feature is as follows: Variables are extracted from the lag characteristics and rolling statistical characteristics, and interactive features are constructed based on the physical correlation between water quantity and water quality concentration variables.

7. The sewage treatment capacity prediction method based on spatiotemporal feature fusion and physical constraints according to claim 6 is characterized in that: The basic features are standardized to construct a multidimensional time series, specifically: Each basic feature is normalized using the Min-Max normalization method to obtain a multidimensional time series.

8. The sewage treatment capacity prediction method based on spatiotemporal feature fusion and physical constraints according to claim 7 is characterized in that: The physical constraint mechanism is combined to construct a sewage treatment capacity prediction model, which is as follows: Extract local temporal dependencies of multidimensional time series using causal convolutional neural networks; The multi-dimensional time series dependency is input into the dynamic parameter prediction layer, and water system efficiency indicators are output in parallel through feature decoupling. The water system efficiency indicators include water reduction coefficient, pipe network leakage rate and rainfall inflow coefficient; Based on the water system efficiency indicators, a physical constraint layer is embedded in the output layer to output the sewage treatment volume prediction results.

9. The method for predicting sewage treatment volume based on spatiotemporal feature fusion and physical constraints according to claim 8 is characterized in that: The actual sewage treatment volume is obtained and combined with the predicted sewage treatment volume to construct physical constraints and modify the sewage treatment volume prediction model, as follows: Obtain actual sewage treatment volume data, and based on the sewage treatment volume prediction results, use the principal loss function to calculate the error between the predicted treatment volume and the actual treatment volume to obtain the principal loss value; Obtain predicted values ​​of dynamic parameters in the model, and apply a boundary penalty mechanism to the dynamic parameters using a preset constraint loss function to obtain a constraint loss value; The main loss value and the constraint loss value are weighted and fused to construct a joint loss function. A validation set is constructed based on the early stopping method to train and correct the sewage treatment volume prediction model.

Citation Information

Patent Citations

  • Intelligent Prediction Method for Wastewater Treatment Based on Fusion Neural Networks

    CN113837356B

  • Sewage treatment effect prediction method and system based on deep learning

    CN119416066A

Cited By

  • Staged prediction method, system and equipment for leakage amount of sewage treatment system and medium

    CN121684060A

  • Regional water consumption conversion method and system

    CN122243153A

  • Training methods, devices, equipment, and media for predicting water and soil pollution remediation outcomes

    CN122412966A