A classification method of apple near infrared spectrum based on exponential distance measure fuzzy clustering
By using the exponential distance measurement fuzzy clustering method in the PFCM clustering method and combining the Gath-Geva clustering method, the problem of low classification accuracy caused by Euclidean distance measurement in Apple's near-infrared spectral data processing is solved, and efficient and accurate identification of apple varieties.
Patent Information
- Application Number
- CN202010386932.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-09
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-05-09
AI Technical Summary
The existing PFCM clustering methods are difficult to obtain ideal clustering effects when processing Apple's near-infrared spectral data, especially due to the different shapes, sizes and density caused by the Euclidean distance measurement, which leads to low classification accuracy.
Combining the PFCM clustering method with the Gath-Geva clustering method, using an exponential distance measurement based on the fuzzy maximum probability evaluation standard, replacing the original Euclidean distance measurement, an apple near-infrared clustering with fuzzy clustering of exponential distance measurements is designed. Spectral classification method.
Accurate clustering of Apple near-infrared spectral data of various morphology, sizes and density is achieved, reducing detection costs, improving identification speed and classification accuracy, and avoiding information loss problems caused by principal component analysis.
Smart Images

Figure CN111595803B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of apple variety identification, and in particular to an apple near-infrared spectrum classification method based on exponential distance measurement fuzzy clustering. Background Art
[0002] Apples are rich in nutrients that are essential to the human body. However, different apple varieties often result in different nutritional components and tastes. Physical and chemical testing of apples to identify apple varieties is very time-consuming, which usually requires measuring sugar content, acidity and establishing mathematical models. Although physical and chemical testing can obtain high-accuracy and high-reliability apple variety identification results, it generally has problems such as high cost, low efficiency, cumbersome steps, time-consuming and labor-intensive, and great product damage.
[0003] Near infrared spectroscopy has the advantages of convenience, rapidity, high efficiency, non-destructiveness and low cost. As a detection tool, it has been widely used in various fields. The wave number range of near infrared spectroscopy is 10000cm -1 ~4000cm -1 The fundamental frequencies of chemical bond vibrations of most inorganic and organic compounds are in this region. The near-infrared absorption spectra of different molecules vary depending on the functional groups, types of compounds, and stereostructures of the compounds. In fact, different types of apples have different organic matter contents, so the diffuse reflectance near-infrared spectra are also different, which also makes it possible to use near-infrared spectroscopy technology to identify tea varieties.
[0004] The Possibilistic Fuzzy C-Means (PFCM) clustering method (Nikhil, R.-P., Kuhu, P., James, M.-K., James, C.-B., A Possibilistic Fuzzy c-Means Clustering Algorithm, IEEE Trans. Fuzzy Systems, 2005, 13(4): 517-530) solves the noise sensitivity defect of fuzzy C-means clustering (FCM) and overcomes the cluster overlap problem of possible C-means clustering (PCM). Since the Euclidean distance measure is used in the objective function of PFCM, it is difficult for PFCM to obtain ideal clustering effect when processing sample data of different shapes, sizes and densities.
[0005] A near-infrared spectrometer was used to collect near-infrared spectral data of multiple varieties of apples. After the collected near-infrared diffuse reflectance spectral data of the samples were reduced in dimension through principal component analysis (PCA), the boundaries of the data of each variety of apples were often irregular in shape. If PFCM based on Euclidean distance was used to cluster and analyze the near-infrared spectral data of apples, the classification accuracy would be very low. Summary of the invention
[0006] The present invention is aimed at the shortcomings of the existing PFCM clustering method when clustering apple near-infrared spectrum data, and the PFCM clustering method is scientifically combined with the Gath-Geva clustering method to design an apple near-infrared spectrum classification method of exponential distance measurement fuzzy clustering. Compared with the original PFCM clustering method, the apple near-infrared spectrum classification method of the present invention of exponential distance measurement fuzzy clustering adopts a distance measurement based on fuzzy maximum probability evaluation standard to replace the Euclidean distance measurement in the PFCM clustering method. At the same time, the present invention also has the advantages of low detection cost, fast identification speed, high classification accuracy, etc.
[0007] The principle on which the present invention is based: Studies have shown that the near-infrared diffuse reflectance spectrum of apples contains information on the organic matter content inside the apples. Different varieties of apples have different corresponding near-infrared diffuse reflectance spectra, so the clustering method can be used to classify the near-infrared spectra of different varieties of apples.
[0008] An apple near-infrared spectrum classification method based on exponential distance measurement fuzzy clustering, the specific steps are as follows:
[0009] S1. Collect near-infrared diffuse reflectance spectra of apple samples: Use the diffuse reflectance mode of Antaris II Fourier transform near-infrared (FT-NIR) spectrometer to obtain near-infrared diffuse reflectance spectral data of apple samples. During the spectrum collection process, the temperature, humidity and other external environments of the laboratory should be kept constant as much as possible. At the same time, the near-infrared diffuse reflectance spectral data of apple samples obtained are in the wave number range of 10000cm -1 ~4000cm -1 1557-dimensional data; set the number of categories to C.
[0010] S2, extract identification information from apple near-infrared diffuse reflectance spectrum: divide apple near-infrared spectrum data into training sample set and test sample set, training sample data matrix d is the sample dimension, and n is the number of training samples. The specific steps are as follows:
[0011] (1) Construct the matrix H from the training sample set ft , H fb and H fw as follows:
[0012]
[0013]
[0014] H fw =[A 1 ,A 2 ,...,A c ]
[0015]
[0016] In the above formula,
[0017] c is the number of categories, m (m>1) is the weight index, z i is the i-th (i=1,2,…,n) near-infrared spectrum training sample, is the overall sample mean of the training sample set, is the sample mean of the jth (j=1,2,...,c) class of samples in the training sample set, u ij is the training sample z i The fuzzy membership of the jth (j=1,2,...,c) class is calculated according to the following formula: ij :
[0018]
[0019] (2) For the matrix H fb Perform QR decomposition, H fb =QR, let S fb =RR T , M=Q T H fw , S fw =MM T
[0020] (3) For S fw -1 S fb Singular value decomposition obtains the matrix composed of its eigenvectors P = [φ 1 ,φ 2 ,φ 3 ,......,φ t ],t=rank(H fw ).
[0021] (4) Calculate G = QP, for the kth (k = 1, 2, ..., N) test sample z k ′, after transformation by matrix G, is transformed into: x k =G T z k ′. Where N is the number of test samples.
[0022] S3, identification of apple samples: an apple near-infrared spectrum classification method based on exponential distance measurement fuzzy clustering is used to classify the test sample x that has been processed with identification information in S2. k Conduct cluster analysis to identify the types of apple samples;
[0023] S3.1, initialization: set the threshold ε>0, fuzzy weighting parameters m, w∈(1,+∞), coefficients a>0, b>0, the number of categories is c; determine the maximum number of iterations r max , and the initial iteration counter r 0 =1; the mean of the near-infrared diffuse reflectance spectrum data of the apple samples after dimensionality reduction in S2 is taken as the class center value The fuzzy membership values and cluster center values obtained by running fuzzy C-means clustering are used as the initial fuzzy membership values and the initial cluster centers
[0024] S3.2, calculation parameter β i : During the iteration, the parameter β i Exists as a constant vector; N and c represent the number of test sample data and the number of categories respectively; v i (r-1) is the cluster center value calculated at the r-1th iteration; the fuzzy membership value u ik (r-1) Represents the r-1th iteration sample x k The fuzzy membership value belonging to category i;
[0025] S3.3, calculate the rth (r=1,2,…,r max ) iterations: D ik For sample x k To cluster center v i The distance norm of fi is the fuzzy covariance matrix of the i-th sample category, and p i is the prior probability,
[0026] S3.4, calculate the fuzzy membership value at the rth iteration: u ik (r) is the fuzzy membership value calculated at the rth iteration;
[0027] S3.5, calculate the typical value at the rth iteration: t ik (r) is the fuzzy membership value calculated at the rth iteration;
[0028] S3.6, calculate the cluster center value of the i-th category at the r-th iteration in is the cluster center v calculated in the rth iteration i The value of; cluster center matrix V (r) It consists of c cluster center values, and
[0029] S3.7, the cycle count increases, that is, r = r + 1; if the condition is met: || V (r) -V (r-1) ||<εorr>r max The calculation is terminated, otherwise continue with S3.2 to classify different varieties of apples based on the calculated fuzzy membership values and typical values.
[0030] Beneficial effects of the present invention:
[0031] The present invention discloses an apple near infrared spectrum classification method based on exponential distance measurement fuzzy clustering, which adopts a standard distance measurement based on fuzzy maximum likelihood evaluation, so that apple near infrared spectrum data of various forms, sizes and densities can be clustered more accurately. The present invention does not need to perform principal component analysis when calculating identification information in apple near infrared spectrum data, thus avoiding the disadvantage of losing identification information due to principal component analysis. The present invention can simultaneously generate fuzzy membership values and typical values to analyze apple near infrared spectrum data. It has the advantages of low detection cost, fast identification speed, high classification accuracy, etc., and is suitable for identification of apple varieties as well as identification of other fruit varieties. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 is a flow chart of the present invention;
[0033] Figure 2 It is the near infrared diffuse reflectance spectrum of 200 apple samples;
[0034] Figure 3 is the initial fuzzy membership;
[0035] Figure 4 It is the apple test sample data after the identification information is extracted and processed;
[0036] Figure 5 is the fuzzy membership of fuzzy C-means clustering;
[0037] Figure 6 It is a fuzzy membership degree generated by the fuzzy clustering method with exponential distance measure;
[0038] Figure 7 is a typical value produced by fuzzy clustering methods using an exponential distance measure. DETAILED DESCRIPTION
[0039] The device and method of the present invention are further described below in conjunction with the accompanying drawings and specific implementation examples.
[0040] like Figure 1 As shown, an apple near-infrared spectrum classification method based on exponential distance measurement fuzzy clustering includes the following steps:
[0041] The apple near infrared spectrum classification method of the present invention based on exponential distance measurement fuzzy clustering is suitable for identifying apple varieties, such as Red Fuji, Yellow Banana, Red Star, Guoguang, Gala, Sansa and other apple varieties. Because the organic matter content in different types of apples is different, the diffuse reflectance near infrared spectra are also different, which provides conditions for realizing the identification of apple varieties. For the convenience of description, Red Fuji, Huaniu, Yellow Banana and Ghana are selected as experimental objects.
[0042] Step 1. Collection of near-infrared spectra of apple samples: Four different varieties of apples were collected: Red Fuji, Huaniu, Yellow Banana, and Ghana. The number of samples of each apple was 50, for a total of 200 apple samples. The average weight of each apple sample was: Red Fuji 245g, Huaniu 236g, Yellow Banana 231g, and Ghana 225g. The grade of the selected apple samples was all grade one. In the process of obtaining the near-infrared diffuse reflectance spectral data of the apple samples, the laboratory temperature should be kept at 25±1℃ and the relative humidity should be kept at 50-60% as much as possible. The detailed spectral acquisition process is as follows: First, turn on the Antaris II Fourier transform near-infrared spectrometer and preheat it for 1 hour; secondly, set the wavenumber range, scanning interval, and number of scans of the spectral scan to 10,000 cm -1 ~4000cm -1 、3.856cm -1 , 32; Finally, the diffuse reflectance mode of Antaris II Fourier transform near infrared spectrometer was used to obtain the near infrared diffuse reflectance spectrum data of apple samples. The obtained apple spectrum data was 1557-dimensional high-dimensional data. At the same time, each apple was sampled 3 times, and the mean of the 3 samples was saved in the computer to provide experimental data for the establishment of subsequent models. Set the number of categories c = 4. Figure 2 As shown, this is the near-infrared diffuse reflectance spectrum of 200 apple samples.
[0043] Step 2: Extract identification information from apple near-infrared diffuse reflectance spectra: divide apple near-infrared spectrum data into training sample set (30 training samples per class, totaling n=120 training samples) and test sample set (20 training samples per class, totaling N=80 training samples). The training sample data matrix d = 1557 is the sample dimension, n = 120 is the number of training samples. The specific steps are as follows:
[0044] (1) Construct the matrix H from the training sample setft , H fb and H fw as follows:
[0045]
[0046]
[0047] H fw =[A 1 ,A 2 ,...,A c ]
[0048]
[0049] In the above formula,
[0050] c is the number of categories, c=4; m (m>1) is the weight index, m=2; z i is the i-th (i=1,2,…,n) near-infrared spectrum training sample, is the overall sample mean of the training sample set, is the sample mean of the jth (j=1,2,...,c) class of samples in the training sample set, u ij is the training sample z i The initial fuzzy membership of the jth (j=1,2,...,c) class is calculated according to the following formula: ij :
[0051]
[0052] The initial fuzzy membership u ij like Figure 3 shown.
[0053] (2) For the matrix H fb Perform QR decomposition, H fb =QR, let S fb =RR T , M=Q T H fw , S fw =MM T
[0054] (3) For S fw -1 S fb Singular value decomposition obtains the matrix composed of its eigenvectors P = [φ 1 ,φ 2 ,φ 3 ,......,φ t ],t=rank(H fw ).
[0055] (4) Calculate G = QP, for the kth (k = 1, 2, ..., N) test sample z k ′, after transformation by matrix G, is transformed into: x k =G T z k ′. Where N is the number of test samples, N=80.
[0056] The apple test sample data after identification information extraction is as follows Figure 4 shown.
[0057] Step 3: Identify the types of apple samples: Use an apple near-infrared spectrum classification method based on exponential distance measurement fuzzy clustering to classify the test sample x in S2 that has been processed with identification information. k Perform cluster analysis to identify the types of apple samples:
[0058] A. Initialization process: Set the fuzzy weighting parameters m, w (m, w>1), the number of categories C, the coefficients a>0, b>0; set the initial value of the loop count r and the maximum number of iterations to r max ; Set the iterative maximum error parameter ε; Run the fuzzy C-means clustering to obtain the fuzzy membership value and cluster center value as an exponential distance measure fuzzy clustering method initial fuzzy membership value and cluster center value
[0059] Initialization value settings: From step 1, we can know that: the number of categories C = 4 (i.e. four categories); set the fuzzy weighting parameters m = 2, w = 2; coefficient a = b = 1; the initial value of the number of iterations r 0 = 1 and the maximum number of iterations r max =100, the upper limit of error ε = 0.00001; perform fuzzy C-means clustering (FCM), and the cluster center after the FCM operation is terminated is used as the initial cluster center of the fuzzy clustering method with an exponential distance measure. Fuzzy membership value of fuzzy C-means clustering like Figure 5 As shown, the initial cluster center for:
[0060]
[0061] B. Calculate parameter β using formula (1) i .
[0062] C. Calculate the rth (r=1, 2, ..., r) value by formula (2)-(4). max ) The distance norm D at the iteration ik .
[0063] D. Calculate the fuzzy membership value at the rth iteration using formula (5)
[0064] E. Calculate the typical value at the rth iteration using formula (6)
[0065] F. Calculate the cluster center value of the i-th category at the r-th iteration using formula (7)
[0066] G. The loop count increases, that is, r = r + 1; if the condition is met: || V (r) -V (r-1) ||<εorr>r max The calculation terminates, otherwise continue with step B; according to the above calculation results, the fuzzy membership value and typical value can be obtained and used to finally realize the classification of different types of apples.
[0067] The experimental results are: when the iteration ends, r = 10, and the final cluster center for:
[0068]
[0069] When the iteration ends, the fuzzy membership is Figure 6 As shown in Figure 2, the classification accuracy of apple varieties is 87.5% based on the fuzzy membership value. The typical value at the end of the iteration is as follows: Figure 7 As shown, according to the typical values, the classification accuracy of apple varieties is also 87.5%.
[0070] The series of detailed descriptions listed above are only specific descriptions of feasible implementation methods of the present invention. They are not intended to limit the scope of protection of the present invention. Any equivalent implementation methods or changes that do not deviate from the technical spirit of the present invention should be included in the scope of protection of the present invention.
Claims
1. An apple near-infrared spectrum classification method based on exponential distance measurement fuzzy clustering, characterized in that: The following steps are involved: S1. Collect near-infrared diffuse reflectance spectra of apple samples: Use the diffuse reflectance mode of AntarisII Fourier transform near-infrared FT-NIR spectrometer to obtain near-infrared diffuse reflectance spectral data of apple samples; in the process of collecting spectra, the temperature and humidity of the laboratory should be kept constant as much as possible; at the same time, the near-infrared diffuse reflectance spectral data of apple samples obtained are in the wave number range of 10000cm -1 ~4000cm -1 1557-dimensional data; set the number of categories to c; S2, extract identification information from the apple near-infrared diffuse reflectance spectrum in S1: divide the apple near-infrared spectrum data into a training sample set and a test sample set, and the training sample data matrix d is the sample dimension, n is the number of training samples; the specific steps are as follows: (1) Construct the matrix H from the training sample set ft , H fb and H fw as follows: <h2 style=";text-align:left;direction:ltr">H<h2 style=";text-align:left;direction:ltr"> fw <h2 style=";text-align:left;direction:ltr"> (A1,A2,...,A)<h2 style=";text-align:left;direction:ltr"> c <h2 style=";text-align:left;direction:ltr"> ] In the above formula, c is the number of categories, m is the fuzzy weighting parameter, m>1, z i is the i-th near-infrared spectrum training sample, i=1,2,...,n, is the overall sample mean of the training sample set, is the sample mean of the j-th class of samples in the training sample set, u ij is the training sample z i The fuzzy membership of the jth class, j = 1, 2, ..., c; the u of the training sample is calculated according to the following formula ij : (2) For the matrix H fb Perform QR decomposition, H fb =QR, let S fb =RR T , M=Q T H fw , S fw =MM T ; (3) For S fw -1 S fb Singular value decomposition obtains the matrix composed of its eigenvectors P = [φ1, φ2, φ3, ..., φ t ],t=rank(H fw ); (4) Calculate G = QP, for the kth test sample z k ′, after transformation by matrix G, is transformed into: x k =G T z k ′, k = 1, 2, ..., N, where N is the number of test samples; S3, identification of apple samples: an apple near-infrared spectrum classification method based on exponential distance measurement fuzzy clustering is used to classify the test sample x that has been processed with identification information in S2. k Cluster analysis is performed to identify the types of apple samples. The specific steps are as follows: S3.1, initialization: set the threshold ε>0, fuzzy weighting parameters m, w∈(1,+∞), coefficients a>0, b>0, the number of categories is c; determine the maximum number of iterations r max , and the initial iteration counter r0 = 1; the mean value of the near-infrared diffuse reflectance spectrum data of the apple sample after dimensionality reduction processing in S2 is used as the cluster center value, and the fuzzy membership value and cluster center value obtained by running fuzzy C-means clustering are used as an exponential distance measure as the initial fuzzy membership value of fuzzy clustering and the initial cluster centers S3.2, calculation parameter β i : During the iteration, the parameter β i Exists as a constant vector; N and c represent the number of test sample data and the number of categories respectively; v i (r-1) is the cluster center value calculated at the r-1th iteration; the fuzzy membership value u ik (r-1) Represents the r-1th iteration test sample x k The fuzzy membership value belonging to category i; S3.3, calculate the distance norm at the rth iteration: 1 <i<c,1<k<N,r=1,2,…,r max ;D ik For the test sample x k To cluster center v i The distance norm of fi is the fuzzy covariance matrix of the i-th sample category, and 1 <i<c;p i is the prior probability, S3.4, calculate the fuzzy membership value at the rth iteration: 1 <i<c,1<k<N; S3.5, calculate the typical value at the rth iteration: 1 <i<c,1<k<N; S3.6, calculate the cluster center value of the $i$-th class at the $r$-th iteration: , $1 \lt i \lt c$; the cluster center matrix $V$ (r) consists of $c$ cluster center values, and S3.7, the cycle count increases, that is, r = r + 1; if the condition is met: || V (r) -V (r-1) ||<εorr>r max The calculation is terminated, otherwise continue with S3.2 to classify different varieties of apples based on the calculated fuzzy membership values and typical values.
