Sewage quality prediction method and system based on multi-model fusion stacking
Through the multi-model fusion stacked sewage water quality prediction method, combined with the parallel model and the Attention-biLSTM meta-model, the problems of inaccurate sewage water quality prediction and poor stability in the existing technology are solved, and high-precision and low-cost sewage water quality prediction and real-time monitoring are achieved.
Patent Information
- Application Number
- CN202510475100.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-05-13
AI Technical Summary
The existing sewage water quality prediction and analysis methods cannot accurately reflect the real-time changes in sewage water quality, and the traditional chemical measurement methods are costly, have poor stability and cannot be measured in a timely and continuously, so the prediction accuracy is not high enough.
The sewage water quality prediction method with multi-model fusion stacking is used to predict the stacking structure of the parallel model and the meta-model. The parallel models include RBFNN, ELM, GRNN and GBDT models, and the meta-model is the Attention-biLSTM model. The data set is extended through the deformation expansion data generation method to enhance the robustness of the model.
It significantly improves the accuracy of sewage water quality prediction, and can quickly and accurately predict key indicators in sewage effluent water quality, such as COD, NH3-N, TN, TP, and support real-time monitoring and precise control of sewage treatment process.
Smart Images

Figure CN119990480A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of water quality prediction and analysis in a sewage treatment process, and specifically relates to a sewage quality prediction method and system based on multi-model fusion stacking. Background Art
[0002] Importance of sewage treatment and water quality index measurement: In modern sewage treatment technology, AAO (anaerobic-anoxic-aerobic reactor) is widely used due to its strong adaptability and flexible operation. Among them, chemical oxygen demand (COD), ammonia nitrogen (NH 3 As key indicators for measuring the content of pollutants in water, the accurate determination of total nitrogen (TN), total phosphorus (TP) and total nitrogen (N) is of irreplaceable importance for optimizing wastewater treatment schemes and ensuring that wastewater discharge meets strict regulatory standards. They are not only directly related to the efficiency of wastewater treatment, but also play a key role in the assessment of environmental impact and process control.
[0003] Traditional COD, NH 3 -N, TN, TP determination methods: However, the traditional COD, NH 3 -N, TN, TP chemical analysis methods have many drawbacks. This method consumes a large amount of chemical agents during the determination process, which not only increases the detection cost, but also may cause secondary pollution to the environment. At the same time, the time required for water sample digestion and determination is long, and it is impossible to obtain monitoring data online in a timely and continuous manner, which makes it difficult to adjust the treatment strategy in time during the sewage treatment process, and it is difficult to meet the needs of modern sewage treatment for real-time monitoring and precise control.
[0004] The rise and problems of soft sensing methods: In order to overcome the shortcomings of traditional chemical determination methods, soft sensing models based on machine learning and other methods, namely water quality soft sensors, came into being. This method predicts water quality COD, NH 3 -N, TN, and TP content are expected to be quickly and online monitored. However, due to the complex dynamic characteristics of the sewage treatment process and the 3 Due to the complexity and discontinuity of N, TN, and TP measurements, the existing soft sensing methods still need to be improved in terms of prediction accuracy and are difficult to accurately reflect the real-time changes in sewage quality. Summary of the invention
[0005] The purpose of the present invention is to solve the problems that the existing prediction and analysis methods cannot accurately reflect the real-time changes of sewage quality in the water treatment process, the existing water quality index monitoring cost is high or the stability is poor or it cannot be measured continuously and timely, and the prediction accuracy is not high enough. A sewage water quality prediction method with multi-model fusion and stacking is proposed, which aims to use the low-cost and stable water quality sensor monitoring index data to predict the indicators with high cost or poor stability or cannot be measured continuously and timely, such as COD, ammonia nitrogen value, TN, and TP.
[0006] The technical solution of the present invention is as follows: In the first aspect, a method for predicting sewage quality based on multi-model fusion stacking comprises the following steps: S1. Obtain wastewater quality monitoring data, pre-process the wastewater quality monitoring data, and then construct a data set; S2. Use the data set to construct a sewage water quality prediction model of multi-model fusion stacking; wherein the sewage water quality prediction model includes a parallel model and a meta-model, the input end of the parallel model is the input end of the entire sewage water quality prediction model, and the output end of the parallel model is connected to the input end of the meta-model; the output end of the meta-model is the output end of the entire sewage water quality prediction model; S3. Input the wastewater quality monitoring data to be predicted into the parallel model for processing, and output a preliminary prediction value; S4. Input the preliminary prediction value into the meta-model for processing to obtain the final prediction value and complete the sewage quality prediction.
[0007] Preferably, the wastewater quality monitoring data in step S1 includes the influent COD, influent ammonia nitrogen NH 3 -N, pH value, oxidation-reduction potential ORP, reaction temperature T and dissolved oxygen DO.
[0008] Preferably, the step S1 specifically includes the following sub-steps: Obtain wastewater quality monitoring data; Calculate the deformation and expansion data of each wastewater quality monitoring data; Use arithmetic interpolation to fill in missing data in wastewater quality monitoring data; Construct a data set based on the deformed extended data and the filled wastewater quality monitoring data.
[0009] Preferably, the deformation and expansion data include: pH change rate △pH, oxidation-reduction potential change rate △ORP, dissolved oxygen change rate △DO, reaction temperature change rate △T, influent COD change rate △COD, influent ammonia nitrogen change rate △NH 3 -N, pH cumulative value pH Cum , Oxidation-reduction potential cumulative value ORP Cum , dissolved oxygen cumulative value DO Cum, reaction temperature cumulative value T Cum , Influent COD cumulative value COD Cum , the cumulative value of ammonia nitrogen in the influent NH 3 -N Cum , the product of the monitoring data of each wastewater quality index and the quotient of the monitoring data of each wastewater quality index.
[0010] Preferably, the parallel models in step S2 include a parallel RBFNN model, an ELM model, a GRNN model and a GBDT model.
[0011] Preferably, the preliminary predicted value in step S3 includes the preliminary predicted value of influent COD, the preliminary predicted value of influent ammonia nitrogen NH 3 -N preliminary prediction value, TN preliminary prediction value and TP preliminary prediction value.
[0012] Preferably, the metamodel in step S4 is an Attention-biLSTM model; the final prediction value output by the Attention-biLSTM model includes the final prediction value of COD, the influent ammonia nitrogen NH 3 -N final predicted value, TN final predicted value and TP final predicted value.
[0013] Preferably, the Attention-biLSTM model processes the preliminary prediction value to obtain the final prediction value, specifically comprising the following steps: Set input sequence ,have:
[0014] in, represents the initial prediction value input at time step t, and n represents the total time step; Calculate the input sequence The forward hidden state and the reverse hidden state are calculated as follows:
[0015] in, represents the forward hidden state at time step t, represents the reverse hidden state at time step t, represents the forward LSTM link, represents the reverse LSTM link, represents the forward hidden state at time step t+1, Represents the reverse hidden state at the t+1 time step; According to the forward hidden state and the reverse hidden state, the attention weight is calculated using the attention mechanism, and the calculation formula is:
[0016] in, Indicated in t The attention score calculated at time step, Representation and time step t The associated learnable vector, represents the inverse tangent function, Indicates that the hidden state of the positive and the reverse hidden state Vectors concatenated by dimension, Represents the hidden state of the concatenated forward and the reverse hidden state A learnable weight matrix that performs a linear transformation, represents the learnable bias vector, represents the attention weight, represents the activation function; According to the attention weight, calculate the context vector , and its calculation formula is:
[0017] According to the context vector, the final prediction value is calculated, and the calculation formula is:
[0018] in, represents the final predicted value, represents the activation function, Represents the context vector and t The initial forecast value entered at time step Vectors concatenated by dimension, Represents the concatenated vector A learnable weight matrix that performs a linear transformation, represents the learnable bias vector.
[0019] The beneficial effects of the present invention are: 1. The present invention introduces a stacking structure of "multiple models in parallel + Attention-biLSTM metamodel" in sewage quality prediction. It makes preliminary predictions by connecting multiple models in parallel, and then uses the preliminary prediction results as the input of the metamodel, which solves the problem that a single model is insufficient in modeling complex time series and nonlinear relationships, and realizes the complementary advantages of multiple models. This fusion method can effectively integrate the prediction capabilities of different models, reduce the possible deviations of a single model, and thus significantly improve the prediction accuracy.
[0020] 2. The meta-model (Attention-biLSTM) combines the attention mechanism and the bidirectional long short-term memory network, which can more effectively capture the long-term dependencies and contextual information in time series data, further improving the accuracy of predictions.
[0021] 3. The present invention proposes a deformation expansion data generation method. By adding data deformations between original data (such as accumulation, rate of change, multiplication, quotient, etc.), not only the characteristics of the original data are considered, but also the changes in single indicator data and the correlation between different indicator data, thereby expanding the data set and enhancing the robustness of the model. At the same time, it also enhances the dynamic correlation of input features, which is differentiated from existing data enhancement technologies (such as wavelet denoising).
[0022] 4. The present invention can quickly and accurately predict the key indicators of sewage effluent quality (such as COD, NH 3 -N, TN, TP), provides real-time monitoring data for the sewage treatment process, helps to adjust the treatment strategy in time and ensure that sewage discharge meets regulatory standards. By accurately predicting water quality indicators, it can provide strong support for the precise control of the sewage treatment process, optimize sewage treatment plans, improve treatment efficiency, and reduce operating costs.
[0023] In a second aspect, a sewage water quality prediction system based on multi-model fusion stacking is provided, the system comprising a processor, and the processor is used to execute the sewage water quality prediction method based on multi-model fusion stacking as described in the first aspect.
[0024] In a third aspect, a computer-readable storage medium stores computer instructions. In response to a computer reading the computer instructions in the storage medium, the computer executes the sewage water quality prediction method based on multi-model fusion stacking as described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 Shown is a flow chart of a sewage quality prediction method based on multi-model fusion stacking provided in Example 1 of the present invention.
[0026] Figure 2 The figure shows a flowchart of a sewage quality prediction method based on multi-model fusion stacking provided in Example 1 of the present invention.
[0027] Figure 3 The flowchart shown is a process of processing a metamodel test set by taking the prediction of TN as an example provided in Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0028] Now, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. It should be understood that the embodiments shown and described in the accompanying drawings are only exemplary and are intended to explain the principles and spirit of the present invention, rather than to limit the scope of the present invention.
[0029] Embodiment 1: like Figure 1 and Figure 2 As shown, a sewage quality prediction method based on multi-model fusion stacking includes the following steps: S1. Obtain wastewater quality monitoring data, pre-process the wastewater quality monitoring data, and then construct a data set; S2. Use the data set to construct a sewage water quality prediction model of multi-model fusion stacking; wherein the sewage water quality prediction model includes a parallel model and a meta-model, the input end of the parallel model is the input end of the entire sewage water quality prediction model, and the output end of the parallel model is connected to the input end of the meta-model; the output end of the meta-model is the output end of the entire sewage water quality prediction model; S3. Input the wastewater quality monitoring data to be predicted into the parallel model for processing, and output a preliminary prediction value; S4. Input the preliminary prediction value into the meta-model for processing to obtain the final prediction value and complete the sewage quality prediction.
[0030] In this embodiment, the wastewater quality monitoring data in step S1 includes the influent COD, influent ammonia nitrogen NH 3 -N, pH value, oxidation-reduction potential ORP, reaction temperature T and dissolved oxygen DO.
[0031] In this embodiment, step S1 specifically includes the following sub-steps: Obtain wastewater quality monitoring data; Calculate the deformation and expansion data of each wastewater quality monitoring data; Use arithmetic interpolation to fill in missing data in wastewater quality monitoring data; Construct a data set based on the deformed extended data and the filled wastewater quality monitoring data.
[0032] In this embodiment, the deformation extension data includes: pH change rate △pH = pH i -pH i-1 ; Oxidation-reduction potential change rate △ORP = ORP i -ORP i-1 ; Dissolved oxygen change rate △DO=DO i -DO i-1 ; Reaction temperature change rate △T=Ti -T i-1 ; Influent COD change rate △COD = COD i -COD i-1 ; Influent ammonia nitrogen change rate △NH 3 -N=NH 3 -N i -NH 3 -N i-1 ; pH value Cum =pH 1 +pH 2 +…+pH i ; Oxidation reduction potential (ORP) Cum =ORP 1 +ORP 2 + … +ORP i ; Dissolved oxygen accumulation value DO Cum =DO 1 +DO 2 +… +DO i ; Reaction temperature cumulative value T Cum =T 1 +T 2 +… +T i ; Influent COD cumulative value COD Cum =COD 1 +COD 2 +…+COD i ; Influent ammonia nitrogen cumulative value NH 3 -N Cum =NH 3 -N 1 +NH 3 -N 2 +…+NH 3 -N i ; Product: COD*pH, COD*DO, COD*ORP, COD*T, COD*NH 3 -N, pH*DO, pH*ORP, pH*T, pH*NH 3 -N, DO*ORP, DO*T, DO*NH 3 -N, ORP *T, ORP *NH 3 -N, T*NH 3 -N; Ask for quotient: COD / pH, COD / DO, COD / ORP, COD / T, COD / NH 3 -N, pH / DO, pH / ORP, pH / T, pH / NH 3 -N, DO / ORP, DO / T, DO / NH 3 -N, ORP / T, ORP / NH 3 -N, T / NH 3 -N.
[0033] In this embodiment, the parallel models in step S3 include a parallel radial basis neural network (RBFNN) model, an extreme learning machine (ELM) model, a generalized regression neural network (GRNN) model, and a gradient boosted tree (GBDT) model.
[0034] In this embodiment, the preliminary prediction values in step S3 include the preliminary prediction value of influent COD, the preliminary prediction value of influent ammonia nitrogen NH 3 -N preliminary prediction value, TN preliminary prediction value and TP preliminary prediction value.
[0035] In this embodiment, the meta-model in step S4 is a bidirectional long short-term memory network (Attention-biLSTM) model combined with an attention mechanism; the final prediction values output by the Attention-biLSTM model include the final prediction value of COD, the influent ammonia nitrogen NH 3 -N final predicted value, TN final predicted value and TP final predicted value.
[0036] In this embodiment, the Attention-biLSTM model processes the preliminary prediction value to obtain the final prediction value, which specifically includes the following steps: Set input sequence ,have:
[0037] in, represents the initial prediction value input at time step t, and n represents the total time step; Calculate the input sequence The forward hidden state and the reverse hidden state are calculated as follows:
[0038] in, represents the forward hidden state at time step t, represents the reverse hidden state at time step t, represents the forward LSTM link, represents the reverse LSTM link, represents the forward hidden state at time step t+1, Represents the reverse hidden state at the t+1 time step; According to the forward hidden state and the reverse hidden state, the attention weight is calculated using the attention mechanism, and the calculation formula is:
[0039] in, Indicated in t The attention score calculated at the time step reflects an intermediate calculation result of the degree of correlation between the hidden state at the current moment and other moments. Representation and time step t The relevant learnable vector plays a role in calculating the attention score. The function output is weighted by The output of the function is multiplied to adjust the size of the attention score, represents the inverse tangent function, Indicates that the hidden state of the positive and the reverse hidden state Vectors concatenated by dimension, Represents a learnable weight matrix, which is used to concatenate the hidden state of the forward direction. and the reverse hidden state Perform a linear transformation and map it to a suitable feature space for subsequent attention calculation. Represents a learnable bias vector, which increases the flexibility of the model in its calculation and adds a bias term to the result of the linear transformation. represents the attention weight, represents the activation function; According to the attention weight, calculate the context vector , and its calculation formula is:
[0040] According to the context vector, the final prediction value is calculated, and the calculation formula is:
[0041] in, represents the final predicted value, Represents the activation function, which is used to perform nonlinear transformation on the result after linear transformation, giving the model the ability to learn nonlinear relationships. Common activation functions include sigmoid function, tanh function, ReLU (Rectified Linear Unit) function, etc. Through the processing of activation functions, the model can learn more complex patterns and relationships, so as to better fit the data and make predictions; Represents the context vector and t The initial forecast value entered at time step Vectors concatenated by dimension, Represents a learnable weight matrix, which is the concatenated vector Perform a linear transformation and transform the vector Mapped to the appropriate feature space in order to calculate the final prediction value. The dimension of the matrix depends on the vector The dimensions of and the dimensions of the model's expected output, Represents a learnable bias vector, which is used in linear transformation Then, add the bias vector , increasing the flexibility of the model and enabling the model to learn richer feature representations. Similar to the bias term in the fully connected layer of a neural network, it can adjust the position of the linear transformation result, helping the model to better fit the data.
[0042] The present invention predicts high-cost indicators through low-cost sensor data, providing a more economical solution for real-time monitoring of sewage treatment.
[0043] Embodiment 2: Based on Example 1, this embodiment of the present invention also provides a training process for a parallel model and a meta-model.
[0044] Dataset Partitioning The SBR operating parameters are: 30 minutes of water inflow into the biochemical pool - 30 minutes of stirring - 30 minutes of aeration - ... - 30 minutes of stirring - 30 minutes of aeration - 30 minutes of drainage, of which "- 30 minutes of stirring - 30 minutes of aeration -" is a total of 10 cycles, and the total operating cycle is 660 minutes. In the SBR biochemical reaction pool, DO (dissolved oxygen) online monitors, ORP (oxidation-reduction potential) online monitors and EC (conductivity) online monitors are installed. During the 600-minute reaction time excluding water inflow and drainage, the water quality DO value, ORP value and EC value are collected every 1 minute. Every 10 minutes, the water quality NH 3 -N value, such as NH at the 1st minute, 11th minute, and 21st minute 3 -N value, NH for the rest of the time 3 The -N value is obtained by arithmetic interpolation.
[0045] The SBR reactor was run for 100 complete cycles to obtain the DO, ORP, EC and NH values for 100 cycles. 3 -N data. Each cycle data consists of 600 sets of data, and the data features in each cycle are time series. As shown in Table 1, each time series contains 9 input features - DO, ORP, COD, DO·ORP, DO·COD, ORP·COD, DO / ORP, DO / COD and COD / ORP, as well as output features effluent COD and effluent NH 3 -N.
[0046] Table 1 Input feature description
[0047] Product: COD*pH, COD *DO, COD *ORP, COD *T, COD *NTU, pH*DO, pH*ORP, pH*T, pH*NH 3 -N, DO*ORP, DO*T, DO*NH 3 -N, ORP*T, ORP*NH 3 -N, T* NH 3 -N; Asking questions: COD / pH, COD / DO, COD / ORP, COD / T, COD / NTU, pH / DO, pH / ORP, pH / T, pH / NH 3 -N, DO / ORP, DO / T, DO / NH 3 -N, ORP / T, ORP / NH 3 -N, T / NH 3 -N.
[0048] Build a sewage quality prediction model Among the 200 cycles, 160 cycles are randomly selected and sorted. The data sets of the first 159 cycles are used as training sets, and the remaining 1 cycle data set is used as test sets. The 159 training sets are trained using two different prediction methods to obtain the corresponding prediction models. The two prediction models are used to predict the 160th cycle, and the prediction results of the 160th cycle are obtained, which are recorded as x. 160 ,y 160 Repeat the above steps, taking each of the 160 cycles as the test set and the remaining 159 sets as the training set, and a total of 160 independent prediction results are obtained, denoted as set W, X, W = {w 1 ,w 2 ,……,w 160},X={x 1,x 2 ,……,x 160}.
[0049] Metamodel test set processing The remaining 40 cycles of data after randomly selecting 160 cycles from 200 cycles are used as the test set of the meta-model, and the 160 cycles of data selected in advance are used as the training set. Through the parallel model, the 40 cycle data are predicted respectively to obtain the predicted values of 40 cycles, which are recorded as sets Y and Z, where Y={y 1 ,y 2 ,……,y 40},Z={z 1 ,z 2 ,……,z 40}, sets Y and Z are used as input features on the meta-model test set, such as Figure 3 As shown, TN 2 test Represents the test set data.
[0050] Metamodel construction Select Attention-biLSTM as the meta-model. 3 -N measured values are used as training sets to train the meta-model. Specifically, the set W and X are used as feature inputs, and the corresponding NH 3 -N measured values are used as feature output for training.
[0051] Prediction Output Using the sets Y and Z as input, and using the constructed metamodel, we get the output features of the metamodel through prediction, that is, we get NH for 40 cycles. 3 -N Final predicted value.
[0052] Through the above steps, the present invention improves the prediction accuracy of time series data by comprehensively utilizing the advantages of multiple models and training and predicting in a stacked manner. The core of this method is to effectively integrate the prediction results of different models, use Attention-biLSTM as a meta-model, fully explore the prediction ability of each model, and finally obtain more accurate prediction results. This method has broad application prospects in time series analysis and prediction tasks, and is suitable for data prediction needs in multiple fields.
[0053] The water quality intelligent prediction method of the present invention fully combines the advantages of RBFNN model, ELM model, GRNN model and GBDT model by stacking deep learning and integrated learning models, and maximizes the prediction performance of the model. As shown in Table 2, it can be seen from the prediction performance of different models that in complex sewage water quality data, the present invention can better capture the time series characteristics and nonlinear relationships in the data. In real-time prediction, it can improve prediction accuracy, reduce overfitting, and provide more reliable information basis for proposing feasible improvement plans for wastewater treatment.
[0054] Table 2. Comparison of effluent COD and effluent ammonia nitrogen NH in the test set by the proposed model and other models 3 -N prediction effect comparison
[0055] This invention can not only effectively promote the intelligence and automation of water quality monitoring, but also provide a new idea and method for predictive analysis in other fields, with broad application potential and market value. Through in-depth research on model stacking, it can be replaced or expanded in the future according to different application requirements to achieve more outstanding prediction performance.
[0056] Embodiment 3: On the basis of Example 1, this example also provides a sewage water quality prediction system based on multi-model fusion stacking, which is used to configure and execute a sewage water quality prediction method based on multi-model fusion stacking in Example 1.
[0057] In this embodiment, the system may be an electronic device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor executes the program to implement part or all of the steps of the sewage water quality prediction method based on multi-model fusion stacking as described in Example 1.
[0058] In this embodiment, the electronic device may include: a processor, a memory, a bus and a communication interface. The processor, the communication interface and the memory are connected through a bus. The memory stores a computer program that can be run on the processor. When the processor runs the computer program, it executes part or all of the steps of the sewage water quality prediction method based on multi-model fusion stacking provided in the aforementioned embodiment 1 of the present application.
[0059] The system in the embodiment of the present invention can also be a computer-readable storage medium, which stores a computer program. When the computer program is executed, some or all steps of the sewage water quality prediction method based on multi-model fusion stacking as described in Example 1 are implemented.
[0060] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0061] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0062] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0063] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0064] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0065] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.
Claims
1. A sewage quality prediction method based on multi-model fusion stacking, characterized in that: The following steps are involved: S1. Obtain wastewater quality monitoring data, pre-process the wastewater quality monitoring data, and then construct a data set; S2. Use the data set to construct a sewage water quality prediction model of multi-model fusion stacking; wherein the sewage water quality prediction model includes a parallel model and a meta-model, the input end of the parallel model is the input end of the entire sewage water quality prediction model, and the output end of the parallel model is connected to the input end of the meta-model; the output end of the meta-model is the output end of the entire sewage water quality prediction model; S3. Input the wastewater quality monitoring data to be predicted into the parallel model for processing, and output a preliminary prediction value; S4. Input the preliminary prediction value into the meta-model for processing to obtain the final prediction value and complete the sewage quality prediction.
2. The method for predicting sewage quality based on multi-model fusion stacking according to claim 1 is characterized in that: The wastewater quality monitoring data in step S1 includes the influent COD and influent ammonia nitrogen NH3-N of the wastewater, as well as the pH value, oxidation-reduction potential ORP, reaction temperature T and dissolved oxygen DO.
3. The method for predicting sewage quality based on multi-model fusion stacking according to claim 1 is characterized in that: The step S1 specifically includes the following sub-steps: Obtain wastewater quality monitoring data; Calculate the deformation and expansion data of each wastewater quality monitoring data; Use arithmetic interpolation to fill in missing data in wastewater quality monitoring data; Construct a data set based on the deformed extended data and the filled wastewater quality monitoring data.
4. The method for predicting sewage quality based on multi-model fusion stacking according to claim 3 is characterized in that: The deformation expansion data include: pH change rate △pH, redox potential change rate △ORP, dissolved oxygen change rate △DO, reaction temperature change rate △T, influent COD change rate △COD, influent ammonia nitrogen change rate △NH3-N, pH cumulative value pH Cum , Oxidation-reduction potential cumulative value ORP Cum , dissolved oxygen cumulative value DO Cum , reaction temperature cumulative value T Cum , Influent COD cumulative value COD Cum 、Accumulated value of ammonia nitrogen in influent NH3-N Cum , the product of the monitoring data of each wastewater quality index and the quotient of the monitoring data of each wastewater quality index.
5. The method for predicting sewage quality based on multi-model fusion stacking according to claim 1 is characterized in that: The parallel model in step S2 includes a parallel RBFNN model, an ELM model, a GRNN model and a GBDT model; the input end of the RBFNN model, the input end of the ELM model, the input end of the GRNN model and the input end of the GBDT model are all input ends of the entire parallel model; the output end of the RBFNN model, the output end of the ELM model, the output end of the GRNN model and the output end of the GBDT model are all output ends of the entire parallel model.
6. The method for predicting sewage quality based on multi-model fusion stacking according to claim 1 is characterized in that: The preliminary prediction values in step S3 include a preliminary prediction value of influent COD, a preliminary prediction value of influent ammonia nitrogen NH3-N, a preliminary prediction value of TN and a preliminary prediction value of TP.
7. The method for predicting sewage quality based on multi-model fusion stacking according to claim 1 is characterized in that: The metamodel in step S4 is an Attention-biLSTM model; the final prediction values output by the Attention-biLSTM model include the final prediction value of COD, the final prediction value of influent ammonia nitrogen NH3-N, the final prediction value of TN and the final prediction value of TP.
8. The method for predicting sewage quality based on multi-model fusion stacking according to claim 7 is characterized in that: The Attention-biLSTM model processes the preliminary prediction value to obtain the final prediction value, which specifically includes the following steps: Set input sequence ,have: in, express t The initial forecast value entered at time step, n represents the total time step; Calculate the input sequence The forward hidden state and the reverse hidden state are calculated as follows: in, express t The forward hidden state at time step , express t The hidden state at the reverse time step, represents the forward LSTM link, represents the reverse LSTM link, express t The forward hidden state at time step +1, express t +1 time step reverse hidden state; According to the forward hidden state and the reverse hidden state, the attention weight is calculated using the attention mechanism, and the calculation formula is: in, Indicated in t The attention score calculated at time step, Representation and time step t The associated learnable vector, represents the inverse tangent function, Indicates that the hidden state of the positive and the reverse hidden state Vectors concatenated by dimension, Represents the hidden state of the concatenated forward and the reverse hidden state A learnable weight matrix that performs a linear transformation, represents the learnable bias vector, represents the attention weight, represents the activation function; According to the attention weight, calculate the context vector , and its calculation formula is: According to the context vector, the final prediction value is calculated, and the calculation formula is: in, represents the final predicted value, represents the activation function, Represents the context vector and t The initial forecast value entered at time step Vectors concatenated by dimension, Represents the concatenated vector A learnable weight matrix that performs a linear transformation, represents the learnable bias vector.
9. A sewage quality prediction system based on multi-model fusion stacking, characterized in that: It includes a processor, which is used to execute the sewage water quality prediction method based on multi-model fusion stacking as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that: The storage medium stores computer instructions. In response to the computer reading the computer instructions in the storage medium, the computer executes the sewage water quality prediction method based on multi-model fusion stacking as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Sewage treatment intelligent prediction method based on fusion neural network
CN113837356A
Hybrid clustering and stacking integrated deep learning photovoltaic output prediction method and system
CN119382063A
Cited By
Sewage treatment process closed-loop control method based on machine learning
CN120406375A
Remote sewage treatment system based on big data model
CN121107480A