METHOD AND SYSTEM FOR PREDICTING EFFLUENT AMMONIA NITROGEN (NH4-N) AND ELECTRONIC DEVICE

Information

  • Patent Application
  • 20240310350
  • Publication Number
    20240310350
  • Date Filed
    June 14, 2023
    a year ago
  • Date Published
    September 19, 2024
    3 months ago
Abstract
The present disclosure provides a method and system for predicting effluent ammonia nitrogen (NH4—N) and an electronic device. The method includes: obtaining data to be tested; and inputting the data to be tested into a trained deep echo state network, to obtain predicted NH4—N concentration. A method for establishing the deep echo state network includes: establishing an original network, where the original network includes a plurality of input variables and reservoirs, and a principal component analysis (PCA) mapping layer is added between adjacent ones of the reservoirs; initializing the original network to obtain an initialized network; performing parameter optimization on the initialized network by a matrix generation method of singular value decomposition and a competitive swarm optimizer (CSO) algorithm, to obtain an optimized network; and training and testing the optimized network, to obtain the trained deep echo state network.
Description
CROSS REFERENCE TO RELATED APPLICATION

This patent application claims the benefit and priority of Chinese Patent Application No. 2023102732408, filed with the China National Intellectual Property Administration on Mar. 17, 2023, the disclosure of which is incorporated by reference herein in its entirety as part of the present application.


TECHNICAL FIELD

The present disclosure relates to the field of water treatment technologies, and in particular, to a method for predicting effluent ammonia nitrogen (NH4—N).


BACKGROUND

With the rapid development of urbanization and industrialization, the hydrographic environment has been seriously damaged. Wastewater discharge not only seriously affects our daily life, but also destroys ecological balance of nature. To reduce the discharge of wastewater and recycle water, wastewater treatment plants have been established all over the world. During wastewater treatment, NH4—N concentration is an important parameter used to measure the performance of a wastewater treatment process (WWTP). Excessive discharge of ammonia nitrogen is a main reason for eutrophication of rivers and black or odor water. To resolve the problem, some laboratory detection methods based on chemistry and biology are widely used. However, these methods have long detection time and are easily affected by environmental factors.


In addition, due to the continuous development of sensors and information technologies, the wastewater treatment plants can record and save a large amount of historical data. Therefore, a data-driven method is widely used for predicting effluent NH4—N. However, because the wastewater treatment process is a complex system with characteristics of high nonlinearity, large delay, and large time-varying. To sum up, in the conventional technology, prediction of the effluent NH4—N has problems of low prediction accuracy, weak stability, and high maintenance costs.


SUMMARY

An objective of the present disclosure is to provide a method and system for predicting effluent NH4—N and an electronic device, to resolve problems of predicting the effluent NH4—N in a conventional technology, for example, low prediction accuracy, weak stability, and high maintenance costs.


To achieve the above objective, the present disclosure provides the following technical solutions:


A method for predicting effluent NH4—N includes:

    • obtaining data to be tested; and
    • inputting the data to be tested into a trained deep echo state network, to obtain predicted NH4—N concentration, where
    • a method for establishing the deep echo state network includes:
    • establishing an original network, where the original network includes a plurality of input variables and reservoirs, and a principal component analysis (PCA) mapping layer is added between adjacent ones of the reservoirs;
    • initializing the original network to obtain an initialized network;
    • performing parameter optimization on the initialized network by a matrix generation method of singular value decomposition and a competitive swarm optimizer (CSO) algorithm, to obtain an optimized network; and
    • training and testing the optimized network, to obtain the trained deep echo state network.


Preferably, the input variable includes:

    • a temperature, a redox potential, a dissolved oxygen concentration, content of total suspended solids, a pH value, total effluent phosphorus, and total influent phosphorus.


Preferably, the initializing the original network includes:

    • setting a parameter of the original network and setting a structure of the original network.


Preferably, the setting a structure of the original network includes:

    • converting all the input variables into five input nodes by a principal component analysis method; and
    • determining the structure of the original network based on the input nodes and effluent NH4—N concentration.


Preferably, the setting a parameter of the original network includes:

    • using a tanh function as an activation function of a neuron, and initializing the parameter of the original network.


Preferably, the performing parameter optimization on the initialized network by a matrix generation method of singular value decomposition and a competitive swarm optimizer (CSO) algorithm, to obtain an optimized network includes:

    • establishing an input weight matrix and a reservoir weight of the initialized network by the matrix generation method of singular value decomposition;
    • determining a decision variable based on the input weight matrix, the reservoir weight, and a delay factor of the initialized network; and
    • optimizing the initialized network based on the CSO algorithm and the decision variable, to obtain the optimized network.


Preferably, the establishing an input weight matrix of the initialized network by the matrix generation method of singular value decomposition includes:

    • establishing a first singular value;
    • establishing a first diagonal matrix based on the first singular value;
    • establishing a random matrix based on the first diagonal matrix;
    • generating two orthogonal matrixes based on the random matrix; and
    • obtaining the input weight matrix of the initialized network based on the two orthogonal matrixes.


Preferably, the establishing a reservoir weight of the initialized network by the matrix generation method of singular value decomposition includes:

    • establishing a second singular value;
    • establishing a second diagonal matrix based on the second singular value;
    • randomly generating two rotation matrixes based on the second diagonal matrix; and
    • establishing the reservoir weight of the initialized network based on the two rotation matrixes.


Preferably, the optimizing the initialized network based on the CSO algorithm and the decision variable, to obtain the optimized network includes:

    • dividing the decision variable into a structure-related hyper-parameter and a weight-related variable;
    • optimizing the structure-related hyper-parameter and a randomly generated weight variable by using a prediction accuracy as an objective function and based on the CSO algorithm, to obtain a first optimal parameter;
    • optimizing the weight-related variable and the first optimal parameter by using the prediction accuracy as the objective function and based on the CSO algorithm, to obtain a second optimal parameter
    • optimizing a parameter of the initialized network based on the first optimal parameter and the second optimal parameter, to obtain the optimized network.


A system for predicting effluent NH4—N includes:

    • a data obtaining module, configured to obtain data to be tested; and
    • a concentration prediction module, configured to input the data to be tested into a trained deep echo state network, to obtain predicted NH4—N concentration, where
    • the deep echo state network includes:
    • an original network establishing module, configured to establish an original network, where the original network includes a plurality of input variables and reservoirs, and a principal component analysis (PCA) mapping layer is added between adjacent ones of the reservoirs;
    • an original network initialization module, configured to initialize the original network to obtain an initialized network;
    • a network optimization module, configured to perform parameter optimization on the initialized network by a matrix generation method of singular value decomposition and a competitive swarm optimizer (CSO) algorithm, to obtain an optimized network; and
    • a network test module, configured to train and test the optimized network, to obtain the trained deep echo state network.


Preferably, the original network initialization module includes:

    • an original network parameter setting unit and an original network structure setting unit.


Preferably, the network optimization module includes:

    • an input variable establishing unit, configured to establish an input weight matrix and a reservoir weight of the initialized network by the matrix generation method of singular value decomposition;
    • a decision variable determination unit, configured to determine a decision variable based on the input weight matrix, the reservoir weight, and a delay factor of the initialized network; and
    • a network optimization module, configured to optimize the initialized network based on the CSO algorithm and the decision variable, to obtain the optimized network.


The present disclosure further provides an electronic device, including:

    • one or more processors; and
    • a storage apparatus, configured to store one or more programs;
    • when the one or more programs are executed, the one or more processors are enabled to implement the method for predicting effluent NH4—N according to any one of claims 1 to 9.


The storage apparatus is a readable storage medium.


According to specific embodiments provided by the present disclosure, the present disclosure provides the following technical effects:


According the method and system for predicting effluent NH4—N and the electronic device provided by the present disclosure, the deep echo state network is established by adding the PCA mapping layer and the delay factor into the network, the parameters in the network are optimized by a singular value decomposition based matrices design strategy-competitive swarm optimizer (SVDMDS-CSO) algorithm to obtain the trained deep echo state network, and a concentration of ammonia nitrogen in a sewage treatment process is predicted through the network, so that accuracy and stability of prediction are improved, and an error of a prediction result and maintenance costs are reduced.





BRIEF DESCRIPTION OF THE DRAWINGS

To describe the technical solutions in embodiments of the present disclosure or in the prior art more clearly, the accompanying drawings required in embodiments are briefly described below. Apparently, the accompanying drawings in the following description show only some embodiments of the present disclosure, and other drawings can be derived from these accompanying drawings by those of ordinary skill in the art without creative efforts.



FIG. 1 is a schematic flowchart of a method for predicting effluent NH4—N according to an embodiment of the present disclosure;



FIG. 2 is a flowchart of a method for establishing a deep echo state network according to an embodiment of the present disclosure;



FIG. 3 is a diagram of a structure of an Evolving Deep Delay Echo State Network (EDDESN) according to an embodiment of the present disclosure;



FIG. 4 is a diagram of a prediction result of a concentration of effluent NH4—N according to an embodiment of the present disclosure; and



FIG. 5 is a diagram of a prediction error of a concentration effluent NH4—N according to an embodiment of the present disclosure.





DETAILED DESCRIPTION OF THE EMBODIMENTS

To technical solutions of embodiments of the present disclosure are clearly and completely described below with reference to the drawings. Apparently, the described embodiments are only a part rather than all of embodiments of the present disclosure. All other embodiments obtained by a person of ordinary skill in the art based on embodiments of the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.


The “embodiment” mentioned herein means that a specific feature, structure or characteristic described in combination with embodiment may be included in at least one embodiment of the present application. The term appearing in different parts of the specification does not necessarily refer to the same embodiment or an independent or alternative embodiment exclusive of other embodiments. It may be explicitly or implicitly appreciated by those skilled in the art that the embodiment described herein may be combined with other embodiments.


The terms “first”, “second”, “third”, “fourth”, and the like in the specification, claims and the accompanying drawings of the present disclosure are intended to distinguish between different objects but do not indicate a specific sequence. Moreover, the terms “include”, “have”, and any variations thereof mean to cover non-exclusive inclusion. For example, a process or method that includes a series of steps or units is not limited to the listed steps. On the contrary, optionally, it also includes steps that are not listed, or optionally also includes other steps inherent to the process, method, product, or device.


An objective of the present disclosure is to provide a method for predicting effluent ammonia nitrogen (NH4—N), to resolve problems of predicting the effluent NH4—N in a conventional technology, for example, low prediction accuracy, weak stability, and high maintenance cost.


To make the above objectives, features, and advantages of the present disclosure clearer and more comprehensible, the present disclosure will be further described in detail below with reference to the accompanying drawings and the specific examples.


Embodiment 1

Referring to FIG. 1, the present disclosure provides a method for predicting effluent ammonia nitrogen (NH4—N). The method includes the following steps.


Step 100: Obtain data to be tested.


Step 200: Input the data to be tested into a trained deep echo state network, to obtain predicted NH4—N concentration.


As shown in FIG. 2, a method for establishing the deep echo state network includes the following steps.


Step 201: Establish an original network, where the original network includes a plurality of input variables and reservoirs, and a principal component analysis (PCA) mapping layer is added between adjacent ones of the reservoirs.


Step 202: Initialize the original network to obtain an initialized network.


Step 203: Perform parameter optimization on the initialized network by a matrix generation method of singular value decomposition and a competitive swarm optimizer (CSO) algorithm, to obtain an optimized network.


Step 204: Train and test the optimized network, to obtain the trained deep echo state network.


Further, the input variable includes:

    • a temperature, a redox potential, a dissolved oxygen concentration, content of total suspended solids, a pH value, total effluent phosphorus, and total influent phosphorus.


Further, as shown in FIG. 3 to FIG. 5, the initializing the original network includes:

    • setting a parameter of the original network and setting a structure of the original network.


Specifically, the setting a structure of the original network includes:

    • converting all the input variables into five input nodes by a principal component analysis method; and
    • determining the structure of the original network based on the input nodes and effluent NH4—N concentration. The network structure is 5-1, where L represents a quantity of layers of the network and Nr represents a quantity of nodes in the reservoir. In this network, L=3, Nr∈[100, 200]. That is, the network has: five input nodes; three sub-reservoirs, where a quantity of neurons in each reservoir is limited within a range of [100, 200], and further determined by the optimization algorithm; and one output node. A PCA layer between adjacent sub-reservoirs has 60 nodes, to reduce dimension of an input weight.


Specifically, the setting a parameter of the original network includes:

    • using a tanh function as an activation function of a neuron, and initializing the parameter of the original network. The reservoir uses a leaky neuron and uses the tanh function as the activation function of the neuron to train a sample {(uk,tk∈|uk∈Rn, k=1, 2, . . . , l}, where uk represents a kth group of input samples, tk indicates kth group of actual output values, n represents dimension of an input sample, and l represents a total quantity of samples. Other related parameters are obtained by a subsequent optimization algorithm.


Further, the performing parameter optimization on the initialized network by a matrix generation method of singular value decomposition and a competitive swarm optimizer (CSO) algorithm, to obtain an optimized network includes:

    • establishing an input weight matrix and a reservoir weight of the initialized network by the matrix generation method of singular value decomposition;
    • determining a decision variable based on the input weight matrix, the reservoir weight, and a delay factor of the initialized network; and
    • optimizing the initialized network based on the CSO algorithm and the decision variable, to obtain the optimized network.


Specifically, the establishing an input weight matrix of the initialized network by the matrix generation method of singular value decomposition includes the following steps.


Establish a first singular value. First, a group of singular values {βi1, βi2, . . . , βini} are set, where i represents an ith reservoir, and ni represents input dimension of an ith sub-reservoir.


Establish a first diagonal matrix S=diag(βi1, βi2, . . . , βini) based on the first singular value, where βi1≥βi2≥ . . . ≥βini.


Establish a random matrix Σiin=[S;0]∈RNr×ni based on the first diagonal matrix.


Generate two orthogonal matrixes U∈RNr×Nr and V∈Rni×ni based on the random matrix.


Obtain an ith input weight matrix Wiin=UΣiinV of the initialized network based on the two orthogonal matrixes.


Specifically, the establishing a reservoir weight of the initialized network by the matrix generation method of singular value decomposition includes the following steps.


Establish a second singular value {σi1, σi2, . . . , σiNr}.


Establish a second diagonal matrix Σi=diag(σi1, σi2, . . . , σiNr) based on the second singular value, where σi1≥σi2≥ . . . ≥σiNr.


Randomly generate two rotation matrixes U=Q (p1,q1,s1) and V=Q(p2,q2,s2) based on the second diagonal matrix, where Q(p,q,s) represents Qp,p=Qq,q=cos(s), Qp,q=−sin(s), and Qq,p=sin(s), p and q are two integers in [1,Nr] and s is a rotation angle in [0,2π].


Establish the reservoir weight Wi=UΣiV of the initialized network based on the two rotation matrixes, and repeat the foregoing steps until sparsity of the matrix meets requirements.


Specifically, the optimizing the initialized network based on the CSO algorithm and the decision variable, to obtain the optimized network includes the following steps.


Determine the decision variable as





{Nrii,Dii1i2, . . . ,σiNri1i2, . . . ,βini|i=1,2, . . . ,L}, where


Nr represents a size of the sub-reservoir, γi represents a leak rate of neurons in the ith sub-reservoir, αi represents sparsity of the reservoir weight matrix, and Di represents a delay size of the delay factor.


To reduce dimension of the decision variable, divide the decision variable into a structure-related hyper-parameter and a weight-related variable, namely {Nr, γi, αiDi|i=1, 2, . . . , L} and {σi1, σi2, . . . , σiNr, βi1, βi2, . . . , βini|i=1, 2, . . . , L}.


In a first stage, if the decision variable is {Nr, γi, αiDi|i=1, 2, . . . , L}, optimize the structure-related hyper-parameter and a randomly generated weight variable by using a prediction accuracy as an objective function and based on the CSO algorithm, to obtain a first optimal parameter.


In a second stage, if the decision variable is {σi1, σi2, . . . , σiNr, βi1, βi2, . . . , βini|i=1, 2, . . . , L}, optimize the weight-related variable and the first optimal parameter by using the prediction accuracy as the objective function and based on the CSO algorithm, to obtain a second optimal parameter. The algorithm is suitable for a high-dimensional optimization problem.


Optimize a parameter of the initialized network based on the first optimal parameter and the second optimal parameter, to obtain the optimized network.


A state equation of the above-mentioned network of which initialization and parameter optimization are completed is:









x
i

(
k
)

=



(

1
-

γ
i


)




x
i

(

k
-
1

)


+


γ
i



f
[



W
i
in




u
i

(
k
)


+


W
i




x
i

(

k
-
1

)



]




,




where


xi(k) represents a state of an ith sub-reservoir at kth time, γi represents the leak rate of the neurons in the ith sub-reservoir, f represents the activation function tanh, Wiin represents the input weight of the ith sub-reservoir, and Wi represents an internal weight of the ith sub-reservoir. ui(k) represents an input of the ith sub-reservoir, and may be expressed as:








u
i

(
k
)

=

{






u

(
k
)

,

i
=
1










W
^


i
-
1





x

i
-
1


(

k
-

D
i


)


,

1
<
i

L





,






where


Di represents a size of an ith delay factor, Ŵi represents a linear transformation matrix calculated by PCA. To calculate the matrix, first, calculate an average value of a state vector xi=[xi1, xi2, . . . xiNr], where Xi represents the state vector.








μ
i

=


1

N
r








N
r



j
=
1



x
ij




,




where ui represents the average value of the state vector.


Decentralize the state vector to obtain Zi=[xi1−μi, xi2−μi, . . . , xiN−μi], where Zi represents a decentralized state vector.


Calculate a covariance matrix:








S
i

=


1

l
-
1




Z
i



Z
i
T



,




where Si represents the covariance matrix.


Ŵi is formed with feature vectors corresponding to first M maximum eigenvalues of Si.


An output of the optimized network may be expressed as y(k)=X(k)Wout, where y(k) represents the output of the optimized network.


X(t)=[x1(t); x2(t); . . . ; xL(t)]T represents a state matrix. To avoid ill-posed issue and collinearity problem, calculate the output weight by ridge regression:








W
out

=


arg


min

W
out







HW
out

-
T



2
2


+

β





W
out



2
2




,




where


H=[X(1), X(2), . . . , X(l)]T represents the state matrix, and T=[t(1), t(2), . . . , t(l)]T represents an expected output vector. Wout=(HTH+βI)−1HTT is obtained by a least square method.


Input a test sample to test the optimized network based on the output weight Wout obtained in the foregoing step, to obtain the trained deep echo state network.


Embodiment 2

A system for predicting effluent ammonia nitrogen (NH4—N) includes a data obtaining module and a concentration prediction module.


The data obtaining module is configured to obtain data to be tested.


The concentration prediction module is configured to input the data to be tested into a trained deep echo state network, to obtain predicted NH4—N concentration.


The deep echo state network includes an original network establishing module, an original network initialization module, a network optimization module, and a network test module.


The original network establishing module is configured to establish an original network, where the original network includes a plurality of input variables and reservoirs, and a principal component analysis (PCA) mapping layer is added between adjacent ones of the reservoirs, and the input variable includes a temperature, a redox potential, a dissolved oxygen concentration, content of total suspended solids, a pH value, total effluent phosphorus, and total influent phosphorus.


The original network initialization module is configured to initialize the original network to obtain an initialized network. The original network initialization module includes an original network parameter setting unit and an original network structure setting unit.


The original network structure setting unit includes a variable conversion subunit, configured to convert all the input variables into five input nodes by a principal component analysis method; an original network structure determining subunit, configured to determine a structure of the original network based on an input node and a concentration of the effluent NH4—N.


The original network parameter setting unit uses a tanh function as an activation function of a neuron, and initializes the parameter of the original network.


The network optimization module is configured to perform parameter optimization on the initialized network by a matrix generation method of singular value decomposition and a competitive swarm optimizer (CSO) algorithm, to obtain an optimized network.


Specifically, the network optimization module includes an input variable establishing unit, configured to establish an input weight matrix and a reservoir weight of the initialized network by the matrix generation method of singular value decomposition; and a decision variable determination unit, configured to determine a decision variable based on the input weight matrix, the reservoir weight, and a delay factor of the initialized network; and a decision variable determination unit, configured to optimize the initialized network based on the CSO algorithm and the decision variable, to obtain the optimized network.


In the input variable establishing unit, the method for establishing an input weight matrix specifically includes: establishing a first diagonal matrix based on the first singular value; establishing a first diagonal matrix based on the first singular value; establishing a random matrix based on the first diagonal matrix; generating two orthogonal matrixes based on the random matrix; and obtaining the input weight matrix of the initialized network based on the two orthogonal matrixes.


In the input variable establishing subunit, the method for establishing a reservoir weight matrix specifically includes: establishing a second singular value; establishing a second singular value; randomly generating two rotation matrixes based on the second diagonal matrix; and establishing the reservoir weight of the initialized network based on the two rotation matrixes.


The network optimization unit is specifically configured to: divide the decision variable into a structure-related hyper-parameter and a weight-related variable; optimize based on the structure-related hyper-parameter and a randomly generated weight variable by using a prediction accuracy as an objective function based on the CSO algorithm, to obtain a first optimal parameter; optimize the weight-related variable and the first optimal parameter by using the prediction accuracy as the objective function and based on the CSO algorithm, to obtain a second optimal parameter; and optimize the parameter of the initialized network based on the first optimal parameter and the second optimal parameter, to obtain the optimized network.


The network test module is configured to train and test the optimized network, to obtain the trained deep echo state network.


Embodiment 3

An electronic device includes:

    • one or more processors and a storage apparatus.


The storage apparatus is configured to store one or more programs.


When the one or more programs are executed, the one or more processors are enabled to implement the method for predicting effluent NH4—N in the embodiment 1.


The storage apparatus is a readable storage medium.


The present disclosure has the following beneficial effects:


According to the method and system for predicting effluent ammonia nitrogen (NH4—N) and the electronic device provided by the present disclosure, the deep echo state network is established by adding the PCA mapping layer and the delay factor into the network, the parameters in the network are optimized by a singular value decomposition based matrices design strategy-competitive swarm optimizer (SVDMDS-CSO) algorithm to obtain the trained deep echo state network, and a concentration of ammonia nitrogen in a sewage treatment process is predicted through the network, so that accuracy and stability of prediction are improved, and an error of a prediction result and maintenance costs are reduced.


Each embodiment of the present specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts between embodiments may refer to each other. Since the system disclosed in an embodiment corresponds to the method disclosed in another embodiment, the description is relatively simple, and reference can be made to the method description.


Methods described herein may be construed as being performed or performable by a module, segment or portion of code representing executable instructions including one or more steps for implementing a particular logical function or process. The steps do not necessarily need to be performed in the order shown or discussed herein, and in at least some cases could be performed in a substantially concurrent manner or in a different order.


The methods described herein may be considered as including executable instructions for implementing logical steps or functions. They can be specifically embodied in any computer-readable medium for use by an apparatus or device for executing instructions, such as a computer-based system, a system including a processor, or another system that can obtain instructions from the apparatus or device and execute these instructions, or for use in conjunction with the apparatus or device. For the purposes of the present specification, “computer-readable medium” can be any means that can contain, store, communicate, propagate or transmit programs for use by an apparatus or device for executing instructions, or for use in conjunction with the apparatus or device for executing instructions.


The computer-readable medium referred to herein may take any form, such as a magnetic or optical disc drive, a random access memory (RAM), a read only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), or others.


The elements of electronic devices in the present disclosure that are referred to as “modules” or “units” (or other terms) may be implemented in the form of hardware, software, firmware, or a combination thereof. In at least some disclosed embodiments, modules that are configured to perform certain steps or methods may be implemented using firmware or software stored in a memory and executed by a suitable instruction execution system, such as a computer including a processor, for example. Modules implemented in hardware in some embodiments may take the form of discrete logic circuits for implementing logic functions, application-specific integrated circuits having suitable combined logic gate circuits, programmable gate arrays (PGA), field programmable gate arrays (FPGA), or others.


Specific examples are used herein to explain the principles and implementations of the present disclosure. The foregoing description of embodiments is only intended to help understand the method of the present disclosure and its core ideas; besides, various modifications may be made by a person of ordinary skill in the art to specific embodiments and the scope of application in accordance with the ideas of the present disclosure. In conclusion, the content of the present specification shall not be construed as limitations to the present disclosure.

Claims
  • 1. A method for predicting effluent ammonia nitrogen (NH4—N), comprising: obtaining data to be tested; andinputting the data to be tested into a trained deep echo state network, to obtain predicted NH4—N concentration,wherein a method for establishing the deep echo state network comprises: establishing an original network, wherein the original network comprises a plurality of input variables and reservoirs, and a principal component analysis (PCA) mapping layer is added between adjacent ones of the reservoirs;initializing the original network to obtain an initialized network;performing parameter optimization on the initialized network by a matrix generation method of singular value decomposition and a competitive swarm optimizer (CSO) algorithm, to obtain an optimized network; andtraining and testing the optimized network, to obtain the trained deep echo state network.
  • 2. The method for predicting effluent NH4—N according to claim 1, wherein the input variables comprise: a temperature, a redox potential, a dissolved oxygen concentration, content of total suspended solids, a pH value, total effluent phosphorus, and total influent phosphorus.
  • 3. The method for predicting effluent NH4—N according to claim 2, wherein the initializing the original network comprises: setting a parameter of the original network and setting a structure of the original network.
  • 4. The method for predicting effluent NH4—N according to claim 3, wherein the setting a structure of the original network comprises: converting all the input variables into five input nodes by a principal component analysis method; anddetermining the structure of the original network based on the input nodes and effluent NH4—N concentration.
  • 5. The method for predicting effluent NH4—N according to claim 3, wherein the setting a parameter of the original network comprises: using a tanh function as an activation function of a neuron, and initializing the parameter of the original network.
  • 6. The method for predicting effluent NH4—N according to claim 1, wherein the performing parameter optimization on the initialized network by a matrix generation method of singular value decomposition and a competitive swarm optimizer (CSO) algorithm, to obtain an optimized network comprises: establishing an input weight matrix and a reservoir weight of the initialized network by the matrix generation method of singular value decomposition;determining a decision variable based on the input weight matrix, the reservoir weight, and a delay factor of the initialized network; andoptimizing the initialized network based on the CSO algorithm and the decision variable, to obtain the optimized network.
  • 7. The method for predicting effluent NH4—N according to claim 6, wherein the establishing an input weight matrix of the initialized network by the matrix generation method of singular value decomposition comprises: establishing a first singular value;establishing a first diagonal matrix based on the first singular value;establishing a random matrix based on the first diagonal matrix;generating two orthogonal matrixes based on the random matrix; andobtaining the input weight matrix of the initialized network based on the two orthogonal matrixes.
  • 8. The method for predicting effluent NH4—N according to claim 6, wherein the establishing a reservoir weight of the initialized network by the matrix generation method of singular value decomposition comprises: establishing a second singular value;establishing a second diagonal matrix based on the second singular value;randomly generating two rotation matrixes based on the second diagonal matrix; andestablishing the reservoir weight of the initialized network based on the two rotation matrixes.
  • 9. The method for predicting effluent NH4—N according to claim 6, wherein the optimizing the initialized network based on the CSO algorithm and the decision variable, to obtain the optimized network comprises: dividing the decision variable into a structure-related hyper-parameter and a weight-related variable;optimizing the structure-related hyper-parameter and a randomly generated weight variable by using a prediction accuracy as an objective function and based on the CSO algorithm, to obtain a first optimal parameter;optimizing the weight-related variable and the first optimal parameter by using the prediction accuracy as the objective function and based on the CSO algorithm, to obtain a second optimal parameter; andoptimizing a parameter of the initialized network based on the first optimal parameter and the second optimal parameter, to obtain the optimized network.
  • 10. A system for predicting effluent NH4—N, comprising: a data obtaining module, configured to obtain data to be tested; anda concentration prediction module, configured to input the data to be tested into a trained deep echo state network, to obtain predicted NH4—N concentration,wherein the deep echo state network comprises: an original network establishing module, configured to establish an original network, wherein the original network comprises a plurality of input variables and reservoirs, and a principal component analysis (PCA) mapping layer is added between adjacent ones of the reservoirs;an original network initialization module, configured to initialize the original network to obtain an initialized network;a network optimization module, configured to perform parameter optimization on the initialized network by a matrix generation method of singular value decomposition and a competitive swarm optimizer (CSO) algorithm, to obtain an optimized network; anda network test module, configured to train and test the optimized network, to obtain the trained deep echo state network.
  • 11. The system for predicting effluent NH4—N according to claim 10, wherein the original network initialization module comprises: an original network parameter setting unit and an original network structure setting unit.
  • 12. The system for predicting effluent NH4—N according to claim 10, wherein the network optimization module comprises: an input variable establishing unit, configured to establish an input weight matrix and a reservoir weight of the initialized network by the matrix generation method of singular value decomposition;a decision variable determination unit, configured to determine a decision variable based on the input weight matrix, the reservoir weight, and a delay factor of the initialized network; anda network optimization module, configured to optimize the initialized network based on the CSO algorithm and the decision variable, to obtain the optimized network.
  • 13. An electronic device, comprising: one or more processors; anda storage apparatus, configured to store one or more programs,wherein when the one or more programs are executed, the one or more processors are enabled to implement the method for predicting effluent NH4—N according to claim 1.
  • 14. The electronic device according to claim 13, wherein the input variables comprise: a temperature, a redox potential, a dissolved oxygen concentration, content of total suspended solids, a pH value, total effluent phosphorus, and total influent phosphorus.
  • 15. The electronic device according to claim 14, wherein the initializing the original network comprises: setting a parameter of the original network and setting a structure of the original network.
  • 16. The electronic device according to claim 15, wherein the setting a structure of the original network comprises: converting all the input variables into five input nodes by a principal component analysis method; anddetermining the structure of the original network based on the input nodes and effluent NH4—N concentration.
  • 17. The electronic device according to claim 15, wherein the setting a parameter of the original network comprises: using a tanh function as an activation function of a neuron, and initializing the parameter of the original network.
  • 18. The electronic device according to claim 13, wherein the performing parameter optimization on the initialized network by a matrix generation method of singular value decomposition and a competitive swarm optimizer (CSO) algorithm, to obtain an optimized network comprises: establishing an input weight matrix and a reservoir weight of the initialized network by the matrix generation method of singular value decomposition;determining a decision variable based on the input weight matrix, the reservoir weight, and a delay factor of the initialized network; andoptimizing the initialized network based on the CSO algorithm and the decision variable, to obtain the optimized network.
  • 19. The electronic device according to claim 18, wherein the establishing an input weight matrix of the initialized network by the matrix generation method of singular value decomposition comprises: establishing a first singular value;establishing a first diagonal matrix based on the first singular value;establishing a random matrix based on the first diagonal matrix;generating two orthogonal matrixes based on the random matrix; andobtaining the input weight matrix of the initialized network based on the two orthogonal matrixes.
  • 20. The electronic device according to claim 13, wherein the storage apparatus is a readable storage medium.
Priority Claims (1)
Number Date Country Kind
2023102732408 Mar 2023 CN national