A method for identifying wool and cashmere fibers based on near infrared spectroscopy
By generating positive and negative sample pairs of wool and cashmere fibers through a self-supervised learning method, and combining a multi-channel convolutional neural network and a support vector machine classifier, the problems of accuracy and efficiency in identifying wool and cashmere fibers were solved, achieving efficient identification even in the absence of a large amount of labeled data.
Patent Information
- Application Number
- CN202411760800.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-12-03
AI Technical Summary
Existing technologies struggle to accurately distinguish between wool and cashmere fibers in the absence of extensive labeled data, and traditional near-infrared spectroscopy methods are limited in accuracy and robustness when dealing with fiber samples from different batches and sources.
A self-supervised learning method based on near-infrared spectroscopy is adopted to generate positive and negative sample pairs through spectral band scaling, local smoothing perturbation and spectral peak shift. Combined with a multi-channel convolutional neural network and a support vector machine classifier, samples are automatically generated and deep features are extracted.
It reduces data annotation costs and time, improves the accuracy and efficiency of wool and cashmere fiber identification, enhances the robustness and adaptability of the model, and is applicable to fiber identification under different sources and conditions.
Smart Images

Figure CN119649049B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of deep learning, and particularly relates to a method for identifying wool and cashmere fibers based on near-infrared spectroscopy. BACKGROUND
[0002] Wool is from the body of a sheep, and even the finest sheep wool is called wool. It feels full and warm. Cashmere grows on the body of a goat, grows in the outer skin layer, and is a layer of fine cashmere covering the root of the coarse hair. Cashmere will naturally fall off and is a unique animal fiber.
[0003] Cashmere and wool fibers are both protein fibers, and the basic components are keratin. They are both composed of many cells, and the cross-section distribution is divided into 2 or 3 levels, i.e. the scale layer on the surface, the cortex layer inside and the medulla layer in the center. Cashmere fiber is short and has low strength, the scale on the surface is thin and sparse, and the fibers are close to each other. The fiber curling number is less than that of wool, so the friction coefficient is smaller than that of wool, the fiber cohesion is relatively poor, but the hand feeling is smooth and soft. Although the cashmere fiber has less curling number, the curling depth is large, and the straightening degree can reach more than 300%, while the 64 merino wool is only 16000, so the cashmere fiber is better than the wool in warmth.
[0004] Due to their similar composition and organizational structure, it is difficult to distinguish them in appearance and hand feeling. The phenomenon of using wool to pretend to be cashmere often occurs in the market, which not only damages the interests of consumers, but also has a negative impact on the healthy development of the textile market. Therefore, accurate identification of wool and cashmere fibers has become a big problem in the industry.
[0005] At present, some traditional methods for identifying cashmere and wool fibers mainly include biological identification method, chemical identification method and image recognition method. The biological identification method has slow detection speed, high cost and requires detection personnel to have certain professional knowledge level; the chemical identification method usually needs to prepare the sample, which is destructive to the sample and has a long detection period, and is not suitable for rapid detection in some specific occasions. As the current mainstream detection technology, the image recognition method greatly improves the accuracy and speed of detection, but the reasonable selection of feature parameters plays a decisive role in the accuracy of the final fiber qualitative and quantitative analysis. In theory, the more feature parameters are selected, the higher the identification accuracy is, but the more feature parameters are selected, the longer the identification time is and the more complicated the process is.
[0006] The near-infrared spectroscopy analysis method in the image recognition method, as a non-destructive, rapid and environmentally friendly analysis method, has gradually attracted attention in textile fiber identification. This technology can provide detailed information about the chemical composition and structure of the fiber by analyzing the absorption characteristics of the fiber material in the near-infrared spectrum region.
[0007] The current near-infrared spectrum analysis method usually relies on a pre-established model and needs a large amount of labeled data for training, and it is time-consuming to label a large amount of data one by one, and the accuracy and robustness may be limited when facing different batches and different sources of fiber samples. Therefore, a model and method for classifying and identifying wool and cashmere in the absence of a large amount of labeled data are needed. SUMMARY
[0008] The technical problem to be solved by the present application is to provide a wool and cashmere fiber identification method based on near-infrared spectrum, which has simple structure and reasonable design, based on band scaling, local smoothing disturbance and spectral peak shift for sample enhancement, automatically generating positive and negative sample pairs, thereby reducing the cost and time of data labeling; deeper features are extracted by the pre-task model, improving the accuracy and efficiency of wool and cashmere fiber identification, and having a wide application prospect.
[0009] To solve the above technical problems, the technical scheme adopted by the present application is: a wool and cashmere fiber identification method based on near-infrared spectrum, characterized by comprising the following steps:
[0010] Step one, the near-infrared spectrum data of r types of wool and the near-infrared spectrum data of m types of cashmere constitute a near-infrared spectrum data set;
[0011] Step two, pre-process the near-infrared spectrum data in the near-infrared spectrum data set to obtain spectral samples;
[0012] Step three, generate enhanced samples for the spectral samples respectively, the qth spectral sample and its enhanced sample form a positive sample pair, the qth spectral sample and the pth spectral sample form a negative sample pair, 1≤g≤r, 1≤p≤m, g and p are positive integers;
[0013] Step four, construct a pre-task model of self-supervised learning:
[0014] Step 401, the pre-task model includes an input layer, an i-channel convolutional neural network, a feature fusion layer, a full connection layer 1 and a full connection layer 2;
[0015] Step 402, divide the positive sample pair and the negative sample pair into multiple wavelength blocks B i , i represents the number of wavelength blocks, n≥i≥2, n is a positive integer;
[0016] Step 403, input the wavelength blocks of the positive sample pair into the pre-task model, and the pre-task model outputs the numerical feature vector of the positive sample pair; input the wavelength blocks of the negative sample pair into the pre-task model, and the pre-task model outputs the numerical feature vector of the negative sample pair;
[0017] Step 404, calculate the similarity between the numerical feature vectors of the positive and negative sample pairs to construct a contrast loss function, update the network parameters of the pre-task model, and obtain a constructed pre-task model;
[0018] Step five, constructing a downstream task model of self-supervised learning: taking the numerical feature vectors as the input of the SVM classifier, training the SVM classifier, and obtaining a constructed SVM classifier;
[0019] Step six, the constructed pre-task model and the constructed SVM classifier constitute a self-supervised learning model based on near-infrared spectroscopy, and the self-supervised learning model based on near-infrared spectroscopy is used to classify the to-be-tested sample.
[0020] The wool and cashmere fiber identification method based on near-infrared spectroscopy has the characteristics that in step three, the method for generating the enhanced sample includes spectral band scaling, local smoothing disturbance and spectral peak shift.
[0021] The wool and cashmere fiber identification method based on near-infrared spectroscopy has the characteristics that the specific method of spectral band scaling is X'(lambda)=X(lambda)*(1+alpha), wherein lambda is in [lambda1, lambda2], [lambda1, lambda2] is a specific waveband range, alpha is a scaling factor, X(lambda) is a spectral value of the original spectral data at wavelength lambda, and X'(lambda) is an enhanced spectral value at wavelength lambda.
[0022] The wool and cashmere fiber identification method based on near-infrared spectroscopy has the characteristics that the specific method of local smoothing disturbance is: Wherein lambda is in [lambda1, lambda2], [lambda1, lambda2] is a specific waveband range, n represents the number of wave points in the specific waveband range, beta represents a random noise term, X(lambda) represents a spectral value of the original spectral data at wavelength lambda, and X'(lambda) represents an enhanced spectral value at wavelength lambda.
[0023] The wool and cashmere fiber identification method based on near-infrared spectroscopy has the characteristics that the specific method of spectral peak shift is X'(lambda)=X(lambda+Delta lambda), lambda represents a specific wavelength, Delta lambda represents a random offset, X(lambda) represents a spectral value of the original spectral data at wavelength lambda, and X'(lambda) represents an enhanced spectral value at wavelength lambda.
[0024] The wool and cashmere fiber identification method based on near-infrared spectroscopy has the characteristics that in step four, the i-channel convolutional neural network includes i convolutional branches, and the basic structure of each convolutional branch includes a convolutional layer 1, a pooling layer 1, a convolutional layer 2 and a pooling layer 2.
[0025] The wool and cashmere fiber identification method based on near-infrared spectroscopy has the characteristics that the feature fusion layer performs weighted fusion on the features of different wavelength blocks B i .
[0026] The wool and cashmere fiber identification method based on near-infrared spectroscopy has the characteristics that i=5; the wavelength range is 1000nm-2500nm; the entire wavelength range is divided into 5 sub-wavelength bands, and the wavelength range of each sub-wavelength band is:
[0027] B1 band: 1000nm-1300nm;
[0028] B2 band: 1301nm-1600nm;
[0029] B3 band: 1601nm-1900nm;
[0030] B4 band: 1901nm-2200nm;
[0031] B5 band: 2200nm-2500nm.
[0032] The wool and cashmere fiber identification method based on near-infrared spectroscopy has the characteristics that the expression of the loss function in step 404 is: where ω i represents the weighted coefficient of the wavelength block B i , represents the similarity of and , and constitute a positive sample pair, represents the feature vector of the i-th sample z i on the wavelength block B i , represents the feature vector of the enhanced sample z i ' of the i-th sample z j on the wavelength block B i ; represents the similarity of and , and constitute a negative sample pair, represents the feature vector of the i-th sample z i on the wavelength block B i , represents the feature vector of the j-th sample z j on the wavelength block B i .
[0033] The wool and cashmere fiber identification method based on near-infrared spectroscopy has the characteristics that the SVM classifier uses a cross-entropy loss function.
[0034] Compared with the prior art, the present application has the following advantages:
[0035] 1. The structure of the present application is simple, reasonable in design, easy to implement and use.
[0036] 2. The pre-task model of the present application uses positive and negative sample pairs. In self-supervised learning, the generation of positive and negative sample pairs is automatic and does not depend on manual labeling, and does not require a large amount of labeled data, thereby reducing the cost and time of data labeling, and thus being suitable for use in the absence of a large amount of labeled data.
[0037] 3. The present application performs sample enhancement based on spectral band scaling, local smooth perturbation and spectral peak shift, automatically generates positive and negative sample pairs, simulates the environmental changes and noise interference that may occur in the actual detection process, effectively improves the robustness of the pre-task model to spectral data, and enables the pre-task model to maintain high recognition accuracy when facing data collected under different sources and conditions.
[0038] 4. The present application divides the near-infrared spectral data of the sample into multiple bands according to spectral characteristics. This division strategy can more comprehensively and accurately extract the differences between cashmere and wool fibers, provide sufficient identification basis, and has good use effect.
[0039] 5. The present application uses a multi-channel convolutional neural network structure, which includes multiple convolution branches. Each convolution branch processes spectral information in a different wavelength range. This design allows independent learning of features in different wavelength blocks and extracts more detailed local features, thereby fully utilizing key information in the spectrum and enhancing the overall recognition ability of the model.
[0040] 6. The present application introduces self-supervised learning into near-infrared spectral analysis, which can reduce the demand for labeled data while extracting deeper features through the pre-task model, improving the accuracy and efficiency of wool and cashmere fiber identification, and having broad application prospects.
[0041] In summary, the present application has the following advantages: simple structure, reasonable design, sample enhancement based on spectral band scaling, local smooth perturbation and spectral peak shift, automatic generation of positive and negative sample pairs, thereby reducing the cost and time of data labeling; extraction of deeper features through the pre-task model, improvement of the accuracy and efficiency of wool and cashmere fiber identification, and broad application prospects.
[0042] The technical solutions of the present application will be further described in detail below with reference to the accompanying drawings and examples. BRIEF DESCRIPTION OF DRAWINGS
[0043] Figure 1 A flow chart of the method of the present application.
[0044] Figure 2 A structure chart of the pre-task model of the present application.
[0045] Figure 3 A comparison chart of cashmere samples and wool samples of the present application.
[0046] Figure 4 A state chart of the present application using a near infrared spectrometer to collect near infrared spectral data of cashmere samples and wool samples.
[0047] Figure 5 A comparison chart of the present application using band scaling to enhance spectral data.
[0048] Figure 6 A comparison chart of the present application using local smoothing perturbation to enhance spectral data.
[0049] Figure 7 A comparison chart of the present application using spectral peak shift to enhance spectral data. DETAILED DESCRIPTION
[0050] The method of the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments of the present application.
[0051] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below in conjunction with the accompanying drawings and embodiments.
[0052] It should be noted that the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, the singular form is intended to include the plural form unless the context clearly indicates otherwise, and it should also be understood that the terms "comprise" and / or "include" as used in the specification indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0053] It is to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting, unless the context clearly indicates otherwise. For example, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or groups thereof.
[0054] Spatially relative terms, such as "under", "below", "lower", "over", "upper" and the like, can be used herein for ease of description to describe one element or feature's relationship to another element(s) or feature(s) as illustrated in the figures. It will be understood that the spatially relative terms are intended to encompass different orientations of the device in use or operation in addition to the orientations depicted in the figures. For example, if a device described is turned over in use, a downwardly-facing surface can then be oriented upwardly, or vice versa. Thus, the example term "over" can encompass both an "over" orientation with respect to other elements or features depicted in the figures and a "below" orientation with respect to other elements or features depicted in the figures. The device can be otherwise oriented (rotated 90 degrees or at other orientations) and the spatially relative descriptors used herein interpreted accordingly.
[0055] As shown in Figure 1 The present application comprises.
[0056] Step one, respectively collect the near-infrared spectrum data of r type wool samples and the near-infrared spectrum data of m type cashmere samples, the near-infrared spectrum data of r type wool samples and the near-infrared spectrum data of m type cashmere samples constitute a near-infrared spectrum data set, r and m are positive integers.
[0057] When collecting near-infrared spectrum data, first, wool samples and cashmere samples need to be collected, wool fiber samples and cashmere fiber samples from different brands and different places are collected to ensure the diversity and representativeness of the samples, and the fluff and surface impurities of the samples are removed to construct effective samples. Figure 3 As shown in Figure 3 a is a cashmere sample, Figure 3 b is a wool sample.
[0058] The near-infrared spectral data is obtained by scanning the wool sample and the cashmere sample by the near-infrared spectrometer, and the near-infrared spectral data can reflect the absorption characteristics of the wool sample and the cashmere sample in the near-infrared spectral region. In the near-infrared spectral region, the vibration of the hydrogen-containing group in the organic molecule will produce the absorption of the combination frequency and the absorption of the multiple frequency. When the near-infrared light of the near-infrared spectrometer irradiates on the sample, the hydrogen-containing group will absorb the light with the frequency matching the vibration frequency, thereby generating a specific absorption spectrum. By detecting the optical density of the transmitted or reflected light, the near-infrared spectral data of the wool sample and the cashmere sample can be obtained respectively. The near-infrared spectral data is usually represented by a series of wavelength corresponding absorbance or reflectance values.
[0059] In this embodiment, 15 wool samples and 15 cashmere samples are used to form a sample set. Ten spectral data of each sample are taken by the near-infrared spectrometer to ensure the universality of each type of sample in the data set, and finally 300 spectral data are obtained. Figure 4 As shown in a, the near-infrared spectrometer collects the near-infrared spectral data of one of the wool samples. Figure 4 As shown in b, the near-infrared spectrometer collects the near-infrared spectral data of one of the cashmere samples.
[0060] The parameters of the near-infrared spectrometer are set, the scanning wavelength range is 1000-2500 nm, the wavenumber resolution is set to 1 cm-1, and the scanning of the fiber is set to scan the front and back surfaces and take the average spectrum each time to ensure the accuracy of the spectral data. The sample is placed on the sample table to ensure full contact with the table surface and to ensure that the fiber has a certain thickness and does not appear to be light leakage. The integral sphere accessory is used to collect the reflected spectral data.
[0061] Step two, the near-infrared spectral data in the near-infrared spectral data set is preprocessed to obtain spectral samples. All the spectral samples form a spectral sample set.
[0062] The preprocessing adopts Savitzky-Golay smoothing processing. Smoothing filtering is one of the common preprocessing methods in spectral analysis. The Savitzky-Golay method is used for smoothing filtering, which can remove irrelevant information and noise in the spectral data, improve the smoothness of the spectrum, optimize the spectral range, improve the signal quality, and maximize the retention of spectral information. The near-infrared spectral data is preprocessed to obtain the preprocessed wool spectral sample and cashmere spectral sample, and the wool spectral sample and cashmere spectral sample form a sample set.
[0063] Step three, an enhanced sample is generated for each spectral sample, the qth spectral sample and its enhanced sample form a positive sample pair, and the qth spectral sample and the pth spectral sample form a negative sample pair, 1≤g≤r, 1≤p≤m, g and p are positive integers.
[0064] In the self-supervised learning and contrastive learning framework, constructing positive sample pairs and negative sample pairs is a key step to improve model performance. The positive sample pairs are constructed by different enhanced results of the same sample, and the negative sample pairs are constructed by different samples.
[0065] Positive sample pair: Apply band scaling, local smooth perturbation and spectral peak shift data augmentation techniques to the qth spectral sample respectively. In this way, the qth spectral sample will generate at least 3 qth enhanced samples. Pairing one qth enhanced sample with the qth spectral sample can form a positive sample pair.
[0066] Negative sample pair: Randomly select two different spectral samples from the spectral sample set: the qth spectral sample and the pth spectral sample to form a negative sample pair.
[0067] In self-supervised learning, the generation of positive and negative sample pairs is automatic and does not depend on human annotation, and does not require a large amount of labeled data, thereby reducing the cost and time of data annotation, and thus is suitable for use in the absence of a large amount of labeled data.
[0068] The specific method of band scaling is: X'(λ) = X(λ)·(1+α), where λ∈[λ1, λ2], [λ1, λ2] is a specific waveband range, α represents a scaling factor, α is a randomly generated decimal value, and the range of α is set to [-0.05, 0.05] to ensure that band scaling does not cause significant distortion of the data, X(λ) represents the spectral value of the original spectral data at wavelength λ, and X'(λ) represents the enhanced spectral value at wavelength λ. Based on the fact that certain important wavebands in the spectrum may have intensity differences under different environmental conditions, band scaling randomly selects one or more key feature wavebands in the spectral data for a small linear scaling, simulating the intensity fluctuations that may occur between different samples due to external conditions or material properties. As shown in Figure 5 The horizontal axis represents the wavelength range, which is 1000-2500 nm, and the vertical axis represents the absorbance. The blue line represents the original spectral value curve, and the orange line represents the spectral value curve obtained after band scaling.
[0069] The specific method of local smooth perturbation is: where λ∈[λ1, λ2], [λ1, λ2] is a specific waveband range, n represents the number of wave points in the specific waveband range, β represents a random noise term, and the value range of β is [-0.01, 0.01] to ensure that the perturbation does not change the overall trend of the original data, X(λ) represents the spectral value of the original spectral data at wavelength λ, and X'(λ) represents the enhanced spectral value at wavelength λ. Local smooth perturbation enhances data robustness by introducing a small perturbation to a random local waveband in the spectral data, while other data remains unchanged, so the two spectral value curves before and after enhancement are completely overlapped.Figure 6 As shown in FIG. 6, the abscissa represents the wavelength range, the wavelength range is 1000nm-2500nm, the ordinate represents the absorbance, the blue line represents the original spectrum value curve, and the orange line represents the spectrum value curve obtained after the local smoothing perturbation operation.
[0070] The specific method of spectral peak shift is: X'(λ) = X(λ + Δλ), λ represents a specific wavelength, Δλ represents a random offset, X(λ) represents the spectrum value of the original spectrum data at wavelength λ, X'(λ) represents the enhanced spectrum value at wavelength λ, and the range of Δλ is set to [-5nm, 5nm]. The spectral peak shift simulates the slight shift of the peak position of the spectrum data under different sample conditions. Especially for fibers such as wool and cashmere, some characteristic peaks are located in a relatively fixed waveband, but changes in external factors such as pressure, temperature or humidity can cause slight shifts in these peaks. By shifting the peak position, the adaptability of the model to peak fluctuations can be enhanced. For example, Figure 7 As shown in FIG. 7, the abscissa represents the wavelength range, the wavelength range is 1000nm-2500nm, the ordinate represents the absorbance, the blue line represents the original spectrum value curve, and the orange line represents the spectrum value curve obtained after the spectral peak shift operation.
[0071] The present application adopts three enhancement methods of spectral band scaling, local smoothing perturbation and spectral peak shift, simulates the environmental changes and noise interference that may occur in the actual detection process, effectively improves the robustness of the pre-task model to spectrum data, and enables the pre-task model to maintain high recognition accuracy when facing data collected under different sources and different conditions.
[0072] Step four, constructing a pre-task model of self-supervised learning:
[0073] Step 401, the pre-task model includes an input layer, an i-channel convolutional neural network, a feature fusion layer, a fully connected layer 1 and a fully connected layer 2.
[0074] The input layer receives the spectrum data of the i-th wavelength block B i .
[0075] As shown in FIG. 8, the i-channel convolutional neural network includes i convolution branches, and the basic structure of each convolution branch includes a convolution layer 1, a pooling layer 1, a convolution layer 2 and a pooling layer 2. Figure 2
[0076] The convolution layer 1 is the core of the multi-channel convolutional neural network structure, and the convolution kernel size of the convolution layer 1 is 3x1. The convolution kernel is responsible for extracting specific features in the input data, and the output of each convolution kernel is subjected to a ReLU activation function. The output of each convolution kernel is a single channel;
[0077] Pooling layer 1, the pooling layer 1 is a max pooling layer, the pooling window size is 2x1, which is used to reduce the dimension of the feature while keeping the key information.
[0078] Convolution layer 2, the convolution kernel size of the convolution layer 2 is 3x1, which is used to further extract features, and the output of the convolution kernel is activated by the ReLU activation function.
[0079] Pooling layer 2, the pooling layer 2 is a max pooling layer, the pooling window size is 2x1, and the max pooling layer can extract the most significant features in the feature map to further reduce the dimension of the feature.
[0080] Feature fusion layer, each wavelength block B i The feature vectors extracted by the convolution layer are weighted and fused into a high-dimensional feature vector to form a unified feature representation, which enhances the learning effect of specific wavebands through the weighting mechanism and helps the model to fully utilize the difference information of different wavebands. In a possible embodiment, the weight is obtained through model adaptive learning. In a possible embodiment, the weight is set through experimental data. The principle of setting is to give the corresponding weight according to the contribution of different wavelength blocks to the difference between wool and cashmere spectra.
[0081] Fully connected layer 1, which maps the fused feature vector to an intermediate dimension, and the output is activated by ReLU.
[0082] Fully connected layer 2, which maps the intermediate dimension feature to the final numerical feature vector, which is used as the input of the SVM classifier for the SVM classifier to process.
[0083] Step 402, dividing the positive sample pairs and negative sample pairs into a plurality of wavelength blocks B i , i represents the number of wavelength blocks, i≥3.
[0084] Since the spectral data shows different differences in different wavelength intervals, the present application designs a neural network structure specially for different wavelength blocks, thereby enhancing the learning effect in specific wavebands. In a possible embodiment, i=5. The wavelength range is 1000nm-2500nm, and the entire wavelength range is divided into 5 sub-wavebands, each wavelength block covers a specific wavelength range, and the wavelength range of each waveband is:
[0085] B1 waveband: 1000nm-1300nm; B1 waveband mainly contains absorption peaks related to the stretching vibration of C-H bond, especially the characteristic peaks related to lipids and fatty acids. Although the lipid content in cashmere and wool fibers is relatively low, there are still some absorption differences in this part. By capturing the C-H stretching vibration characteristics of these lipids, additional identification information can be provided to the model.
[0086] B2 band: 1301 nm-1600 nm; In the B2 band, the absorption peaks mainly appear with N-H and C-H bonds, especially the absorption peaks related to the amino and amine groups of proteins. This is the main contribution area of proteins in the fiber structure. Although the chemical composition of cashmere and wool fibers is similar, there are subtle differences in the content and certain branches of proteins, which lead to their near-infrared spectra showing slight differences in this band. These characteristics are crucial for identifying wool and cashmere.
[0087] B3 band: 1601 nm-1900 nm; The B3 band contains absorption peaks related to O-H bonds and N-H bonds, mainly involving the characteristic absorption of water and amino acid molecules. The moisture content of cashmere and wool fibers will be different, especially during processing and storage, which leads to their different performances in the spectrum of this band. By including this band, the difference information related to moisture and amino acid content can be captured.
[0088] B4 band: 1901 nm-2200 nm; The B4 band mainly involves absorption peaks related to C=O and O-H stretching vibrations. These peaks are usually related to carbonyl groups in proteins and amino acid side chains, and also have some connection with trace lipids and moisture in fibers. The absorption peaks in this section are crucial for further refining the differences in protein structure between wool and cashmere, and can enhance the discrimination ability of the model.
[0089] B5 band: 2200 nm-2500 nm. The absorption of the B5 band is mainly related to N-H and O-H bonds in amino acids, and also includes some characteristic peaks related to the vibration of polypeptide chain backbone. This band can capture deeper structural information of cashmere and wool fiber proteins, especially the vibration characteristics of certain trace components. By including this band, more complex amino acids and their side chain structure differences in the fiber can be identified.
[0090] The spectral characteristics of each band are significantly different, and can effectively capture the chemical composition and physical structure changes of the fiber. Each band has its unique spectral peak distribution, which can capture key information related to lipids, proteins, moisture, and amino acids, respectively. This division strategy can more comprehensively and accurately extract the differences between cashmere and wool fibers, providing sufficient identification basis and good use effect.
[0091] Step 403, input the wavelength blocks of the positive sample pairs into the pre-task model respectively, and the pre-task model outputs the numerical feature vectors of the positive sample pairs; input the wavelength blocks of the negative sample pairs into the pre-task model respectively, and the pre-task model outputs the numerical feature vectors of the negative sample pairs.
[0092] It should be noted that, in order to capture the differences between different wavelength blocks B iIndependent feature extraction is performed, and the application adopts a 5-channel convolutional neural network structure. Each wavelength block B i There is an independent convolutional channel responsible for processing the spectral data in the wavelength block and extracting features in the wavelength band.
[0093] Step 404: Calculate the similarity between the numerical feature vectors of the positive and negative sample pairs to construct a contrast loss function, update the network parameters of the pre-task model, and obtain the constructed pre-task model.
[0094] The loss function of the pre-task model adopts a contrast loss function. Since the wavelength block weighting mechanism is introduced by the feature fusion layer, the goal of the loss function of the pre-task model is to maximize the similarity of the positive sample pairs and minimize the similarity of the negative sample pairs. Based on the loss function L contrastiev Backpropagation training is performed, and the stochastic gradient descent method is used to iteratively train the parameters of the pre-task model until the maximum number of iterations is reached, the network parameters of the pre-task model are updated, and the training and construction of the pre-task model are completed.
[0095] The expression of the loss function in step 404 is: Where ω i is the weighting coefficient of the wavelength block B i , is the similarity between and in the positive sample pair, and form the positive sample pair, is the feature vector of the gth sample on the wavelength block B i , is the feature vector of the enhanced sample of the gth sample on the wavelength block B i ; is the similarity between and in the negative sample pair, and form the negative sample pair, is the feature vector of the gth sample on the wavelength block B i , is the feature vector of the pth sample on the wavelength block B i .
[0096] In one possible embodiment, the cosine similarity is calculated. The calculation method of is the same.
[0097] The pre-task model is constructed by a self-supervised learning algorithm, and under the condition that a large amount of labeled data is not required, the pre-task model automatically learns features by using the inherent characteristics of spectral data. Through three enhancement methods of band scaling, local smoothing disturbance and spectral peak shift, a positive and negative sample pair is generated, a self-supervised contrast learning task is designed, the pre-task model can automatically extract effective features from unlabeled data, greatly reducing the dependence on labeled data, and improving the generalization ability and adaptability of the model.
[0098] Step five, constructing a downstream task model of self-supervised learning: taking the numerical feature vector as the input of the classification network model, training the classification network model, and obtaining the constructed classification network model. The classification network model adopts a SVM classifier, and the SVM classifier uses a cross-entropy loss function. The SVM classifier is used to complete the classification of cashmere and wool.
[0099] The numerical feature vector of the positive and negative sample pair has labels, that is, positive and negative. The labels of the subject and object of the positive sample pair are represented by 1, the label of the subject in the negative sample pair is represented by 1, and the label of the object in the negative sample pair is represented by -1. In the training process, the SVM classifier maximizes the interval between positive and negative samples. By adjusting the parameters of the model, the SVM classifier can achieve good performance on the test data.
[0100] In one possible embodiment, the penalty factor C of the SVM classification model is used to control the punishment for classification errors. The larger the value, the less tolerant of the misclassification phenomenon, but a too large value is prone to overfitting. It is crucial to select a suitable penalty factor C, which is related to the performance of the SVM classification model. The present application adopts cross-validation to select the most suitable penalty factor C in 1-12, and the step size is 1.
[0101] In one possible embodiment, the classification network model can also use an RF classifier or a K-NN classifier.
[0102] Step six, the constructed pre-task model and the constructed classification network model constitute a self-supervised learning model based on near-infrared spectroscopy, and the self-supervised learning model based on near-infrared spectroscopy is used to classify the near-infrared spectral data of the to-be-tested sample.
[0103] The spectral data of the to-be-tested sample is obtained, the spectral data is input into the self-supervised learning model based on near-infrared spectroscopy, the self-supervised learning model based on near-infrared spectroscopy outputs the material category of the spectral data, and a classification result is obtained.
[0104] It should be noted that the wool samples include different forms of textiles such as socks, hats, gloves, clothes, etc., and the cashmere samples include different forms of textiles such as socks, hats, gloves, clothes, etc., which are different in form, but the specific identification principles and methods are the same as those of the present application, and will not be repeated here.
[0105] The above is only an embodiment of the present application, and does not limit the present application in any way. Any simple modification, change, and equivalent structural change made according to the technical essence of the present application to the above embodiment are still within the protection scope of the present application.
Claims
1. A method for identifying wool and cashmere fibers based on near infrared spectroscopy, characterized in that: The method comprises the following steps: Step one, collecting near-infrared spectrum data of r type wool samples and collecting near-infrared spectrum data of m type cashmere samples to form a near-infrared spectrum data set; Step two, preprocessing the near-infrared spectrum data in the near-infrared spectrum data set to obtain spectrum samples; Step three, generating enhanced samples for the spectrum samples respectively, the q type spectrum sample and its enhanced sample constitute a positive sample pair, the q type spectrum sample and the p type spectrum sample constitute a negative sample pair, 1≤g≤r, 1≤p≤m, g and p are positive integers; Step four, constructing a pre-task model of self-supervised learning: Step 401, the pre-task model comprises an input layer, an i-channel convolutional neural network, a feature fusion layer, a full connection layer 1 and a full connection layer 2; Step 402, dividing the positive sample pairs and the negative sample pairs into a plurality of wavelength blocks B respectively i , i represents the number of wavelength blocks, n≥i≥2, n is a positive integer; Step 403, inputting the wavelength blocks of the positive sample pairs into the pre-task model respectively, and the pre-task model outputs the numerical feature vectors of the positive sample pairs; inputting the wavelength blocks of the negative sample pairs into the pre-task model respectively, and the pre-task model outputs the numerical feature vectors of the negative sample pairs; Step 404, calculating the similarity between the numerical feature vectors of the positive and negative sample pairs to construct a contrast loss function, updating the network parameters of the pre-task model, and obtaining the constructed pre-task model; Step five, constructing a downstream task model of self-supervised learning: taking the numerical feature vectors as the input of a classification network model, training the classification network model, and obtaining the constructed classification network model; Step six, the constructed pre-task model and the constructed classification network model constitute a near-infrared spectrum based self-supervised learning model, and the near-infrared spectrum based self-supervised learning model is used for classifying the to-be-tested sample.
2. A method for discriminating wool and cashmere fibers based on near infrared spectroscopy as claimed in claim 1, characterized in that: In step three, the method for generating enhanced samples comprises spectral band scaling, local smoothing disturbance and spectral peak shift.
3. A method for discriminating wool and cashmere fibers based on near infrared spectroscopy as claimed in claim 2, characterized in that: The specific method of spectral band scaling is: X'(λ)=X(λ)·(1+α), wherein λ∈[λ1, λ2], [λ1, λ2] is a specific wave band range, α represents a scaling factor, X(λ) represents the spectrum value of the original spectrum data at wavelength λ, and X'(λ) represents the enhanced spectrum value at wavelength λ.
4. A method for discriminating wool and cashmere fibers based on near infrared spectroscopy as claimed in claim 2, characterized in that: The specific method for locally smoothing the perturbation is: where λ ∈ [λ1, λ2], [λ1, λ2] is a specific wavelength range, n represents the number of wave points in the specific wavelength range, β represents a random noise term, X(λ) represents a spectral value of the original spectral data at wavelength λ, and X'(λ) represents an enhanced spectral value at wavelength λ.
5. A method for discriminating wool and cashmere fibers based on near infrared spectroscopy as claimed in claim 2, characterized in that: The specific method of spectral peak shift is: X'(λ)=X(λ+Δλ), λ represents a specific wavelength, Δλ represents a random offset, X(λ) represents the spectrum value of the original spectrum data at wavelength λ, and X'(λ) represents the enhanced spectrum value at wavelength λ.
6. A method for discriminating wool and cashmere fibers based on near infrared spectroscopy as claimed in claim 1, characterized in that: In step four, the i-channel convolutional neural network comprises i convolution branches, and the basic structure of each convolution branch comprises a convolution layer 1, a pooling layer 1, a convolution layer 2 and a pooling layer 2.
7. A method for discriminating wool and cashmere fibers based on near infrared spectroscopy as claimed in claim 1, characterized in that: Feature fusion Layer pairs are weighted fused with different wavelength blocks B i characteristics.
8. A method for discriminating wool and cashmere fibers based on near infrared spectroscopy as claimed in claim 1, characterized in that: i=5; the wavelength range is 1000nm-2500nm; the entire wavelength range is divided into 5 sub-bands, and the wavelength range of each band is: B1 band: 1000nm-1300nm; B2 band: 1301nm-1600nm; B3 band: 1601nm-1900nm; B4 band: 1901nm-2200nm; B5 band: 2200nm-2500nm.
9. A method for discriminating wool and cashmere fibers based on near infrared spectroscopy as claimed in claim 1, characterized in that: The expression of the loss function in step 404 is: where ω i represents the weight coefficient of the wavelength block B i , represents the similarity of and in the positive sample pair, and comprise the positive sample pair, represents the feature vector of the gth sample on the wavelength block B i , represents the feature vector of the augmented sample of the gth sample on the wavelength block B i ; represents the similarity of and in the negative sample pair, and comprise the negative sample pair, represents the feature vector of the gth sample on the wavelength block B i , represents the feature vector of the pth sample on the wavelength block B i .
10. A method for discriminating wool and cashmere fibers based on near infrared spectroscopy as claimed in claim 1, characterized in that: The classification network model adopts an SVM classifier, and the SVM classifier uses a cross-entropy loss function.
Citation Information
Patent Citations
Rapid identification method for wool and cashmere fibers
CN118190859A
Image annotation using one or more neural networks
US20230033075A1