INTELLIGENT MONITORING METHOD AND APPARATUS FOR ABNORMAL WORKING CONDITIONS IN HEAVY METAL WASTEWATER TREATMENT PROCESS BASED ON TRANSFER LEARNING AND STORAGE MEDIUM
20230089156 · 2023-03-23
Assignee
Inventors
- Keke HUANG (Changsha, CN)
- Haofei WEN (Changsha, CN)
- Chunhua YANG (Changsha, CN)
- Hongqiu ZHU (Changsha, CN)
- Yonggang LI (Changsha, CN)
Cpc classification
C02F1/008
CHEMISTRY; METALLURGY
G05B13/042
PHYSICS
International classification
Abstract
An intelligent monitoring method and apparatus for abnormal working conditions in a heavy metal wastewater treatment process based on transfer learning and a storage medium are provided. During an intelligent monitoring, the abnormal working conditions can be automatically and intelligently recognized by fusing data in the treatment process of the heavy metal wastewater different in source; specifically, a normal sample Y.sup.SD in the treatment process of the heavy metal wastewater with fixed sources and a small number of normal samples Y.sup.TD in the treatment process of the heavy metal wastewater with unknown sources are utilized; and first, a data representation dictionary D.sup.SD of Y.sup.SD is obtained through learning on Y.sup.SD, and then considering different distribution of Y.sup.SD and Y.sup.TD, a transfer learning method is adopted to fuse characters of Y.sup.TD into a dictionary learning process to obtain a dictionary D.sup.TD with higher generalization ability.
Claims
1. An intelligent monitoring method for abnormal working conditions in a heavy metal wastewater treatment process based on transfer learning, comprising: 1) constructing an offline dictionary for heavy metal wastewater treatment data samples with fixed sources according to historically-collected heavy metal wastewater treatment data samples with fixed sources; 2) acquiring an augmented dictionary corresponding to effective heavy metal wastewater treatment data samples with unknown sources by utilizing historically-collected effective heavy metal wastewater treatment data samples with unknown sources to perform the transfer learning on the offline dictionary; 3) calculating a reconstruction error of the effective heavy metal wastewater treatment data samples with unknown sources through the augmented dictionary, and acquiring a control limit under a working condition in the heavy metal wastewater treatment process through a kernel density estimation based on the reconstruction error; and 4) calculating a reconstruction error of to-be-monitored data y.sub.i under the augmented dictionary D.sup.TD, wherein if the reconstruction error of to-be-monitored data y.sub.i calculated is less than the control limit, it is considered that a current heavy metal wastewater treatment process is normal, otherwise, it is considered that the current heavy metal wastewater treatment process is abnormal.
2. The intelligent monitoring method according to claim 1, wherein the constructing the offline dictionary for the heavy metal wastewater treatment data samples with fixed sources comprises the following steps: step 1.1: collecting historical samples, wherein a sensor is utilized for collecting heavy metal wastewater treatment historical samples with fixed sources, and a sample set with fixed sources is Y.sup.SD; Y.sup.SD=[y.sub.1, y.sub.2, . . . , y.sub.N.sub.
3. The intelligent monitoring method according to claim 2, wherein the objective function of the offline dictionary learning is solved through a K-SVD method, and the dictionary D.sub.1 and the sparse coding X are constantly updated until the optimal initial dictionary D.sup.SD corresponding to Y.sup.SD is obtained.
4. The intelligent monitoring method according to claim 1, wherein the acquiring the augmented dictionary by utilizing the historically-collected effective heavy metal wastewater treatment data samples with unknown sources to perform the transfer learning on the offline dictionary comprises the following steps: utilizing a sensor for collecting effective heavy metal wastewater treatment historical samples with unknown sources, wherein an effective sample set with unknown sources is Y.sup.TD; and utilizing an initial dictionary D.sup.SD and a corresponding sparse coding X for representing the Y.sup.TD based on a sparse representation principle, constructing an objective function of sparse coding corresponding to heavy metal wastewater treatment data samples with unknown sources, solving an optimal sparse coding X.sup.p corresponding to the effective sample set Y.sup.TD with unknown sources through the transfer learning, and then acquiring a corresponding optimal dictionary through X.sup.p;
5. The intelligent monitoring method according to claim 4, wherein the optimal dictionary corresponding to the effective sample set Y.sup.TD with unknown sources is solved by constructing the objective function of the sparse coding corresponding to the heavy metal wastewater treatment data samples with unknown sources;
6. The intelligent monitoring method according to claim 1, wherein a calculation of the reconstruction error refers to a 2-norm calculation of a sample collection value of a to-be-calculated reconstruction error and an expression value of the augmented dictionary for samples and corresponding sparse coding.
7. The intelligent monitoring method according to claim 1, wherein the acquiring the control limit under the working condition in the heavy metal wastewater treatment process through the kernel density estimation refers to calculating a kernel density function for reconstruction errors of historical samples with unknown sources according to a following formula, and a value of the kernel density function under a set confidence level serves as the control limit:
8. The intelligent monitoring method according to claim 1, wherein direction selection vectors are sequentially set by setting an abnormal wastewater index positioning objective function, and a reconstruction error of each wastewater index under the augmented dictionary is calculated until abnormal amplitudes on abnormal samples are converged to determine abnormal wastewater indexes;
9. An intelligent monitoring apparatus for abnormal working conditions in a heavy metal wastewater treatment process based on transfer learning, comprising: an offline dictionary construction module for constructing an offline dictionary by utilizing historically-collected heavy metal wastewater treatment data samples with fixed sources; an augmented dictionary construction module for performing the transfer learning on the offline dictionary through historically-collected effective heavy metal wastewater treatment data samples with unknown sources to construct an augmented dictionary; a control limit generation module configured to calculate reconstruction errors of all the historical samples through the augmented dictionary, and calculate a control limit under a working condition in a heavy metal wastewater treatment process through a kernel density estimation method based on the reconstruction errors of all the historical samples; and an industrial system abnormality judgment module configured to calculate a reconstruction error of to-be-monitored data acquired online according to the augmented dictionary, compare the reconstruction error of the to-be-monitored data with the control limit and judge whether a current heavy metal wastewater treatment process working condition is abnormal or not according to a comparison result.
10. A computer storage medium, configured to storage programs, wherein when being executed, the programs are used for implementing the intelligent monitoring method according to claim 1.
11. The computer storage medium according to claim 10, wherein in the intelligent monitoring method, the constructing the offline dictionary for the heavy metal wastewater treatment data samples with fixed sources comprises the following steps: step 1.1: collecting historical samples, wherein a sensor is utilized for collecting heavy metal wastewater treatment historical samples with fixed sources, and a sample set with fixed sources is Y.sup.SD; Y.sup.SD=[y.sub.1, y.sub.2, . . . , y.sub.N.sub.
12. The computer storage medium according to claim 11, wherein in the intelligent monitoring method, the objective function of the offline dictionary learning is solved through a K-SVD method, and the dictionary D.sub.1 and the sparse coding X are constantly updated until the optimal initial dictionary D.sup.SD corresponding to Y.sup.SD is obtained.
13. The computer storage medium according to claim 10, wherein in the intelligent monitoring method, the acquiring the augmented dictionary by utilizing the historically-collected effective heavy metal wastewater treatment data samples with unknown sources to perform the transfer learning on the offline dictionary comprises the following steps: utilizing a sensor for collecting effective heavy metal wastewater treatment historical samples with unknown sources, wherein an effective sample set with unknown sources is Y.sup.TD; and utilizing an initial dictionary D.sup.SD and a corresponding sparse coding X for representing the Y.sup.TD based on a sparse representation principle, constructing an objective function of sparse coding corresponding to heavy metal wastewater treatment data samples with unknown sources, solving an optimal sparse coding X.sup.p corresponding to the effective sample set Y.sup.TD with unknown sources through the transfer learning, and then acquiring a corresponding optimal dictionary through X.sup.p;
14. The computer storage medium according to claim 13, wherein in the intelligent monitoring method, the optimal dictionary corresponding to the effective sample set Y.sup.TD with unknown sources is solved by constructing the objective function of the sparse coding corresponding to the heavy metal wastewater treatment data samples with unknown sources,
15. The computer storage medium according to claim 10, wherein in the intelligent monitoring method, a calculation of the reconstruction error refers to a 2-norm calculation of a sample collection value of a to-be-calculated reconstruction error and an expression value of the augmented dictionary for samples and corresponding sparse coding.
16. The computer storage medium according to claim 10, wherein in the intelligent monitoring method, the acquiring the control limit under the working condition in the heavy metal wastewater treatment process through the kernel density estimation refers to calculating a kernel density function for reconstruction errors of historical samples with unknown sources according to a following formula, and a value of the kernel density function under a set confidence level serves as the control limit:
17. The computer storage medium according to claim 10, wherein in the intelligent monitoring method, direction selection vectors are sequentially set by setting an abnormal wastewater index positioning objective function, and a reconstruction error of each wastewater index under the augmented dictionary is calculated until abnormal amplitudes on abnormal samples are converged to determine abnormal wastewater indexes,
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0045]
DETAILED DESCRIPTION
[0046] The present invention will be further described in detail below with reference to the accompanying drawings and the embodiments.
[0047] As shown in
[0048] 1) Construct an offline dictionary for heavy metal wastewater treatment data samples with fixed sources according to historically-collected heavy metal wastewater treatment data samples with fixed sources.
[0049] The construction of the offline dictionary for the heavy metal wastewater treatment data samples with fixed sources includes the following steps:
[0050] step 1.1: collecting historical samples,
[0051] wherein a sensor is utilized for collecting heavy metal wastewater treatment historical samples with fixed sources, and a sample set with fixed sources is Y.sup.SD; Y.sup.SD=[y.sub.1, y.sub.2, . . . , y.sub.N.sub.
[0052] step 1.2: representing Y.sup.SD through a dictionary D.sub.1 and sparse coding X based on a sparse representation principle, constructing an objective function of offline dictionary learning, and acquiring an optimal initial dictionary D.sup.SD corresponding to Y.sup.SD and sparse coding X.sup.SD corresponding to D.sup.SD by solving the objective function of offline dictionary learning,
[0053] where, the initial value of the dictionary D.sub.1 is a matrix formed by in-column arranging of K samples randomly selected from a historical sample set Y.sup.SD, K=10*m, T is a set value of the number of nonzero elements in each column of a sparse coding matrix, and ∥⋅∥.sub.2.sup.2 and ∥⋅∥.sub.0 represent 2-norm and 0-norm correspondingly; x.sub.i represents the ith column in X.
[0054] The final value of the dictionary D.sub.1 is D.sup.SD, the initial value of D.sub.1 in each column is a randomly-selected sample, and D.sub.1 has K columns; the final value of the sparse coding X is X.sup.SD; and X.sup.SD represents sparse coding of Y.sup.SD under D.sup.SD, and each column in D.sup.SD represents one dictionary atom;
[0055] the value of T is commonly set to 2; and
[0056] the objective function of offline dictionary learning is solved through a K-SVD method, and the dictionary D.sub.1 and the sparse coding X are constantly updated until an optimal initial dictionary D.sup.SD corresponding to Y.sup.SD is obtained.
[0057] The solving through the K-SVD method specifically includes the following steps: randomly selecting K samples from Y.sup.SD to serve as initial values of the dictionary D.sup.SD, and then acquiring the sparse coding X.sup.SD through an orthogonal matching pursuit algorithm; and updating the dictionary D.sub.1 by column. For example, when kth-column dictionary atoms are updated, it may be written in the following form, and x.sub.T.sup.k represents the kth line in X
[0058] E.sub.k is equal to
A defined set ω.sub.k={i|.sub.1≤i≤N,x.sub.T.sup.k(i)≠0} represents an index set of indexes where nonzero terms are located in x.sub.T.sup.k. Ω.sub.k is defined as a N×|ω.sub.k| matrix, the value thereof at (ω.sub.k(i),i) is 1, and the rest of values are all 0. By multiplying Ω.sub.k and x.sub.T.sup.k and E.sub.k, original matrices may be shrunk x.sub.R.sup.k=x.sub.T.sup.kΩ.sub.k, E.sub.k.sup.R=E.sub.kΩ.sub.k. After singular value decomposition is performed on E.sub.k.sup.R, E.sub.k.sup.R=UΔV.sup.T, d.sub.k=u(:,1) and x.sub.R.sup.k=Δ(1,1)v(:,1) are obtained; and the sparse coding X.sup.SD is alternately updated through the orthogonal matching pursuit algorithm after updating is finished column by column. The optimal initial dictionary D.sup.SD is obtained after iteration updating is performed certain times.
[0059] 2) Acquire an augmented dictionary corresponding to effective heavy metal wastewater treatment data samples with unknown sources by utilizing the historically-collected effective heavy metal wastewater treatment data samples with unknown sources to perform transfer learning on the offline dictionary.
[0060] The acquiring the augmented dictionary by utilizing historically-collected effective heavy metal wastewater treatment data samples with unknown sources to perform transfer learning on the offline dictionary includes the following steps:
[0061] utilizing a sensor for collecting effective heavy metal wastewater treatment historical samples with unknown sources, wherein an effective sample set with unknown sources is Y.sup.TD; and utilizing an initial dictionary D.sup.SD and corresponding sparse coding X for representing the Y.sup.TD based on a sparse representation principle, constructing an objective function of sparse coding corresponding to heavy metal wastewater treatment data samples with unknown sources, solving optimal sparse coding X.sup.p corresponding to the effective sample set Y.sup.TD with unknown sources through transfer learning, and then acquiring a corresponding optimal dictionary through X.sup.p;
[0062] where, D.sub.p represents an interpolation dictionary in a transfer learning process, the initial value of D.sub.p represents an optimal initial dictionary D.sup.SD corresponding to the offline dictionary for the heavy metal wastewater treatment data samples with fixed sources, namely, when p=0, D.sub.0=D.sup.SD; T is a set value of the number of the nonzero elements in each column in the sparse coding matrix, and ∥⋅∥.sub.2.sup.2 and ∥⋅∥.sub.0 represent 2-norm and 0-norm correspondingly; and x.sub.i represents the ith column in X.
[0063] To constantly reduce representation errors of newly-distributed data while keeping continuity of an interpolation dictionary model, an optimal dictionary corresponding to the effective sample set Y.sup.TD with unknown sources is solved by constructing the objective function of the dictionary corresponding to the heavy metal wastewater treatment data samples with unknown sources;
[0064] where, λ represents a tuning parameter, and is [1,10]; D represents a to-be-solved dictionary, D.sub.p+1 is assigned to a final dictionary solved through iteration, and D.sub.p+1 represents the optimal dictionary corresponding to the solved effective sample set Y.sup.TD with unknown sources;
[0065] the process of solving is as below:
[0066] an updating result of an interpolation dictionary is acquired by deriving ∥Y.sup.TD−DX.sub.p∥.sub.F.sup.2+λ∥D−D.sub.p∥.sub.F.sup.2:
D.sub.p+1=(λD.sub.p+Y.sup.TDX.sub.p.sup.T)(λE+X.sub.pX.sub.p.sup.T).sup.−1 (5)
[0067] zooming is performed on dictionary atoms of the augmented dictionary to guarantee that L2 norm representing the dictionary atoms is equal to 1:
[0068] (3)-(6) are repeated until ∥D.sub.p+1−D.sub.p∥.sub.F.sup.2≤δ, δ represents a stopping threshold set to 0.01; and
[0069] X.sub.p represents sparse coding obtained in the pth-time iteration process, X.sub.p.sup.T is transposition of X.sub.p, E is a unit matrix, and d.sub.1.sup.TD and d.sub.K.sup.TD represent the 1st column and the Kth column of the augmented dictionary D.sup.TD.
Algorithm 1. Cross distributed data sparse representation based on transfer dictionary learning
Input: historical data Y.sup.SD, a few analyzed data Y.sup.TD, the sparse constraint T, the dictionary size K, the iteration times P, the stopping threshold δ which are determined commonly through experience and manual parameter adjustment
the dictionary size K is commonly set as a decuple variable, namely 10*m. The sparse constraint is commonly set to 1-2, the iteration times P is commonly set to 100, and the stopping threshold is set to 0.01.
Initialize: the historical data Y.sup.SD is utilized for obtaining an initialized dictionary D.sup.SD according to a K-SVD algorithm, and an interpolation model parameter p is set to 0.
When ∥D.sub.p+1−D.sub.p∥.sub.F.sup.2≤δ and p<P,
1. Perform sparse representation on newly-distributed data Y.sup.TD under the current interpolation dictionary D.sub.p according to the formula (3) to obtain sparse coding X.sub.p.
2. Update an interpolation dictionary model according to the formulas (4)-(5) while limiting a dictionary change amplitude
3. p←p+1
4. Perform dictionary atom normalization according to the formula (6)
Cycle End
[0070] A dictionary under new distribution is obtained D.sup.TD
Output: a final dictionary D.sup.TD
[0071] 3) Calculate a reconstruction error of the effective heavy metal wastewater treatment data samples with unknown sources through the augmented dictionary, and acquire a control limit under a working condition in the heavy metal wastewater treatment process through kernel density estimation based on the reconstruction error.
[0072] The acquiring the control limit under a working condition in the heavy metal wastewater treatment process through kernel density estimation refers to calculating a kernel density function for reconstruction errors of historical samples with unknown sources according to a following formula, and the value of the kernel density function under a set confidence level serves as the corresponding control limit:
[0073] where, e represents distribution of to-be-fitted reconstruction errors of the historical samples with unknown sources, e.sub.i represents a reconstruction error of the ith historical sample with unknown sources, H represents a bandwidth matrix, n represents the sum of the historical samples, and K[g] represents a kernel function; and {circumflex over (f)}(e,H) refers to a curve fitted through the historical samples e.sub.i with unknown sources under a given bandwidth matrix H.
[0074] In this example, a gaussian kernel function is adopted as the kernel function, a diagonal matrix is adopted as the bandwidth matrix, and a confidence level is set to 0.98.
[0075] 4) Calculate a reconstruction error of to-be-monitored data y.sub.i under the augmented dictionary D.sup.TD. If the calculated reconstruction error is less than the control limit, it is considered that the current heavy metal wastewater treatment process is normal, otherwise, it is considered that the current heavy metal wastewater treatment process is abnormal.
[0076] The calculation of the reconstruction error refers to 2-norm calculation of a sample collection value of a to-be-calculated reconstruction error and an expression value of the augmented dictionary for samples and a corresponding sparse coding.
[0077] Abnormal detection and abnormal index isolation are performed on the working condition of the wastewater treatment process based on the obtained dictionary model:
[0078] direction selection vectors are sequentially set by setting an abnormal wastewater index positioning objective function, and a reconstruction error of each wastewater index under the augmented dictionary is calculated until abnormal amplitudes on abnormal samples are converged to determine abnormal wastewater indexes;
[0079] where, y.sub.f is an abnormal sample in the wastewater treatment process, y.sub.i=y.sub.f−ξ.sub.if.sub.i, y.sub.i is a to-be-reconstructed sample in which the ith-dimension index of y.sub.f is isolated, and the values of other dimensions of indexes are kept unchanged, and f.sub.i is a reconstruction amplitude of the ith-dimension index in y.sub.f; x.sub.ri is sparse coding of y.sub.i under the augmented dictionary, and the initial value of x.sub.ri is sparse coding of y.sub.f under the augmented dictionary; Re.sub.i is a reconstruction error of the ith wastewater index in y.sub.f on the augmented dictionary, and D.sup.TD represents the augmented dictionary; ξ.sub.i represents a direction selection vector, if the ith element on the vector is 1, it means that the ith index is selected at this time, and other elements are all 0, ξ.sub.i∈R.sup.m; and {circumflex over (x)}.sub.ri and {circumflex over (f)}.sub.i are end values obtained after optimizing x.sub.ri and f.sub.i through an argmin objective function.
[0080] Indexes for selection of the direction selection vector are constantly changed, for example, a first-dimension variable represents pH value, ξ.sub.1=[1, 0, 0, . . . 0, 0].sup.T represents a selective vector for the pH value, and an abnormal index is determined by finding an i value corresponding to a minimum reconstruction error.
[0081] Possible problems in the wastewater treatment process can be found through abnormality isolation, for example, if abnormality is caused by pH, pH stability can be achieved by changing reagent amount, thereby guaranteeing normal proceeding of the wastewater treatment process.
[0082] Based on the above method, an embodiment of the present invention further provides an intelligent monitoring apparatus for abnormal working conditions in a heavy metal wastewater treatment process based on transfer learning, including:
[0083] an offline dictionary construction module for constructing an offline dictionary by utilizing historically-collected heavy metal wastewater treatment data samples with fixed sources;
[0084] an augmented dictionary construction module for performing transfer learning on the offline dictionary through historically-collected effective heavy metal wastewater treatment data samples with unknown sources to construct an augmented dictionary;
[0085] a control limit generation module configured to calculate reconstruction errors of all the historical samples through the augmented dictionary, and calculate a control limit under a working condition in a heavy metal wastewater treatment process through a kernel density estimation method based on the reconstruction errors of all the historical samples; and
[0086] an industrial system abnormality judgment module configured to calculate a reconstruction error of to-be-monitored data acquired online according to the augmented dictionary, compare the reconstruction error of the to-be-monitored data with the control limit and judge whether a current heavy metal wastewater treatment process working condition is abnormal or not according to a comparison result.
[0087] It is to be understood that functional unit modules in various embodiments of the present invention may be centralized in one processing unit, may also independently and physically exist, and may be achieved in a hardware or software form, or two or more unit modules may be integrated into one unit module.
[0088] Furthermore, an embodiment of the present invention further provides a computer storage medium configured to store programs. The intelligent monitoring method for the abnormal working conditions in the heavy metal wastewater treatment process based on transfer learning is achieved when the programs are executed. Beneficial effects of the computer storage medium refer to part of beneficial effects of the method and are not repeated herein.
[0089] A person skilled in the art can understand that the embodiments of this application may be provided as a method, a system, or a computer program product. Therefore, this application may use a form of hardware-only embodiments, software-only embodiments, or embodiments combining software and hardware. In addition, this application may use a form of a computer program product that is implemented on one or more computer-usable storage media (including but not limited to a disk memory, a CD-ROM, an optical memory, and the like) that include computer-usable program code.
[0090] This application is described with reference to flowcharts and/or block diagrams of the method, the device (system), and the computer program product according to the embodiments of this application. It should be understood that computer program instructions can implement each procedure and/or block in the flowcharts and/or block diagrams and a combination of procedures and/or blocks in the flowcharts and/or block diagrams. These computer program instructions may be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or a processor of another programmable data processing device to generate a machine, so that an apparatus configured to implement functions specified in one or more procedures in the flowcharts and/or one or more blocks in the block diagrams is generated by using instructions executed by the general-purpose computer or the processor of another programmable data processing device.
[0091] These computer program instructions may also be stored in a computer readable memory that can instruct a computer or any other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory generate an artifact that includes an instruction apparatus. The instruction apparatus implements a specific function in one or more processes in the flowcharts and/or in one or more blocks in the block diagrams.
[0092] These computer program instructions may also be loaded onto a computer or another programmable data processing device, so that a series of operations and steps are performed on the computer or the another programmable device, thereby generating computer-implemented processing. Therefore, the instructions executed on the computer or the another programmable device provide steps for implementing a specific function in one or more processes in the flowcharts and/or in one or more blocks in the schematic structural diagrams.
[0093] At last, it should be noted that: The foregoing embodiments are merely used to illustrate the technical solutions of the present invention but not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they may still make modifications or make equivalent replacements to the embodiments of the present invention, and any modification or equivalent replacement without departing from the spirit and scope of the present invention shall be subject to the protection scope of the claims of the present invention.