Method and system for monitoring operation of DO in AAO-MBR water based on LSTM time sequence model
By applying a monitoring method based on the LSTM time series model in the AAO-MBR sewage treatment process, the problem of difficulty in accurately monitoring and predicting the operation of dissolved oxygen in water in the prior art is solved, and precise control of the sewage treatment process and improvement of the operation efficiency is achieved.
Patent Information
- Application Number
- CN202510024677.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-04-18
AI Technical Summary
The prior art is difficult to accurately monitor and predict the operation of dissolved oxygen (DO) in AAO-MBR water, resulting in problems such as unsatisfactory sewage treatment results and excessive energy consumption.
The monitoring method based on the LSTM time series model is adopted, and the actual operation data of the sewage treatment plant is collected, pretreated and segmented, and the LSTM model is constructed for training, and the control condition rules are defined to achieve prediction and control of DO in water.
It has achieved scientific and accurate monitoring of the dissolved oxygen concentration in AAO-MBR water, and can define control conditions and rules based on actual needs, improving the stability and efficiency of the sewage treatment process.
Smart Images

Figure CN119847090A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of sewage treatment, and more particularly to a method and system for monitoring DO operation in AAO-MBR water based on an LSTM time series model. Background Art
[0002] Currently, the AAO-MBR wastewater treatment process is used to treat wastewater with high ammonia nitrogen and COD content. Sources of this wastewater include food production wastewater, food processing wastewater, and fertilizer plant wastewater. The wastewater is treated through screens, sedimentation tanks, AAO, MBR processes, and denitrification tanks. Current process control parameters include inlet and outlet flow rates, water temperature, pH, ammonia nitrogen, total nitrogen, total phosphorus, phosphorus removal agent dosage, aeration rate, steam-water ratio, DO, and transmembrane pressure differential. Wastewater treatment plants use real-time data to monitor and record operating parameters on an hourly basis. This means each parameter is recorded 24 times per day, totaling at least 240 parameters per day. This translates to a total of 7,200 data points per month. This large amount of data makes it difficult to manually identify pollutant removal effectiveness and removal rates. It is difficult to quickly determine the effectiveness of pollutant removal and the parameters that need adjustment based solely on the pollution control process. Furthermore, human experience-based data analysis also has hysteresis, hindering timely adjustments to the pollution control process.
[0003] The dissolved oxygen content in water is one of the key parameters in the operation of this process. Appropriate dissolved oxygen concentration plays a vital role in the metabolic activities of microorganisms and the removal efficiency of pollutants. However, traditional dissolved oxygen monitoring methods often have certain limitations. For example, the real-time performance of measurements based on single-point sensors is not strong enough, making it difficult to accurately predict the changing trend of dissolved oxygen. In addition, the impact of multiple factors on dissolved oxygen in the time series cannot be well comprehensively considered. As a result, problems such as unsatisfactory treatment effects and excessive energy consumption may occur during sewage treatment due to poor dissolved oxygen control.
[0004] Therefore, how to accurately monitor and predict the dissolved oxygen operation status in AAO-MBR water is an urgent problem that technicians in this field need to solve. Summary of the Invention
[0005] In view of this, the present invention provides a method and system for monitoring DO operation in AAO-MBR water based on LSTM time series model to solve the problems existing in the background technology.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] A method for monitoring DO operation in AAO-MBR water based on an LSTM time series model includes:
[0008] Collect actual operating data from different key nodes of the sewage treatment plant using the AAO-MBR process to generate an original data set;
[0009] Preprocess the original data set, including performing PCA analysis on the original data set;
[0010] Split the preprocessed original dataset into training set and test set;
[0011] Build a water DO prediction model based on LSTM time series and train the model using the training set;
[0012] Define control condition rules based on predicted DO values according to actual application requirements;
[0013] Use the trained model to predict the test set data and obtain the predicted value of DO;
[0014] The predicted value of DO is compared with the preset threshold to obtain a comparison result, and the control condition is obtained based on the comparison result.
[0015] Optionally, the PCA analysis is to analyze all types of data detected by the sewage treatment plant to obtain initial data indicators; after obtaining the initial data indicators, in order to avoid the DO-related parameters being deleted due to the data being too small or the data being considered worthless after PCA analysis, it is necessary to add other DO-related parameters to the initial data indicators after PCA analysis, thereby obtaining the preprocessed original data set.
[0016] Optionally, the preprocessing further includes data standardization and data scaling, wherein data scaling regulates data magnitude differences so that the magnitudes of various indicators remain consistent or meet the operating requirements of the water DO prediction model based on the LSTM time series.
[0017] Optionally, the preprocessed original data set is divided into a training set and a test set as follows:
[0018] The preprocessed raw data set is split into a 60% training set and a 40% test set. Optionally, the LSTM time series-based water DO prediction model is represented by the following function:
[0019] An LSTM neuron consists of four key components: an input gate i, a forget gate f, an output gate o, and an internal storage unit c; these operation functions Q1-Q6 are as follows:
[0020]
[0021] Among them, W f ,W i ,W C ,Wo represents the weight matrix, b f , b i , b C , b o represents the bias term, σ is the sigmoid function, tanh is the hyperbolic tangent function, h t-1 is the hidden state at the previous moment, x t is the input at the current moment, f t is the output of the forget gate, i t is the output of the input gate, is the candidate cell state, C t is the cell state at the current moment, o t is the output of the output gate, h t is the hidden state at the current moment.
[0022] Optionally, the process of training the DO prediction model based on the LSTM time series using the training set is as follows:
[0023] Forward calculate the output value of each neuron;
[0024] Construct the loss function according to the error term value of each neuron;
[0025] According to the gradient guidance of the loss function, update the network weight parameters. The backpropagation of the LSTM error term includes two levels. One is the spatial level, propagating the error term to the upper layer of the network. The other is the time level, propagating backward in time, that is, starting from the current t moment, calculating the error at each moment.
[0026] Optionally, the loss function is represented by the following formula:
[0027]
[0028] In the formula, θ represents the parameter vector in the LSTM, τ is the output sequence, y t , z t represents the output at time t. [[ID= 52]]
[0029] Optionally, the specific process of comparing the predicted value of DO with the preset threshold to obtain the comparison result and obtaining the control condition based on the comparison result is as follows:
[0030] When the predicted value of DO < 0.2, the aeration tank operates in an anaerobic environment, and it is necessary to quickly increase the DO value to meet the aerobic operation of the microorganisms in the aeration tank;
[0031] When 0.2 < predicted value of DO < 1.5, the aeration tank operates in an anoxic environment, and the DO content in the aeration tank is increased by slowly increasing DO to adjust the operation mode of the aerobic tank;
[0032] When the DO predicted value is >2, the aerobic pool meets the aerobic operation requirements of the internal microorganisms. At this time, the existing operating state is maintained and the DO operating conditions are maintained.
[0033] A DO operation monitoring system for AAO-MBR water based on LSTM time series model, including:
[0034] The data acquisition module collects actual operating data of different key nodes of the sewage treatment plant using the AAO-MBR process and generates the original data set;
[0035] Data preprocessing module, which preprocesses the original data set, including PCA analysis of the original data set;
[0036] Data segmentation module, which divides the preprocessed original data set into training set and test set;
[0037] Model building module, builds a water DO prediction model based on LSTM time series and trains the model using the training set;
[0038] The control condition definition module defines the control condition rules based on the predicted DO value according to actual application requirements;
[0039] The DO prediction module uses the trained model to predict the test set data and obtain the predicted DO value;
[0040] The control condition output module compares the predicted value of DO with the preset threshold to obtain a comparison result, and obtains the control condition based on the comparison result.
[0041] Through the above technical solution, it can be known that compared with the prior art, the present invention discloses a method for monitoring the operation of DO in AAO-MBR water based on the LSTM time series model, including: collecting actual operation data of different key nodes of the sewage treatment plant using the AAO-MBR process to generate an original data set; preprocessing the original data set, including performing PCA analysis on the original data set; dividing the preprocessed original data set into a training set and a test set; constructing a water DO prediction model based on the LSTM time series, and training the model using the training set; defining control condition rules based on the predicted DO value according to actual application needs; using the trained model to predict the test set data to obtain the predicted value of DO; comparing the predicted value of DO with a preset threshold to obtain a comparison result, and obtaining the control condition based on the comparison result. The present invention can scientifically and accurately monitor the dissolved oxygen concentration in AAO-MBR water, and can define control condition rules according to actual needs. The control conditions can be obtained by predicting the model and comparing with the preset threshold, which helps to control the operation of the process and improve its operation stability and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0043] Figure 1 The present invention provides a flow chart of the method. DETAILED DESCRIPTION
[0044] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0045] The embodiment of the present invention discloses a method for monitoring DO operation in AAO-MBR water based on LSTM time series model. Figure 1 Shown, including:
[0046] Collect actual operating data from different key nodes of the sewage treatment plant using the AAO-MBR process to generate an original data set;
[0047] For sewage treatment plants, operating parameters include more than just DO concentration. In addition to DO, other operating parameters also need to be collected, such as DO / COD / BOD / pH / ammonia nitrogen / total nitrogen / total phosphorus / steam-water ratio / aeration air volume / transmembrane pressure difference in the water at different key nodes, and other actual sewage treatment plant operation data. The data collected at each node are used as the data of the original data set.
[0048] PCA is to perform principal component analysis on all the above raw data and filter out data that are closely related to DO as the original data set or input data.
[0049] Preprocess the original data set, including performing PCA analysis on the original data set;
[0050] Split the preprocessed original dataset into training set and test set;
[0051] Build a water DO prediction model based on LSTM time series and train the model using the training set;
[0052] Define control condition rules based on predicted DO values according to actual application requirements;
[0053] Use the trained model to predict the test set data and obtain the predicted value of DO;
[0054] The predicted value of DO is compared with the preset threshold to obtain a comparison result, and the control condition is obtained based on the comparison result.
[0055] In a specific embodiment, PCA analysis is to analyze all types of data detected by the sewage treatment plant to obtain initial data indicators; after obtaining the initial data indicators, in order to avoid the DO-related parameters being deleted due to the data being too small or the data being deemed worthless after PCA analysis, it is necessary to add other DO-related parameters to the initial data indicators after PCA analysis, thereby obtaining the preprocessed original data set.
[0056] PCA analysis is performed on data to preserve as much of the original data as possible by projecting high-dimensional data into a low-dimensional space. PCA finds the eigenvectors of the data covariance matrix, sorts them by eigenvalue, and selects the top k eigenvectors to form a new coordinate system. The original data is then projected onto this new coordinate system to achieve dimensionality reduction. The advantage of PCA is that it effectively removes redundant information from the data, reduces computational complexity, and improves the model's generalization capabilities.
[0057] In a specific embodiment, the preprocessing also includes data standardization and data scaling, wherein data scaling regulates the difference in data magnitude so that the magnitudes of various indicators remain consistent or meet the operating requirements of the water DO prediction model based on the LSTM time series.
[0058] In a specific embodiment, the preprocessed original data set is divided into a training set and a test set as follows:
[0059] The preprocessed original dataset is divided into 60% training set and 40% test set.
[0060] In a specific embodiment, the water DO prediction model based on LSTM time series is represented by the following function:
[0061] The LSTM model is an artificial intelligence model. Each LSTM layer has three important gate structures, which are the forget gate, input gate, output gate, and two important states from front to back: the cell state and the hidden state. The cell state not only remembers the information of a certain time step, but also maintains a relatively stable memory of the entire time series, which is long-term memory information. For the hidden state, it pays more attention to the output of the current time step and the previous time step, which is short-term memory information. The LSTM model predicts and analyzes the input data through long-term and short-term memory. The data recorded by the sewage treatment plant has obvious time characteristics. The LSTM network uses the information of the previous moment and the input information of this moment to train together. On the basis of the number of samples and the number of features, the time axis is added to predict and analyze the data matrix. DO belongs to the information at a certain moment, but it is required to remain greater than a certain value for a long time.
[0062] An LSTM neuron consists of four key components: an input gate i, a forget gate f, an output gate o, and an internal storage unit c; these operation functions Q1-Q6 are as follows:
[0063]
[0064] Among them, W f ,W i ,W C ,W o represents the weight matrix, b f ,b i ,b C ,b o represents the bias term, σ is the sigmoid function, tanh is the hyperbolic tangent function, h t-1 is the hidden state at the previous moment, x t is the input at the current moment, f t is the output of the forget gate, i t is the output of the input gate, is the candidate unit state, C t is the unit state at the current moment, o t is the output of the output gate, h t is the hidden state at the current moment.
[0065] The internal storage unit c stores data related to LSTM neurons;
[0066] It also includes a projection function, which is mainly used to control the flow of information and update the cell state. It adjusts the discard of information, updates the cell state, and determines the final output information through the forget gate and input-output gate.
[0067] In a specific embodiment, the process of training the water DO prediction model based on the LSTM time series using the training set is as follows:
[0068] The LSTM training process uses a backpropagation algorithm and follows three steps: First, the output value of each neuron is calculated forward. For LSTM, this is done separately according to the front-end algorithm. Second, the specific parameters for model optimization are determined, selected based on the training process. Early in training, the output value will not match the expected value, so a loss function is constructed based on the error term of each neuron. Third, the network weight parameters are updated based on the gradient of the loss function. Backpropagation of the LSTM error term involves two levels: a spatial level, which propagates the error term to the previous layer of the network, and a temporal level, which propagates backward through time, starting from the current time t and calculating the error at each moment.
[0069] The loss function is expressed as follows:
[0070]
[0071] Where θ represents the parameter vector in LSTM, τ is the output sequence, and y t ,z t represents the output at time t.
[0072] For sewage treatment plant data, the output value of each neuron in the forward pass is a pollutant indicator. Early in training, output values and expected values are obtained, forming error data. The deviation between this data and the actual value is determined by human judgment and the DO prediction model based on the LSTM time series. During the data prediction and analysis process, some data is output as decimals. To prevent the model from simply judging parameters based on data size, human judgment is required at this stage. For example, the dissolved oxygen (DO) concentration in an AAO aerobic tank is generally greater than 2.0 mg / L, while conventional sewage plants operate at a DO concentration greater than 1.8 mg / L to meet aerobic requirements. Therefore, after obtaining the LSTM prediction results, human judgment is required to determine whether a small number of predictions close to the critical value need to be adjusted. The loss function is then constructed based on the error value. The subsequent process jumps back to the first step and repeats steps 1, 2, and 3 until the network error is less than the specified value. The errors and output values formed at this stage require human judgment. When the output data is close to common sense values and has no obvious errors, the number of human judgments and decision-making degrees can be gradually reduced, and the judgment of the data can be transferred to the LSTM model. The final prediction result of the LSTM can be judged by combining multiple time levels.
[0073] Adjust the training effect of the model by adjusting the parameter values. Directly adjust the number of training epochs of the model and the batch size used in each training epoch. In actual operation, the parameter values can be adjusted according to the actual situation and data volume calculation. The parameter of the number of training epochs of the model determines how many times the model will iteratively train on the entire training dataset; the batch size used in each training epoch determines the number of samples used for training in each iteration; the validation split number represents that during the training process, a part (20%) of the training dataset is used for validation to evaluate the generalization ability of the model; it also includes controlling the verbosity of the output. The model outputs more information during the training process, including the loss value of each round of training, the loss value on the validation set, the training progress, etc.
[0074] In a specific embodiment, compare the predicted value of DO with a preset threshold to obtain a comparison result, and obtain control conditions based on the comparison result specifically as follows:
[0075] When the predicted value of DO < 0.2, the aeration tank operates in an anaerobic environment, and it is necessary to quickly increase the DO value to meet the aerobic operation of the microorganisms in the aeration tank;
[0076] When 0.2 < predicted value of DO < 1.5, the aeration tank operates in an anoxic environment, and the DO content in the aeration tank is increased by slowly increasing DO to adjust the operation mode of the aerobic tank;
[0077] When the predicted value of DO > 2, the aerobic tank meets the aerobic operation of the internal microorganisms. At this time, maintain the existing operating state and keep the operating conditions of DO.
[0078] It also includes visualizing the prediction results: showing the PCA results and the data prediction results.
[0079] Principal component analysis (PCA) is a commonly used method for data dimensionality reduction and feature extraction. By visualizing the PCA results, it is possible to intuitively see the structural characteristics of the data after PCA transformation, the amount of information contained in each principal component, and the distribution relationship between samples, etc., which helps to better understand the internal characteristics of the original dataset.
[0080] After predicting using the constructed DO prediction model in water based on the LSTM time series, visualizing the prediction results can intuitively evaluate the accuracy and reliability of the model prediction, as well as whether the trend of data changing over time is well captured by the model, etc.
[0081] An AAO-MBR water DO operation monitoring system based on the LSTM time series model includes:
[0082] A data acquisition module that acquires the actual operation data of different key nodes of a sewage treatment plant applying the AAO-MBR process and generates an original dataset;
[0083] Data preprocessing module, which preprocesses the original data set, including PCA analysis of the original data set;
[0084] Data segmentation module, which divides the preprocessed original data set into training set and test set;
[0085] Model building module, builds a water DO prediction model based on LSTM time series and trains the model using the training set;
[0086] The control condition definition module defines the control condition rules based on the predicted DO value according to actual application requirements;
[0087] The DO prediction module uses the trained model to predict the test set data and obtain the predicted DO value;
[0088] The control condition output module compares the predicted value of DO with the preset threshold to obtain a comparison result, and obtains the control condition based on the comparison result.
[0089] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.
[0090] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for monitoring DO operation in AAO-MBR water based on LSTM time series model, characterized in that: Including: Collecting the actual operation data of different key nodes of a sewage treatment plant adopting the AAO-MBR process to generate an original data set; Preprocessing the original data set, including performing PCA analysis on the original data set; Dividing the preprocessed original data set into a training set and a test set; Constructing a DO prediction model in water based on the LSTM time series and training the model using the training set; Defining control condition rules based on the predicted DO values according to actual application requirements; Using the trained model to predict the data in the test set to obtain the predicted values of DO; Comparing the predicted values of DO with a preset threshold to obtain a comparison result, and obtaining control conditions based on the comparison result.
2. A method for monitoring DO operation in AAO-MBR water based on LSTM time series model according to claim 1, characterized in that: The PCA analysis is to analyze all types of data detected by the sewage treatment plant to obtain initial data indicators; after obtaining the initial data indicators, in order to avoid deleting this part of type data due to the data related to DO being too small or considered worthless after PCA analysis, other parameters related to DO need to be added to the initial data indicators after PCA analysis, so as to obtain the preprocessed original data set.
3. A method for monitoring DO operation in AAO-MBR water based on LSTM time series model according to claim 2, characterized in that: The preprocessing also includes data standardization and data scaling, where data scaling regulates the data magnitude difference to make the order of magnitude of each indicator consistent or meet the operation requirements of the DO prediction model in water based on the LSTM time series.
4. A method for monitoring DO operation in AAO-MBR water based on LSTM time series model according to claim 1, characterized in that: The specific method of dividing the preprocessed original data set into a training set and a test set is as follows: Dividing the preprocessed original data set according to the ratio of 60% training set and 40% test set.
5. A method for monitoring DO operation in AAO-MBR water based on LSTM time series model according to claim 1, characterized in that: The DO prediction model in water based on the LSTM time series is represented by the following function: The LSTM neuron consists of four key parts: input gate i, forget gate f, output gate o, and internal storage unit c; the operation functions Q1-Q6 are as follows: Among them, W f ,W i ,W c ,W o represents the weight matrix, b f ,b i ,b C ,b o represents the bias term, σ is the sigmoid function, tanh is the hyperbolic tangent function, h t-1 is the hidden state at the previous moment, x t is the input at the current moment, f t is the output of the forget gate, i t is the output of the input gate, is the candidate unit state, C t is the unit state at the current moment, o t is the output of the output gate, h t is the hidden state at the current moment.
6. A method for monitoring DO operation in AAO-MBR water based on LSTM time series model according to claim 1, characterized in that: The process of training the DO prediction model in water based on the LSTM time series using the training set is: Forward calculating the output value of each neuron; Constructing a loss function according to the error term value of each neuron; According to the gradient guidance of the loss function, updating the network weight parameters. The backpropagation of the LSTM error term includes two levels. One is the spatial level, propagating the error term to the upper layer of the network, and the other is the time level, propagating backward along time, that is, starting from the current t moment, calculating the error at each moment.
7. A method for monitoring DO operation in AAO-MBR water based on LSTM time series model according to claim 6, characterized in that: The loss function is represented by the following formula: In the formula, θ represents the parameter vector in LSTM, τ is the output sequence, and y t ,z t represents the output at time t.
8. A method for monitoring DO operation in AAO-MBR water based on LSTM time series model according to claim 1, characterized in that: The specific method of comparing the predicted values of DO with a preset threshold to obtain a comparison result and obtaining control conditions based on the comparison result is as follows: When the predicted value of DO < 0.2, the aeration tank operates in an anaerobic environment, and it is necessary to quickly increase the DO value to meet the aerobic operation of the microorganisms in the aeration tank; When 0.2 < the predicted value of DO < 1.5, the aeration tank operates in an anoxic environment, and the DO content in the aeration tank is increased by slowly increasing DO to adjust the operation mode of the aerobic tank; When the predicted value of DO > 2, the aerobic tank meets the aerobic operation of the internal microorganisms. At this time, the existing operation state is maintained, and the operation conditions of DO are maintained.
9. A DO operation monitoring system for AAO-MBR water based on LSTM time series model, characterized in that: A method for monitoring DO operation in AAO-MBR water based on an LSTM time series model according to any one of claims 1 to 8 comprises: The data acquisition module collects the actual operation data of different key nodes of the sewage treatment plant using the AAO-MBR process and generates the original data set; The data preprocessing module preprocesses the original data set, including PCA analysis of the original data set; Data segmentation module, which divides the preprocessed original data set into training set and test set; Model building module, building a water DO prediction model based on LSTM time series and training the model using the training set; The control condition definition module defines the control condition rules based on the predicted DO value according to the actual application requirements; DO prediction module, uses the trained model to predict the test set data and obtain the predicted value of DO; The control condition output module compares the predicted value of DO with the preset threshold value to obtain a comparison result, and obtains the control condition based on the comparison result.