Water quality detection method based on membership function and principal component analysis

By combining the membership function and principal component analysis method in water quality detection, and considering the weight of water quality attributes, the problem of low decision-making accuracy in existing methods is solved, and more efficient water quality grade detection and decision support are achieved.

CN115754199BActive Publication Date: 2024-09-20HENAN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211410512.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-10
Publication Date
2024-09-20
Estimated Expiration
2042-11-10

AI Technical Summary

Technical Problem

Existing water quality detection methods ignore the weight of water quality attributes when processing multi-sensor data, resulting in reduced decision accuracy, and traditional methods fail to effectively integrate the mapping relationship between multi-source data and water quality types.

Method used

Methods based on membership functions and principal component analysis are used to construct a membership model of water quality levels, calculate the membership degree of each attribute, and use the principal component analysis method to obtain the contribution rate to modify the basic probability assignment function, and finally use the Dempster combination rule Perform data fusion to improve decision accuracy.

Benefits of technology

It improves the accuracy and efficiency of water quality testing, ensures the accuracy of water quality grade decision-making and the rationality of information, and enhances the understanding of water quality attributes and decision-making support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115754199B
    Figure CN115754199B
Patent Text Reader

Abstract

The present invention discloses a water quality detection method based on membership function and principal component analysis, comprising the following steps: first, establishing a membership model of each attribute according to different water quality grade samples collected by a sensor; then, calculating the membership of the test sample under the corresponding attribute for different water quality grades; secondly, normalizing the required membership as an initial BPA function; thirdly, using principal component analysis to obtain the contribution rate of each attribute, discounting the initial BPA function with the attribute contribution rate, and using the discounted result as the final basic probability assignment function; finally, using the Dempster combination rule to fuse the final basic probability assignment function one by one, and outputting the water quality grade decision result of the test sample. The scheme of the present invention comprehensively considers the membership and attribute contribution rate, can effectively process uncertain and imprecise information, and has important theoretical significance and application value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of water quality detection, and in particular to a water quality detection method based on membership function and principal component analysis. Background Art

[0002] Water quality testing is an important part of water resources management and environmental protection. It is the foundation and technical support for water quality resource and environmental management. It provides basic data for analyzing the current status of water quality and conducting water resource quality evaluation. Therefore, studying water quality testing methods is of great significance for realizing water area monitoring. With the rapid development of sensor technology and the diversification of water quality monitoring methods, there may be redundant and complementary information between the acquired water quality attribute (such as pH value, potassium permanganate content, ammonia nitrogen content, etc.) indicator data. In addition, the mapping relationship established between traditional multi-source water quality monitoring data and water quality types can no longer meet the needs. At the same time, due to the complexity of the monitoring environment and the inaccuracy of the sensor, the monitored water quality attribute indicator data has the characteristics of uncertainty. Therefore, it is of great theoretical significance and application value to study the reasonable fusion of water quality attribute indicator data collected by multiple sensors and make water quality decisions.

[0003] Dempster-Shafer (DS) evidence theory expresses the "unknown" and "uncertain" information through its defined confidence function and likelihood function. With its solid mathematical foundation and excellent ability to handle uncertain information, DS evidence theory has become an excellent uncertainty reasoning method. The generation of basic probability assignment (BPA) function is the primary problem that needs to be solved when applying evidence theory to process and fuse uncertain information. Therefore, how to convert the water quality monitoring data obtained by the sensor into the BPA function in the DS evidence theory framework is the most important step in applying DS evidence theory to solve practical problems. At present, the most widely used method is the BPA function generation method based on membership. Because the membership reflects the relationship between the evaluation factors and the evaluation level, the correct selection of the membership function can ensure the good effect of fuzzy comprehensive evaluation. Common fuzzy evaluation mostly uses membership function for evaluation. However, only using membership to generate BPA function ignores the influence of water quality attribute weight. Reference [1] constructs a membership model through a bell-shaped function, then determines the similarity between the test sample and each target based on the maximum membership principle, and finally normalizes the similarity to generate a BPA function. Reference [2] calculates the difference between the test sample and each target based on a triangular fuzzy membership model to generate an initial BPA function, then calculates the conflict between the generated evidence, and finally modifies the initial BPA function based on the conflict threshold to obtain the final BPA function. However, the above methods do not consider the impact of attribute weights on the generated BPA function, which leads to a decrease in decision accuracy. Summary of the invention

[0004] The purpose of the present invention is to provide a water quality detection method based on membership function and principal component analysis, which can effectively make a correct decision on the water quality level of the target water area.

[0005] The technical solution adopted by the present invention is:

[0006] Step 1: construct a membership model of the target water quality level under each attribute according to the data set sample mean and variance of different water quality levels under a certain attribute in the water quality detection data set;

[0007] Step 2: Calculate the membership of each attribute of the test sample data observed by the sensor for different water quality levels. The sensor observes N attributes of the water quality target at j The parameters of (j=1,2,…,N) constitute a test sample X=(x 1 ,x 2 ,…,x N ), the test sample X has attribute att j Different water quality levels i The membership degree is L i (x j ), where x j For the test sample at att j The value under the attribute;

[0008] Step 3: Normalize the membership degree obtained in step 2 to determine the initial BPA function m j (L i ); the test sample X is at at j The membership of Z levels of water quality is obtained under the attributes, which are L 1 (x j )、L 2 (x j ),……,L Z (x j ), the generated initial BPA function is: Among them, m j (L i ) indicates that the test sample is at j For water quality level L under properties i Similarly, obtain the initial BPA function for water quality level L under other attributes of the test sample i The initial BPA function is: 1 (L 1 ),m 1 (L 2 ),...,m 1 (L Z)}、{m 2 (L 1 ),m 2 (L 2 ),...,m 2 (L Z )}、...{m N (L 1 ),m N (L 2 ),...,m N (L Z )};

[0009] Step 4: Obtain the contribution rate C of each attribute based on principal component analysis j ;

[0010] Step 5: Determine the final basic probability assignment function: Use the attribute contribution rate to calculate the initial BPA function m obtained in step 3 j Discount is performed and the discount result is used as the final basic probability assignment function m' j ;

[0011]

[0012] Where j = 1, 2, ..., N, m' j =(m' j (L 1 ),m' j (L 2 ),m' j (L 3 ),m' j (L 4 ),m' j (L 5 ),m' j (Θ)).

[0013] Step 6: Use the Dempster combination rule to fuse the final basic probability assignment functions in step 5 one by one for a total of N-1 times. The Dempster combination rule is:

[0014]

[0015] in, is an empty set, θ r and θ u To identify the focal element on the frame Θ, K is the conflict coefficient;

[0016] Step 7: Output the detected water quality grade results. The subset corresponding to the largest basic probability assignment in the final fusion result is the water quality grade for the decision.

[0017] The specific steps of step 1 are as follows:

[0018] Step 1-1: record the Z levels of water quality data collected by different sensors as L i (i=1,2,...,Z), the sensor needs to collect data set samples of different water quality levels, each sample contains N attributes, namely att j (j=1,2,…,N). Construct membership model from the collected data set samples:

[0019]

[0020] Among them, e is a natural constant, which is an irrational number approximately equal to 2.71828182845904523536..., x j ∈[x jmin ,x jmax ], x jmin ,x jmax Att j The minimum and maximum values ​​of the data set under the attribute, j=1,2,...,N. The water quality level in the data set is L i Samples at att j Average value under attribute, i=1,2,...,Z, p=1,2,...,Q, Water quality level L i The pth data set sample is at att j The value under the attribute, Q is the water quality level L i The total number of samples in the data set. ji Water quality level L i The dataset samples are at att j The variance of the values ​​under the attribute,

[0021] Step 1-2, according to Z water quality level L i (i=1,2,...,Z) constitutes the identification framework Θ={L 1 ,L 2 ,...,L Z}, a power set is generated by combining any elements in the identification frame Θ If m(L i )>0, then L i is the focal element of the BPA function m on the identification frame Θ.

[0022] The specific steps of step 4 are as follows:

[0023] Step 4-1, construct the N×N order covariance matrix between attributes:

[0024]

[0025] The eigenvalues ​​of each attribute are obtained through the covariance matrix between the attributes, and the contribution rate of each attribute is obtained according to the eigenvalues. M is the total number of data set samples collected by the sensor, y jl and kl The lth sample in the data set is at at j Attributes and att k The value under the attribute, and For the dataset samples in att j Attributes and att k The average value under the attribute. Step 4-2, generate each attribute eigenvalue: Cu = λu. Among them, u is the eigenvector, λ is the eigenvalue, and the eigenvector of a linear transformation is a non-degenerate vector whose direction remains unchanged under the transformation. The scale of the vector under this transformation is called its eigenvalue. Mathematically, if vector u and transformation C satisfy Cu = λu, then vector u is called an eigenvector of transformation C, and λ is the corresponding eigenvalue. After the eigenvalue is normalized, we get att j Contribution rate of attribute C j :

[0026]

[0027] Among them, λ j for att j The characteristic value of the attribute.

[0028] The present invention has a simple structure, reasonable design, and clear objectives, and is used to detect the water quality level of the target water area. Water quality detection includes multiple indicators, each indicator is used as an attribute for grade judgment, and constructing a membership model for each attribute is conducive to clearly understanding the distribution of water quality grade data, and generating membership according to the membership model to generate an initial BPA function. The principal component analysis method is used to analyze the importance of each attribute to the detection level, and then the contribution rate of each attribute is obtained. The initial BPA function of each attribute is corrected by the contribution rate to obtain the final BPA function of each attribute, and then the final BPA function generated by each attribute is fused according to the Dempster combination rule to obtain the final fusion result. The subset with the largest basic probability assignment value is the detected water quality level, and the water quality level obtained by this method has higher accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0030] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION

[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0032] like Figure 1 As shown, the present invention comprises the following steps:

[0033] Step 1: Construct a membership model.

[0034] Step 1-1, taking the actual water quality detection as an example, according to the surface water environment function and protection objectives, it is divided into five types according to the function level, and different sensors are used to collect five levels (L 1 , L 2 , L 3 , L 4 , L 5 ) water quality data, where L 1 The water quality is first class and its five properties (PH value, 1 、Potassium permanganate content att 2 , total phosphorus content att 3 、Ammonia nitrogen content att 4 , dissolved oxygen content att 5 ) and generate the target sample data set. Calculate L under the PH value attribute 1 Average water quality data and variance σ 11 , calculate L in the same way 2 Average water quality data and variance σ 12 , until L 5 Average water quality data and variance σ 15 Then, the membership model of the five water quality levels under this attribute is constructed:

[0035]

[0036] Among them, i = 1, 2, 3, 4, 5, e is a natural constant, an irrational number approximately equal to 2.71828182845904523536..., x 1 ∈[x 1min ,x 1max ], x 1min ,x 1max The pH values ​​are att 1 The minimum and maximum values ​​of the data set samples under the attribute. Similarly, the potassium permanganate content att can be constructed in turn. 2 , total phosphorus content att 3 、Ammonia nitrogen content att 4 , dissolved oxygen content att 5 The membership models of different water quality levels under the attribute are L i (x 2 )、L i (x 3 )、L i (x 4 )、L i (x 5 ).

[0037] Step 1-2: Construct an identification framework Θ={L 1 ,L 2 ,L 3 ,L 4 ,L 5}, a power set is generated by combining any elements in the identification frame Θ If m(L i )>0, it is called L i is the focal element of the BPA function m on the identification frame Θ.

[0038] Step 2: Calculate the membership of the Z water quality grade test sample attribute data observed by different sensors and the membership model of different water quality grades under each attribute in step 1. Assume a test sample X = (x 1 ,x 2 ,x 3 ,x 4 ,x 5 ), where x 1 , x 2 , x 3 , x 4 , x 5 The pH values ​​of the test samples are 1 、Potassium permanganate content att 2 , total phosphorus content att 3 、Ammonia nitrogen content att4 , dissolved oxygen content att 5 The values ​​of each attribute under the PH value attribute of this sample for L 1 The water quality membership is For L 2 The water quality membership is For L 5 The water quality membership is Similarly, the membership of the test sample at each level under the other four attributes can be obtained. For example, the test sample has potassium permanganate content at 2 The different water quality levels under the attribute are

[0039] Step 3: Normalize the membership degree obtained in step 2 and determine the initial BPA function: 1 The membership of different levels of water quality is obtained under the attributes, which are L 1 (x 1 )、L 2 (x 1 )、L 3 (x 1 )、L 4 (x 1 )、L 5 (x 1 ), the generated initial BPA function is: m 1 (L i ) indicates that at pH value att 1 The sample under the attribute is for level L i The initial BPA function. Similarly, the potassium permanganate content att 2 Properties, total phosphorus content att 3 Properties, ammonia nitrogen content att 4 Properties, dissolved oxygen content att 5 The initial BPA functions of the test sample under the five attributes are {m 1 (L 1 ),m 1 (L 2 ),m 1 (L 3 ),m 1 (L 4 ),m 1 (L 5 )},{m 2 (L 1 ),m 2 (L 2 ),m 2 (L3 ),m 2 (L 4 ),m 2 (L 5 )},......,{m 5 (L 1 ),m 5 (L 2 ),m 5 (L 3 ),m 5 (L 4 ),m 5 (L 5 )}.

[0040] Step 4: Calculate the contribution rate of each attribute.

[0041] Step 4-1. Construct the covariance matrix C between attributes:

[0042]

[0043] in, M is the number of samples in the entire data set collected by the sensor, y 1l and 2l are the lth data set samples at pH value att 1 Properties and content of potassium permanganate att 2 The value under the attribute, and They are the data set samples at pH value att 1 Properties and content of potassium permanganate att 2 The average value under the attribute.

[0044] Step 4-2, based on the covariance matrix C, obtain the eigenvector and the eigenvalue of each attribute: Cu = λu. Among them, u is the eigenvector, λ is the eigenvalue, and the eigenvector of a linear transformation is a non-degenerate vector whose direction remains unchanged under the transformation. The scale of the vector under this transformation is called its eigenvalue. Mathematically, if vector u and transformation C satisfy Cu = λu, then vector u is called an eigenvector of transformation C, and λ is the corresponding eigenvalue. The number of eigenvalues ​​is consistent with the number of attributes, λ j for att j The characteristic value of the attribute. After the characteristic value is normalized, the contribution rate C of each attribute is obtained j :

[0045] Step 5, determine the final basic probability assignment function: use the attribute contribution rate to discount the initial BPA function of the test sample in step 3 for different attributes, and use the discounted result as the final basic probability assignment function;

[0046]

[0047] Where j = 1, 2, ..., N, m' j =(m' j (L 1 ),m' j (L 2 ),m' j (L 3 ),m' j (L 4 ),m' j (L 5 ),m' j (Θ)).

[0048] Step 6: Use the Dempster combination rule to fuse the final basic probability assignment functions in step 5 one by one, for a total of 4 times. The Dempster combination rule is:

[0049]

[0050] in, is an empty set, θ r and θ u To identify the focal element on the frame Θ, K is the conflict coefficient.

[0051] Step 7: Output the detected water quality grade results. The subset corresponding to the largest basic probability assignment in the final fusion result is the final water quality grade.

[0052] In order to generate the BPA function more reasonably, the present invention considers the attribute weight based on the idea of ​​principal component analysis. Because principal component analysis is a statistical analysis method that divides the original multiple variables into a few comprehensive indicators, how to determine these comprehensive indicators becomes the key to the technology, so it is possible to consider using the characteristic of measuring the importance of different variables in principal component analysis to obtain attribute weights.

[0053] In view of the problems existing in the existing methods, the present invention, on the basis of constructing a membership model, uses the principal component analysis method to obtain the contribution rate of each attribute, and integrates the BPA functions for different water quality levels under different attributes into the BPA functions for different water quality levels under comprehensive attributes according to the attribute contribution rate, so that the generated BPA function has higher information content.

[0054] References:

[0055] [1] Guo Wei, Zhu Ke, Wu Yitao, et al. Basic credibility assignment generation method based on bell-shaped function[J]. Journal of Electronics, 2016, 44(4): 926-932.

[0056] [2] Jiang Wen, Chen Yundong, Tang Chao, et al. Basic probability assignment generation method based on sample difference[J]. Control and Decision, 2015, 30(1):71-75.

[0057] In summary, the method proposed in the present invention patent has a simple structure, a clear process, a reasonable design, and is easy to operate during implementation and use. The scheme of the present invention comprehensively considers the degree of membership and the contribution rate of water quality attributes, and determines the basic probability assignment function twice to make the result more reasonable and sufficient. Finally, the Dempster combination rule is used to merge the final basic probability assignment function one by one to obtain reasonable water quality detection results, which can greatly improve the accuracy and efficiency of target water quality level detection.

[0058] In the description of the present invention, it should be noted that directional words, such as the terms "center", "lateral", "longitudinal", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like, indicating directions and positional relationships are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and cannot be understood as limiting the specific protection scope of the present invention.

[0059] It should be noted that the terms "first", "second", etc. in the specification and claims of this application are used to refer to

[0060] Distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged in appropriate circumstances, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0061] Note that the above are only preferred embodiments of the present invention and the principles of the application technology. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention is described in more detail through the above embodiments, the present invention is not limited to the specific embodiments described herein, and may include more other effective embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A water quality detection method based on membership function and principal component analysis, characterized in that: The steps include: Step 1: Use different sensors to collect Z levels of water quality data, observe the data on N attributes and generate a target sample data set. The membership model of the target water quality level under each attribute is constructed by using the variance σ; the specific steps of step 1 are: Z levels of water quality data collected by different sensors are recorded as L i (i=1,2,...,Z), the sensor needs to collect data set samples of different levels of water quality, each sample contains N attributes, denoted as at j (j=1,2,…,N); Construct a membership model from the collected data set samples: Among them, e is a natural constant, which is an irrational number approximately equal to 2.71828182845904523536..., x j ∈[x jmin ,x jmax ], x jmin ,x jmax They are att j The minimum and maximum values ​​of the data set samples under the attribute, j=1,2,...,N; The water quality level in the data set is L i Samples at att j Average value under attribute, i=1,2,...,Z, p=1,2,...,Q, Water quality level L i The pth data set sample is at att j The value under the attribute, Q is the water quality level L i The total number of data set samples, σ ji Water quality level L i The dataset samples are at att j The variance of the values ​​under the attribute, Step 2: Calculate the membership values ​​of the test samples observed by the sensor under the membership model of each attribute corresponding to different levels of water quality. The parameters of each attribute of the water quality target observed by the sensor constitute a test sample X = (x1, x2, ..., x N ), the test sample X has attribute att j Different water quality levels i The membership degree is L i (x j ), where x j For the test sample at att j The value under the attribute; Step 3: Normalize the membership degree obtained in step 2 to determine the initial BPA function; the step of normalizing the membership degree to obtain the initial BPA function is as follows: Normalize the membership degree obtained in step 2 to determine the initial BPA function: the test sample X is at j The membership of water quality of Z levels is obtained under the attributes, which are L1(x j )、L2(x j ),……,L Z (x j ), the generated initial BPA function is: Among them, m j (L i ) indicates that the test sample is at j For water quality level L under properties i Similarly, obtain the initial BPA function for water quality level L under other attributes of the test sample i The initial BPA function is: Z )}、{m2(L1),m2(L2),...,m2(L Z )}、……、{m N (L1),m N (L2),...,m N (L Z )}; Step 4: Obtain the contribution rate C of each attribute based on principal component analysis j ; The detailed steps to obtain the attribute contribution rate are: Step 4-1. Construct the covariance matrix C between attributes: The eigenvalues ​​of each attribute are obtained through the covariance matrix between the attributes, and the contribution rate of each attribute is obtained according to the eigenvalues; among them, M is the total number of data set samples collected by the sensor, y jl and kl The lth sample in the data set is at at j Attributes and att k The value under the attribute, and For the dataset samples in att j Attributes and att k Average value under attribute; Step 4-2, based on the covariance matrix C, obtain the eigenvector and the eigenvalue of each attribute: Cu = λu; u is the eigenvector, λ is the eigenvalue, where the eigenvector of a linear transformation is a non-degenerate vector whose direction remains unchanged under the transformation; the scale of the vector under this transformation is called its eigenvalue; mathematically, if the vector u and the transformation C satisfy Cu = λu, then the vector u is called an eigenvector of the transformation C, and λ is the corresponding eigenvalue; the number of eigenvalues ​​is consistent with the number of attributes, λ j For the attribute att j The eigenvalues ​​of ; after the eigenvalues ​​are normalized, the contribution rate of each attribute is obtained: For Z-level water quality, a reasonable BPA function is generated by using the attribute contribution rate evaluation method in principal component analysis; Step 5: Determine the final basic probability assignment function: Use the attribute contribution rate to discount the initial BPA function obtained in step 3, and use the discounted result as the final basic probability assignment function; according to the attribute contribution rate C j The specific process of discounting the initial BPA function is: where j = 1, 2, …, N, m' j =(m' j (L1), m' j (L2), m' j (L3), m' j (L4), m' j (L5), m' j (Θ)); Step 6: Use the Dempster combination rule to fuse the final basic probability assignment functions in step 5 one by one for a total of N-1 times; the Dempster combination rule is: in, is an empty set, m1 and m2 are the modified BPA functions of the attributes to be fused generated by the above method, θ r and θ u To identify the focal element on the frame Θ, K is the conflict coefficient, which represents the degree of conflict between two pieces of evidence. Generally speaking, the larger K is, the greater the degree of conflict between the two pieces of evidence is. Step 7: Output the detected water quality grade results. The subset corresponding to the largest basic probability assignment in the final fusion result is the final water quality grade.