Memory, biochemical oxygen demand soft measurement method, system and device
By adjusting the number of hidden layer neurons in the RBF neural network according to the input layer variables and the minimum error value, the problem of unstable accuracy of the biochemical oxygen demand soft measurement model in the existing technology when the working conditions change is solved, and a more accurate solution is achieved. High accuracy and stability of measurement results.
Patent Information
- Application Number
- CN202010413762.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-15
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2040-05-15
AI Technical Summary
The prediction model used for soft measurement of biochemical oxygen demand in the prior art cannot adapt when working conditions change, resulting in insufficient accuracy of measurement results.
In the biochemical oxygen demand soft measurement model of the RBF neural network, the initial number of neurons in the hidden layer is determined based on the input layer variables in each PCA calculation and the error minimum in the previous calculation to achieve adaptive adjustment of the model. .
It improves the accuracy and stability of the measurement results of the biochemical oxygen demand soft measurement model when working conditions change, and avoids the negative impact of working condition changes on the measurement results.
Smart Images

Figure CN113673143B
Abstract
Description
Technical Field
[0001] The invention relates to the field of sewage treatment, and in particular to a storage device, a biochemical oxygen demand soft measurement method, a system and a device. Background Art
[0002] Biochemical Oxygen Demand (BOD) is an important water quality indicator in the sewage treatment process and an important monitoring indicator in the sewage treatment process.
[0003] The level of BOD can reflect the extent to which organic matter in the water can be degraded by the biochemical action of microorganisms. Therefore, real-time monitoring of BOD is an important means for sewage treatment.
[0004] In the prior art, the prediction model used for soft measurement of biochemical oxygen demand is generally aimed at the problem of the constant number of input variables under stable working conditions, and then the prediction model is adjusted in real time according to the computing power of each neuron, and the current value of biochemical oxygen demand can be estimated through the measurement model.
[0005] After research, the inventors found that the measurement model for biochemical oxygen demand soft measurement constructed according to the prior art cannot adapt to application scenarios with changing working conditions in actual applications, and the accuracy of the generated measurement results is not stable enough and is prone to deviations.
[0006] The information disclosed in this background technology section is only intended to enhance the understanding of the overall background of the invention and should not be regarded as an acknowledgment or any form of suggestion that the information constitutes the prior art already known to a person skilled in the art. Summary of the invention
[0007] The purpose of the present invention is to make the measurement results generated by the measurement model of biochemical oxygen demand soft measurement more accurate and stable in the application scenario where the actual working conditions change.
[0008] The present invention provides a biochemical oxygen demand soft measurement method. When establishing a biochemical oxygen demand BOD soft measurement model based on an RBF neural network, the initial number of neurons in the hidden layer during each PCA calculation is determined, comprising the steps of:
[0009] S11, obtaining the input layer variables corresponding to the BOD soft sensor model during each PCA calculation;
[0010] S12, determining the number of hidden layer neurons corresponding to the minimum error value after the BOD soft-sensing model prediction calculation during the last PCA calculation as the reference hidden layer neuron number;
[0011] S13. Taking the benchmark hidden layer neuron number as a benchmark, the initial number of neurons in the hidden layer of this PCA calculation is determined according to the comparison result between the number of input layer variables of this PCA calculation and the number of input layer variables of the last PCA calculation.
[0012] In the present invention, the step of obtaining the input layer variables required by the BOD soft sensor model for each PCA calculation includes:
[0013] Obtain the initial data of various variables in advance based on the sample data collected by various instruments;
[0014] Normalizing the initial data by a zero-mean normalization method to generate sample set data of various variables;
[0015] The matrix A=[a1, a2, ..., a p ], and obtain the covariance S of the matrix A, and decompose the matrix A into a principal component score matrix R;
[0016] The cumulative variance contribution rate during this PCA calculation is calculated, and the variables whose cumulative variance contribution rate is greater than the preset threshold are determined as the input layer variables obtained in this PCA calculation.
[0017] In the present invention, the initial data is normalized by a zero mean normalization method to generate sample set data of various variables, including:
[0018]
[0019] Among them, i is the number of samples, j is the sample weight, and a ij is the jth component of the i-th sample, a j is the mean of the jth component sample, s jj For variable a j The standard deviation of , p is the number of sample components.
[0020] In the present invention, the calculation of the cumulative variance contribution rate during the PCA calculation includes:
[0021] Calculate the cumulative variance contribution of the t-th PCA calculation:
[0022]
[0023] Among them, i is the number of samples, j is the sample weight, and a i is the i-th sample value, is the mean of the jth component sample, η is the cumulative variance contribution rate, q is the number of neurons in the input layer, p is the number of sample components, η m is the preset threshold for the cumulative variance contribution rate;
[0024] Select q vectors from the principal component score matrix R as the input of the RBF neural network, and determine the input layer variables obtained by the tth PCA calculation.
[0025] In the present invention, the expression of the BOD soft sensor model is:
[0026]
[0027] Among them, w(k) is the connection weight between the hidden layer and the output layer; θ(k) is the output of the hidden layer neuron; θ m (k) is the output of the mth hidden layer neuron; w m (k) is the connection weight between the mth hidden layer neuron and the output neuron; M(t) is the initial number of neurons in the hidden layer after the tth PCA calculation, y t (k) is the predicted value at time k after the t-th PCA calculation;
[0028] The hidden layer contains M(t) neurons, and the output expression of each hidden layer neuron is:
[0029]
[0030] u(k)=[u1(k),u2(k),...,u q(t) (k)] Formula (5);
[0031] c(k)=[c1(k),c2(k),...,c M(t) (k)] Formula (6);
[0032] σ(k)=[σ1(k),σ2(k),...,σ M(t) (k)] Formula (7);
[0033] Among them, c m (k) is the center vector of the mth neuron, σ m (k) is the width of the mth neuron, u m (k) is the input layer vector of the mth hidden layer neuron.
[0034] In the present invention, the initial number of neurons in the hidden layer of the current PCA calculation is determined based on the comparison result between the number of input layer variables of the current PCA calculation and the number of input layer variables of the previous PCA calculation, which is based on the reference number of neurons in the hidden layer, including:
[0035] According to formula (8), the initial number of neurons in the hidden layer during PCA calculation is calculated;
[0036]
[0037] Among them, q(t-1) is the number of input layer neurons after the t-1th PCA calculation, q(t) is the number of input layer neurons after the tth PCA calculation, and M best (t-1) is the number of hidden layer neurons corresponding to the minimum value of the operation error after the t-1th BOD model prediction calculation.
[0038] In the present invention, it includes:
[0039] The training and learning of the BOD soft sensor model includes:
[0040] The error of RBF neural network after the t-th PCA calculation is e t (k) The expression is:
[0041]
[0042] Among them, q is the number of neurons in the input layer, y td (k) is the expected output of the RBF neural network at time k after the t-th PCA calculation, y t (k) is the actual output of the RBF neural network at time k after the t-th PCA calculation;
[0043] The BOD soft sensor model is trained and learned using the gradient descent algorithm. d is the ideal error, when e t (k) <e d Stop adjusting when
[0044] In another aspect of the present invention, a biochemical oxygen demand soft measurement device is provided. When establishing a biochemical oxygen demand BOD soft measurement model based on an RBF neural network, the initial number of neurons in the hidden layer during each PCA calculation is determined, including:
[0045] The variable determination unit is used to obtain the input layer variables corresponding to the BOD soft sensor model during each PCA calculation;
[0046] A benchmark determination unit is used to determine the number of hidden layer neurons corresponding to the minimum error value after the BOD soft sensor model prediction calculation in the last PCA calculation as the benchmark hidden layer neuron number;
[0047] The neuron number determination unit is used to determine the initial number of neurons in the hidden layer of this PCA calculation based on the benchmark hidden layer neuron number and the comparison result between the number of input layer variables of this PCA calculation and the number of input layer variables of the last PCA calculation.
[0048] In the present invention, the expression of the BOD soft sensor model is:
[0049]
[0050] Among them, w(k) is the connection weight between the hidden layer and the output layer; θ(k) is the output of the hidden layer neuron; θ m (k) is the output of the mth hidden layer neuron; w m (k) is the connection weight between the mth hidden layer neuron and the output neuron; M(t) is the initial number of neurons in the hidden layer after the tth PCA calculation, y t (k) is the predicted value at time k after the t-th PCA calculation;
[0051] The hidden layer contains M(t) neurons, and the output expression of each hidden layer neuron is:
[0052]
[0053] u(k)=[u1(k),u2(k),...,u q(t) (k)] Formula (5);
[0054] c(k)=[c1(k),c2(k),...,c M(t) (k)] Formula (6);
[0055] σ(k)=[σ1(k),σ2(k),...,σ M(t) (k)] Formula (7);
[0056] Among them, c m (k) is the center vector of the mth neuron, σ m (k) is the width of the mth neuron, u m (k) is the input layer vector of the mth hidden layer neuron.
[0057] In the present invention, the neuron number determination unit comprises:
[0058] According to formula (8), the initial number of neurons in the hidden layer during PCA calculation is calculated;
[0059]
[0060] Among them, q(t-1) is the number of input layer neurons after the t-1th PCA calculation, q(t) is the number of input layer neurons after the tth PCA calculation, and M best (t-1) is the number of hidden layer neurons corresponding to the minimum value of the operation error after the t-1th BOD model prediction calculation.
[0061] In another aspect of the present invention, a memory is provided, comprising a software program, wherein the software program is suitable for a processor to execute the steps of the above-mentioned biochemical oxygen demand soft-sensing method.
[0062] Another aspect of the embodiment of the present invention further provides a biochemical oxygen demand soft measurement device, which includes a computer program stored in a memory, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the methods described in the above aspects and achieves the same technical effects.
[0063] Compared with the prior art, the present invention has the following beneficial effects:
[0064] The present invention first determines the input layer variables corresponding to the BOD soft measurement model after each PCA calculation, and then when the working conditions change, determines the initial number of neurons in the hidden layer during the current PCA calculation according to the number of neurons in the hidden layer corresponding to the minimum error value after the BOD soft measurement model prediction calculation during the last PCA calculation and the number of input layer variables corresponding to the BOD soft measurement model during the last PCA calculation; in this way, the BOD soft measurement model can adaptively adjust the corresponding input layer variables and the initial number of neurons in the hidden layer according to different working conditions; avoids the influence of the actual input layer variable changes due to the changes in working conditions, and further improves the accuracy and stability of the measurement results generated by the BOD soft measurement model.
[0065] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention and implement it according to the contents of the specification, and to make the above and other purposes, technical features and advantages of the present invention easier to understand, one or more preferred embodiments are listed below and described in detail with the accompanying drawings as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 is a step diagram of the biochemical oxygen demand soft measurement method of the present invention;
[0067] Figure 2 It is a schematic diagram of the change in the number of neurons in the hidden layer during the training process of the BOD soft sensor model in the present invention;
[0068] Figure 3 It is a schematic diagram of the RMSE curve diagram of the BOD soft sensor model in the present invention;
[0069] Figure 4 It is a structural schematic diagram of the biochemical oxygen demand soft measurement device of the present invention;
[0070] Figure 5 It is a structural schematic diagram of the biochemical oxygen demand soft measurement device described in the present invention. DETAILED DESCRIPTION
[0071] The specific implementation modes of the present invention are described in detail below in conjunction with the accompanying drawings, but it should be understood that the protection scope of the present invention is not limited by the specific implementation modes.
[0072] Unless explicitly stated otherwise, throughout the specification and claims, the term “comprise” or variations such as “include” or “comprising”, etc., will be understood to include the stated elements or components but not to exclude other elements or components.
[0073] In this document, the terms "first", "second", etc. are used to distinguish two different elements or parts, and are not used to limit a specific position or relative relationship. In other words, in some embodiments, the terms "first", "second", etc. can also be interchangeable.
[0074] Embodiment 1
[0075] In order to make the measurement model of BOD soft sensor more accurate and stable in practical application, Figure 1 As shown, in an embodiment of the present invention, a biochemical oxygen demand soft measurement method is provided. When establishing a biochemical oxygen demand BOD soft measurement model based on an RBF neural network, the initial number of neurons in the hidden layer is determined each time the PCA is calculated, including the steps of:
[0076] S11, obtaining the input layer variables corresponding to the BOD soft sensor model during each PCA calculation;
[0077] The application scenario of the embodiment of the present invention is to achieve real-time prediction of biochemical oxygen demand by establishing a biochemical oxygen demand (BOD) soft-sensing model based on RBF neural network.
[0078] After research, the inventors found that the reason why the prediction model in the prior art has the problem of unstable measurement accuracy is largely due to the fact that in practical applications, under different working conditions, the actual input layer variables of the prediction model will change. At this time, if the prediction model cannot be adaptively adjusted according to the current working conditions, the prediction results will deviate, thereby affecting the accuracy of its soft measurement results.
[0079] Based on the above cognition, in the embodiment of the present invention, it is necessary to obtain the input layer variables corresponding to the BOD soft sensor model during each PCA calculation, so that the BOD soft sensor model can always obtain the input layer variables corresponding to it;
[0080] In practical applications, the specific method of obtaining the input layer variables corresponding to the BOD soft sensor model during each PCA calculation can be:
[0081] S101, obtaining initial data of various variables in advance based on sample data collected by various instruments;
[0082] In the embodiment of the present invention, it can be set that the sample data collected by various instruments already include initial data of various variables under various working conditions.
[0083] Table 1 shows an example including 9 kinds of sample data;
[0084] Table 1:
[0085] Sample number name unit Collection location MLSS mg / l Biochemical pool inlet and outlet BOD mg / l Biochemical pool import COD mg / l Biochemical pool import SV % Biochemical pool pH Biochemical pool import Oils mg / l Biochemical pool inlet and outlet Ammonia nitrogen mg / l Biochemical pool import Total Phosphorus mg / l Biochemical pool import Total Nitrogen mg / l Biochemical pool import
[0086] In Table 1, the variables to be collected include mixed liquor suspended solids concentration (MLSS), sludge settling ratio (SV), BOD, chemical oxygen demand (COD), oil, ammonia nitrogen, total phosphorus, total nitrogen and temperature.
[0087] In practical applications, 200 groups of sample data can be selected from all sample data as training samples and 160 groups as test samples. The RBF neural network is learned using the gradient descent algorithm, the expected root mean square error (RMSE) is set to 0.05, and the maximum number of iterations is set to 500. The experiment is run independently 20 times, and the test RMSE is calculated to evaluate the model performance.
[0088] S102, normalizing the initial data by a zero mean normalization method to generate sample set data of various variables; specifically, the method may include:
[0089] In the sewage treatment process, due to the point setting of process parameters and the difference in parameters, the sample set data is quite different. Therefore, it is necessary to normalize the initial data through the zero-mean standardization method to generate sample set data of various variables. Specifically, it can be achieved according to formula (1).
[0090]
[0091] Among them, i is the number of samples, j is the sample weight, and a ij is the jth component of the ith sample, is the mean of the jth component sample, s jj For variable a j The standard deviation of , p is the number of sample components.
[0092] S103, generating a matrix A=[a1, a2, ..., a p ], and obtain the covariance S of the matrix A, and decompose the matrix A into a principal component score matrix R;
[0093] S104, calculating the cumulative variance contribution rate during the current PCA calculation, and determining the variables whose cumulative variance contribution rate is greater than a preset threshold as the input layer variables obtained by the current PCA calculation.
[0094] In practical applications, the calculation of the cumulative variance contribution rate of each PCA calculation can be achieved through formula (2):
[0095] Calculate the cumulative variance contribution of the t-th PCA calculation:
[0096]
[0097] Among them, i is the number of samples, j is the sample weight, and a i is the i-th sample value, is the mean of the jth component sample, η is the cumulative variance contribution rate, q is the number of neurons in the input layer, p is the number of sample components, η m is the preset threshold for the cumulative variance contribution rate;
[0098] Select q vectors from the principal component score matrix R as the input of the RBF neural network, and determine the input layer variables obtained by the tth PCA calculation.
[0099] Still taking the 9 types of sample data shown in Table 1 as an example, assuming that in operating condition 1, the cumulative variance contribution rate η>0.92 of the 9 initial input variables calculated by a certain PCA is used as an indicator, and finally the number of variables obtained after the first PCA calculation is selected as 6 (including: inlet MLSS, SV, inlet oil, inlet COD, effluent ammonia nitrogen and effluent total phosphorus).
[0100] In condition 2, another PCA calculation was used to calculate the cumulative variance contribution rate of the 9 initial input variables η>0.92 as an indicator, and the number of variables obtained after the second PCA calculation was finally selected as 5 (including: inlet MLSS, SV, inlet COD, effluent ammonia nitrogen and effluent total phosphorus).
[0101] It can be seen from the above that when the preset threshold of the cumulative variance contribution rate is set to η>0.92, different input layer variables are determined under working conditions one and two, respectively.
[0102] S12, determining the number of hidden layer neurons corresponding to the minimum error value after the BOD soft-sensing model prediction calculation during the last PCA calculation as the reference hidden layer neuron number;
[0103] For each PCA calculation, it is necessary to determine the number of hidden layer neurons corresponding to the minimum error value after the BOD soft sensor model prediction calculation in the last PCA calculation, and then determine the number of hidden layer neurons as the benchmark hidden layer neuron number.
[0104] S13. Taking the benchmark hidden layer neuron number as a benchmark, the initial number of neurons in the hidden layer of this PCA calculation is determined according to the comparison result between the number of input layer variables of this PCA calculation and the number of input layer variables of the last PCA calculation.
[0105] Specifically, when the number of input layer variables of this PCA calculation is greater than that of the previous PCA calculation, the number of hidden layer neurons of this PCA calculation is set to be greater than the benchmark number of hidden layer neurons; when the number of input layer variables of this PCA calculation is equal to that of the previous PCA calculation, the initial number of hidden layer neurons of this PCA calculation is equal to the benchmark number of hidden layer neurons; when the number of input layer variables of this PCA calculation is less than that of the previous PCA calculation, the initial number of hidden layer neurons of this PCA calculation is set to be less than the benchmark number of hidden layer neurons.
[0106] The core inventive idea of the embodiment of the present invention includes: taking the number of hidden layer neurons corresponding to the minimum error value after the BOD soft sensor model predicts the calculation during the last PCA calculation as the optimal number of hidden layer neurons at that time, and obtaining the corresponding number of input layer variables;
[0107] Then, based on this, we can determine whether the number of input layer variables in this PCA calculation is to be increased, decreased, or unchanged. Then, we can increase, decrease, or keep unchanged the initial number of neurons in the hidden layer in this PCA calculation. Specifically, the number can be:
[0108] The expression of the BOD soft sensor model is:
[0109]
[0110] Among them, w(k) is the connection weight between the hidden layer and the output layer; θ(k) is the output of the hidden layer neuron; θ m (k) is the output of the mth hidden layer neuron; w m (k) is the connection weight between the mth hidden layer neuron and the output neuron; M(t) is the initial number of neurons in the hidden layer after the tth PCA calculation, y t (k) is the predicted value at time k after the t-th PCA calculation;
[0111] The hidden layer contains M(t) neurons, and the output expression of each hidden layer neuron is:
[0112]
[0113] u(k)=[u1(k),u2(k),...,u q(t) (k)] Formula (5);
[0114] c(k)=[c1(k),c2(k),...,c M(t) (k)] Formula (6);
[0115] σ(k)=[σ1(k),σ2(k),...,σ M(t) (k)] Formula (7);
[0116] Among them, c m (k) is the center vector of the mth neuron, σ m (k) is the width of the mth neuron, u m (k) is the input layer vector of the mth hidden layer neuron.
[0117] Next, the initial number of neurons in the hidden layer during PCA calculation is calculated according to formula (8);
[0118]
[0119] Among them, q(t-1) is the number of input layer neurons after the t-1th PCA calculation, q(t) is the number of input layer neurons after the tth PCA calculation, and M best (t-1) is the number of hidden layer neurons corresponding to the minimum value of the operation error after the t-1th BOD model prediction calculation.
[0120] To summarize, the embodiment of the present invention first determines the input layer variables corresponding to the BOD soft measurement model according to the current working conditions during each PCA calculation, and then determines the initial number of neurons in the hidden layer during this PCA calculation according to the number of hidden layer neurons corresponding to the minimum error after the BOD soft measurement model predicted calculation during the last PCA calculation and the input layer variables corresponding to the BOD soft measurement model during the last PCA calculation; in this way, the BOD soft measurement model can adaptively adjust the corresponding input layer variables and the initial number of neurons in the hidden layer according to different working conditions; thereby avoiding the impact of changes in the actual input layer variables due to changes in working conditions, thereby improving the accuracy and stability of the measurement results generated by the BOD measurement model.
[0121] Embodiment 2
[0122] Based on the first embodiment, the specific methods of training and learning the BOD soft sensor model in the embodiment of the present invention may include:
[0123] The error of RBF neural network after the t-th PCA calculation is e t (k) The expression is:
[0124]
[0125] Among them, q is the number of neurons in the input layer, ytd (k) is the expected output of the RBF neural network at time k after the t-th PCA calculation, y t (k) is the actual output of the RBF neural network at time k after the t-th PCA calculation;
[0126] The BOD soft sensor model is trained and learned using the gradient descent algorithm. d is the ideal error, when e t (k) <e d Stop adjusting when
[0127] Under the conditions of working condition 1 and working condition 2, the test data of the variable input BOD soft sensor model based on the adaptive RBF neural network are shown in Table 2 and Table 3 respectively;
[0128] Table 2:
[0129]
[0130]
[0131] Table 3:
[0132]
[0133] It can be seen from Table 2 and Table 3 that when the prediction model changes from working condition 1 to working condition 2, the BOD soft sensing model in the BOD soft sensing method of the present invention can adjust the number of initial hidden layer neurons in real time according to the number of input variables, thereby obtaining a higher model prediction accuracy.
[0134] In an example of implementing the technical solution in the embodiment of the present invention, the change in the number of neurons in the hidden layer during the training of the BOD soft sensor model is as follows: Figure 2 As shown in the figure, the RMSE curve of the BOD soft sensor model is as follows: Figure 3 As shown, the error fluctuation range is between [0.2, 0.38]. It can be seen that the output of the BOD soft sensor model in the embodiment of the present invention fits the test sample well.
[0135] Embodiment 3
[0136] In another aspect of the embodiment of the present invention, a biochemical oxygen demand soft measurement device is also provided. Figure 4 The schematic diagram of the structure of the biochemical oxygen demand soft measurement device provided by the embodiment of the present invention is shown. Figures 1 to 3 The device corresponding to the biochemical oxygen demand soft measurement method described in the corresponding embodiment, that is, the device is implemented by means of a virtual device. Figures 1 to 3In any corresponding embodiment of the biochemical oxygen demand soft measurement method, each virtual module constituting the biochemical oxygen demand soft measurement device can be executed by an electronic device, such as a network device, a terminal device, or a server. Specifically, the biochemical oxygen demand soft measurement device in the embodiment of the present invention includes:
[0137] When establishing the BOD soft-sensing model based on RBF neural network, the initial number of neurons in the hidden layer is determined for each PCA calculation, including:
[0138] The variable determination unit 01 is used to obtain the input layer variables corresponding to the BOD soft sensor model during each PCA calculation;
[0139] The benchmark determination unit 02 is used to determine the number of hidden layer neurons corresponding to the minimum error value after the BOD soft sensor model prediction calculation in the last PCA calculation as the benchmark hidden layer neuron number;
[0140] The neuron number determination unit 03 is used to determine the initial number of neurons in the hidden layer of this PCA calculation based on the reference number of neurons in the hidden layer and the comparison result of the number of input layer variables in this PCA calculation with the number of input layer variables in the last PCA calculation.
[0141] In practical applications, when the number of input layer variables of this PCA calculation is greater than that of the previous PCA calculation, the number of hidden layer neurons of this PCA calculation is set to be greater than the benchmark number of hidden layer neurons; when the number of input layer variables of this PCA calculation is equal to that of the previous PCA calculation, the initial number of hidden layer neurons of this PCA calculation is equal to the benchmark number of hidden layer neurons; when the number of input layer variables of this PCA calculation is less than that of the previous PCA calculation, the initial number of hidden layer neurons of this PCA calculation is set to be less than the benchmark number of hidden layer neurons.
[0142] Preferably, in an embodiment of the present invention, the expression of the BOD soft sensor model is:
[0143]
[0144] Among them, w(k) is the connection weight between the hidden layer and the output layer; θ(k) is the output of the hidden layer neuron; θm(k) is the output of the mth hidden layer neuron; w m (k) is the connection weight between the mth hidden layer neuron and the output neuron; M(t) is the initial number of neurons in the hidden layer after the tth PCA calculation, y t (k) is the predicted value at time k after the t-th PCA calculation;
[0145] The hidden layer contains M(t) neurons, and the output expression of each hidden layer neuron is:
[0146]
[0147] u(k)=[u1(k),u2(k),...,u q(t) (k)] Formula (5);
[0148] c(k)=[c1(k),c2(k),...,c M(t) (k)] Formula (6);
[0149] σ(k)=[σ1(k),σ2(k),...,σ M(t) (k)] Formula (7);
[0150] Among them, c m (k) is the center vector of the mth neuron, σ m (k) is the width of the mth neuron, u m (k) is the input layer vector of the mth hidden layer neuron.
[0151] Preferably, in an embodiment of the present invention, the neuron number determination unit includes:
[0152] According to formula (8), the initial number of neurons in the hidden layer during PCA calculation is calculated;
[0153]
[0154] Among them, q(t-1) is the number of input layer neurons after the t-1th PCA calculation, q(t) is the number of input layer neurons after the tth PCA calculation, and M best (t-1) is the number of hidden layer neurons corresponding to the minimum value of the operation error after the t-1th BOD model prediction calculation.
[0155] Since the working principle and beneficial effects of the biochemical oxygen demand soft measurement device in the embodiment of the present invention have been Figure 1 The corresponding biochemical oxygen demand soft measurement method is also recorded and explained, so they can be cross-referenced and will not be repeated here.
[0156] Embodiment 4
[0157] In an embodiment of the present invention, a memory is further provided, wherein the memory includes a software program, and the software program is suitable for the processor to execute Figure 1 The corresponding steps in the biochemical oxygen demand soft measurement method.
[0158] The embodiments of the present invention can be implemented by means of a software program, that is, by writing a program for implementing Figure 1The corresponding software program (and instruction set) for each step in the biochemical oxygen demand soft measurement method is stored in a storage device, which is arranged in a computer device, so that the processor of the computer device can call the software program to achieve the purpose of the embodiment of the present invention.
[0159] Embodiment 5
[0160] In an embodiment of the present invention, a biochemical oxygen demand soft measurement device is further provided. The memory included in the biochemical oxygen demand soft measurement device includes a corresponding computer program product. When the program instructions included in the computer program product are executed by a computer, the computer can execute the biochemical oxygen demand soft measurement method described in the above aspects and achieve the same technical effect.
[0161] Figure 5 FIG. 1 is a schematic diagram of the hardware structure of a biochemical oxygen demand soft measurement device of an electronic device according to an embodiment of the present invention. Figure 5 As shown, the device includes one or more processors 610, a bus 630, and a memory 620. Taking one processor 610 as an example, the device may also include: an input device 640, and an output device 650.
[0162] The processor 610, the memory 620, the input device 640 and the output device 650 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0163] The memory 620 is a non-transitory computer-readable storage medium that can be used to store non-transitory software programs, non-transitory computer executable programs, and modules. The processor 610 executes various functional applications and data processing of the electronic device by running the non-transitory software programs, instructions, and modules stored in the memory 620, that is, the processing method of the above method embodiment is implemented.
[0164] The memory 620 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data, etc. In addition, the memory 620 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 620 may optionally include a memory remotely arranged relative to the processor 610, and these remote memories may be connected to the processing device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0165] The input device 640 can receive input digital or character information and generate signal input. The output device 650 can include a display device such as a display screen.
[0166] The one or more modules are stored in the memory 620, and when executed by the one or more processors 610, perform:
[0167] When establishing a BOD soft-sensing model based on RBF neural network, the initial number of neurons in the hidden layer is determined for each PCA calculation, including the following steps:
[0168] S11, obtaining the input layer variables corresponding to the BOD soft sensor model during each PCA calculation;
[0169] S12, determining the number of hidden layer neurons corresponding to the minimum error value after the BOD soft-sensing model prediction calculation during the last PCA calculation as the reference hidden layer neuron number;
[0170] S13. Taking the benchmark hidden layer neuron number as a benchmark, the initial number of neurons in the hidden layer of this PCA calculation is determined according to the comparison result between the number of input layer variables of this PCA calculation and the number of input layer variables of the last PCA calculation.
[0171] The above product can execute the method provided by the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to the method provided by the embodiment of the present invention.
[0172] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0173] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0174] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0175] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage device, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage device includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), ReRAM, MRAM, PCM, NAND Flash, NOR Flash, Memristor, disk or optical disk and other media that can store program codes.
[0176] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A biochemical oxygen demand soft measurement method, characterized in that: When establishing a biochemical oxygen demand (BOD) soft-sensing model based on RBF neural network, the initial number of neurons in the hidden layer is determined each time the principal component analysis method (PCA) is calculated, including the following steps: S11, obtaining the input layer variables corresponding to the BOD soft sensor model during each PCA calculation; S12, determining the number of hidden layer neurons corresponding to the minimum error value after the BOD soft-sensing model prediction calculation during the last PCA calculation as the reference hidden layer neuron number; S13. Taking the benchmark hidden layer neuron number as a benchmark, the initial number of neurons in the hidden layer of this PCA calculation is determined according to the comparison result between the number of input layer variables of this PCA calculation and the number of input layer variables of the last PCA calculation.
2. The biochemical oxygen demand soft-sensing method according to claim 1, characterized in that: The step of obtaining the input layer variables required by the BOD soft sensor model for each PCA calculation includes: Obtain the initial data of various variables in advance based on the sample data collected by various instruments; Normalizing the initial data by a zero-mean normalization method to generate sample set data of various variables; The matrix A=[a1, a2, ..., a p ], and obtain the covariance S of the matrix A, and decompose the matrix A into a principal component score matrix R; The cumulative variance contribution rate during this PCA calculation is calculated, and the variables whose cumulative variance contribution rate is greater than the preset threshold are determined as the input layer variables obtained in this PCA calculation.
3. The biochemical oxygen demand soft-sensing method according to claim 2, characterized in that: The initial data is normalized by a zero mean standardization method to generate sample set data of various variables, including: Among them, i is the number of samples, j is the sample weight, and a ij is the jth component of the ith sample, is the mean of the jth component sample, s jj For variable a j The standard deviation of , p is the number of sample components.
4. The biochemical oxygen demand soft-sensing method according to claim 3, characterized in that: The calculation of the cumulative variance contribution rate during the PCA calculation includes: Calculate the cumulative variance contribution of the t-th PCA calculation: Among them, i is the number of samples, j is the sample weight, and a i is the i-th sample value, is the mean of the jth component sample, η is the cumulative variance contribution rate, q is the number of neurons in the input layer, p is the number of sample components, η m is the preset threshold for the cumulative variance contribution rate; Select q vectors from the principal component score matrix R as the input of the RBF neural network, and determine the input layer variables obtained by the tth PCA calculation.
5. The biochemical oxygen demand soft-sensing method according to claim 4, characterized in that: The expression of the BOD soft sensor model is: Among them, w(k) is the connection weight between the hidden layer and the output layer; θ(k) is the output of the hidden layer neuron; θ m (k) is the output of the mth hidden layer neuron; w m (k) is the connection weight between the mth hidden layer neuron and the output neuron; M(t) is the initial number of neurons in the hidden layer after the tth PCA calculation, y t (k) is the predicted value at time k after the t-th PCA calculation; The hidden layer contains M(t) neurons, and the output expression of each hidden layer neuron is: u(k) = [u1(k), u2(k),..., u q(t) (k)] Equation (5); c(k)=[c1(k),c2(k),...,c M(t) (k)] Formula (6); σ(k) = [σ1(k), σ2(k),..., σ M(t) (k)] Equation (7); Among them, c m (k) is the center vector of the mth neuron, σ m (k) is the width of the mth neuron, u m (k) is the input layer vector of the mth hidden layer neuron.
6. The biochemical oxygen demand soft-sensing method according to claim 5, characterized in that: The method of determining the initial number of neurons in the hidden layer of the current PCA calculation based on the number of neurons in the benchmark hidden layer as a benchmark and the number of variables in the input layer of the current PCA calculation compared with the number of variables in the input layer of the previous PCA calculation comprises: According to formula (8), the initial number of neurons in the hidden layer during PCA calculation is calculated; Among them, q(t-1) is the number of input layer neurons after the t-1th PCA calculation, q(t) is the number of input layer neurons after the tth PCA calculation, and M best (t-1) is the number of hidden layer neurons corresponding to the minimum value of the operation error after the t-1th BOD model prediction calculation.
7. The biochemical oxygen demand soft-sensing method according to claim 6, characterized in that: include: The training and learning of the BOD soft sensor model includes: The error of RBF neural network after the t-th PCA calculation is e t (k) The expression is: Among them, q is the number of neurons in the input layer, y td (k) is the expected output of the RBF neural network at time k after the t-th PCA calculation, y t (k) is the actual output of the RBF neural network at time k after the t-th PCA calculation; The BOD soft sensor model is trained and learned using the gradient descent algorithm. d is the ideal error, when e t (k) <e d Stop adjusting when 8. A biochemical oxygen demand soft measurement device, characterized in that: When establishing a BOD soft-sensing model based on RBF neural network, the initial number of neurons in the hidden layer is determined for each PCA calculation, including: The variable determination unit is used to obtain the input layer variables corresponding to the BOD soft sensor model during each PCA calculation; A benchmark determination unit is used to determine the number of hidden layer neurons corresponding to the minimum error value after the BOD soft sensor model prediction calculation in the last PCA calculation as the benchmark hidden layer neuron number; The neuron number determination unit is used to determine the initial number of neurons in the hidden layer of this PCA calculation based on the benchmark hidden layer neuron number and the comparison result between the number of input layer variables of this PCA calculation and the number of input layer variables of the last PCA calculation.
9. The biochemical oxygen demand soft measurement device according to claim 8, characterized in that: The expression of the BOD soft sensor model is: Among them, w(k) is the connection weight between the hidden layer and the output layer; θ(k) is the output of the hidden layer neuron; θ m (k) is the output of the mth hidden layer neuron; w m (k) is the connection weight between the mth hidden layer neuron and the output neuron; M(t) is the initial number of neurons in the hidden layer after the tth PCA calculation, y t (k) is the predicted value at time k after the t-th PCA calculation; The hidden layer contains M(t) neurons, and the output expression of each hidden layer neuron is: u(k) = [u1(k), u2(k),..., u q(t) (k)] Equation (5); c(k)=[c1(k),c2(k),...,c M(t) (k)] Formula (6); σ(k) = [σ1(k), σ2(k),..., σ M(t) (k)] Equation (7); Among them, c m (k) is the center vector of the mth neuron, σ m (k) is the width of the mth neuron, u m (k) is the input layer vector of the mth hidden layer neuron.
10. The biochemical oxygen demand soft measurement device according to claim 9, characterized in that: The neuron number determination unit comprises: According to formula (8), the initial number of neurons in the hidden layer during PCA calculation is calculated; Among them, q(t-1) is the number of input layer neurons after the t-1th PCA calculation, q(t) is the number of input layer neurons after the tth PCA calculation, and M best (t-1) is the number of hidden layer neurons corresponding to the minimum value of the operation error after the t-1th BOD model prediction calculation.
11. A memory, characterized in that: The method comprises a software program, wherein the software program is suitable for executing the steps of the biochemical oxygen demand soft-sensing method according to any one of claims 1 to 7 by a processor.
12. A biochemical oxygen demand soft measurement device, characterized in that: comprising a bus, a processor and a memory as claimed in claim 11; The bus is used to connect the memory and the processor; The processor is configured to execute an instruction set in the memory.
