An aeration quantity prediction method and system based on MSTP-Net
The MSTP-Net method addresses the problem that existing models struggle to balance short-term fluctuations and long-term trends in predicting aeration volume over long time series. By employing feature selection, multi-scale feature extraction, and sparse self-attention mechanisms, it achieves high-precision aeration volume prediction, reduces errors, and improves the model's robustness in practical deployment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN
- Filing Date
- 2026-05-25
- Publication Date
- 2026-07-14
AI Technical Summary
Existing aeration volume prediction models struggle to balance high-frequency fluctuations and long-term trends when processing long-term series data, and random K-fold cross-validation leads to the leakage of future information, resulting in an overestimation of model performance.
A method based on MSTP-Net is adopted, which uses feature selection, multi-scale temporal feature extraction, time series cross-validation and sparse self-attention mechanism, combined with a generative decoder to predict aeration volume.
It achieves high-precision, multi-timescale prediction of aeration volume, significantly reduces prediction error, and enhances the robustness and prediction efficiency of the model.
Smart Images

Figure CN122390159A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of wastewater treatment technology, and in particular to a method and system for predicting aeration volume based on MSTP-Net. Background Technology
[0002] Aeration is the most critical energy-consuming step in the biological treatment tank of municipal wastewater treatment plants. Its core function is to provide dissolved oxygen for microorganisms to degrade organic matter. Accurately predicting the aeration demand over a future period is crucial for reducing treatment energy consumption and ensuring effluent quality. However, the wastewater treatment process is characterized by strong nonlinearity, multivariate coupling, and time-varying lags, making accurate prediction of aeration demand extremely challenging.
[0003] Currently, various time-series prediction models have been applied to aeration volume prediction, such as methods based on Long Short-Term Memory (LSTM) networks and Transformer-based methods. LSTM, with its gating mechanism, can effectively capture local temporal dynamics, but when processing wastewater operation data spanning weeks or even months, it suffers from gradient vanishing and memory decay, making it difficult to simultaneously account for high-frequency fluctuations and long-term trends. While Transformer-type models enhance global dependency modeling capabilities through self-attention mechanisms, their computational complexity is proportional to the square of the sequence length, resulting in slow inference speeds, and the standard pointwise autoregressive decoding method is prone to error accumulation. Furthermore, existing models often employ random K-fold cross-validation during training and evaluation, neglecting the temporal attributes of the time series, leading to future information leakage and consequently, an overestimation of model performance. Summary of the Invention
[0004] To address the technical problems existing in the background art, the present invention provides an aeration volume prediction method and system based on MSTP-Net.
[0005] To achieve the above objectives, a first aspect of the present invention provides an aeration rate prediction method based on MSTP-Net, comprising: Historical operating data of the wastewater treatment biochemical tank are obtained, and feature selection is performed on the historical operating data based on correlation analysis to select a subset of features that meet preset conditions for correlation with aeration volume. A multi-scale temporal feature extraction method is used to extract short-term fluctuation features and long-term dependency features from the feature subset, and the extracted features are fused to obtain a temporal feature representation. Using the aforementioned time-series features as training input, MSTP-Net is trained and its hyperparameters optimized using a time-series cross-validation strategy to obtain an optimized MSTP-Net prediction model. Using the optimized MSTP-Net prediction model, the Informer prediction method is employed, and a sparse self-attention mechanism is used to filter key queries to reduce computational complexity. A generative decoder is then used to output the predicted aeration volume values for multiple future time points.
[0006] Furthermore, feature selection is performed on the historical operational data based on correlation analysis, specifically including: Calculate the Spearman rank correlation coefficient between each candidate feature and the aeration rate; Candidate features are sorted from largest to smallest based on the absolute value of their correlation coefficients; Select the pre-defined quantitative features that rank highest as the feature subset.
[0007] Furthermore, before feature selection, the historical operational data is preprocessed, specifically including: The historical running data is subjected to dual detection using the Z-Score normalization method and the box graph method to identify outliers. For the identified missing and outlier values, linear interpolation is used to impute them based on the valid observations before and after the missing or outlier intervals. The imputed data is subjected to min-max normalization to obtain standardized data, which is then used as input for subsequent feature selection.
[0008] Furthermore, the multi-scale temporal feature extraction method includes a first branch and a second branch executed in parallel; wherein, the first branch uses an exponential gating mechanism to process the input gate in order to capture short-term fluctuation features in the sequence; the second branch generates a query vector, a key vector, and a value vector, and uses the outer product of the key vector and the value vector to update the memory unit in the form of a matrix in order to capture long-term dependency features in the sequence; the multi-scale temporal feature extraction method fuses the outputs of the two branches to obtain the temporal feature representation.
[0009] Furthermore, a time-series cross-validation strategy is employed to train and optimize the hyperparameters of MSTP-Net, specifically including: Retrieve the historical execution dataset arranged in chronological order; Set an initial training window length and a validation window length, and divide the historical running dataset forward with a fixed step size; in each division, the training window consists of all continuous data before the current time point, and the validation window is the continuous data segment immediately following the training window; In each partition, the MSTP-Net is trained using training window data and the prediction performance is evaluated using validation window data to obtain the evaluation metrics for each validation. Calculate the average of all validation window evaluation metrics as the evaluation result of generalization performance, and select model hyperparameters based on this result.
[0010] Furthermore, the method of using the Informer prediction method to output predicted aeration rates for multiple future time points specifically includes: The temporal feature representation is input into the encoder, a sparse query matrix is calculated through a sparse self-attention mechanism, and the feature length is halved layer by layer through an attention distillation operation to obtain the encoded features. The learnable start tag sequence and the encoded features are input into the decoder to generate aeration volume predictions for multiple future time steps in parallel.
[0011] A second aspect of the present invention provides an aeration rate prediction system based on MSTP-Net, comprising: The feature selection module is used to acquire historical operating data of the wastewater treatment biochemical tank, perform feature selection on the historical operating data based on correlation analysis, and filter out a subset of features that are correlated with the aeration volume and meet preset conditions. The multi-scale temporal feature extraction module is used to extract short-term fluctuation features and long-term dependency features from the feature subset using a multi-scale temporal feature extraction method, and then fuse the extracted features to obtain a temporal feature representation. The training optimization module is used to train and optimize the MSTP-Net using the time-series feature representation as training input and employing a time-series cross-validation strategy to obtain an optimized MSTP-Net prediction model. The prediction module utilizes the optimized MSTP-Net prediction model, employs the Informer prediction method, filters key queries through a sparse self-attention mechanism to reduce computational complexity, and uses a generative decoder to output predicted aeration values for multiple future time points.
[0012] A third aspect of the present invention provides an electronic device including a memory, a processor, and a program stored in the memory and running on the processor, wherein the processor executes the program to implement the steps in the MSTP-Net-based aeration volume prediction method as described in the first aspect of the present invention.
[0013] A fourth aspect of the present invention provides a computer-readable storage medium having a program stored thereon that, when executed by a processor, implements the steps of the MSTP-Net-based aeration volume prediction method as described in the first aspect of the present invention.
[0014] A fifth aspect of the present invention provides a computer program product comprising software code, wherein the program in the software code performs the steps of the MSTP-Net-based aeration volume prediction method as described in the first aspect of the present invention.
[0015] Compared with existing technologies, the present invention provides an aeration volume prediction method and system based on MSTP-Net. It reduces noise interference by eliminating redundant information through feature selection, achieves a complete characterization of the multi-scale dynamics of the aeration process by extracting short-term fluctuations and long-term dependencies in parallel, eliminates look-ahead bias through time series cross-validation to make the model evaluation more realistic, and improves the efficiency and accuracy of long-sequence prediction through sparse self-attention mechanism and generative decoder. Thus, it achieves high-precision, multi-time-scale (1 hour to 96 hours) prediction of aeration volume, significantly reduces prediction error, and enhances the robustness of the model in actual deployment. Attached Figure Description
[0016] The accompanying drawings, which form part of this disclosure, are used to provide a further understanding of this disclosure. The illustrative embodiments of this disclosure and their descriptions are used to explain this disclosure and do not constitute an undue limitation of this disclosure.
[0017] Figure 1 The flowchart shows the aeration volume prediction method based on MSTP-Net provided in Embodiment 1 of the present invention.
[0018] Figure 2 This is a schematic diagram of the SRCC feature selection process provided in Embodiment 1 of the present invention; Figure 3 This is a diagram of the sLSTM structure provided in Embodiment 1 of the present invention; Figure 4 This is a diagram of the mLSTM structure provided in Embodiment 1 of the present invention; Figure 5 This is a structural diagram of the Informer provided in Embodiment 1 of the present invention; Figure 6 This is a structural diagram of the MSTP-Net prediction model provided in Embodiment 1 of the present invention; Figure 7 This is an architecture diagram of the MSTP-Net-based aeration volume prediction system provided in Embodiment 2 of the present invention. Detailed Implementation
[0019] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0020] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form as well. Furthermore, it should be understood that the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0021] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0022] All data acquisition in this embodiment is carried out in accordance with laws and regulations and with user consent, and the data is used legally.
[0023] Example 1 like Figure 1 This embodiment provides a method for predicting aeration volume based on MSTP-Net, including: S1. Obtain historical operating data of the wastewater treatment biochemical tank, and perform feature selection on the historical operating data based on correlation analysis to screen out a subset of features that meet preset conditions for correlation with aeration volume.
[0024] In this step, the historical operating data of the wastewater treatment biological treatment tank is first obtained. In a specific data collection example, the data is taken from the untreated water quality information of a wastewater treatment plant in Liaocheng, Shandong Province, from August 1, 2022 to December 31, 2022. The sensor data collection frequency is once per hour, and the data variables include NO3, MLSS, OPR, pH, NH3, DO, AR, COD, etc., with a total of 3672 sets of data collected (partial data are shown in Table 1).
[0025] Table 1 Partial Data Collection
[0026] After acquiring the raw data, this embodiment first performs data preprocessing. Specifically, the data is dual-detected using the Z-Score normalization method and the box plot method to identify outliers: the Z-Score method calculates the mean and standard deviation of each feature, and data points whose deviation from the mean exceeds three times the standard deviation are marked as outlier candidates; the box plot method calculates the interquartile range (IQR), and data points exceeding the range [Q1-1.5×IQR, Q3+1.5×IQR] are marked as outlier candidates; data points identified by both methods are confirmed as outliers. For the identified missing values and outliers, linear interpolation is used to imputate them based on the valid observations before and after the missing or outlier intervals. The interpolation formula is as follows: ; In the formula, and These are the nearest valid observations before and after the missing interval. This method can preserve the local trend characteristics of water quality parameters over time to the greatest extent. For cases where outliers occur consecutively or the data itself exhibits severe nonlinear fluctuations, mean imputation is used for data correction. After preprocessing, the data is standardized using min-max normalization, with the following formula: ; In the formula, and Let these represent the minimum and maximum observed values of the variable, respectively. This represents the standardized data after normalization. After preprocessing, the dataset contains 3648 valid samples, divided into training, test, and validation sets in a 7:2:1 ratio.
[0027] Next, feature selection is performed. High-dimensional raw data often contains a large number of redundant, irrelevant, or even noisy features. Directly inputting these features into the model not only increases computational complexity and the risk of overfitting but may also mask the influence of core variables. Therefore, this embodiment selects the Spearman Rank Correlation Coefficient (SRCC) as the core method for feature selection. For example... Figure 2 As shown, SRCC is a non-parametric filtering method that can effectively identify features with potential positive or negative trends in aeration volume by measuring the degree of monotonic correlation between variables. It does not require the assumption of a linear relationship and fits the complex nonlinear interaction characteristics between variables in the aeration process. At the same time, SRCC is not sensitive to outliers in the data and does not require the data to follow a normal distribution, which enhances its robustness when processing actual wastewater treatment plant operation data.
[0028] The formula for calculating SRCC is as follows: ; In the formula, For water quality indicators in the biological treatment pond, such as DO and MLSS, This refers to the aeration rate of the biological treatment tank. and These represent their average values. Coefficients Use a monotonic function to assess the correlation between two statistical variables. The value is +1 or 1 indicates that the two variables are completely monotonically correlated.
[0029] The feature selection process based on SRCC is as follows: The original input features are... With target variable As input, the Spearman rank correlation coefficient between the two is calculated to quantify the monotonic correlation strength between each feature and the target; then, based on the preset correlation coefficient threshold, a subset of significantly correlated features is selected to form a preliminary feature dataset.
[0030] In this embodiment, the Spearman rank correlation coefficient between each candidate feature and the aeration rate was calculated, and the results are shown in Table 2.
[0031] Table 2 Based on Spearman's Feature ranking
[0032] As shown in Table 2, DO, NH3, and NO are significantly correlated with aeration rate, with the adjustment of aeration rate mainly depending on the DO value, according to Spearman's... The correlation coefficient reached 0.867; the correlation coefficients for NH3 and NO were 0.552 and 0.513, respectively; the correlations for OPR, COD, MLSS, and pH were relatively low. To examine the impact of the number of features on prediction performance, this embodiment used xLSTM and Informer models to predict the aeration rate for 1 hour, and the results are shown in Table 3.
[0033] Table 3. RMSE and MAE of the model under different feature combinations
[0034] The results show that when the first four features (DO, NH3, NO, OPR) are selected as model inputs, both models achieve good prediction accuracy (MAE of xLSTM is 0.434, and RMSE of Informer is 0.752). Therefore, this embodiment uses the key feature subset (DO, NH3, NO, OPR) selected by SRCC as input for subsequent steps.
[0035] Through feature selection in step S1, this embodiment solves the technical problem of redundant and noisy features interfering with model training in the original high-dimensional data, and achieves the technical effects of reducing input dimensionality, reducing the risk of overfitting, and improving model training efficiency and generalization ability.
[0036] S2. Using a multi-scale temporal feature extraction method, short-term fluctuation features and long-term dependency features are extracted from the feature subset respectively, and the extracted features are fused to obtain a temporal feature representation.
[0037] In this step, a multi-scale time series feature extraction method is used to extract short-term fluctuation features and long-term dependency features from the feature subset obtained in step S1, and then the extracted features are fused to obtain a time series feature representation.
[0038] This embodiment introduces xLSTM as the core architecture for feature extraction. xLSTM is not a minor modification of the traditional LSTM, but rather introduces exponential gating and a novel memory structure on top of LSTM, and introduces two complementary memory unit variants in parallel: sLSTM (first branch) and mLSTM (second branch). For example... Figure 6 As shown, the overall architecture of the MSTP-Net prediction model includes these two parallel branches.
[0039] (a) sLSTM branch – used to capture short-term volatility characteristics Aeration volume data often exhibits strong non-stationarity and drastic fluctuations due to multiple factors such as influent flow shocks, water quality fluctuations, and equipment adjustment delays. The sLSTM module improves upon the traditional LSTM by introducing an exponential gating mechanism. It replaces the standard Sigmoid gating with an exponential activation function, thereby eliminating the rigid constraint that the gating output is strictly limited to the (0,1) range. This allows the model to respond to drastic changes in input features with a wider dynamic range.
[0040] like Figure 3 As shown, the gating computation and state update process of the sLSTM model can be formally described as follows. First, at each time step... The model is based on the current input. Hidden state from the previous moment Calculate the intermediate activation value for each gating control and introduce a statistical enhancement term. To enhance sensitivity to fluctuation characteristics. Forget gate. Input gate Candidate status and output gate The intermediate activations are calculated using the following formulas: ; ; ; ; ; ; ; ; In the formula, This is the weight matrix for the corresponding gate; For bias terms; This is a statistical enhancement term used to strengthen the model's response to abrupt changes in time-series data. Unlike traditional LSTM, sLSTM uses an exponential activation function in the input gate. Replacing Sigmoid makes the gated output no longer limited by The interval allows for capturing dramatic fluctuations in the aeration rate sequence with a wider dynamic range; the forget gate and output gate still retain the Sigmoid function. To ensure selective forgetting and output regulation of information, candidate states are determined through... (usually) )generate.
[0041] After completing the gating signal calculation, sLSTM updates the cell state according to the following formula. With hidden state : ; ; In the formula, This represents element-wise multiplication. The candidate hidden states are obtained after nonlinear transformation. This recursive structure enables sLSTM to effectively balance historical dependence with current input in aeration rate prediction, quickly adapt to temporal changes caused by sudden changes in influent load or equipment adjustments, and provide a reliable temporal feature representation for precise aeration control.
[0042] (ii) mLSTM branch – used to capture long-term dependency features like Figure 4 As shown, mLSTM maintains the same gating method as sLSTM, but its core innovation lies in introducing a key, value, and query mechanism. Through a covariance attention structure, it dynamically weights input features, thereby enhancing the model's ability to capture long-range dependencies in multivariate time-series data. The calculation formulas for its forget gate, input gate, and output gate are as follows: ; ; ; Subsequently, attention weights are calculated based on the similarity between the query and the key, and then normalized using the Softmax function: ; In the formula, For feature dimension, scaling factor This is used to prevent the dot product result from becoming too large, leading to gradient saturation. Attention weights It reflects the correlation strength between the current input and various parts of the historical information.
[0043] Building upon this, mLSTM implements covariance updates for cell states. Unlike traditional LSTMs that use element-wise addition for state updates, mLSTM incorporates the interaction information between the value vector and the key vector into the memory cells through an outer product operation. Its state update rule can be expressed as: ; ; In the formula, As a matrix-based memory unit, through outer product Achieve second-order association modeling of input features; This represents element-wise multiplication. For matrix vectorization operations, the two-dimensional memory cells are flattened into one-dimensional hidden states. This matrix memory structure enables mLSTM to capture covariance information among multiple variables simultaneously, significantly improving its ability to express complex time-series dependencies. At the same time, thanks to the parallel nature of matrix operations, mLSTM has fully parallel computing capabilities, exhibiting higher computational efficiency when handling long-sequence tasks such as aeration rate prediction.
[0044] (III) Feature Fusion The short-term fluctuation feature sequence output by the sLSTM branch and the long-range dependency feature sequence output by the mLSTM branch are aligned by time steps and then weighted and fused to obtain a multi-scale time series feature representation. This fused feature simultaneously includes high-frequency abrupt change information and low-frequency trend information in the aeration rate sequence, providing a comprehensive feature foundation for subsequent multi-step prediction.
[0045] Through step S2, this embodiment solves the technical problem that traditional LSTM is unable to simultaneously take into account short-term fluctuations and long-term dependencies, and realizes a complete characterization of the multi-scale dynamics of the aeration process, providing high-quality time-series feature input for accurate prediction.
[0046] S3. Using the time-series feature representation as training input, MSTP-Net is trained and its hyperparameters are optimized using a time-series cross-validation strategy to obtain an optimized MSTP-Net prediction model.
[0047] In this step, the time-series feature representation obtained in step S2 is used as the training input, and the MSTP-Net is trained and its hyperparameters are optimized using a time-series cross-validation strategy to obtain the optimized MSTP-Net prediction model.
[0048] Standard K-fold cross-validation maximizes data utilization through random resampling, but directly applying it to the time series domain can lead to the "leakage" of future information into the past, causing the model to essentially glimpse patterns that should belong to the future during training, resulting in overly optimistic evaluation results. To overcome this limitation, this embodiment employs Time Series Cross-Validation (TSCV) as the core model validation and selection strategy. TSCV strictly adheres to the causal principle that "the past can only be used to predict the future," simulating the real prediction process by performing an ordered, forward-rolling segmentation of the original time series data.
[0049] Its workflow employs a dynamic sliding window mechanism: In the initial stage, only a small segment of continuous data from the beginning of the time series is used as the initial training set, and its immediately adjacent fixed-length data segment is used as the validation set to evaluate the model's predictive performance within the current historical window. After the first validation, the original validation set data is incorporated into the training set in chronological order, forming an expanded historical window. The model is then retrained on this updated training set to perform prediction validation for the next future time period. This process is repeated continuously, rolling forward with a fixed step size until the entire time series dataset has been traversed. In each iteration, the training set always consists of all historical data before the validation time point, while the validation set is strictly limited to the immediately following unobserved period.
[0050] The specific steps are as follows: (1) Obtain the historical running dataset arranged in chronological order; (2) Set the initial training window length and the validation window length, and divide the historical running dataset forward with a fixed step size; in each division, the training window consists of all continuous data before the current time point, and the validation window is the continuous data segment immediately after the training window; (3) In each partition, the MSTP-Net is trained using the training window data and the prediction performance is evaluated using the validation window data to obtain the evaluation index for each validation. (4) Calculate the average value of all validation window evaluation metrics as the evaluation result of generalization performance, and select model hyperparameters based on the result.
[0051] This embodiment deeply integrates the TSCV mechanism into the model. For each set of candidate hyperparameters, training and evaluation are performed on each training-validation pair of the rolling split, and the average performance across all validation periods is used as the final score for this configuration. This design not only provides a robust estimate of the model's generalization ability but also ensures that the selection of hyperparameters is strictly based on optimizing temporal generalization performance rather than overfitting to historical data.
[0052] Through step S3, this embodiment solves the technical problems of look-ahead bias and false overestimation of model performance caused by random cross-validation, realizes the true evaluation of the model's generalization ability, and the selected hyperparameters are more robust in actual deployment.
[0053] S4. Using the optimized MSTP-Net prediction model, the Informer prediction method is adopted, and the key queries are filtered through a sparse self-attention mechanism to reduce computational complexity. The generative decoder is used to output the predicted aeration values for multiple future time points.
[0054] In this step, the optimized MSTP-Net prediction model obtained in step S3 is used, and the Informer prediction method is adopted. The sparse self-attention mechanism is used to filter key queries to reduce computational complexity, and the generative decoder is used to output the predicted aeration volume values for multiple future time points.
[0055] While the Transformer architecture has achieved success in various sequence modeling tasks thanks to its global self-attention mechanism, it faces two fundamental bottlenecks when applied to long-sequence time series prediction: the computational complexity of standard self-attention is proportional to the square of the sequence length, making it difficult to handle densely sampled data spanning several months; and point-by-point decoding suffers from error accumulation and slow speed during the inference phase. Therefore, this embodiment employs the Informer model as the core engine of the prediction module.
[0056] like Figure 5 As shown, the Informer structure consists of three parts: ProbSparse self-attention, attention distillation, and generative decoder.
[0057] (1) ProbSparse self-attention mechanism Informer proposed the ProbSparse self-attention mechanism, which, through theoretical analysis, reveals that not all query-key-value pairs are equally important in long sequence prediction; the attention probability distribution of many queries is highly sparse and nearly uniform. Based on this, an efficient metric is designed that selects only "active" queries that are significantly different from the primary key for computation, thereby reducing the computational and memory complexity of the self-attention layer from the square of the sequence length to near linearity. The expression for the ProbSparse self-attention mechanism is as follows: ; In the formula, For a sparse query matrix, the attention output of the remaining queries is approximated by the mean.
[0058] (2) Attention distillation operation The Informer model reduces the computational complexity of each layer by introducing a distillation operation in the encoder. ( (n, This further reduces the input by half, thus solving the problem of not being able to stack models due to excessively long inputs. Specifically, from Layer (1) to Layer (2) The distillation process for layer +1 is as follows: ; In stacked multi-layer encoders, the attention distillation mechanism halves the feature length layer by layer by performing convolution and max pooling operations on the feature maps output by the previous layer's attention. This process not only significantly reduces the computational load but also forms a hierarchical feature abstraction, enabling the model to filter out noise and refine the core temporal patterns that are crucial to the prediction task layer by layer.
[0059] (3) Generative decoder Informer introduces a generative decoder that abandons the traditional iterative autoregressive approach. Instead, it uses a feedforward structure with a learnable starter label sequence as the initial input to generate all prediction points in parallel at once. This fundamentally eliminates the problem of error accumulation and significantly improves the stability and inference speed of medium- and long-term predictions.
[0060] In the specific implementation of this step, the multi-scale temporal feature representation obtained in step S2 is input into the encoder. A sparse query matrix is calculated using the aforementioned sparse self-attention mechanism. Then, the feature length is halved layer by layer through an attention distillation operation to obtain the encoded features. The learnable start tag sequence and the encoded features are then input into the decoder to generate aeration prediction values for multiple future time steps in parallel. The prediction values in this embodiment cover a multi-timescale range from 1 hour to 96 hours.
[0061] Through step S4, this embodiment solves the technical problems of excessive computation, slow inference speed and error accumulation in long sequence prediction of Transformer-type models, and realizes efficient and stable multi-step aeration volume prediction.
[0062] Experimental verification To verify the effectiveness of the method in this embodiment, experiments were conducted on a real wastewater treatment plant dataset. The experimental environment configuration was as follows: CPU: Intel(R) Xeon(R) CPU E5 @ 2.50GHz, GPU: NVIDIA RTX4090, operating system: Ubuntu 20.04 LTS, memory capacity: 50GB, framework version: PyTorch 1.13.0, Python version: 3.8.0.
[0063] This embodiment selects four evaluation indicators: mean absolute error (MAE), mean absolute percentage error (MAPE), root mean square error (RMSE), and coefficient of determination (CQD). The formula is as follows: ; ; ; ; in The number of samples in the test set. These are actual observations. The predicted value output by the model. This is the mean of the true values.
[0064] (I) Comparative Experiment To verify the performance advantages of the MSTP-Net hybrid architecture, xLSTM, Informer, BiLSTM, and Autoformer were selected as comparison methods. The hyperparameter settings for each model are shown in Table 4.
[0065] Table 4. Hyperparameters of the comparative experimental models Model hyperparameters xLSTM d_model:64,batch_size:64, optimizer:adam, Stopping _patience:10,n_heads:2,dropout:0.2,learning_rete:0.001 BiLSTM units:120,batch_size:64,optimizer:adam, Informer d_model:512,batch_size:64,activation:gelu,n_heads:6,e_layers:2,d_layers:1,dropout:0.01,learning_rate:0.001 Autoformer d_model:512,batch_size:64,activation:gelu, n_heads:6, e_layers:2,d_layers:1,moving_avg:30,dropout:0.01,learning_rete:0.001 The models were compared across six aeration prediction timescales: 1h, 4h, and 12h (short-term) and 24h, 48h, and 96h (medium-term). The experimental results are shown in Table 5.
[0066] Table 5 Comparative Experimental Results
[0067] In terms of overall performance, MSTP-Net achieved the best performance across all time scales and evaluation metrics, securing the best value in 18 metrics. In short-term 1-hour prediction, MSTP-Net reduced RMSE by 30.4% and MAE by 24.5% compared to the second-best model, xLSTM. An improvement of 0.008; in the medium-term 96-hour forecast, its RMSE was reduced by 10.4% and MAPE by 31.8% compared to the best baseline model, Autoformer. An improvement of 0.026. This fully demonstrates the synergistic advantages of the xLSTM and Informer hybrid architecture in this embodiment.
[0068] (II) Ablation Experiment To quantify the contribution of each core module in the MSTP-Net model architecture, three sets of control models were designed: full MSTP-Net, xLSTM-xLSTM (using only xLSTM for feature extraction and prediction), and Informer-Informer (using only Informer for feature extraction and prediction). The experimental results are shown in Table 6.
[0069] Table 6 Ablation Experiment Results
[0070] The results show that the complete MSTP-Net architecture exhibits the best prediction performance across all time scales, achieving the best values in 15 metrics. The xLSTM-xLSTM architecture shows some competitiveness in short-term predictions (MAPE as low as 2.701 in 1-hour predictions), but its performance significantly degrades in medium-term predictions. The Informer-Informer architecture achieves the best performance in 4 metrics in 24-hour medium-term predictions, but its short-term prediction error is relatively high. This verifies the complementary advantages of the xLSTM and Informer modules in this embodiment.
[0071] In summary, the MSTP-Net prediction model constructed in this embodiment achieves end-to-end prediction through four collaborative steps: Step S1 uses Spearman correlation coefficients to screen key process parameters to reduce input noise; Step S2 employs a dual-branch parallel structure of sLSTM and mLSTM to capture short-term fluctuations and long-term dependencies respectively; Step S3 uses time-series cross-validation to eliminate look-ahead bias; and Step S4 utilizes the ProbSparse self-attention mechanism and a generative decoder to achieve multi-scale prediction. Experimental results demonstrate that the method in this embodiment performs exceptionally well in aeration rate prediction, strongly proving its advancement and effectiveness.
[0072] Example 2 like Figure 7 As shown, this embodiment provides an aeration rate prediction system based on MSTP-Net, including: The feature selection module is used to acquire historical operating data of the wastewater treatment biochemical tank, perform feature selection on the historical operating data based on correlation analysis, and filter out a subset of features that are correlated with the aeration volume and meet preset conditions. The multi-scale temporal feature extraction module is used to extract short-term fluctuation features and long-term dependency features from the feature subset using a multi-scale temporal feature extraction method, and then fuse the extracted features to obtain a temporal feature representation. The training optimization module is used to train and optimize the MSTP-Net using the time-series feature representation as training input and employing a time-series cross-validation strategy to obtain an optimized MSTP-Net prediction model. The prediction module utilizes the optimized MSTP-Net prediction model, employs the Informer prediction method, filters key queries through a sparse self-attention mechanism to reduce computational complexity, and uses a generative decoder to output predicted aeration values for multiple future time points.
[0073] Example 3 Embodiment 3 of the present invention provides an electronic device.
[0074] An electronic device includes a memory, a processor, and a program stored in the memory and running on the processor. The processor includes, but is not limited to, at least one of a central processing unit (CPU), a graphics processing unit (GPU), a neural network processor (NPU), a tensor processor (TPU), or an artificial intelligence acceleration chip. The program is used to execute the steps in the aeration volume prediction method based on MSTP-Net as described in Embodiment 1 of the present invention.
[0075] The detailed steps are the same as those of the MSTP-Net-based aeration volume prediction method provided in Example 1, and will not be repeated here.
[0076] Example 4 Embodiment 4 of the present invention provides a computer-readable storage medium.
[0077] A computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps in the MSTP-Net-based aeration volume prediction method as described in Embodiment 1 of the present invention.
[0078] The detailed steps are the same as those of the MSTP-Net-based aeration volume prediction method provided in Example 1, and will not be repeated here.
[0079] Example 5 Embodiment 5 of the present invention provides a computer program product.
[0080] A computer program product includes software code, wherein the program in the software code performs the steps of the aeration volume prediction method based on MSTP-Net as described in Embodiment 1 of the present invention.
[0081] The detailed steps are the same as those of the MSTP-Net-based aeration volume prediction method provided in Example 1, and will not be repeated here.
[0082] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present invention can be implemented using various computer languages. For example, in one implementation, the methods and systems can be developed based on deep learning frameworks (such as TensorFlow, PyTorch, etc.) and using the Python language. Those skilled in the art will understand that other suitable programming languages or tools can also be used for implementation without departing from the core ideas of the present invention.
[0083] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0084] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0085] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0086] The above description is merely a preferred embodiment of this practice and is not intended to limit the scope of this practice. Various modifications and variations can be made to this practice by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of this practice should be included within the protection scope of this practice.
Claims
1. A method for predicting aeration volume based on MSTP-Net, characterized in that, include: Historical operating data of the wastewater treatment biochemical tank are obtained, and feature selection is performed on the historical operating data based on correlation analysis to select a subset of features that meet preset conditions for correlation with aeration volume. A multi-scale temporal feature extraction method is used to extract short-term fluctuation features and long-term dependency features from the feature subset, and the extracted features are fused to obtain a temporal feature representation. Using the aforementioned time-series features as training input, MSTP-Net is trained and its hyperparameters optimized using a time-series cross-validation strategy to obtain an optimized MSTP-Net prediction model. Using the optimized MSTP-Net prediction model, the Informer prediction method is employed, and a sparse self-attention mechanism is used to filter key queries to reduce computational complexity. A generative decoder is then used to output the predicted aeration volume values for multiple future time points.
2. The method as described in claim 1, characterized in that, Feature selection based on correlation analysis of the historical operational data specifically includes: Calculate the Spearman rank correlation coefficient between each candidate feature and the aeration rate; Candidate features are sorted from largest to smallest based on the absolute value of their correlation coefficients; Select the pre-defined quantitative features that rank highest as the feature subset.
3. The method as described in claim 1, characterized in that, Before feature selection, the historical operational data is preprocessed, specifically including: The historical running data is subjected to dual detection using the Z-Score normalization method and the box graph method to identify outliers. For the identified missing and outlier values, linear interpolation is used to impute them based on the valid observations before and after the missing or outlier intervals. The imputed data is subjected to min-max normalization to obtain standardized data, which is then used as input for subsequent feature selection.
4. The method as described in claim 1, characterized in that, The multi-scale temporal feature extraction method includes a first branch and a second branch executed in parallel. The first branch uses an exponential gating mechanism to process the input gate in order to capture short-term fluctuation features in the sequence. The second branch generates a query vector, a key vector, and a value vector, and uses the outer product of the key vector and the value vector to update the memory unit in the form of a matrix in order to capture long-term dependency features in the sequence. The multi-scale temporal feature extraction method fuses the outputs of the two branches to obtain the temporal feature representation.
5. The method as described in claim 1, characterized in that, MSTP-Net is trained and its hyperparameters are optimized using a time-series cross-validation strategy, specifically including: Retrieve the historical execution dataset arranged in chronological order; Set an initial training window length and a validation window length, and divide the historical running dataset forward with a fixed step size; in each division, the training window consists of all continuous data before the current time point, and the validation window is the continuous data segment immediately following the training window; In each partition, the MSTP-Net is trained using training window data and the prediction performance is evaluated using validation window data to obtain the evaluation metrics for each validation. Calculate the average of all validation window evaluation metrics as the evaluation result of generalization performance, and select model hyperparameters based on this result.
6. The method as described in claim 1, characterized in that, The method of using the Informer prediction method to output predicted aeration values for multiple future time points specifically includes: The temporal feature representation is input into the encoder, a sparse query matrix is calculated through a sparse self-attention mechanism, and the feature length is halved layer by layer through an attention distillation operation to obtain the encoded features. The learnable start tag sequence and the encoded features are input into the decoder to generate aeration volume predictions for multiple future time steps in parallel.
7. An aeration volume prediction system based on MSTP-Net, characterized in that, include: The feature selection module is used to acquire historical operating data of the wastewater treatment biochemical tank, perform feature selection on the historical operating data based on correlation analysis, and filter out a subset of features that are correlated with the aeration volume and meet preset conditions. The multi-scale temporal feature extraction module is used to extract short-term fluctuation features and long-term dependency features from the feature subset using a multi-scale temporal feature extraction method, and then fuse the extracted features to obtain a temporal feature representation. The training optimization module is used to train and optimize the MSTP-Net using the time-series feature representation as training input and employing a time-series cross-validation strategy to obtain an optimized MSTP-Net prediction model. The prediction module utilizes the optimized MSTP-Net prediction model, employs the Informer prediction method, filters key queries through a sparse self-attention mechanism to reduce computational complexity, and uses a generative decoder to output predicted aeration values for multiple future time points.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the program, it implements the steps of the MSTP-Net-based aeration volume prediction method as described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the MSTP-Net-based aeration volume prediction method as described in any one of claims 1 to 6.
10. A computer program product, comprising software code, characterized in that, The program in the software code performs the steps of the aeration volume prediction method based on MSTP-Net as described in any one of claims 1 to 6.