A sewage treatment process fault prediction method based on improved LSTM-BLS

By using an improved LSTM-BLS model and a weighted width learning method, the challenges of predicting and diagnosing highly nonlinear data in wastewater treatment processes are solved, achieving high-precision and low-cost fault prediction for wastewater treatment processes and ensuring stable system operation.

CN117216502BActive Publication Date: 2025-11-25NORTHEASTERN UNIV CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311300006.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-09
Publication Date
2025-11-25
Estimated Expiration
2043-10-09

AI Technical Summary

Technical Problem

Existing technologies struggle to efficiently predict parameter changes in highly nonlinear and nonstationary data during wastewater treatment, and costly fault diagnosis methods suffer from time consumption and insufficient accuracy.

Method used

An improved LSTM-BLS model is adopted, which combines a feature extraction component and a multi-head attention layer. Time series prediction is performed through a long short-term memory network, and a weighted width learning method is used for fault diagnosis. An imbalanced fault diagnosis model is constructed to improve prediction accuracy and diagnosis efficiency.

Benefits of technology

It achieves high-precision, low-cost fault prediction of the sewage treatment process, can identify abnormal system states in advance, and ensure the safe operation of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117216502B_ABST
    Figure CN117216502B_ABST
Patent Text Reader

Abstract

The application discloses a sewage treatment process fault prediction method based on an improved LSTM-BLS, and comprises the following steps: inputting a sewage treatment process variable history sequence and sewage treatment process effluent water quality variable history sequence data into an improved LSTM-BLS model to obtain a sewage treatment process variable future sequence and a sewage treatment process effluent water quality variable future sequence; based on sewage treatment process normal operation data and sewage treatment process fault operation data, the data is divided into an unbalanced fault diagnosis training set and an unbalanced fault diagnosis verification set according to a proportion; a historical data fault diagnosis model is established; the historical data fault diagnosis model is trained based on the unbalanced fault diagnosis training set to obtain a trained historical data fault diagnosis model; and the sewage treatment process variable future sequence and the sewage treatment process effluent water quality variable future sequence are input into the trained historical data fault diagnosis model to realize prediction of the state of sewage in the sewage treatment process in a future period of time.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of sewage treatment system fault prediction, and particularly relates to a sewage treatment process prediction and diagnosis method based on artificial intelligence. BACKGROUND

[0002] Water plays a crucial role in the evolution of human history and is also one of the essential material resources in the process of industrial development. With the acceleration of urbanization and industrialization in China, the demand for freshwater resources is increasing, and the pressure on freshwater supply is gradually increasing. Currently, the main technology for sewage treatment process is the activated sludge method, which is a complex biochemical reaction technology. The activated sludge purifies sewage through three processes: initial adsorption, microbial metabolism, and formation of flocculation and sedimentation. The essence is to use the microbial population in activated sludge to adsorb, decompose, and oxidize biodegradable organic matter in sewage through a series of biochemical reactions, thereby separating it from the sewage and achieving the purpose of purifying the sewage. The operating state of the sewage treatment system is generally reflected by the changes in multiple process variables. These variables will change correspondingly with different factors such as fault type, location, and severity. By predicting the trend of key variables in the sewage treatment process, the transformation process of the system state in the sewage treatment process can be clearly and intuitively displayed, which lays the foundation for subsequent fault diagnosis. Fault prediction of the sewage treatment process, i.e., predicting the future operating state of the sewage treatment process, can identify the fault type of the sewage treatment system in a poor operating state and provide numerical basis for artificial daily inspection. When this research is carried out at home and abroad, it is generally divided into two steps: sewage treatment process parameter prediction and sewage treatment process operating state classification.

[0003] For the sewage treatment process parameter prediction task, the current main methods include statistical-based time series prediction methods, machine learning-based time series prediction methods, and deep learning-based time series prediction methods. Traditional time series prediction methods based on statistics, such as autoregressive models and autoregressive average moving models, have poor performance in handling non-linear data. Machine learning-based time series prediction methods, such as support vector machine models and extreme learning machine models, also have certain limitations in handling non-linear high-dimensional data. Therefore, deep learning-based time series prediction methods, which are good at handling non-linear features, have become the mainstream of time series prediction methods, including long short-term memory network models, convolutional neural network models, and Transfomer neural networks, all of which have good performance.

[0004] For the wastewater treatment process fault diagnosis task, the current main methods include statistical-based fault diagnosis method, machine learning-based fault diagnosis method and deep learning-based fault diagnosis method. The statistical-based fault diagnosis method generally diagnoses the fault through statistics such as PCA (Principal Component Analysis); the machine learning-based fault diagnosis method can make full use of complex data and fault information in the wastewater treatment process compared with the statistical-based fault diagnosis method, but the effect of non-integrated model is poor, and the effect of solving nonlinear problems is general; the deep learning-based fault diagnosis method is often applied when the data volume is large, and the cost of applying the deep learning model is too large, so it is less applied in the field of wastewater treatment process fault diagnosis.

[0005] The above domestic and foreign research background involves the wastewater treatment process parameter prediction task and the wastewater treatment fault diagnosis task in the wastewater treatment process. In the wastewater treatment process parameter prediction task, the current mainstream method mainly predicts linear and weakly nonlinear data, and the prediction accuracy of high nonlinear and non-stationary data has not reached the ideal state. In the wastewater treatment fault diagnosis task, the current mainstream method has difficulty in processing nonlinear data at low cost, and although the diagnosis accuracy is improved at high cost, it has the disadvantages of high time consumption and the like in application. SUMMARY

[0006] To solve the above problems, the technical scheme adopted by the present application is: a wastewater treatment process fault prediction method based on improved LSTM-BLS, comprising the following steps:

[0007] Obtain the wastewater treatment process variable history sequence, the wastewater treatment process effluent water quality variable history sequence, the wastewater treatment process normal operation data and the wastewater treatment process fault operation data;

[0008] Input the wastewater treatment process variable history sequence and the wastewater treatment process effluent water quality variable history sequence data into the improved LSTM-BLS model to obtain the wastewater treatment process variable future sequence and the wastewater treatment process effluent water quality variable future sequence;

[0009] Based on the wastewater treatment process normal operation data and the wastewater treatment process fault operation data, the unbalanced fault diagnosis training set and the unbalanced fault diagnosis verification set are divided according to the proportion;

[0010] Establish a historical data fault diagnosis model;

[0011] Train the historical data fault diagnosis model based on the unbalanced fault diagnosis training set to obtain the trained historical data fault diagnosis model;

[0012] The future sequence of process variables of the sewage treatment process and the future sequence of effluent water quality variables of the sewage treatment process are input into the trained historical data fault diagnosis model to realize prediction of the state of sewage in the sewage treatment process in a future period of time.

[0013] Further, the construction process of the improved LSTM-BLS model is as follows:

[0014] First, a feature extraction component module is constructed, which is defined as a GTN module. The input and output relationship of the GTN module is represented as:

[0015] Output=Norm(Input+σ(W3(Dropout(W2(ELU(W1·Input+b1))+b2))+b3)⊙(W4(Dropout(W2(ELU(W1·Input+b1))+b2))+b4)

[0016] =GTN(Input)

[0017] In the above formula, W i ,b i are the weights and biases of the fully connected layer in the GTN module, ELU is the linear unit activation function, Dropout is the Dropout operation in deep learning, and Norm is the layer normalization operation.

[0018] Step 1.2: Apply the feature extraction component module to construct the feature layer as follows:

[0019]

[0020] In the formula, V t represents the class attention mechanism weight corresponding to the input [x1,…x t ], GTN represents the feature extraction component module, and λ1,…λ t represent the features of the input [x1,…x t ] obtained by the feature extraction module GTN, flatten represents the flattening operation, and softmax represents the normalization layer operation.

[0021] Step 1.3: Construct an interpretable multi-head attention layer model, and define the interpretable multi-head attention as:

[0022]

[0023]

[0024] In the formula, is a weight matrix shared by all heads, is the linear mapping matrix of the final fully connected layer, Q, K, V represent the input information, key and value in the attention mechanism, represents the weight matrix corresponding to the hth head, m H represents the number of selected heads.

[0025] Further, the wastewater treatment process variable history sequence and the wastewater treatment process effluent water quality variable history sequence data are input into the improved LSTM-BLS model to obtain the wastewater treatment process variable future sequence and the wastewater treatment process effluent water quality variable future sequence.

[0026] The wastewater treatment process variable history sequence and the wastewater treatment process effluent water quality variable history sequence data include m1 wastewater treatment operation variables; the data of the m1 wastewater treatment operation variables in the data sample set are sliced according to the time sequence as input data X1.

[0027] After the deep neural network model is constructed, the sliced data is first mapped into a vector, and is expanded into n time parameter vectors conforming to the dimension d of the model hidden layer;

[0028] The n-dimensional time parameter vectors after expansion are calculated by a feature extraction component to obtain features Z t containing linear information and nonlinear information of the time sequence information;

[0029] The above features Z t are input into an LSTM module for time sequence prediction, and in order to ensure the accuracy of the prediction, the output of the LSTM module is added to Z t and is input into a multi-head attention layer to obtain the output A t of the attention layer.

[0030] The output A t of the attention layer is input into a gating layer, a residual layer is set, and then an output Y

[0031]

[0032] wherein: W (·) ,b (·) represent the weights and biases of each layer.

[0033] Further, the m1 wastewater treatment operation variables include the influent flow, the easily biodegradable organic matter bottom in the biochemical pool l=1, the nitrate nitrogen concentration and the active heterotrophic bacteria biomass in the biochemical pool l=2, the dissolved oxygen concentration in the biochemical pool l=5, and the chemical oxygen demand COD.

[0034] Further, the sewage treatment process normal operation data and sewage treatment process fault operation data include m2 sewage treatment process important parameters and corresponding sewage treatment states: including normal operation, toxicity impact fault and foam fault.

[0035] Further, the sewage treatment process normal operation data and sewage treatment process fault operation data include m2 sewage treatment process important parameters and corresponding sewage treatment states: including normal operation, toxicity impact fault and foam fault.

[0036] Step 2.1: Build a weighted width learning model, define feature nodes and enhanced nodes:

[0037] Z i =φ i (XW ei +β ei ),i=1,2,…,n

[0038] H j =ξ j (Z n W hj +β hj ),j=1,2,…,m

[0039] Where: W ei ,b ei represent the feature node weight and bias, W hi ,b hi represent the enhanced node weight and bias

[0040] Step 2.2: Calculate the relationship between width learning output Y and feature nodes and enhanced nodes:

[0041] Y=[Z1,Z2,…,Z n |H1…H m ]W=[Z n |H m ]W

[0042] Step 2.3: Calculate the optimization objective considering data imbalance and introduce weight matrix T, and derive the weight W:

[0043]

[0044] W=(λI+A T TA) -1 A T TY

[0045] Step 2.4: Use input data X2 and sewage treatment process state label Y2 to train the weighted width learning model, and adjust the feature node and enhanced node parameters in the model through the multi-fold validation method.

[0046] Further, a multi-step prediction state determination strategy is further included to evaluate the future sewage operation state, a prediction step is set as tau, and a prediction sequence in the tau step is constructed:

[0047]

[0048] A plurality of time points in the same interval in the step tau are selected as the prediction sequence, the average value of the last two samples is input into the fault diagnosis model, the operation state confidence of the sewage treatment process in the future tau time is obtained, and the state of the sewage treatment process in the future tau time is judged through the confidence.

[0049] The sewage treatment process prediction and diagnosis method based on artificial intelligence provided by the application combines the prediction model with high prediction accuracy combining the width learning and the long short-term memory network idea and the low-cost weighted width learning fault diagnosis model, can predict the future operation state of the sewage treatment process at a high confidence level, ensures the safe operation of the sewage treatment system, the prediction method can predict the sewage treatment process operation parameters, can accurately and quickly judge the future sewage treatment process operation state, and improves the timeliness and accuracy of the sewage treatment process fault prediction.

[0050] The sewage treatment process fault prediction method based on the sewage treatment process parameter prediction and the fault diagnosis is proposed for the characteristics difficult to identify in the early stage of the sewage treatment system failure. In the sewage treatment process parameter prediction step, the long short-term memory network time series prediction method based on the width learning idea is proposed according to the BLS idea. The sewage treatment process data collected is sliced according to the time sequence, and the slicing is sequentially passed through the flat layer, the feature extraction layer, the long short-term memory network layer and the multi-head attention layer in the model, and the multi-step prediction result of the step is obtained. The sewage treatment process parameter prediction method used in the application can effectively complete the prediction target, and the feature extraction method and the attention mechanism structure used can fully utilize the parameter information and the correlation information of each variable in the historical information, and can more accurately predict. In the sewage treatment process fault diagnosis step, the unbalanced fault diagnosis problem is considered, and the weighted width learning method is used for fault diagnosis of the sewage treatment process data. First, the normal state and the fault history data of the sewage treatment process are collected, then the feature node layer and the enhanced node layer in the weighted width model are constructed, then the optimization target and the weight of the weighted width learning are calculated by the ridge regression method, after the model is constructed, the historical data is input for model training and parameter adjustment, the result of the fault prediction step is input into the trained model, and the sewage treatment process operation state fault prediction confidence is obtained through a softmax layer. The sewage treatment process fault prediction problem is experimentally tested, and the same sewage treatment process prediction operation state as the actual operation result can be obtained by using the fault state and the normal state data, which proves that the sewage treatment process fault prediction method proposed in the application can reliably predict the sewage treatment process fault, and the sewage treatment process fault prediction method proposed in the application can provide protection for the smooth operation of the sewage treatment system. BRIEF DESCRIPTION OF DRAWINGS

[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.

[0052] Figure 1 The flow chart of the sewage treatment process fault prediction method based on the improved LSTM-BLS of the present application;

[0053] Figure 2 The network structure diagram of the long short-term memory network time series prediction method based on the width learning idea of the present application;

[0054] Figure 3A weighted width learning algorithm network structure diagram of the present application;

[0055] Figure 4 A sewage treatment process parameter prediction method prediction result diagram of the present application. DETAILED DESCRIPTION

[0056] It should be noted that the embodiments and features of the embodiments in the present application can be combined with each other without conflict, and the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0057] To make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below in combination with the drawings of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. The description of the at least one exemplary embodiment is actually only illustrative, but not as any limitation on the present application and its application or use. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0058] It should be noted that the terms used herein are only for describing specific embodiments, and are not intended to limit the exemplary embodiments according to the present application. As used herein, the singular form is intended to include the plural form, unless the context clearly indicates otherwise, and it should also be understood that when the terms "comprise" and / or "include" are used in the specification, there is a feature, step, operation, device, component and / or combination thereof.

[0059] Unless specifically stated otherwise, the relative arrangement of the components and steps illustrated in these embodiments, numerical expressions, and numerical values set forth in the specification are not meant to limit the scope of the present application. It should also be understood that the size of the various parts shown in the drawings is not necessarily to scale. Techniques, methods, and devices known to those of ordinary skill in the relevant art can not be discussed in detail, but should be considered as part of the description of the application. In all examples shown and discussed herein, any specific value should be interpreted as merely an example, and not as a limitation. Thus, other examples of the exemplary embodiments can have different values. It should be noted that similar reference numbers and letters in the following drawings represent similar items, and therefore, once an item is defined in one drawing, it need not be further discussed in subsequent drawings.

[0060] In the description of the present application, it should be understood that the orientation words such as "front, back, up, down, left, right", "transverse, vertical, perpendicular, horizontal" and "top, bottom" and the like indicated orientation or positional relationship are generally based on the orientation or positional relationship shown in the drawings, only for the convenience of describing the present application and simplifying the description, without the opposite statement, these orientation words do not indicate and imply that the indicated device or element must have a particular orientation or be constructed and operated in a particular orientation, therefore it cannot be understood as a limitation on the scope of protection of the present application: the orientation words "inner, outer" refer to the inner and outer of the contour of each component itself.

[0061] For the convenience of description, spatial relative terms such as "over", "above", "upper surface", "upper" and the like can be used herein to describe the spatial positional relationship of one device or feature with other devices or features as shown in the drawings. It should be understood that the spatial relative terms are intended to include different orientations in use or operation in addition to the orientation of the device described in the drawings. For example, if the device in the drawing is inverted, the device described as "above" or "over" other devices or structures will be positioned "below" or "under" other devices or structures. Thus, the exemplary term "above" can include both "above" and "below" orientations. The device can also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatial relative descriptions used herein are interpreted accordingly.

[0062] In addition, it should be noted that the use of the words "first", "second" and the like to define parts is only for the convenience of distinguishing the corresponding parts, and the above words have no special meaning unless otherwise stated, therefore it cannot be understood as a limitation on the scope of protection of the present application.

[0063] A sewage treatment process fault prediction method based on an improved LSTM-BLS, comprising the following steps:

[0064] S1: obtaining sewage treatment process variable history sequence, sewage treatment process effluent quality variable history sequence, sewage treatment process normal operation data and sewage treatment process fault operation data;

[0065] S2: inputting the sewage treatment process variable history sequence and the sewage treatment process effluent quality variable history sequence data into the improved LSTM-BLS model to obtain the sewage treatment process variable future sequence and the sewage treatment process effluent quality variable future sequence;

[0066] S3: based on the sewage treatment process normal operation data and the sewage treatment process fault operation data, dividing them into unbalanced fault diagnosis training set and unbalanced fault diagnosis verification set according to the proportion;

[0067] S4: establishing a historical data fault diagnosis model;

[0068] S5: training the historical data fault diagnosis model based on the unbalanced fault diagnosis training set to obtain a trained historical data fault diagnosis model;

[0069] S6: inputting the future sequence of the process variable of the sewage treatment process and the future sequence of the effluent water quality variable of the sewage treatment process into the trained historical data fault diagnosis model to realize prediction of the state of the sewage in the sewage treatment process in a future period of time.

[0070] Steps S1 / S2 / S3 / S4 / S5 / S6 are sequentially executed;

[0071] Further, the construction process of the improved LSTM-BLS model is as follows:

[0072] First, a feature extraction component module is constructed, which is defined as GTN. The input and output relationship of the GTN module is represented as:

[0073] Output=Norm(Input+σ(W3(Dropout(W2(ELU(W1·Input+b1))+b2))+b3)

[0074] ⊙(W4(Dropout(W2(ELU(W1·Input+b1))+b2))+b4))

[0075] =GTN(Input)

[0076] In the above formula, W i ,b i are the weights and biases of the full connection layer in the GTN module, ELU is the linear unit activation function, Dropout is the Dropout operation in deep learning, and Norm is the layer normalization operation.

[0077] Step 1.2: apply the feature extraction component module to construct a feature layer as follows:

[0078]

[0079] In the formula, V t represents the class attention mechanism weight corresponding to the input [x1,…x t ], GTN represents the feature extraction component module, λ1,…λ t represent the features corresponding to the input [x1,…x t ] obtained by the feature extraction module GTN, flatten represents the flattening operation, and softmax represents the normalization layer operation.

[0080] Step 1.3: build an interpretable multi-head attention layer model, define the interpretable multi-head attention as:

[0081]

[0082]

[0083] wherein, is the weight matrix shared by all heads, is the linear mapping matrix of the final fully connected layer, Q, K, V represent the input information, keys and values in the attention mechanism, represents the weight matrix corresponding to the hth head, m H represents the number of selected heads.

[0084] Further: the wastewater treatment process variable history sequence and the wastewater treatment process effluent water quality variable history sequence data are input into the improved LSTM-BLS model to obtain the wastewater treatment process variable future sequence and the wastewater treatment process effluent water quality variable future sequence;

[0085] The wastewater treatment process variable history sequence and the wastewater treatment process effluent water quality variable history sequence data include m1 wastewater treatment operation variables; the data of the m1 wastewater treatment operation variables in the data sample set are sliced according to the time sequence as input data X1;

[0086] After the deep neural network model is built, first, the sliced data is mapped into a vector, which is expanded to an n-dimensional time parameter vector conforming to the model hidden layer dimension d;

[0087] The n-dimensional time parameter vector after expansion calculates the features Z t containing linear information and nonlinear information of time sequence information through a feature extraction component;

[0088] The above features Z t are input into the LSTM module for time sequence prediction, and in order to ensure the accuracy of the prediction, the output of the LSTM module is added to Z t and sent to the multi-head attention layer to obtain the output A t of the attention layer;

[0089] The output A t of the attention layer is input into the gate layer, and a residual layer is set, and then an output is obtained through a fully connected layer

[0090]

[0091] wherein: W (·) ,b (·) represent the weights and biases of each layer.

[0092] The sewage treatment process adopts the activated sludge method. After primary treatment, the raw sewage enters the biochemical tank part, and after biological denitrification, part of it is denitrified again through internal circulation reflux, and the other part enters the secondary sedimentation tank for sedimentation. The biochemical tank part includes biochemical tanks l∈{1,2,3,4,5}, wherein, biochemical tanks l1∈{1,2} are mainly used for the anoxic zone to complete the denitrification process, and biochemical tanks l2∈{3,4,5} are mainly used for the aerobic zone to complete the nitrification process. In step 1, the m1 sewage treatment operation variables include the influent flow, the easy-biodegradable organic matter bottom in the biochemical tank l=1, the nitrate nitrogen concentration and the active heterotrophic bacteria biomass in the biochemical tank l=2, the dissolved oxygen concentration in the biochemical tank l=5, and the chemical oxygen demand [COD].

[0093] Further, the sewage treatment process data sample includes m2 sewage treatment process important parameters and corresponding sewage treatment states. The historical data sample set is divided into input data X2 and sewage treatment process state label Y2, and is input to the weighted width learning fault diagnosis model for training. The weighted width learning fault diagnosis model is the historical data fault diagnosis model;

[0094] Further, the historical data fault diagnosis model is trained based on the unbalanced fault diagnosis training set, and the process of obtaining the trained historical data fault diagnosis model is as follows:

[0095] Step 2.1 builds a weighted width learning model, defines feature nodes and enhanced nodes:

[0096] Z i =φ i (XW ei +β ei ),i=1,2,…,n

[0097] H j =ξ j (Z n W hj +β hj ),j=1,2,…,m

[0098] Where: W ei ,b ei represent the feature node weight and bias, W hi ,b hi represent the enhanced node weight and bias

[0099] Step 2.2: Calculate the relationship between the width learning output Y and the feature nodes and the enhanced nodes:

[0100] Y=[Z1,Z2,…,Z n |H1…Hm ]W = [Z n |H m ]W

[0101] Step 2.3: Calculate the optimization objective considering the data imbalance and introduce the weight matrix T, and derive the weight W:

[0102]

[0103] W = (λI + A T TA) -1 A T TY

[0104] Step 2.4: Train the weighted width learning model using the input data X2 and the wastewater treatment process state label Y2, and adjust the parameters through the multi-fold validation method.

[0105] Evaluate the future wastewater operation state through the multi-step prediction state judgment strategy, set the prediction step length as τ, and construct the prediction sequence G within τ steps:

[0106]

[0107] Directly input the prediction data into the classifier may cause disturbance and error due to the volatility of the prediction. To reduce the volatility during prediction, select multiple time points at the same interval in the step length τ as the prediction sequence, and take the average of the last two samples as the input to the fault diagnosis model. The running state confidence of the wastewater treatment process within the future τ time is obtained, and the wastewater treatment process state at the future τ time is judged through the confidence.

[0108] Example 1:

[0109] The wastewater treatment process adopts the activated sludge method. After primary treatment, the raw wastewater enters the biochemical pool part, and after biological denitrification, part of it is recycled by internal circulation for denitrification again, and the other part enters the secondary sedimentation tank for sedimentation. The biochemical pool part includes biochemical pools l ∈ {1, 2, 3, 4, 5}, wherein, biochemical pool l1 ∈ {1, 2} is the anoxic zone mainly for completing the denitrification process, and biochemical pool l2 ∈ {3, 4, 5} is the aerobic zone mainly for completing the nitrification process. In step 1, the m1 wastewater treatment operation variables include the influent flow rate, the easily biodegradable organic matter bottom in the biochemical pool l = 1, the nitrate nitrogen concentration and the active heterotrophic bacteria biomass in the biochemical pool l = 2, the dissolved oxygen concentration in the biochemical pool l = 5, and the chemical oxygen demand [COD].

[0110] The sample number is selected as 900 for training the improved LSTM-BLS model, and the prediction step length is selected as 60-10, i.e., the next 10 variables are predicted by the first 60 variables, and the slicing processing is performed according to the prediction step length.

[0111]

[0112]

[0113] The step 1 comprises the following steps:

[0114] Step 1.1: constructing a deep learning neural network model as shown in Figure 2 , first constructing a feature extraction component module, defined as GTN, the input and output relationship of the GTN module can be expressed as:

[0115] Output=Norm(Input+σ(W3(Dropout(W2(ELU(W1·Input+b1))+b2))+b3)⊙(W4(Dropout(W2(ELU(W1·Input+b1))+b2))+b4)

[0116] =GTN(Input)

[0117] W i ,b i in the above formula are the weights and biases of the full connection layer in the GTN module, ELU is the linear unit activation function, Dropout is the Dropout operation in deep learning, and Norm is the layer normalization operation.

[0118] Step 1.2: applying the feature extraction component module in step 1.1 to construct a feature layer:

[0119]

[0120] In the formula, V t represents the class attention mechanism weight corresponding to the input [x1,…x t ], GTN represents the feature extraction component module in step 1.1, λ1,…λ t represent the features corresponding to the input [x1,…x t ] obtained by the feature extraction module GTN, flatten represents the flattening operation, and softmax represents the normalization layer operation.

[0121] Step 1.3: constructing an interpretable multi-head attention layer model, defining the interpretable multi-head attention as:

[0122]

[0123]

[0124] In the formula, is the weight matrix shared by all heads, is the linear mapping matrix of the final full connection layer, Q, K, V represent the input information, key and value in the attention mechanism, represents the weight matrix corresponding to the hth head, m H represents the number of selected heads;

[0125] Step 1.4: After the deep neural network model is constructed, firstly, the input sliced data is mapped into a vector, and is expanded into an n-time parameter vector conforming to the model hidden layer dimension d.

[0126] Step 1.5: The n-dimensional time parameter vector after expansion is calculated by a feature extraction component to obtain features Z t containing linear information and nonlinear information of time series information.

[0127] Step 1.6: The above features Z t are input into the LSTM module for time series prediction, and in order to ensure the accuracy of the prediction, the output of the LSTM module is added to Z t and sent into the multi-head attention layer to obtain the output A t of the attention layer.

[0128] Step 1.7: The output A t of the attention layer is input into the gate layer, and a residual layer is set, and then an output Y is obtained through a full connection layer.

[0129]

[0130] Where: W (·) ,b (·) represent the weights and biases of each layer.

[0131] Wherein, the number of layers of LSTM is all set to 4 layers, the batchsize of the training model is selected to be 20, the number of hidden layer nodes is selected to be 256, Q in , S S,1 , X BH,2 , S NO,2 , S O,5 , COD, the learning rate is selected to be 0.001, 0.0001, 0.0001, 0.0005, 0.0002, 0.0002, the cycle number is 1500 times, and the prediction result is as shown in Figure 4 .

[0132] Step 2: Collect samples of normal working conditions and fault working conditions of the sewage treatment process, the sewage treatment process data samples include m2 important parameters of the sewage treatment process and corresponding sewage treatment states; the historical data sample set is divided into input data X2 and sewage treatment process state label Y2, and is input into the weighted width learning fault diagnosis model for training.

[0133] The step 2 comprises the following steps:

[0134] Step 2.1: build the weighted width learning model as shown in Figure 3 Figure 1, define the feature nodes and the enhanced nodes

[0135] Z i = φ i (XW ei + β ei ), i = 1, 2, …, n

[0136] H j = ξ (W hj Z n + β hj ), j = 1, 2, …, m

[0137] wherein W ei , b ei represent the feature node weight and bias, W hi , b hi represent the enhanced node weight and bias.

[0138] Step 2.2: calculate the relationship between the width learning output Y and the feature nodes and the enhanced nodes

[0139] Y = [Z1, Z2, …, Z n |H1…H m ]W = [Z n |H m ]W

[0140] Step 2.3: calculate the optimization objective considering data imbalance by introducing a weight matrix T and derive the weight W:

[0141]

[0142] W = (λI + A T TA) -1 A T TY

[0143] Step 2.4: train the above model using the input data X2 and the sewage treatment process state label Y2, and adjust the parameters through the multi-fold validation method.

[0144] The historical data 2686 in the step 2, wherein the normal data is 1873, the toxic shock fault is 337, and the foam fault is 476. According to the quantity ratio, the majority class weight of T in step 2.33 is 0.16, and the minority class weight is 1. Through the three-fold validation method, the node number N1 = 30, N2 = 20, and N3 = 2000 in the width learning.

[0145] Step 3: The future sewage operation state is evaluated by a multi-step prediction state judgment strategy, and a prediction sequence G in a step length τ is constructed:

[0146]

[0147] The predicted data is directly input into the classifier, which may cause disturbance and error due to the volatility of the prediction. In order to reduce the volatility of the prediction, multiple time points in the same interval in the step length τ are selected as the prediction sequence, and the average value of the last two samples is input into the fault diagnosis model to obtain the operation state confidence of the sewage treatment process in the future τ time. The future τ time sewage treatment process state is judged by the confidence, and the predicted confidence is compared with the actual data confidence as shown in Table 1.

[0148] In step 3, the step length τ = 10, and the time t = 3, 6, 9, 10 is selected for future parameter fault diagnosis. The fault diagnosis results are shown in Table 1, which shows that the operation state corresponding to the four time points is consistent under different operation states, and it can be seen that the present application can predict various abnormal operation states in advance.

[0149] Table 1 is a normal state and fault state prediction confidence table of the sewage treatment process fault prediction method based on the improved LSTM-BLS of the present application as follows:

[0150] Table 1

[0151]

[0152] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for predicting faults in wastewater treatment processes based on an improved LSTM-BLS, characterized in that: Includes the following steps: Acquire historical sequences of variables in the wastewater treatment process, historical sequences of effluent water quality variables in the wastewater treatment process, normal operation data of the wastewater treatment process, and fault operation data of the wastewater treatment process; The historical sequence data of wastewater treatment process variables and wastewater treatment process effluent water quality variables are input into the improved LSTM-BLS model to obtain the future sequence data of wastewater treatment process variables and wastewater treatment process effluent water quality variables. The construction process of the improved LSTM-BLS model is as follows: First, we construct a feature extraction component module, defined as the GTN module. The input-output relationship of the GTN module is represented as follows: Output=Norm(Input+σ(W3(Dropout(W2(ELU(W1·Input+b1))+b2))+b3)⊙(W4(Dropout(W2(ELU(W1·Input+b1))+b2))+b4)) =GTN(Input) W in the above formula i ,b i Here are the weights and biases of the fully connected layers in the GTN module, ELU is the linear unit activation function, Dropout is the Dropout operation in deep learning, and Norm is the layer normalization operation. Step 1.2: Apply the feature extraction component module to construct the feature layer as follows: V in the formula t This indicates that the input [x1,…x] t The corresponding attention mechanism weights, GTN represents the feature extraction component module, λ1,…λ t This represents the input [x1,…x] obtained by the feature extraction module GTN. t The corresponding features are: flatten represents the flattening operation, and softmax represents the normalization layer operation; Step 1.3: Construct an interpretable multi-head attention layer model, defining interpretable multi-head attention as: In the formula, It is a weight matrix shared by all heads. It is the linear mapping matrix of the final fully connected layer, where Q, K, and V represent the input information, keys and values, in the attention mechanism. Let m represent the weight matrix corresponding to the h-th head. H Indicates the number of heads selected; Based on the normal operation data and fault operation data of the wastewater treatment process, the data are divided into an unbalanced fault diagnosis training set and an unbalanced fault diagnosis validation set according to the proportion. Establish a fault diagnosis model based on historical data; The historical data fault diagnosis model is trained based on the unbalanced fault diagnosis training set to obtain the trained historical data fault diagnosis model. The process of training a historical data fault diagnosis model based on an unbalanced fault diagnosis training set to obtain a trained historical data fault diagnosis model is as follows: Step 2.1 Build a weighted width learning model and define feature nodes and augmentation nodes: Z i =φ i (XW ei +β ei ),i=1,2,…,n H j =ξ j (Z n W hj +β hj ),j=1,2,…,m Among them: W ei ,b ei W represents the feature node weights and biases. hi ,b hi Represents the augmentation of node weights and biases Step 2.2: Calculate the relationship between the width learning output Y and the feature nodes and augmentation nodes: Y=[Z1,Z2,…,Z n |H1…H m ]W=[Z n |H m ]IN Step 2.3: Calculate the optimization objective considering the imbalanced data and introduce the weight matrix T, and derive the weights W: W=(λI+A T ARE) -1 A T TY Step 2.4 Use the input data X2 and the wastewater treatment process status label Y2 to train a weighted width learning model, and adjust the feature nodes and enhance the node parameters in the model through multi-fold validation. The future sequences of process variables and effluent water quality variables in the wastewater treatment process are input into a trained historical data fault diagnosis model to predict the state of wastewater during the wastewater treatment process in the future.

2. The wastewater treatment process fault prediction method based on improved LSTM-BLS according to claim 1, characterized in that: The process involves inputting historical sequence data of wastewater treatment process variables and historical sequence data of wastewater treatment process effluent water quality variables into an improved LSTM-BLS model to obtain future sequence data of wastewater treatment process variables and future sequence data of wastewater treatment process effluent water quality variables. The process includes historical sequence data of wastewater treatment process variables and historical sequence data of wastewater treatment effluent quality variables, including m1 wastewater treatment operation variables; the data of the m1 wastewater treatment operation variables in the data sample set are sliced ​​according to the time series as input data X1. After constructing the deep neural network model, the input sliced ​​data is first vectorized and expanded into n time parameter vectors that conform to the hidden layer dimension d of the model. The extended n-dimensional time parameter vector is used by a feature extraction component to calculate feature Z, which contains both linear and nonlinear information related to the time series. t ; The above feature Z t Time series forecasting is performed using an LSTM module. To ensure forecast accuracy, the output of the LSTM module is compared with Z... t The sums are fed into the multi-head attention layer to obtain the output A of the attention layer. t ; The output A of the attention layer t The input is gated, and a residual layer is set up. Then, the output is obtained through a fully connected layer. Among them: W (·) ,b (·) This indicates the weights and biases of each layer.

3. The wastewater treatment process fault prediction method based on improved LSTM-BLS according to claim 2, characterized in that: The m1 wastewater treatment operation variables include influent flow rate, the amount of readily biodegradable organic matter in biological tank l=1, the nitrate nitrogen concentration and active heterotrophic bacteria biomass in biological tank l=2, the dissolved oxygen concentration and chemical oxygen demand (COD) in biological tank l=5.

4. The wastewater treatment process fault prediction method based on improved LSTM-BLS according to claim 1, characterized in that: The normal operation data and fault operation data of the wastewater treatment process include m2 important parameters of the wastewater treatment process and the corresponding wastewater treatment status: including normal operation, toxic shock fault, and foam fault.

5. The wastewater treatment process fault prediction method based on improved LSTM-BLS according to claim 1, characterized in that: It also includes assessing the future operating status of wastewater through a multi-step prediction state determination strategy, where the prediction step size is τ, and a prediction sequence G is constructed within the τ-step range: Multiple time intervals with the same step size τ are selected as the prediction sequence, and the average of the last two samples is used as the input to the fault diagnosis model to obtain the confidence level of the sewage treatment process operation status within the future time τ. The sewage treatment process status at the future time τ is judged by the confidence level.