Fiber composition classification method based on one-dimensional convolutional neural network

By constructing a one-dimensional convolutional neural network model, the problem of inaccurate feature extraction from fiber near-infrared spectral data was solved, enabling automated and accurate classification of fiber components and improving analysis efficiency and accuracy.

CN114119984BActive Publication Date: 2024-11-29池明旻
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111039379.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-06
Publication Date
2024-11-29
Estimated Expiration
2041-09-06

AI Technical Summary

Technical Problem

Existing technologies for fiber composition analysis suffer from high dimensionality, complex information, and significant noise in fiber near-infrared spectral data, leading to inaccurate feature extraction. The models are simple in structure and lack efficient band selection methods, which affects accuracy and requires manual preprocessing by professionals, resulting in low efficiency.

Method used

A fiber composition classification method based on a one-dimensional convolutional neural network is adopted, including data acquisition and preprocessing, constructing a one-dimensional convolutional neural network model, extracting features through a one-dimensional convolutional residual module, an attention module, and a one-dimensional inception module, and training the model by combining the cross-entropy loss function and the gradient descent algorithm to achieve end-to-end fiber composition classification.

Benefits of technology

It achieves automatic extraction and high-accuracy prediction of fiber composition features, freeing it from the limitations of domain knowledge, improving the accuracy and efficiency of fiber composition analysis, and reducing reliance on professional knowledge.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114119984B_ABST
    Figure CN114119984B_ABST
Patent Text Reader

Abstract

The present invention provides a fiber component classification method based on a one-dimensional convolutional neural network, which belongs to the intersection of cloth textile component analysis and artificial intelligence technology. The classification method comprises the following steps: cloth fiber near-infrared spectrum data collection, one-dimensional convolutional neural network construction, convolutional neural network hyperparameter selection, one-dimensional convolutional neural network parameter training, and model result verification. The purpose of the present invention is to provide a fiber component classification method based on a one-dimensional convolutional neural network, which does not require the experience and knowledge of experts in the field, automatically extracts effective features from one-dimensional fiber near-infrared spectrum data for determining the various fiber categories contained in the textile to be tested, and realizes an end-to-end training and prediction model framework. Experiments show that the method provided by the invention can effectively solve the problem of textile fiber component classification and significantly improve the accuracy of classification results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention provides a fiber component classification method based on a one-dimensional convolutional neural network, which is used for rapid, accurate and non-destructive detection of textile components and belongs to the intersection of cloth textile component analysis and artificial intelligence technology. Background Art

[0002] Fiber components have the functions of keeping warm and providing decoration, and these components can be quickly detected through near-infrared spectroscopy. Near-infrared spectroscopy is a convenient, accurate, and non-destructive analysis method that has been applied to the quantitative analysis of cloth fiber component data. By scanning the near-infrared spectrum of cloth fiber samples, information such as the reflectivity of the fiber can be recorded. Due to the advantages of near-infrared spectroscopy, researchers can quickly and accurately analyze the categories of fiber components. Currently, there are methods for using near-infrared spectroscopy for fiber component analysis, such as partial least squares, radial basis function neural network, artificial neural network, non-negative matrix decomposition, and fully constrained least squares, all of which show good accuracy and performance. For example, Meng QF et al. used partial least squares method to establish the most effective near-infrared spectroscopy standard model by adopting the optimal wavelength; Lu JH et al. used radial basis function neural network based on wavelet transform preprocessing to analyze near-infrared spectra; JintaoX et al. used artificial neural networks to improve the accuracy of classifiers by extracting high-level semantic features; Heinz D et al. used fully constrained least squares method that satisfies sum-one constraint and non-negative constraint to separate end members and abundance; Lee S et al. proposed non-negative matrix decomposition, which decomposes a sparse matrix into two non-negative dense matrices to process the spectrum.

[0003] 1. Effect defects: (Compare the effects of the prior art with this patent to determine the effect defects of the prior art)

[0004] The current problem is that due to the characteristics of fiber near-infrared spectral data such as high dimension, complex information, and obvious noise, directly classifying these original bands will affect the accuracy of the results. In addition, the data is highly professional and requires manual preprocessing by professionals, which will lose some valuable information, and is inefficient and costly.

[0005] 2. Technical defects that lead to effect defects: (Compare the technical solutions of the prior art with those of this patent to determine the technical defects of the prior art)

[0006] The technical defects are that the model structure is simple, there is no efficient band selection method, the feature extraction is inaccurate, and the dependency between adjacent data is not taken into account, which makes the fiber composition analysis remain at a relatively low level and the accuracy is not high. Summary of the invention

[0007] The present invention provides a fiber component classification method based on a one-dimensional convolutional neural network, and builds a complete end-to-end classification model for cloth fiber near-infrared spectrum data, including cloth fiber near-infrared spectrum data collection and preprocessing, construction of a one-dimensional convolutional neural network, and learning of one-dimensional convolutional neural network parameters. The problem that a large number of noise bands in the original fiber near-infrared spectrum data affect the accuracy of feature extraction is solved, and the limitation of domain knowledge is broken, and the automatic extraction of fiber component features and high-accuracy prediction of component classification are realized.

[0008] To achieve the above object, the present invention provides a fiber component classification method based on a one-dimensional convolutional neural network, comprising:

[0009] (1) Collect and store the near-infrared spectra of cloth fibers, record the categories of the components contained, and save them in json format as experimental data sets;

[0010] (2) building a one-dimensional convolutional neural network model to extract features from the experimental data set; the one-dimensional convolutional neural network model includes a one-dimensional convolution residual module, an attention module, a one-dimensional Inception module, and a classifier module;

[0011] (3) selecting hyperparameters of the one-dimensional convolutional neural network;

[0012] (4) dividing the experimental data set of step (1) into a training set and a test set, and using the divided training set as the input of the one-dimensional convolutional neural network model of step (2) for training to obtain a fiber component classification model;

[0013] (5) Collect near-infrared spectral data of labeled clothing in daily life, input it into the fiber composition classification model for detection, and obtain the material contained in the clothing;

[0014] Furthermore, the specification of preparing the data set in step (1) specifically includes:

[0015] (11) Using a handheld near-infrared spectrometer, collect the near-infrared spectral characteristics of the fabric reflectivity in the 900 to 1700 nm band as a feature vector x, which is used as the input of the model;

[0016] (12) The one-dimensional convolutional neural network fiber composition classification method is used to solve the problem of 12 common materials that are difficult to distinguish, including: cotton, linen, spandex, acrylic, polyester, Tencel, rayon, silk, nylon, wool, cashmere, and modal as the label vector y.

[0017] Furthermore, the one-dimensional convolutional neural network model constructed in step (2) specifically includes:

[0018] (21) Construct a one-dimensional convolution residual module to obtain high-level concentrated features of sample data by increasing the model depth. The module consists of two parts: Identity module and Convolution module. The Convolution module contains: one-dimensional convolution layer, batch normalization layer, non-linear activation Relu layer, and the Identity module is an identity mapping from input to output;

[0019] (22) constructing an attention module, and using the output of the stacked one-dimensional convolution residual module as the input of the attention module to obtain high-level features after feature redistribution; the calculation process of the attention module is as follows:

[0020] Q=W Q ×X (1)

[0021] K=W K ×X (2)

[0022] V=W V ×X (3)

[0023]

[0024] Among them, W Q , W K , W V is the model parameter Q, K, V is the intermediate representation of the input sample features, d k represents the length of a vector in the K matrix, Softmax represents the normalized exponential function, * represents the dot multiplication operation, and × represents the matrix multiplication operation; the above one-dimensional convolution residual module and attention module are alternately superimposed four times;

[0025] (23) Construct a one-dimensional Inception module, and use the output of the above four alternating stacking as the input of the one-dimensional Inception module to obtain the significant features of the sample, which includes four branches:

[0026] Branch 1: a one-dimensional convolutional layer;

[0027] Branch 2: two one-dimensional convolutional layers with different kernel sizes;

[0028] Branch 3: three one-dimensional convolutional layers with different kernel sizes;

[0029] Branch 4: a maximum pooling layer and a one-dimensional convolution layer;

[0030] Combine the output results of the four branches according to the channel dimension;

[0031] (24) Convert the extracted feature dimension into one dimension through global average pooling;

[0032] (25) constructing twelve stacked fully connected layers to integrate the obtained one-dimensional high-level features, and the twelve stacked fully connected layers respectively represent the integration of the twelve common material features mentioned in (11);

[0033] (26) A Sigmoid classifier is constructed for each stacked fully connected layer to classify the one-dimensional high-level features.

[0034] Furthermore, the steps (21) and (23) both include multiple stacked one-dimensional convolutional layers, each one-dimensional convolutional layer includes multiple one-dimensional convolutional kernels, and the calculation steps of each one-dimensional convolutional kernel specifically include:

[0035]

[0036] Where kernel_size_j represents the size of the jth convolution kernel, × represents matrix multiplication, and w represents the weight parameter of the one-dimensional convolution kernel, which obtains the i-th receptive field x by weighted summation. i The features among them, set the number of channels for the one-dimensional convolution kernel to obtain a one-dimensional convolution layer.

[0037] Furthermore, the Convolution part in the one-dimensional convolution residual module in step (21) includes three one-dimensional convolution layers.

[0038] Furthermore, the one-dimensional convolution residual module and the attention module described in steps (21) and (22) are superimposed on each other four times.

[0039] Furthermore, the one-dimensional Inception module in step (23) is composed of four feature extraction branches, and its output results are combined according to the channel dimension.

[0040] Specifically, the step (3) comprises the following steps:

[0041] (31) Set the label of each sample in step (12) to a {0, 1} vector of length 12, which respectively represents the presence of the k-th material;

[0042] (32) Set the number of output channels of the one-dimensional convolution residual module in step (21) to 8 times the number of input channels, and the convolution kernel size to 11.

[0043] Furthermore, in step (4), the training set is input into a one-dimensional convolutional neural network model for training. The specific steps are: using the training set as the input of the loss function Loss, calculating the gradient of the parameters through the BP back propagation algorithm, and updating the model parameters using the gradient descent algorithm to obtain a trained model.

[0044] Furthermore, the model training method comprises the following steps:

[0045] (91) Define the loss function Loss to measure the difference between the true label and the predicted probability, and use the cross entropy loss function CrossEntropy:

[0046]

[0047]

[0048] (92) The model parameters are updated using the gradient descent iterative method. The gradient is calculated using batch stochastic gradient descent, and the model parameters are updated using back propagation. After multiple rounds of iterations, stable network parameters are obtained and saved as the final model.

[0049] The fiber component classification method of the present invention is based on a one-dimensional convolutional neural network and designs a multi-layer feature extraction module. Compared with the existing technology, it has the advantage of not relying on the knowledge of experts in the field, and the feature extraction is fully automatic. It takes into account the dependency between adjacent bands, solves the errors caused by human factors such as lack of experience, realizes end-to-end model training and prediction, and improves the accuracy of fiber component analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0051] Figure 1 This is a model architecture diagram of the fiber component classification method based on a one-dimensional convolutional neural network proposed in this application.

[0052] Figure 2 This is the structural diagram of the one-dimensional convolution residual module proposed in this application.

[0053] Figure 3 This is the near-infrared spectrum of pure cotton material.

[0054] Figure 4 This is the near-infrared spectrum of pure hemp material. DETAILED DESCRIPTION

[0055] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0056] (1) Collect and store the near-infrared spectra of cloth fibers, record the categories of the components contained, and save them in json format as experimental data sets;

[0057] (2) building a one-dimensional convolutional neural network model to extract features from the experimental data set; the one-dimensional convolutional neural network model includes a one-dimensional convolution residual module, an attention module, a one-dimensional Inception module, and a classifier module;

[0058] (3) selecting hyperparameters of the one-dimensional convolutional neural network;

[0059] (4) dividing the experimental data set of step (1) into a training set and a test set, and using the divided training set as the input of the one-dimensional convolutional neural network model of step (2) for training to obtain a fiber component classification model;

[0060] (5) Collect near-infrared spectral data of labeled clothing in daily life, input it into the fiber composition classification model for detection, and obtain the material contained in the clothing.

[0061] Among them, the one-dimensional convolutional neural network model is as follows Figure 1 As shown in the figure, the one-dimensional convolutional neural network is a structure composed of E layers of one-dimensional convolution residual modules, attention modules, and one-dimensional Inception modules connected end to end. E is an integer greater than or equal to 1. This value is a hyperparameter and can be selected according to needs. First, the attention module is added after the one-dimensional convolution residual block to fine-tune the features. The one-dimensional residual module and the attention module are stacked on each other 4 times, and finally the one-dimensional Inception module is superimposed to form a one-dimensional convolutional neural network. The output of the Inception module passes through the global average pooling layer, at which time the length becomes 1, and the dimension is flattened into a two-dimensional matrix as the input of m binary classifiers. A linear combination with a Sigmoid activation function is performed to obtain the final probability vector output P∈R for all waveforms. N×m , m is the size of the fiber component set 12. In order to prevent the model from overfitting during training, a regularization layer and a nonlinear activation layer are added after each convolution layer, and finally the probability values ​​of the existence of twelve materials are obtained.

[0062] In the embodiment, a handheld near-infrared spectrometer is used to collect the near-infrared spectral characteristics of the fabric reflectivity in the 900 to 1700 nanometer band as a feature vector x, which is used as the input of the model. The near-infrared spectrum of the cotton material is as follows: Figure 3 As shown in Figure 2, the near infrared spectrum of hemp material is as follows: Figure 4 As shown; the one-dimensional convolutional neural network fiber composition classification method is used to solve the problem of twelve common materials that are difficult to distinguish, including: cotton, linen, spandex, acrylic, polyester, Tencel, rayon, silk, nylon, wool, cashmere, and modal as label vectors y.

[0063] The fiber component classification method based on a one-dimensional convolutional neural network provided by the example of the present invention is used to classify and detect the near-infrared spectral data of the above twelve different pure materials and mixed materials. The specific operations are as follows:

[0064] Step 1: Structured dataset

[0065] Specifically, the textile fiber near-infrared spectroscopy dataset is loaded, which includes a dataset with labels for twelve materials, divided into training sets and test sets. The sample feature x is a 228-dimensional vector, and the sample label y is a 12-dimensional {0, 1} vector y = [y 1 ,y 2 , ..., y i , ..., y 12 ], respectively indicating whether the i-th material of the sample exists.

[0066] Step 2: Build a one-dimensional convolutional neural network

[0067] A one-dimensional convolutional neural network is constructed to extract features from sample data. The one-dimensional convolutional neural network includes a one-dimensional convolutional residual module, an attention module, a one-dimensional Inception module, and a classifier, wherein the one-dimensional convolutional residual module and the attention module are stacked and added four times;

[0068] Specifically, the one-dimensional convolutional neural network model building process includes the following steps:

[0069] (21) Construct a one-dimensional convolution residual module to obtain high-level concentrated features of sample data by increasing the model depth. The module consists of two parts: Identity module and Convolution module. The Convolution module contains: one-dimensional convolution layer, batch normalization layer, non-linear activation Relu layer, and the Identity module is an identity mapping from input to output;

[0070] (22) Construct an attention module, and use the output of the stacked one-dimensional convolution residual module as the input of the attention module to obtain high-level features after feature redistribution. Because the input of the attention module is the output of the residual module, the two are alternated for four rounds. The feature dimension of the four-round output is the same as 170, but the number of output channels is increased each time, which are 64, 128, 256, and 512 respectively. Taking the first round as an example, the data size input to the attention module is 1024×64×170, which is respectively in the three parameter matrices W Q , W k , W V Do matrix multiplication, W Q , W K , W VThe dimensions of Q, K, and V are all 170×170, and the dimensions of Q, K, and V are also 1024×64×170:

[0071] Q=X×W Q (1)

[0072] K=X×W K (2)

[0073] V=X×W V (3)

[0074] By performing matrix multiplication of the transpose of Q and K and dividing it by the square root of the length of a vector in the K matrix and taking the integer 13, and then multiplying it by the V matrix, we can get the output Z of the attention module, whose dimension is 1024×64×170:

[0075]

[0076] Take Z as the input of the residual module for the next round of feature extraction. (4) Where Z is the feature redistribution matrix obtained by the attention mechanism, Q, K, V are the three matrices used for attention operation; W Q ,W K , W V The parameter matrices of Q, K, and V are obtained respectively; d k Represents the length of a vector in the K matrix; Softmax represents the normalized exponential function;

[0077] Take Z as the input of the residual module for the next round of feature extraction. The above one-dimensional convolution residual module and attention module are stacked in sequence, connected end to end, and the output result of the jth layer is n c is the number of output channels, n k is the output wavelength length, where n k ≤n k-1 ,As the convolutional layer goes deeper, the length of the waveform n k In the reduction, while the dimension n c As the near-infrared spectrum increases, the waveform becomes more compact and contains richer semantic information;

[0078] (23) Construct a one-dimensional Inception module, and use the output of the above four alternating stacking as the input of the one-dimensional Inception module to obtain the significant features of the sample. The one-dimensional Inception module is used to increase the width of the model while increasing the depth of the model, and further extract effective features; the one-dimensional Inception module has a total of one layer and contains four branches, namely:

[0079] Branch 1: convolution kernel size is 1×1 convolution;

[0080] Branch 2: The convolution kernel size is 1×1 and 3×1 convolution stack, and the padding size of the convolution kernel larger than 1 is 1;

[0081] Branch 3: The convolution kernel size is 1×1, 3×1 and 3×1 convolutions are stacked, and the padding size of the convolution kernel larger than 1 is 1;

[0082] Branch 4: The pooling window is a stack of maximum pooling of 3×1 and convolution kernel size of 1×1, and the pooling window padding size is 1;

[0083] The one-dimensional-Inception module is only added in the last round, because only when the model reaches a certain depth, increasing the width of the model will improve the effect; the four branches of the one-dimensional-Inception module process the input data set respectively and obtain four outputs of different sizes;

[0084] (24) The output of the one-dimensional Inception module is the merging of the four branch outputs in the channel dimension. (24) The extracted feature dimension is converted to one dimension through global average pooling GAP. The specific operation is as follows:

[0085] y[batch, channels*1]=GAP(y[batch, channels, features])

[0086] Among them, batch is the batch size input when training the model through the BP algorithm, channels is the number of channels, features is the feature length, and GAP is the mean of the features calculated according to the channel dimension for each sample in the batch;

[0087] (25) Twelve parallel fully connected layers are constructed to synthesize the obtained one-dimensional high-level features. The twelve parallel fully connected layers respectively represent the synthesis of the twelve common material features mentioned in (11). The construction process is as follows:

[0088] y k =f k (w k ×x+b k ), k = 1, 2, ..., 12 (5)

[0089] Among them, k represents twelve parallel fully connected layers, w k is the weight parameter of the kth layer, b k is the bias of the kth layer, × represents matrix multiplication, and f(x) uses the identity function f(x) = x;

[0090] (26) A Sigmoid classifier is constructed for each of the twelve parallel fully connected layers in the last layer to classify the one-dimensional high-level features. The construction formula is as follows:

[0091]

[0092] Furthermore, the steps (21) and (23) both include multiple stacked one-dimensional convolutional layers, each one-dimensional convolutional layer includes multiple one-dimensional convolutional kernels, and the calculation steps of each one-dimensional convolutional kernel specifically include:

[0093]

[0094] Where kernel_size_j represents the size of the jth convolution kernel, × represents matrix multiplication, and w represents the weight parameter of the one-dimensional convolution kernel, which obtains the i-th receptive field x by weighted summation. i The features in it, set the number of channels for the one-dimensional convolution kernel, and get the one-dimensional convolution layer as Figure 2 shown.

[0095] Furthermore, in step (4), the training set is input into a one-dimensional convolutional neural network model for training, and the specific steps are: using the training set as the input of the loss function Loss, calculating the gradient of the parameters through the BP back propagation algorithm, and updating the model parameters using the gradient descent algorithm to obtain a trained model;

[0096] (3) Select one-dimensional convolutional neural network hyperparameters:

[0097] Specifically, step (3) comprises the following steps:

[0098] (31) Set the label of each sample in step (12) to a {0, 1} vector of length 12, which respectively represents the presence of the k-th material;

[0099] (32) Set the number of output channels of the one-dimensional convolution residual module in step (21) to 8 times the number of input channels, and the convolution kernel size to 11.

[0100] Through searching and optimization, the input sample length is 228, the convolution kernel size kernel_size of the first four one-dimensional convolution residual modules is 11, the sliding step size stride is 1, and the padding is set to 5. The number of channels is 64, 128, 256, and 512 respectively, and the high-level feature length is 170; the above features are input to the last layer of one-dimensional Inception module, branch 1 is a convolution with a convolution kernel size kernel_size of 1×1, and the number of output channels is 16; branch 2 is a convolution with a convolution kernel size kernel_size of 1×1 and 3×1 convolution stack, the padding size of the convolution kernel greater than 1 is 1, and the number of output channels is 24; branch 3 is the convolution kernel size kernel_size is 1×1, 3×1 and 3×1 convolution stacks, the padding size of the convolution kernel greater than 1 is 1, and the number of output channels is 32; branch 4 is a stack of maximum pooling with a pooling window of 3×1 and a convolution kernel size of 1×1, the padding size of the pooling window is 1, and the number of output channels is 32; Adam is used as the optimizer, and the learning rate lr is 1e-3;

[0101] (4) dividing the experimental data set of step (1) into a training set and a test set, and using the divided training set as the input of the one-dimensional convolutional neural network model of step (2) for training to obtain a fiber component classification model, the specific steps are as follows:

[0102] (41) Define the loss function Loss to measure the difference between the true label and the predicted probability, and select the cross entropy loss function CrossEntropy: Because it is a binary classification of twelve materials, the average loss of the twelve classifiers is needed as the total loss:

[0103]

[0104]

[0105]

[0106] Where N is the number of samples, for each binary classifier, Y i is the label of the i-th sample, P i is the predicted probability of the i-th sample, k is the k-th binary classifier, and log is the natural logarithm;

[0107] (42) Update the model parameters using the gradient descent iteration method, use batch stochastic gradient descent to calculate the gradient, update the model parameters by back propagation, obtain stable network parameters after multiple rounds of iterations, and save these parameters as the final model;

[0108] (5) Near-infrared spectral data of labeled clothing in daily life are collected and input into the fiber composition classification model for detection to obtain the material contained in the clothing; the model analyzes the textile fiber composition on the test set and calculates the accuracy. Table 1 shows the comparison results of the method of the present invention, ML_KNN, ClassifierChain, and BinaryRelevence based on svm. It can be seen that the method of the present invention is superior to other methods and improves the classification accuracy by at least 32%. The model has a high classification effect.

[0109] method Accuracy Method of the present invention 86.21% ML_KNN 53.96% ClassifierChain 49.71% BinaryRelevence(SVM) 49.41%

[0110] Table 1

[0111] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and substitutions can be made without departing from the technical principles of the present application. These improvements and substitutions should also be regarded as the scope of protection of the present application.

Claims

1. Fiber composition classification method based on one-dimensional convolutional neural network, It is characterized in that The following steps are involved: (1) Collect and store the near-infrared spectra of cloth fibers, record the categories of the components contained, and save them in json format as experimental data sets; (2) building a one-dimensional convolutional neural network model to extract features from the experimental data set; the one-dimensional convolutional neural network model includes a one-dimensional convolution residual module, an attention module, a one-dimensional Inception module, and a classifier module; (3) selecting hyperparameters of the one-dimensional convolutional neural network; (4) dividing the experimental data set of step (1) into a training set and a test set, and using the divided training set as the input of the one-dimensional convolutional neural network model of step (2) for training to obtain a fiber component classification model; (5) Collect near-infrared spectral data of labeled clothing in daily life, input it into the fiber composition classification model for detection, and obtain the material contained in the clothing; Wherein, in step (4), the training set is input into the one-dimensional convolutional neural network model for training, and the specific steps are: using the training set as the input of the loss function Loss, calculating the gradient of the parameters through the BP back propagation algorithm, and updating the model parameters using the gradient descent algorithm to obtain a trained model; The model training method comprises the following steps: (91) Define the loss function Loss to measure the difference between the true label and the predicted probability. The present invention uses the cross entropy loss function CrossEntropy: (92) Update the model parameters using the gradient descent iteration method, use batch stochastic gradient descent to calculate the gradient, update the model parameters by back propagation, obtain stable network parameters after multiple rounds of iterations, and save these parameters as the final model; The specification of preparing the data set in step (1) specifically includes: (11) Using a handheld near-infrared spectrometer, collect the near-infrared spectral characteristics of the fabric reflectivity in the 900 to 1700 nm band as a feature vector x, which is used as the input of the model; (12) The one-dimensional convolutional neural network fiber composition classification method is used to solve the problem of 12 common materials that are difficult to distinguish, including: cotton, linen, spandex, acrylic, polyester, tencel, rayon, silk, nylon, wool, cashmere, and modal as the label vector y; The step (2) of building a one-dimensional convolutional neural network model specifically includes: (21) Construct a one-dimensional convolution residual module to obtain high-level concentrated features of sample data by increasing the model depth. The module consists of two parts: Identity module and Convolution module. The Convolution module contains: one-dimensional convolution layer, batch normalization layer, non-linear activation Relu layer, and the Identity module is an identity mapping from input to output; (22) constructing an attention module, and using the output of the stacked one-dimensional convolution residual module as the input of the attention module to obtain high-level features after feature redistribution; the calculation process of the attention module is as follows: Q=W Q ×X (1); K=W K ×X (2); V=W V ×X (3); Among them, W Q , W K , W V is the model parameter Q, K, V is the intermediate representation of the input sample features, d k represents the length of a vector in the K matrix, Softmax represents the normalized exponential function, * represents the dot multiplication operation, and × represents the matrix multiplication operation; the above one-dimensional convolution residual module and attention module are alternately superimposed four times; (23) Construct a one-dimensional Inception module, and use the output of the above four alternating stacking as the input of the one-dimensional Inception module to obtain the significant features of the sample, which includes four branches: Branch 1: a one-dimensional convolutional layer; Branch 2: two one-dimensional convolutional layers with different kernel sizes; Branch 3: three one-dimensional convolutional layers with different kernel sizes; Branch 4: a maximum pooling layer and a one-dimensional convolution layer; Combine the output results of the four branches according to the channel dimension; (24) Convert the extracted feature dimension into one dimension through global average pooling; (25) constructing twelve stacked fully connected layers to integrate the obtained one-dimensional high-level features, and the twelve stacked fully connected layers respectively represent the integration of the twelve common material features mentioned in (11); (26) constructing a Sigmoid classifier for each stacked fully connected layer to classify the one-dimensional high-level features; Wherein, the step (3) specifically includes: (31) Set the label of each sample in step (12) to a {0, 1} vector of length 12, which respectively represents the presence of the k-th material; (32) Set the number of output channels of the one-dimensional convolution residual module in step (21) to 8 times the number of input channels, and the convolution kernel size to 11.

2. The fiber component classification method based on a one-dimensional convolutional neural network according to claim 1, It is characterized in that The steps (21) and (23) both include multiple stacked one-dimensional convolutional layers, each of which includes multiple one-dimensional convolutional kernels. The calculation steps of each one-dimensional convolutional kernel specifically include: Where kernel_size_j represents the size of the jth convolution kernel, × represents matrix multiplication, and w represents the weight parameter of the one-dimensional convolution kernel, which obtains the i-th receptive field x by weighted summation. i The features among them, set the number of channels for the one-dimensional convolution kernel to obtain a one-dimensional convolution layer.

3. The fiber component classification method based on a one-dimensional convolutional neural network according to claim 1, Features The Convolution part in the one-dimensional convolution residual module in step (21) includes three one-dimensional convolution layers.

4. The fiber component classification method based on a one-dimensional convolutional neural network according to claim 1, Features The one-dimensional convolution residual module and the attention module described in steps (21) and (22) are superimposed on each other four times.

5. The fiber component classification method based on a one-dimensional convolutional neural network according to claim 1, Features The one-dimensional Inception module in step (23) is composed of four feature extraction branches, and its output results are combined according to the channel dimension.

Citation Information

Patent Citations

  • Retinal OCT image classification based on depth learning

    CN109376767A

  • Electrocardiogram classification method based on convolutional neural network

    CN110889448A

  • Fabric material near-infrared spectrum recognition and identification method based on twin network

    CN111797930A