Construction method and system of ammonia nitrogen concentration prediction model and ammonia nitrogen concentration prediction method and system

Through the combination of REMD and VMD with LSTM model, an ammonia nitrogen concentration prediction model was constructed, which solved the problems of high complexity of the existing ammonia nitrogen concentration prediction model and difficult to determine parameters, and achieved more accurate and reliable ammonia nitrogen concentration prediction.

CN118918986APending Publication Date: 2024-11-08CHINA JILIANG UNIV +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411055669.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-06-28
Filing Date
2024-08-02
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

The existing ammonia nitrogen concentration prediction model has high complexity, difficult to determine parameters, and has limitations in water applications, making it difficult to accurately predict ammonia nitrogen concentration.

Method used

Using robust empirical modal decomposition (REMD) and variational modal decomposition (VMD) combined with long and short-term memory network (LSTM) model, an ammonia nitrogen concentration prediction model is constructed through data decomposition and fuzzy entropy quantization, and a genetic algorithm is used to optimize VMD parameters. Improve decomposition effect.

Benefits of technology

It effectively reduces the complexity of ammonia nitrogen data, avoids noise interference, improves the accuracy and reliability of prediction, adapts to complex ammonia nitrogen sequence changes, and solves the problems of insufficient REMD decomposition and limitations in VMD parameter settings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118918986A_ABST
    Figure CN118918986A_ABST
Patent Text Reader

Abstract

The invention discloses an ammonia nitrogen concentration prediction model construction method and system and an ammonia nitrogen concentration prediction method and system.The construction method comprises the following steps that ammonia nitrogen concentration sample data are obtained, the ammonia nitrogen concentration sample data are decomposed through REMD, and a plurality of first modal components are obtained; calculating the fuzzy entropy of each first modal component, taking the first modal component with the maximum fuzzy entropy as a second modal component, and taking the rest first modal components as first training data; decomposing the second modal component by using VMD, and taking an obtained decomposition result as second training data; and training an LSTM (Long Short-Term Memory) network based on the first training data and the second training data to obtain an ammonia nitrogen concentration prediction model. According to the method, the problem that a single machine learning model cannot meet the precision requirement is solved in a mixed model mode, and the method can better adapt to a relatively complex NH3-N sequence change process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a method and system for constructing an ammonia nitrogen concentration prediction model, and a method and system for predicting ammonia nitrogen concentration based on the ammonia nitrogen concentration prediction model. Background Art

[0002] With the rapid development of social economy, people are facing increasingly serious water environment problems. The problem of blue algae blooms in eutrophic water bodies has increasingly attracted the attention of the public and academia. This problem not only poses a potential risk to aquatic plants and animals, but also disrupts drinking water supply and causes serious damage to surface water ecosystems. Ammonia nitrogen (NH 3 -N) is a key nutrient required for the growth of cyanobacteria. 3 -N concentrations can be used to assess the status of aquatic ecosystems. 3 Accurate prediction of -N concentration is of vital importance for carrying out water quality early warning decision-making activities and formulating sewage treatment standards.

[0003] Nowadays, NH is often studied based on mechanistic models of biochemical kinetics. 3 -N concentration, but the mechanism model requires a lot of data to establish and solve the water quality control equation, which makes the model more complex and the parameters difficult to determine, and has certain limitations in its application in water bodies. Summary of the invention

[0004] In view of the problems that the existing mechanism models are highly complex, parameters are difficult to determine, and there are certain limitations in the application of water bodies, the present invention provides a method for constructing an ammonia nitrogen concentration prediction model, and an ammonia nitrogen concentration prediction method based on the constructed ammonia nitrogen concentration prediction model.

[0005] In order to solve the above technical problems, the present invention is solved by the following technical solutions:

[0006] A method for constructing an ammonia nitrogen concentration prediction model comprises the following steps:

[0007] Acquire ammonia nitrogen concentration sample data, decompose the ammonia nitrogen concentration sample data by REMD (robust empirical mode decomposition), and obtain a plurality of first mode components;

[0008] Calculate the fuzzy entropy of each first modal component, take the first modal component with the largest fuzzy entropy as the second modal component, and take the remaining first modal components as the first training data;

[0009] Decomposing the second modal component by using VMD (variational mode decomposition), and using the decomposition result as the second training data;

[0010] The LSTM long short-term memory network is trained based on the first training data and the second training data to obtain an ammonia nitrogen concentration prediction model.

[0011] As an implementable method:

[0012] Perform several decompositions based on the ammonia nitrogen concentration sample data, perform several iterative extractions based on the corresponding initial signal in each decomposition, until a preset completion condition is met, obtain the corresponding first modal component, and update the initial signal based on the first modal component; use the ammonia nitrogen concentration sample data as the initial signal during the initial decomposition;

[0013] The completion condition includes a first condition and a second condition, and the corresponding decomposition step is determined to be completed when the first condition or the second condition is met;

[0014] The first condition is that the number of iterations reaches a preset iteration number threshold;

[0015] The second condition is {|N zp -N ep |≤1}&{(f k >f k-1 )&(f k-1 >f k-2 )};

[0016] in:

[0017] N zp Indicates zero point;

[0018] N ep Indicates extreme points;

[0019] k represents the number of iterations corresponding to the current iteration step;

[0020] f represents the corresponding stop judgment parameter;

[0021] The method for obtaining the stop judgment parameters corresponding to the current iteration step is:

[0022] In the current iteration step, the signal component corresponding to the current decomposition step is obtained; in the current decomposition step, the corresponding initial signal is extracted once through iteration to obtain a signal component;

[0023] Obtaining the root mean square corresponding to the signal component;

[0024] Obtaining the excess kurtosis corresponding to the signal component;

[0025] A stop determination parameter corresponding to the current iteration step is generated based on the root mean square and the excess kurtosis.

[0026] As an implementable method:

[0027] The specific steps of iterative extraction are:

[0028] Acquire a first signal to be processed, and use the corresponding initial signal as the first signal to be processed when performing iterative processing for the first time;

[0029] Calculating a mean envelope corresponding to the first signal to be processed;

[0030] Generate a second signal to be processed based on the mean envelope and the first signal to be processed, wherein the second signal to be processed is the first signal to be processed corresponding to the next iteration step;

[0031] Taking the mean envelope as the signal component corresponding to the current iteration step, calculating the corresponding stop judgment parameter;

[0032] Determine whether the first condition is met;

[0033] When the first condition is met, it is determined that the current decomposition step is completed, and the second signal to be processed is used as the decomposed first modal component;

[0034] When the first condition is not met, determining whether the second condition is met;

[0035] When the second condition is met, it is determined that the current decomposition step is completed, and the first signal to be processed adopted in the previous iteration step is used as the first modal component to be decomposed.

[0036] As an implementable method:

[0037] After the current decomposition step is completed, the initial signal used in the current decomposition step is updated based on the obtained first modal component;

[0038] When the updated initial signal is monotonic or constant, the REMD decomposition is determined to be complete, otherwise it proceeds to the next decomposition step and performs several iterative extractions based on the updated initial signal to obtain the corresponding first modal component.

[0039] As an implementable method:

[0040] The VMD decomposes the second modal component based on the decomposition number and the penalty factor to obtain a plurality of third modal components corresponding to the decomposition number, and uses each third modal component as second training data;

[0041] Parameter optimization is performed on VMD based on the GA algorithm to obtain the decomposition number and the penalty factor.

[0042] As an implementable method:

[0043] Create a chromosome population, configure the VMD parameters corresponding to the number of decompositions and penalty factors as population iteration parameters;

[0044] Iterative optimization is performed based on the chromosome population, corresponding candidate combination parameters are obtained in each iterative process, and the obtained candidate combination parameters are made to enter a local minimum value, until the number of iterative optimization reaches a preset iterative optimization number threshold, and the candidate combination parameters corresponding to the minimum value are selected from the local minimum value as the optimal combination parameters;

[0045] The iterative optimization process includes the following steps:

[0046] Get the chromosome population corresponding to the current iterative optimization. The first iterative optimization uses the constructed chromosome population.

[0047] Decomposing the chromosome population by using VMD algorithm to obtain several population modal components;

[0048] Calculate the envelope entropy values ​​of various group modal components, construct candidate combination parameters and enter the local minimum based on the number of decompositions and penalty factors corresponding to the minimum value of the envelope entropy value;

[0049] A crossover and mutation operation is performed on the chromosome population, and the updated chromosome population is used for the next iterative optimization.

[0050] As an implementable method:

[0051] Acquire original monitoring data, and perform data preprocessing on the original monitoring data to obtain ammonia nitrogen concentration sample data;

[0052] The data preprocessing comprises the following steps:

[0053] Forward interpolation method is used to fill missing data;

[0054] Use the 3σ principle to identify and process outliers;

[0055] The corresponding data are normalized using maximum and minimum value normalization.

[0056] The present invention also proposes a system for constructing an ammonia nitrogen concentration prediction model, comprising:

[0057] A first decomposition module is used to obtain ammonia nitrogen concentration sample data, and decompose the ammonia nitrogen concentration sample data through REMD to obtain a plurality of first modal components;

[0058] A fuzzy entropy calculation module is used to calculate the fuzzy entropy of each first modal component, take the first modal component with the largest fuzzy entropy as the second modal component, and take the remaining first modal components as the first training data;

[0059] A second decomposition module, used for decomposing the second modal component by using VMD, and using the decomposition result as second training data;

[0060] A training module is used to train an LSTM long short-term memory network based on the first training data and the second training data to obtain an ammonia nitrogen concentration prediction model.

[0061] The present invention also proposes a method for predicting ammonia nitrogen concentration, comprising the following steps:

[0062] Obtain target ammonia nitrogen concentration data, decompose the ammonia nitrogen concentration sample data through REMD to obtain a plurality of modal components, and use the obtained modal components as first candidate components;

[0063] Calculate the fuzzy entropy of each first candidate component, take the first candidate component with the largest fuzzy entropy as the second candidate component, and take the remaining first candidate components as the first target data;

[0064] Decomposing the second candidate component row by using VMD, and using the decomposition result as the second target data;

[0065] The first target data and the second target data are input into an ammonia nitrogen concentration prediction model constructed by any of the above-mentioned construction methods, and the ammonia nitrogen concentration prediction model outputs corresponding prediction values, and generates corresponding concentration prediction results based on the prediction values.

[0066] The present invention also provides an ammonia nitrogen concentration prediction system, comprising:

[0067] A first decomposition unit is used to obtain target ammonia nitrogen concentration data, decompose the ammonia nitrogen concentration sample data through REMD, obtain a plurality of modal components, and use the obtained modal components as first candidate components;

[0068] A fuzzy entropy calculation unit, used to calculate the fuzzy entropy of each first candidate component, take the first candidate component with the largest fuzzy entropy as the second candidate component, and take the remaining first candidate components as the first target data;

[0069] A second decomposition unit, configured to decompose the second candidate component by using VMD, and use the decomposition result as the second target data;

[0070] A prediction unit is used to input the first target data and the second target data into an ammonia nitrogen concentration prediction model constructed by any of the above-mentioned construction methods, and the ammonia nitrogen concentration prediction model outputs corresponding prediction values, and generates corresponding concentration prediction results based on the prediction values.

[0071] The present invention has significant technical effects due to the adoption of the above technical solution:

[0072] The present invention proposes a prediction method based on the combination of data decomposition technology and machine learning model;

[0073] The use of robust empirical mode decomposition (REMD) can adapt well to the high complexity and irregularity of ammonia nitrogen data, effectively avoid the influence of noise interference and outliers, and obtain more accurate and reliable reconstructed signals.

[0074] The LSTM neural network model with long-term memory function can retain important features in the data while forgetting non-critical information, which can avoid the problems of gradient disappearance and gradient explosion in the training process.

[0075] In order to solve the problem of insufficient REMD decomposition, fuzzy entropy (FE) is used to quantify the modal components after ammonia nitrogen decomposition, and the modal component with the largest fuzzy entropy value is decomposed twice, which can better adapt to the more complex NH3-N sequence change process. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] 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 or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0077] Figure 1 It is a schematic flow chart of a method for constructing an ammonia nitrogen concentration prediction model of the present invention;

[0078] Figure 2 is a schematic diagram of a process for decomposing ammonia nitrogen concentration sample data using REMD in Example 1;

[0079] Figure 3 This is a schematic diagram of the basic unit structure of LSTM. DETAILED DESCRIPTION

[0080] The present invention is further described in detail below in conjunction with embodiments. The following embodiments are for explanation of the present invention but the present invention is not limited to the following embodiments.

[0081] Example 1 A method for constructing an ammonia nitrogen concentration prediction model, such as Figure 1 As shown, the following steps are included:

[0082] S100, obtaining ammonia nitrogen concentration sample data, and decomposing the ammonia nitrogen concentration sample data through REMD to obtain a plurality of first modal components.

[0083] The original monitoring data is obtained, and data preprocessing is performed on the original monitoring data to obtain ammonia nitrogen concentration sample data. In this embodiment, the ammonia nitrogen concentration sample data is the ammonia nitrogen concentration time series obtained after preprocessing.

[0084] The data preprocessing comprises the following steps:

[0085] Forward interpolation method is used to fill missing data;

[0086] Use the 3σ principle to identify and process outliers;

[0087] The corresponding data are normalized using maximum and minimum value normalization.

[0088] In this embodiment, the specific steps of decomposing the ammonia nitrogen concentration sample data by REMD are:

[0089] Performing several decompositions based on the ammonia nitrogen concentration sample data;

[0090] Each decomposition is performed based on the corresponding initial signal for several iterative extractions until a preset completion condition is met, a corresponding first modal component is obtained, and the initial signal is updated based on the first modal component. During the initial decomposition, the ammonia nitrogen concentration sample data is used as the initial signal;

[0091] That is, the entire decomposition process includes several decomposition steps, and each decomposition step contains several iteration steps.

[0092] The objective function f(k) of the REMD algorithm is constructed in advance, and the result obtained based on the objective function f(k) is recorded as f k , represents the corresponding stop judgment parameter, which is used to determine whether to stop the iteration;

[0093] The expression of the objective function f(k) is:

[0094] f(k))=e RMS +E k

[0095]

[0096]

[0097] in:

[0098] k means that the current step is the kth iteration in the corresponding decomposition step;

[0099] N s It represents the total number of signal components obtained in the kth iteration of the corresponding decomposition step. In the current decomposition step, one signal component is obtained for each iterative extraction;

[0100] n represents the signal length;

[0101] g k [n] represents the nth signal component obtained by k iterations of the corresponding initial signal;

[0102] eRMS Indicates g k The root mean square of [n];

[0103] E k Indicates g k The excess kurtosis of [n];

[0104] Indicates g k The average value of [n].

[0105] Based on the above objective function, a completion condition is configured. In this embodiment, the completion condition includes a first condition and a second condition. When the first condition or the second condition is met, it is determined that the corresponding decomposition step is completed.

[0106] The first condition is that the number of iterations reaches a preset iteration number threshold;

[0107] The second condition is {|N zp -N ep |≤1}&{(f k >f k-1 )&(f k-1 >f k-2 )};

[0108] in:

[0109] N zp Indicates zero point;

[0110] N ep Indicates extreme points;

[0111] k represents the number of iterations corresponding to the current iteration step;

[0112] f represents the corresponding stop judgment parameter;

[0113] Reference Figure 2 , the process of using REMD to decompose the ammonia nitrogen concentration sample data is as follows:

[0114] A100, obtain the initial signal G corresponding to the current decomposition step j (n);

[0115] j represents the current decomposition step, and the corresponding initial signal is recorded as G j (n);

[0116] When j=1, the original data x[n] is used as the initial signal, and the original data x[n] is the ammonia nitrogen concentration sample data.

[0117] A200, the initial signal G j (n) Perform iterative screening until the completion condition is met and obtain the corresponding modal component R IMFj .

[0118] A300, the modal component R obtained in the current decomposition step IMFj As the jth modal component that meets the conditions, that is, the jth first modal component, denoted by E j (R IMF ).

[0119] A400. Update the initial signal based on the obtained first modal component.

[0120] Let j = j + 1;

[0121] An update to obtain the initial signal G j The method of [n] is:

[0122]

[0123] That is, the first modal components obtained by decomposition are subtracted from the original data x[n] to obtain the corresponding updated initial signal for use in the next decomposition step.

[0124] Another update to obtain the initial signal G j The method of [n] is:

[0125] G j [n] = G j-1 [n]-E j-1 (R IMF );

[0126] G j-1 [n]

[0127] That is, the initial signal G used in the current decomposition step j-1 [n] minus the first modal component E obtained in the current decomposition step j-1 (R IMF ), and obtain the initial signal G to be used in the next decomposition step j [n].

[0128] A500. Determine whether to end the decomposition.

[0129] When the updated initial signal G j If [n] is monotonic or a constant, the decomposition is terminated; otherwise, the decomposition is continued.

[0130] When it is determined to continue decomposition, enter the next decomposition step and use the initial signal G j [n] Perform iterative screening.

[0131] When it is determined that the decomposition is finished, the decomposition is finished and the initial signal G j [n] as the residual S RS , the signal that cannot be decomposed is defined as the residual error (RS).

[0132] At this time, the original signal can be reconstructed as:

[0133]

[0134] in:

[0135] J represents the total number of modal component functions.

[0136] The specific process of iterative screening in the above step A200 includes the following steps:

[0137] B100, obtaining the first signal to be processed corresponding to the current iteration step;

[0138] In the iterative process, k represents the number of screening implementations and the number of iterations.

[0139] When performing the first iteration, let k = 0, and the corresponding initial signal G j (n) as the first signal to be processed h k [n].

[0140] B200, calculating the first signal to be processed h k [n] corresponds to the mean envelope m k [n];

[0141] Based on the first signal to be processed h k [n] Calculate the corresponding upper envelope g max [n] and lower envelope g min [n]; to obtain

[0142] Based on the upper envelope g max [n] and lower envelope g min [n] Get the mean envelope m k [n];

[0143]

[0144] Note: Figure 2 In this embodiment, the mean envelope m is obtained. k [n] then set k=k+1.

[0145] B300, based on the obtained mean envelope m k-1 [n] and the first signal to be processed h used k-1 [n] Generate the second signal to be processed h k [n];

[0146] h k [n] = h k-1 [n]-m k-1 [n];

[0147] That is, the first signal to be processed h used in this iteration step k-1 [n] and its mean envelope m k-1 [n] is subtracted to obtain the corresponding second signal to be processed h k [n], the second signal to be processed is a candidate signal of the modal component.

[0148] The second signal to be processed h k [n] is the first signal to be processed corresponding to the next iteration step;

[0149] B400, taking the mean envelope as the signal component corresponding to the current iteration step, and calculating the corresponding stop judgment parameter;

[0150] B500, determine whether the first condition is met;

[0151] When the first condition is met (k>I max , k is the number of iterations, I max is the iteration number threshold, which can be set to 30 for example) to determine that the current decomposition step is completed, and the second signal to be processed h k [n] as the first modal component R IMFj .

[0152] B600, when the first condition is not met, determining whether the second condition is met;

[0153] Second condition: {|N zp -N ep |≤1}&{(f k >f k-1 )&(f k-1 >f k-2 )};

[0154] When the second condition is met, the current decomposition step is determined to be completed, and the first signal to be processed h used in the previous iteration step is k-2 [n] as the first modal component R IMFj .

[0155] The current iteration step is the kth step, and the second signal to be processed obtained in the current iteration step is h k [n], the first signal to be processed used in the current iteration step is the second signal to be processed obtained in the previous iteration step h k-1 [n], the first signal to be processed used in the previous iteration step is the second signal to be processed obtained in the k-2th step is h k-2 [n].

[0156] When the second condition is not met, the next iteration step is entered and the second signal to be processed is h k[n] is taken as the first signal to be processed and iterative screening is performed again.

[0157] Common decomposition algorithms include wavelet decomposition (WPD), empirical mode decomposition (EMD), integrated empirical mode decomposition (EEMD), etc. Zhang Haobin et al. established a multi-scale modal combination prediction model, using EMD to decompose ammonia nitrogen concentration into modal components of different characteristic scales. Ren Yongqin et al. proposed an ammonia nitrogen concentration prediction model based on CEEMDAN and BiGRU neural networks. However, these decomposition techniques often have the phenomenon of modal aliasing and false components. This embodiment makes up for the shortcomings of modal aliasing when decomposing signals in the original EMD, EEMD, and CEEMD methods by improving the screening stop criterion of robust empirical mode decomposition (REMD).

[0158] S200, calculating the fuzzy entropy of each first modal component, taking the first modal component with the largest fuzzy entropy as the second modal component, and taking the remaining first modal components as first training data;

[0159] Fuzzy entropy FE is an important indicator to measure the complexity of time series. Different from sample entropy, fuzzy entropy introduces fuzzy membership function on the basis of sample entropy, making it more adaptable to nonlinear and unstable time series and more robust.

[0160] This embodiment uses fuzzy entropy FE to quantize each first modal component, and the specific steps are:

[0161] S210, reconstructing the first modal component;

[0162] Assume that the first modal component is a time series X with a length of N, and the reconstructed expression is as follows:

[0163]

[0164]

[0165] in:

[0166] represents the reconstructed time series;

[0167] m represents the dimension.

[0168] S220, through the fuzzy function Definition and Similarity

[0169] The calculation formula is:

[0170]

[0171] in:

[0172] Represents the distance between two time series;

[0173] r represents the similarity tolerance.

[0174] S230, define function ψ m (n, r) is as follows:

[0175]

[0176] S240. For a finite time series, the fuzzy entropy is defined as:

[0177] FE(m,n,r,N)=lnψ m (n,r)-lnψ m+1 (n, r).

[0178] S300, decomposing the second modal component by using VMD, and using the decomposition result as second training data;

[0179] Fuzzy entropy is used to quantify the complexity of the sequence after REMD decomposition. The larger the fuzzy entropy value, the more complex the fluctuation characteristics of the sequence;

[0180] This embodiment uses VMD to decompose the first modal component with the highest entropy. VMD is a new adaptive non-recursive signal decomposition method. It decomposes the original data into O center frequencies ω. o The modal components with limited bandwidth can effectively extract the information at different frequencies of the original data.

[0181] The specific steps of the VMD method are as follows:

[0182] S311. Construct a variational problem.

[0183]

[0184] in:

[0185] f(t) represents the original data to be decomposed, that is, the second modal component;

[0186] u o represents the decomposed modal components;

[0187] * indicates the convolution operator;

[0188] ω o Represents the center frequency of each modal component;

[0189] represents the partial derivative with respect to time.

[0190] S312. Solve variational problems.

[0191] First, the Lagrange multiplication operator λ and the penalty factor α are introduced to transform the constrained model into an unconstrained variational model:

[0192]

[0193] In order to obtain the optimal value of the constrained variational model, the alternating direction multiplier iteration algorithm is used to cyclically update u o and ω o ,u o and ω o The expression and termination condition are:

[0194]

[0195] in:

[0196] λ is the Lagrange multiplication operator;

[0197] α is the quadratic penalty factor;

[0198] f(ω) is the Fourier transform of f(t);

[0199] for The Fourier transform of

[0200] λ n (ε) is l n (t) The Fourier transform of

[0201] n is the number of iterations of the alternating direction multiplier iteration algorithm;

[0202] N is the maximum number of iterations of the alternating direction multiplier iterative algorithm.

[0203] S320, Variational mode decomposition improved by genetic algorithm;

[0204] S321. Optimize the parameters of VMD based on the GA algorithm to obtain the optimal combination of decomposition number and penalty factor.

[0205] The decomposition results of VMD are different when the number of decompositions and the size of the penalty factor are set differently. If it is too large, the decomposition bandwidth will be too small and the original signal will be over-decomposed. If it is too small, the bandwidth decomposition will be too large, resulting in signal loss. Manually determining the parameters is too subjective to achieve the best decomposition effect. In order to overcome the limitations of manual setting of VMD parameters, this embodiment proposes an adaptive VMD decomposition algorithm, which uses GA to optimize VMD.

[0206] The steps of genetic algorithm optimization of VMD algorithm are as follows:

[0207] Create a chromosome population, configure the VMD parameters corresponding to the number of decompositions and penalty factors as population iteration parameters;

[0208] Iterative optimization is performed based on the chromosome population, corresponding candidate combination parameters are obtained in each iterative process, and the obtained candidate combination parameters are made to enter a local minimum value, until the number of iterative optimization reaches a preset iterative optimization number threshold, and the candidate combination parameters corresponding to the minimum value are selected from the local minimum value as the optimal combination parameters;

[0209] The iterative optimization process includes the following steps:

[0210] Get the chromosome population corresponding to the current iterative optimization. The first iterative optimization uses the constructed chromosome population.

[0211] Decomposing the chromosome population by using VMD algorithm to obtain several population modal components;

[0212] Calculate the envelope entropy values ​​of various group modal components, construct candidate combination parameters and enter the local minimum based on the number of decompositions and penalty factors corresponding to the minimum value of the envelope entropy value;

[0213] A crossover and mutation operation is performed on the chromosome population, and the updated chromosome population is used for the next iterative optimization.

[0214] S322, the VMD decomposes the second modal component based on the number of decompositions obtained by optimization and the penalty factor, obtains a plurality of third modal components corresponding to the number of decompositions, and uses each third modal component as second training data.

[0215] In order to further improve the prediction accuracy, VMD is used to decompose the first modal component with the largest fuzzy entropy, thereby solving the problem of insufficient REMD decomposition and better adapting to the more complex NH3-N sequence change process.

[0216] Variational mode decomposition (VMD) has a good decomposition effect, but the number of decompositions and the penalty factor need to be set manually. The current selection of VMD parameters and usually adopts the center frequency observation method. This method is subjective and limited and cannot achieve the best decomposition effect. This embodiment uses a genetic algorithm GA to optimize the VMD algorithm. GA can globally optimize the two parameters of VMD decomposition number and penalty factor, and can also avoid human setting errors. It has the advantages of strong versatility, high search frequency, and strong global optimization ability.

[0217] S400: Train an LSTM long short-term memory network using the first training data and the second training data to obtain an ammonia nitrogen concentration prediction model.

[0218] As a special type of recurrent neural network, the Long Short-Term Memory Network has the function of long-term memory. It can retain important features in the data while forgetting non-critical information. It is not prone to gradient vanishing and gradient exploding problems during training and is widely used in time series prediction.

[0219] The basic unit structure of LSTM is as follows Figure 3 As shown in Figure 1, it contains three gates, namely the input gate, output gate and forget gate, which are used to control information input, output and forgetting respectively. Taking the unit state at time t as an example, the input gate i t , output gate o t and forget gate f t The operation process is:

[0220] i t =σ(W i ·[h t-1 , x t ]+b i )

[0221] o t =σ(W o ·[h t-1 , x t ]+b o )

[0222] f t =σ(W f ·[h t-1 , x t ]+b f )

[0223] in:

[0224] x t represents the input at time t; W i represents the updateable weight matrix of the input gate, W o represents the updateable weight matrix of the output gate, W f represents the updateable weight matrix of the forget gate; b i represents the bias of the input gate, b o The bias of the output gate, b f Bias of forget gate; h t-1 represents the output of the network at time t-1; σ(·) represents the sigmoid activation function.

[0225]

[0226] h t =o t ·tanh(c t )

[0227] in:

[0228] c t Indicates cell status update; W c Represents the cell state updateable weight matrix; tanh represents the hyperbolic tangent activation function; represents the candidate memory unit, c t It also represents a memory unit; h t-1 is the output at the previous moment, h t is the output at the current moment, X t Represents the input at the current moment.

[0229] This embodiment adopts an LSTM neural network model with long-term memory function, which can retain important features in the data while forgetting non-critical information to solve the problem that a single WNN, BP, and SVM neural networks do not have the ability to capture long-term dependencies, and can avoid the problems of gradient disappearance and gradient explosion during the training process. Finally, a mixed ammonia nitrogen concentration prediction model of robust empirical mode decomposition (REMD), fuzzy entropy (FE), genetic algorithm improved variational mode decomposition (GA-VMD), and long short-term memory network (LSTM) is constructed.

[0230] In summary, the present invention uses REMD to decompose the original NH 3 -N sequence is decomposed into several first modal components to reduce data complexity, which can well adapt to the high complexity and irregularity of ammonia nitrogen data, effectively avoid noise interference and the influence of outliers, obtain more accurate and reliable reconstructed signals, and solve the problem that the screening stop criterion in the EMD decomposition process may lead to different decomposition effects of different data sets by using the preset threshold method. Fuzzy entropy is used to quantify the complexity of each first modal component, and the high-complexity first modal component is decomposed again to better adapt to the more complex ammonia nitrogen sequence change process. An improved VMD adaptive decomposition method based on GA is also proposed to effectively solve the limitations of artificially set VMD parameters, while improving its robustness to noise and interference, making its decomposition results more accurate. The prediction network adopts LSTM network, which has a good ability to capture long-distance dependencies and has a strong memory capacity. It can better capture the high complexity and irregularity of ammonia nitrogen data, effectively utilize the information in time series data, and improve the accuracy and reliability of prediction.

[0231] Embodiment 2: A system for constructing an ammonia nitrogen concentration prediction model, comprising:

[0232] A first decomposition module is used to obtain ammonia nitrogen concentration sample data, and decompose the ammonia nitrogen concentration sample data through REMD to obtain a plurality of first modal components;

[0233] A fuzzy entropy calculation module is used to calculate the fuzzy entropy of each first modal component, take the first modal component with the largest fuzzy entropy as the second modal component, and take the remaining first modal components as the first training data;

[0234] A second decomposition module, used for decomposing the second modal component by using VMD, and using the decomposition result as second training data;

[0235] A training module is used to train an LSTM long short-term memory network based on the first training data and the second training data to obtain an ammonia nitrogen concentration prediction model.

[0236] Embodiment 3, a method for predicting ammonia nitrogen concentration, comprising the following steps:

[0237] Obtain target ammonia nitrogen concentration data, decompose the ammonia nitrogen concentration sample data through REMD to obtain a plurality of modal components, and use the obtained modal components as first candidate components;

[0238] Calculate the fuzzy entropy of each first candidate component, take the first candidate component with the largest fuzzy entropy as the second candidate component, and take the remaining first candidate components as the first target data;

[0239] Decomposing the second candidate component row by using VMD, and using the decomposition result as the second target data;

[0240] The first target data and the second target data are input into the ammonia nitrogen concentration prediction model constructed by the construction method described in Example 1, and the ammonia nitrogen concentration prediction model outputs corresponding prediction values, and generates corresponding concentration prediction results based on the prediction values.

[0241] In this embodiment, the target ammonia nitrogen concentration data also undergoes data preprocessing including maximum and minimum normalization, so it is necessary to accumulate the corresponding predicted values ​​output by the ammonia nitrogen concentration prediction model and perform denormalization on the accumulated values ​​to obtain the corresponding concentration prediction results.

[0242] The processing steps of the target ammonia nitrogen concentration data in the proposed ammonia nitrogen concentration prediction method in this embodiment are the same as the processing steps of the ammonia nitrogen concentration sample data in Example 1, so they will not be repeated in this specification.

[0243] Embodiment 4: An ammonia nitrogen concentration prediction system, comprising:

[0244] A first decomposition unit is used to obtain target ammonia nitrogen concentration data, decompose the ammonia nitrogen concentration sample data through REMD, obtain a plurality of modal components, and use the obtained modal components as first candidate components;

[0245] A fuzzy entropy calculation unit, used to calculate the fuzzy entropy of each first candidate component, take the first candidate component with the largest fuzzy entropy as the second candidate component, and take the remaining first candidate components as the first target data;

[0246] A second decomposition unit, configured to decompose the second candidate component by using VMD, and use the decomposition result as the second target data;

[0247] A prediction unit is used to input the first target data and the second target data into the ammonia nitrogen concentration prediction model constructed by the construction method described in Example 1, and the ammonia nitrogen concentration prediction model outputs corresponding prediction values, and generates corresponding concentration prediction results based on the prediction values.

[0248] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0249] 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.

[0250] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0251] The present invention is described with reference to the flowcharts and / or block diagrams of the method, terminal device (system), and computer program product according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0252] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0253] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable terminal device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0254] It should be noted that:

[0255] The "one embodiment" or "embodiment" mentioned in the specification means that the specific features, structures or characteristics described in conjunction with the embodiment are included in at least one embodiment of the present invention. Therefore, the phrases "one embodiment" or "embodiment" appearing in various places throughout the specification do not necessarily refer to the same embodiment.

[0256] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0257] In addition, it should be noted that the shapes and names of the parts and components of the specific embodiments described in this specification may be different. Any equivalent or simple changes made based on the structure, features and principles described in the patent concept of the present invention are included in the protection scope of the patent of the present invention. The technicians in the technical field of the present invention can make various modifications or supplements to the specific embodiments described or replace them in a similar manner, as long as they do not deviate from the structure of the present invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.

Claims

1. A method for constructing an ammonia nitrogen concentration prediction model, It is characterized in that The following steps are involved: Acquire ammonia nitrogen concentration sample data, and decompose the ammonia nitrogen concentration sample data through REMD to obtain a plurality of first modal components; Calculate the fuzzy entropy of each first modal component, take the first modal component with the largest fuzzy entropy as the second modal component, and take the remaining first modal components as the first training data; Decomposing the second modal component by using VMD, and using the decomposition result as second training data; The LSTM long short-term memory network is trained based on the first training data and the second training data to obtain an ammonia nitrogen concentration prediction model.

2. The method for constructing an ammonia nitrogen concentration prediction model according to claim 1, Features: Perform several decompositions based on the ammonia nitrogen concentration sample data, perform several iterative extractions based on the corresponding initial signal for each decomposition, until a preset completion condition is met, obtain the corresponding first modal component, and update the initial signal based on the first modal component; During the initial decomposition, the ammonia nitrogen concentration sample data is used as an initial signal; The completion condition includes a first condition and a second condition, and the corresponding decomposition step is determined to be completed when the first condition or the second condition is met; The first condition is that the number of iterations reaches a preset iteration number threshold; The second condition is {|N zp -N ep |≤1}&{(f k >f k-1 )&(f k-1 >f k-2 )}; in: N zp Indicates zero point; N ep Indicates extreme points; k represents the number of iterations corresponding to the current iteration step; f represents the corresponding stop judgment parameter; The method for obtaining the stop judgment parameters corresponding to the current iteration step is: In the current iteration step, the signal component corresponding to the current decomposition step is obtained; in the current decomposition step, the corresponding initial signal is extracted once through iteration to obtain a signal component; Obtaining the root mean square corresponding to the signal component; Obtaining the excess kurtosis corresponding to the signal component; A stop determination parameter corresponding to the current iteration step is generated based on the root mean square and the excess kurtosis.

3. The method for constructing an ammonia nitrogen concentration prediction model according to claim 2, Features: The specific steps of iterative extraction are: Acquire a first signal to be processed, and use the corresponding initial signal as the first signal to be processed when performing iterative processing for the first time; Calculating a mean envelope corresponding to the first signal to be processed; Generate a second signal to be processed based on the mean envelope and the first signal to be processed, wherein the second signal to be processed is the first signal to be processed corresponding to the next iteration step; Taking the mean envelope as the signal component corresponding to the current iteration step, calculating the corresponding stop judgment parameter; Determine whether the first condition is met; When the first condition is met, it is determined that the current decomposition step is completed, and the second signal to be processed is used as the decomposed first modal component; When the first condition is not met, determining whether the second condition is met; When the second condition is met, it is determined that the current decomposition step is completed, and the first signal to be processed adopted in the previous iteration step is used as the first modal component to be decomposed.

4. The method for constructing the ammonia nitrogen concentration prediction model according to claim 2 or 3, Features: After the current decomposition step is completed, the initial signal used in the current decomposition step is updated based on the obtained first modal component; When the updated initial signal is monotonic or constant, the REMD decomposition is determined to be complete, otherwise it proceeds to the next decomposition step and performs several iterative extractions based on the updated initial signal to obtain the corresponding first modal component.

5. The method for constructing an ammonia nitrogen concentration prediction model according to claim 1, Features: The VMD decomposes the second modal component based on the decomposition number and the penalty factor to obtain a plurality of third modal components corresponding to the decomposition number, and uses each third modal component as second training data; Parameter optimization is performed on VMD based on the GA algorithm to obtain the decomposition number and the penalty factor.

6. The method for constructing the ammonia nitrogen concentration prediction model according to claim 5, Features: Create a chromosome population, configure the VMD parameters corresponding to the number of decompositions and penalty factors as population iteration parameters; Iterative optimization is performed based on the chromosome population, corresponding candidate combination parameters are obtained in each iterative process, and the obtained candidate combination parameters are made to enter a local minimum value, until the number of iterative optimization reaches a preset iterative optimization number threshold, and the candidate combination parameters corresponding to the minimum value are selected from the local minimum value as the optimal combination parameters; The iterative optimization process includes the following steps: Get the chromosome population corresponding to the current iterative optimization. The first iterative optimization uses the constructed chromosome population. Decomposing the chromosome population by using VMD algorithm to obtain several population modal components; Calculate the envelope entropy values ​​of various group modal components, construct candidate combination parameters and enter the local minimum based on the number of decompositions and penalty factors corresponding to the minimum value of the envelope entropy value; A crossover and mutation operation is performed on the chromosome population, and the updated chromosome population is used for the next iterative optimization.

7. The method for constructing an ammonia nitrogen concentration prediction model according to claim 1, Features: Acquire original monitoring data, and perform data preprocessing on the original monitoring data to obtain ammonia nitrogen concentration sample data; The data preprocessing comprises the following steps: Forward interpolation method is used to fill missing data; Use the 3σ principle to identify and process outliers; The corresponding data are normalized using maximum and minimum value normalization.

8. A system for constructing an ammonia nitrogen concentration prediction model, It is characterized in that include: A first decomposition module is used to obtain ammonia nitrogen concentration sample data, and decompose the ammonia nitrogen concentration sample data through REMD to obtain a plurality of first modal components; A fuzzy entropy calculation module is used to calculate the fuzzy entropy of each first modal component, take the first modal component with the largest fuzzy entropy as the second modal component, and take the remaining first modal components as the first training data; A second decomposition module, used for decomposing the second modal component by using VMD, and using the decomposition result as second training data; A training module is used to train an LSTM long short-term memory network based on the first training data and the second training data to obtain an ammonia nitrogen concentration prediction model.

9. A method for predicting ammonia nitrogen concentration, It is characterized in that The following steps are involved: Obtain target ammonia nitrogen concentration data, decompose the ammonia nitrogen concentration sample data by REMD to obtain a plurality of modal components, and use the obtained modal components as first candidate components; Calculate the fuzzy entropy of each first candidate component, take the first candidate component with the largest fuzzy entropy as the second candidate component, and take the remaining first candidate components as the first target data; Decomposing the second candidate component row by using VMD, and using the decomposition result as the second target data; The first target data and the second target data are input into an ammonia nitrogen concentration prediction model constructed by any one of the construction methods of claims 1 to 7, and the ammonia nitrogen concentration prediction model outputs corresponding prediction values, and generates corresponding concentration prediction results based on the prediction values.

10. An ammonia nitrogen concentration prediction system, It is characterized in that include: A first decomposition unit is used to obtain target ammonia nitrogen concentration data, decompose the ammonia nitrogen concentration sample data through REMD, obtain a plurality of modal components, and use the obtained modal components as first candidate components; A fuzzy entropy calculation unit, used to calculate the fuzzy entropy of each first candidate component, take the first candidate component with the largest fuzzy entropy as the second candidate component, and take the remaining first candidate components as the first target data; A second decomposition unit, configured to decompose the second candidate component by using VMD, and use the decomposition result as the second target data; A prediction unit is used to input the first target data and the second target data into an ammonia nitrogen concentration prediction model constructed by any one of the construction methods of claims 1 to 7, and the ammonia nitrogen concentration prediction model outputs corresponding prediction values, and generates corresponding concentration prediction results based on the prediction values.

Citation Information

Cited By

  • Dissolved oxygen prediction method and device based on secondary decomposition and LSTM fusion

    CN119129943A

  • Method and device for regulating and controlling effluent concentration of sewage treatment plant, electronic equipment and medium

    CN120010571A