Wool cashmere fiber identification method based on near infrared spectrum

By using a self-supervised learning method based on near-infrared spectrum in the identification of wool and cashmere fibers, spectral band scaling, local smoothing perturbation and peak shifting for sample enhancement, the problem of relying on a large amount of labeled data in the prior art is solved, and efficient and accurate fiber identification is achieved.

CN119649049AActive Publication Date: 2025-03-18XI'AN POLYTECHNIC UNIVERSITY
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411760800.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-18
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

The prior art relies on a large amount of labeled data in the identification of wool and cashmere fibers, and the accuracy and robustness are limited when facing fiber samples from different batches and sources.

Method used

A self-supervised learning method based on near-infrared spectroscopy is adopted to enhance samples through spectral band scaling, local smoothing perturbation and peak offset, and positive and negative sample pairs are automatically generated to reduce data labeling costs and time. Use the pre-task model to extract deeper features and identify them in combination with the SVM classifier.

Benefits of technology

It improves the accuracy and efficiency of identification of wool and cashmere fibers, reduces the cost and time of data annotation, and enhances the robustness and adaptability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119649049A_ABST
    Figure CN119649049A_ABST
Patent Text Reader

Abstract

The invention discloses a wool and cashmere fiber identification method based on a near infrared spectrum. The method comprises the following steps: step 1, establishing a near infrared spectrum data set; step 2, preprocessing to obtain a spectrum sample set; step 3, generating enhanced samples to form positive and negative sample pairs; step 4, constructing a pre-task model of self-supervised learning; step 5, constructing a downstream task model of self-supervised learning; and step 6, the pre-task model and the SVM classifier form a self-supervised learning model based on the near infrared spectrum, and classification is carried out by using the self-supervised learning model based on the near infrared spectrum. The system is simple in structure and reasonable in design, sample enhancement is performed based on band scaling, local smooth disturbance and spectral peak offset, and positive and negative sample pairs are automatically generated, so that the cost and time of data annotation are reduced; deeper features are extracted through the pre-task model, the precision and efficiency of wool and cashmere fiber identification are improved, and the method has a wide application prospect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of deep learning, and in particular relates to a wool and cashmere fiber identification method based on near infrared spectroscopy. Background Art

[0002] Wool comes from sheep. Even the finest wool is called wool. It feels full and warm. Cashmere grows on goats. It grows on the outer cortex. It is a layer of fine wool covering the roots of the coarse hair. Cashmere will fall off naturally. It is a unique animal fiber.

[0003] Cashmere and wool fibers are both protein fibers, and their basic composition is keratin. They are both formed by the accumulation of many cells. Their cross-sectional distribution is divided into 2 or 3 layers, namely the scale layer on the outer surface, the cortex layer inside, and the medulla layer in the center. Cashmere fibers are short in length and low in strength. The scales covering the surface are thin and sparse, and they are close to each other. The fiber curls are less than wool, so the friction coefficient is smaller than wool, and the cohesion between fibers is relatively poor, but the hand feels smooth and waxy. Although cashmere fibers have fewer curls, they have a large curl depth and can be straightened to more than 300%, while 64-count Merino wool is only 16,000, so cashmere fibers are better at keeping warm than wool.

[0004] Due to their similar composition and tissue structure, they are difficult to distinguish in appearance and feel. Wool is often passed off as cashmere in the market, which not only harms the interests of consumers, but also has a negative impact on the healthy development of the textile market. Therefore, the accurate identification of wool and cashmere fibers has become a major problem in the industry.

[0005] At present, the traditional identification methods of some cashmere and wool fibers mainly include biological identification, chemical identification and image recognition. The biological identification method has a slow detection speed and high cost, and requires the tester to have a certain level of professional knowledge; the chemical identification method usually requires sample preparation, which is destructive to the sample, and the detection cycle is long, which is not suitable for rapid detection in some specific occasions. As the current mainstream detection technology, image recognition has greatly improved the accuracy and speed of detection, but the reasonable selection of characteristic parameters plays a decisive role in the accuracy of the final qualitative and quantitative analysis of fibers. In theory, the more characteristic parameters are selected, the higher the accuracy of identification. However, the more characteristic parameters are selected, the longer the identification time will be and the more complicated the process will be.

[0006] Near infrared spectroscopy analysis in image recognition is a non-destructive, rapid and environmentally friendly analysis method that has gradually attracted attention in textile fiber identification. This technology can provide detailed information about the chemical composition and structure of fibers by analyzing the absorption characteristics of fiber materials in the near infrared spectral region.

[0007] Current near-infrared spectroscopy analysis methods usually rely on pre-established models and require a large amount of labeled data for training. It takes a lot of time to label a large amount of data one by one, and its accuracy and robustness may be limited when facing fiber samples from different batches and sources. Therefore, a model and method that can classify and identify wool and cashmere in the absence of a large amount of labeled data is needed. Summary of the invention

[0008] The technical problem to be solved by the present invention is to provide a wool and cashmere fiber identification method based on near-infrared spectroscopy in view of the deficiencies in the above-mentioned prior art. The method has a simple structure and a reasonable design. Sample enhancement is performed based on spectral band scaling, local smooth perturbation and spectral peak shift, and positive and negative sample pairs are automatically generated, thereby reducing the cost and time of data annotation. Deeper features are extracted through the pre-task model, thereby improving the accuracy and efficiency of wool and cashmere fiber identification, and has broad application prospects.

[0009] In order to solve the above technical problems, the technical solution adopted by the present invention is: a wool and cashmere fiber identification method based on near infrared spectroscopy, characterized in that it comprises the following steps:

[0010] Step 1, the near infrared spectrum data of the r type wool and the near infrared spectrum data of the m type cashmere constitute a near infrared spectrum data set;

[0011] Step 2: preprocessing the near infrared spectrum data in the near infrared spectrum data set to obtain spectrum samples;

[0012] Step 3: Generate enhanced samples for the spectral samples respectively. The qth spectral sample and its enhanced sample constitute a positive sample pair, and the qth spectral sample and the pth spectral sample constitute a negative sample pair. 1≤g≤r, 1≤p≤m, g and p are positive integers.

[0013] Step 4: Build a pre-task model for self-supervised learning:

[0014] Step 401, the pre-task model includes an input layer, a convolutional neural network of i channels, a feature fusion layer, a fully connected layer 1 and a fully connected layer 2;

[0015] Step 402: Divide the positive sample pairs and the negative sample pairs into a plurality of 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 respectively, 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 respectively, 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, thereby constructing a contrast loss function, updating the network parameters of the pre-task model, and obtaining a constructed pre-task model;

[0018] Step 5: Construct a downstream task model for self-supervised learning: use the numerical feature vector as the input of the SVM classifier, train the SVM classifier, and obtain a constructed SVM classifier;

[0019] Step 6: 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 of near-infrared spectroscopy is used to classify the samples to be tested.

[0020] The above-mentioned wool and cashmere fiber identification method based on near-infrared spectroscopy is characterized in that: in step three, the method for generating enhanced samples includes spectral band scaling, local smoothing perturbation and spectral peak shift.

[0021] The above-mentioned wool and cashmere fiber identification method based on near-infrared spectroscopy is characterized in that the specific method of spectral band scaling is: X'(λ)=X(λ)·(1+α), wherein λ∈[λ1,λ2], [λ1,λ2] is a specific band range, α represents the scaling factor, X(λ) represents the spectral value of the original spectral data at wavelength λ, and X'(λ) represents the enhanced spectral value at wavelength λ.

[0022] The above-mentioned wool and cashmere fiber identification method based on near infrared spectroscopy is characterized in that the specific method of local smooth disturbance is: Where λ∈[λ1,λ2], [λ1,λ2] is a specific band range, n represents the number of wave points within the specific band range, β represents the random noise term, X(λ) represents the spectral value of the original spectral data at wavelength λ, and X'(λ) represents the enhanced spectral value at wavelength λ.

[0023] The above-mentioned wool and cashmere fiber identification method based on near-infrared spectroscopy is characterized in that the specific method of spectral peak shift is: X'(λ)=X(λ+Δλ), λ represents a specific wavelength, Δλ represents a random offset, X(λ) represents the spectral value of the original spectral data at a wavelength λ, and X'(λ) represents the enhanced spectral value at a wavelength λ.

[0024] The above-mentioned wool and cashmere fiber identification method based on near-infrared spectroscopy is characterized in that: in step 4, the i-channel convolutional neural network includes i convolution branches, and the basic structure of each convolution branch includes convolution layer 1, pooling layer 1, convolution layer 2 and pooling layer 2.

[0025] The above wool and cashmere fiber identification method based on near infrared spectroscopy is characterized in that: the characteristic fusion layer is used for different wavelength blocks B i The features are weighted fused.

[0026] The above-mentioned wool and cashmere fiber identification method based on near infrared spectroscopy is 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:

[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 above-mentioned wool and cashmere fiber identification method based on near infrared spectroscopy is characterized in that: the expression of the loss function in step 404 is: where ω i Indicates wavelength block B i The weighting coefficient of Indicates the positive sample pair and The similarity of and To form a positive sample pair, represents the i-th sample z i In wavelength block B i The eigenvectors on represents the i-th sample z j The enhanced sample z i 'In wavelength block B i The eigenvectors on ; Represents negative sample pair and The similarity of and To form a negative sample pair, represents the i-th sample z i In wavelength block B i The eigenvectors on represents the jth sample z j In wavelength block B i The eigenvectors on .

[0033] The above-mentioned wool and cashmere fiber identification method based on near infrared spectroscopy is characterized in that the SVM classifier uses a cross entropy loss function.

[0034] Compared with the prior art, the present invention has the following advantages:

[0035] 1. The invention has a simple structure, reasonable design, and is easy to implement and operate.

[0036] 2. The pre-task model of the present invention adopts positive and negative sample pairs. In self-supervised learning, the generation of positive and negative sample pairs is automatic, does not rely on manual labeling, and does not require a large amount of labeled data, thereby reducing the cost and time of data labeling. Therefore, it is suitable for use in the absence of a large amount of labeled data.

[0037] 3. The present invention 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, and effectively improves the robustness of the pre-task model to spectral data, so that the pre-task model can still maintain a high recognition accuracy when facing data collected from different sources and under different conditions.

[0038] 4. The present invention divides the near-infrared spectral data of the sample into multiple bands according to the 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 invention adopts a multi-channel convolutional neural network structure, which includes multiple convolution branches, each of which processes spectral information within different wavelength ranges. This design can independently learn the characteristics of different wavelength blocks and extract more detailed local features, thereby making full use of the key information in the spectrum and enhancing the overall recognition ability of the model.

[0040] 6. The present invention 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, thereby improving the accuracy and efficiency of wool and cashmere fiber identification, and has broad application prospects.

[0041] In summary, the present invention has a simple structure and a reasonable design. It performs sample enhancement based on spectral band scaling, local smooth perturbation and spectral peak shift, and automatically generates positive and negative sample pairs, thereby reducing the cost and time of data annotation. It extracts deeper features through the pre-task model, improves the accuracy and efficiency of wool and cashmere fiber identification, and has broad application prospects.

[0042] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 The figure is a flow chart of the method of the present invention.

[0044] Figure 2 It is a structural diagram of the pre-task model of the present invention.

[0045] Figure 3 It is a comparison diagram of the cashmere sample and the wool sample of the present invention.

[0046] Figure 4 This is a state diagram of the present invention using a near-infrared spectrometer to collect near-infrared spectrum data of cashmere samples and wool samples.

[0047] Figure 5 This is a comparison diagram of the present invention using spectral band scaling to enhance spectral data.

[0048] Figure 6 This is a comparison diagram of the present invention using local smooth perturbation to enhance spectral data.

[0049] Figure 7 This is a comparison diagram of the present invention using spectral peak shift to enhance spectral data. DETAILED DESCRIPTION

[0050] The method of the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments of the present invention.

[0051] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0052] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0053] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0054] For ease of description, spatially relative terms such as "above", "above", "on the upper surface of", "above", etc. may be used here to describe the spatial positional relationship between a device or feature and other devices or features as shown in the figure. It should be understood that spatially relative terms are intended to include different orientations of the device in use or operation in addition to the orientation described in the figure. For example, if the device in the accompanying drawings is inverted, the device described as "above other devices or structures" or "above other devices or structures" will be positioned as "below other devices or structures" or "below other devices or structures". Thus, the exemplary term "above" can include both "above" and "below". The device can also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatially relative descriptions used here are interpreted accordingly.

[0055] like Figure 1 As shown, the present invention includes.

[0056] Step 1: collect near infrared spectral data of r-type wool samples and near infrared spectral data of m-type cashmere samples respectively. The near infrared spectral data of r-type wool samples and the near infrared spectral data of m-type cashmere samples constitute a near infrared spectral data set, where r and m are positive integers.

[0057] When collecting near-infrared spectral data, we first need to collect wool samples and cashmere samples, collect wool fiber samples and cashmere fiber samples from different brands and origins, ensure the diversity and representativeness of the samples, remove the hair foam and surface impurities of the samples, and construct effective samples. Figure 3 As shown, Figure 3 a is a cashmere sample, Figure 3 b is a wool sample.

[0058] Near infrared spectral data is obtained by scanning wool samples and cashmere samples with a near infrared spectrometer. Near infrared spectral data can reflect the absorption characteristics of wool samples and cashmere samples in the near infrared spectral region. In the near infrared spectral region, the vibration of hydrogen-containing groups in organic molecules will produce absorption of combined frequency and various levels of harmonic frequency. When the near infrared light of the near infrared spectrometer is irradiated on the sample, these hydrogen-containing groups will absorb light that matches their vibration frequency, thereby producing a specific absorption spectrum. By analyzing the optical density of the transmitted or reflected light through the detector, the near infrared spectral data of the wool sample and cashmere sample can be obtained respectively. Near infrared spectral data are usually expressed as absorbance or reflectance values ​​corresponding to a series of wavelengths.

[0059] In this embodiment, 15 wool samples and 15 cashmere samples are used to form a sample set. Each sample is subjected to 10 spectral data through a near infrared spectrometer to ensure the universality of each type of sample in the data set, and finally a total of 300 spectral data are obtained. Figure 4 As shown in a, the near-infrared spectrometer collects near-infrared spectral data for one of the wool samples. Figure 4 As shown in b, the near-infrared spectrometer collects near-infrared spectral data for one of the cashmere samples.

[0060] Set the parameters of the near-infrared spectrometer, the scanning wavelength range is 1000-2500nm, the wave number resolution is set to 1cm-1, and each scan is set to scan the front and back sides of the fiber and take the average spectrum to ensure the accuracy of the spectral data. Place the sample on the sample table to ensure full contact with the table surface and to ensure that the fiber has a certain thickness and no light leakage occurs. Use an integrating sphere accessory to collect reflectance spectral data.

[0061] Step 2: Preprocess the near infrared spectrum data in the near infrared spectrum data set to obtain spectrum samples. All spectrum samples constitute a spectrum sample set.

[0062] Savitzky-Golay smoothing is used for preprocessing. Smoothing filtering is one of the commonly used preprocessing methods in spectral analysis. Using the Savitzky-Golay method for smoothing filtering can remove irrelevant information and noise in spectral data, improve the smoothness of the spectrum, optimize the spectral range, improve the signal quality, and retain the spectral information to the maximum extent. The near-infrared spectral data is preprocessed to obtain the preprocessed wool spectral samples and cashmere spectral samples, which constitute the sample set.

[0063] Step 3: Generate enhanced samples for each spectral sample. The qth spectral sample and its enhanced sample constitute a positive sample pair, and the qth spectral sample and the pth spectral sample constitute a negative sample pair. 1≤g≤r, 1≤p≤m, g and p are positive integers.

[0064] In the framework of self-supervised learning and contrastive learning, constructing positive sample pairs and negative sample pairs is a key step to improve model performance. Positive sample pairs are constructed for different enhancement results of the same sample, and negative sample pairs are constructed for different samples.

[0065] Positive sample pairs: Apply data enhancement techniques such as spectral band scaling, local smoothing perturbation and spectral peak shift 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: Two different spectral samples are randomly selected 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, does not rely on manual labeling, and does not require a large amount of labeled data, thereby reducing the cost and time of data labeling. Therefore, it is suitable for use in the absence of a large amount of labeled data.

[0068] The specific method of spectral band scaling is: X'(λ) = X(λ)·(1+α), where λ∈[λ1,λ2], [λ1,λ2] is a specific band range, α represents the scaling factor, α is a randomly generated decimal value, and the range of α is set to [-0.05,0.05] to ensure that spectral 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 some important bands in the spectrum may have intensity differences under different environmental conditions, spectral band scaling is to randomly select one or more key characteristic bands in the spectral data and perform a small linear scaling to simulate the intensity fluctuations between different samples that may be caused by external conditions or material properties. Figure 5 As shown, the horizontal axis represents the wavelength range, the wavelength range is 1000nm-2500nm, 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 the spectral band scaling operation.

[0069] The specific method of local smooth perturbation is: The specific method of local smooth perturbation is: Where λ∈[λ1,λ2], [λ1,λ2] is a specific band range, n represents the number of wave points within the specific band range, β represents the random noise term, and the value range of β is [-0.01, 0.01], ensuring that the disturbance 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 smoothing perturbation enhances data robustness by introducing small disturbances to random local bands in the spectral data, and other factors remain unchanged, so the two spectral value curves before and after the enhancement completely overlap. Figure 6 As shown, the horizontal axis represents the wavelength range, the wavelength range is 1000nm-2500nm, 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 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 spectral value of the original spectral data at wavelength λ, X'(λ) represents the enhanced spectral value at wavelength λ, and the range of Δλ is set to [-5nm, 5nm]. Spectral peak shift simulates the slight shift in the peak position of spectral data under different sample conditions. Especially for fibers such as wool and cashmere, some characteristic peaks are located in relatively fixed bands, but external factors such as changes in pressure, temperature or humidity may cause these peaks to shift slightly. By shifting the peak position, the model's adaptability to peak position fluctuations can be enhanced. For example Figure 7 As shown, the horizontal axis represents the wavelength range, which is 1000nm-2500nm, 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 the peak shift operation.

[0071] This application adopts three enhancement methods: spectral band scaling, local smoothing perturbation and spectral peak shift, which simulates the environmental changes and noise interference that may occur in the actual detection process, effectively improving the robustness of the pre-task model to spectral data, so that the pre-task model can still maintain a high recognition accuracy when facing data collected from different sources and under different conditions.

[0072] Step 4: Build a pre-task model for self-supervised learning:

[0073] Step 401, the pre-task model includes an input layer, a convolutional neural network of i channels, a feature fusion layer, a fully connected layer 1 and a fully connected layer 2.

[0074] Input layer, receiving the i-th wavelength block B i spectral data.

[0075] like Figure 2 As shown, the i-channel convolutional neural network includes i convolution branches, and the basic structure of each convolution branch includes convolution layer 1, pooling layer 1, convolution layer 2 and pooling layer 2.

[0076] Convolution layer 1: The convolution layer is the core of the multi-channel convolutional neural network structure. The convolution kernel size of convolution layer 1 is 3×1. The convolution kernel is responsible for extracting specific features from the input data. The output of each convolution kernel passes through the ReLU activation function, and the output of each convolution kernel is single-channel.

[0077] Pooling layer 1: Pooling layer 1 is the maximum pooling layer with a pooling window size of 2×1, which is used to reduce the dimension of features while maintaining key information;

[0078] Convolutional layer 2: The convolution kernel size of convolutional layer 2 is 3×1, which is used to further extract features. The output of the convolution kernel passes through the ReLU activation function;

[0079] Pooling layer 2: Pooling layer 2 is the maximum pooling layer with a pooling window size of 2×1. The maximum pooling layer can extract the most significant features in the feature map to further reduce the dimension of the features.

[0080] The feature fusion layer combines 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. The weighting mechanism enhances the learning effect of a specific band, which helps the model to make full use of the difference information of different bands. In one possible embodiment, the weights are obtained through model adaptive learning. In one possible embodiment, the weights are set through experimental data. The principle of setting is to assign corresponding weights according to the contribution of different wavelength blocks to the spectral difference of wool and cashmere.

[0081] The fully connected layer 1 maps the fused feature vector to an intermediate dimension and the output is activated by ReLU.

[0082] The fully connected layer 2 maps the intermediate dimensional features to the final numerical feature vector, which is used as the input of the SVM classifier to facilitate processing by the SVM classifier.

[0083] Step 402: Divide the positive sample pairs and the 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 has different performances in different wavelength ranges, this application designs a neural network structure specifically for different wavelength blocks to enhance the learning effect in specific bands. In one possible embodiment, i=5. The wavelength range is 1000nm-2500nm, and the entire wavelength range is divided into 5 sub-bands. Each wavelength block covers a specific wavelength range. The wavelength range of each band is:

[0085] B1 band: 1000nm-1300nm; B1 band mainly contains absorption peaks related to the stretching vibration of CH bonds, especially characteristic peaks related to lipids and fatty acids. In cashmere and wool fibers, although their lipid content is relatively low, there are still some absorption differences in this part. By capturing the CH stretching vibration characteristics of these lipids, additional identification information can be provided to the model.

[0086] B2 band: 1301nm-1600nm; In the B2 band, the absorption peaks related to NH and CH bonds mainly appear, 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 slight differences in certain branches and contents of proteins, which leads to slight differences in their near-infrared spectra in this band. These characteristics are crucial for identifying wool and cashmere.

[0087] B3 band: 1601nm-1900nm; The B3 band contains absorption peaks related to OH bonds and NH bonds, mainly involving the characteristic absorption of moisture and amino acid molecules. The moisture content of cashmere and wool fibers will be different, especially during processing and storage, which causes them to have different performances in the spectrum of this band. By including this band, differential information related to moisture and amino acid content can be captured.

[0088] B4 band: 1901nm-2200nm; B4 band mainly involves absorption peaks related to C=O and OH stretching vibration. These peaks are usually related to carbonyl and amino acid side chains in proteins, and are also related to 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: 2200nm-2500nm. The absorption of the B5 band is mainly related to the NH and OH bonds in amino acids, and also includes some characteristic peaks related to the vibration of the 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 structural differences in the fiber can be identified.

[0090] The spectral characteristics of each band are significantly different, which can effectively capture the chemical composition and physical structure changes of the fiber. Each band has its own unique spectral characteristic peak distribution, which can capture key information related to lipids, proteins, moisture and amino acids. 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.

[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 separate the different wavelength blocks B iTo perform independent feature extraction, the present invention adopts a 5-channel convolutional neural network structure. Each wavelength block B i There is an independent convolution channel responsible for processing the spectral data within this wavelength block and extracting the features within this band.

[0093] Step 404: Calculate the similarity between the numerical feature vectors of the positive and negative sample pairs, thereby constructing a contrast loss function, updating the network parameters of the pre-task model, and obtaining a constructed pre-task model.

[0094] The loss function of the pre-task model adopts the contrast loss function. Since the feature fusion layer introduces the wavelength block weighting mechanism, the goal of the loss function of the pre-task model is to maximize the similarity of positive sample pairs and minimize the similarity of negative sample pairs. contrastiev Perform back-propagation training and use the stochastic gradient descent method to iteratively train the parameters of the pre-task model until the maximum number of iterations is reached, update the network parameters of the pre-task model, and complete the training and construction of the pre-task model.

[0095] The expression of the loss function in step 404 is: where ω i Indicates wavelength block B i The weighting coefficient of Indicates the positive sample pair and The similarity of and To form a positive sample pair, represents the gth sample In wavelength block B i The eigenvectors on represents the gth sample Enhanced sample In wavelength block B i The eigenvectors on ; Represents negative sample pair and The similarity of and To form a negative sample pair, represents the gth sample In wavelength block B i The eigenvectors on represents the pth sample In wavelength block B i The eigenvectors on .

[0096] In one possible embodiment, Calculated by cosine similarity. The calculation method of is similar.

[0097] The present invention constructs a pre-task model through a self-supervised learning algorithm. Without the need for a large amount of labeled data, the pre-task model automatically learns features using the intrinsic characteristics of spectral data. Through three enhancement methods, namely, frequency band scaling, local smoothing perturbation, and spectral peak shift, positive and negative sample pairs are generated, and self-supervised comparative learning tasks are designed. The pre-task model can automatically extract effective features from unlabeled data, greatly reducing the dependence on labeled data, while improving the generalization ability and adaptability of the model.

[0098] Step 5: Construct the downstream task model of self-supervised learning: Use the numerical feature vector as the input of the classification network model, train the classification network model, and obtain the constructed classification network model. The classification network model uses the SVM classifier, and the SVM classifier uses the cross entropy loss function. The SVM classifier is used to complete the classification of cashmere and wool.

[0099] The numerical feature vectors of positive and negative sample pairs are labeled, i.e., positive and negative. The labels of the subject and object of the positive sample pair are represented by 1, the subject label of the negative sample pair is represented by 1, and the object label of the negative sample pair is represented by -1. During 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 better performance on the test data.

[0100] In one possible embodiment, the penalty factor C of the SVM classification model is used to control the penalty intensity 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 a suitable penalty factor C, which is related to the performance of the SVM classification model. The present invention adopts cross validation to select the most suitable penalty factor C from 1-12, with a step size of 1.

[0101] In a possible embodiment, the classification network model may also use an RF classifier or a K-NN classifier.

[0102] Step 6. The constructed pre-task model and the constructed classification network model constitute a self-supervised learning model based on near-infrared spectroscopy, and the near-infrared spectroscopy data of the sample to be tested is classified using the self-supervised learning model of near-infrared spectroscopy.

[0103] The spectral data of the sample to be tested is obtained, and the spectral data is input into a 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 to obtain a classification result.

[0104] It should be noted that wool samples include different forms of textiles such as socks, hats, gloves, and clothes, and cashmere samples include different forms of textiles such as socks, hats, gloves, and clothes. Although their forms are different, the specific identification principles and methods are the same as those of the present application, and will not be repeated here.

[0105] The above description is only an embodiment of the present invention and does not limit the present invention in any way. Any simple modification, change and equivalent structural change made to the above embodiment based on the technical essence of the present invention still falls within the protection scope of the technical solution of the present invention.

Claims

1. A wool and cashmere fiber identification method based on near infrared spectroscopy, characterized in that: The following steps are involved: Step 1: Collect near infrared spectral data of r-type wool samples and collect near infrared spectral data of m-type cashmere samples to form a near infrared spectral data set; Step 2: preprocessing the near infrared spectrum data in the near infrared spectrum data set to obtain spectrum samples; Step 3: Generate enhanced samples for the spectral samples respectively. The qth spectral sample and its enhanced sample constitute a positive sample pair, and the qth spectral sample and the pth spectral sample constitute a negative sample pair. 1≤g≤r, 1≤p≤m, g and p are positive integers. Step 4: Build a pre-task model for self-supervised learning: Step 401, the pre-task model includes an input layer, a convolutional neural network of i channels, a feature fusion layer, a fully connected layer 1 and a fully connected layer 2; Step 402: Divide the positive sample pairs and the negative sample pairs into a plurality of wavelength blocks B i , i represents the number of wavelength blocks, n≥i≥2, n is a positive integer; Step 403: input the wavelength blocks of the positive sample pair into the pre-task model respectively, 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 respectively, and the pre-task model outputs the numerical feature vector of the negative sample pair; Step 404: Calculate the similarity between the numerical feature vectors of the positive and negative sample pairs, thereby constructing a contrast loss function, updating the network parameters of the pre-task model, and obtaining a constructed pre-task model; Step 5: Construct a downstream task model for self-supervised learning: use the numerical feature vector as the input of the classification network model, train the classification network model, and obtain a constructed classification network model; Step 6. 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 of near-infrared spectroscopy is used to classify the samples to be tested.

2. The wool and cashmere fiber identification method based on near infrared spectroscopy according to claim 1, characterized in that: In step three, the methods for generating enhanced samples include spectral band scaling, local smoothing perturbation and spectral peak shift.

3. A wool and cashmere fiber identification method based on near infrared spectroscopy according to claim 2, characterized in that: The specific method of spectral band scaling is: X'(λ)=X(λ)·(1+α), where λ∈[λ1,λ2], [λ1,λ2] is a specific band range, α represents the scaling factor, X(λ) represents the spectral value of the original spectral data at wavelength λ, and X'(λ) represents the enhanced spectral value at wavelength λ.

4. The wool and cashmere fiber identification method based on near infrared spectroscopy according to claim 2, characterized in that: The specific method of local smoothing disturbance is: Where λ∈[λ1,λ2], [λ1,λ2] is a specific band range, n represents the number of wave points within the specific band range, β represents the random noise term, X(λ) represents the spectral value of the original spectral data at wavelength λ, and X'(λ) represents the enhanced spectral value at wavelength λ.

5. The wool and cashmere fiber identification method based on near infrared spectroscopy according to 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 spectral value of the original spectral data at wavelength λ, and X'(λ) represents the enhanced spectral value at wavelength λ.

6. The wool and cashmere fiber identification method based on near infrared spectroscopy according to claim 1, characterized in that: In step 4, the i-channel convolutional neural network includes i convolution branches, and the basic structure of each convolution branch includes convolution layer 1, pooling layer 1, convolution layer 2 and pooling layer 2.

7. The wool and cashmere fiber identification method based on near infrared spectroscopy according to claim 1, characterized in that: Feature Fusion Layer for different wavelength blocks B i The features are weighted fused.

8. The wool and cashmere fiber identification method based on near infrared spectroscopy according to 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. The wool and cashmere fiber identification method based on near infrared spectroscopy according to claim 1, characterized in that: The expression of the loss function in step 404 is: where ω i Indicates wavelength block B i The weighting coefficient of Indicates the positive sample pair and The similarity of and To form a positive sample pair, represents the gth sample In wavelength block B i The eigenvectors on represents the gth sample Enhanced sample In wavelength block B i The eigenvectors on ; Represents negative sample pair and The similarity of and To form a negative sample pair, represents the gth sample In wavelength block B i The eigenvectors on represents the pth sample In wavelength block B i The eigenvectors on .

10. The wool and cashmere fiber identification method based on near infrared spectroscopy according to claim 1, characterized in that: The classification network model adopts SVM classifier, which uses cross entropy loss function.

Citation Information

Patent Citations

  • Cashmere and wool component content identification method based on infrared spectrum technology

    CN117092059A

  • Rapid identification method for wool and cashmere fibers

    CN118190859A

  • Virus detection and quantification method in fluid samples by digital processing diffuse optical reflectance hyperspectral images obtained in the visible and near infrared ranges

    EP4083852A1

  • Image annotation using one or more neural networks

    US20230033075A1