A Qualitative Analysis Method for Pesticide Residues in Chinese Cabbage Based on Fuzzy Pattern Recognition

Through the fuzzy singular value decomposition method and linear discriminant analysis method combined with the fuzzy covariance matrix clustering method, the small sample problem in high-dimensional spectral data processing is solved, and the rapid and accurate analysis of cabbage pesticide residues is achieved.

CN112801172BActive Publication Date: 2025-06-10黑龙江中诺检验检测有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110098774.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-25
Publication Date
2025-06-10
Estimated Expiration
2041-01-25

AI Technical Summary

Technical Problem

The existing fuzzy linear discrimination method has a ‘small sample problem’ when processing high-dimensional spectral data, resulting in unsatisfactory classification results.

Method used

The identification information of near-infrared spectral data was extracted by fuzzy singular value decomposition method, and the clustering analysis of spectral data was performed by combining linear discriminant analysis method and fuzzy covariance matrix clustering method.

Benefits of technology

The small sample problem of fuzzy linear discrimination method is effectively solved, the clustering speed and classification accuracy are improved, and the qualitative analysis of cabbage pesticide residues can be carried out quickly and accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112801172B_ABST
    Figure CN112801172B_ABST
Patent Text Reader

Abstract

The present invention discloses a qualitative analysis method for pesticide residues in Chinese cabbages by fuzzy pattern recognition, which includes collecting near-infrared spectral data of vegetable samples to be analyzed; and dividing the near-infrared spectral data into training samples x i and test samples #imgabs0#. The discriminant information of the near-infrared spectral data of the vegetables is extracted by using the fuzzy singular value decomposition method; the test samples and the training samples are respectively transformed by using the linear discriminant analysis method; and the transformed test samples and training samples are subjected to spectral data clustering analysis by using the fuzzy covariance matrix clustering method. This method effectively solves the small sample problem of the existing fuzzy linear discriminant method by using the fuzzy singular value decomposition method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of machine learning and artificial intelligence, and particularly relates to a method for qualitative analysis of pesticide residues in Chinese cabbages by fuzzy pattern recognition. Background Art

[0002] At present, applying pesticides has become one of the important measures to control plant insect pests and diseases and improve the yield and quality of agricultural products. However, unreasonable use of pesticides will pose hazards to human health and the environment. Therefore, exploring effective methods for detecting pesticide residue concentrations has research value and significance for ensuring food safety for consumers.

[0003] Near-infrared spectroscopy detection technology is a non-destructive detection technology that uses the characteristics of substances such as absorption, scattering, reflection, and transmission of light to determine their content. Because it meets the characteristics of accuracy, reliability, speed, and non-destruction, it is widely used in the detection of agricultural and sideline products. For Chinese cabbages with different pesticide residues, the reflected near-infrared spectra are different. Using this characteristic, the pesticide residues on Chinese cabbages can be qualitatively analyzed and classified accordingly.

[0004] Fuzzy linear discriminant analysis (FLDA) is based on fuzzy sets and improves the linear discriminant analysis (LDA) method using the fuzzy within-class scatter matrix and the fuzzy total scatter matrix. FLDA can effectively extract the fuzzy discriminant information of samples. However, FLDA has the "small sample problem" when dealing with high-dimensional spectral data.

[0005] Clustering algorithms are divided into two categories. The first category of algorithms is hard clustering algorithms such as the k-means clustering algorithm, etc., which divide a data set into different classes, and each object belongs to only one class. The second category is fuzzy clustering algorithms, which allow an object to belong to multiple classes. Since most objects do not have a strict distinction, the fuzzy clustering algorithm is selected to replace the hard clustering algorithm. The fuzzy C-means clustering algorithm (FCM) is a clustering algorithm based on the minimum square error criterion, which makes the sum of the membership degrees of data points in all classes equal to 1, effectively avoiding solutions with all membership degrees of 0. Summary of the Invention

[0006] To solve the deficiencies in the prior art, the present invention proposes a method for qualitative analysis of pesticide residues in Chinese cabbages by fuzzy pattern recognition, which effectively solves the small sample problem of the existing fuzzy linear discriminant method using the fuzzy singular value decomposition method.

[0007] The technical solution adopted by the present invention is as follows:

[0008] S1, collect the near-infrared spectral data of the vegetable samples to be analyzed; and divide the near-infrared spectral data into training samples x i and test samples

[0009] S2. Extract the discriminant information of the near-infrared spectral data of vegetables using the fuzzy singular value decomposition method;

[0010] S3. Use the linear discriminant analysis method to transform the test samples and training samples in S2 respectively;

[0011] S4. Use the fuzzy covariance matrix clustering method to perform spectral data clustering analysis on the transformed test samples and training samples in S3.

[0012] Furthermore, the method for extracting discriminant information in S2 is as follows:

[0013] S2.1. Calculate the fuzzy membership degree u of the training samples ij :

[0014]

[0015] S2.2. Based on the fuzzy membership degree u of the training samples ij Calculate the fuzzy between-class scatter matrix S of the training samples x i and the fuzzy within-class scatter matrix S fB respectively; fW ;

[0016] S2.3. Based on the fuzzy between-class scatter matrix S fB and the fuzzy within-class scatter matrix S fW , construct matrices H fW and H fB respectively;

[0017] S2.4. Construct matrix fW from matrices H fB and H and perform singular value decomposition on matrix M to obtain the diagonal matrix R and the unitary matrix Q;

[0018] S2.5. Then perform singular value decomposition on matrix P to obtain the unitary matrix V,

[0019] S2.6. Based on the unitary matrix Q, diagonal matrix R, unitary matrix V, and identity matrix I obtained from the singular value decomposition, construct matrix and form the transformation matrix G with the first three column vectors of matrix W;

[0020] S2.7. Use the transformation matrix G to transform the test samples and the training samples x i respectively, and obtain the transformed test samples and the transformed training samples y i = x i G.

[0021] Further, in S3, the linear discriminant analysis method is used to transform the test samples and the training samples y i into the test samples and the training samples zi respectively.

[0022] Further, the method for clustering analysis of spectral data is as follows:

[0023] S4.1, Run the fuzzy C-means clustering on the test samples transformed in S3 to obtain the fuzzy membership degree value u jt,FCM belonging to the j-th class and the class center value v j,FCM , and use u jt,FCM and v j,FCM as the initial fuzzy membership degree value and the initial class center value for subsequent fuzzy clustering; establish the fuzzy clustering objective function:

[0024]

[0025] where, is the distance measure from the test sample to the class center v j,FCM ; d is the dimension of the test sample; S fj,FCM is the fuzzy covariance matrix calculated after running FCM;

[0026]

[0027] where, is the distance measure from the test sample to the class center v s,FCM ;

[0028] S4.3, Based on the parameters calculated in step S4.2 perform iterative calculations on the test samples, and classify the Chinese cabbages according to the fuzzy membership degree values at the end of the iteration.

[0029] Further, the iterative process in S4.3 is as follows:

[0030] S4.3.1, Calculate the fuzzy membership degree of the test sample belonging to the class center γ j :

[0031]

[0032] where, is the distance measure from the test sample to the class center γ j of the j-th class, is the distance measure from the test sample to the class center γ of the j-th classj Distance measure;

[0033] S4.3.2 Calculate the class center:

[0034] After the iteration terminates, classify the near-infrared spectra of vegetables according to the calculated fuzzy membership values.

[0035] Furthermore, S fj,FCM is the fuzzy covariance matrix calculated after running FCM, expressed as:

[0036]

[0037] where is the fuzzy membership value of the test sample belonging to the j-th class after running fuzzy C-means clustering on the test sample and m is the weight exponent;

[0038] Furthermore, the test sample to the class center v s,FCM The distance measure is expressed as:

[0039]

[0040] where v s,FCM is the clustering center belonging to the s-th class obtained after running FCM; S fs,FCM is the fuzzy covariance matrix calculated after running FCM.

[0041] Furthermore, the test sample to the class center γ j The distance measure is expressed as:

[0042]

[0043]

[0044] where S fj is the fuzzy covariance matrix of the j-th class,

[0045] Furthermore, preprocess the near-infrared spectral data of vegetables collected in S1 using multiplicative scatter correction.

[0046] Advantages of the present invention:

[0047] The analysis method proposed by the present invention uses near-infrared spectroscopy technology to detect four kinds of pesticide residues, solves the problem of unsatisfactory classification effect of traditional hard clustering algorithms, and has the characteristics of fast clustering speed and high classification accuracy. In addition, in the analysis process of the method of the present invention, the fuzzy singular value decomposition method is used to process the data, which solves the "small sample problem" of the existing fuzzy linear discriminant method. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 is the overall flowchart of the method of the present invention;

[0049] Figure 2 is the distribution diagram of the test sample set;

[0050] Figure 3 is the distribution diagram of the initial fuzzy membership values;

[0051] Figure 4 is the fuzzy membership graph of the fuzzy covariance matrix clustering method. DETAILED DESCRIPTION OF THE INVENTION

[0052] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0053] In this embodiment, the detection object is taken as Chinese cabbage as an example, and the present invention provides Figure 1 a qualitative analysis method for pesticide residues in Chinese cabbage by fuzzy pattern recognition as shown. The specific steps are as follows:

[0054] S1, Collect the near-infrared spectral data of the Chinese cabbage samples to be analyzed, use a Fourier near-infrared spectrometer to detect the Chinese cabbage samples, obtain the near-infrared diffuse reflection spectral data of the Chinese cabbage samples, and store the spectral data in a computer.

[0055] In this embodiment, the Chinese cabbage samples are thoroughly washed with warm water to ensure no pesticides, and then the processed Chinese cabbage samples are divided into 4 groups; the pesticide selected is lambda-cyhalothrin and different ratios of pesticides are used to treat the 4 groups of Chinese cabbage samples respectively. The 4 groups of Chinese cabbage are as follows: Group 0 has no pesticide, Group 1 has a pesticide-to-water ratio of 1:500, Group 2 has a ratio of 1:100, and Group 3 has a ratio of 1:20. The temperature and relative humidity in the laboratory remain unchanged. The Agilent Cary 630FTIR spectrometer is turned on and preheated for 1 h. The near-infrared spectrum of Chinese cabbage is collected in the reflection integrating sphere mode, with a resolution of 8 cm-1, and each sample is scanned 64 times.

[0056] S2. Preprocess the collected near-infrared spectral data of Chinese cabbage using multiplicative scatter correction (MSC) to eliminate scattering effects and improve the signal-to-noise ratio of the data. And divide the preprocessed near-infrared spectral data into training samples \(x_i\), \(i = 1, 2, \ldots, n\) i , \(i = 1, 2, \ldots, n\) 1 and test samples \(t = 1, 2, \ldots, n\) 2 , \(n\) 1 is the number of training samples, \(n\) 1 = 120; \(n\) 2 is the number of test samples, \(n\) 2 = 40.

[0057] S3. Extract the discriminant information of the near-infrared spectral data of Chinese cabbage using the fuzzy singular value decomposition method.

[0058] S3.1. Calculate the fuzzy membership degrees of the training samples as follows:

[0059]

[0060] where \(u_{ij}\) ij is the fuzzy membership degree of the training sample \(x_i\) i belonging to the \(j\)-th class, \(v_j\) j is the sample mean of the \(j\)-th (\(j = 1, 2, 3, 4\)) class samples in the training sample set; \(c\) is the number of classes, \(c = 4\), \(1 < c < n\) 1 , \(v_k\) k is the sample mean of the \(k\)-th (\(k = 1, 2, 3, 4\)) class samples of the training samples.

[0061] S3.2. Calculate the fuzzy between-class scatter matrix \(S_B\) i and the fuzzy within-class scatter matrix \(S_W\) fB of the training sample \(x_i\) respectively according to the following formula, specifically: fW where

[0062]

[0063]

[0064] where is the total mean of the training samples, is the fuzzy membership degree of the sample \(x_i\) i belonging to the \(j\)-th class with the weight index \(m\); \(m\) is the weight index, \(m = 2\).

[0065] S3.3. Based on the fuzzy between-class scatter matrix \(S_B\) i and the fuzzy within-class scatter matrix \(S_W\) fB of the training sample \(x_i\), construct matrices \(H\) fW and \(H\) fW and \(H\)fB , satisfying Thus, it is obtained that:

[0066]

[0067]

[0068] wherein, j = 1, 2,..., c is the set of fuzzy membership degree vectors of the training samples of the j-th class, is the fuzzy membership degree vector of the n-th 1 sample of the j-th class; j = 1, 2,..., c is the set of products of the training samples of the j-th class and the square roots of the corresponding membership degrees, such as is the product of the square root of the fuzzy membership degree vector of the n-th 1 sample and the n-th 1 training sample; j = 1, 2,..., c is the set of products of the mean value v j of the training samples of the j-th class and the square roots of each corresponding fuzzy membership degree, is the mean value of the training samples, e is the unit column matrix, expressed as X is the training sample matrix, d is the sample dimension; is the set of products of the training samples of the c-th class and the square roots of the corresponding membership degrees; is the set of products of the mean value of the training samples of the c-th class and the square roots of each corresponding fuzzy membership degree.

[0069] S3.4, construct the matrix fW from the matrices H fB and H and perform singular value decomposition on the matrix M to obtain R is a diagonal matrix, Q is a unitary matrix obtained by singular value decomposition of the matrix M, i.e., Q T Q = I, I is the unit matrix; P is an orthogonal matrix.

[0070] S3.5, perform singular value decomposition on the matrix P to obtain P = UΣV T . V is a unitary matrix obtained by singular value decomposition of P; U is an orthogonal matrix; Σ is a diagonal matrix.

[0071] S3.6, construct the matrix based on the unitary matrix Q, diagonal matrix R, unitary matrix V and unit matrix I obtained from the above formula. The matrix formed by the first 3 column vectors of the matrix W is G, and the obtained G is the transformation matrix.

[0072] S3.7, use the transformation matrix G to respectively transform the t-th (t = 1, 2,..., n 2) test samples and the i-th (i = 1, 2, …, n 1 ) training samples x i are transformed as follows: y i = x i G.

[0073] S4. Using the linear discriminant analysis (LDA), the test samples in S3.7 and the training samples y i are respectively transformed into test samples and training samples z i . The test samples are distributed as Figure 2 shown.

[0074] S5. Using the fuzzy covariance matrix clustering method for spectral data clustering analysis, the specific process is as follows:

[0075] S5.1. After running the fuzzy C-means clustering (FCM) on the transformed test samples in S4 , the fuzzy membership degree values u jt,FCM belonging to the j-th class and the class center values v j,FCM are obtained, and the fuzzy membership degree values u jt,FCM and the class center values v j,FCM are used as the initial fuzzy membership degree values and initial class center values for subsequent fuzzy clustering. The fuzzy membership degree values u jt,FCM are as Figure 3 shown.

[0076] Establish the fuzzy clustering objective function:

[0077]

[0078] is the distance measure from the test sample to the class center v j,FCM ; d is the dimension of the test sample; S fj,FCM is the fuzzy covariance matrix calculated after running FCM, expressed as:

[0079]

[0080] where, is the fuzzy membership degree value of the test sample belonging to the j-th class after running the fuzzy C-means clustering (FCM) on the test sample , m is the weight index;

[0081] S5.2 Calculate the parameter 1 < s, j < c; where, m is the weight index. Is the test sample To the class center v s,FCM The distance measure, expressed as: v s,FCM Is the cluster center belonging to the sth (s = 1, 2,..., c) class obtained after running FCM; S fs,FCM Is the fuzzy covariance matrix calculated after running FCM.

[0082] S5.3, Based on the parameters calculated in step S5.2 For the test samples in S4 Perform iterative calculations, and classify Chinese cabbages according to the fuzzy membership values at the end of the iteration. The specific iterative process is as follows:

[0083] S5.3.1, Calculate the fuzzy membership:

[0084]

[0085] In the above formula, the test sample To the class center γ j The distance measure γ j Is the class center of the jth class, S fj Is the fuzzy covariance matrix of the jth class, expressed as:

[0086]

[0087] μ jt Is the test sample Belongs to the class center γ j The fuzzy membership;.

[0088] S5.3.2 Calculate the class center:

[0089]

[0090] γ j Is the class center of the jth class.

[0091] When the iteration terminates, classify the near-infrared spectra of Chinese cabbages according to the calculated fuzzy membership values. The fuzzy membership after iteration is as Figure 4 Shown.

[0092] The above embodiments are only used to illustrate the design idea and characteristics of the present invention, and its purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, all equivalent changes or modifications made according to the principles and design ideas disclosed by the present invention are within the protection scope of the present invention.

Claims

1. A qualitative analysis method for pesticide residues in Chinese cabbage based on fuzzy pattern recognition, characterized in that, it includes the following steps: S1, collect the near-infrared spectral data of the Chinese cabbage sample to be analyzed; and divide the near-infrared spectral data into training samples x i and test samples S2. Extract the discriminant information of the near-infrared spectral data of Chinese cabbage by using the fuzzy singular value decomposition method; S3. Use the linear discriminant analysis method to transform the test samples and training samples in S2 respectively; S4. Use the fuzzy covariance matrix clustering method to perform spectral data clustering analysis on the transformed test samples and training samples in S3; The method for extracting discriminant information in S2 is: S2.1, calculate the fuzzy membership degree u of the training samples ij : where c is the number of categories, and v j is the sample mean of the j-th category samples in the training sample set, and v k is the sample mean of the k-th category samples of the training samples; S2.2, based on the fuzzy membership degree u of the training samples ij Calculate the fuzzy between-class scatter matrix S i of the training samples x fB and the fuzzy within-class scatter matrix S fW ; S2.3, based on the fuzzy between-class scatter matrix S fB and the fuzzy within-class scatter matrix S fW , construct matrices H fW and H fB ; S2.4, from matrix H fW and H fB Construct matrix and perform singular value decomposition on matrix M to obtain diagonal matrix R, unitary matrix Q, and orthogonal matrix P; S2.

5. Then perform singular value decomposition on the orthogonal matrix P to obtain the unitary matrix V, S2.6, construct a matrix from the unitary matrix Q, diagonal matrix R, unitary matrix V, and identity matrix I obtained based on singular value decomposition; the transformation matrix G formed by the first three column vectors of matrix W; S2.7, use the transformation matrix G to transform the test samples and the training samples x i respectively, and obtain the transformed test samples and the transformed training samples y i = x i G; In S3, the linear discriminant analysis method is used to convert the test samples and the training samples y i into the test samples and the training samples z i ; The method for spectral data clustering analysis is: S4.1, for the test samples after the transformation in S3 After running the fuzzy C-means clustering, obtain the fuzzy membership value u belonging to the j-th class jt,FCM and the class center value v of the j-th class j,FCM , and use u jt,FCM and v j,FCM as the initial fuzzy membership value and the initial class center value for subsequent fuzzy clustering; establish the fuzzy clustering objective function: Among them, is the test sample to the class center v j,FCM distance measure; d is the dimension of the test sample; S fj,FCM is the fuzzy covariance matrix calculated after running FCM; S4.2, Calculate parameters Among them, is the distance measure of the test sample to the class center v s,FCM ; m is the weight index; S4.3, based on the parameters calculated in step S4.2 Perform iterative calculations on the test samples to classify Chinese cabbages according to the fuzzy membership values at the end of the iteration.

2. A qualitative analysis method for pesticide residues in Chinese cabbage based on fuzzy pattern recognition according to claim 1, characterized in that, The iterative process in S4.3 is: S4.3.1, Calculate the test sample The fuzzy membership degree belonging to the class center γ j is as follows: Among them, is the distance measure of the test sample to the class center γ of the j-th class j , and is the distance measure of the test sample to the class center γ of the s-th class j . S4.3.2 Calculate the class center: where n 2 is the number of test samples; after the iteration terminates, the near-infrared spectrum of Chinese cabbage is classified according to the calculated fuzzy membership degree values.

3. A qualitative analysis method for pesticide residues in Chinese cabbage based on fuzzy pattern recognition according to claim 1, characterized in that, S fj,FCM is the fuzzy covariance matrix calculated after running FCM, expressed as: Among them, is the fuzzy membership degree value of the test sample belonging to the j-th class after running the fuzzy C-means clustering on the test sample where m is the weight index and n 2 is the number of test samples.

4. A qualitative analysis method for pesticide residues in Chinese cabbage based on fuzzy pattern recognition according to claim 1, characterized in that, Test sample to the class center v s,FCM distance measure is expressed as: Among them, v s,FCM is the clustering center belonging to the s-th class obtained after running FCM; S fs,FCM is the fuzzy covariance matrix calculated after running FCM.

5. A qualitative analysis method for pesticide residues in Chinese cabbage based on fuzzy pattern recognition according to claim 2, characterized in that, Test sample to the class center γ j distance measure is expressed as: Among them, S fj is the fuzzy covariance matrix of the j-th class, 6. A qualitative analysis method for pesticide residues in Chinese cabbage based on fuzzy pattern recognition according to any one of claims 1-5, characterized in that, The near-infrared spectral data of Chinese cabbage collected in S1 is preprocessed by multivariate scattering correction.

Citation Information

Patent Citations

  • Tea leaf near infrared spectrum classification method based on fuzzy orthogonal linear discriminant analysis

    CN110414549A

  • Chinese cabbage pesticide residue qualitative analysis method based on possibility clustering

    CN111595805A