A textile fiber identification and composition detection system

Through a textile fiber identification and component detection system combining spectral data and image data, the component recognition model and fiber attention mechanism are used to solve the problem of low recognition accuracy and efficiency in the prior art, and high-precision fiber identification and component analysis are achieved.

CN118883440BActive Publication Date: 2025-04-25NANTONG LEISHENG SIZING CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410910499.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-09
Publication Date
2025-04-25
Estimated Expiration
2044-07-09

AI Technical Summary

Technical Problem

Existing fiber identification and composition detection methods rely on a single type of data, lacking effective attention mechanisms and optimized loss functions, resulting in low recognition accuracy and efficiency in handling complex fiber combinations and ensuring category balance.

Method used

A textile fiber identification and component detection system is proposed, and the component recognition model is used for analysis by combining spectral data and image data. The model includes a data preprocessing layer, a feature extraction layer, a feature analysis layer, a fully connected layer and a result output layer, and introduces a fiber attention mechanism and an optimized loss function to improve recognition accuracy and efficiency.

Benefits of technology

High-precision identification and composition analysis of textile fibers are realized, and the detection of complex fiber combinations can be accurately identified and balanced with different fiber categories is improved, which improves the performance and sensitivity of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118883440B_ABST
    Figure CN118883440B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of textile fabrics, and specifically to a textile fiber identification and component detection system. First, a sample to be detected is subjected to a first preprocessing to obtain a first detection sample; then, the first detection sample is processed to obtain first image data and first spectral data; finally, the first image data and the first spectral data are sequentially passed through a preprocessing layer, a feature extraction layer, a feature analysis layer, a fully connected layer, and a result output layer of a component identification model. Through the processing of these five layers, the system can accurately analyze the component content of various fibers in the textile, thereby realizing efficient and accurate fiber identification and component detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of textile fabrics, and in particular to a textile fiber identification and component detection system. Background Art

[0002] Fiber identification is a technology used to determine the types of fibers present in textiles. This process is essential for quality control, compliance verification, and consumer information transparency for textiles. As the textile market globalizes and consumers pay more attention to sustainable production, accurate fiber identification can help manufacturers ensure that products meet international standards and market demands, while also ensuring that consumers can get the product characteristics they expect. Ingredient testing involves analyzing the specific chemical composition and proportions of various fibers in textiles, which not only helps to evaluate the performance of textiles, such as durability and comfort, but also relates to the recycling and environmentally friendly treatment of textiles. For example, accurate ingredient testing can guide the separation of materials in the recycling process, thereby improving recycling efficiency and the reuse value of materials. In addition, ingredient testing is also essential to meet strict environmental regulations and standards, especially when targeting high-standard markets such as the European Union.

[0003] The continuous development of fiber identification and component detection technology has effectively improved the production efficiency and market competitiveness of textiles, while enhancing consumer trust and satisfaction. With the strengthening of environmental regulations and the increase in consumer demand for sustainable products, these technologies have also promoted the development and promotion of environmentally friendly textiles.

[0004] Current methods for fiber identification and component detection mainly include optical microscopy, combustion tests, and dissolution tests, which allow the identification and differentiation of various fibers from the macroscopic to the molecular level. For example, optical microscopy can observe the physical morphology of fibers. Component detection mainly relies on advanced spectroscopic analysis techniques, such as near-infrared spectroscopy and Fourier transform infrared spectroscopy, which can accurately quantify the proportion of various fibers in textiles and analyze complex mixed fiber products.

[0005] In existing research, the Chinese patent application number CN201910163415.3 proposed a textile fiber identification and composition detection system, which realizes automatic imaging, fiber type identification and quality analysis of textile samples through the collaborative work of optical imaging system, camera and host computer. The Chinese patent application number CN202011127366.7 proposed a mutual information identification method for cotton foreign fibers, including equipment initialization, high-speed imaging processing of cotton fibers, comprehensive and detailed fiber feature identification, classification marking, automatic cleaning, automatic correction of identification errors and permanent storage of data.

[0006] Although there are some methods for fiber recognition and component detection, these methods usually rely on a single type of data and lack effective attention mechanisms and optimized loss functions, which limits their recognition accuracy and efficiency in processing complex fiber combinations and ensuring category balance.

[0007] Therefore, a textile fiber identification and composition detection system is proposed. Summary of the invention

[0008] The purpose of the present invention is to provide a textile fiber identification and component detection system. First, the sample to be detected is subjected to a first preprocessing to obtain a first detection sample; then, the first detection sample is processed to obtain first image data and first spectral data; finally, the first image data and the first spectral data are sequentially passed through the preprocessing layer, feature extraction layer, feature analysis layer, full connection layer and result output layer of the component identification model. Through the processing of these five layers, the system can accurately analyze the component content of various fibers in the textile, thereby realizing efficient and accurate fiber identification and component detection.

[0009] To achieve the above object, the present invention provides the following technical solutions:

[0010] A textile fiber identification and component detection system, comprising:

[0011] A sample processing unit, used for performing a first pretreatment on the sample to be tested to obtain a first test sample; the first pretreatment includes cleaning and drying;

[0012] A data acquisition unit, used to acquire data of the first detection sample, and acquire first spectrum data and first image data; the first spectrum data is acquired by a near-infrared spectrometer; the first image data is acquired by a microscope camera;

[0013] A data analysis unit, comprising a component recognition model, for analyzing the first spectral data and the first image data to obtain analysis results; the component recognition model comprises a data preprocessing layer, a feature extraction layer, a feature analysis layer, a fully connected layer and a result output layer;

[0014] The data preprocessing layer is used to perform preprocessing operations on the first spectrum data and the first image data respectively to obtain second spectrum data and second image data;

[0015] The feature extraction layer is used to perform feature extraction on the second spectrum data and the second image data respectively to obtain a comprehensive spectrum feature vector and a comprehensive image feature vector.

[0016] The process of acquiring the first spectral data includes using the near-infrared spectrometer to scan the first test sample and record the light reflection intensity at different wavelengths; the process of acquiring the first image data includes using the microscope camera to photograph the first test sample and obtain a microstructure image of the first test sample.

[0017] The data preprocessing layer includes a first processing channel and a second processing channel; the first processing channel is used to perform a first preprocessing operation on the first spectral data to obtain the second spectral data; the first preprocessing operation includes baseline correction and denoising; the second processing channel is used to perform a second preprocessing operation on the first image data to obtain the second image data; the second preprocessing operation includes color enhancement, contrast adjustment, edge enhancement and noise filtering.

[0018] The feature extraction layer includes two network structures; the two network structures are GRU and CNN respectively; the CNN includes a convolution layer, an activation layer, a pooling layer and a fully connected layer, which are used to analyze the second image data and obtain the comprehensive image feature vector; the GRU is used to analyze the second spectral data and obtain the comprehensive spectral feature vector;

[0019] The convolution layer applies a plurality of convolution filters to capture local features of the second image data; the local features include texture features, edge features, shape features, and color features;

[0020] The activation layer is used to add nonlinear processing to help the network learn more complex features;

[0021] The pooling layer is used to reduce the spatial dimension of the feature and improve the abstraction and invariance of the feature;

[0022] The fully connected layer is used to integrate the learned local features to form the comprehensive image feature vector.

[0023] The process of obtaining the comprehensive spectrum feature vector includes:

[0024] The peaks were identified using local maximum search, and the peak position, peak height, slit width, and peak area were obtained;

[0025] The position, height, width and area characteristics of the peak are summarized to form a comprehensive spectral feature vector.

[0026] The feature analysis layer is used to analyze the comprehensive image feature vector and the comprehensive spectrum feature vector, obtain the analysis results and input them into the fully connected layer; the feature analysis layer includes a fiber attention mechanism; the fiber attention mechanism includes a channel attention module and a spatial attention module, which are used to pay attention to different features of different fibers; the formula of the channel attention module is:

[0027] M c (F)=σ(Conv1D(AvgPool(F))+Conv1D(MaxPool(F)));

[0028] Where F is the input feature vector, Conv1D is a one-dimensional convolution operation, AvgPool and MaxPool represent global average pooling and global maximum pooling respectively, and σ is the Sigmoid activation function used to generate channel weights;

[0029] The formula of the spatial attention module is:

[0030] M s (F) = σ(Convx1(Concat(Dconv r=1 (F),DConv r=2 (F),DConv r=3 (F))));

[0031] Among them, Dconv r represents a dilated convolution with an expansion rate of r, Convx1 represents a 1x1 convolution for dimensionality reduction, Concat represents a concatenation operation in the channel dimension, and σ is a Sigmoid activation function used to generate spatial attention weights;

[0032] The attention weighted feature F′ is calculated by combining the channel attention module and the spatial attention module, and the calculation formula is:

[0033]

[0034] Among them, and denote element-wise multiplication in the channel and spatial dimensions, respectively.

[0035] The fully connected layer is used to learn the nonlinear combination of features, and integrates the feature vectors obtained by the feature analysis layer through a weight matrix.

[0036] The result output layer is a structure with multiple outputs; each of the outputs corresponds to a quantified result of a fiber; and the quantified result is a component ratio of the fiber.

[0037] The component recognition model is trained by using historical data sets to improve the accuracy and reliability of recognition;

[0038] Each piece of data in the historical data set includes image data and spectral data; each piece of data in the historical data set is annotated with results; the result annotation includes the component proportions of various fibers; the historical data set is divided into a training set and a verification set in a ratio of 7:3; the component identification model is trained through the training set; and the component identification model is verified and optimized through the verification set.

[0039] The model training includes optimizing a loss function, wherein the optimized loss function L fi for:

[0040]

[0041]

[0042] Among them, L CE Used to enhance the accuracy of fiber identification; true A vector of actual fiber components, each element represents the actual proportion of a fiber, y pred is the fiber component vector predicted by the model, each element represents the predicted fiber ratio; N is the number of categories, that is, the types of different fibers; L MSE Used to enhance the accuracy of component ratio prediction; i It is to increase the weight of rare fiber types to solve the problem of fiber category imbalance; fr(i) represents the frequency of occurrence of the i-th fiber in the training set, which is used to adjust the loss weight of this fiber type; α and β are adjustable hyperparameters used to balance L CE and L MES contribution.

[0043] Compared with the prior art, the present invention has the following beneficial effects:

[0044] 1. The present invention uses comprehensive analysis and feature extraction of spectral data and image data to enable the system to achieve high-precision identification and component analysis of textile fibers. Spectral data provides a unique fingerprint of chemical composition, allowing the system to accurately distinguish minute differences between different chemical substances; while image data reveals the microstructural characteristics of the fiber, including texture, shape, and color characteristics. Combining the analysis of these two data types, the system can not only identify fiber types, but also detect complex combinations of fiber components, thereby providing a more comprehensive material characterization.

[0045] 2. The present invention proposes a fiber attention mechanism that combines channel attention and spatial attention, greatly improving the performance and sensitivity of the fiber recognition system. By applying the fiber attention mechanism, the system can more effectively focus on the most critical features in the recognition process, including spectral peaks of specific wavelengths and specific textures in the image. The channel attention module enables the model to automatically adjust the focus when processing different fiber components and enhance the response to important channels; the spatial attention module enhances the model's ability to recognize important spatial positions in fiber samples. This focusing mechanism effectively improves the accuracy and efficiency of fiber component detection.

[0046] 3. The present invention proposes an optimized loss function that not only focuses on the correct classification of categories, but also pays attention to the accuracy of the quantitative results, which is crucial for the accurate prediction of the component ratio; in addition, by introducing a weight adjustment factor, the optimized loss function can also solve the problem of category imbalance and ensure that the model can give appropriate attention and treatment to all types of fibers. This loss function design that comprehensively considers classification accuracy and prediction accuracy effectively improves the reliability and accuracy of the system in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A flowchart of an implementation method of a textile fiber identification and component detection system provided by an embodiment of the present invention;

[0048] Figure 2 A schematic diagram of the structure of a textile fiber identification and component detection system provided by an embodiment of the present invention;

[0049] Figure 3 A schematic diagram of a single fiber provided by an embodiment of the present invention;

[0050] Figure 4 A diagram showing the test results of a training set of a cross-validation experiment provided by an embodiment of the present invention;

[0051] Figure 5 A diagram of the validation set test results of a cross-validation experiment provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] In the textile industry, fiber identification and composition testing is a vital link. It involves a wide range of applications from simple clothing manufacturing to high-end technical textiles. Accurate fiber identification not only ensures product quality and meets international trading and regulatory requirements, but also plays a key role in consumers' purchasing decisions. In addition, with the improvement of sustainable development and environmental awareness, the correct analysis of the composition of textiles is of great significance for recycling, reducing environmental impact and developing new materials.

[0054] Common textile fibers are divided into natural fibers and chemical fibers; natural fibers include plant fibers, animal fibers and mineral fibers; plant fibers include cotton, linen and fruit fibers; animal fibers include wool, rabbit hair and silk; mineral fibers include asbestos. Chemical fibers include regenerated fibers, synthetic fibers and inorganic fibers; regenerated fibers include viscose fibers; synthetic fibers include cotton nylon, nylon and polypropylene; inorganic fibers include glass fibers and metal fibers.

[0055] Traditional fiber identification and composition analysis methods mainly rely on chemical testing and microscopic analysis, which are usually complex, time-consuming and require professional technicians to operate. With the increase in the variety of textiles and the widespread use of composite materials, the limitations of traditional methods have become more and more obvious, and they cannot meet the industry's dual needs for efficiency and accuracy.

[0056] With the development of image processing technology and spectral analysis technology, combined with advanced machine learning algorithms, it is possible to develop an integrated fiber identification and component detection system. This system can quickly and non-destructively identify fiber types and components through high-precision optical imaging and spectral analysis, greatly improving the speed and accuracy of analysis.

[0057] The purpose of the present invention is to provide a textile fiber identification and composition detection system. The specific implementation method flow chart and system structure diagram of the system refer to Figure 1 and Figure 2 .

[0058] Reference Figure 1 As shown, before starting the fiber identification and component detection analysis, it is necessary to first determine whether the sample to be tested contains fiber components; if it does, start the analysis; if it does not, reselect the sample to be tested.

[0059] The specific steps for fiber identification and component testing of the samples to be tested include:

[0060] First, the sample to be tested is subjected to a first preprocessing, including cleaning and drying, to obtain a first test sample; then, data acquisition is performed on the first test sample to obtain first image data and first spectral data; finally, the first image data and the first spectral data are sequentially passed through the preprocessing layer, feature extraction layer, feature analysis layer, full connection layer and result output layer of the component recognition model to obtain the component content of various fibers.

[0061] In order to explain in detail the textile fiber identification and composition detection system proposed by the present invention, the present invention is described through the following two embodiments.

[0062] Embodiment 1

[0063] In textiles, different textile fibers have different image characteristics and spectral characteristics. For example, in the textile image of the microscope camera with a 40x objective lens, cotton fibers are flat and ribbon-like in the longitudinal direction with natural twists; wool is curled in the longitudinal direction and has scales on the surface; jute has horizontal nodes and vertical stripes in the longitudinal direction, etc.

[0064] In terms of spectral analysis, different fiber types also show different characteristic performances, which mainly reflect the chemical and molecular structure of various fibers. For example, cotton fiber is mainly composed of cellulose, and its spectrum usually shows absorption peaks unique to cellulose. These peaks mainly appear in the wavelength range of the infrared spectrum, especially around 3400cm-1 (OH bond stretching vibration) and 2900cm-1 (CH bond vibration); wool is a protein fiber, and its spectral characteristics include specific absorption bands of amino acid residues. Characteristic absorption peaks at 1650cm-1 (amide I band, C=O stretching vibration) and 1540cm-1 (amide II band, NH bending and CN stretching) can usually be observed in the wool spectrum.

[0065] In this embodiment, by comprehensively considering the image features and spectral features of the fibers in the textiles and proposing a component recognition model to analyze the features, the accuracy of fiber recognition and component detection is significantly improved.

[0066] First, a first pretreatment is performed on the sample to be tested to obtain a first test sample; the first pretreatment includes cleaning and drying; this step is applied to a sample processing unit of a textile fiber identification and component detection system;

[0067] The first pretreatment is mainly to remove dust, grease, stains and other impurities that may exist on the fiber surface. If these impurities are not removed, they will interfere with the spectral analysis and image capture of the fiber, resulting in inaccurate data. For example, dust and grease on the surface may change the absorption peak and reflectivity in the spectral data, or affect the clarity of the image and the color performance of the fiber during optical imaging.

[0068] Then, data acquisition is performed on the first test sample to obtain first image data and first spectrum data; this step is applied to a data acquisition unit of a textile fiber identification and component detection system; the first spectrum data is acquired by a near-infrared spectrometer; the first image data is acquired by a microscope camera;

[0069] Furthermore, the process of acquiring the first spectral data includes using the near-infrared spectrometer to scan the first test sample and record the light reflection intensity at different wavelengths; the process of acquiring the first image data includes using the microscope camera to photograph the first test sample and obtain a microstructure image of the first test sample.

[0070] In this embodiment, a microscope camera objective lens of 40 times is used.

[0071] By using a near-infrared spectrometer and a microscope camera, the system can comprehensively obtain key information about fiber samples in two dimensions: spectral data reveals the chemical properties and composition structure of the fiber, while high-resolution image data provides a detailed microstructural view of the fiber, such as Figure 3 Shown is a schematic diagram of a single fiber under a 40x objective lens;

[0072] This dual data acquisition method not only enhances the accuracy of identifying fiber types and component ratios, but also makes the analysis process more comprehensive and in-depth, laying a solid data foundation for subsequent data analysis.

[0073] Finally, the first spectrum data and the first image data are input into the component recognition model, and the analysis results are obtained through the data preprocessing layer, the feature extraction layer, the feature analysis layer, the full connection layer and the result output layer in sequence; this step is applied to a data analysis unit of a textile fiber recognition and component detection system;

[0074] Further, the data preprocessing layer is used to perform preprocessing operations on the first spectrum data and the first image data respectively to obtain second spectrum data and second image data;

[0075] The data preprocessing layer includes a first processing channel and a second processing channel; the first processing channel is used to perform a first preprocessing operation on the first spectral data to obtain the second spectral data; the first preprocessing operation includes baseline correction and denoising; the second processing channel is used to perform a second preprocessing operation on the first image data to obtain the second image data; the second preprocessing operation includes color enhancement, contrast adjustment, edge enhancement and noise filtering.

[0076] In this embodiment, baseline correction is mainly used to eliminate background signals in the spectrum, which is achieved by a polynomial fitting algorithm. De-noising is mainly used to remove measurement noise while retaining important spectral features, which is achieved by applying a Gaussian smoothing digital filter.

[0077] The main purpose of color enhancement is to improve the color saturation and contrast of the image, making the colors in the image more vivid and easy to distinguish different fiber materials and states. This is achieved by adjusting the color space parameters of the image; contrast adjustment is used to increase the light and dark contrast of the image, making the details in the image more obvious, and optimizing the image by using adaptive histogram equalization technology. Edge enhancement is used to improve the clarity of the boundaries of objects in the image, which helps to better analyze the morphology and structural boundaries of the fiber. It is achieved by using the edge detection algorithm Laplacian operator to strengthen the high-frequency part. Noise filtering is to remove random noise generated during image acquisition and processing, which may interfere with the correct identification and analysis of the fiber. This is achieved by using a median filter.

[0078] In this embodiment, the data preprocessing layer includes two processing channels specifically for optimizing spectral and image data. The first processing channel performs baseline correction and denoising on the spectral data, clearly highlighting the chemical signal, making the chemical composition analysis more accurate. The second processing channel optimizes the image data by enhancing color, adjusting contrast, strengthening edges and filtering noise, thereby greatly improving the image resolution and the visualization quality of the fiber microstructure. This preprocessing not only ensures the consistency and reliability of data input, but also lays a solid foundation for deep feature extraction and comprehensive analysis.

[0079] Furthermore, the feature extraction layer is used to perform feature extraction on the second spectral data and the second image data respectively to obtain a comprehensive spectral feature vector and a comprehensive image feature vector.

[0080] Furthermore, the feature extraction layer includes two network structures; the two network structures are GRU and CNN respectively; the CNN includes a convolution layer, an activation layer, a pooling layer and a fully connected layer, which are used to analyze the second image data to obtain the comprehensive image feature vector; the GRU is used to analyze the second spectral data to obtain the comprehensive spectral feature vector;

[0081] The convolution layer applies multiple convolution filters to capture the local features of the second image data; the local features include texture features, edge features, shape features and color features; the activation layer is used to add nonlinear processing to help the network learn more complex features; the pooling layer is used to reduce the spatial dimension of the features and improve the abstraction and invariance of the features; the fully connected layer is used to integrate the learned local features to form the comprehensive image feature vector.

[0082] The CNN network deeply analyzes the image data through its convolutional layer, activation layer, pooling layer and fully connected layer, effectively capturing the local features of the fiber such as texture, edge, shape and color. These hierarchical processing not only improves the abstraction and invariance of the features, but also enhances the learning ability of the model by adding nonlinear processing, enabling the system to accurately identify complex fiber features.

[0083] In the feature extraction layer, by integrating advanced CNN and GRU network structures, image and spectral data can be efficiently analyzed and integrated. The CNN network deeply analyzes the image data through its convolutional layer, activation layer, pooling layer and fully connected layer, effectively capturing the local features of the fiber such as texture, edge, shape and color. These levels of processing improve the abstraction and invariance of the features, enhance the learning ability of the model, and enable the system to accurately identify complex fiber features. At the same time, the GRU network processes spectral data and extracts time series features to ensure the depth and accuracy of spectral analysis. This comprehensive feature extraction strategy greatly improves the efficiency and accuracy of fiber component recognition, providing strong technical support for textile quality control and new material research and development.

[0084] Furthermore, the process of obtaining the comprehensive spectral feature vector includes:

[0085] Peaks were identified using local maximum search to obtain peak position, peak height, slit width, and peak area;

[0086] The position, height, width and area characteristics of the peak are summarized to form a comprehensive spectral feature vector.

[0087] In this embodiment, by using local maximum search to accurately identify the peak in the spectral data, not only the position, height, width and area of ​​the peak are obtained, but also these key parameters are summarized to form a comprehensive spectral feature vector, which greatly improves the accuracy and efficiency of chemical composition analysis. This method enables the system to reveal the subtle differences of chemical substances in detail, providing a solid data foundation for high-precision fiber identification and component detection.

[0088] Furthermore, the feature analysis layer is used to analyze the comprehensive image feature vector and the comprehensive spectrum feature vector, obtain the analysis results and input them into the fully connected layer;

[0089] The feature analysis layer includes a fiber attention mechanism; the fiber attention mechanism includes a channel attention module and a spatial attention module, which are used to pay attention to different features of different fibers; the formula of the channel attention module is:

[0090] M c(F)=σ(Conv1D(AvgPool(F))+Conv1D(MaxPool(F)));

[0091] Where F is the input feature vector, Conv1D is a one-dimensional convolution operation, AvgPool and MaxPool represent global average pooling and global maximum pooling respectively, and σ is the Sigmoid activation function used to generate channel weights;

[0092] The formula of the spatial attention module is:

[0093] M s (F) = σ(Convx1(Concat(Dconv r=1 (F),DConv r=2 (F),DConv r=3 (F))));

[0094] Among them, Dconv r represents a dilated convolution with an expansion rate of r, Convx1 represents a 1x1 convolution for dimensionality reduction, Concat represents a concatenation operation in the channel dimension, and σ is a Sigmoid activation function used to generate spatial attention weights;

[0095] The attention weighted feature F′ is calculated by combining the channel attention module and the spatial attention module, and the calculation formula is:

[0096]

[0097] Among them, and denote element-wise multiplication in the channel and spatial dimensions, respectively.

[0098] In this embodiment, the feature analysis layer includes a fiber attention mechanism, which uses a channel attention module and a spatial attention module to focus on the most critical fiber features, including subtle differences in chemical composition and microstructural characteristics of the fiber. The channel attention module optimizes the weights of each channel in the feature vector by analyzing the results of global average pooling and global maximum pooling, thereby enhancing the model's sensitivity to chemical properties. The spatial attention module uses dilated convolution and 1x1 convolution to enhance the understanding of the fiber's spatial structure and improve the ability to recognize fiber morphological features. This dual attention strategy ensures that the most effective information is extracted from complex data, greatly optimizes the data processing effect of the subsequent fully connected layer, and provides strong technical support for ensuring the accuracy and comprehensiveness of fiber recognition.

[0099] Furthermore, the fully connected layer is used to learn the nonlinear combination between features and integrate the feature vectors obtained by the feature analysis layer through the weight matrix. This layer can deeply explore and utilize these complex data relationships by learning the nonlinear combination between features and effectively integrating the comprehensive feature vectors from the feature analysis layer using the weight matrix. This not only enables the system to more accurately identify the types and components of various fibers, but also improves the ability to identify subtle differences in fiber characteristics, thereby improving the recognition accuracy and reliability of the entire system.

[0100] The result output layer is a structure with multiple outputs; each of the outputs corresponds to a quantified result of a fiber; and the quantified result is a component ratio of the fiber.

[0101] In this embodiment, the result output layer is designed as a multi-output structure, which enables the system to provide quantitative results of multiple fibers at the same time. Each output corresponds to the composition ratio of a fiber, ensuring detailed and accurate identification of various fiber components in textiles.

[0102] In order to verify the effectiveness of the component recognition model, an ablation experiment was conducted in this embodiment. The experimental results are shown in Table 1.

[0103] Table 1 Ablation experiment results

[0104]

[0105] Referring to Table 1, Model 5 is the component recognition model proposed in this embodiment, Model 1 is based on Model 5 without considering image features, Model 2 is based on Model 5 without considering spectral features, and Model 3 removes the fiber attention mechanism based on Model 5. Model 4 removes the optimization loss function based on Model 5.

[0106] It can be concluded from the data in Table 1 that the component recognition model proposed in this embodiment has the highest scores in precision (P%), recall rate (R%) and F1 score (F1%), indicating the effectiveness of the component recognition model proposed in this embodiment when facing fiber recognition and component detection tasks.

[0107] Furthermore, the component identification model is trained by using historical data sets to improve the accuracy and reliability of fiber identification and component detection.

[0108] Each piece of data in the historical data set includes image data and spectral data; each piece of data in the historical data set is annotated with results; the result annotation includes the component proportions of various fibers; the historical data set is divided into a training set and a verification set in a ratio of 7:3; the component identification model is trained through the training set; and the component identification model is verified and optimized through the verification set.

[0109] In this embodiment, a training and verification method based on a historical data set is used to significantly improve the accuracy and reliability of recognition. The historical data set includes image data and spectral data, and each piece of data is accurately annotated with results, which covers the composition ratio of the fiber, ensuring the authenticity and validity of the data in the training and verification process. By dividing the training set and the verification set in a ratio of 7:3, the model can learn on the training set and test its performance on the verification set, thereby identifying potential overfitting or other problems and performing necessary optimization.

[0110] Furthermore, the model training includes optimizing a loss function, wherein the optimized loss function L fi for:

[0111]

[0112] Among them, L CE Used to enhance the accuracy of fiber identification; true A vector of actual fiber components, each element represents the actual proportion of a fiber, y pred is the fiber component vector predicted by the model, each element represents the predicted fiber ratio; N is the number of categories, that is, the types of different fibers; L MSE Used to enhance the accuracy of component ratio prediction; i It is to increase the weight of rare fiber types to solve the problem of fiber category imbalance; fr(i) represents the frequency of occurrence of the i-th fiber in the training set, which is used to adjust the loss weight of this fiber type; α and β are adjustable hyperparameters used to balance L CE and L MES contribution.

[0113] In this embodiment, by optimizing a composite loss function that combines classification and regression losses, the system can significantly improve the recognition accuracy of different fiber types and the prediction accuracy of component ratios. This method is particularly effective in solving the problem of imbalanced fiber categories. By giving higher weights to rare fiber types, the fairness and accuracy of the system when processing diverse textiles is ensured.

[0114] Embodiment 2

[0115] First, a first pretreatment is performed on the sample to be tested to obtain a first test sample; the first pretreatment includes cleaning and drying; this step is applied to a sample processing unit of a textile fiber identification and component detection system;

[0116] The first pretreatment is mainly to remove dust, grease, stains and other impurities that may exist on the fiber surface. If these impurities are not removed, they will interfere with the spectral analysis and image capture of the fiber, resulting in inaccurate data. For example, dust and grease on the surface may change the absorption peak and reflectivity in the spectral data, or affect the clarity of the image and the color performance of the fiber during optical imaging.

[0117] Then, data acquisition is performed on the first test sample to obtain first image data and first spectrum data; this step is applied to a data acquisition unit of a textile fiber identification and component detection system; the first spectrum data is acquired by a near-infrared spectrometer; the first image data is acquired by a microscope camera;

[0118] Furthermore, the process of acquiring the first spectral data includes using the near-infrared spectrometer to scan the first test sample and record the light reflection intensity at different wavelengths; the process of acquiring the first image data includes using the microscope camera to photograph the first test sample and obtain a microstructure image of the first test sample.

[0119] In this embodiment, a microscope camera objective lens of 40 times is used.

[0120] Finally, the first spectrum data and the first image data are input into the component recognition model, and the analysis results are obtained through the data preprocessing layer, the feature extraction layer, the feature analysis layer, the full connection layer and the result output layer in sequence; this step is applied to a data analysis unit of a textile fiber recognition and component detection system;

[0121] Further, the data preprocessing layer is used to perform preprocessing operations on the first spectrum data and the first image data respectively to obtain second spectrum data and second image data;

[0122] The data preprocessing layer includes a first processing channel and a second processing channel; the first processing channel is used to perform a first preprocessing operation on the first spectral data to obtain the second spectral data; the first preprocessing operation includes baseline correction and denoising; the second processing channel is used to perform a second preprocessing operation on the first image data to obtain the second image data; the second preprocessing operation includes color enhancement, contrast adjustment, edge enhancement and noise filtering.

[0123] In this embodiment, baseline correction is mainly used to eliminate background signals in the spectrum, which is achieved by a polynomial fitting algorithm. De-noising is mainly used to remove measurement noise while retaining important spectral features, which is achieved by applying a Gaussian smoothing digital filter.

[0124] The main purpose of color enhancement is to improve the color saturation and contrast of the image, making the colors in the image more vivid and easy to distinguish different fiber materials and states. This is achieved by adjusting the color space parameters of the image; contrast adjustment is used to increase the light and dark contrast of the image, making the details in the image more obvious, and optimizing the image by using adaptive histogram equalization technology. Edge enhancement is used to improve the clarity of the boundaries of objects in the image, which helps to better analyze the morphology and structural boundaries of the fiber. It is achieved by using the edge detection algorithm Laplacian operator to strengthen the high-frequency part. Noise filtering is to remove random noise generated during image acquisition and processing, which may interfere with the correct identification and analysis of the fiber. This is achieved by using a median filter.

[0125] In this embodiment, the data preprocessing layer includes two processing channels specifically for optimizing spectral and image data. The first processing channel performs baseline correction and noise removal on the spectral data to clearly highlight the chemical signal, making the chemical composition analysis more accurate. The second processing channel optimizes the image data by enhancing color, adjusting contrast, strengthening edges and filtering noise, thereby greatly improving the image resolution and the visualization quality of the fiber microstructure.

[0126] Furthermore, the feature extraction layer is used to perform feature extraction on the second spectral data and the second image data respectively to obtain a comprehensive spectral feature vector and a comprehensive image feature vector.

[0127] The feature extraction layer includes two network structures; the two network structures are GRU and CNN respectively; the CNN includes a convolution layer, an activation layer, a pooling layer and a fully connected layer, which are used to analyze the second image data and obtain the comprehensive image feature vector; the GRU is used to analyze the second spectral data and obtain the comprehensive spectral feature vector;

[0128] The convolution layer applies a plurality of convolution filters to capture local features of the second image data; the local features include texture features, edge features, shape features, and color features;

[0129] The activation layer is used to add nonlinear processing to help the network learn more complex features;

[0130] The pooling layer is used to reduce the spatial dimension of the feature and improve the abstraction and invariance of the feature;

[0131] The fully connected layer is used to integrate the learned local features to form the comprehensive image feature vector.

[0132] The CNN network deeply analyzes the image data through its convolutional layer, activation layer, pooling layer and fully connected layer, effectively capturing the local features of the fiber such as texture, edge, shape and color. These hierarchical processing not only improves the abstraction and invariance of the features, but also enhances the learning ability of the model by adding nonlinear processing, enabling the system to accurately identify complex fiber features.

[0133] Furthermore, the process of obtaining the comprehensive spectral feature vector includes:

[0134] The peaks were identified using local maximum search to obtain the peak position, peak height, slit width and peak area; the peak position, height, width and area characteristics were summarized to form a comprehensive spectral feature vector.

[0135] Furthermore, the feature analysis layer is used to analyze the comprehensive image feature vector and the comprehensive spectrum feature vector, obtain the analysis results and input them into the fully connected layer;

[0136] The feature analysis layer includes a fiber attention mechanism; the fiber attention mechanism includes a channel attention module and a spatial attention module, which are used to pay attention to different features of different fibers; the formula of the channel attention module is:

[0137] M c (F)=σ(Conv1D(AvgPool(F))+Conv1D(MaxPool(F)));

[0138] Where F is the input feature vector, Conv1D is a one-dimensional convolution operation, AvgPool and MaxPool represent global average pooling and global maximum pooling respectively, and σ is the Sigmoid activation function used to generate channel weights;

[0139] The formula of the spatial attention module is:

[0140] M s (F) = σ(Convx1(Concat(Dconv r=1 (F),DConv r=2 (F),DConv r=3 (F))));

[0141] Among them, Dconv r represents a dilated convolution with an expansion rate of r, Convx1 represents a 1x1 convolution for dimensionality reduction, Concat represents a concatenation operation in the channel dimension, and σ is a Sigmoid activation function used to generate spatial attention weights;

[0142] The attention weighted feature F′ is calculated by combining the channel attention module and the spatial attention module, and the calculation formula is:

[0143]

[0144] Among them, and denote element-wise multiplication in the channel and spatial dimensions, respectively.

[0145] In this embodiment, the feature analysis layer includes a fiber attention mechanism, which uses the channel attention module and the spatial attention module to focus on the most critical fiber features, including subtle differences in chemical composition and microstructural characteristics of the fiber. The channel attention module optimizes the weights of each channel in the feature vector by analyzing the results of global average pooling and global maximum pooling, thereby enhancing the model's sensitivity to chemical properties. The spatial attention module uses dilated convolution and 1x1 convolution to enhance the understanding of the fiber spatial structure and improve the ability to recognize fiber morphological characteristics.

[0146] Furthermore, the fully connected layer is used to learn the nonlinear combination between features and integrate the feature vectors obtained by the feature analysis layer through the weight matrix. This layer can deeply explore and utilize these complex data relationships by learning the nonlinear combination between features and effectively integrating the comprehensive feature vectors from the feature analysis layer using the weight matrix.

[0147] The result output layer is a structure with multiple outputs; each output corresponds to a quantitative result of a fiber; and the quantitative result is the component ratio of the fiber. In order to better evaluate the performance and generalization ability of the model, a cross-validation experiment was performed in this embodiment. The experimental results of the cross-validation are shown in Table 2.

[0148] Table 2 Cross validation experiment results

[0149]

[0150] The specific steps of the cross-validation experiment include: dividing the data set into 5 non-overlapping subsets, one of which is used as a validation set and the other 4 subsets are used as training sets for the experiment; conducting 5 experiments of EM1, EM2, EM3, EM4 and EM5 respectively, and obtaining the final evaluation index by calculating the average value of the results of EM1, EM2, EM3, EM4 and EM5.

[0151] As shown in Table 2, the component recognition model showed high precision (P%), recall rate (R%) and F1 score (F1%) in each experiment; the experimental results of the training set and the validation set in the cross-validation experiment are shown in Figure 2. Figure 4 and Figure 5 shown.

[0152] Reference Figure 4 and Figure 5Although the performance of the component recognition model on the training set and the validation set fluctuated slightly in different experiments, it still showed good stability and consistency overall. The average results showed that the precision on the training set was 74.86%, the recall rate was 75.41%, and the F1 score was 75.63%, while on the validation set, these indicators were 70.43%, 74.41%, and 72.75%, respectively. This consistent performance confirmed that the component recognition model proposed in this embodiment has good stability and generalization ability, and there is no overfitting phenomenon.

[0153] Furthermore, the component identification model is trained by using historical data sets to improve the accuracy and reliability of fiber identification and component detection;

[0154] Each piece of data in the historical data set includes image data and spectral data; each piece of data in the historical data set is annotated with results; the result annotation includes the component proportions of various fibers; the historical data set is divided into a training set and a verification set in a ratio of 7:3; the component identification model is trained through the training set; and the component identification model is verified and optimized through the verification set.

[0155] Furthermore, the model training includes optimizing a loss function, wherein the optimized loss function L fi for:

[0156]

[0157] Among them, L CE Used to enhance the accuracy of fiber identification; true A vector of actual fiber components, each element represents the actual proportion of a fiber, y pred is the fiber component vector predicted by the model, each element represents the predicted fiber ratio; N is the number of categories, that is, the types of different fibers; L MSE Used to enhance the accuracy of component ratio prediction; i It is to increase the weight of rare fiber types to solve the problem of fiber category imbalance; fr(i) represents the frequency of occurrence of the i-th fiber in the training set, which is used to adjust the loss weight of this fiber type; α and β are adjustable hyperparameters used to balance L CE and L MES contribution.

[0158] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A textile fiber identification and component detection system, characterized in that: include: A sample processing unit, used for performing a first preprocessing on the sample to be tested to obtain a first test sample; The first pretreatment includes washing and drying; A data acquisition unit, used to acquire data of the first detection sample, and acquire first spectrum data and first image data; The first spectral data is obtained by a near-infrared spectrometer; the first image data is obtained by a microscope camera; A data analysis unit, comprising a component recognition model, for analyzing the first spectral data and the first image data to obtain analysis results; the component recognition model comprises a data preprocessing layer, a feature extraction layer, a feature analysis layer, a fully connected layer and a result output layer; The data preprocessing layer is used to perform preprocessing operations on the first spectrum data and the first image data respectively to obtain second spectrum data and second image data; The feature extraction layer is used to extract features from the second spectrum data and the second image data respectively to obtain a comprehensive spectrum feature vector and a comprehensive image feature vector; The result output layer is a structure with multiple outputs; each of the outputs corresponds to a quantified result of a fiber; the quantified result is the component ratio of the fiber; The component recognition model is trained by using historical data sets to improve the accuracy and reliability of recognition; Each piece of data in the historical data set includes image data and spectral data; each piece of data in the historical data set is annotated with results; the result annotation includes the component proportions of various fibers; the historical data set is divided into a training set and a validation set in a ratio of 7:3; the component recognition model is trained by the training set; and the component recognition model is verified and optimized by the validation set; The model training includes optimizing a loss function, wherein the optimized loss function L fi for: Among them, L CE Used to enhance the accuracy of fiber identification; true A vector of actual fiber components, each element represents the actual proportion of a fiber, y pred is the fiber component vector predicted by the model, each element represents the predicted fiber ratio; N is the number of categories, that is, the types of different fibers; L MSE Used to enhance the accuracy of component ratio prediction; i It is to increase the weight of rare fiber types to solve the problem of fiber category imbalance; fr(i) represents the frequency of occurrence of the i-th fiber in the training set, which is used to adjust the loss weight of this fiber type; α and β are adjustable hyperparameters used to balance L CE and L MES contribution.

2. A textile fiber identification and component detection system according to claim 1, characterized in that: The process of acquiring the first spectral data includes using the near-infrared spectrometer to scan the first test sample and record the light reflection intensity at different wavelengths; the process of acquiring the first image data includes using the microscope camera to photograph the first test sample and obtain a microstructure image of the first test sample.

3. A textile fiber identification and component detection system according to claim 1, characterized in that: The data preprocessing layer includes a first processing channel and a second processing channel; the first processing channel is used to perform a first preprocessing operation on the first spectral data to obtain the second spectral data; the first preprocessing operation includes baseline correction and denoising; the second processing channel is used to perform a second preprocessing operation on the first image data to obtain the second image data; the second preprocessing operation includes color enhancement, contrast adjustment, edge enhancement and noise filtering.

4. A textile fiber identification and component detection system according to claim 1, characterized in that: The feature extraction layer includes two network structures; the two network structures are GRU and CNN respectively; the CNN includes a convolution layer, an activation layer, a pooling layer and a fully connected layer, which are used to analyze the second image data and obtain the comprehensive image feature vector; the GRU is used to analyze the second spectral data and obtain the comprehensive spectral feature vector; The convolution layer applies a plurality of convolution filters to capture local features of the second image data; the local features include texture features, edge features, shape features, and color features; The activation layer is used to add nonlinear processing to help the network learn more complex features; The pooling layer is used to reduce the spatial dimension of the feature and improve the abstraction and invariance of the feature; The fully connected layer is used to integrate the learned local features to form the comprehensive image feature vector.

5. A textile fiber identification and component detection system according to claim 4, characterized in that: The process of obtaining the comprehensive spectrum feature vector includes: The peaks were identified using local maximum search, and the peak position, peak height, slit width, and peak area were obtained; The position, height, width and area characteristics of the peak are summarized to form a comprehensive spectral feature vector.

6. A textile fiber identification and component detection system according to claim 1, characterized in that: The feature analysis layer is used to analyze the comprehensive image feature vector and the comprehensive spectrum feature vector, obtain the analysis results and input them into the fully connected layer; the feature analysis layer includes a fiber attention mechanism; the fiber attention mechanism includes a channel attention module and a spatial attention module, which are used to pay attention to different features of different fibers; the formula of the channel attention module is: M c (F)=σ(Conv1D(AvgPool(F))+Conv1D(MaxPool(F))); Where F is the input feature vector, Conv1D is a one-dimensional convolution operation, AvgPool and MaxPool represent global average pooling and global maximum pooling respectively, and σ is the Sigmoid activation function used to generate channel weights; The formula of the spatial attention module is: M s (F)=σ(Convx1(Concat(Dconv r=1 (F),DConv r=2 (F),DConv r=3 (F)))); Among them, Dconv r represents a dilated convolution with an expansion rate of r, Convx1 represents a 1x1 convolution for dimensionality reduction, Concat represents a concatenation operation in the channel dimension, and σ is a Sigmoid activation function used to generate spatial attention weights; The attention weighted feature F′ is calculated by combining the channel attention module and the spatial attention module, and the calculation formula is: Among them, · and denote element-wise multiplication in the channel and spatial dimensions, respectively.

7. A textile fiber identification and component detection system according to claim 1, characterized in that: The fully connected layer is used to learn the nonlinear combination of features, and integrates the feature vectors obtained by the feature analysis layer through a weight matrix.

Citation Information

Patent Citations

  • A textile fiber identification and composition detection system

    CN111665243B

  • Mutual information identification method for cotton foreign fibers

    CN112330608A

  • Textile fiber component identification method and device, storage medium and processor

    CN118196505A