Improved meat variety classification method based on fuzzy c-means clustering
By improving the fuzzy C-means clustering algorithm and utilizing Euclidean distance function, multivariate scattering correction, and principal component analysis, the robustness problem of fuzzy C-means clustering in noisy environments was solved, achieving high-accuracy classification of meat varieties.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-20
- Publication Date
- 2026-03-03
AI Technical Summary
The fuzzy C-means clustering algorithm is not robust in noisy environments, resulting in low accuracy in meat variety classification.
The Euclidean distance function is used as the distance measure. By increasing the weight of normal data and decreasing the weight of noisy data points, the fuzzy C-means clustering algorithm is improved. Combined with multivariate scattering correction and principal component analysis, fuzzy identification information is extracted and cluster analysis is performed.
It improved the clustering accuracy of meat variety classification, enabling rapid and accurate meat variety classification.
Smart Images

Figure CN116561617B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of pattern recognition and artificial intelligence, specifically to an improved fuzzy C-means clustering method for classifying meat varieties, which is applied to meat variety classification. Background Technology
[0002] Meat is a common food in people's daily lives, containing essential nutrients for the human body. Meat is nutritious, delicious, and can aid brain development, protect the brain against aging, and provide sufficient energy for muscle growth. Therefore, researching a simple, rapid, and accurate method for classifying meat varieties is of great significance.
[0003] Mid-infrared spectroscopy is the absorption spectrum of a substance in the mid-infrared region, generally defined as the infrared band with wavelengths of 2.5-25 μm. Mid-infrared spectroscopy is a non-destructive detection technique that utilizes the absorption, scattering, reflection, and transmission properties of light to determine the content of its components. It is widely used in the detection of agricultural and sideline products due to its accuracy, reliability, speed, and non-destructive nature. Different varieties of meat have different reflected mid-infrared spectra; this principle can be used to classify different meat varieties.
[0004] Fuzzy C-means clustering (FCM), as one of the classic fuzzy clustering algorithms, has wide applications in pattern recognition, machine vision, and other fields. This algorithm obtains the distribution of data by performing cluster analysis on unlabeled samples. However, its robustness is poor in noisy environments, easily leading to low classification accuracy. Summary of the Invention
[0005] This invention addresses the problem of poor robustness of FCM (Fuzzy Clustering Method) in noisy environments, leading to low clustering accuracy. It presents an improved fuzzy clustering method that, compared to existing methods, utilizes an Euclidean distance function as the distance metric. This function analyzes the data weights, increasing the weights of normal data points and decreasing the weights of noisy data points to reduce the impact of outliers on clustering performance, thus improving the algorithm's robustness. This invention offers advantages such as high clustering accuracy, fast detection speed, and simple operation.
[0006] An improved fuzzy C-means clustering method for meat variety classification includes the following steps:
[0007] S1, Data acquisition of infrared spectra in meat samples: Fourier transform infrared spectrometer is used to scan and detect different varieties of meat samples, and the collected infrared spectral data of meat is stored in the computer.
[0008] S2, using multivariate scattering correction (MSC) to preprocess the infrared spectra of meat.
[0009] S3 involves dimensionality reduction of the infrared spectral data of meat samples. Principal component analysis (PCA) is used to reduce the dimensionality of the preprocessed infrared spectral data of meat samples from S2.
[0010] S4, Fuzzy identification information extraction from the mid-infrared spectrum of meat. A fuzzy identification information extraction method is used to extract the identification information from the dimensionality-reduced mid-infrared spectral data in S3. The specific steps are as follows:
[0011] S4.1, Initialization: Set the number of training samples for meat to N1, the number of test samples to N2, the weight index to m, and the number of categories to c, where m > 1;
[0012] S4.2, calculate the i-th (1≤i≤N1) training sample x i (x i The fuzzy membership degree u of the training sample of class t (1≤t≤c) belonging to class j (1≤j≤c) ij :
[0013] ||x i -v j ||For sample x i To class center v j The Euclidean distance.
[0014] S4.3 Calculate the fuzzy intra-class scatter matrix H using the fuzzy membership matrix U. fw And the fuzzy class scatter matrix H fb :
[0015]
[0016]
[0017] in,
[0018] S4.4 to H fb SVD decomposition yields According to H fb rank r of a matrix b Obtain U respectively b and D b The first r b The columns form a new U b and D b .
[0019] S4.5 Using matrices For H fw Transform
[0020] S4.6 pairs SVD decomposition yields according to rank r w Obtain U respectively w and D w The first r w The columns form a new U w and D w .
[0021] S4.7 Calculate the transformation matrix Project the k-th (1≤k≤N2) test sample onto W to obtain test sample data containing discrimination information.
[0022] S5 employs an improved fuzzy C-means clustering method to classify meat varieties from the meat test samples containing identification information in S4. The implementation steps are as follows:
[0023] S5.1, Initialize parameters: Set the weight index m, the number of categories c, where m > 1; Set the initial loop value r, the maximum number of loops r max Set the iteration precision ε; Set the initial cluster centers V (0) .
[0024] S5.2, calculate the r-th (r=1,2,3…r) max Fuzzy membership degree at the next iteration
[0025]
[0026] Among them, D ik For the k-th class of sample data x k The class center of the i-th class at the (r-1)-th iteration. The distance norm, and For sample x k To the class center Euclidean distance; parameter σ 2 The covariance matrix between samples, in The mean of all sample data. A fuzzy membership matrix is composed of c fuzzy membership degrees.
[0027] S5.3, calculate the r-th (r=1,2,3…r) max Fuzzy membership degree at the next iteration
[0028]
[0029] in The class center v is calculated in the r-th iteration. iThe value is composed of a class center matrix consisting of c class centers.
[0030] S5.4, the number of iterations increases, i.e., r = r + 1; if the condition is met: ||V (r) -V (r-1) ||<ε or r>r max If the calculation terminates, continue to step S5.2 to classify meat varieties based on the calculated fuzzy membership degrees.
[0031] The beneficial effects of this invention are:
[0032] 1. The present invention provides an improved fuzzy C-means clustering method for meat variety classification. It adopts the Euclidean distance function as a new distance measure, which improves the robustness of the fuzzy clustering algorithm and achieves a higher clustering accuracy than the original fuzzy C-means clustering, enabling rapid classification of meat varieties.
[0033] 2. An improved fuzzy C-means clustering method of the present invention is used for mid-infrared spectral data. By reducing the weight of noisy data and increasing the weight of normal data, the clustering accuracy can be improved. Attached Figure Description
[0034] Figure 1 This is a flowchart of the present invention;
[0035] Figure 2 This is the mid-infrared spectrum of meat;
[0036] Figure 3 This is the infrared spectrum of meat after multivariate scattering correction processing;
[0037] Figure 4 This is a data graph obtained from principal component analysis;
[0038] Figure 5 It is an improved version of fuzzy membership degree generated by fuzzy C-means clustering. Detailed Implementation
[0039] The invention will now be further described with reference to the accompanying drawings.
[0040] like Figure 1 As shown, an improved method for meat variety classification using fuzzy C-means clustering includes the following steps:
[0041] S1, Data acquisition of infrared spectra in meat samples: Fourier transform infrared spectrometer is used to scan and detect different varieties of meat samples, and the collected infrared spectral data of meat is stored in a computer.
[0042] Fresh chicken, pork, and turkey meat were collected, with 40 samples of each type, totaling 120 samples. All samples (approximately 100g) were chopped using a blender, washed with detergent solution and distilled water, and then dried. All spectra were collected using a Spectra-Tech (Applied Systems Inc.) Fourier Transform Infrared (FTIR) spectrometer system, with samples directly diffused onto an attenuated total reflectance (ATR) element. For each spectrum, 64 clutter plots were added and a trigonometric transformation was performed before Fourier transform. The wavenumbers for the spectral scans ranged from 800 to 4000 cm⁻¹. -1 Each meat sample collected contained 448-dimensional spectra. The mid-infrared spectrum of the meat is shown below. Figure 2 As shown.
[0043] S2, preprocessing the mid-infrared spectrum of meat using multivariate scattering correction (MSC). The preprocessed mid-infrared spectrum is shown below. Figure 3 As shown.
[0044] S3, dimensionality reduction of the infrared spectral data of meat. Principal component analysis (PCA) is used to reduce the dimensionality of the preprocessed infrared spectral data of meat in S2. The eigenvalues and eigenvectors of the spectra in S2 are calculated using PCA, and the eigenvalues are arranged from largest to smallest as follows: λ1 = 0.0329, λ2 = 0.0055, λ3 = 0.00073, λ4 = 0.00033, λ5 = 0.00022. The infrared spectra of the meat samples are projected onto the five eigenvectors to obtain 5-dimensional data, i.e., compressed from 448 dimensions to 5 dimensions, as shown below. Figure 4 As shown.
[0045] S4, Fuzzy identification information extraction from the mid-infrared spectrum of meat: A fuzzy identification information extraction method is used to extract the identification information from the dimensionality-reduced mid-infrared spectral data in S3. The specific steps are as follows:
[0046] S4.1, Initialization: Set the number of training samples for meat to N1 = 30, the number of test samples to N2 = 10, the weight index m = 2, and the number of categories c = 3;
[0047] S4.2, calculate the i-th (1≤i≤N1) training sample x i (x i The fuzzy membership degree u of the training sample of class t (1≤t≤c) belonging to class j (1≤j≤c) ij :
[0048] ||x i -v j ||For sample x i To class center v jThe Euclidean distance.
[0049] S4.3 Calculate the fuzzy intra-class scatter matrix H using the fuzzy membership matrix U. fw And the fuzzy class scatter matrix H fb :
[0050]
[0051]
[0052] in, It is the mean of the training samples, v1, v2, ... v c denoted as the mean values of the training samples of class 1, class 2, and class c, respectively.
[0053] S4.4 to H fb SVD decomposition yields According to H fb rank r of a matrix b Obtain U respectively b and D b The first r b The columns form a new U b and D b .
[0054] S4.5 Using matrices For H fw Transform
[0055] For H fw The transformation matrix.
[0056] S4.6 pairs SVD decomposition yields according to rank r w Obtain U respectively w and D w The first r w The columns form a new U w and D w .
[0057] S4.7 Calculate the transformation matrix Project the k-th (1≤k≤N2) test sample onto W to obtain test sample data containing discrimination information.
[0058] Calculation yields:
[0059] S5 employs an improved fuzzy C-means clustering method to classify meat varieties from the meat test samples containing identification information in S4. The implementation steps are as follows:
[0060] S5.1 Initialization parameters: Set the weight index m = 2, the number of categories c = 3; set the initial loop value r = 1, and the maximum number of loops r max =100; Set iteration precision ε = 0.00001; Set initial cluster centers V (0) :
[0061]
[0062] S5.2, calculate the r-th (r=1,2,3…r) max Fuzzy membership degree at the next iteration
[0063]
[0064] Among them, D ik For the k-th class of sample data x k The class center of the i-th class at the (r-1)-th iteration. The distance norm, and For sample x k To the class center Euclidean distance; parameter σ 2 The covariance matrix between samples, in The mean of all sample data. A fuzzy membership matrix is composed of c fuzzy membership degrees. Figure 5 This represents the final fuzzy membership value for meat.
[0065] The calculation yields:
[0066] S5.3, calculate the r-th (r=1,2,3…r) max Fuzzy membership degree at the next iteration
[0067]
[0068] in The class center v is calculated in the r-th iteration. i The value is composed of a class center matrix consisting of c class centers.
[0069] The final cluster centers were calculated as follows:
[0070] S5.4, the number of iterations increases, i.e., r = r + 1; if the condition is met: ||V (r) -V (r-1) ||<ε or r>r maxIf the calculation terminates, continue to step S5.2 to classify meat varieties based on the calculated fuzzy membership degrees.
[0071] The above iterative calculation results show that the meat classification accuracy of an improved fuzzy C-means clustering algorithm is 100%.
[0072] The detailed descriptions listed above are merely specific descriptions of feasible embodiments of the present invention, and are not intended to limit the scope of protection of the present invention. All equivalent methods or modifications that do not depart from the technology of the present invention should be included within the scope of protection of the present invention.
Claims
1. An improved fuzzy C-means clustering method for classifying meat varieties, characterized in that, Includes the following steps: S1, Collect infrared spectral data from meat samples; S2, preprocessing the infrared spectrum of meat; S3 performs dimensionality reduction processing on infrared spectral data of meat. S4, extract fuzzy identification information from the infrared spectrum of meat; S5 uses improved fuzzy C-means clustering to perform fuzzy clustering on the meat test samples containing identification information in S4 to classify meat varieties; The steps implemented by S5 are as follows: S5.1, Initialize parameters: Set the weight index m, the number of categories c, where m > 1; Set the initial value r of the loop, and the maximum number of loops r. max Set the iteration precision ε; Set the initial cluster centers V (0) ; S5.2, calculate the r-th (r=1,2,3…r) max Fuzzy membership degree at the next iteration Among them, D ik For the k-th class of sample data x k The class center of the i-th class at the (r-1)-th iteration. The distance norm, and For sample x k To the class center Euclidean distance; parameter σ 2 The covariance matrix between samples, in The mean of all sample data. A fuzzy membership matrix is composed of c fuzzy membership degrees. S5.3, calculate the r-th (r=1,2,3…r) max Fuzzy membership degree at the next iteration in The class center v is calculated in the r-th iteration. i The value is composed of a class center matrix consisting of c class centers. S5.4, the number of iterations increases, i.e., r = r + 1; if the condition is met: ||V (r) -V (r-1) ||<ε or r>r max If the calculation terminates, continue to step S5.2 to classify meat varieties based on the calculated fuzzy membership degrees.
2. The improved fuzzy C-means clustering method for meat variety classification according to claim 1, characterized in that, The implementation of S1 involves scanning and detecting different types of meat samples using a Fourier transform mid-infrared spectrometer, and storing the collected meat mid-infrared spectral data in a computer; specifically as follows: The samples were chopped using a mixer, washed with detergent solution and distilled water, and dried. All spectra were collected on a Spectra-Tech Fourier Transform Infrared (FTIR) spectrometer system. The samples were directly diffused onto an attenuated total reflectance (ATR) element. For each spectrum, 64 clutter plots were added and a trigonometric transformation was performed before Fourier transform. The wavenumbers for the spectral scans ranged from 800 to 4000 cm⁻¹. -1 The spectrum of each meat sample collected was 448-dimensional data.
3. The improved fuzzy C-means clustering method for meat variety classification according to claim 1, characterized in that, The implementation of S2 involves preprocessing the infrared spectrum of meat using multivariate scattering correction (MSC).
4. The improved fuzzy C-means clustering method for meat variety classification according to claim 1, characterized in that, The implementation of S3 involves using principal component analysis (PCA) to reduce the dimensionality of the preprocessed infrared spectral data of meat in S2.
5. The improved fuzzy C-means clustering method for meat variety classification according to claim 4, characterized in that, The specific method for dimensionality reduction is as follows: calculate the eigenvalues and eigenvectors, arrange the eigenvalues from largest to smallest into 5, and project the infrared spectrum of the meat sample onto the 5 eigenvectors to obtain 5-dimensional data, that is, compress from 448 dimensions to 5 dimensions.
6. The improved fuzzy C-means clustering method for meat variety classification according to claim 1, characterized in that, The implementation of S4 involves using a fuzzy identification information extraction method to extract the identification information from the dimensionality-reduced mid-infrared spectral data in S3; specifically as follows: S4.1, Initialization: Set the number of training samples for meat to N1, the number of test samples to N2, the weight index to m, and the number of categories to c, where m>1; S4.2, calculate the i-th (1≤i≤N1) training sample x i (x i The fuzzy membership degree u of the training sample of class t (1≤t≤c) belonging to class j (1≤j≤c) ij : ||x i -v j ||For sample x i To class center v j The Euclidean distance; S4.3 Calculate the fuzzy intra-class scatter matrix H using the fuzzy membership matrix U. fw And the fuzzy class scatter matrix H fb : in, S4.4 to H fb SVD decomposition yields According to H fb rank r of a matrix b Obtain U respectively b and D b The first r b The columns form a new U b and D b ; S4.5 Using matrices For H fw Transform S4.6 pairs SVD decomposition yields according to rank r w Obtain U respectively w and D w The first r w The columns form a new U w and D w ; S4.7 Calculate the transformation matrix Project the k-th (1≤k≤N2) test sample onto W to obtain test sample data containing discrimination information.
7. The improved fuzzy C-means clustering method for meat variety classification according to claim 6, characterized in that, When the collected samples consisted of chicken, pork, and turkey, the calculations were as follows:
8. The improved fuzzy C-means clustering method for meat variety classification according to claim 1, characterized in that, When the collected samples consist of chicken, pork, and turkey, the initial cluster centers are...
9. The improved fuzzy C-means clustering method for meat variety classification according to claim 1, characterized in that, When the collected samples consist of three types of meat: chicken, pork, and turkey, calculate the fuzzy membership matrix.
Citation Information
Patent Citations
Fuzzy maximum entropy clustering-based tea near-infrared spectrum classification method
CN110108661A
Fast clustering algorithm based on kernel fuzzy c-means integrated with spatial constraints
US20210081827A1