A method for identifying the components of fabric images based on deep learning

Through the Transformer structure of the ResNet-34 neural network and Self-Attention mechanism, the inefficiency of traditional fabric search methods and the high computational complexity of deep learning models are solved, and efficient and accurate identification of fabric components is achieved.

CN114937155BActive Publication Date: 2025-08-05HANGZHOU DIANZI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210644609.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-08
Publication Date
2025-08-05
Estimated Expiration
2042-06-08

AI Technical Summary

Technical Problem

Traditional fabric search methods are slow and costly, and the recognition accuracy is low by using mobile phone graph recognition methods, market supply and demand information do not match, deep learning models have large calculation volume, high CPU occupancy, and poor versatility in fabric component recognition.

Method used

The Transformer structure using ResNet-34 neural network combined with Self-Attention mechanism is used to reduce the computational complexity and improve the recognition rate and accuracy through gradient backpropagation and multi-head self-attention layer, and enhance image feature extraction using edge detection technology.

Benefits of technology

The precise extraction and target matching of fabric image features are achieved, the recognition success rate and accuracy are improved, and the interference of environmental noise is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114937155B_ABST
    Figure CN114937155B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for identifying fabric image components based on deep learning. First, fabric images of different components are collected as training data sets. Then, bicubic interpolation and edge detection based on the Laplace operator are used to scale and enhance the image. Then, based on the basic architecture of deep learning, a convolutional neural network with ResNet‑34 as the main body is designed; using the classification loss function, iterative training is performed through gradient back propagation, and the image to be identified is input into the trained neural network for feature extraction. Then, through the Transformer structure based on the self-attention mechanism, the amount of calculated data is reduced by using a shift window. Finally, a probability distribution is obtained through a linear transformation and a Softmax function, and the fabric image recognition result is output. The present invention effectively gets rid of the interference of environmental noise, realizes the accurate extraction of fabric image features, and the success rate and accuracy of target matching and recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of image recognition technology, and relates to component recognition of fabric images, and specifically to a fabric image component recognition method based on deep learning. Background Art

[0002] With the development of the apparel industry, demand for styles is becoming increasingly diverse, and the variety of fabrics on the market is also increasing. Traditional fabric search methods are no longer able to adapt to the development requirements of the fabric sales industry. The traditional fabric market relies on centralized markets and middlemen, resulting in slow fabric search, high costs, and suboptimal fabric matching. Market supply and demand information is limited by geography and manual massive searches, making it difficult for designers to quickly and accurately collect the fabrics they need, and for fabric suppliers to find the right customers, resulting in a significant information mismatch between supply and demand.

[0003] In recent years, a method of using mobile phone image recognition to match fabrics has emerged. However, due to the performance limitations of mobile phone hardware devices, the captured images cannot clearly reflect the various properties of the fabrics, resulting in low recognition accuracy and unsatisfactory matching results.

[0004] In the field of image recognition, deep learning models demonstrate significant performance and accuracy advantages. However, the choice of deep learning models is often arbitrary, requiring the calculation of thousands of parameters to reflect the model's expressive power. Most models exhibit shortcomings such as high computational complexity, high CPU utilization, complex implementation, and poor versatility. Applying deep learning models to fabric composition recognition requires both versatility and accuracy. Summary of the Invention

[0005] In response to the shortcomings of the existing technology, the present invention proposes a fabric image component recognition method based on deep learning, which introduces a multiple attention mechanism into the convolutional neural network to reduce the computational complexity, increase the recognition rate, and improve the accuracy of the matching results.

[0006] A fabric image component recognition and matching method based on deep learning specifically includes the following steps:

[0007] Step 1: Collect images of fabrics with different compositions, use the specific compositions as corresponding labels, and build a dataset.

[0008] Step 2: Scale the fabric images collected in step 1 to the same size and perform enhancement processing.

[0009] Step 3: Build a ResNet-34 neural network. Input the image data processed in Step 2 into the ResNet-34 neural network. Perform iterative training using gradient backpropagation. Save the trained ResNet-34 neural network. Use the saved ResNet-34 neural network to extract image feature data from the dataset and save it as a template in the feature database.

[0010] Step 4: Build a Transformer structure based on the Self-Attention mechanism, including an encoder and decoder. The multi-head self-attention layer uses a moving window mechanism to shift the self-attention feature value by a certain position, and then divides it into multiple non-repeating but related local windows based on the shifted window.

[0011] Step 5: Input the fabric image to be matched into the ResNet-34 neural network saved in Step 3 to obtain the corresponding feature matrix, which is then input into the decoder. The template data from Step 3 is input into the encoder in sequence. The decoder output is then passed through a linear transformation and a Softmax function to obtain the corresponding probability distribution. The resulting fabric composition recognition results are then sorted and output.

[0012] The present invention has the following beneficial effects:

[0013] A convolutional neural network based on ResNet-34 was established, and the Transformer structure under the Self-Attention mechanism was introduced. The image was enhanced through edge detection technology, which effectively eliminated the interference of environmental noise and achieved accurate extraction of fabric image features, as well as the success rate and accuracy of target matching and recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 This is a flowchart for fabric image component recognition based on deep learning;

[0015] Figure 2 Schematic diagram of the ResNet-34 neural network structure;

[0016] Figure 3 Schematic diagram of the Transformer structure based on the Self-Attention mechanism in the embodiment. DETAILED DESCRIPTION

[0017] The present invention will be further explained below with reference to the accompanying drawings.

[0018] A fabric image component recognition and matching method based on deep learning specifically includes the following steps:

[0019] Step 1: To reduce noise interference, use microphotography to collect 500,000 images of fabrics with different compositions, including woven, knitted, leather, and composite fabrics. Specific compositions are used as labels corresponding to fabric images to establish a dataset.

[0020] Step 2: For the fabric image collected in step 1, first use the bicubic interpolation method to uniformly scale it to 128*128 pixels. Then use Gaussian filtering to reduce noise, and then use the Laplacian operator edge detection technology to perform enhancement processing. The Laplacian operator used in this embodiment is Finally, the image is randomly flipped horizontally and vertically or the brightness is enhanced to improve the data richness.

[0021] Step 3: In order to solve the common problems of gradient disappearance and network degradation in neural networks, the present invention selects Figure 2 The image data processed in step 2 is input into the ResNet-34 neural network. The processing of the input data by the ResNet-34 neural network includes the following three parts:

[0022] In the first part, the convolution layer and the pooling layer are passed in sequence, performing a convolution operation with a kernel of 7×7 and a stride of 2×2, and a maximum pooling operation respectively;

[0023] The second part consists of four convolution steps: the first step consists of three residual blocks, all of which perform convolution operations with a 3×3 kernel size and 64 kernels; the second step consists of four residual blocks, all of which perform convolution operations with a 3×3 kernel size and 128 kernels; the third step consists of six residual blocks, all of which perform convolution operations with a 3×3 kernel size and 256 kernels; and the fourth step consists of three residual blocks, all of which perform convolution operations with a 3×3 kernel size and 512 kernels. The first convolution operation of the first residual block in each step has a stride of 2, and the stride of the remaining convolution operations is 1. To ensure the consistency of the number of channels between each step, 1×1 convolution operations are included between the four steps.

[0024] In the third part, the feature matrix is output through the average pooling and straightening layers in turn, and finally through the fully connected layer.

[0025] Input the feature matrix into the SoftMax function to obtain the predicted probability and calculate the error with the true label of the image. Using Softmax Cross Entropy Loss as the loss function, the error between the predicted probability and the true label is calculated. The cross entropy L of the i-th sample is i Defined as:

[0026]

[0027] Among them, P i represents the predicted probability of the i-th sample, Y i represents the true label of the i-th sample, e represents a natural constant, x i 、x j Represent samples respectively, i, j∈[1,N], and N is the total number of samples in the training set.

[0028] Therefore, the cross entropy loss function L is:

[0029]

[0030] We iteratively trained the model using gradient backpropagation and gradient optimization using the AdaGrad method. We set the target accuracy to 98% and trained the model for 10,000 iterations. The trained ResNet-34 neural network was saved. We then used the saved ResNet-34 neural network to extract image feature data from the dataset and saved it as a template in the feature database.

[0031] Step 4: Build a Transformer structure based on the Self-Attention mechanism, including an encoder and decoder. The multi-head self-attention layer uses a moving window mechanism to shift the self-attention feature value by a certain position, and then divides it into multiple non-repeating but related local windows based on the shifted window.

[0032] Step 5: Input the fabric image to be matched into the ResNet-34 neural network saved in Step 3 to obtain the corresponding feature matrix, which is then input into the decoder. The template data from Step 3 is input into the encoder in sequence. The decoder output is then passed through a linear transformation and a Softmax function to obtain the corresponding probability distribution. The resulting fabric composition recognition results are then sorted and output.

[0033] The above description is merely a specific embodiment of the present invention. Obviously, the present invention is not limited to the details of the exemplary embodiment described above. Therefore, the embodiment should be considered as illustrative and non-restrictive. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.

Claims

1. A fabric image component recognition method based on deep learning, characterized by: The specific steps include: Step 1: Collect images of fabrics with different compositions, use the specific compositions as corresponding labels, and build a dataset; Step 2: Scale the fabric images collected in step 1 to the same size and perform enhancement processing; Step 3: Build a ResNet-34 neural network, input the image data processed in step 2 into the ResNet-34 neural network, iteratively train and adjust the network parameters, and save the trained ResNet-34 neural network; use the saved ResNet-34 neural network to extract image feature data of fabrics with different compositions, and save it as a template into a feature database; Step 4: Construct a Transformer structure based on the Self-Attention mechanism, including an encoder and a decoder. In the multi-head self-attention layer, the moving window mechanism is used to shift the self-attention feature value by a certain position, and then the shifted window is used to divide it into multiple non-repeating but related local windows. Step 5: Input the fabric image to be matched into the ResNet-34 neural network saved in step 3, obtain the corresponding feature matrix and input it into the decoder; The template data in the feature database are input into the encoder in sequence, and then the output results of the decoder are sequentially subjected to a linear transformation and a Softmax function to obtain the corresponding probability distribution. After sorting, the fabric composition recognition results are output.

2. The fabric image component recognition method based on deep learning according to claim 1, characterized in that: Using microphotography, we collected 500,000 images of fabrics of varying composition, including wovens, knits, leather, and composites.

3. The fabric image component recognition method based on deep learning according to claim 1, characterized in that: For the fabric image collected in step 1, the bicubic interpolation method is first used to uniformly scale it to 128*128 pixels; then, after passing through Gaussian filtering, the edge detection technology of the Laplacian operator is used for enhancement processing.

4. The fabric image component recognition method based on deep learning according to claim 3, characterized in that: The Laplacian operator is 5. The fabric image component recognition method based on deep learning according to claim 1, characterized in that: Step 2 also includes randomly performing horizontal and vertical flipping or brightness enhancement on the scaled and enhanced image.

6. The fabric image component recognition method based on deep learning according to claim 1, characterized in that: The ResNet-34 neural network is iteratively trained using Softmax Cross Entropy Loss as the loss function, and the AdaGrad method is used for gradient optimization.

7. The fabric image component recognition method based on deep learning according to claim 1 or 6, characterized in that: The optimization accuracy of the ResNet-34 neural network is set to 98%.

8. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • A method of Clothing Attribute Prediction with Auto-Encoding Transformations

    AU2020102476A4

  • Fine-grained cloth image retrieval method based on cross entropy loss function

    CN113268625A