A fast classification method for fabric images

By combining dynamic image adjustment and enhancement technology with deep learning networks, the efficiency and accuracy problems of ethnic minority clothing image classification in existing technologies are solved, and efficient recognition is achieved in resource-constrained environments.

CN118262174BActive Publication Date: 2025-09-19HANGZHOU DIANZI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410461062.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-17
Publication Date
2025-09-19
Estimated Expiration
2044-04-17

Smart Images

  • Figure CN118262174B_ABST
    Figure CN118262174B_ABST
Patent Text Reader

Abstract

This invention discloses a rapid classification method for fabric images. The method first collects and labels images of ethnic minority clothing to generate a dataset of ethnic minority clothing. The collected dataset is then preprocessed. The preprocessed images are then input into a constructed rapid fabric image classification model to extract features and output classification results. Finally, the rapid fabric image classification model is trained, tested, and evaluated using the dataset. This method significantly improves the accuracy and efficiency of ethnic minority clothing image classification, ensuring that the characteristics of cultural heritage images are fully protected and correctly identified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition, and in particular to a fast classification method for fabric images. Background Art

[0002] Ethnic minority clothing, as a rich and historical textile image, is unique for its intricate patterns and rich color combinations, reflecting the rich cultural traditions and exquisite craftsmanship of ethnic minorities. These garments are not only an integral part of ethnic minority culture but also a vital resource for studying their history, culture, and craftsmanship. Ethnic minorities comprise numerous subgroups, each with its own unique clothing styles. Clothing patterns are a crucial vehicle for the inheritance of ethnic minority culture, reflecting their diverse migration routes, history, culture, and folk customs. Preserving ethnic minority embroidery techniques presents both opportunities and challenges, requiring scholars to explore the culture of ethnic minority embroidery from diverse perspectives. Given the unique characteristics of ethnic minorities, their images contain a wealth of information, such as pattern type, color combinations, and fabric texture. This makes ethnic minority clothing fabric images a complex and information-intensive data type. However, the rapid and accurate classification of these images is not only crucial for preserving and inheriting ethnic minority clothing culture but also has practical applications in promoting research and development of ethnic minority clothing.

[0003] In the current technological landscape, image recognition systems have achieved remarkable success in many fields. However, these systems often face challenges in both efficiency and accuracy when processing images of ethnic minority clothing due to the complex and diverse image features. Specifically, the diverse patterns, complex textures, and rich colors of ethnic minority clothing pose significant technical challenges for image preprocessing and feature extraction. Traditional image recognition processes typically involve cumbersome processing steps and significant computational resource consumption. These limitations become a significant issue, especially in scenarios requiring real-time processing of large-scale image data. While advances in deep learning have greatly promoted the application of deep neural networks in image recognition, the deployment of these large networks in environments with limited computing and storage resources, such as mobile and embedded devices, remains challenging. Even though lightweight models have been proposed to alleviate resource constraints, simplifying the models without sacrificing recognition accuracy and processing speed remains a key issue that needs to be addressed in existing technologies. Summary of the Invention

[0004] The present invention addresses the deficiencies of the prior art and provides a fast classification method for fabric images, thereby improving the processing capability of the classification task of ethnic minority clothing images, especially in a resource-constrained computing environment.

[0005] A fast classification method for fabric images, the specific steps are as follows:

[0006] Step 1: Dataset collection and annotation: Collect pictures of ethnic minority costumes and label them to obtain a dataset of ethnic minority costumes.

[0007] Step 2: Preprocess the collected ethnic minority clothing dataset.

[0008] Preprocessing involves resizing all images in the dataset to a consistent size, then dividing the images into training and test sets. To enhance the key visual features of images of ethnic minority clothing and improve the accuracy of subsequent classification models, dynamic image adjustment and enhancement are performed to improve the accuracy and efficiency of ethnic minority clothing image classification. This technology specifically considers the content complexity and cultural characteristics of the images, adaptively adjusting image quality and enhancing image features to optimize the training results of subsequent classification models. The specific implementation process of dynamic image adjustment and enhancement is as follows:

[0009] 1. Apply content-aware analysis to each image to determine the key content areas in the image. This step is done by calculating the gradient map G of the image. m The gradient map reflects the edge and detail intensity of the content in the image: the formula is as follows:

[0010]

[0011] Where I represents the image, and They are the pixel gradients of image I in the x and y directions respectively. The pixel gradients can be calculated using the Sobel edge detection operator. According to the gradient mapping G m , identify key content regions in the image. These regions correspond to locations with high gradient values, indicating that the image has important details and features at these locations.

[0012] 2. Dynamically apply enhancement techniques to identified key content areas, including local contrast enhancement and brightness adjustment, to emphasize the details of clothing patterns and textures. The enhancement process can be expressed as:

[0013] I enhance (x,y)=α(G m (x,y))·I(x,y)+β(G m (x,y))·I(x,y)

[0014] Where α(G m ) and β(G m ) are functions based on the gradient map values, which define how to adjust the contrast and brightness based on the importance of the content. m) is a value in the range [1-δ, 1+δ], where δ is a preset contrast adjustment amplitude. β(G m ) is a value in the range [1-γ, 1+γ], where γ is a preset brightness adjustment amplitude. α(G m ) and β(G m ) is defined as follows:

[0015]

[0016]

[0017] where k a is the gain coefficient related to contrast, k b is the gain factor related to brightness. is the mean value of Gm, used for normalization. The calculation method is as follows:

[0018]

[0019] in It is a double summation operation for the entire image pixels, which means iterating over all the pixels in the x rows and y columns. m (x,y) is the gradient map value at coordinate (x,y). M×N is the total number of pixels in the image. This average provides a reference point for determining whether the gradient strength at a single pixel is higher or lower than the average gradient strength for the entire image, allowing the contrast and brightness of that pixel to be adjusted accordingly.

[0020] Step 3: Input the preprocessed image into the constructed fabric image fast classification model to extract features and output the classification results. The model consists of a feature extraction module, a feature encoding module, a feature fusion module, and a classification decision module connected in series.

[0021] The feature extraction module is responsible for extracting preliminary feature information from the input image. This reduces the spatial dimensionality of the feature map, thereby reducing the computational complexity of subsequent processing. It consists of a convolutional layer and a max pooling layer. The convolutional layer is followed by batch normalization (BN) and a ReLU activation function, followed by a max pooling layer using a 2x2 pooling kernel, which outputs feature A.

[0022] Feature A is input to the feature encoding module, which further extracts more complex image features. This module consists of two residual blocks and two maximum pooling layers. The residual block consists of two convolutional layers, each using 64 3x3 convolution kernels, followed by batch normalization and ReLU. Furthermore, the residual block incorporates the Multi-Level Feature Fusion SE Attention Mechanism (MLF-SE) to improve its ability to capture important features. A maximum pooling layer is then used to further reduce the spatial dimensionality of the feature map, outputting feature B.

[0023] Among them, the MLF-SE mechanism introduces a new fusion strategy based on SE attention, which not only focuses on the global information of the channel, but also combines the attention of local spatial features. This is achieved by fusing global average pooling GAP and local spatial attention. The specific implementation process of the MLF-SE attention mechanism is as follows: the dimension of the input feature map X is H×W×C, where H, W and C represent the height, width and number of channels of the feature map, respectively. Apply the global average pooling operation to X to obtain a one-dimensional feature vector Fgap with global information. The dimension of Fgap is 1×1×C. In parallel with GAP, a convolution operation is applied to the input X to retain the spatial information and obtain Fconv. Fconv maintains the same dimension H×W×C as the input X. Spatial attention is calculated on Fconv, and the weight S of each spatial position is obtained after the convolution operation and the Sigmoid function. lw , S lw The dimension is H×W. The spatial weight S lw Applied to Fconv, the weighted local feature Flocal is obtained through the dot product operation. The dimension of Flocal is the same as Fconv, which is H×W×C. Fgap is expanded to the dimension of H×W×C by copying so that it can be fused with Flocal. The expanded Fgap and Flocal are spliced ​​in the channel dimension, and the fused dimension is H×W×2C. Use 1×1 convolution to compress the number of channels of the fused feature map from 2C back to C to obtain Fse. Finally, Fse is multiplied element-by-element with the original input X to obtain the attention-weighted output

[0024] Feature B is input into the feature fusion module, where deeper residual blocks and parallel structures are used to further extract richer and more advanced image features. This module includes a deep residual block and a maximum pooling layer. The deep residual block combines a three-branch design with an MLF-SE attention mechanism after each branch to enhance the ability to capture image details. Specifically, the three parallel branches in the feature fusion module are: branch 1 contains three 1x1 convolutional layers; branch 2 contains a 3x3 convolutional layer followed by a 1x1 convolutional layer; and branch 3 contains a 5x5 convolutional layer followed by a 1x1 convolutional layer. The outputs of the three branches are each passed through the SE attention module before being spliced ​​together to output feature C.

[0025] Feature C is input into the classification decision module. Feature mapping is used to map the high-dimensional feature vector into a more compact feature space to facilitate classification decisions. The Softmax layer is then used to implement multi-class classification and output the predicted probability for each class to obtain the classification result. This module contains a fully connected layer and a Softmax layer.

[0026] Step 4: Train and test the fabric image fast classification model using the dataset. The deep learning model training process begins by randomly partitioning the entire dataset into two parts: one part serves as the training set for model learning and parameter optimization; the other part serves as the test set for evaluating and validating the model's performance after training. To ensure the reliability and reproducibility of experimental results, all model parameters involved in training are set according to specific standards, including but not limited to key hyperparameters such as the learning rate and optimizer selection. During training, particular attention is paid to ensuring sufficient model learning cycles and an appropriate batch size, ensuring effective updates to model weights at each iteration and promoting the stability and efficiency of the learning process. This systematic training schedule aims to maximize the model's classification accuracy on the test set, enabling rapid and accurate recognition of diverse fabric image features.

[0027] After training, the model was thoroughly tested using performance evaluation metrics. These metrics focused on accuracy, or the proportion of images correctly classified by the model. This metric directly reflects the model's reliability and efficiency in real-world applications. A comprehensive ablation experiment and comparative analysis with a classical network were then used to verify the effectiveness of the fabric image classification model in accurately identifying and classifying images of ethnic minority clothing.

[0028] Compared with existing technologies, this paper significantly improves the accuracy and efficiency of image classification of ethnic minority clothing by introducing a "dynamic image adjustment and enhancement" technique as a preprocessing step and designing a novel deep learning network. The preprocessing method adaptively adjusts the image's content complexity and cultural characteristics, which not only optimizes image quality but also enhances key visual features, providing information-rich input data for the classification model. In particular, the gradient-driven dynamic adjustment allows the model to focus more on the details of cultural clothing patterns and textures, which are often critical factors in classification decisions. The designed deep learning network utilizes a serial modular structure to extract image features from basic to advanced levels, with each module having its own unique function. In particular, the integrated MLF-SE attention mechanism further enhances the model's sensitivity to image details. The MLF-SE mechanism introduces a novel fusion strategy based on SE attention, which not only focuses on global information across channels but also incorporates attention to local spatial features. This is achieved by fusing global average pooling (GAP) with local spatial attention. The existing SE attention mechanism uses global average pooling to extract channel features, followed by two fully connected layers to obtain per-channel weights. This mechanism ignores the spatial distribution and local patterns of features, which is insufficient when processing ethnic clothing images with complex textures and local features. In addition, compared with classic networks, the network structure proposed in this paper shows higher accuracy and better generalization ability when processing specific ethnic clothing image datasets. This systematic improvement not only enables the model to perform well in fast classification tasks, but also ensures that the characteristics of cultural heritage images are fully protected and correctly identified, which is of great significance for promoting the dissemination and protection of cultural diversity. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 A flowchart of the steps of a rapid classification method for fabric images according to the present invention;

[0030] Figure 2 This is a structural diagram of a neural network model for a rapid classification method for fabric images according to the present invention;

[0031] Figure 3 This is the structural diagram of the feature extraction module;

[0032] Figure 4 This is the structural diagram of the feature encoding module;

[0033] Figure 5 This is the structure diagram of the MLF-SE attention mechanism;

[0034] Figure 6 This is the structural diagram of the feature fusion module;

[0035] Figure 7 This is the structural diagram of the classification decision module;

[0036] Figure 8 The following is a graph showing the accuracy and loss function value of the model on the training set and test set. DETAILED DESCRIPTION

[0037] In order to more clearly illustrate the technical solution of the present invention, the specific implementation of the present invention will be described below with reference to the accompanying drawings.

[0038] See also Figure 1 , a fast classification method for fabric images proposed by the present invention, specifically comprising the following steps:

[0039] Step 1: Dataset Collection and Labeling. Images of ethnic minority clothing were primarily obtained through field research and literature research, supplemented by a limited amount of web crawling techniques. A total of 847 high-quality images of ethnic minority clothing were collected, all stored in PNG format. These images were then carefully annotated using annotation software, eliminating samples of poor quality. Ultimately, images of 10 ethnic minority clothing groups were annotated, including those of the Zhuang, Hui, Manchu, Tibetan, Uyghur, Miao, Yi, Kazakh, Dai, and Li ethnic groups. This annotation work provided an accurate and rich data foundation for subsequent deep learning model training and automatic classification of ethnic minority images.

[0040] Step 2: Data preprocessing. In the data preprocessing stage of the present invention, all collected ethnic minority images are first uniformly adjusted to a resolution of 224x224x3 to adapt to the input requirements of the deep learning model. Furthermore, in order to reasonably distribute training and test data and ensure the objectivity and effectiveness of the evaluation results, these images are divided into training sets and test sets in a ratio of 4:1. The training set is used for model training, and the test set is used to verify the performance of the model. In order to enhance the key visual features of ethnic minority clothing images in order to improve the accuracy of subsequent classification models, the present invention proposes a "dynamic image adjustment and enhancement" technology, which aims to improve the accuracy and efficiency of ethnic minority clothing image classification. This technology takes into special consideration the content complexity and cultural characteristics of the image, and optimizes the training effect of the subsequent classification model by adaptively adjusting the image quality and enhancing the image features. The specific implementation steps are as follows:

[0041] 1. First, content-aware analysis is applied to each original image to determine the key content areas in the image. This step is done by calculating the gradient map G of the image. m The gradient map reflects the edge and detail intensity of the content in the image: the formula is as follows:

[0042]

[0043] Among them, G m (x,y) is the gradient mapping value of the image at the coordinate (x,y), which is a non-negative real number that represents the edge strength of the image at that point. Image I represents the original image, and are the pixel gradients of image I in the x and y directions respectively, which can be calculated using the Sobel edge detection operator. m , identify key content regions in the image. These regions correspond to locations with high gradient values, indicating that the image has important details and features at these locations.

[0044] 2. Based on the results of content-aware analysis, the image is dynamically adjusted and enhanced. Enhancement techniques, such as local contrast enhancement and brightness adjustment, are dynamically applied to identified key content areas to emphasize details of clothing patterns and textures. The enhancement process can be expressed as:

[0045] I enhance (x,y)=α(G m (x,y))·I(x,y)+β(G m (x,y))·I(x,y)

[0046] Where α(G m ) and β(G m ) is a function based on the gradient map value, which defines how to adjust the contrast and brightness according to the importance of the content, α(G m ) is a value in the range [1-δ, 1+δ], δ is a preset contrast adjustment amplitude; β(G m ) is a value in the range [1-γ, 1+γ], γ is a preset brightness adjustment range, α(G m ) and β(G m ) is defined as follows:

[0047]

[0048]

[0049] Where ka is the gain factor related to contrast and is set to 0.1, and Kb is the gain factor related to brightness and is set to 20. It's G m The average value is used for standardization. The calculation method is as follows:

[0050]

[0051] in It is a double summation operation for the entire image pixels, which means iterating over all the pixels in the x rows and y columns. m (x,y) is the gradient map value at coordinate (x,y). M×N is the total number of pixels in the image. This average provides a reference point to determine whether the gradient strength at a single pixel is higher or lower than the average gradient strength for the entire image, so that the contrast and brightness of that pixel can be adjusted accordingly.

[0052] Step 3: Input the pre-processed image into the constructed fabric image fast classification model to extract features and output the classification results. The model consists of a feature extraction module, a feature encoding module, a feature fusion module and a classification decision module connected in series. Figure 2 .

[0053] The feature extraction module is responsible for extracting preliminary feature information from the input image and reducing the computational complexity of subsequent processing by reducing the spatial dimension of the feature map. It consists of a convolutional layer and a maximum pooling layer. The convolutional layer uses 32 3x3 convolution kernels with a stride of 1 and an edge padding of 1. This is followed by batch normalization (BN) and ReLU activation function, which outputs a 32-channel, 224x224 feature map. The function of this layer is to extract primary features of the image, such as edges and textures, while enhancing the nonlinear ability and training stability of the network through batch normalization and ReLU activation function. The following maximum pooling layer uses a 2x2 pooling kernel with a stride of 2 and no edge padding, and outputs a 32-channel, 112x112 feature map. The function of this layer is to reduce the spatial dimension of the feature map, reduce the computational complexity, and retain key feature information. Finally, feature A is output. See Figure 3 .

[0054] Feature A is input to the feature encoding module, which further extracts more complex image features. This module consists of two residual blocks and two maximum pooling layers. The residual block consists of two branches: the main branch and the shortcut branch. The main branch contains two convolutional layers, each with 64 3x3 convolution kernels, a stride of 1, and edge padding of 1. Each convolution layer is followed by batch normalization and Reinforced Luminance (ReLU). The shortcut branch contains 1x1 convolutions to match the dimensions, followed by batch normalization. After the outputs of the main and shortcut branches are added, the MLF-SE attention module is introduced to improve the ability to capture important features. The module is activated with ReLU and outputs a 64-channel, 112x112 feature map. The purpose of this residual block is to deepen the network structure without introducing additional training difficulty. By introducing the shortcut branch, the vanishing gradient problem is addressed, facilitating the training of deep networks. The subsequent maximum pooling layer contains 2x2 pooling kernels, a stride of 2, and no edge padding, and outputs a 64-channel, 56x56 feature map. This layer further reduces the spatial dimension of the feature map, prepares for extracting deeper features, and finally outputs feature B. Figure 4 .

[0055] Among them, the MLF-SE mechanism introduces a new fusion strategy based on SE attention, which not only focuses on the global information of the channel, but also combines the attention of local spatial features. This is achieved by fusing global average pooling (GAP) and local spatial attention. The specific implementation process of the MLF-SE attention mechanism is as follows: the dimension of the input feature map X is H×W×C, where H, W, and C represent the height, width, and number of channels of the feature map, respectively. Apply the global average pooling operation to X to obtain a 1D feature vector Fgap with global information. The dimension of Fgap is 1×1×C. In parallel with the GAP branch, a 3×3 convolution is applied to the original input X, retaining the spatial information to obtain Fconv. Fconv maintains the same dimension H×W×C as the input X. Spatial attention is calculated on Fconv, and the weight S of each spatial position is obtained after a 3×3 convolution and a Sigmoid function. lw . S lw The dimension is H×W. The spatial weight S lw Applied to Fconv, the weighted local feature Flocal is obtained through the dot product operation. The dimension of Flocal is the same as Fconv, which is H×W×C. Fgap is expanded to the dimension of H×W×C by copying so that it can be fused with Flocal. The expanded Fgap and Flocal are spliced ​​in the channel dimension, and the fused dimension is H×W×2C. Use 1×1 convolution to compress the number of channels of the fused feature map from 2C back to C to obtain Fse. Finally, Fse is multiplied element-by-element with the original input X to obtain the attention-weighted output See also Figure 5 .

[0056] Feature B is input to the feature fusion module, where deeper residual blocks and a parallel architecture further extract richer and more advanced image features. This module comprises deep residual blocks and max pooling layers. The deep residual blocks combine a three-branch design and introduce an MLF-SE attention mechanism after each branch to enhance the capture of image details. Branch 1 consists of three convolutional layers, each with 256 1x1 convolution kernels and a stride of 1. These layers are followed by batch normalization (BN) and reinforced linear unit (ReLU) layers, primarily for feature transformation and dimensionality adjustment without changing the size of the feature map. Branch 2 consists of two convolutional layers. The first layer uses 256 3x3 convolution kernels with a stride of 1 to maintain the feature map size, allowing for deeper feature extraction. The second layer uses 256 1x1 convolution kernels with a stride of 1, primarily for feature transformation and dimensionality adjustment. Each convolutional layer is followed by batch normalization (BN) and reinforced linear unit (ReLU). Branch 3 contains two convolutional layers. The first convolutional layer uses 256 5x5 convolution kernels with a stride of 1 to keep the feature map size unchanged and allow deeper feature extraction. The second convolutional layer uses 256 1x1 convolution kernels with a stride of 1 to retain more spatial information without reducing the size of the feature map. Each convolutional layer is followed by BN and ReLU. The outputs of the three branches are each passed through the MLF-SE attention module before splicing, and then spliced ​​to output a 768-channel, 28x28 feature map. This is followed by a maximum pooling layer to reduce the dimensionality of the fused feature map. It contains a 2x2 pooling kernel with a stride of 2 and no edge padding, outputting a 768-channel, 14x14 feature map, and finally outputting feature C. See Figure 6 .

[0057] Feature C is input to the classification decision module, which includes three fully connected layers and a Softmax classification. The three fully connected layers are 1024, 512, and 256 neurons respectively. Each fully connected layer is connected with BN and ReLU. It is mainly responsible for mapping the high-dimensional feature vector into a more compact feature space to facilitate classification decision. Then, the Softmax layer is used to implement multi-class classification and output the predicted probability of each class, for a total of ten classes. This module includes fully connected layers and Softmax layers. See Figure 7 .

[0058] Step 4: Training, testing, and evaluating the fabric image fast classification model. During deep learning model training, the entire dataset was randomly divided into two parts: 80% was used as the training set for model learning, and the remaining 20% ​​was set as the test set, which was used to evaluate the performance of the trained model. To ensure the accuracy and repeatability of the experiment, all model parameters used were standardized. In particular, the number of iterations (epochs) during training was set to 100 to ensure sufficient learning cycles for the model.

[0059] Furthermore, a learning rate scheduler was introduced, a strategy that dynamically adjusts the learning rate during training, helping the model optimize and converge more effectively. Specifically, the StepLR scheduler was used, which reduces the learning rate by 0.5 after every five epochs. This decay strategy gradually reduces the learning rate as training progresses, helping the model avoid oscillations near the optimal solution.

[0060] Furthermore, the batch size during training was set to 64, meaning that each training iteration randomly selected 64 samples from the training set for forward and backward propagation to update the model's weight parameters. This training setup aims to achieve the highest classification accuracy on the test set, enabling efficient and automatic recognition of features across categories in the dataset. After achieving the optimal weight parameters, the model became an effective deep learning detection model capable of accurately identifying and classifying images of ethnic minority clothing.

[0061] After training, the model will undergo a comprehensive performance test using performance evaluation indicators. The evaluation indicators focus on accuracy, that is, the proportion of images correctly classified by the model. This indicator directly reflects the reliability and efficiency of the model in practical applications. Then, through the comprehensive use of ablation experiments and comparative analysis with classic networks, the effectiveness of the fabric image classification model in accurately identifying and classifying images of ethnic minority clothing is verified. As shown in Table 1 below, three classic networks are used for comparison. When all parameters remain the same, our method has the highest accuracy. The accuracy and loss function value of the model on the training set or test set are shown in Table 1. Figure 8 .

[0062] Table 1

[0063]

Claims

1. A fast classification method for fabric images, characterized in that: The steps include: Step 1: Collect pictures of ethnic minority costumes, label the collected pictures, and obtain a dataset of ethnic minority costumes; Step 2: Preprocess the collected ethnic minority clothing dataset; The preprocessing is as follows: adjusting the size of all images in the dataset to a consistent size, then dividing the images into a training set and a test set, and performing dynamic image adjustment and enhancement; The specific process of dynamic image adjustment and enhancement is as follows: Apply content-aware analysis to each image to determine the key content areas in the image: Calculate the gradient map G of the image m , reflecting the edge and detail intensity of the content in the image, the formula is as follows: Where I represents the image, and They are the pixel gradients of image I in the x and y directions, and the pixel gradients are calculated using the Sobel edge detection operator; according to the gradient mapping G m ,determine the key content areas in the image; For the identified key content areas, enhancement techniques are dynamically applied, including local contrast enhancement and brightness adjustment, to emphasize the details of clothing patterns and textures. The enhancement process is expressed as follows: I enhance (x,y)=α(G m (x,y))·I(x,y)+β(G m (x,y))·I(x,y) Where α(G m ) and β(G m ) is a function based on the gradient map value, which defines how to adjust the contrast and brightness according to the importance of the content, α(G m ) is a value in the range [1-δ, 1+δ], δ is a preset contrast adjustment amplitude; β(G m ) is a value in the range [1-γ, 1+γ], γ is a preset brightness adjustment range, α(G m ) and β(G m ) is defined as follows: where k a is the gain coefficient related to contrast, k b is the gain coefficient related to brightness, It's G m The average value of is used for standardization, The calculation method is as follows: in It is a double summation operation for the entire image pixels, which means iterating over all the pixels in the x rows and y columns. m (x,y) is the gradient mapping value at coordinate (x,y); M×N is the total number of pixels in the image; Step 3: Input the preprocessed image into the fabric image fast classification model constructed by the feature extraction module, feature encoding module, feature fusion module and classification decision module in series, perform feature extraction and output the classification result; Step 4: Train and test the fabric image fast classification model using the dataset.

2. The rapid classification method for fabric images according to claim 1, characterized in that: The implementation process of the fabric image fast classification model is as follows: First, the feature extraction module extracts preliminary feature information from the input image and reduces the spatial dimension of the feature map. The feature extraction module consists of a convolutional layer and a maximum pooling layer. The convolutional layer is followed by batch normalization (BN) and ReLU activation function to output feature A. Next, feature A is fed into a feature encoding module, which consists of two residual blocks and two maximum pooling layers. The residual block consists of two convolutional layers, each followed by a batch normalization (BN) and a ReLU. The residual block introduces the multi-level feature fusion SE attention mechanism (MLF-SE), and then uses a maximum pooling layer to reduce the spatial dimension of the feature map, outputting feature B. Feature B is then input into the feature fusion module, where image features are extracted through residual blocks and parallel structures. This module includes a deep residual block and a maximum pooling layer. The deep residual block combines three parallel branches and introduces the attention mechanism MLF-SE after each branch. The branches are then concatenated to output feature C. Finally, feature C is input into the classification decision module, which uses feature mapping and then uses the Softmax layer to implement multi-class classification and output the predicted probability of each class to obtain the classification result. This module contains a fully connected layer and a Softmax layer.

3. The rapid classification method for fabric images according to claim 2, characterized in that: The specific implementation process of the attention mechanism MLF-SE is as follows: The dimension of the input feature map X is H×W×C, where H, W, and C represent the height, width, and number of channels of the feature map, respectively. A global average pooling operation is applied to X to obtain a one-dimensional feature vector Fgap with global information. The dimension of Fgap is 1×1×C. In parallel with the global average pooling, a convolution operation is applied to the input X to obtain the feature Fconv. Fconv maintains the same dimension H×W×C as the input X. Spatial attention is calculated on Fconv. After the convolution operation, the weight S of each spatial position is obtained by passing it through the Sigmoid function. lw , S lw The dimension is H×W; The spatial weight S lw Applied to Fconv, the weighted local feature Flocal is obtained through the dot product operation. The dimension of Flocal is the same as that of Fconv, which is H×W×C; Expand Fgap to the dimensions of H×W×C by copying, and concatenate it with Flocal in the channel dimension. The fused dimension is H×W×2C. Use 1×1 convolution to compress the number of channels of the fused feature map from 2C back to C to obtain Fse. Finally, perform element-wise multiplication of Fse with the input X to obtain the attention-weighted output 4. The rapid classification method for fabric images according to claim 3, characterized in that: The three parallel branches in the feature fusion module are specifically: Branch 1 contains three 1x1 convolutional layers; Branch 2 consists of a 3x3 convolutional layer followed by a 1x1 convolutional layer; Branch 3 consists of a 5x5 convolutional layer followed by a 1x1 convolutional layer.

Citation Information

Patent Citations

  • Intelligent automatic quick comprehensive trash selecting and sorting device

    CN102941213A

  • Feature selection and parameter synchronous optimization method for single-class classification SVM (Support Vector Machine)

    CN106295691A