Sewage effluent ammonia nitrogen prediction method based on local reinforcement optimization echo state network
By constructing a locally enhanced and optimized echo state network, the method for predicting ammonia nitrogen in wastewater effluent is optimized, which solves the problems of complexity and prediction accuracy in ammonia nitrogen detection by traditional methods, and realizes high-precision and low-latency online monitoring of ammonia nitrogen.
Patent Information
- Application Number
- CN202511350379.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-22
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-09-22
AI Technical Summary
Existing ammonia nitrogen detection methods in wastewater treatment plants are complex to operate, and the real-time and automated control requirements are difficult to meet. Traditional mechanistic modeling methods are unable to accurately characterize the nonlinear and time-varying changes in ammonia nitrogen concentration, resulting in low prediction accuracy.
A method based on locally enhanced optimized echo state network is adopted. By acquiring process parameter data and effluent ammonia nitrogen data, a locally enhanced optimized echo state network is constructed. The neuron structure is optimized by information entropy ranking, fitness function design and enhancement mechanism to achieve high-precision ammonia nitrogen prediction.
It achieves high-precision, low-latency prediction of ammonia nitrogen in wastewater effluent, improves the model's structural interpretability and generalization ability, and meets the real-time and accuracy requirements of wastewater treatment processes.
Smart Images

Figure CN121256244B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of effluent ammonia nitrogen prediction, and in particular to a sewage effluent ammonia nitrogen prediction method based on a locally reinforced optimization echo state network. BACKGROUND
[0002] With the rapid development of industrialization and urbanization, the amount of urban sewage discharge is increasing, and water pollution problems are becoming increasingly serious, causing serious impact on the environment and ecological system. Sewage treatment, as an effective measure to address this problem, can effectively reduce harmful substances remaining in sewage through physical, biological and chemical methods. In order to protect the ecological safety of urban water bodies, the operation efficiency and effluent quality of sewage treatment plants have become an important consideration for environmental governance. This trend has prompted all parties to pay more attention to improving facility efficiency and management levels to meet the increasing demand for environmental protection, so the present application has a wide application prospect.
[0003] Among them, the effluent ammonia nitrogen As one of the most critical water quality indicators in the sewage treatment process, it represents the inorganic nitrogen content in the form of ammonium ions in sewage, and is an important reference factor for measuring the degree of organic pollution and biochemical oxygen demand in sewage. If the ammonia nitrogen concentration in the sewage is too high, it will not only inhibit the survival of aquatic organisms in the water body, but also easily cause water eutrophication, and then cause secondary pollution problems such as blue-green algae outbreak. Therefore, it is of great significance to realize accurate prediction and online monitoring of the effluent ammonia nitrogen concentration in sewage for ensuring the effectiveness of sewage treatment, improving the efficiency of regulation and control, and achieving green environmental protection.
[0004] Currently, the detection of ammonia nitrogen in sewage treatment plants mostly relies on experimental chemical analysis methods, such as the Nessler's reagent spectrophotometric method or the ion selective electrode method. Although these methods have high accuracy, their operation procedures are complex and the reaction time is long, making it difficult to meet the real-time and automatic control requirements in the sewage treatment process. At the same time, the sewage treatment process has high nonlinearity, time-varying and uncertainty, and is affected by various process conditions (such as DO, temperature, pH, ORP, etc.), and the ammonia nitrogen concentration changes frequently. Traditional mechanism modeling methods are difficult to accurately depict the dynamic change process, and the modeling is complex and has poor generalization ability. SUMMARY
[0005] In view of the above existing problems, the present application is proposed.
[0006] Therefore, the present application provides a sewage effluent ammonia nitrogen prediction method based on a locally reinforced optimization echo state network, which solves the core problem of insufficient dynamic coupling of cloud water conversion process and terrain dynamic forcing in the prior art.
[0007] To solve the above technical problems, the present application provides the following technical solutions:
[0008] In a first aspect, the present invention provides a method for predicting ammonia nitrogen in wastewater effluent based on a locally enhanced optimized echo state network, comprising,
[0009] The process parameter data and effluent ammonia nitrogen data of the wastewater treatment process are obtained. After preprocessing the process parameter data and effluent ammonia nitrogen data, a set of predictive variables and a set of candidate auxiliary variables are obtained.
[0010] Calculate the mutual information value of each effluent ammonia nitrogen and candidate auxiliary variable in the predictor variable set and the candidate auxiliary variable set, and select the top m variables with the highest mutual information values to form the initial auxiliary variable set;
[0011] Calculate the covariance matrix of the variables in the initial set of auxiliary variables, and extract the principal components with eigenvalues greater than 1 through eigenvalue decomposition to obtain a core set of auxiliary variables containing 4-10 variables;
[0012] A local reinforcement optimization echo state network is constructed based on the core auxiliary variable set;
[0013] The core auxiliary variables in the test sample are input into the local enhanced optimized echo state network, and the predicted value of effluent ammonia nitrogen is output. The prediction accuracy is evaluated by mean square error, and the prediction of effluent ammonia nitrogen is completed.
[0014] Furthermore, the process parameter data includes temperature, effluent pH, DO at the aerobic stage, effluent ORP, and effluent NO3N data. The preprocessing includes sequentially performing noise reduction, outlier removal, and missing value filling operations, and using Min-Max normalization to unify the scale of all data. The processed data is divided into N1 group training samples and N2 group test samples, and the predicted variable is determined to be effluent ammonia nitrogen, with the process parameters as the candidate auxiliary variable set.
[0015] Furthermore, a standard echo state network is created, the input weight matrix and reservoir weight matrix are randomly initialized, and the number of reservoir neurons is set to a constant n; the reservoir weight matrix is adjusted to a real symmetric matrix, and the reservoir weight matrix is scaled by the spectral radius.
[0016] The datasets of process parameter data and effluent ammonia nitrogen data were divided into training set and test set; the ESN reservoir was trained using the training set data, and the output layer weight matrix was fitted by the least squares method; the prediction mean square error was calculated to evaluate the performance of the initial model.
[0017] For each reservoir neuron's activation value sequence, its information entropy is calculated using the discrete information entropy formula to quantify the neuron's contribution to network prediction and identify silent neurons.
[0018] Construct an initial optimized population. Each individual in the population is encoded as a real vector of length n in the range [0, 1], which is mapped to a binary mask through a threshold of 0.5. A vector value ≥ 0.5 indicates retaining the corresponding neuron, and < 0.5 indicates pruning; the initial population contains three types of individuals: ① fully retained individuals, with vector values all being 1, retaining all reservoir neurons; ② entropy-sorted pruning individuals, pruning 5% of the neurons with the lowest information entropy, and setting the corresponding vector values to 0; ③ randomly sampled individuals, with vector values randomly generated and following a uniform distribution in [0, 1].
[0019] Construct a composite fitness function and add a boundary penalty term at the same time. The penalty term rule is: if the neuron retention ratio p > p_max (p_max = 0.95), add γ(p - p_max); if p < p_min (p_min = 0.5), add γ(p_min - p); γ = 100 is the penalty intensity coefficient.
[0020] Sort the individuals in the population according to the fitness value, divide them into the top 50% of the fitness as the mutation population and the bottom 50% as the evolutionary population, and implement a differential update strategy: after each round of update, recalculate the fitness of the updated individuals and retain the individuals with better fitness; set the number of iteration rounds to 20 to complete the population optimization.
[0021] Select the globally optimal individual after 20 rounds of iteration, perform neuron pruning based on the corresponding binary mask; update the input weight matrix and reservoir weight matrix after pruning, only retain the corresponding sub-matrices, and retrain the network.
[0022] Furthermore, set the spectral radius ρ to 0.66, and adjust the maximum absolute value of the eigenvalues of W to make the reservoir matrix satisfy the echo state property.
[0023] Furthermore, the echo state network at At the moment, the input state of the input nodes, the state of the internal neurons in the reservoir, and the output state equations of the output nodes are shown in formulas (5) - (7), and the update equations of the reservoir state and output state are shown in formulas (8) - (9).
[0024] (5)
[0025] (6)
[0026] (7)
[0027] (8)
[0028] (9)
[0029] Among them, is of dimension Input the weight matrix, This indicates the number of input data. The activation state of reservoir neurons at that location. For time Input status at the location, It is the activation function of reservoir neurons, with parameters It's the leakage rate. It is a dimension of The reservoir weight matrix, For size The output matrix is obtained using ridge regression. As shown in formula (10).
[0030] (10)
[0031] in, It is the set of desired target output vectors, with a size of , It is the regularization coefficient, and It is the identity matrix, a matrix. Size is Used to learn output layer parameters. This represents the number of training samples.
[0032] Furthermore, a boundary penalty term is added to the fitness function to dynamically adjust the fitness function, as shown in the following formula:
[0033] (14)
[0034] in, , is the proportion of neurons retained; , which is the set range of allowable pruning ratios; It is the penalty intensity coefficient, used to amplify the penalty for deviations in the pruning ratio.
[0035] Then, the population is sorted according to fitness, and iterative updates are performed to find the optimal pruning scheme.
[0036] Furthermore, each iteration also includes a mutation mechanism, adding Gaussian noise perturbation to random individuals in the population. The perturbation formula is:
[0037] (17)
[0038] in, =0.1 is the variation intensity coefficient, ε~N(0,I) is a standard normal distribution random vector. After perturbation, the fitness is recalculated. If it is better than the original individual, it is replaced to enhance the diversity of the population and avoid getting trapped in local optima.
[0039] Furthermore, the echo state network selects the globally optimal individual to perform physical pruning on the network, retaining... The neurons and their corresponding connections are updated, and the formula is as follows:
[0040] (18)
[0041] (19)
[0042] (20)
[0043] in, It is the pruned input weight matrix, retaining only the rows corresponding to the selected neurons; It is the weight matrix inside the reservoir after pruning, retaining only the submatrix corresponding to the selected neuron, thus completing the pruning of reservoir neurons.
[0044] In a second aspect, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, it implements any step of the wastewater effluent ammonia nitrogen prediction method based on a locally enhanced optimized echo state network as described in the first aspect of the present invention.
[0045] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the wastewater effluent ammonia nitrogen prediction method based on a locally enhanced optimized echo state network as described in the first aspect of the present invention.
[0046] The beneficial effects of this invention are:
[0047] This invention addresses the nonlinear dynamic changes in ammonia nitrogen concentration by constructing an adaptively pruned redundant neuron model to optimize wastewater quality prediction, achieving high-precision, low-latency prediction of ammonia nitrogen in urban wastewater effluent. By introducing information entropy ranking, fitness function design, reinforcement mechanisms, and perturbation mechanisms, it effectively solves the problems of redundant structure, heavy computational burden, and low modeling efficiency inherent in traditional ESNs, exhibiting good structural interpretability, model compression capability, and generalizability. Attached Figure Description
[0048] Figure 1 This is a diagram of the echo state network structure of the present invention;
[0049] Figure 2 This is a schematic diagram of the echo state network optimization process based on the local reinforcement optimization algorithm of the present invention;
[0050] Figure 3 This is a graph showing the changes in fitness and pruning ratio during the algorithm iteration process of this invention;
[0051] Figure 4 This is a graph showing the prediction results of ammonia nitrogen in the effluent of urban sewage treatment processes according to the present invention; Detailed Implementation
[0052] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0053] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0054] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0055] Reference Figures 1-4 This is one embodiment of the present invention, which provides a method for predicting ammonia nitrogen in wastewater effluent based on a locally enhanced optimized echo state network, comprising the following steps:
[0056] The experimental data were selected from the wastewater treatment test data of a wastewater treatment plant from August 26, 2014 to September 16, 2014. After data preprocessing and variable determination, a total of 6 variables remained.
[0057]
[0058] 1. Data Preprocessing
[0059] The collected data underwent noise reduction, outlier removal, missing value imputation, and normalization to obtain 2000 data samples under 22 variables, including 21 auxiliary variables and the predictive variable total phosphorus in the effluent. These 2000 data samples need to be divided into two parts: 1500 data samples for training and the remaining 500 data samples for testing.
[0060] 2. Determination of predictor and auxiliary variables
[0061] Initialize the candidate auxiliary variable set and predictor variable: effluent ammonia nitrogen The observation vector corresponding to the auxiliary variable is in The auxiliary variable is arranged in sequence and the observation vector corresponding to the predictor variable is: .
[0062] 2.1) Set of candidate auxiliary variables variables in and predictor variables conduct Normalization is performed to unify the scale of all variables to the same range in order to eliminate the influence of dimensions.
[0063] (1)
[0064] (2)
[0065] in, Indicates the first The mean of the auxiliary variables; This represents the mean of the predictor variable.
[0066] 2.2) Calculate the auxiliary variables respectively and predictor variables The mutual information value between them is used to represent their correlation.
[0067] (3)
[0068] in, yes and The joint probability density function; , They are and The marginal probability density function. Based on the mutual information value, select the first... The auxiliary variables with the highest scores constitute the initial set of auxiliary variables. .
[0069] 2.3) If the mutual information value between two auxiliary variables is very high, it may lead to multicollinearity. Therefore, principal component analysis is used to extract the main features from the high-dimensional data to reduce the data dimensionality. The covariance matrix of the initially selected auxiliary variables is calculated to determine the linear relationship between each pair of auxiliary variables.
[0070] (4)
[0071] in and These are the initial auxiliary variables. Two different variables in and These are the means of the variables. After calculating the covariance matrix, eigenvalue decomposition is performed to obtain eigenvalues and eigenvectors. Eigenvalues represent the magnitude of the variance of each principal component, and eigenvectors represent the direction of each principal component. Principal components are selected based on the magnitude of the eigenvalues, generally those with eigenvalues greater than 1. Principal component analysis yields a set of six auxiliary variables. .
[0072] 3. Echo State Network Design for Local Reinforcement Optimization Algorithm
[0073] Echo-state networks (ESNs) are a variant of RNNs, which are composed of... The input layer of each node, The reservoir of each node and The output layer consists of 1 node, Figure 1 As shown, the reservoir is composed of randomly connected neurons. At time t, the input state of the input node, the state of the neurons inside the reservoir, and the output state equation of the output node are shown in equations (5) ~ (7), and the update equations of the reservoir state and the output state are shown in equations (8) ~ (9).
[0074] (5)
[0075] (6)
[0076] (7)
[0077] (8)
[0078] (9)
[0079] in, It is a dimension of Input the weight matrix, This indicates the number of input data. The activation state of reservoir neurons at that location. For time Input status at the location, It is the activation function of reservoir neurons, with parameters It's the leakage rate. It is a dimension of The reservoir weight matrix, For size The output matrix is obtained using ridge regression. As shown in formula (10).
[0080] (10)
[0081] in, It is the set of desired target output vectors, with a size of , It is the regularization coefficient, and It is the identity matrix, a matrix. Size is Used to learn output layer parameters. This represents the number of training samples.
[0082] While echo-state networks outperform basic recurrent neural networks, the random generation of the reservoir leads to unclear dynamic characteristics, making it difficult to achieve an optimal structure tailored to the specific task. Furthermore, the number of neurons required in the reservoir typically far exceeds the number of input and output nodes, and as task complexity increases, a larger reservoir size is often needed to capture richer dynamic information. An excessively large reservoir structure results in redundant neurons and connection weights, increasing network training costs. Conversely, an excessively small reservoir structure struggles to achieve good prediction results for complex real-world problems. Therefore, optimization algorithms can be used to reasonably modify the reservoir structure, enabling adaptive adjustment of the reservoir.
[0083] The local reinforcement optimization algorithm, based on the partial reinforcement effect theory, treats each neuron in the pooling layer as a learner whose behavior is to retain or prune. By defining an importance metric and fitness function for neurons, learners are evaluated, and the network structure is iteratively updated through a reinforcement learning mechanism to achieve simplification and optimization. This process balances global search and local adjustment capabilities, avoiding getting trapped in local optima.
[0084] First, by calculating the information entropy of the reservoir neurons during the initial training period, we obtain the... The activation sequence of neurons is denoted as Then, the sequence is divided into its range of values. There are three equal-width intervals, and their boundary set is: ,in , Then, the normalized probability of each interval is calculated according to formula (11). The final information entropy is calculated by formula (12). It is the number of values in each interval that fall within the activation value of that interval. Let be the normalized probability. Satisfying ... . It means the first The information entropy of a neuron during training is almost constant (the difference between the maximum and minimum values is small). Neurons whose entropy is set to 0 are considered silent neurons.
[0085] (11)
[0086] (12)
[0087] Before ESN pruning, the PRO algorithm randomly generates a population, and each network structure is encoded as a real vector of length R (number of reservoir neurons): .in, Indicates that the first [number] is reserved. One neuron is removed if the number of neurons is less than one, otherwise they are removed. Two special individuals are added to the initial population: (1) fully preserved individuals: (1) Used for benchmark comparison; (2) Information entropy guides individuals: remove neurons with the lowest entropy value for heuristic inspiration.
[0088] According to PRO theory, a composite fitness function is defined as shown in formula (13). Error is used as the primary evaluation criterion, and the proportion of neurons is used as the secondary evaluation criterion.
[0089] (13)
[0090] in, The mean square error of the current structure's prediction; It is the mean square error of the initial network; It is the number of neurons to be preserved; This is the initial number of reservoir neurons; It is a weighted coefficient for controlling precision and sparsity.
[0091] To prevent excessive pruning from resulting in too few reservoir neurons, leading to insufficient fit and excessively biased prediction results, and to prevent insufficient pruning from failing to significantly improve network performance, a boundary penalty term is added to the fitness function to dynamically adjust the fitness function and guide the PRO algorithm to search back to a reasonable range, as shown in formula (14).
[0092] (14)
[0093] in, , is the proportion of neurons retained; , which is the set range of allowable pruning ratios; It is the penalty intensity coefficient, used to amplify the penalty for deviations in the pruning ratio.
[0094] Then, the population is sorted by fitness, and iterative updates are performed to find the optimal pruning scheme. The iteration cycle is set to 20 rounds. The PRO algorithm performs three types of update operations:
[0095] (1) Reinforcement mechanism (mutation update): For top-ranked individuals With random factors To a certain individual The direction is self-stretched, as shown in formula (15).
[0096] (15)
[0097] (2) Correction mechanism (evolutionary mechanism): For individuals with lower rankings, make them move closer to high-quality individuals, as shown in formula (16).
[0098] (16)
[0099] (3) Mutation Mechanism (Perturbation Mechanism): To enhance the diversity of the population to maintain the algorithm's search capability and prevent getting trapped in local optima, the PRO algorithm uses a probabilistic perturbation mechanism in each iteration. Add a Gaussian noise perturbation term, and then recalculate the fitness of the updated individual. If it is better than the original individual, it is replaced, as shown in formula (17).
[0100] (17)
[0101] in, It is a primitive individual; It is a candidate individual after mutation; It is the coefficient of variation intensity; It follows a standard normal distribution.
[0102] After 20 iterations, the PRO algorithm selects the globally optimal individual. Perform physical pruning on the network, retaining The neurons and their corresponding connections are then established. The updated ESN reservoir is shown in equations (18)-(20).
[0103] (18)
[0104] (19)
[0105] (20)
[0106] in, It is the pruned input weight matrix, retaining only the rows corresponding to the selected neurons; This is the weight matrix within the reservoir after pruning, retaining only the submatrix corresponding to the selected neurons. This completes the pruning of reservoir neurons.
[0107] PRO-ESN detailed process:
[0108] ESN reservoir structure affects prediction performance. Too many neurons lead to poor generalization ability, while a small number of neurons have limited information processing capacity. The PRO-ESN model optimization algorithm proposed in this paper is as follows:Figure 4 As shown, the main steps include:
[0109] First: Create a standard ESN network and randomly initialize the network parameters. , ), and set a constant n. Simultaneously, through the spectral radius Scaling and adjusting the reservoir matrix It is a real symmetric matrix, and is processed as shown in Eqs.(21)-(23).
[0110] (twenty one)
[0111] (twenty two)
[0112] (twenty three)
[0113] Second: Import dataset D, train the reservoir using the training data, and update its state according to Eq.(8). Then input the test data and fit the output using the least squares method according to Eq.(10). Calculate the prediction error and perform performance evaluation. The error calculation is shown in Eq.(24).
[0114] (twenty four)
[0115] Third: For each reservoir neuron The discrete information entropy of its activation value in the training set is calculated by Eq.(16) and used for the construction of the subsequent initial population.
[0116] Fourth: Construct an initial optimization population. Each individual is mapped to a binary mask using a 0.5 threshold for pruning. Three types of individuals are constructed: fully retained individuals, entropy-sorted pruned individuals (the lowest 5% of entropy is set to 0), and randomly sampled individuals. This forms the basis for subsequent algorithmic optimization of the population.
[0117] Fifth: Construct a fitness function to calculate the fitness of each different network, which serves as the basis for pruning and updating in the PRO algorithm.
[0118] Sixth: Based on fitness levels, individuals are divided into mutant and evolutionary populations, and different update strategies are applied to different populations. After the update, fitness is assessed, and better individuals are retained.
[0119] Seventh: Find the optimal individual scheme and perform pruning operation, while updating the input weight matrix and reservoir weight matrix according to Eq.(23) and Eq.(24).
[0120] Eighth: Retrain the pruned network and perform predictions and performance evaluations on the test set.
[0121] The parameters of the echo state network and the local reinforcement optimization algorithm are shown in the table below.
[0122]
[0123] 4. Test the trained network using the test set.
[0124] The optimal structure of the echo state network, obtained by optimization using a local reinforcement optimization algorithm, is used to predict the test data. The observed values of auxiliary variables in the test sample are used as the input of the trained echo state network, and the output is the predicted result of the effluent ammonia nitrogen. Figure 3 During training, the fitness and pruning ratio of the local reinforcement optimization algorithm change with each iteration. Figure 4 This graph shows the test results for the original echo-state network and the locally enhanced optimized echo-state network. The X-axis represents time (samples / day), and the Y-axis represents effluent ammonia nitrogen (mg / L). The red line represents the actual data, the blue line represents the predicted effluent ammonia nitrogen concentration from the original echo-state network, and the yellow line represents the predicted effluent ammonia nitrogen concentration from the locally enhanced optimized echo-state network. Mean squared error (MSE) is used to reflect the degree of prediction deviation; a smaller value indicates a more ideal prediction effect. The results show that the prediction accuracy is significantly improved compared to the original algorithm, proving the effectiveness of this method.
[0125] Experimental results show that this method has better prediction accuracy and generalization ability than the original ESN on a real dataset from a wastewater treatment plant. It can meet the real-time and accuracy requirements of online ammonia nitrogen monitoring in wastewater treatment processes and has good prospects for practical application. This method is widely applicable to environmental monitoring, intelligent control, and nonlinear time series modeling.
[0126] This embodiment also provides a computer device applicable to the wastewater effluent ammonia nitrogen prediction method based on a locally enhanced optimized echo state network, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the wastewater effluent ammonia nitrogen prediction method based on a locally enhanced optimized echo state network as proposed in the above embodiment.
[0127] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0128] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the wastewater effluent ammonia nitrogen prediction method based on a locally enhanced optimized echo state network as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0129] In summary, this invention describes the cloud-water transformation process using fractional calculus and introduces a dynamic adjustment mechanism for terrain gradient. It accurately characterizes the non-classical diffusion features caused by terrain forcing through Caputo's temporal and spatial fractional derivatives, establishes a dynamic response relationship between cloud droplet collision efficiency and terrain gradient, and solves the problem of decoupling cloud microphysical processes from terrain dynamic forcing in existing technologies. It innovatively combines wavelet analysis to detect acoustic-gravity wave signals excited by terrain, constructs a periodic perturbation term modulated by terrain to correct the vertical velocity field, and achieves physical consistency coupling between gravity waves and cloud microphysical processes.
[0130] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for predicting ammonia nitrogen in wastewater effluent based on locally enhanced optimized echo state networks, characterized in that: It includes the following steps: Obtain the process parameter data and the effluent ammonia nitrogen data during the sewage treatment process, and preprocess the process parameter data and the effluent ammonia nitrogen data to obtain a prediction variable set and a candidate auxiliary variable set; Calculate the mutual information values of each effluent ammonia nitrogen and candidate auxiliary variable in the prediction variable set and the candidate auxiliary variable set, and screen the top m variables with the highest mutual information values to form a primary selection auxiliary variable set; Calculate the covariance matrix of the variables in the primary selection auxiliary variable set, and extract the principal components with eigenvalues greater than 1 through eigenvalue decomposition to obtain a core auxiliary variable set containing 4-10 variables; Construct a locally enhanced optimized echo state network based on the core auxiliary variable set; Input the core auxiliary variables in the test sample into the locally enhanced optimized echo state network to output the predicted value of the effluent ammonia nitrogen; use the mean square error to evaluate the prediction accuracy and complete the prediction of the sewage effluent ammonia nitrogen; Create a standard echo state network, randomly initialize the input weight matrix and the reservoir weight matrix, and set the constant n of the number of reservoir neurons; adjust the reservoir weight matrix to a real symmetric matrix, and scale the reservoir weight matrix through the spectral radius; Divide the dataset of the process parameter data and the effluent ammonia nitrogen data into a training set and a test set; Train the ESN reservoir with the training set data, and fit the output layer weight matrix by the least squares method; calculate the prediction mean square error to evaluate the performance of the initial model; For the activation value sequence of each reservoir neuron, calculate its information entropy through the discrete information entropy formula, quantify the information contribution degree of the neuron to the network prediction, and identify the silent neurons; Construct an initial optimization population, and each population individual is encoded as a [0,1] real number vector with a length of n, which is mapped to a binary mask through a 0.5 threshold. If the vector value ≥ 0.5, it means to retain the corresponding neuron, and < 0.5 means to prune; the initial population includes three types of individuals: ① all-retained individuals, with vector values all being 1, retaining all reservoir neurons; ② entropy-sorted pruning individuals, pruning the 5% neurons with the lowest information entropy, and setting the corresponding vector values to 0; ③ randomly sampled individuals, with vector values randomly generated and following a uniform distribution on [0,1]; Construct a composite fitness function and add a boundary penalty term at the same time. The penalty term rule is: if the neuron retention ratio p > p_max (p_max = 0.95), add γ(p - p_max); if p < p_min (p_min = 0.5), add γ(p_min - p); γ = 100 is the penalty intensity coefficient; Sort the population individuals according to the fitness values, divide them into the top 50% of the fitness as the mutation population and the bottom 50% of the fitness as the evolution population, and execute a differential update strategy: after each round of update, recalculate the fitness of the updated individuals and retain the individuals with better fitness; set the number of iteration rounds to 20 rounds to complete the population optimization; Screen the globally optimal individual after 20 rounds of iteration, perform neuron pruning based on the corresponding binary mask; update the input weight matrix and the reservoir weight matrix after pruning, only retain the corresponding sub-matrices, and retrain the network.
2. The wastewater effluent ammonia nitrogen prediction method based on locally enhanced optimized echo state network as described in claim 1, characterized in that: The process parameter data includes temperature, effluent pH, DO at the aerobic stage, effluent ORP, and effluent NO3N data. The preprocessing includes sequentially performing noise reduction, outlier removal, and missing value filling operations, and using Min-Max normalization to unify the scale of all data. The processed data is divided into N1 group training samples and N2 group test samples, and the predicted variable is determined to be effluent ammonia nitrogen, with the process parameters as the candidate auxiliary variable set.
3. The wastewater effluent ammonia nitrogen prediction method based on locally enhanced optimized echo state network as described in claim 1, characterized in that: The spectral radius ρ is set to 0.66, and the maximum absolute value of the eigenvalues of W is adjusted to make the reservoir matrix satisfy the echo state characteristics.
4. The wastewater effluent ammonia nitrogen prediction method based on locally enhanced optimized echo state network as described in claim 1, characterized in that: The echo state network in At time t, the input state of the input node, the state of the neurons inside the reservoir, and the output state of the output node are shown in equations (5) to (7), and the update equations of the reservoir state and the output state are shown in equations (8) to (9): (5) (6) (7) (8) (9) in, It is a dimension of Input the weight matrix, This indicates the number of input data. The activation state of reservoir neurons at that location. For time The input status at that location. It is the activation function of reservoir neurons, with parameters It's the leakage rate. It is a dimension of The reservoir weight matrix, For size The output matrix is obtained using ridge regression. As shown in formula (10): (10) in, It is the set of desired target output vectors, with a size of , It is the regularization coefficient, and It is the identity matrix, a matrix. Size is Used to learn output layer parameters. This represents the number of training samples.
5. The wastewater effluent ammonia nitrogen prediction method based on locally enhanced optimized echo state network as described in claim 1, characterized in that: By adding a boundary penalty term to the fitness function, the fitness function can be dynamically adjusted, as shown in the following formula: (14) in, , is the proportion of neurons retained; , which is the set range of allowable pruning ratios; It is the penalty intensity coefficient, used to amplify the penalty for deviation of the pruning ratio; The population is sorted by fitness, and iterative updates are performed to find the optimal pruning scheme.
6. The wastewater effluent ammonia nitrogen prediction method based on locally enhanced optimized echo state network as described in claim 1, characterized in that: Each iteration also includes a mutation mechanism, adding Gaussian noise perturbation to random individuals in the population. The perturbation formula is: (17) in, =0.1 is the coefficient of variation intensity. The fitness of the individual is a standard normally distributed random vector. After perturbation, the fitness is recalculated. If the fitness is better than the original individual, it is replaced to enhance population diversity and avoid getting trapped in local optima.
7. The wastewater effluent ammonia nitrogen prediction method based on locally enhanced optimized echo state network as described in claim 1, characterized in that: The echo state network selects the globally optimal individual to perform physical pruning on the network, retaining... The neurons and their corresponding connections are updated, and the formula is as follows: (18) (19) (20) in, It is the pruned input weight matrix, retaining only the rows corresponding to the selected neurons; It is the weight matrix inside the reservoir after pruning, retaining only the submatrix corresponding to the selected neuron, thus completing the pruning of reservoir neurons.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the wastewater effluent ammonia nitrogen prediction method based on a locally enhanced optimized echo state network as described in any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the wastewater effluent ammonia nitrogen prediction method based on a locally enhanced optimized echo state network as described in any one of claims 1 to 7.
Citation Information
Patent Citations
A method for predicting ammonia nitrogen concentration in effluent based on adaptive recurrent fuzzy neural network
CN109344971A
Helium leak detection method and system for switch cabinet
CN118882947A