CN116151121A - A Neural Network-Based NH4-N Soft-Sensing Method for Effluent Water - Google Patents
A Neural Network-Based NH4-N Soft-Sensing Method for Effluent Water Download PDFInfo
- Publication number
- CN116151121A CN116151121A CN202310181946.1A CN202310181946A CN116151121A CN 116151121 A CN116151121 A CN 116151121A CN 202310181946 A CN202310181946 A CN 202310181946A CN 116151121 A CN116151121 A CN 116151121A
- Authority
- CN
- China
- Prior art keywords
- sub
- network
- echo state
- reserve pool
- effluent
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 54
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 title claims abstract description 22
- 230000001537 neural effect Effects 0.000 title 1
- 239000011159 matrix material Substances 0.000 claims abstract description 26
- 238000000354 decomposition reaction Methods 0.000 claims abstract description 21
- 238000012360 testing method Methods 0.000 claims abstract description 16
- 238000013528 artificial neural network Methods 0.000 claims abstract description 14
- 238000001514 detection method Methods 0.000 claims abstract description 13
- 238000000691 measurement method Methods 0.000 claims abstract description 9
- XKMRRTOUMJRJIA-UHFFFAOYSA-N ammonia nh3 Chemical compound N.N XKMRRTOUMJRJIA-UHFFFAOYSA-N 0.000 claims description 9
- QVGXLLKOCUKJST-UHFFFAOYSA-N atomic oxygen Chemical compound [O] QVGXLLKOCUKJST-UHFFFAOYSA-N 0.000 claims description 9
- 229910052760 oxygen Inorganic materials 0.000 claims description 9
- 239000001301 oxygen Substances 0.000 claims description 9
- 239000007787 solid Substances 0.000 claims description 9
- 238000004364 calculation method Methods 0.000 claims description 6
- 238000012549 training Methods 0.000 claims description 6
- 230000004913 activation Effects 0.000 claims description 4
- 230000035772 mutation Effects 0.000 claims description 4
- 239000010865 sewage Substances 0.000 abstract description 12
- 230000009191 jumping Effects 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 4
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 3
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 3
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 1
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 1
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000004064 recycling Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
- G06F30/27—Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16C—COMPUTATIONAL CHEMISTRY; CHEMOINFORMATICS; COMPUTATIONAL MATERIALS SCIENCE
- G16C20/00—Chemoinformatics, i.e. ICT specially adapted for the handling of physicochemical or structural data of chemical particles, elements, compounds or mixtures
- G16C20/20—Identification of molecular entities, parts thereof or of chemical compositions
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16C—COMPUTATIONAL CHEMISTRY; CHEMOINFORMATICS; COMPUTATIONAL MATERIALS SCIENCE
- G16C20/00—Chemoinformatics, i.e. ICT specially adapted for the handling of physicochemical or structural data of chemical particles, elements, compounds or mixtures
- G16C20/70—Machine learning, data mining or chemometrics
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- Computing Systems (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Software Systems (AREA)
- Bioinformatics & Cheminformatics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Crystallography & Structural Chemistry (AREA)
- Chemical & Material Sciences (AREA)
- Data Mining & Analysis (AREA)
- General Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Molecular Biology (AREA)
- Mathematical Physics (AREA)
- Spectroscopy & Molecular Physics (AREA)
- Computational Linguistics (AREA)
- Biophysics (AREA)
- Geometry (AREA)
- Computer Hardware Design (AREA)
- Databases & Information Systems (AREA)
- Purification Treatments By Anaerobic Or Anaerobic And Aerobic Bacteria Or Animals (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及水处理技术领域,特别是涉及一种基于神经网络的出水NH4-N软测量方法。The invention relates to the technical field of water treatment, and in particular to a soft measurement method of effluent NH4-N based on neural network.
背景技术Background Art
随着当今社会城市化和工业化的快速发展,我国水环境已受到严重破坏。污水排放不仅严重影响居民的日常生活,而且破坏了大自然的生态平衡。为了降低污水的排放量,实现水的循环利用,全国各地纷纷建立了污水处理厂。在污水处理过程中,NH4-N浓度是衡量污水处理工艺(WWTP)性能的一个重要参数,然而由于污水处理过程是一个具有高度非线性、大滞后、大时变、多变量耦合等特点的复杂系统,而且维护成本较高,因此对其进行预测仍然是一个悬而未决的问题。因此,如何低成本、高效率地对出水NH4-N的浓度进行预测对于出水水质的达标考核以及污水处理厂的稳定运行是非常有必要的。With the rapid development of urbanization and industrialization in today's society, my country's water environment has been severely damaged. Sewage discharge not only seriously affects the daily life of residents, but also destroys the ecological balance of nature. In order to reduce the discharge of sewage and realize the recycling of water, sewage treatment plants have been established all over the country. In the sewage treatment process, NH4-N concentration is an important parameter to measure the performance of sewage treatment process (WWTP). However, since the sewage treatment process is a complex system with high nonlinearity, large hysteresis, large time variation, multivariate coupling and other characteristics, and the maintenance cost is high, its prediction is still an unresolved problem. Therefore, how to predict the concentration of effluent NH4-N at low cost and high efficiency is very necessary for the assessment of effluent water quality and the stable operation of sewage treatment plants.
发明内容Summary of the invention
为了克服现有技术的不足,本发明的目的是提供一种基于神经网络的出水NH4-N软测量方法,本发明通过将差分进化算法与条件数分析结合应用于构建新型回声状态网络,能够对污水处理过程中氨氮浓度进行预测。In order to overcome the shortcomings of the prior art, the purpose of the present invention is to provide a soft measurement method for effluent NH4-N based on neural network. The present invention combines the differential evolution algorithm with condition number analysis to construct a new echo state network, which can predict the ammonia nitrogen concentration in the sewage treatment process.
为实现上述目的,本发明提供了如下方案:To achieve the above object, the present invention provides the following solutions:
一种基于神经网络的出水NH4-N软测量方法,包括:A soft measurement method for effluent NH4-N based on neural network, comprising:
构建回声状态网络,并对所述回声状态网络的网络结构及网络参数进行初始化;所述回声状态网络的输入变量包括进水温度、总固体悬浮物、溶解氧浓度、pH值以及出水氧化还原电位;所述回声状态网络的输出变量包括氨氮浓度;Constructing an echo state network, and initializing the network structure and network parameters of the echo state network; the input variables of the echo state network include inlet water temperature, total suspended solids, dissolved oxygen concentration, pH value, and outlet water redox potential; the output variables of the echo state network include ammonia nitrogen concentration;
基于初始化后的回声状态网络,根据奇异值分解方法构造子储备池;Based on the initialized echo state network, a sub-reservoir is constructed according to the singular value decomposition method;
根据条件数和差分进化算法优化所述子储备池;Optimizing the sub-reservoir according to a condition number and a differential evolution algorithm;
对优化后的所述子储备池的权值、输入权值和状态矩阵进行更新,并判断迭代次数是否小于预设迭代阈值,若是,则跳转至步骤“基于初始化后的回声状态网络,根据奇异值分解方法构造子储备池”;若是,则计算输出权值;The weights, input weights and state matrix of the optimized sub-reserve pool are updated, and it is determined whether the number of iterations is less than a preset iteration threshold. If so, jump to the step of "constructing a sub-reserve pool based on the initialized echo state network according to the singular value decomposition method"; if so, calculate the output weights;
根据输出权值和测试样本对所述回声状态网络进行测试,得到确定好的出水NH4-N检测模型;The echo state network is tested according to the output weights and the test samples to obtain a determined effluent NH4-N detection model;
将待检测数据输入至确定好的出水NH4-N检测模型中,得到检测结果。The data to be tested is input into the determined effluent NH4-N detection model to obtain the test results.
优选地,对所述回声状态网络的网络结构及网络参数进行初始化,包括:Preferably, initializing the network structure and network parameters of the echo state network includes:
确定所述回声状态网络的初始结构为5-N-1;其中N表示子储备池节点个数;N的大小是逐渐增加;Determine the initial structure of the echo state network as 5-N-1; wherein N represents the number of nodes in the sub-reservoir; and the size of N is gradually increased;
将sigmoid函数作为网络激活函数G(·),确定初始迭代次数i=1,最大迭代次数imax≤30,训练样本其中,uk表示第k组输入样本,tk表示第k组实际输出值,表示输入样本维度为n,L为样本总数;The sigmoid function is used as the network activation function G(·), the initial iteration number i=1, the maximum iteration number i max ≤30, and the training sample Among them, uk represents the kth group of input samples, tk represents the kth group of actual output values, Indicates that the input sample dimension is n, and L is the total number of samples;
随机初始化网络输入权值Win和储备池内部权值W在(0,1)之间。Randomly initialize the network input weights W in and the internal weights W of the reserve pool between (0,1).
优选地,所述基于初始化后的回声状态网络,根据奇异值分解方法构造子储备池,包括:Preferably, the constructing of the sub-reservoir based on the initialized echo state network according to the singular value decomposition method comprises:
随机生成一个对角矩阵以及两个正交矩阵Ui和Vi;其中,为随机生成的在(0,1)之间数值,nk为子储备池节点个数;Randomly generate a diagonal matrix And two orthogonal matrices U i and V i ; where, is a randomly generated value between (0,1), and n k is the number of nodes in the sub-reservation pool;
利用所述对角矩阵和两个所述正交矩阵构造子储备池ΔWi=UiSiVi。The sub-reservoir ΔW i =U i S i V i is constructed using the diagonal matrix and the two orthogonal matrices.
优选地,所述根据条件数和差分进化算法优化所述子储备池,包括:Preferably, the optimizing the sub-reserve pool according to the condition number and the differential evolution algorithm comprises:
构建适应度函数fitness(ΔWi)=κ(Hi)-κ(Hi-1);其中,κ(Hi)代表新的子储备池加入后,储备池对应的状态矩阵的条件数;Construct a fitness function fitness(ΔW i )=κ(H i )-κ(H i-1 ); where κ(H i ) represents the condition number of the state matrix corresponding to the reserve pool after the new sub-reserve pool is added;
初始化初始种群NP=50,变异算子F=0.7,交叉算子CR=0.5,并初始化种群其中n∈{1,2…,NP},并设置最大迭代次数G;Initialize the initial population NP = 50, mutation operator F = 0.7, crossover operator CR = 0.5, and initialize the population Where n∈{1,2…,NP}, and set the maximum number of iterations G;
根据公式得到变异个体μn;其中,r1,r2,r3∈[1,NP]为三个互不相同的整数;According to the formula Get the mutant individual μ n ; where r 1 , r 2 , r 3 ∈[1,NP] are three different integers;
通过完成交叉操作,对于每一个独立个体得到交叉个体其中,j∈{1,2…,10},rand∈(0,1)是随机生成的;pass Complete the crossover operation, for each independent individual Get crossover individuals Among them, j∈{1,2…,10}, rand∈(0,1) is randomly generated;
当算法达到最大迭代次数后,终止算法流程,返回最优个体,并利用所述最优个体构造新的子储备池。When the algorithm reaches the maximum number of iterations, the algorithm process is terminated, the optimal individual is returned, and a new sub-reserve pool is constructed using the optimal individual.
优选地,所述对优化后的所述子储备池的权值、输入权值和状态矩阵进行更新,并判断迭代次数是否小于预设迭代阈值,若是,则跳转至步骤“基于初始化后的回声状态网络,根据奇异值分解方法构造子储备池”;若是,则计算输出权值,包括:Preferably, the weights, input weights and state matrix of the optimized sub-reserve pool are updated, and it is determined whether the number of iterations is less than a preset iteration threshold. If so, the process jumps to the step of "constructing a sub-reserve pool based on the initialized echo state network according to a singular value decomposition method"; if so, the output weights are calculated, including:
将储备池权值更新为 Update the reserve pool weight to
将输入权值更新为 Update the input weights to
将状态矩阵更新为H=[H1,…,Hi];Update the state matrix to H = [H 1 ,…,H i ];
若满足i≥imax,则执行下一步骤,否则返回步骤“基于初始化后的回声状态网络,根据奇异值分解方法构造子储备池”;If i≥i max is satisfied, the next step is executed, otherwise the process returns to the step "constructing a sub-reservoir based on the initialized echo state network according to the singular value decomposition method";
通过公式Wout=HΓT计算输出权值Wout;其中,Γ代表伪逆计算,T为目标输出数据。The output weight W out is calculated by the formula W out =H Γ T, wherein Γ represents pseudo-inverse calculation, and T is the target output data.
根据本发明提供的具体实施例,本发明公开了以下技术效果:According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
本发明提供了一种基于神经网络的出水NH4-N软测量方法,包括:构建回声状态网络,并对所述回声状态网络的网络结构及网络参数进行初始化;所述回声状态网络的输入变量包括进水温度、总固体悬浮物、溶解氧浓度、pH值以及出水氧化还原电位;所述回声状态网络的输出变量包括氨氮浓度;基于初始化后的回声状态网络,根据奇异值分解方法构造子储备池;根据条件数和差分进化算法优化所述子储备池;对优化后的所述子储备池的权值、输入权值和状态矩阵进行更新,并判断迭代次数是否小于预设迭代阈值,若是,则跳转至步骤“基于初始化后的回声状态网络,根据奇异值分解方法构造子储备池”;若是,则计算输出权值;根据输出权值和测试样本对所述回声状态网络进行测试,得到确定好的出水NH4-N检测模型;将待检测数据输入至确定好的出水NH4-N检测模型中,得到检测结果。本发明为污水处理过程中关键水质参数的测量提供了一种高效快速的解决方案。The present invention provides a soft measurement method for effluent NH4-N based on a neural network, comprising: constructing an echo state network, and initializing the network structure and network parameters of the echo state network; the input variables of the echo state network include inlet water temperature, total suspended solids, dissolved oxygen concentration, pH value and effluent redox potential; the output variables of the echo state network include ammonia nitrogen concentration; based on the initialized echo state network, constructing a sub-reserve pool according to a singular value decomposition method; optimizing the sub-reserve pool according to a condition number and a differential evolution algorithm; updating the weights, input weights and state matrix of the optimized sub-reserve pool, and judging whether the number of iterations is less than a preset iteration threshold, if so, jumping to the step of "constructing a sub-reserve pool according to a singular value decomposition method based on the initialized echo state network"; if so, calculating the output weight; testing the echo state network according to the output weight and a test sample to obtain a determined effluent NH4-N detection model; inputting the data to be detected into the determined effluent NH4-N detection model to obtain a detection result. The present invention provides an efficient and rapid solution for measuring key water quality parameters in the sewage treatment process.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。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 labor.
图1为本发明实施例提供的方法流程图;FIG1 is a flow chart of a method provided by an embodiment of the present invention;
图2为本发明实施例提供的神经网络拓扑结构图;FIG2 is a topological structure diagram of a neural network provided by an embodiment of the present invention;
图3为本发明实施例提供的输出权值绝对值分布图;FIG3 is a distribution diagram of absolute values of output weights provided by an embodiment of the present invention;
图4为本发明实施例提供的出水NH4-N浓度预测结果图;FIG4 is a diagram showing the prediction results of effluent NH4-N concentration provided by an embodiment of the present invention;
图5为本发明实施例提供的出水NH4-N浓度预测误差图。FIG5 is a diagram showing an error in prediction of effluent NH4-N concentration according to an embodiment of the present invention.
具体实施方式DETAILED DESCRIPTION
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。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.
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
本申请的说明书和权利要求书及所述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤、过程、方法等没有限定于已列出的步骤,而是可选地还包括没有列出的步骤,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤元。The terms "first", "second", "third" and "fourth" in the specification and claims of the present application and the drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a series of steps, processes, methods, etc. are not limited to the listed steps, but may optionally include steps that are not listed, or may optionally include other step elements inherent to these processes, methods, products or devices.
本发明的目的是提供一种基于神经网络的出水NH4-N软测量方法,本发明能够为污水处理过程中关键水质参数的测量提供了一种高效快速的解决方案。The purpose of the present invention is to provide a soft measurement method for effluent NH4-N based on neural network, which can provide an efficient and fast solution for the measurement of key water quality parameters in the sewage treatment process.
为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。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.
图1为本发明实施例提供的方法流程图,如图1所示,本发明提供了一种基于神经网络的出水NH4-N软测量方法,包括:FIG1 is a flow chart of a method provided by an embodiment of the present invention. As shown in FIG1 , the present invention provides a soft measurement method for effluent NH4-N based on a neural network, comprising:
步骤100:构建回声状态网络,并对所述回声状态网络的网络结构及网络参数进行初始化;所述回声状态网络的输入变量包括进水温度、总固体悬浮物、溶解氧浓度、pH值以及出水氧化还原电位;所述回声状态网络的输出变量包括氨氮浓度;Step 100: construct an echo state network, and initialize the network structure and network parameters of the echo state network; the input variables of the echo state network include inlet water temperature, total suspended solids, dissolved oxygen concentration, pH value and outlet water redox potential; the output variables of the echo state network include ammonia nitrogen concentration;
步骤200:基于初始化后的回声状态网络,根据奇异值分解方法构造子储备池;Step 200: Based on the initialized echo state network, construct a sub-reservoir according to a singular value decomposition method;
步骤300:根据条件数和差分进化算法优化所述子储备池;Step 300: Optimizing the sub-reservoir according to the condition number and differential evolution algorithm;
步骤400:对优化后的所述子储备池的权值、输入权值和状态矩阵进行更新,并判断迭代次数是否小于预设迭代阈值,若是,则跳转至步骤“基于初始化后的回声状态网络,根据奇异值分解方法构造子储备池”;若是,则计算输出权值;Step 400: Update the weights, input weights and state matrix of the optimized sub-reservoir, and determine whether the number of iterations is less than a preset iteration threshold. If so, jump to the step of "constructing a sub-reservoir based on the initialized echo state network according to the singular value decomposition method"; if so, calculate the output weights;
步骤500:根据输出权值和测试样本对所述回声状态网络进行测试,得到确定好的出水NH4-N检测模型;Step 500: testing the echo state network according to the output weights and the test samples to obtain a determined outlet water NH4-N detection model;
步骤600:将待检测数据输入至确定好的出水NH4-N检测模型中,得到检测结果。Step 600: input the data to be detected into the determined effluent NH4-N detection model to obtain the detection result.
优选地,对所述回声状态网络的网络结构及网络参数进行初始化,包括:Preferably, initializing the network structure and network parameters of the echo state network includes:
确定所述回声状态网络的初始结构为5-N-1;其中N表示子储备池节点个数;N的大小是逐渐增加;Determine the initial structure of the echo state network as 5-N-1; wherein N represents the number of nodes in the sub-reservoir; and the size of N is gradually increased;
将sigmoid函数作为网络激活函数G(·),确定初始迭代次数i=1,最大迭代次数imax≤30,训练样本其中,uk表示第k组输入样本,tk表示第k组实际输出值,表示输入样本维度为n,L为样本总数;The sigmoid function is used as the network activation function G(·), the initial iteration number i=1, the maximum iteration number i max ≤30, and the training sample Among them, uk represents the kth group of input samples, tk represents the kth group of actual output values, Indicates that the input sample dimension is n, and L is the total number of samples;
随机初始化网络输入权值Win和储备池内部权值W在(0,1)之间。Randomly initialize the network input weights W in and the internal weights W of the reserve pool between (0,1).
具体的,本实施例中的基于CNEESN神经网络的出水NH4-N软测量方法,其网络是一个不断增长的网络,主要操作流程如下:首先生成一个小规模的储备池,并初始化相应的权值,然后根据条件数分析和差分进化算法优化利用通过奇异值分解(SVD)方法随机生成的奇异值,并利用优化过的奇异值构建新的子储备池,再将新的子储备池添加进网络,如图2所示。本实施例利用条件数分析和差分进化算法,使得每一个子储备池添加进网络后,网络的储备池条件数尽可能的小,从而训练得到一个较好的输出权值,然后对污水处理过程中的氨氮浓度进行预测。本实施例包括以下步骤:Specifically, the effluent NH4-N soft measurement method based on the CNEESN neural network in this embodiment is a continuously growing network, and the main operation process is as follows: first, a small-scale reserve pool is generated and the corresponding weights are initialized, and then the singular values randomly generated by the singular value decomposition (SVD) method are optimized according to the condition number analysis and differential evolution algorithm, and a new sub-reserve pool is constructed using the optimized singular values, and then the new sub-reserve pool is added to the network, as shown in Figure 2. This embodiment uses condition number analysis and differential evolution algorithms to make the condition number of the network's reserve pool as small as possible after each sub-reserve pool is added to the network, so as to train to obtain a better output weight, and then predict the ammonia nitrogen concentration in the sewage treatment process. This embodiment includes the following steps:
步骤1:初始化网络结构及参数Step 1: Initialize network structure and parameters
步骤1.1:初始化网络结构Step 1.1: Initialize the network structure
将进水温度、总固体悬浮物、溶解氧浓度、pH值以及出水氧化还原电位作为输入变量,氨氮浓度作为输出变量,确定回声状态网络初始结构为5-N-1,其中N表示子储备池节点个数。典型回声状态网络的储备池节点个数N取值为50≤N≤1000,但本方法所提出的模型是增长型模型,N的大小是逐渐增加的。该网络中初始N取10,即该网络含有5个输入节点,10个储备池节点,1个输出节点。Taking the inlet water temperature, total suspended solids, dissolved oxygen concentration, pH value and outlet redox potential as input variables and ammonia nitrogen concentration as output variable, the initial structure of the echo state network is determined to be 5-N-1, where N represents the number of sub-reservoir nodes. The number of reserve pool nodes N of a typical echo state network is 50≤N≤1000, but the model proposed by this method is a growth model, and the size of N gradually increases. The initial N in this network is 10, that is, the network contains 5 input nodes, 10 reserve pool nodes, and 1 output node.
步骤1.2:初始化网络参数Step 1.2: Initialize network parameters
将sigmoid函数作为网络激活函数G(·),确定初始迭代次数i=1,最大迭代次数imax≤30,训练样本uk表示第k组输入样本,tk表示第k组实际输出值,表示输入样本维度为n,L为样本总数;随机初始化网络输入权值Win和储备池内部权值W在(0,1)之间。The sigmoid function is used as the network activation function G(·), the initial iteration number i=1, the maximum iteration number i max ≤30, and the training sample u k represents the kth group of input samples, t k represents the kth group of actual output values, Indicates that the input sample dimension is n, L is the total number of samples; the network input weight W in and the internal weight W of the reserve pool are randomly initialized between (0,1).
优选地,所述基于初始化后的回声状态网络,根据奇异值分解方法构造子储备池,包括:Preferably, the constructing of the sub-reservoir based on the initialized echo state network according to the singular value decomposition method comprises:
随机生成一个对角矩阵以及两个正交矩阵Ui和Vi;其中,为随机生成的在(0,1)之间数值,nk为子储备池节点个数;Randomly generate a diagonal matrix And two orthogonal matrices U i and V i ; where, is a randomly generated value between (0,1), and n k is the number of nodes in the sub-reservation pool;
利用所述对角矩阵和两个所述正交矩阵构造子储备池ΔWi=UiSiVi。The sub-reservoir ΔW i =U i S i V i is constructed using the diagonal matrix and the two orthogonal matrices.
可选地,本实施例的步骤2为根据奇异值分解构造子储备池。本实施例随机生成一个对角矩阵以及两个正交矩阵Ui和Vi,利用三个矩阵可以构造子储备池ΔWi=UiSiVi。通过这种方法可以确保ΔWi和Si有相同的奇异值,从而保证ESP特性。Optionally,
优选地,所述根据条件数和差分进化算法优化所述子储备池,包括:Preferably, the optimizing the sub-reserve pool according to the condition number and the differential evolution algorithm comprises:
构建适应度函数fitness(ΔWi)=κ(Hi)-κ(Hi-1);其中,κ(Hi)代表新的子储备池加入后,储备池对应的状态矩阵的条件数;Construct a fitness function fitness(ΔW i )=κ(H i )-κ(H i-1 ); where κ(H i ) represents the condition number of the state matrix corresponding to the reserve pool after the new sub-reserve pool is added;
初始化初始种群NP=50,变异算子F=0.7,交叉算子CR=0.5,并初始化种群其中n∈{1,2…,NP},并设置最大迭代次数G;Initialize the initial population NP = 50, mutation operator F = 0.7, crossover operator CR = 0.5, and initialize the population Where n∈{1,2…,NP}, and set the maximum number of iterations G;
根据公式得到变异个体μn;其中,r1,r2,r3∈[1,NP]为三个互不相同的整数;According to the formula Get the mutant individual μ n ; where r 1 , r 2 , r 3 ∈[1,NP] are three different integers;
通过完成交叉操作,对于每一个独立个体得到交叉个体其中,j∈{1,2…,10},rand∈(0,1)是随机生成的;pass Complete the crossover operation, for each independent individual Get crossover individuals Among them, j∈{1,2…,10}, rand∈(0,1) is randomly generated;
当算法达到最大迭代次数后,终止算法流程,返回最优个体,并利用所述最优个体构造新的子储备池。When the algorithm reaches the maximum number of iterations, the algorithm process is terminated, the optimal individual is returned, and a new sub-reserve pool is constructed using the optimal individual.
具体的,本实施例中步骤3为根据条件数和差分进化算法优化子储备池,具体步骤如下:Specifically,
步骤3.1:设计适应度函数根据矩阵条件数的理论分析我们可知,条件数越大的矩阵,在进行矩阵的运算时越容易产生病态解的问题。因此本实施例设计适应度函数用来衡量新生成的子储备池的性能。具体计算方式如下:Step 3.1: Design fitness function According to the theoretical analysis of matrix condition number, we know that the larger the condition number of a matrix, the easier it is to produce ill-conditioned solutions when performing matrix operations. Therefore, this embodiment designs a fitness function to measure the performance of the newly generated sub-reserve pool. The specific calculation method is as follows:
fitness(ΔWi)=κ(Hi)-κ(Hi-1) (1)fitness(ΔW i )=κ(H i )-κ(H i-1 ) (1)
其中κ(Hi)代表新子储备池加入后,储备池对应的状态矩阵的条件数。Where κ(H i ) represents the condition number of the state matrix corresponding to the reserve pool after the new sub-reservoir is added.
步骤3.2:利用差分进化算法优化SVD产生的奇异值Step 3.2: Use differential evolution algorithm to optimize the singular values generated by SVD
初始化初始种群NP=50,变异算子F=0.7,交叉算子CR=0.5。初始化种群其中n∈{1,2…,NP},并设置最大迭代次数G。Initialize the initial population NP = 50, mutation operator F = 0.7, crossover operator CR = 0.5. Initialize the population Where n∈{1,2…,NP}, and the maximum number of iterations G is set.
通过公式(2)得到变异个体μn The mutant individual μ n is obtained by formula (2):
其中r1,r2,r3∈[1,NP]为三个互不相同的整数。Where r 1 , r 2 , r 3 ∈[1,NP] are three different integers.
通过公式(3)完成交叉操作,对于每一个独立个体σjn得到交叉个体γjnThe crossover operation is completed by formula (3), and for each independent individual σ j n, the crossover individual γ j n is obtained
其中,j∈{1,2…,10},rand∈(0,1)是随机生成的。Among them, j∈{1,2…,10}, rand∈(0,1) is randomly generated.
通过公式(4)完成选择操作The selection operation is completed by formula (4)
fitness(·)代表公式(1)中的适应度函数计算。fitness(·) represents the fitness function calculation in formula (1).
算法达到最大迭代次数后,终止算法流程,返回最优个体。该个体用来构造新的子储备池。After the algorithm reaches the maximum number of iterations, the algorithm process is terminated and the optimal individual is returned. This individual is used to construct a new sub-reserve pool.
优选地,所述对优化后的所述子储备池的权值、输入权值和状态矩阵进行更新,并判断迭代次数是否小于预设迭代阈值,若是,则跳转至步骤“基于初始化后的回声状态网络,根据奇异值分解方法构造子储备池”;若是,则计算输出权值,包括:Preferably, the weights, input weights and state matrix of the optimized sub-reserve pool are updated, and it is determined whether the number of iterations is less than a preset iteration threshold. If so, the process jumps to the step of "constructing a sub-reserve pool based on the initialized echo state network according to a singular value decomposition method"; if so, the output weights are calculated, including:
将储备池权值更新为 Update the reserve pool weight to
将输入权值更新为 Update the input weights to
将状态矩阵更新为H=[H1,…,Hi];Update the state matrix to H = [H 1 ,…,H i ];
若满足i≥imax,则执行下一步骤,否则返回步骤“基于初始化后的回声状态网络,根据奇异值分解方法构造子储备池”;If i≥i max is satisfied, the next step is executed, otherwise the process returns to the step "constructing a sub-reservoir based on the initialized echo state network according to the singular value decomposition method";
通过公式Wout=HΓT计算输出权值Wout;其中,Γ代表伪逆计算,T为目标输出数据。The output weight W out is calculated by the formula W out =H Γ T, wherein Γ represents pseudo-inverse calculation, and T is the target output data.
进一步地,本实施例中的步骤4为更新网络的结构及参数。本实施例将储备池权值更新为输入权值更新为状态矩阵更新为H=[H1,…,Hi]。Furthermore, step 4 in this embodiment is to update the structure and parameters of the network. In this embodiment, the weight of the reserve pool is updated to The input weights are updated to The state matrix is updated to H = [H 1 ,…,H i ].
若满足i≥imax,则执行步骤5,否则返回步骤2。If i≥i max is satisfied, execute
更进一步地,如图3所示,本实施例中的步骤5:计算输出权值。输出权值可通过公式(5)计算:Furthermore, as shown in FIG3 ,
Wout=HΓT(5)W out =H Γ T (5)
其中Γ代表伪逆计算,T为目标输出数据。Where Γ represents pseudo-inverse calculation and T is the target output data.
此外,本实施例的步骤6为测试网络,利用以上步骤得到的输出权值Wout,输入测试样本,对网络进行测试。本实施例将测试好的网络应用于出水NH4-N浓度的预测,其结果如和误差分别如图4和图5所示。In addition, step 6 of this embodiment is to test the network, using the output weight W out obtained in the above steps, input the test sample, and test the network. This embodiment applies the tested network to the prediction of effluent NH4-N concentration, and the results and errors are shown in Figures 4 and 5 respectively.
本实施例中的数据样本如下所示,其中表1-12是本发明实验数据。表1-5为训练输入样本:进水温度、好氧末段溶解氧、好氧末端总固体悬浮物、出水酸碱度pH、出水氧化还原电位,表6为训练样本出水氨氮的浓度,表7-11为测试输入样本:进水温度、好氧末段溶解氧、好氧末端总固体悬浮物、出水酸碱度pH、出水氧化还原电位,表12为测试样本出水氨氮的浓度。The data samples in this embodiment are as follows, where Tables 1-12 are experimental data of the present invention. Tables 1-5 are training input samples: inlet water temperature, dissolved oxygen at the end of aerobic stage, total suspended solids at the end of aerobic stage, pH value of effluent, and redox potential of effluent, Table 6 is the concentration of ammonia nitrogen in the effluent of the training sample, Tables 7-11 are test input samples: inlet water temperature, dissolved oxygen at the end of aerobic stage, total suspended solids at the end of aerobic stage, pH value of effluent, and redox potential of effluent, and Table 12 is the concentration of ammonia nitrogen in the effluent of the test sample.
表1辅助变量进水温度(℃)Table 1 Auxiliary variables Inlet water temperature (℃)
表2辅助变量溶解氧(mg/L)Table 2 Auxiliary variables dissolved oxygen (mg/L)
表3辅助变量总固体悬浮物(mg/L)Table 3 Auxiliary variables Total suspended solids (mg/L)
表4辅助变量pH值Table 4 Auxiliary variables pH value
表5辅助变量氧化还原电位Table 5 Auxiliary variables Redox potential
表6实测出水NH4-N浓度(mg/L)Table 6 Measured effluent NH4-N concentration (mg/L)
测试样本如下:The test samples are as follows:
表7辅助变量进水温度(℃)Table 7 Auxiliary variables Inlet water temperature (℃)
表8辅助变量溶解氧(mg/L)Table 8 Auxiliary variables Dissolved oxygen (mg/L)
表9辅助变量总固体悬浮物(mg/L)Table 9 Auxiliary variables Total suspended solids (mg/L)
表10辅助变量pH值Table 10 Auxiliary variable pH value
表11辅助变量氧化还原电位Table 11 Auxiliary variables Redox potential
表12实测出水NH4-N浓度(mg/L)Table 12 Measured effluent NH4-N concentration (mg/L)
本发明的有益效果如下:The beneficial effects of the present invention are as follows:
本发明发明将条件数分析与差分进化算法相结合来优化ESN网络结构,进而避免病态解问题,提高网络的鲁棒性,增加其抗干扰性能。The invention combines condition number analysis with a differential evolution algorithm to optimize the ESN network structure, thereby avoiding the problem of ill-conditioned solutions, improving the robustness of the network, and increasing its anti-interference performance.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处。综上所述,本说明书内容不应理解为对本发明的限制。This article uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only used to help understand the method and core ideas of the present invention. 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 (5)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310181946.1A CN116151121B (en) | 2023-02-21 | 2023-02-21 | A soft measurement method for effluent NH4-N based on neural network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310181946.1A CN116151121B (en) | 2023-02-21 | 2023-02-21 | A soft measurement method for effluent NH4-N based on neural network |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116151121A true CN116151121A (en) | 2023-05-23 |
CN116151121B CN116151121B (en) | 2024-03-26 |
Family
ID=86356179
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310181946.1A Active CN116151121B (en) | 2023-02-21 | 2023-02-21 | A soft measurement method for effluent NH4-N based on neural network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116151121B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104104629A (en) * | 2014-05-27 | 2014-10-15 | 温州大学 | Rapid signal detection method based on echo state network |
CN110837886A (en) * | 2019-10-28 | 2020-02-25 | 北京工业大学 | A Soft-Sensing Method for Effluent NH4-N Based on ELM-SL0 Neural Network |
CN115660165A (en) * | 2022-10-23 | 2023-01-31 | 北京工业大学 | A multi-step prediction method for effluent ammonia nitrogen concentration based on a modular neural network with double-layer PSO |
-
2023
- 2023-02-21 CN CN202310181946.1A patent/CN116151121B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104104629A (en) * | 2014-05-27 | 2014-10-15 | 温州大学 | Rapid signal detection method based on echo state network |
CN110837886A (en) * | 2019-10-28 | 2020-02-25 | 北京工业大学 | A Soft-Sensing Method for Effluent NH4-N Based on ELM-SL0 Neural Network |
CN115660165A (en) * | 2022-10-23 | 2023-01-31 | 北京工业大学 | A multi-step prediction method for effluent ammonia nitrogen concentration based on a modular neural network with double-layer PSO |
Non-Patent Citations (3)
Title |
---|
GE ZHAO 等: "An ammonia nitrogen concentration online soft measure method based on the neural network", 《PROCEEDINGS OF THE 36TH CHINESE CONTROL CONFERENCE》, pages 3994 - 3999 * |
乔俊飞 等: "改进K-means算法优化RBF神经网络的出水氨氮预测", 《控制工程》, vol. 25, no. 3, pages 375 - 379 * |
王磊: "回声状态网络优化设计及应用研究", 《中国博士学位论文全文数据库 信息科技辑》, no. 3, pages 140 - 16 * |
Also Published As
Publication number | Publication date |
---|---|
CN116151121B (en) | 2024-03-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10570024B2 (en) | Method for effluent total nitrogen-based on a recurrent self-organizing RBF neural network | |
CN102323906B (en) | A method for automatic generation of MC/DC test data based on genetic algorithm | |
CN114331788B (en) | An intelligent detection method for nitrogen content in effluent from urban sewage treatment process based on cascaded modular neural network | |
CN103336867A (en) | Proton exchange membrane fuel cell model optimizing process method | |
CN108595892A (en) | Soft-measuring modeling method based on time difference model | |
CN104573869A (en) | Optimization method and system for achieving dredging operations based on BP neural network and NSGA-II | |
CN112765902B (en) | A soft sensor modeling method for COD concentration in rural domestic sewage treatment process based on RBF neural network of TentFWA-GD | |
CN112989704A (en) | DE algorithm-based IRFM-CMNN effluent BOD concentration prediction method | |
CN111859807A (en) | Initial pressure optimizing method, device, equipment and storage medium for steam turbine | |
Yasmin et al. | Improved support vector machine using optimization techniques for an aerobic granular sludge | |
CN110991616B (en) | Method for predicting BOD of effluent based on pruning feedforward small-world neural network | |
CN115755589B (en) | An optimization method for reactor fuzzy control system based on genetic algorithm | |
CN116151121B (en) | A soft measurement method for effluent NH4-N based on neural network | |
CN113223633A (en) | Width GRNN model-based papermaking process drain water quality prediction method | |
CN106802983B (en) | Optimized BP neural network-based biogas yield modeling calculation method and device | |
CN104345636A (en) | Dissolved-oxygen control method based on improved differential algorithm | |
CN113537454B (en) | Soft sensing method of effluent ammonia nitrogen based on ADw-CLPSO radial basis function affective neural network | |
CN112924646A (en) | Effluent BOD soft measurement method based on self-adaptive pruning feedforward small-world neural network | |
CN110837886A (en) | A Soft-Sensing Method for Effluent NH4-N Based on ELM-SL0 Neural Network | |
CN112446168A (en) | Effluent BOD concentration soft measurement method based on MIC and RBFNN | |
CN115541837B (en) | Intelligent detection method for total nitrogen in effluent based on dynamic fuzzy neural network | |
CN114912543B (en) | An online compensation method for missing data in urban sewage treatment process based on autoencoder neural network | |
CN116307255A (en) | Water body eutrophication prediction method based on improved MIMO depth double 3Q learning | |
CN110909492A (en) | Sewage treatment process soft measurement method based on extreme gradient lifting algorithm | |
CN113065242B (en) | A soft sensing method for total nitrogen concentration in sewage treatment effluent based on KPLSR model |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |