Wastewater treatment effluent COD prediction methods, equipment, media and products
By constructing a dynamic LSTM neural network and combining with particle swarm optimization algorithm, the problem of low efficiency in real-time prediction of existing sewage treatment models is solved, and efficient and accurate COD prediction of sewage treatment effluent is achieved, reducing sewage treatment cost.
Patent Information
- Application Number
- CN202410439091.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-12
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2044-04-12
AI Technical Summary
Existing sewage treatment neural network models are inefficient in real-time prediction, have long calculation time, and lack innovative methods that can provide efficient and accurate prediction in complex real-life situations.
Build a dynamic LSTM neural network, dynamically adjust the optimization model through gate weights, and combine it with particle swarm optimization algorithm to find optimization to improve the prediction efficiency and accuracy of the model.
Dynamic LSTM neural network can significantly reduce prediction time, improve the prediction efficiency and accuracy of sewage plant effluent indicators, reduce sewage treatment costs, and provide guidance for real-time adjustment of aeration volume or dosing dose.
Smart Images

Figure CN118313414B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method, equipment, medium and product for predicting COD of effluent from sewage treatment. Background Art
[0002] In recent years, with the development and progress of society, the problem of water pollution has become increasingly serious. All countries in the world are more or less facing problems such as water shortage and quality deterioration, which has caused inestimable economic losses.
[0003] At present, sewage treatment constructed in various places mainly uses biological methods, which is essentially to use microorganisms in activated sludge to adsorb, decompose and oxidize biodegradable organic matter in sewage, and separate these organic matter from sewage through complex biochemical reactions to purify sewage. Its sewage treatment process is generally divided into three levels. Among them, primary treatment: physical treatment, mechanical treatment, such as grilles, sedimentation or flotation, to remove stones, sand, fats, grease, etc. contained in sewage. Secondary treatment: biochemical treatment. Pollutants in sewage are degraded and converted into sludge under the action of microorganisms. Tertiary treatment: deep treatment of sewage, including removal of nutrients and disinfection in sewage through chlorination, ultraviolet or ozone technology. The treated water can be sent to the intermediate waterway for flushing toilets, spraying streets, green belts, industrial water, fire fighting and other water sources.
[0004] It can be seen that the sewage treatment process is a rather complex biochemical reaction process, which has the following characteristics:
[0005] 1) The treatment status of sewage is constantly changing;
[0006] 2) There are many microorganisms in the reaction tank, and the reaction patterns between them are difficult to quantify;
[0007] 3) Daily influent flow and influent components are different;
[0008] 4) The anaerobic and aerobic reaction process is complex and easily affected by external factors (such as temperature, pH, etc.);
[0009] These characteristics make it very difficult to establish a sewage treatment process model. The main difficulties are:
[0010] 1) The sewage treatment process changes dramatically over time, and the variables in the model interact and couple with each other, making it difficult to model the mechanism.
[0011] 2) The reaction process is complex, and the living conditions of microbial populations and the reaction laws between them are difficult to represent with specific models.
[0012] 3) The water quality of sewage inlet varies greatly before and after, and the composition and content of pollutants are complex.
[0013] Therefore, in order to establish a sewage treatment model and simulate the nonlinear relationship between influent data and effluent data to a certain extent, neural network is a commonly used method. The early sewage treatment neural network model was mainly based on BP neural network, and later gradually developed a variety of neural network models such as fuzzy neural network radial basis, (Radial Basis Function, RBF), long short-term memory network (Long Short-Term Memory, LSTM), etc. In the process of network model development, many optimization algorithms matching the model have also appeared, such as genetic algorithm, particle swarm algorithm, etc. The prediction accuracy of relevant effluent data has been continuously improved with the deepening of research, but some studies have been too focused on accuracy, resulting in complex algorithms and long model calculation time, which cannot meet the needs of real-time prediction.
[0014] Nowadays, the research on neural network models for sewage treatment has reached a bottleneck, lacking innovative methods that are more real-time, efficient, and accurate in prediction. In addition, many models are too theoretical, lacking comprehensive consideration of complex actual situations in research, and the prediction results obtained by the models often have large deviations in actual applications. Summary of the invention
[0015] In order to solve the above problems existing in the prior art, the present invention provides a method, equipment, medium and product for predicting COD of sewage treatment effluent.
[0016] To achieve the above object, the present invention provides the following solutions:
[0017] A method for predicting COD of sewage treatment effluent, the method comprising:
[0018] Constructing a dynamic LSTM neural network; the dynamic LSTM neural network is a neural network obtained by dynamically adjusting the gate weights of the LSTM neural network;
[0019] The constructed dynamic LSTM neural network is used as the water output index prediction model;
[0020] The data of the sewage treatment plant to be predicted are obtained, and the data of the sewage treatment plant to be predicted are input into the effluent index prediction model to obtain the effluent index prediction result.
[0021] Optionally, construct a dynamic LSTM neural network, specifically including:
[0022] Obtaining an LSTM neural network; the LSTM neural network includes an input gate, an output gate, and a forget gate;
[0023] Build a training dataset;
[0024] Assign a dynamic weight to the input gate and forget gate of the initialized dynamic LSTM neural network, and initialize the hyperparameters f, m, and L of the dynamic LSTM neural network;
[0025] The particle swarm optimization algorithm is used to optimize the hyperparameters f, m, and L in the initialized LSTM neural network to obtain the optimal hyperparameters; the optimal hyperparameters are given to the initialized dynamic LSTM neural network to obtain an untrained dynamic LSTM neural network;
[0026] Using the training data set to train the untrained dynamic LSTM neural network to obtain a trained dynamic LSTM neural network, that is, to obtain the dynamic LSTM neural network;
[0027] Optionally, construct a training data set, specifically including:
[0028] Acquire sewage treatment plant data; the sewage treatment plant data includes influent data and effluent data;
[0029] Preprocessing the sewage plant data;
[0030] Perform correlation analysis based on the preprocessed data to obtain correlation analysis results;
[0031] Determine the water inlet index related to the water outlet index based on the correlation analysis result;
[0032] The water inlet index and the water outlet index are both standardized;
[0033] The standardized inlet index is used as input, and the standardized outlet index is used as output to form a training sample pair to form a training data set.
[0034] Optionally, the sewage plant data is preprocessed, specifically including:
[0035] The linear interpolation method is used to fill in the sewage plant data.
[0036] Optionally, the formula used for correlation analysis is:
[0037]
[0038] Wherein, r[l] represents the result of correlation analysis, x[k, l] is the lth influent related data of the input data at the kth moment, (l=1, 2, ..., 9), the influent related data before and after are indicators (COD, AN, SS, TN, TP, SV, BOD) and aeration volume, dosage, y[k] is the COD content of the effluent from the biochemical pool at the kth moment, and n is the number of variables, (k=1, 2, ..., n).
[0039] Optionally, a particle swarm optimization algorithm is used to optimize the dynamic weights assigned to the trained LSTM neural network to obtain the optimal dynamic weights, specifically including:
[0040] Initialize the dynamic weights assigned to the trained LSTM neural network;
[0041] The initialized dynamic weights are used as the input variables of the particle swarm algorithm, the dynamic neural network model is used as the fitness function of the particle swarm optimization algorithm, the number of particles and the number of iterations are set, and the optimal dynamic weights are obtained.
[0042] A computer device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any one of the above-mentioned methods for predicting COD of sewage treatment effluent.
[0043] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned methods for predicting COD of sewage treatment effluent.
[0044] A computer program product comprises a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned methods for predicting COD of sewage treatment effluent.
[0045] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0046] The present invention uses the constructed dynamic LSTM neural network as a water discharge index prediction model to obtain the water discharge index prediction result based on the acquired sewage plant data to be predicted, which can improve the prediction efficiency and accuracy of the sewage plant water discharge index. In addition, the present invention dynamically changes the gate weight operation of the LSTM neural network to obtain a dynamic LSTM neural network, which can greatly shorten the prediction time and reduce the sewage treatment cost, and further provide guidance for increasing or decreasing the aeration volume or dosage. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 A flow chart of a method for predicting COD of sewage treatment effluent provided in Example 1 of the present invention;
[0049] Figure 2A schematic diagram of the LSTM neural network structure provided in Example 1 of the present invention;
[0050] Figure 3 A schematic diagram of prediction curve tracking of a dynamic LSTM neural network provided in Example 1 of the present invention;
[0051] Figure 4 A complete flow chart of constructing a dynamic LSTM neural network provided in Example 1 of the present invention;
[0052] Figure 5 A comparison chart of LSTM model prediction results provided in Example 1 of the present invention;
[0053] Figure 6 A comparison chart of the prediction results of the dynamic LSTM model provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 creative work are within the scope of protection of the present invention.
[0055] The purpose of the present invention is to provide a method, device, medium and product for predicting COD of sewage treatment effluent, aiming to improve the efficiency and accuracy of determining effluent indicators of sewage treatment plants.
[0056] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0057] Example 1
[0058] like Figure 1 As shown, this embodiment provides a method for predicting COD of sewage treatment effluent, such as Figure 1 As shown, the method includes:
[0059] Step 100: Build a dynamic LSTM neural network.
[0060] In the actual application process, the construction process of the dynamic LSTM neural network is as follows: First, preprocess the data collected from a sewage treatment plant. Secondly, after correlation analysis, an LSTM neural network model with inlet and outlet water indicators and historical aeration dosage as input and current aeration volume as output is established, and the gate weight dynamic adjustment algorithm is used to optimize the weights of the LSTM neural network model. Finally, in order to verify the effectiveness of this method, Figure 5 and Figure 6As shown, compared with the prediction results based only on the LSTM model, the error sum of the dynamic LSTM neural network established in this embodiment is reduced by 16.15%. Therefore, the established dynamic LSTM neural network is effective and feasible for the prediction of COD of the effluent of the biochemical pool.
[0061] Based on this, the construction process of the dynamic LSTM neural network is refined into the following process:
[0062] 1. Data selection and processing.
[0063] The strength of machine learning generalization ability is not only affected by the learning ability of the model algorithm itself, but also has an inseparable relationship with the quality of the data set used by the model. If the model itself has strong learning ability, but the data set used has only a small amount of data or data of poor quality, then the prediction results of the model must be unsatisfactory. The real on-site data collected by the sewage treatment plant are selected to construct a preliminary data set for predicting the COD of the effluent of the sewage treatment biochemical pool. Then a series of processing tasks such as gross error data quality analysis, missing data filling, and data standardization are performed on the data set.
[0064] 1.1 Data preprocessing.
[0065] In view of the problems existing in the data used in this embodiment, the present invention uses linear interpolation to fill it, and the specific process is shown in formula (1). For abnormal values, including negative numbers and gross errors, the average value is used for filling, and no data removal is performed.
[0066]
[0067] Among them, x[k, l] is the value to be filled, x[f, l] is the value of the position before filling, and x[b, l] is the value of the position after filling.
[0068] 1.2 Correlation analysis.
[0069] Data collection is once every hour. After the above step 1.1, the data is filled in 500 groups. Each group of data includes inlet and outlet water indicators (COD, AN, SS, TN, TP, SV, BOD), aeration volume and dosage. The hydraulic retention time in the biochemical pool is about 7 hours. The time of the inlet water indicator is selected as k-7, the time of the outlet water indicator is k, and the correlation analysis is performed with the aeration volume at the k time. For example, the formula for Pearson correlation analysis is:
[0070]
[0071] Wherein, r[l] represents the result of correlation analysis, x[k, l] is the lth influent related data of the input data at the kth moment, (l=1, 2, ..., 9), the influent related data before and after are indicators (COD, AN, SS, TN, TP, SV, BOD) and aeration volume, dosage, y[k] is the COD content of the effluent from the biochemical pool at the kth moment, and n is the number of variables, (k=1, 2, ..., n).
[0072] Through correlation analysis, the input variables are selected as the influent index (COD, AN, TN, TP, SS) at time k-7, the aeration volume and the dosage at time k-7, and the output is the effluent COD index at time k.
[0073] 1.3 Data standardization.
[0074] Since there are dimensional differences among the indicators, in order to facilitate the subsequent model training, the indicators need to be standardized. The standardization formula is:
[0075]
[0076] In the formula, x[k, l]′ is the sample value after standardization, x minl , x maxl are the minimum and maximum values of the lth inlet water related data, (k=1, 2, ..., n), (l=1, 2, ..., 7), respectively.
[0077] 1.4 Dataset division.
[0078] After data processing and correlation analysis, the data size is 500×7 for input and 500×1 for output. Use Python to divide the data set into 4:1. Set test_size to the test set ratio, which should not exceed 1. The default value is 0.25. Set random_state to the random seed, which ranges from 0 to 42. Setting the random seed can make the data set divided each time consistent, and the experiment can be repeated.
[0079] Finally, the training set input size is 400×7, the output size is 400×1, the test set input size is 100×7, and the output size is 100×1.
[0080] 2. LSTM neural network.
[0081] The long short-term memory (LSTM) neural network is an improvement on the recurrent neural network (RNN). Compared with RNN, LSTM can not only solve the gradient explosion and gradient vanishing problems, but also better discover the dependencies of sequences. Therefore, it is widely used to process time series problems, such as speech recognition. Each LSTM module consists of three gates: input, output, and forget, and a cell unit (memory cell). It can effectively process time series information. Its structure is as follows: Figure 2 shown.
[0082] Based on this, the specific working principle of LSTM is as follows:
[0083] (1) Filter out some of the information transmitted from the previous moment to the current moment. This step is completed by the forget gate, which reads h k-1 and x k , output a value between 0 and 1. 1 means retaining the complete information, and 0 means discarding all information. See formula (4):
[0084] f k =σ(w f [h k-1 , x k ]+b f ) (4)
[0085] In the formula, h k-1 Represents the output of the previous cell, x k Represents the input of the current cell. f and b f They are the weight matrix and bias vector in the forget gate, σ represents the activation function Sigmoid, f k Represents the output of the forget gate. The formula of the Sigmoid function is:
[0086]
[0087] (2) Determine the amount of new information to be updated to the current cell. To implement this operation, the following steps are required: First, the input gate containing the Sigmoid function determines the information that needs to be updated. Then a tanh layer generates a new value
[0088] i k =σ(w i [h k-1 , x k ]+b i ) (6)
[0089]
[0090] In the formula, i k represents the output of the input gate, w i and b i are the weight matrix and bias vector in the input gate, w c and b c They are the weight matrix and bias vector in the tanh layer respectively.
[0091] Next, combine these two parts to update the value of the cell state at the current moment to obtain the updated value c of the cell state k .
[0092]
[0093] (3) The output value needs to be determined. The final output result depends on the cell state. First, the output gate containing the Sigmoid function determines the information to be output. Then, the cell state is processed by the tanh function to obtain the output h at the current moment. k .
[0094] o k =σ(w o [h k-1 , x k ]+b o ) (9)
[0095] h k =o k *tanh(c k ) (10)
[0096] Among them, w o and b o are the weight matrix and bias vector of the output gate, respectively, o k Represents the output value of the output gate.
[0097] In the process of training and testing the LSTM neural network using the training set and test set, since the sewage data has time series characteristics and there is a correlation between the current data and the previous data, a time series prediction model was established based on the LSTM neural network. This model can well solve the dependency problem between sewage data and has a good effect in predicting water quality indicators.
[0098] 3. Dynamic LSTM neural network.
[0099] Design idea: In the experiment, it was found that each neural network model had difficulty in tracking the curve after the output mutation. Therefore, this embodiment hopes to assign a dynamic weight to the input gate and forget gate of LSTM so that the network model can better fit the predicted output curve to the actual output curve. Figure 3 As shown, the prediction curve of the designed dynamic LSTM neural network can be changed from line 3 to line 2, where line 1 is the actual output curve of the test set.
[0100] The following is a detailed formula for building a dynamic LSTM neural network:
[0101]
[0102]
[0103]
[0104] W1=m+L×p (14)
[0105] W2=2-W1 (15)
[0106]
[0107] Among them, c[l] in formula (11) represents the weight matrix of the difference between the input at time k-1 and the input at time k to the input at time k-1. Formula (16) is an improved version of formula (8) in the original LSTM neural network model. Here, f, m, and L are discriminative constants, W1 represents the input gate weight value, and W2 represents the forget gate weight value. x[k, l] represents the input data on the lth dimension at the kth moment. Because the dimension of the input data is 7, l = (1, 2, ... 7). c[l] represents a 7-dimensional input change rate parameter. q[l] represents a 7-dimensional activation parameter, and p represents a 1-dimensional input change weight parameter.
[0108] Particle swarm algorithm, its full name is particle swarm optimization algorithm. It is a search algorithm based on group collaboration developed by simulating the foraging behavior of bird flocks. The basic idea of particle swarm algorithm is to find the optimal solution through collaboration and information sharing between individuals in the group. In the specific implementation process, the algorithm is used to optimize the dynamic weights f, m, and L. For example, f, m, and L are used as the 3D input variables of the particle swarm algorithm (the positions of particles in three dimensions), and the initial values are set to 0.1, 1, and 0.1 respectively. The improved version of the initial dynamic neural network model (hyperparameters: f, m, and L initial values are set to 0.1, 1, and 0.1 respectively, the number of hidden layer neurons is set to 14, and the number of hidden layers is 1) is used as the fitness function of the particle swarm algorithm, the number of particles is set to 20, and the number of iterations is set to 50.
[0109] Existing work believes that f is 0.03, m is 0.9, and L is 0.03, which is more appropriate, and the better values should also be around them.
[0110] After obtaining better dynamic LSTM neural network hyperparameters f, m, and L through the particle swarm algorithm, an untrained dynamic LSTM neural network model is obtained (see Figure 4 ). Then the input data of the training set is given to the untrained model, and the gradient descent method is used as the learning algorithm of the model. The number of learning iterations is set to 300 times, and the learning rate is set to 0.03. The untrained dynamic LSTM neural network model is trained using the learning algorithm to obtain a trained dynamic LSTM neural network model. In this process, the model parameters (weights from the input layer to the hidden layer, and weights from the hidden layer to the output layer) are optimized (see Figure 4 ).
[0111] Step 101: Use the constructed dynamic LSTM neural network as a water discharge index prediction model. Based on the above description, the dynamic LSTM neural network is applied to the prediction of the COD concentration content of the effluent of the sewage treatment plant, and the aeration volume or the dosage can be increased or decreased to achieve the purpose of cost saving.
[0112] Step 102: Obtain the data of the sewage treatment plant to be predicted, and input the data of the sewage treatment plant to be predicted into the effluent index prediction model to obtain the effluent index prediction result.
[0113] Based on the above description, compared with the prior art, that is, the existing LSTM neural network algorithm, the dynamic neural network algorithm provided by the present invention has more advantages in prediction accuracy. It can also reduce the huge prediction deviation caused by unexpected situations in the actual operation of the sewage treatment plant.
[0114] Example 2
[0115] A computer device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method for predicting COD of sewage treatment effluent in Example 1.
[0116] Example 3
[0117] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for predicting COD of sewage treatment effluent in Example 1.
[0118] Example 4
[0119] A computer program product includes a computer program, which implements the steps of the sewage treatment effluent COD prediction method in Example 1 when executed by a processor.
[0120] Example 5
[0121] A computer device, which may be a database. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store pending transactions. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the COD prediction method for sewage treatment effluent in Example 1 is implemented.
[0122] It should be noted that the object information (including but not limited to object device information, object personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the present invention are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0123] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided by the present invention can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided by the present invention may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processor involved in each embodiment provided by the present invention may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited thereto.
[0124] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0125] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core ideas of the present invention. The same and similar parts between the embodiments can be referred to each other. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for predicting COD of sewage treatment effluent, characterized in that: The method comprises: Construct a dynamic LSTM neural network; the dynamic LSTM neural network is a neural network obtained by dynamically adjusting the gate weights of the LSTM neural network; The constructed dynamic LSTM neural network is used as the water output index prediction model; Obtaining data of the sewage treatment plant to be predicted, and inputting the data of the sewage treatment plant to be predicted into the effluent index prediction model to obtain the effluent index prediction result; Construct a dynamic LSTM neural network, including: Obtaining an LSTM neural network; the LSTM neural network includes an input gate, an output gate, and a forget gate; Build a training dataset; Assign a dynamic weight to the input gate and forget gate of the initialized dynamic LSTM neural network, and initialize the hyperparameters f, m, and L of the dynamic LSTM neural network; The particle swarm optimization algorithm is used to optimize the hyperparameters f, m, and L in the initialized LSTM neural network to obtain the optimal hyperparameters; the optimal hyperparameters are given to the initialized dynamic LSTM neural network to obtain an untrained dynamic LSTM neural network; Using the training data set to train the untrained dynamic LSTM neural network to obtain a trained dynamic LSTM neural network, that is, to obtain the dynamic LSTM neural network; W1=m+L×p; In the formula, q[l] represents a 7-dimensional activation parameter, p represents a 1-dimensional input change weight parameter, c[l] is expressed as the weight matrix of the difference between the input at time k-1 and the input at time k to the input at time k-1, W1 represents the input gate weight value, and l represents the dimension.
2. The method for predicting COD of sewage treatment effluent according to claim 1, characterized in that: Construct a training data set, including: Acquire sewage treatment plant data; the sewage treatment plant data includes influent data and effluent data; Preprocessing the sewage plant data; Perform correlation analysis based on the preprocessed data to obtain correlation analysis results; Determine the water inlet index related to the water outlet index based on the correlation analysis result; The water inlet index and the water outlet index are both standardized; The standardized inlet index is used as input, and the standardized outlet index is used as output to form a training sample pair to form a training data set.
3. The method for predicting COD of sewage treatment effluent according to claim 2, characterized in that: Preprocessing the sewage plant data specifically includes: The linear interpolation method is used to fill in the sewage plant data.
4. The method for predicting COD of sewage treatment effluent according to claim 2, characterized in that: The formula used for correlation analysis is: Where r[l] represents the result of correlation analysis, x[k,l] is the lth influent related data of the input data at the kth moment, l=1,2,...,9, the influent related data before and after are indicators COD, AN, SS, TN, TP, SV, BOD and aeration volume, dosage, y[k] is the COD content of the biochemical pool effluent at the kth moment, n is the number of variables, k=1,2,...,n.
5. The method for predicting COD of sewage treatment effluent according to claim 1, characterized in that: The particle swarm optimization algorithm is used to optimize the hyperparameters f, m, and L in the initialized dynamic LSTM neural network to obtain the optimal hyperparameters, including: Initialize the hyperparameters f, m, L of the dynamic LSTM neural network; The initialized hyperparameters f, m, and L are used as input variables of the particle swarm algorithm, and the dynamic LSTM neural network model is used as the fitness function of the particle swarm optimization algorithm. The number of particles and the number of iterations are set to search for the optimal hyperparameters.
6. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method for predicting COD of sewage treatment effluent according to any one of claims 1 to 5.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for predicting COD of sewage treatment effluent described in any one of claims 1 to 5 are implemented.
8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method for predicting COD of sewage treatment effluent described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Water quality prediction method for optimizing LSTM neural network based on improved genetic algorithm
CN111915097A
WSFA-AFE-based effluent BOD concentration prediction method of ILSTM neural network
CN116306803A