A fabric pilling defect grade evaluation method and system based on a deep convolutional network

By optimizing the ResNet 34 model and designing a deep convolutional network, combined with Gaussian pyramid decomposition and spectral residual analysis, the problems of weak target pilling and complex background texture in fabrics were solved, achieving a more accurate assessment of fabric pilling defect levels.

CN115222958BActive Publication Date: 2026-01-06XI'AN POLYTECHNIC UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210885784.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-26
Publication Date
2026-01-06
Estimated Expiration
2042-07-26

AI Technical Summary

Technical Problem

In existing technologies, the target of fabric pilling is weak and the background texture of the fabric is complex, resulting in insufficient accuracy in assessing the pilling defect level of the fabric. Furthermore, methods based on shallow neural networks and deep convolutional networks suffer from insufficient feature extraction and overfitting problems.

Method used

We employ a deep convolutional network-based approach. By optimizing the ResNet 34 model and constructing saliency maps using Gaussian pyramid decomposition and spectral residual analysis, we use a first convolutional layer with three 3×3 kernels, add ReLU6 activation function and average pooling, and design channel attention and spatial attention modules to achieve subtle extraction and full learning of fabric pilling features.

Benefits of technology

This improves the accuracy and robustness of fabric pilling defect rating, reduces the risk of overfitting, and achieves a more objective and accurate fabric pilling rating.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115222958B_ABST
    Figure CN115222958B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on deep convolution network's fabric pilling defect grade evaluation method and system, will first layer convolution layer 7×7 convolution kernel design into the combination of three 3×3 convolution kernel, realize the effective extraction of small target pilling feature;Residual network is replaced by ReLU6 activation function with ReLU activation function, avoid the weight range difference caused by ReLU activation function too large to destroy the characteristic information of pilling;Average pooling is added in residual network, and pilling feature information is obtained using small size receptive field, so that the pilling feature is more sufficient, the network parameter is reduced, and overfitting caused by too many parameters is avoided.Add attention mechanism model, according to the parallel way of channel attention mechanism and spatial attention mechanism, so that the fabric pilling feature is more fully extracted.Therefore, the grade evaluation method can accurately evaluate the fabric pilling grade under the condition of weak fabric pilling target and complex fabric background texture, meet the accuracy requirement of fabric pilling grade evaluation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of fabric surface pilling defect assessment, and relates to a method and system for assessing fabric pilling defect levels based on deep convolutional networks. Background Technology

[0002] Fabrics are a crucial raw material for textiles. With rising living standards, surface defects such as creases, wrinkles, frayed edges, and pilling have become significant factors determining fabric performance and lifespan. Pilling, as a surface defect, directly determines fabric quality and is one of the most important indicators for assessing fabric surface quality. Therefore, the detection and grading of pilling defects are essential. Currently, existing technologies for assessing fabric pilling typically involve rubbing the fabric against a surface to a certain degree, calculating the total amount of pills produced, and subtracting this from the original weight of the sample or weighing it as a percentage. Since calculating the mass or weighing is a time-consuming task, experienced operators often make subjective assessments based on standard photographs. While this method has high accuracy, it is easily affected by human factors. Therefore, using machine vision for automated fabric pilling grading has become an inevitable trend in the textile research field. The main methods currently used are as follows:

[0003] This statistical method for assessing fabric pilling levels separates pills from the fabric texture using a threshold. Based on the size, number, total area, and average area of ​​the pills, statistical distribution analysis is employed to evaluate the pilling level of the fabric sample. Two-dimensional discrete wavelet transform and relative total variational models are used to suppress texture information in the pilling image. Morphological operations are then performed, and the total area of ​​the pills and the area of ​​the pilling image are extracted as evaluation parameters. Finally, statistical distribution analysis is used to achieve the level assessment. A three-dimensional image is acquired using a laser beam and a CCD camera. Periodic textures are removed in the frequency domain, and Laplacian and median filters are applied to extract edges, separating the pills from the fabric image background to obtain pill parameters. Statistical distribution experiments are then used to achieve objective level assessment. Two-dimensional Gaussian fitting theory is used to match pilling templates to the pilling image. A histogram is then used to calculate the pilling image segmentation threshold. Finally, parameters such as the number of pills, the average area of ​​the pills, and the pilling density are extracted to assess the pilling level of the fabric image. By improving the saliency model to enhance the significance of fabric pilling, Gaussian fitting and threshold segmentation are used to separate fabric pills from the fabric texture to obtain an interest map. The obtained parameters, such as the number of pills and the total area of ​​pills, are then used to grade the pilling information through statistical distribution experiments. It can be seen that the effectiveness of separating pills from the background and the selection of pilling features for statistical analysis directly affect the final equivalence assessment result of this statistical method.

[0004] This paper proposes a shallow neural network-based method for assessing fabric pilling levels. It uses a Gaussian model-based thresholding method to segment pilling information from images, extracts pilling features, and inputs these features into an unsupervised self-organizing feature map network (MEMB) to automatically assess the pilling level. A saliency map is constructed, and the Otsu algorithm is used to segment pilling features, followed by a backpropagation (BP) neural network for evaluation. Pilling feature parameters are extracted, and the LMBP backpropagation neural algorithm is used as the evaluator to determine the pilling level. However, this method relies on empirically set parameters, and the limited number of network layers results in insufficient representation of fabric pilling characteristics, leading to less than ideal evaluation results.

[0005] A deep neural network-based method for assessing fabric pilling levels uses Fourier transform to convert the image to the frequency domain, then employs an iterative thresholding method to enhance the image, obtaining a complete and clear pilling image. Finally, a deep learning algorithm is used to train the data on the pilling image, and the degree of pilling is assessed based on the learned features. However, this method uses deep learning to assess pilling from binary images, which are prone to losing some pilling information, leading to misjudgments of pilling levels. Furthermore, the multiple hidden layers of the network can easily cause overfitting in the deep learning algorithm. Another approach uses frequency domain filtering to remove fabric texture components, then builds a deep convolutional neural network to objectively assess pilling levels. Because the number of pills in a fabric is large, the target is small, and the feature division between each pilling level is not obvious, if the convolutional neural network does not learn enough features during feature extraction, the accuracy of fabric pilling level assessment can easily be low.

[0006] Pilling grading methods based on statistics, discriminant analysis, and support vector machines primarily rely on extracting pilling features for further grading. While these methods can grade fabric pilling, they have limitations. First, the extraction of these feature parameters largely depends on manual definition. Since there are many characteristics of pilling, relying solely on pilling density, area, and quantity for grading results in an insufficiently objective assessment. Second, parameters selected based on experience during grading vary depending on fabric texture. Furthermore, shallow neural network algorithms suffer from high model complexity and a large number of parameters, and the reliance on manual selection of pilling feature parameters makes end-to-end input impossible, failing to meet current industrial requirements. Summary of the Invention

[0007] The purpose of this invention is to solve the problem that the existing technology cannot meet the accuracy of fabric pilling defect level assessment due to the weak target of fabric pilling and the complex background texture of the fabric. The invention provides a method and system for assessing fabric pilling defect level based on deep convolutional networks.

[0008] To achieve the above objectives, the present invention employs the following technical solution:

[0009] The present invention proposes a method for evaluating the pilling defect level of fabrics based on deep convolutional networks, comprising the following steps:

[0010] Based on the preprocessed fabric pilling dataset, obtain the fabric pilling saliency map;

[0011] Build an optimized ResNet 34 model;

[0012] The fabric pilling saliency map is input into the optimized ResNet 34 model to output the fabric pilling level, thus realizing the fabric pilling level assessment.

[0013] Preferably, the significant pilling pattern k(t) of the fabric is obtained as follows:

[0014] k(t)=a×f(t)+(1-a)×h(t) (1)

[0015] Where f(t) is the local feature saliency map; h(t) is the global feature saliency map; a is the fusion degree of the two images, a∈{0,1}; and t is the pixel coordinate.

[0016] Preferably, the preprocessed fabric pilling dataset is subjected to Gaussian pyramid decomposition to obtain the local feature saliency map f(t) of the fabric pilling image;

[0017] Spectral residual analysis was performed on the preprocessed fabric pilling dataset to obtain the global feature saliency map h(t) of the fabric pilling image.

[0018] Preferably, the optimized ResNet 34 model includes a first convolutional layer, a residual network module, and an attention module CBAM.

[0019] Preferably, the first convolutional layer is a combination of three 3×3 convolutional kernels, and the input to the first convolutional layer is a saliency map of fabric pilling.

[0020] The residual network module is as follows:

[0021] The first part of the residual network module includes 3×3 convolutions, batch normalization (BN), and ReLU6 activation function;

[0022] The second part of the residual network module includes an average pooling layer and a 1×1 convolutional layer;

[0023] The balling characteristics are obtained by summing the first part of the output of the residual network module and the second part of the output of the residual network module.

[0024] The attention module CBAM is as follows:

[0025] The attention module CBAM includes a channel attention module and a spatial attention module;

[0026] Channel attention module: Max pooling and average pooling are performed on the input image. The pooled spherical feature map is passed through a shared fully connected layer and nonlinear transformation is performed using an activation function to obtain the channel attention weights.

[0027] Spatial attention module: Max pooling and average pooling are applied to the input image. The pooled spherical feature maps are then connected and convolved through standard convolutional layers. Nonlinear transformation is performed using activation functions to obtain the final weights and generate spatial attention weights.

[0028] Preferably, the final optimized output fabric pilling feature map F z as follows:

[0029]

[0030] Where F is the input fabric pilling feature map; M c (F) represents the output weights of the input fabric pilling feature map after channel attention; M s (F) represents the output weight of F after spatial attention; This is an addition operation based on element-wise multiplication.

[0031] Preferably, the receptive field of the convolutional layer is calculated as follows:

[0032]

[0033] Among them, RF l-1 f1 is the size of the receptive field corresponding to layer l-1, and f1 is the size of the convolution kernel in layer 1. RF0 is the cumulative product of the step sizes from layer 1 to layer l-1, and RF0 is the receptive field size corresponding to the input layer.

[0034] This invention proposes a fabric pilling defect level assessment system based on deep convolutional networks, comprising:

[0035] A saliency map acquisition module is used to acquire a fabric pilling saliency map based on the preprocessed fabric pilling dataset.

[0036] A model building module, which is used to build an optimized ResNet 34 model;

[0037] The grade acquisition module is used to input the fabric pilling saliency map into the optimized ResNet34 model and output the fabric pilling grade to realize the fabric pilling grade assessment.

[0038] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of a method for assessing the pilling defect level of fabrics based on a deep convolutional network.

[0039] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of a method for assessing the pilling defect level of fabrics based on a deep convolutional network.

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

[0041] This invention proposes a method for assessing the pilling defect level of fabrics based on deep convolutional networks. By improving the ResNet34 model, an optimized ResNet34 model is obtained. The fabric pilling saliency map is input into the optimized ResNet34 model, and the pilling level is output, thus achieving the assessment of fabric pilling level. Therefore, this invention, through the combination of the optimized ResNet34 model and the fabric pilling saliency map, can solve the problem in existing technologies where the pilling target is weak and the fabric background texture is complex, leading to inaccuracies in fabric pilling defect level assessment. This fabric defect level assessment method has significant research value in the field of fabric surface defect assessment.

[0042] Furthermore, by using Gaussian pyramid decomposition and spectral residual analysis, a saliency map of fabric pilling is constructed to enhance important information (pilling) in the fabric pilling image and suppress unimportant information (fabric texture, uneven lighting, noise, etc.), thus providing conditions for the fabric pilling defect level assessment model.

[0043] Furthermore, in fabric pilling image recognition, the pilling features are complex and diverse, and the pilling targets in the pilling images are small, with indistinct differences in pilling grade features. Therefore, large convolutional kernels are not suitable for fabric pilling defect grade assessment models. The first convolutional layer in the model is designed as a combination of three 3×3 convolutional kernels, which makes the features extracted from the pilling images more subtle and enables the feature extraction of small target pilling.

[0044] Furthermore, the ReLU activation function is replaced with the ReLU6 activation function in the residual network to avoid the large difference in weight range caused by the ReLU activation function, which would destroy the feature information of balling. Average pooling is added to the shortcut loop of the residual network to obtain the feature information of balling by using a small receptive field, so that the balling feature is more complete and the network parameters are reduced, avoiding overfitting caused by too many parameters.

[0045] Furthermore, channel attention and spatial attention mechanisms are used in parallel to extract fabric fuzz features. This allows both attention modules to directly learn the features of the input fuzzing image, preventing instability caused by the sequential connection order. This approach better focuses on important information (fuzz) and suppresses unimportant information (background), making the entire network more suitable for the current fabric sample set and enabling effective grading of fabric fuzz at different levels. Simultaneously, to focus on more critical and discriminative salient channel and spatial features, the upper-layer input feature F is compared with the current channel feature M. c (F) and spatial features M s (F) Perform an element-wise multiplication-based summation operation to obtain a scaled new feature, thus obtaining the final fabric pilling feature map F. z .

[0046] This invention proposes a fabric pilling defect level assessment system based on deep convolutional networks. By dividing the system into a saliency map acquisition module, a model construction module, and a level acquisition module, the modular approach makes each module independent of the others, facilitating unified management of each module. Attached Figure Description

[0047] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 This is a flowchart of the fabric pilling defect level assessment method based on deep convolutional networks according to the present invention.

[0049] Figure 2 This is a detailed flowchart of the fabric pilling defect level assessment method based on deep convolutional networks according to the present invention.

[0050] Figure 3 This is an overall flowchart of the deep convolutional network fabric pilling defect level assessment model designed in this invention.

[0051] Figure 4 This is a flowchart of the first convolutional layer in the deep convolutional network fabric pilling defect level assessment model designed in this invention.

[0052] Figure 5 This is a flowchart of the residual network in the deep convolutional network fabric pilling defect level assessment model designed in this invention.

[0053] Figure 6This is a graph showing the ReLU activation function and the ReLU6 activation function in the deep convolutional network fabric pilling defect level assessment model designed in this invention.

[0054] Figure 7 This is a flowchart of the channel attention module in the deep convolutional network fabric pilling defect level assessment model designed in this invention.

[0055] Figure 8 This is a flowchart of the spatial attention module in the deep convolutional network fabric pilling defect level assessment model designed in this invention.

[0056] Figure 9 This is a flowchart of the CBAM module in the deep convolutional network fabric pilling defect level assessment model designed in this invention.

[0057] Figure 10 It is the confusion matrix of the training results of the deep convolutional network fabric pilling defect level assessment model designed in this invention.

[0058] Figure 11 This is a diagram of the fabric pilling defect level assessment system based on deep convolutional networks according to the present invention. Detailed Implementation

[0059] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0060] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0061] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0062] In the description of the embodiments of the present invention, it should be noted that if terms such as "upper," "lower," "horizontal," or "inner" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship commonly used when the product of the invention is in use, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention. Furthermore, terms such as "first" and "second" are only used to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0063] Furthermore, the use of the term "horizontal" does not imply that the component must be absolutely horizontal, but rather that it can be slightly tilted. For example, "horizontal" simply means that its direction is more horizontal than "vertical," and does not mean that the structure must be completely horizontal, but can be slightly tilted.

[0064] In the description of the embodiments of the present invention, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention according to the specific circumstances.

[0065] The present invention will now be described in further detail with reference to the accompanying drawings:

[0066] This invention proposes a method for evaluating the pilling defect level of fabrics based on deep convolutional networks, such as... Figure 1 As shown, it includes the following steps:

[0067] S1. Obtain the fabric pilling saliency map based on the preprocessed fabric pilling dataset;

[0068] The significance diagram of fabric pilling, k(t), is obtained as follows:

[0069] k(t)=a×f(t)+(1-a)×h(t) (1)

[0070] Where f(t) is the local feature saliency map; h(t) is the global feature saliency map; a is the fusion degree of the two images, a∈{0,1}; and t is the pixel coordinate.

[0071] Gaussian pyramid decomposition was performed on the preprocessed fabric pilling dataset to obtain the local feature saliency map f(t) of the fabric pilling image.

[0072] Spectral residual analysis was performed on the preprocessed fabric pilling dataset to obtain the global feature saliency map h(t) of the fabric pilling image.

[0073] S2. Build an optimized ResNet 34 model;

[0074] The optimized ResNet 34 model includes a first convolutional layer, a residual network module, and an attention module CBAM.

[0075] The first convolutional layer is a combination of three 3×3 convolutional kernels, and the input to the first convolutional layer is a saliency map of fabric pilling.

[0076] The receptive field of a convolutional layer is calculated as follows:

[0077]

[0078] Among them, RF l-1 f1 is the size of the receptive field corresponding to layer l-1, and f1 is the size of the convolution kernel in layer 1. RF0 is the cumulative product of the step sizes from layer 1 to layer l-1, and RF0 is the receptive field size corresponding to the input layer.

[0079] The residual network module is as follows:

[0080] The first part of the residual network module includes 3×3 convolutions, batch normalization (BN), and ReLU6 activation function;

[0081] The second part of the residual network module includes an average pooling layer and a 1×1 convolutional layer;

[0082] The balling characteristics are obtained by summing the first part of the output of the residual network module and the second part of the output of the residual network module.

[0083] The attention module CBAM is as follows:

[0084] The attention module CBAM includes a channel attention module and a spatial attention module;

[0085] Channel attention module: Max pooling and average pooling are performed on the input image, then the pooled spherical feature map is passed through a shared fully connected layer, and finally a non-linear transformation is performed using an activation function to obtain the channel attention weights;

[0086] Spatial attention module: Max pooling and average pooling are applied to the input images, then they are connected and convolved through standard convolutional layers, and finally nonlinear transformation is performed using activation functions to obtain the final weights and generate spatial attention weights.

[0087] The final optimized output is the fabric pilling feature map F. z as follows:

[0088]

[0089] Where F is the input fabric pilling feature map; M c (F) represents the output weights of the input fabric pilling feature map after channel attention; M s (F) represents the output weight of F after spatial attention; This is an addition operation based on element-wise multiplication.

[0090] S3. Input the fabric pilling saliency map into the optimized ResNet 34 model, output the fabric pilling level, and realize the evaluation of fabric pilling defect level.

[0091] This invention proposes a method for evaluating the pilling defect level of fabrics based on deep convolutional networks, such as... Figure 2 As shown, the specific steps include:

[0092] Step 1: Construct a fabric pilling dataset.

[0093] The constructed fabric pilling dataset consists of five levels and two parts: one part is 300 standard photos of woven fabrics used as the original dataset for research, and the other part is 100 pilling fabric samples obtained on the YG502B fabric pilling instrument, and then fabric pilling images were acquired by the fabric pilling image acquisition platform.

[0094] Previous research methods for assessing fabric pilling levels have rarely focused on the composition and proportions of the dataset. This invention constructs a dataset by combining standard sample photos with data generated by a pilling and fuzzing instrument, which greatly enriches the diversity of fabric pilling datasets. Furthermore, keeping other parameters constant and only changing the ratio of the two components in the fabric pilling dataset, multiple experimental tests show that, compared to other ratios, the algorithm model exhibits better generalization and robustness when the ratio is 3:1.

[0095] Step 2: Preprocessing of the fabric pilling dataset: Enhance the fabric pilling dataset constructed in Step 1, and divide the enhanced dataset into training set, validation set and test set;

[0096] Data augmentation was performed on the fabric pilling dataset obtained in step 1, mainly using data augmentation methods such as multi-angle rotation, random cropping, and adding noise. After transformation, the data was expanded into 1650 significant images of fabric pilling, divided into 5 levels, with 330 images in each level, and the image size was 224×224 pixels.

[0097] The expanded 1650 fabric pilling images were divided into a training set of 1056 images, a validation set of 263 images, and a prediction set of 330 images. Each level had 264 pilling images used for training and validation, and 66 images used for testing.

[0098] Step 3: Obtain a significant image of fabric pilling and assess the quality of the image:

[0099] First, Gaussian pyramid decomposition of the fabric pilling image is performed. Then, according to formula (1), center-periphery difference operation is performed to obtain the local feature saliency map of the fabric pilling image, eliminating noise such as fabric texture and uneven lighting. Then, according to formula (2), spectral residual analysis is performed. By performing Fourier transform on the grayscale image of the original image, inverse Fourier transform is performed on the spectral residual and phase spectrum and reconstructed to obtain the global feature saliency map of the fabric pilling image, suppressing background redundancy information while preventing the loss of small pills. Finally, according to formula (3), the local feature saliency map and the global feature saliency map are linearly fused to obtain the fabric pilling saliency map.

[0100] s(δ)=|g(s)Θg(c)| (1)

[0101] In formula (1), δ is the difference between the peripheral layer and the central layer; Θ is the central-periphery operation; c is the central scale; and s = c + 1 is the peripheral scale.

[0102]

[0103] In formula (2), This represents the inverse Fourier transform operation, where R(f) is the residual spectrum corresponding to the input image, and P(f) is the phase spectrum corresponding to the input image.

[0104] k(t)=a×s(δ)+(1-a)×h(t) (3)

[0105] In formula (3), k(t) is the saliency map of the fused sphere feature; s(δ) is the local feature saliency map; h(t) is the global feature saliency map; a is the fusion degree of the two images, a∈{0,1}; t is the pixel coordinate.

[0106] After obtaining the saliency image of fabric pilling, the average structural similarity evaluation algorithm is used to compare the information content of the original fabric pilling image and the obtained saliency image of fabric pilling in order to evaluate the quality of the pilling image after saliency processing. The calculation is shown in formula (4).

[0107]

[0108] In formula (4), M is the total number of sub-images of the image; j is the j-th image in x and y; S mThe value range is [0,1]. The larger the value, the higher the quality of the obtained significant pilling image of the fabric; x is the original pilling image of the fabric; y = k(t) is the obtained significant pilling image of the fabric; α>0, β>0, γ>0; This is the brightness contrast function; This is the contrast function; For structural comparison functions; u x The average value of x; u y σ is the average value of y; x Let σ be the covariance of x; y Let σ be the covariance of y; xy Let x and y be the standard deviations; c1, c2, and c3 are all constants.

[0109] After the experiment, the average structural similarity values ​​of the saliency diagrams of the fabric pilling grades 1 to 5 were obtained, as shown in Table 1.

[0110] Table 1. Average structural similarity values ​​of fabric pilling grades 1-5 (saliency diagram).

[0111]

[0112] Step 4: As Figure 3 As shown, a deep convolutional network model for assessing the pilling defect level of fabrics is constructed:

[0113] In order to more objectively and accurately assess the pilling level of fabrics, a new model is built based on ResNet 34, which mainly includes the design of convolutional layers and residual modules in the residual network and the addition of attention modules.

[0114] The constructed deep convolutional network model for assessing the pilling defect level of fabrics is mainly divided into five parts from top to bottom: Stage 1 (Conv1), Stage 2 (Conv2), Stage 3 (Conv3), Stage 4 (Conv4), and Stage 5 (Conv5). The pilling feature extraction process is as follows: the input pilling image size is 224×224×3. After Conv1, the feature size becomes 112×112×64; after one Max Pool, the feature size becomes 56×56×64; after Conv2, the feature size becomes 56×56×64; after Conv3, the feature size becomes 28×28×128; after Conv4, the feature size becomes 14×14×256; after Conv5, the feature size becomes 7×7×512; and after the final Avg Pool, the feature size becomes 1×1×512.

[0115] Step 4.1: Design of convolutional layers;

[0116] In fabric pilling image recognition, pilling features are complex and diverse, and the pilling targets in the images are small, with indistinct differences in pilling grade features. Therefore, large convolutional kernels are not suitable for fabric pilling defect grade assessment models. Figure 4 As shown, the first convolutional layer of the deep convolutional network fabric pilling defect level assessment model is designed as a combination of three 3×3 convolutional kernels, which makes the features extracted from the pilling image more subtle and realizes the feature extraction of small target pilling.

[0117] The receptive field of the convolutional network is calculated according to formula (5).

[0118]

[0119] In formula (5), RF l-1 f1 is the size of the receptive field corresponding to layer l-1, and f1 is the size of the convolution kernel in layer 1. This is the cumulative product of the step sizes from layer 1 to layer l-1. RF0 is the receptive field size corresponding to the input layer, and its value is 1.

[0120] When using a 3×3 convolution kernel for three consecutive convolutions, the calculation process for the receptive field of each layer is as follows, according to formula (5):

[0121]

[0122] Calculations show that the first convolutional layer in the deep convolutional network fabric pilling defect level assessment model of this invention uses three small convolutional layers, with a receptive field of 7. Since the pilling target in the pilling image is relatively small, using a matching small receptive field reduces network parameters, increases network depth, and makes the model converge more easily. Simultaneously, it allows for more subtle feature extraction from the pilling image, thus achieving a more accurate pilling image assessment.

[0123] Step 4.2: Design of the residual network module;

[0124] The designed residual block has two loops. One loop consists of a convolutional layer and an activation function, which is mainly used to extract feature information from the balling image. The other loop adds average pooling to the input and output. These operations are carried out on 1×1 convolutions, so the computational load can be reduced for some large data, making it easier to converge. This is used to solve the overfitting phenomenon caused by too many parameters.

[0125] like Figure 5As shown, the processing of the residual block is divided into two parts: (a) The output features of the fabric pilling image sample after passing through the first convolutional layer and the max pooling layer are used as input. First, a 3×3 convolution is performed. If the residual block is the first in each stage, then this convolution is used to perform downsampling, halving the feature map size; otherwise, no downsampling is performed. Then, batch normalization (BN) is applied to ensure that the input values ​​of each layer in the designed deep convolutional network are distributed in the same way, thus speeding up the model convergence. Next, a ReLU6 activation function is connected to adjust the weights of each channel. Then, another 3×3 convolution and batch normalization (BN) are performed. (b) Average pooling and a 1×1 convolution are added to the input and output of the residual block. Finally, the two parts (a) and (b) are summed to output the pilling features.

[0126] Step 4.2.1: Replace the ReLU activation function with the ReLU6 activation function;

[0127] The expressions for the ReLU function and the ReLU6 function are shown in formula (7) and formula (8), respectively.

[0128]

[0129] ReLU6(x)=min(6,max(0,x)) (8)

[0130] like Figure 6 The image shows the activation curves for the ReLU and ReLU6 activation functions. (Combined...) Figure 6 As can be seen from formulas (7) and (8), the values ​​and gradients of the ReLU and ReLU6 activation functions are both 0 in the parts less than 0. In the parts greater than 0, the upper limit of ReLU activation is infinite, and its output value will be infinite, which will directly cause its accuracy loss; for the ReLU6 activation function, in the part greater than 0, when x>6,

[0131] The maximum output value is 6, and its activation value and weight range are limited. This makes good use of the entire interval, and its weights are evenly mapped to the [0, 255] interval, thus avoiding the ReLU function from causing the weight range to differ too much and destroying the feature information of balling.

[0132] Step 4.2.2: Add average pooling to the shortcut of the residual network module;

[0133] An average pooling layer is added to the shortcut branch of the residual network module, using a 2×2 window size. In fabric pilling image recognition, the pilling target is small, and a 2×2 window size is more suitable for feature extraction of small pilling targets. Therefore, a small receptive field can be used to obtain pilling feature information, making the pilling features more complete. This does not increase the computational load, as these operations are carried out on 1×1 convolutions, thus reducing the number of network parameters and avoiding overfitting due to too many parameters.

[0134] Step 4.3: Design of the Attention Module (CBAM).

[0135] Add the designed CBAM module to the output convolutional layer of each residual network. Figure 7 The overall structure of the designed CBAM module is shown below. The CBAM module comprises two sub-modules: a channel attention module and a spatial attention module. Due to the multi-scale characteristics of fabric pilling, the channel attention mechanism and the spatial attention mechanism are used in parallel to extract fabric pilling features. This allows both attention modules to directly learn the features of the input pilling image. Then, borrowing the concept of residuals, the pilling features input from the upper layer are summed with the current pilling channel and spatial features using element-wise multiplication to obtain the final fabric pilling feature map. This design improves the quality of the extracted fabric pilling features, reduces feature loss, and avoids instability caused by the sequential connection order.

[0136] like Figure 8 As shown, the channel attention module first performs max pooling and average pooling on the input image, then passes the pooled spherical feature map through a shared fully connected layer, and finally uses an activation function to perform a nonlinear transformation to obtain the final channel attention weights.

[0137] like Figure 9 As shown, the spatial attention module first applies max pooling and average pooling to the input image, then connects and convolves them through a standard convolutional layer, and finally uses an activation function to perform a nonlinear transformation to obtain the final weights and generate the final spatial attention features.

[0138] By parallelizing the two attention modules, they can directly learn the features of the input balling image. Simultaneously, to focus on more critical and discriminative salient channel and spatial features, the concept of residuals is adopted, and the balling features F input from the upper layer are compared with the current balling channel features M using formula (9). c (F) and spatial features M s (F) Perform an element-wise multiplication-based summation operation to obtain the scaled new features, thus obtaining the final optimized output fabric pilling feature map F. z .

[0139]

[0140] In formula (9), F is the input fabric pilling feature map; M c (F) represents the output weights of the input fabric pilling feature map after channel attention; M s (F) represents the output weight of F after spatial attention; This is an addition operation based on element-wise multiplication.

[0141] Step 5: Set the training parameters of the deep convolutional network model as follows: the mini-batch size of (Stochastic Gradient Descent) is 8; the initial learning rate is 0.0001; the epoch is 200. Then, input the training set of the fabric pilling saliency map obtained in Step 3 into the deep convolutional network model for training to obtain the deep convolutional network fabric pilling defect level assessment model.

[0142] Step 6: Set the evaluation index of the deep convolutional network fabric pilling defect level evaluation model. Input the validation set and test set of the fabric pilling saliency map obtained in Step 3 into the deep convolutional network fabric pilling defect level evaluation model for evaluation, and obtain the level evaluation results of the fabric pilling image samples.

[0143] In view of the actual situation of fabric pilling grade assessment, the designed model assessment indexes include: confusion matrix, precision, recall, and specificity.

[0144] A confusion matrix lists the assessment results for all fabric pilling categories, including correct and incorrect assessments, and the incorrectly assigned categories, while also visualizing the assessment results for fabric pilling levels.

[0145] Precision, also known as accuracy, represents the proportion of samples that are actually positive out of all samples predicted as positive. The specific calculation is shown in formula (10):

[0146]

[0147] Recall, also known as the full detection rate, represents the proportion of all positive samples in the test set that are correctly identified as positive samples. The specific calculation is shown in formula (11):

[0148]

[0149] Specificity, or true negative rate, represents the proportion of samples correctly classified as negative out of all negative samples in the test set. The specific calculation is shown in formula (12):

[0150]

[0151] In fabric pilling image recognition, pilling features are complex and diverse, and the pilling targets in the images are small with indistinct differences in pilling grade features. Therefore, precision, recall, and specificity are used as evaluation metrics for deep convolutional network (DCNN) fabric pilling defect grade assessment models to obtain important information about different model performances: the chaos matrix visualizes the assessment results of fabric pilling grades, thus better evaluating the objectivity of the DCNN fabric pilling defect grade assessment model; precision represents the number of correctly predicted fabric pilling grades; recall represents the number of correctly identified fabric pilling grades; and specificity provides information on misjudgments that occur during fabric pilling grade assessment, which is beneficial for timely adjustment of the training parameters of the DCNN fabric pilling defect grade assessment model to train a better model. This is essential for assessing the pilling grades of fabrics with small targets and indistinct differences in grade features.

[0152] When evaluating a deep convolutional network (DCNN) model for assessing fabric pilling defects, confusion matrix, precision, recall, and specificity are considered holistically to train an optimal DCNN model. This model exhibits high accuracy, strong generalization ability, and good robustness, effectively assessing different levels of fabric pilling. Conversely, using only partial assessment metrics results in incomplete information about different model performances, making it impossible to train an optimal DCNN model for assessing fabric pilling defects.

[0153] Table 2 Results of the rating model and two classic convolutional network models

[0154]

[0155] Table 2 shows the results of a comparative experiment between the deep convolutional network fabric pilling defect level assessment model of this invention and two classic convolutional network models: ResNet 34 network model and VGG 19 network model. As can be seen from Table 1, the deep convolutional network fabric pilling defect level assessment model improves the average accuracy by about 5% compared to the VGG 19 network model, and by about 4% compared to the network model before the improvement. The prediction accuracy of the deep convolutional network fabric pilling defect level assessment model is improved by 5.0% for level 1, 4.0% for level 2, 4.2% for level 3, 4.5% for level 4, and 1.3% for level 5 compared to the model before the improvement.

[0156] Figure 10The confusion matrix is ​​the test result of the deep convolutional network fabric pilling defect level assessment model. In the confusion matrix, the horizontal axis is the number of true labels for fabric pilling level 1-5, and the vertical axis is the number of categories predicted by the model for fabric pilling level 1-5. The confusion matrix shows that the present invention has high reliability for fabric pilling level assessment.

[0157] Table 3 shows the pilling rating results for fabrics at levels 1-5 using the grading model.

[0158]

[0159] As shown in Table 3, the pilling defect level assessment results of the deep convolutional network model for fabric pilling defects are 1-5. As can be seen from Table 2, the average detection rate of the algorithm of the present invention for fabric pilling defects is 93.88%, which shows that the fabric pilling defect level assessment method of the present invention can effectively achieve objective level assessment.

[0160] An embodiment of the present invention provides a terminal device comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the various method embodiments described above. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in the various device embodiments described above.

[0161] The computer program can be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention.

[0162] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0163] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0164] The memory can be used to store the computer program and / or module. The processor implements various functions of the terminal device by running or executing the computer program and / or module stored in the memory and calling the data stored in the memory.

[0165] If the modules / units integrated into the terminal device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0166] This invention proposes a fabric pilling defect level assessment system based on deep convolutional networks, such as... Figure 11 As shown, it includes:

[0167] A saliency map acquisition module is used to acquire a fabric pilling saliency map based on the preprocessed fabric pilling dataset.

[0168] A model building module, which is used to build an optimized ResNet 34 model;

[0169] The grade acquisition module is used to input the fabric pilling saliency map into the optimized ResNet34 model and output the fabric pilling grade to realize the evaluation of fabric pilling defect grade.

[0170] This invention proposes a method for assessing the pilling defect level of fabrics based on deep convolutional networks. This method automatically extracts pilling features and objectively and automatically assesses the pilling level, avoiding the inefficiency of manual subjective assessment. The first convolutional layer of the deep convolutional network is designed as a combination of three 3×3 convolutional kernels instead of a 7×7 kernel, effectively extracting features of small-target pilling. The ReLU6 activation function is replaced with the ReLU activation function in the residual network, thus avoiding the large difference in weight range caused by ReLU activation, which could destroy the pilling feature information. Average pooling is added to the shortcut loop of the residual network, utilizing a small receptive field to obtain pilling feature information, resulting in more complete pilling features and reduced network parameters, avoiding overfitting due to excessive parameters. An attention mechanism model is added, using a parallel approach of channel attention and spatial attention mechanisms, to further extract fabric pilling features. This method enables objective assessment of fabric pilling levels, providing a new quality assessment method for objective fabric pilling level evaluation. It can meet the need for objective evaluation of fabric pilling level and solve the problem that the existing technology cannot meet the accuracy of fabric pilling defect level evaluation due to weak fabric pilling targets and complex fabric background texture.

[0171] The present invention proposes a method for evaluating the pilling defect level of fabrics based on deep convolutional networks, which has the following advantages:

[0172] 1) A dataset was constructed by combining standard sample photos and pilling / fuzzing instruments. The constructed fabric pilling dataset has 5 levels and consists of two parts: one part is the original dataset of standard woven fabric samples used in the study, and the other part is the fabric pilling samples obtained on the YG502B fabric pilling / fuzzing instrument, followed by fabric pilling images acquired by a fabric pilling image acquisition platform. The ratio of the two is 3:1, that is, the first part contains 300 fabric pilling images and the second part contains 100 fabric pilling images, ensuring the diversity of fabric pilling samples. Then, Gaussian pyramid decomposition and spectral residual analysis are used to construct fabric pilling saliency maps to enhance important information (fuzz) in the fabric pilling images and suppress non-important information (fabric texture, uneven lighting, noise, etc.), providing conditions for a fabric pilling defect level assessment model based on deep convolutional networks.

[0173] 2) In the image recognition of fabric pilling, the pilling features are complex and diverse, and the pilling targets in the pilling images are small, and the differences in pilling level features are not obvious. Therefore, large convolutional kernels are not suitable for the fabric pilling defect level assessment model. Therefore, the first convolutional layer in the deep convolutional network model is designed as a combination of three 3×3 convolutional kernels, which makes the features extracted from the pilling images more subtle and realizes the feature extraction of small target pilling.

[0174] 3) Building upon this, in the residual network's loop consisting of convolutional layers and activation functions, the ReLU6 activation function replaces the ReLU activation function. This avoids the ReLU activation function causing excessively large differences in weight ranges, which could damage the balling feature information. In the residual network's shortcut loop, before performing the downsampling 1×1 convolution, a 2×2 average pooling window is added. This utilizes a small receptive field to acquire balling feature information, making the balling features more comprehensive. Simultaneously, these computational burdens are placed on the 1×1 convolution, reducing the number of network parameters and preventing overfitting due to excessive parameters.

[0175] 4) A new CBAM module is added to the output convolutional layer of each residual network. Channel attention and spatial attention mechanisms are used in parallel to extract fabric pilling features. This allows both attention modules to directly learn the features of the input pilling image, preventing instability caused by the sequential connection order. This better focuses on important information (pigment) and suppresses unimportant information (background), making the entire network more suitable for the current fabric sample set, thus enabling effective grading of different levels of fabric pilling. Simultaneously, to focus on more critical and discriminative salient channel and spatial features, the pilling feature F input from the previous layer is compared with the current pilling channel feature M. c (F) and spatial features M s (F) Perform an element-wise multiplication-based summation operation to obtain a scaled new feature, thus obtaining the final fabric pilling feature map F. z .

[0176] 5) The designed deep convolutional network was used to assess the level of pilling defects, and the average accuracy of the assessment of five levels of pilling reached 93.88%.

[0177] The above are merely preferred embodiments of the present invention and are not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for rating pilling defects of a fabric based on a deep convolutional network, characterized by, The method comprises the following steps: According to the pre-processed fabric pilling data set, a fabric pilling saliency map is obtained; An optimized ResNet 34 model is established; The fabric pilling saliency map is input into the optimized ResNet 34 model, and the fabric pilling grade is output, so as to realize the fabric pilling grade evaluation; The optimized ResNet 34 model comprises a first convolutional layer, a residual network module and an attention module CBAM; The first convolutional layer is three The combination of convolution kernels, the input of the first convolutional layer is the fabric pilling significant map; The residual network module is as follows: The first part of the residual network module includes... The convolutional, batch normalization (BN), and ReLU6 activation functions are used; the second part of the residual network module includes average pooling layers and... The convolutional layer; the first part of the output of the residual network module and the second part of the output of the residual network module are accumulated to obtain the balling feature; The attention module CBAM is as follows: the attention module CBAM comprises a channel attention module and a spatial attention module; the channel attention module: the input image is subjected to maximum pooling and average pooling, the pilling feature map after the pooling is subjected to a shared fully connected layer, a nonlinear transformation is performed on the pilling feature map after the pooling by using an activation function, and a channel attention weight is obtained; The spatial attention module: the input image is subjected to maximum pooling and average pooling, the pilling feature map after the pooling is connected and convoluted by using a standard convolutional layer, a nonlinear transformation is performed on the pilling feature map after the pooling by using an activation function, a final weight is obtained, and a spatial attention weight is generated.

2. The deep convolutional network-based fabric pilling defect grading method according to claim 1, wherein, Obtaining a fabric pilling profile As follows: (1) wherein, is a local feature saliency map; is a global feature saliency map; is a fusion degree of the two images, ; is a pixel coordinate.

3. The deep convolutional network-based fabric pilling defect grading method according to claim 2, wherein, The pre-processed fabric pilling dataset is decomposed by a Gaussian pyramid to obtain a local feature saliency map of the fabric pilling image ; Spectral residual analysis is performed on the pretreated fabric pilling dataset to obtain a global feature saliency map of the fabric pilling image .

4. The deep convolutional network-based fabric pilling defect grading method according to claim 1, wherein, Final optimized output fabric pilling signature As follows: (2) wherein, is an input fabric pilling feature map; is represents output weights of the input fabric pilling feature map with channel attention; is output weights with spatial attention; is an element-wise multiplication followed by an addition operation.

5. The deep convolutional network-based fabric pilling defect grading method according to claim 1, wherein, The receptive field calculation method of the convolutional layer is as follows: (3) wherein, is the receptive field size of the layer, is the convolution kernel size of the 1st layer, is the multiplication of the stride of the 1st layer to the multiplication of the stride of the layer, is the receptive field size of the input layer.

6. A deep convolutional network based fabric pilling defect grading system, characterized in that, The method comprises the following steps: A saliency map acquisition module is configured to obtain a fabric pilling saliency map according to a pre-processed fabric pilling data set; A model construction module is configured to establish an optimized ResNet 34 model; A grade acquisition module is configured to input the fabric pilling saliency map into the optimized ResNet 34 model, output a fabric pilling grade, and realize fabric pilling grade evaluation. 7.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-6 when the computer program is executed by the processor. The processor executes the computer program to realize the steps of the fabric pilling defect grade evaluation method based on the deep convolutional network according to any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, the computer-readable storage medium comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 7. The computer program is executed by the processor to realize the steps of the fabric pilling defect grade evaluation method based on the deep convolutional network according to any one of claims 1 to 5.