A rapid identification method for wool and cashmere fibers
By collecting and processing the near-infrared spectrum data of wool and cashmere textiles, an integrated classifier classification model is constructed, which solves the high cost and damage problems of cashmere and wool fiber identification in the existing technology, achieves fast and accurate identification effects, and overcomes the problem of data Noise and multicollinearity problems are eliminated, and recognition accuracy and model stability are improved.
Patent Information
- Application Number
- CN202410303593.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-18
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-03-18
AI Technical Summary
Existing methods are difficult to quickly identify cashmere and wool fibers at low cost and may cause damage to fabrics. Moreover, the noise and multicollinearity problems of near-infrared spectral data limit its application.
Collect near-infrared spectrum data of wool and cashmere textiles, process them through multiple feature extraction algorithms, build an integrated classifier classification model, use SVM, RF, K-NN and other classifiers for training, adopt majority voting decision-making, and combine MC, SG, MSC and other pre-processing technologies, using the leverage value method, interval influence analysis and continuous projection algorithm for characteristic wavelength screening to achieve fast and accurate fiber identification.
It achieves fast, accurate, and damage-free identification of wool and cashmere textiles, improves the recognition rate and accuracy, overcomes data redundancy and multicollinearity problems, and reduces model complexity and calculation time.
Smart Images

Figure CN118190859B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for identifying wool and cashmere fibers. Background Art
[0002] In recent years, the identification of cashmere and wool textiles has been a hot topic in the textile industry. Cashmere fiber is relatively rare, accounting for only 0.2% of the world's animal fibers, and is one of the world's best quality and most expensive textile materials. Wool fiber is similar to cashmere in appearance and touch, but the price is less than one-tenth of cashmere. Many unscrupulous merchants use lower-priced wool to replace cashmere products in order to make high profits. Therefore, the identification of cashmere and wool fibers has important practical significance in the textile industry.
[0003] At present, there are five main methods for identifying wool and cashmere textiles: physical methods, chemical methods, biological methods, image methods and deep convolutional network methods. Among the first three methods, common identification methods include microscopy, DNA detection and solution methods. The detection results of these methods are highly stable, but the operation is complicated, the cost is relatively high, and the fabric may be damaged. The image method requires the use of morphological and texture features of the sample images taken with a microscope to identify them. If the sample fiber has the problem of missing scales, it will lead to feature loss, which reduces the features that can be used for classification and affects the subsequent identification. Therefore, the image method has the problem of difficulty in identifying fibers with missing scales. The deep convolutional network method is a time-consuming method that requires a large sample size and expensive experimental equipment.
[0004] Near infrared spectroscopy is an emerging analytical method. Near infrared spectroscopy refers to the electromagnetic spectrum between 780-2526nm. The frequency of this spectral region is consistent with multiple frequencies and combined frequencies of various vibration frequencies of the main groups of organic molecules. The one-to-one correspondence between different groups and corresponding characteristic spectral regions can be used to identify fiber types and predict composition.
[0005] Near-infrared spectroscopy combines the near-infrared spectrum of the analyte with mathematical analysis methods for detection and analysis. It has the advantages of low analysis cost, simple instrument operation and maintenance, no damage to the sample before analysis, and no chemical, biological or electromagnetic pollution after analysis. In view of the advantages of this technology, it has been widely used in many analytical fields such as petroleum, chemical industry, agriculture, food processing, and its application in the textile industry is also gradually developing. However, the noise and multicollinearity problems of near-infrared spectral data have brought challenges to data processing and analysis, limiting its application in wool and cashmere identification. Summary of the invention
[0006] In order to solve the technical problems that the existing methods are difficult to quickly identify cashmere and wool fibers at low cost and may cause damage to fabrics during identification, the present invention provides a method for quickly identifying wool and cashmere fibers. The present invention collects near-infrared spectral data of wool and cashmere textiles, processes the collected near-infrared spectral data using multiple feature extraction algorithms, obtains richer data features, and then uses relevant classification algorithms to classify the extracted data features, thereby realizing the determination of the textile components.
[0007] In order to achieve the above object, the present invention adopts the following technical scheme:
[0008] A method for rapid identification of wool and cashmere fibers, which is special in that it comprises the following steps:
[0009] Step 1: Collect near infrared spectrum data of wool and cashmere fabric samples;
[0010] Step 2: The near infrared spectrum data collected in step 1 are processed by MC, SG smoothing, MSC and abnormal data elimination in sequence;
[0011] Step 3: Screen the characteristic wavelengths of the spectral data processed in step 2 and remove invalid characteristic wavelengths;
[0012] Step 4: Screen the characteristic wavelengths screened out in step 3 again to remove redundant characteristic wavelengths;
[0013] Step 5: construct an integrated classifier classification model and perform training based on the characteristic wavelengths selected in step 4; the integrated classifier classification model includes SVM, RF, and K-NN, and majority voting is used to determine the output of the integrated classifier classification model.
[0014] Step 6: Obtain a near-infrared spectrum image of the fabric to be detected, input it into the trained integrated classifier classification model for identification, and obtain the material category of the fabric to be detected.
[0015] Furthermore, step 1 is specifically as follows:
[0016] Step 1.1: Randomly select a certain number of samples from wool and cashmere fabrics of different brands to ensure the diversity and representativeness of the types;
[0017] Step 1.2: Remove the foam and surface impurities of the selected sample;
[0018] Step 1.3: Set the parameters of the Fourier transform infrared spectrometer, including the scanning wavelength range, number of scans and wavenumber resolution. After setting, collect the near-infrared spectrum data of the sample processed in step 1.2; when collecting: fold the sample and place it on the sample stage and ensure good contact between the sample and the sample stage; collect at least ten raw spectrum data for each sample to ensure the universality of each category of samples in the data set; each time the raw spectrum data is collected, at least three measurements are taken and the average value is taken as the raw spectrum data collected this time to ensure the accuracy of each raw spectrum data.
[0019] Furthermore, the method for rapid identification of wool and cashmere fibers is characterized in that in step 2, a leverage value method is used to eliminate abnormal data.
[0020] Furthermore, in step 3, an interval impact analysis algorithm or a competitive adaptive weighted sampling algorithm is used to screen characteristic wavelengths.
[0021] Furthermore, the specific method of using the interval impact analysis algorithm to screen characteristic wavelengths is as follows:
[0022] Step 3.1: Based on Monte Carlo sampling in the variable space, N sub-datasets are obtained;
[0023] Step 3.2: Establish SVM classification models for the N sub-datasets obtained in step 3.1 respectively, select the best penalty factor C from 1 to 12 using the cross-validation method, and calculate the interval of the SVM classification model corresponding to the N sub-datasets;
[0024] Step 3.3: For the interval statistical analysis of the SVM classification model corresponding to the N sub-datasets obtained in step 3.2, select Dmean i >0 and p<0.05 as the wavelength variable; among them, Dmean i =M i,A -M i,B , M i,A is the marginal mean of the SVM classification model including wavelength variable i, M i,B Dmean is the boundary mean of the SVM classification model that does not include wavelength variable i. i >0 means that adding wavelength variable i to the SVM classification model can improve the model performance; p is the difference significance value determined by the non-parametric U test.
[0025] Furthermore, in step 4, a continuous projection algorithm or a random frog leaping algorithm is used to screen characteristic wavelengths.
[0026] The present invention also provides a computer-readable storage medium on which a computer program is stored; the characteristic is that the computer program is a trained integrated classifier classification model obtained in steps 1-5 of the above-mentioned wool and cashmere fiber rapid identification method, which is used to realize material identification of wool and cashmere fabrics when run by a processor.
[0027] The present invention also provides an electronic device, comprising a processor and a storage medium, wherein a computer program is stored on the storage medium, characterized in that: the computer program is a trained integrated classifier classification model obtained in steps 1-5 of the above-mentioned wool and cashmere fiber rapid identification method, and is used to realize material identification of wool and cashmere fabrics when the processor is running.
[0028] The beneficial effects of the present invention are:
[0029] 1. The present invention collects spectral data of wool and cashmere textile samples, extracts characteristic wavelengths of the spectrum using a band processing method, and then uses these characteristic wavelengths as inputs of an integrated classifier classification model, and uses the types of textile samples corresponding to the characteristic wavelengths as outputs of the integrated classifier classification model to train the model, thereby obtaining a classification model with good recognition rate and recognition accuracy. The trained classification model can realize rapid, accurate, and non-destructive identification of wool and cashmere textiles.
[0030] 2. The present invention uses a multi-model fusion strategy to establish an integrated classifier classification model, thereby improving the accuracy of the identification results. Furthermore, in order to achieve a better recognition rate for the model, three classifiers, SVM (support vector machine), RF (random forest), and K-NN (k-nearest neighbor), are selected for integration, wherein the integrated classifier uses majority voting (hard voting) to decide which category to classify in order to optimize the overall model performance.
[0031] 3. The present invention adopts the MIA-SPA characteristic wavelength extraction method to extract the bands containing more information from the spectral data, thereby overcoming the multicollinearity problem caused by data redundancy, making the model less complex and more accurate.
[0032] 4. Currently, a single processing method is often used in spectrum data processing, and the effect after processing is also relatively simple. However, the present invention adopts a combination of multiple processing methods to reduce the difference of the original spectrum data, increase stability, and achieve an ideal spectrum line. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 The figure is a flow chart of a method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to overcome the noise and multicollinearity problems of near infrared spectral data, which bring challenges to data processing and analysis, so as to enable the rapid identification of wool and cashmere using near infrared spectral analysis technology, the present invention mainly adopts the following measures:
[0035] In order to solve the scattering problems such as noise in the data, the present invention uses a variety of spectral preprocessing techniques to eliminate them: the MC algorithm is used to eliminate the influence of scale differences, the SG smoothing method is used to eliminate a certain degree of noise in the spectral data, and the MSC is used to effectively eliminate the spectral differences caused by different scattering levels.
[0036] In view of the multicollinearity problem caused by data redundancy, the present invention uses a method of characteristic wavelength screening algorithm (such as MIA and SPA combination) to solve this problem to the greatest extent. MIA is used to remove invalid characteristic wavelengths. MIA is a wavelength selection algorithm based on the idea of model cluster analysis and the inherent working mechanism of support vector machine (SVM), which can minimize invalid characteristic wavelengths. SPA is used to further reduce the number of redundant characteristic wavelengths for the remaining wavelength vectors. SPA is a forward loop selection method that requires cyclic calculation of data and all characteristic wavelengths. Spectral data has a large number of bands, which takes too long to calculate and is prone to fall into local optimum. Therefore, the algorithm combined with MIA-SPA can not only reduce the calculation time, but also find the best band.
[0037] In the following, in conjunction with the accompanying drawings, the method for rapid identification of wool and cashmere fibers provided by the present invention is described in detail by taking wool and cashmere socks as an example.
[0038] Reference Figure 1 The method for identifying socks made of wool fiber or cashmere fiber by using the present invention specifically comprises the following steps:
[0039] Step 1: NIR spectroscopy data acquisition
[0040] Step 1.1 Randomly select a certain number of samples from wool and cashmere socks of different brands to ensure the diversity and representativeness of the types;
[0041] Step 1.2: removing foam and surface impurities from the selected samples;
[0042] Step 1.3 sets the parameters of the Fourier transform infrared spectrometer, including the scanning wavelength range, scanning times and wave number resolution. After setting, collect the near infrared spectrum data of the sample processed in step 1.2. During the collection: fold the sample and place it on the sample stage and ensure that the contact between the sample and the sample stage is good; collect the original spectrum data ten times for each sample to ensure the universality of each type of sample in the data set; each time the original spectrum data is collected, three measurements are taken and the average value is taken as the original spectrum data collected this time to ensure the accuracy of each original spectrum data.
[0043] Step 2: Data Processing
[0044] For the collected near-infrared spectral data, mean centering (MC), SG smoothing, multivariate scatter correction (MSC) and abnormal data removal are performed in sequence. The specific steps are as follows:
[0045] Step 2.1: Use mean centering (MC) to process the spectral data to eliminate the impact of scale differences on the spectral data. The mathematical expression is:
[0046]
[0047] In the formula, for a given data set, each feature X is first calculated i The mean is to add up all sample values of each feature and then divide it by the number of samples n. Then center the data: each feature value X of each sample i Subtract the mean of the feature to get the centered data set.
[0048] Mean centering can eliminate the offset between spectral data, reduce the differences between data, provide high-quality data for subsequent modeling, and ensure the stability and accuracy of the model.
[0049] Step 2.2: Use SG smoothing to eliminate a certain degree of noise in the spectral data, reduce the interference of random noise on the sample spectral data, retain the effective information of the spectral data to the greatest extent, and obtain the filtered spectral data. The specific steps are:
[0050] SG smoothing window means that different window widths can be selected at any position on the same curve to meet the needs of different smoothing filters. First, let the window size be n = 2m+1, then the spectral band point i in the window is (-m, -m+1, ..., 0, m-1, m), and a window of size 2m+1 is obtained, then the window has 2m+1 consecutive integer values X i , and then use K-1 degree polynomial to fit each integer value to get y i , the mathematical expression is:
[0051] y i=a0+a1i+a2i 2 +···+a k-1 i k-1
[0052] By fitting the 2m+1 values in the previous window with a k-1 degree polynomial, n such equations can be obtained and form a k-dimensional linear equation system, which can be expressed as:
[0053] Y (2m+1)×1 =X (2m+1)×k ·A K×1 +E (2m+1)×1
[0054] In the polynomial obtained in the previous step, X and Y are both known in the data set, m and k are given, and since the fitting parameter A is unknown, the fitting parameter A is determined by the least squares fitting method, and the least squares solution of the fitting parameter A is recorded as Its mathematical expression is:
[0055]
[0056] According to the above steps, the filtered value of Y can be obtained Its mathematical expression is:
[0057]
[0058] Step 2.3: Use MSC to alleviate the impact of different sample surface conditions on spectral data, enhance the correlation between spectrum and data, and provide high-quality data sets for subsequent modeling. The specific steps are as follows;
[0059] First, the average spectrum A of all samples is calculated, and the average spectrum is used as the ideal spectrum; the average spectrum is calculated according to the following formula:
[0060]
[0061] In the formula, A i represents the spectral data of each sample, and n represents the total number of samples.
[0062] Then, the spectral data of each sample is linearly regressed with the average spectrum to obtain the baseline shift and offset of each sample. By adjusting the baseline shift and offset, the spectral differences between different samples can be reduced and the original effective information can be retained as much as possible. Its mathematical expression is:
[0063]
[0064] Where b i and m i represent the baseline shift and offset of each sample, respectively.
[0065] Finally, the spectral data of each sample is subtracted from the baseline shift obtained in the previous step and divided by the offset to obtain the spectrum A after multi-source scattering correction. i(MSC) :
[0066]
[0067] Step 2.4: Use leverage method to eliminate abnormal data:
[0068] First, plot the spectral data obtained after processing in step 2.3 into a spectrum to observe whether there are obvious abnormal points or noise interference. Even if no obvious abnormal points are found, it is necessary to use the leverage value calculation. Generally speaking, the spectrum lines of spectral data are relatively complex, and it is difficult to distinguish the abnormalities of the two from visual observation alone. Even if there are some obvious abnormal data, there may be data that cannot be distinguished visually. Therefore, it is more conducive to visual identification after using the leverage value calculation. The leverage value hi of each sample is calculated as follows:
[0069]
[0070] In the formula, h i is the leverage value of the ith sample, S i is the score of the principal component analysis of the spectrum of the i-th sample, and S is the score of the principal component analysis of the spectrum of all samples. i The h value can be regarded as the deviation of the numerical value of a set of independent variables from the mean value of the entire data set. The larger the deviation, the greater the h value. i The higher the value, the farther the spectral data of the sample is from the average spectrum of all samples. i Samples with values greater than 3k / n are considered abnormal samples, where k is the number of principal components selected for principal component analysis and n is the sample used for modeling. k / n is the average leverage value of the sample. Generally speaking, individual values should fluctuate around the average, and if the leverage value of an individual value is greater than three times the average leverage value of the sample, it is obviously too large. Therefore, this method usually considers values greater than 3k / n as abnormal values.
[0071] Step 3: Use the interval influence analysis (MIA) algorithm to screen the characteristic wavelengths of the spectral data processed in step 2, remove invalid characteristic wavelengths, and select wavelength variables that can significantly increase the interval. MIA is a band selection algorithm based on the idea of model cluster analysis and the inherent working mechanism of support vector machine (SVM). The MIA method is derived from the fact that the interval is an important indicator reflecting the prediction ability of the SVM model. The larger the interval of the SVM model, the smaller its structural risk and the better the generalization performance of its model.
[0072] The specific steps for using MIA to screen characteristic wavelengths are as follows:
[0073] Assume that there is a spectral training sample set:
[0074]
[0075] Where n is the number of samples; x i is the i-th sample in the training sample set X (d-dimensional vector), x i ∈X=R n ;y i is the classification label of the i-th sample in the training sample set Y, y i ∈Y={-1,1}.
[0076] Step 3.1: Monte Carlo sampling based on variable space:
[0077] The number of variables to be sampled Q is predefined, the number of rows is N, and the size of the variable space p is column; Q variables are randomly selected from d variables (d is equal to the number of column vectors in the sample set T) without replacement each time to obtain a sub-dataset of size n×Q; repeat N times to obtain N sub-datasets. Considering the computational cost and reproducibility, N=10000 is selected. Q is the number of variables in each sampling sub-dataset division. The optimal value of Q can be determined by testing the reproducibility of the information variables identified by MIA and the corresponding prediction error. The penalty factor C takes values between 1 and 12, with a step size of 1; the number of sub-dataset variables Q takes values between 10 and 50, with a step size of 10. The appropriate values are screened out one by one.
[0078] Step 3.2: Establish SVM classification model:
[0079] Given a penalty factor C, an SVM classification model is established for each of the N sub-data sets randomly sampled in step 3.1, and a total of N SVM classification models are established; the penalty factor C of the SVM classification model is used to control the penalty for classification errors. The larger the value, the less tolerant the misclassification phenomenon is. However, if the value is too large, overfitting is prone to occur. It is crucial to select an appropriate penalty factor C, which is related to the performance of the SVM classification model. The present invention uses cross-validation to select the most appropriate penalty factor C from 1-12, thereby calculating the interval of the SVM classification model corresponding to the N sub-data sets, denoted as M i ,i=1,2,…,N。
[0080] Step 3.3: For the SVM interval value M obtained in step 3.2 i Perform statistical analysis:
[0081] For wavelength variable i, the SVM classification models of N sub-datasets are divided into two categories: Class A (models containing wavelength variable i) and Class B (models excluding wavelength variable i). The boundaries of the N SVM classification models are statistically analyzed, and the boundary average values of the SVM classification models containing wavelength variable i and excluding wavelength variable i are respectively counted. If the boundary average value of the SVM classifier model decreases after the wavelength variable i is included, the wavelength variable i is considered to be a useless information variable. If the boundary average value M of the SVM classification model containing wavelength variable i is i,A Greater than the marginal mean M of the SVM classification model that does not contain wavelength variable i i,B , indicating that wavelength variable i may be a useful information variable, then the difference in the boundary mean value of the SVM classification model of wavelength variable i interval can be expressed as:
[0082] Dmean i =M i,A -M i,B
[0083] According to the algorithm principle, Dmean i >0, indicating that adding wavelength variable i to the SVM classification model can improve the model performance, Dmean i <0 indicates a non-informative variable, and all wavelength variables below the 0 line are eliminated.
[0084] After eliminating the variables below the 0 line, the interval distribution of each wavelength variable is subjected to a nonparametric Mann-Whitney U test. The Mann-Whitney U test is a nonparametric statistical method used to test whether there is a significant difference in the means of the two populations. The steps of this method are to sort the remaining wavelengths of the two types of samples according to size, calculate the smaller rank sum as the U value, determine the p value of the significant difference based on the U value, and compare the p value calculated for each wavelength variable with the set threshold (p = 0.05). The wavelength variables with p values less than the set threshold are retained as useful information variables.
[0085] Therefore, choose Dmean i The wavelength variables with >0 and p<0.05 were taken as characteristic wavelengths.
[0086] Step 4: Use the continuous projection algorithm (SPA) to screen the characteristic wavelengths selected in step 3 again to remove redundant characteristic wavelengths, so as to further reduce the number of bands contained in the classification model constructed subsequently, reduce the complexity of classification model calculation, speed up the training speed of the model, and improve the performance of the model. SPA is a forward loop selection method. It selects any wavelength and puts it into the feature table, calculates its projection on other wavelength variables, and then selects the largest wavelength in the projection vector and puts it into the feature table. Through the projection analysis of the vector, the full-band wavelength collinearity can be effectively reduced, and the optimal variable combination can be found among many redundant wavelength variables.
[0087] The specific process of SPA screening characteristic wavelengths is as follows:
[0088] Step 4.1: Initialization process, analyze the characteristic wavelength subset extracted from the spectral data using the MIA method, there is an H×J-order spectral data matrix X (where H is the number of collected samples and J is the number of wavelength variables), and the number of wavelength variables to be extracted is set to N;
[0089] Step 4.2: Before the first iteration (n=1), randomly select a column vector x in the spectral matrix j Note that x k(0) , where k(0)=j,j=1,…,J, J is the total number of wavelengths;
[0090] Step 4.3: Let s be the set of column vector positions that were not selected in the previous step:
[0091]
[0092] Step 4.4: Calculate x j Orthogonal to x k(n-1) The projection onto the subspace of is the projection operator:
[0093]
[0094] Step 4.5: From the projection operator Extract the spectral wavelength of the maximum projection vector from:
[0095]
[0096] Step 4.6: Order
[0097]
[0098] Step 4.7: Let n = n + 1. If x < N, return to step 4.2 for loop calculation. Otherwise, end the algorithm and finally get the band sequence:
[0099] xk(n); n=0,1,…,N-1
[0100] After performing the above processing in sequence, a multivariate linear regression analysis (MLR) model is established for the initial variable k(0) and the number of characteristic wavelengths N in each cycle, and the root mean square error of interactive validation (RMSECV) of the modeling set is obtained. For different candidate subsets, the initial variable k(0) and the number of characteristic wavelengths N corresponding to the smallest RMSECV value are the optimal values, and then the best wavelength combination is selected.
[0101] Step 5: Build and train the ensemble classifier classification model:
[0102] In order to optimize the classification accuracy of the overall classification model, the present invention uses a multi-classifier fusion strategy to construct an integrated classifier classification model to non-destructively identify the types of wool and cashmere socks. Furthermore, in order to make the integrated classifier classification model achieve a better recognition rate, three classifiers, SVM (support vector machine), RF (random forest), and K-NN (k nearest neighbor), are selected to form an integrated classifier classification model, and majority voting (hard voting) is used to decide which category to classify in order to optimize the overall classification model performance. The majority voting (hard voting) means that among these three classifiers, the result determined by the majority classifier is selected as the final output result. For example, among these three classifiers, two classification results are wool and one classification result is cashmere, and the final judgment result is wool. The advantage of doing this is that the advantages of one classifier can make up for the disadvantages of another classifier, and ultimately the performance of the integrated classifier classification model is better than any single component classifier.
[0103] The characteristic variables obtained by the MIA-SPA characteristic wavelength extraction method are used as the input of the integrated classifier classification model, and each sample category is used as the output of the integrated classifier classification model to train the integrated classifier classification model.
[0104] Step 6: Identification of wool and cashmere socks:
[0105] Obtain a near-infrared spectrum image of the socks to be detected, and input it into the integrated classifier classification model trained in step 5 for identification. The integrated classifier classification model outputs the material category of the socks to be detected.
[0106] It should be noted that, in other embodiments, the competitive adaptive weighted sampling (CARS) algorithm can also be used to replace the MIA algorithm in the above step 3. The CARS algorithm is a characteristic variable selection method that combines Monte Carlo sampling with the regression coefficient of the PLS model, with spectral data as input and extracted characteristic wavelengths as output. Each time, the points with larger absolute value weights of the regression coefficients in the PLS model are retained as new subsets by adaptive weighted sampling (ARS), and the points with smaller weights are removed. Then, the PLS model is established based on the new subset. After multiple calculations, the wavelength in the subset with the smallest root mean square error (RMSECV) of the PLS model interactive verification is selected as the characteristic wavelength.
[0107] In other embodiments, the random frog leaping algorithm can also be used in the above step 4 to replace the continuous projection algorithm (SPA) for characteristic wavelength screening. The random frog leaping algorithm draws on the idea of the reversible jump Markov chain Monte Carlo algorithm to establish a characteristic wavelength selection algorithm that is simple in calculation and efficient. The spectral data is used as input, and the extracted characteristic wavelength is used as output. A pseudo-Markov chain Monte Carlo chain is obtained by implementing fixed-dimensional and cross-dimensional mobile searches in the model space to calculate the probability of selection of each characteristic variable as the criterion for selecting the characteristic variable. The higher the probability, the greater the importance of the variable, and the variable with a high probability is preferably the characteristic variable.
[0108] The above only takes wool and cashmere socks as an example to illustrate the rapid identification method of wool and cashmere fibers of the present invention. For other wool and cashmere textiles, such as hats, gloves, clothes, etc., the specific identification principles and methods are the same as those of the above-mentioned socks. The only difference is that the selected sample categories are different. For example, for hats, it is necessary to randomly select wool and cashmere hats of different brands to construct a sample set, which will not be repeated here.
Claims
1. A method for rapid identification of wool and cashmere fibers, characterized in that: The following steps are involved: Step 1: Collect near infrared spectrum data of wool and cashmere fabric samples; Step 2: The near infrared spectrum data collected in step 1 are processed in sequence by MC, SG smoothing, MSC and abnormal data removal; the abnormal data removal is achieved by using the leverage value method; Step 3: Use an interval impact analysis algorithm or a competitive adaptive weighted sampling algorithm to screen the characteristic wavelengths of the spectral data processed in step 2 to remove invalid characteristic wavelengths; Step 4: Use a continuous projection algorithm or a random frog leaping algorithm to screen the characteristic wavelengths screened out in step 3 again to remove redundant characteristic wavelengths; Step 5: construct an integrated classifier classification model and perform training based on the characteristic wavelengths selected in step 4; the integrated classifier classification model includes SVM, RF, and K-NN, and majority voting is used to determine the output of the integrated classifier classification model; Step 6: Obtain a near-infrared spectrum image of the fabric to be detected, input it into the trained integrated classifier classification model for identification, and obtain the material category of the fabric to be detected.
2. The method for rapid identification of wool and cashmere fibers according to claim 1, characterized in that: Step 1 is as follows: Step 1.1: Randomly select a certain number of samples from wool and cashmere fabrics of different brands to ensure the diversity and representativeness of the types; Step 1.2: Remove the foam and surface impurities of the selected sample; Step 1.3: Set the parameters of the Fourier transform infrared spectrometer, including the scanning wavelength range, scanning times and wave number resolution. After setting, collect the near-infrared spectrum data of the sample processed in step 1.2; when collecting: fold the sample and place it on the sample stage and ensure that the contact between the sample and the sample stage is good; collect the original spectrum data of each sample at least ten times to ensure the universality of each type of sample in the data set; Each time the original spectral data is collected, at least three measurements are performed and the average value is taken as the original spectral data collected this time to ensure the accuracy of each original spectral data.
3. The method for rapid identification of wool and cashmere fibers according to claim 1, characterized in that: The specific method of using the interval impact analysis algorithm to screen characteristic wavelengths is: Step 3.1: Based on Monte Carlo sampling in the variable space, N sub-datasets are obtained; Step 3.2: Establish SVM classification models for the N sub-datasets obtained in step 3.1 respectively, select the best penalty factor C from 1 to 12 using the cross-validation method, and calculate the interval of the SVM classification model corresponding to the N sub-datasets; Step 3.3: For the interval statistical analysis of the SVM classification model corresponding to the N sub-datasets obtained in step 3.2, select Dmean i >0 and p<0.05 as the wavelength variable; among them, Dmean i =M i,A -M i,B , M i,A is the marginal mean of the SVM classification model including wavelength variable i, M i,B Dmean is the boundary mean of the SVM classification model that does not include wavelength variable i. i >0 means that adding wavelength variable i to the SVM classification model can improve the model performance; p is the difference significance value determined by the non-parametric U test.
4. A computer-readable storage medium having a computer program stored thereon; characterized in that: The computer program is a trained integrated classifier classification model obtained in steps 1-5 of the method for rapid identification of wool and cashmere fibers according to any one of claims 1-3, and is used to implement material identification of wool and cashmere fabrics when the computer program is run by a processor.
5. An electronic device comprising a processor and a storage medium, wherein the storage medium stores a computer program, wherein: The computer program is a trained integrated classifier classification model obtained in steps 1-5 of the method for rapid identification of wool and cashmere fibers according to any one of claims 1-3, and is used to implement material identification of wool and cashmere fabrics when the computer program is run by a processor.
Citation Information
Patent Citations
Fur near-infrared spectral discrimination method based on packet support vector machine
CN104318260A
Method for identifying maturity of Huanghua pears based on fast attenuation elimination algorithm and PLSDA (Partial Least Square Discriminant Analysis)
CN107247033A
Rice category identification model, construction method thereof and method for identifying rice category
CN115452758A
Cashmere and wool component content identification method based on infrared spectrum technology
CN117092059A
Establishment of Identification and Screening Method of Cows with A2 Beta-Casein Genotype of Producing A2 Milk and Applications Thereof
US20230089466A1
