Textile intelligent identification method, system and computer readable storage medium
Patent Information
- Application Number
- CN202610772516.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-29
- Publication Date
- 2026-08-18
AI Technical Summary
缺陷一:单模态特征提取导致纹理描述维度不足
[0018] Due to the application of the above technical solutions, the present invention has the following advantages compared with the prior art: the present invention can significantly improve the multi-scale texture representation capability, reduce the misclassification rate of similar materials, significantly enhance the illumination robustness, steadily improve the recognition performance of a few categories, and enhance the applicability of edge deployment.
Smart Images

Figure CN122597362A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and intelligent textile detection technology, specifically to an intelligent textile recognition method, system, and computer-readable storage medium based on a multimodal cross-layer fusion attention mechanism. Background Technology
[0002] Material identification and texture classification of textiles are core technical requirements in applications such as textile industry quality control, customs commodity identification, and e-commerce intelligent product selection. With the rapid development of deep learning technology, automatic textile identification methods based on convolutional neural networks (CNNs) are gradually replacing traditional manual inspection methods and have become a research hotspot. However, existing technical solutions still suffer from the following four significant technical shortcomings: Defect 1: Single-modal feature extraction leads to insufficient dimensionality in texture description. Existing mainstream methods (such as using GLCM or LBP features alone) can only describe fabric surface features at a single scale, and cannot simultaneously characterize the macroscopic weave structure and microscopic fiber details of the fabric. For fabrics with multi-layered texture structures (such as corduroy and chenille), the recognition accuracy of such methods is significantly low, making it difficult to meet the needs of precision industrial quality inspection.
[0003] Defect 2: High misclassification rate of similar materials. For material pairs such as cotton-polyester and satin-silk that highly overlap in the spectral frequency domain, existing classification methods based on single image features lack cross-domain feature constraint mechanisms, resulting in significant mutual misclassification in the confusion matrix. The misclassification rate is as high as 12% to 18%, which cannot meet the stringent requirements of industrial quality inspection for accurate material differentiation.
[0004] Defect 3: Light sensitivity leads to weak model generalization ability. Existing methods typically use RGB images directly as network input without decoupling from changes in lighting conditions. This results in significant differences in feature vectors extracted from the same fabric under different lighting environments. Experiments show that changes in lighting conditions can cause a decrease in classification accuracy of approximately 18%, severely limiting the stable deployment of the model in real-world industrial settings.
[0005] Defect 4: Severe degradation in minority class recognition performance under class imbalance conditions. In existing publicly available textile datasets, the sample size of each class varies greatly (e.g., the number of cotton samples can be more than 37 times that of silk). Existing training schemes do not have an effective compensation mechanism for class imbalance, which leads to unstable recall rates for small sample classes (such as leather and acrylic), and a systematic bias towards the majority class in the classification results.
[0006] In summary, existing technologies have significant shortcomings in four dimensions: multi-scale texture representation, similar material differentiation, illumination robustness, and class imbalance handling. There is an urgent need for a new intelligent textile recognition method that can systematically solve the above problems. Summary of the Invention
[0007] The purpose of this invention is to provide a smart textile identification method and a system for implementing the method, which can improve texture representation capabilities, reduce misclassification rates, enhance illumination robustness, and improve the recognition performance of a few categories.
[0008] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A method for intelligent identification of textiles includes the following steps: Step S1: Obtain the original RGB images of textile samples of each category, convert the original RGB images to the HSV color space, and perform normalization processing on the H, S, and V channels respectively to generate a surface reflectance feature map decoupled from ambient light. Step S2: Perform parallel extraction of three-channel heterogeneous features on the surface reflectance feature map to extract macroscopic texture features, microscopic texture features and deep semantic features respectively; Step S3: The macroscopic texture features, the microscopic texture features, and the deep semantic features are concatenated by channels, and the weights of each channel are calculated through a cross-modal attention channel mechanism to generate a fused feature representation; Step S4: Train the intelligent textile recognition model using the fusion feature representations corresponding to the textile samples; Step S5: Use the trained intelligent textile recognition model to identify the category of the textile to be identified, and output the textile category label and corresponding confidence score.
[0009] Furthermore, in step S1, mean-standard deviation normalization is performed on the H, S, and V channels respectively.
[0010] Furthermore, in step S2, the method for extracting the macroscopic texture features is as follows: converting the surface reflectance feature map into a grayscale image, and setting a step size of m. d and n directions θ Each selected step size d and a direction θ Then, a multi-scale gray-level co-occurrence matrix is calculated, thereby constructing mn multi-scale gray-level co-occurrence matrices; p-class statistical descriptors are extracted from each multi-scale gray-level co-occurrence matrix to form an mnp-dimensional GLCM descriptor vector; a two-dimensional fast Fourier transform is performed on the gray-level image, the power spectrum is calculated and averaged to obtain a one-dimensional radial power spectrum, and q-frequency points are sampled on the one-dimensional radial power spectrum to form a q-dimensional FFT feature vector; the GLCM descriptor vector and the FFT feature vector are standardized respectively and then concatenated to obtain a macroscopic texture feature vector.
[0011] Furthermore, in step S2, the method for extracting the micro-texture features is as follows: multiple sampling radii and corresponding sampling point numbers are set as multi-scale LBP operators; an LBP histogram is generated from the surface reflectance feature map using the sampling radii and corresponding sampling point numbers, thereby obtaining 2 e The micro-texture features are defined as follows: e is a set positive integer; the fractal dimension of the image texture is calculated using the box counting method; the micro-texture features are concatenated with the fractal dimension of the image texture to obtain the micro-texture feature vector.
[0012] Furthermore, in step S2, the method for extracting the deep semantic features is as follows: inputting the surface reflectance feature map into a deep convolutional neural network to extract high-level semantic feature vectors.
[0013] Furthermore, in step S3, the macroscopic texture features and the microscopic texture features are respectively up-dimensionalized through a linear projection layer, and then channel-wise concatenated with the deep semantic features.
[0014] Furthermore, in step S4, the Focal Loss loss function is used to train the textile intelligent recognition model.
[0015] Furthermore, in step S4, for categories with sample sizes lower than the minimum sample quantity threshold, a conditional generative adversarial network (cGAN) is used to synthesize and expand texture-fidelity samples. The expanded samples are then scored and screened, and samples with scores lower than the score threshold are retained for training set expansion until the sample size of textile samples in each category reaches or exceeds the minimum sample quantity threshold.
[0016] A textile intelligent identification system that implements the above-mentioned textile intelligent identification method includes: The image acquisition and preprocessing module is used to acquire the original RGB images of textile samples of various categories, convert the original RGB images to the HSV color space, perform normalization processing on the H, S, and V channels respectively, and generate a surface reflectance feature map decoupled from ambient light. The three-channel parallel feature extraction module is used to perform three-channel heterogeneous feature parallel extraction on the surface reflectance feature map, and extract macroscopic texture features, microscopic texture features and deep semantic features respectively; The cross-modal intermediate fusion module is used to concatenate the macro-texture features, the micro-texture features, and the deep semantic features through channels, and calculate the weights of each channel through a cross-modal attention channel mechanism to generate a fused feature representation; The dynamic class balance training module is used to train the textile intelligent recognition model using the fusion feature representation corresponding to the textile samples. The output of the textile intelligent recognition model is the textile category label and the corresponding confidence score. The classification output module is used to identify the category of the textile to be identified using the trained intelligent textile recognition model.
[0017] The present invention also provides a computer-readable storage medium capable of implementing the above-described intelligent textile identification method, wherein the computer-readable storage medium stores a computer program, which, when executed, implements the above-described intelligent textile identification method.
[0018] Due to the application of the above technical solutions, the present invention has the following advantages compared with the prior art: the present invention can significantly improve the multi-scale texture representation capability, reduce the misclassification rate of similar materials, significantly enhance the illumination robustness, steadily improve the recognition performance of a few categories, and enhance the applicability of edge deployment. Attached Figure Description
[0019] Appendix Figure 1 This is a flowchart illustrating the intelligent textile identification method of the present invention.
[0020] Appendix Figure 2 This is a simplified flowchart of the intelligent textile identification method of the present invention.
[0021] Appendix Figure 3 This is a block diagram of the intelligent textile recognition system of the present invention.
[0022] Appendix Figure 4 This is a schematic diagram of the structure of the three-channel parallel feature extraction module in the intelligent textile recognition system of the present invention.
[0023] Appendix Figure 5 This is a schematic diagram of the cross-modal intermediate fusion module in the intelligent textile recognition system of the present invention.
[0024] Appendix Figure 6 This is a schematic diagram of the dynamic class balance training module in the intelligent textile recognition system of the present invention.
[0025] Appendix Figure 7 This is a bar chart comparing the F1 scores of the intelligent textile identification method of the present invention with existing technologies across various fabric categories.
[0026] Appendix Figure 8 This is a graph showing the comparison of classification accuracy of the intelligent textile identification method of the present invention under different lighting conditions. Detailed Implementation
[0027] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0028] Example 1: As shown in the attached document Figure 1 and attached Figure 2 As shown, in a standard industrial quality inspection scenario, the intelligent textile recognition method consists of five core steps: image preprocessing, parallel extraction of heterogeneous features from three channels, cross-modal intermediate layer fusion, dynamic class balancing training, and classification output. Details are as follows: Step S1: Image acquisition and preprocessing.
[0029] The original RGB images of textile samples of each category are obtained, the original RGB images are converted to HSV color space, and normalization processing is performed on the H, S, and V channels respectively to generate surface reflectance feature maps decoupled from ambient light.
[0030] Under standard industrial light source (color temperature 5000K, illuminance 800lx), the training set consists of original front RGB images of textile samples acquired by an industrial camera with a resolution of no less than 24 million pixels. The image size is uniformly adjusted to 224×224 pixels.
[0031] After converting the acquired raw RGB image to the HSV color space, mean-standard deviation normalization was performed on the H (hue), S (saturation), and V (lightness) channels respectively. The normalization method is as follows:
[0032] in, For the first c Channel pixel value, For the training set c The global mean of the channel. For the training set c Standard deviation of the channel , Obtained through statistical calculations on the entire training set of images. To prevent smoothing terms from being divided by zero.
[0033] The surface reflectance characteristic map obtained after the above processing is shown. The numerical distribution of each channel is centered at zero, which effectively eliminates the interference of changes in ambient light intensity on subsequent feature extraction and effectively eliminates the systematic shift of the surface reflectance feature vector of the same fabric under different light intensities and color temperatures.
[0034] Step S2: Parallel extraction of heterogeneous features from three channels.
[0035] Surface reflectivity characteristic map Parallel extraction of heterogeneous features across three channels is performed to extract macroscopic texture features, microscopic texture features, and deep semantic features, respectively.
[0036] Surface reflectivity characteristic map The following three feature extraction branches are executed in parallel: Branch A – Macro-texture feature extraction: Surface reflectivity feature map Convert to grayscale image, set m steps d and n directions θ Each selected step size d and a direction θ This corresponds to calculating a multi-scale gray-level co-occurrence matrix, thus constructing mn multi-scale gray-level co-occurrence matrices; extracting p-class statistical descriptors from each multi-scale gray-level co-occurrence matrix to form an mnp-dimensional GLCM descriptor vector; performing a two-dimensional fast Fourier transform on the grayscale image, calculating the power spectrum and averaging it to obtain a one-dimensional radial power spectrum, sampling the one-dimensional radial power spectrum at q frequency points to form a q-dimensional FFT feature vector; standardizing the GLCM descriptor vector and the FFT feature vector respectively, and then concatenating them to obtain the macroscopic texture feature vector.
[0037] In this embodiment, the macroscopic texture feature vector of branch A Generate through the following steps: ① Gray-level co-occurrence matrix (GLCM) descriptor extraction After converting the surface reflectance feature map into a grayscale image, three step sizes are set. Pixels, four directions A multi-scale gray-level co-occurrence matrix (GLCM) was constructed, generating a total of 3×4=12 GLCMs. Four statistical descriptors—contrast, energy, correlation, and homogeneity—were extracted from each GLCM to form... 3D descriptor vector .
[0038] The calculation formulas for each statistical descriptor are as follows:
[0039]
[0040]
[0041]
[0042] in, Intensity pairs in normalized GLCM The probability of occurrence , , , They are respectively the corresponding rows and columns (the first row) i Okay, number j The mean and standard deviation of the column.
[0043] The specific arrangement of the statistical descriptors is as follows:
[0044] The resulting 48-dimensional statistical descriptors are arranged in matrix numbering order as follows:
[0045] Among them, the subscript numbers correspond to 12. Combination matrix, c , e , r , h These represent contrast, energy, correlation, and homogeneity, respectively.
[0046] ②FFT frequency domain texture periodic feature extraction Subsequently, a two-dimensional Fast Fourier Transform (FFT) is performed on the grayscale image to calculate the power spectrum, and a circular average is taken according to the frequency radius (to calculate the radial average distribution of the power spectrum) to obtain a one-dimensional radial power spectrum; then the frequency range is... Uniformly sample 64 points to form a 64-dimensional FFT feature vector. .
[0047] The formula for calculating the radial power spectrum of FFT is:
[0048] in, For frequency radius, For radius The set of all pixels within the annular region. The maximum usable frequency radius is... The radial power spectrum was uniformly sampled at 64 frequency points (corresponding to a frequency range of approximately 1–112 Hz) to obtain... These 64 sampling points cover the complete spectral distribution from low frequency (coarse texture period) to high frequency (fine texture period), which directly corresponds to material characteristics such as the denim triplet (100 / 125 / 150Hz) and cotton multiplet (65–175Hz) observed in the experiment.
[0049] ③ splicing Will and After performing Z-score normalization, the components were concatenated and spliced together.
[0050] Forming macroscopic texture feature vectors:
[0051] Because of the numerical scale inconsistency between GLCM descriptors (such as Contrast values reaching hundreds) and FFT power spectra (with large magnitude differences), L2 normalization or Z-score normalization needs to be performed on the two sub-vectors respectively before splicing. This indicates the Z-score normalization operation. .
[0052] Branch B – Microtexture Feature Extraction: Multiple sampling radii and corresponding sampling point numbers are set as multi-scale LBP operators. LBP histograms are generated from the surface reflectance feature maps using the sampling radii and corresponding sampling point numbers, thus obtaining 2... e The micro-texture features are defined as follows: e is a set positive integer; the fractal dimension of the image texture is calculated using the box-counting method, and the micro-texture features are concatenated with the fractal dimension of the image texture to obtain the micro-texture feature vector.
[0053] In this embodiment, the micro-texture feature vector The construction process is as follows: ① Multi-scale LBP histogram (256 dimensions) Using radius Pixels, number of sampling points The multi-scale LBP operator. For each center pixel... and its adjacent pixels The LBP encoding rule is as follows:
[0054] in, The grayscale value of the center pixel. radius r The first on the circumference n The grayscale value of each sampling point.
[0055] For three scales LBP histograms were generated separately (each scale was divided into approximately 85 dimensions and then stitched together), resulting in a final 256-dimensional texture feature. This histogram describes the distribution frequency of various micro-texture patterns in the image, effectively capturing the fiber detail differences of materials such as cotton and polyester.
[0056] ②Box-counting fractal dimension (1-dimensional) The fractal dimension of image texture is calculated using box counting. :
[0057] in, To use the side length The number of squares required to cover the texture. Referring to existing experimental results: cotton fabric. (Complex and irregular), polyester (Uniform and regular), denim (Intermediate state). This single scalar effectively quantizes the self-similarity complexity of textures.
[0058] ③ splicing fractal dimension After normalization, it is concatenated as the 257th dimension feature and the 256th dimension LBP feature:
[0059] Forming micro-texture feature vectors:
[0060] Branch C – Deep Semantic Feature Extraction: The surface reflectance feature map is input into a deep convolutional neural network to extract high-level semantic feature vectors.
[0061] In this embodiment, the backbone network used is ResNet50_V2, whose core features are as follows:
[0062] Surface reflectivity feature map Input a ResNet50_V2 backbone network pre-trained on ImageNet (where 50% of the standard convolutional layers have been replaced with depthwise separable convolutional layers), extract the 7×7×2048 spatial feature map output from the fourth residual block, and obtain the deep semantic feature vector after global average pooling:
[0063] The backbone network consists of four residual blocks, each containing several bottleneck structural units that propagate gradients across layers via shortcut connections. At least 50% of the standard convolutional layers are replaced with depthwise separable convolutional layers. Depthwise separable convolution consists of two steps: channel-wise convolution and pointwise convolution.
[0064]
[0065] The replacement reduces the number of model parameters by at least 35% compared to the original ResNet50_V2, improves inference speed by approximately 2 to 3 times, and maintains classification accuracy at least 98% of the original architecture; the 7×7×2048 spatial feature map output from the fourth residual block is extracted and then subjected to global average pooling to obtain... .
[0066] The mathematical forms of standard convolution versus depthwise separable convolution are compared below: I. Standard Convolution
[0067] The computational cost is .
[0068] II. Depthwise Separable Convolution Step 1 – Depthwise Convolution
[0069] Each input channel undergoes independent convolution, with a computational cost of O(n). .
[0070] The second step – Pointwise Convolution
[0071] The computational cost is .
[0072] Parameter compression ratio:
[0073] for k =3, C out =256, compression ratio is about 1 / 9≈88.9%, that is, the number of parameters is reduced to about 11% of the original. When the replacement ratio is not less than 50%, the overall model parameter count can be reduced by not less than 35%, while maintaining the classification accuracy not less than 98% of the original architecture through pre-trained weight transfer.
[0074] Step S3: Cross-modal intermediate layer fusion.
[0075] Macro-texture features, micro-texture features, and deep semantic features are concatenated through channels, and the weights of each channel are calculated using a cross-modal attention channel mechanism to generate a fused feature representation. .
[0076] After the output layer of the third residual block in ResNet50_V2, and After being upgraded to 2048 dimensions via linear projection layers, we obtain... and Then, it is concatenated with the deep semantic feature execution channel:
[0077] Subsequently, the importance weights of each channel are calculated using a cross-modal attention channel mechanism to generate a fused feature representation. :
[0078]
[0079] Among them, the dimensionality reduction weight matrix Upgraded weight matrix Compression ratio r =16, nonlinear activation , Using the Sigmoid activation function, the weights are normalized to... , This indicates a channel splicing operation. This indicates element-wise multiplication; the cross-modal attention channel mechanism is embedded after the output layer of the third residual block of ResNet50_V2 (rather than before the final classification layer), realizing cross-modal semantic alignment in the intermediate layer. This enables the three features to establish cross-modal semantic association in the intermediate layer of the network. Compared with the late fusion scheme that is only performed before the final classification layer, it can suppress noise channels (such as the illumination interference channel) at an earlier stage, strengthen the discriminative features of similar materials such as cotton-polyester and satin-silk, and solve the problem of high misclassification rate.
[0080] The cross-modal attention channel mechanism enables the three features to establish cross-modal semantic associations in the middle layer of the network. Compared with late-stage fusion schemes, it can suppress noise channels and enhance discriminative features at an earlier stage.
[0081] Step S4: Dynamic class balance training.
[0082] Using the fusion feature representation of textile samples Train the intelligent textile recognition model. During training, for categories with sample sizes below the minimum sample size threshold, a conditional generative adversarial network (cGAN) is used to synthesize texture-fidelity samples for augmentation. The augmented samples are then scored and filtered, and samples with scores below the threshold are retained for training set augmentation until the sample size of textile samples in each category reaches or exceeds the minimum sample size threshold.
[0083] In this embodiment, the Focal Loss loss function is used to train the model, and a conditional generative adversarial network (cGAN) is used to synthesize texture-fidelity samples for a few categories with fewer than 200 samples in the training set. The generated samples are filtered by Fréchet Inception Distance (FID) scoring, and only samples with FID scores below 50 are retained for training set expansion.
[0084] The Focal Loss function is defined as follows:
[0085] in, For the first i The category to which each sample belongs k The frequency inverse weight (used after normalization). For category k The sample frequency in the training set, This represents the model's predicted probability of the true class. It is the focus parameter and has a value of 2.
[0086] Minimum sample size threshold (threshold for determining minority classes) The training set is set to 200 samples, which is the sample size of the training set. n k Categories with scores <200 are identified as “minority classes”, triggering cGAN sample synthesis and augmentation.
[0087] The Conditional Generative Adversarial Network (cGAN) takes fabric category labels as conditional input. The generator network uses a U-Net architecture (encoder-decoder structure, skip connections preserve local texture details), and the discriminator network uses a PatchGAN structure (70×70 receptive field constrains texture detail realism). The generated synthetic samples are screened using an FID (Fixed Integrity Index) score. The FID calculation formula is:
[0088] in, , These are the feature mean and covariance matrix extracted from the real samples using Inception-V3, respectively. , To generate the mean and covariance matrix of the corresponding features of the samples, Let be the trace of the matrix. The filtering rules are:
[0089] Typically, high-quality GANs have an FID (Field-ID) between 10 and 50, with setting FID=50 being a reasonable acceptable threshold for quality. Setting FID < 50 ensures that the synthesized fabric texture samples are highly consistent with real samples in terms of visual fidelity and statistical distribution, avoiding the introduction of noise interference from low-quality synthesized samples. Only samples with FID scores below 50 are retained for training set expansion until the sample size for each category is not less than [a certain value]. .
[0090] The sample data used in this embodiment is as follows:
[0091] In the aforementioned dataset, 10 categories had fewer than 200 training samples each: nylon (143), fleece (82), crepe (65), corduroy (60), satin (60), linen (47), leather (39), silk (39), acrylic (30), and chenille (32). These 10 categories triggered the cGAN augmentation mechanism until the number of samples in each category was no less than 200. .
[0092] Step S5: Classify and output.
[0093] The trained intelligent textile recognition model is used to classify the textiles to be identified, and the feature representations are fused. After global average pooling, the data is input into a fully connected classification layer, activated by Softmax, and outputs textile category labels and corresponding confidence scores.
[0094] Representing fusion features After global average pooling, the input consists of two fully connected classification layers (dimensions 1024 and 1024 respectively). K ,in K After applying Softmax activation (to the number of target categories), the output is the predicted probability distribution for each category:
[0095] The category label corresponding to the highest probability is taken as the final recognition result, and the confidence score is output for reference by the downstream quality inspection system.
[0096] Robustness verification under complex lighting conditions As attached Figure 8As shown, a comparative experiment was conducted between the method of this invention and existing technologies under a complex lighting environment simulating an industrial site (light intensity randomly varying from 200 lx to 2000 lx, and color temperature randomly varying from 3000 K to 7000 K). The experimental results show that the existing method based on direct RGB input experiences a decrease in classification accuracy of approximately 18.3% within the aforementioned lighting variation range; while after employing the HSV lighting decoupling and normalization preprocessing in step S1 of this invention, the decrease in classification accuracy is reduced to 4.7%, and the lighting robustness is improved by approximately 74%.
[0097] Performance validation on extreme class imbalanced datasets As attached Figure 7 As shown, using an imbalanced dataset containing 15 textile classes (most classes: cotton: 4280 samples; least classes: silk: 116 samples, imbalance ratio approximately 37:1), we compared the recall rates of each approach on the minority classes (silk, leather, acrylic) using standard cross-entropy loss (baseline), FocalLoss, cGAN augmentation, and the dual class balancing mechanism of this invention.
[0098] The above results show that the dual-class balancing mechanism of the present invention improves the recall rate of the minority class by about 28 percentage points compared with the baseline, verifying the effectiveness of the technical solution.
[0099] Example 2: As shown in the attached document Figure 3 As shown, a smart textile recognition system that works in conjunction with image acquisition hardware includes an image acquisition and preprocessing module, a three-channel parallel feature extraction module, a cross-modal intermediate fusion module, a dynamic class balance training module, and a classification output module connected in sequence.
[0100] The image acquisition and preprocessing module is used to acquire the original RGB images of textile samples of various categories, convert the original RGB images to the HSV color space, and perform normalization processing on the H, S, and V channels respectively to generate a surface reflectance feature map decoupled from ambient light, i.e., to perform step S1 in Example 1. The image acquisition and preprocessing module includes an RGB image acquisition unit, an HSV color space conversion unit, and an illumination decoupling normalization unit connected in sequence.
[0101] As attached Figure 4 As shown, the three-channel parallel feature extraction module (CMCA) is used to perform three-channel heterogeneous feature parallel extraction on the surface reflectance feature map, extracting macroscopic texture features, microscopic texture features, and deep semantic features respectively, i.e., performing step S2 in Example 1. The three-channel parallel feature extraction module includes a macroscopic texture extraction unit, a microscopic texture extraction unit, and a deep semantic feature extraction unit set in parallel.
[0102] As attached Figure 5 As shown, the cross-modal intermediate fusion module is used to concatenate macroscopic texture features, microscopic texture features, and deep semantic features through channels, and calculate the weights of each channel through a cross-modal attention channel mechanism to generate a fused feature representation, i.e., to execute step S3 in Embodiment 1. The cross-modal intermediate fusion module includes a linear projection upscaling unit, a CMCA attention unit, and a weighted fusion output unit connected in sequence.
[0103] As attached Figure 6 As shown, the dynamic class balance training module is used to train a textile intelligent recognition model using the fusion feature representations corresponding to textile samples. The output of the textile intelligent recognition model is the textile category label and the corresponding confidence score, i.e., executing step S4 in Example 1. The dynamic class balance training module includes a Focal Loss calculation unit and a cGAN sample synthesis unit connected by communication.
[0104] The classification output module is used to classify the textile to be identified using the trained intelligent textile recognition model, i.e., to execute step S5 in Example 1. The classification output module includes a fully connected classification head unit, a category label output unit, and a confidence score output unit connected in sequence.
[0105] Example 3: A computer-readable storage medium storing a computer program that, when executed, implements the intelligent textile identification method of Example 1.
[0106] In summary, the above scheme discloses a method and system for intelligent textile recognition based on a multimodal cross-layer fusion attention mechanism. The method includes: converting the original RGB image to the HSV color space and performing illumination decoupling normalization to generate a surface reflectance feature map; performing parallel extraction of three heterogeneous features: macroscopic texture (GLCM+FFT, 112-dimensional), microscopic texture (LBP+fractal dimension, 257-dimensional), and deep semantic features (ResNet50_V2, 2048-dimensional); weighted fusion of the three features in the intermediate feature layer of the CNN using a cross-modal channel attention module (CMCA); model training using a dual class balancing mechanism of FocalLoss and conditional generative adversarial network (cGAN); and finally outputting textile category labels and confidence scores. This invention effectively solves the problems of insufficient single-modal feature description, high misclassification rate of similar materials, weak illumination robustness, and class imbalance leading to degradation of minority class recognition in the prior art. On the standard dataset, the macro average F1 score reaches 93.8%, the minority class recall rate is improved by about 28 percentage points compared with the baseline, and the illumination robustness is improved by about 74%. It is suitable for application scenarios such as textile industry quality inspection, customs commodity identification, and e-commerce intelligent product selection.
[0107] Compared with the prior art, the present invention has the following beneficial effects: Effect 1: Significantly improved multi-scale texture representation capability. By extracting macro-texture (GLCM+FFT, 112-dimensional), micro-texture (LBP+fractal dimension, 257-dimensional), and deep semantic features (ResNet50_V2, 2048-dimensional) in parallel, a full-scale description of fabrics from fiber details to weave structure is achieved. Compared with methods using GLCM or LBP alone, the overall F1 score is improved by more than 15%. Effect 2: Significantly reduced misclassification rate for similar material pairs. The Cross-Modal Channel Attention Module (CMCA) establishes cross-modal semantic associations of three features in the intermediate layers of the CNN, reducing the misclassification rate of highly similar material pairs such as cotton-polyester and satin-silk from 12%–18% to less than 5%, which is significantly better than late-stage fusion schemes. Effect 3: Significantly enhanced robustness to illumination. HSV spatial illumination decoupling and normalization preprocessing effectively eliminates the interference of ambient illumination changes on feature vectors, reducing the decrease in classification accuracy of the model under cross-illumination conditions from approximately 18% to less than 5%, greatly improving the stability of industrial field deployment; Effect 4: Stable improvement in minority class recognition performance. The synergistic effect of the FocalLoss and cGAN dual class balancing mechanisms eliminates the systematic bias caused by class imbalance. On extremely imbalanced datasets, the recall rate of minority classes (leather, acrylic, etc.) can be improved by 20 to 30 percentage points. Effect 5: Enhanced applicability to edge deployment. The depthwise separable convolution replacement scheme reduces the number of model parameters by approximately 40% and increases inference speed by approximately 2 to 3 times, enabling this method to be deployed on industrial edge computing devices to meet real-time online detection requirements.
[0108] The above embodiments are only for illustrating the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent changes or modifications made in accordance with the spirit and essence of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A method for intelligent identification of textiles, characterized in that: The intelligent identification method for textiles includes the following steps: Step S1: Obtain the original RGB images of textile samples of each category, convert the original RGB images to the HSV color space, and perform normalization processing on the H, S, and V channels respectively to generate a surface reflectance feature map decoupled from ambient light. Step S2: Perform parallel extraction of three-channel heterogeneous features on the surface reflectance feature map to extract macroscopic texture features, microscopic texture features and deep semantic features respectively; Step S3: The macroscopic texture features, the microscopic texture features, and the deep semantic features are concatenated by channels, and the weights of each channel are calculated through a cross-modal attention channel mechanism to generate a fused feature representation; Step S4: Train the intelligent textile recognition model using the fusion feature representations corresponding to the textile samples; Step S5: Use the trained intelligent textile recognition model to identify the category of the textile to be identified, and output the textile category label and corresponding confidence score.
2. The intelligent identification method for textiles according to claim 1, characterized in that: In step S1, mean-standard deviation normalization is performed on the H, S, and V channels respectively.
3. The intelligent identification method for textiles according to claim 1, characterized in that: In step S2, the method for extracting the macroscopic texture features is as follows: convert the surface reflectance feature map into a grayscale image, and set m step sizes. d and n directions θ Each selected step size d and a direction θ Then, a multi-scale gray-level co-occurrence matrix is calculated, thereby constructing mn such multi-scale gray-level co-occurrence matrices; p-class statistical descriptors are extracted from each of the multi-scale gray-level co-occurrence matrices to form an mnp-dimensional GLCM descriptor vector; A two-dimensional fast Fourier transform is performed on the grayscale image to calculate the power spectrum and then average it to obtain a one-dimensional radial power spectrum. The one-dimensional radial power spectrum is sampled at q frequency points to form a q-dimensional FFT feature vector. The GLCM descriptor vector and the FFT feature vector are standardized and then concatenated to obtain a macroscopic texture feature vector.
4. The intelligent identification method for textiles according to claim 1, characterized in that: In step S2, the method for extracting the micro-texture features is as follows: Multiple sampling radii and corresponding sampling point numbers are set as multi-scale LBP operators; an LBP histogram is generated from the surface reflectance feature map using the sampling radii and corresponding sampling point numbers, thereby obtaining 2 e The micro-texture features are defined as follows: e is a set positive integer; the fractal dimension of the image texture is calculated using the box counting method; the micro-texture features are concatenated with the fractal dimension of the image texture to obtain the micro-texture feature vector.
5. The intelligent identification method for textiles according to claim 1, characterized in that: In step S2, the method for extracting the deep semantic features is as follows: input the surface reflectance feature map into a deep convolutional neural network to extract high-level semantic feature vectors.
6. The intelligent identification method for textiles according to claim 1, characterized in that: In step S3, the macroscopic texture features and the microscopic texture features are respectively up-dimensionalized through a linear projection layer, and then channel-wise concatenated with the deep semantic features.
7. The intelligent identification method for textiles according to claim 1, characterized in that: In step S4, the FocalLoss loss function is used to train the intelligent textile recognition model.
8. The intelligent identification method for textiles according to claim 1, characterized in that: In step S4, for categories with sample sizes lower than the minimum sample quantity threshold, a conditional generative adversarial network (cGAN) is used to synthesize and expand texture-fidelity samples. The expanded samples are then scored and filtered, and samples with scores lower than the score threshold are retained for training set expansion until the sample size of textile samples in each category reaches or exceeds the minimum sample quantity threshold.
9. A textile intelligent identification system implementing the textile intelligent identification method as described in any one of claims 1 to 8, characterized in that: The intelligent textile identification system includes: The image acquisition and preprocessing module is used to acquire the original RGB images of textile samples of various categories, convert the original RGB images to the HSV color space, perform normalization processing on the H, S, and V channels respectively, and generate a surface reflectance feature map decoupled from ambient light. The three-channel parallel feature extraction module is used to perform three-channel heterogeneous feature parallel extraction on the surface reflectance feature map, and extract macroscopic texture features, microscopic texture features and deep semantic features respectively; The cross-modal intermediate fusion module is used to concatenate the macro-texture features, the micro-texture features, and the deep semantic features through channels, and calculate the weights of each channel through a cross-modal attention channel mechanism to generate a fused feature representation; The dynamic class balance training module is used to train the textile intelligent recognition model using the fusion feature representation corresponding to the textile samples. The output of the textile intelligent recognition model is the textile category label and the corresponding confidence score. The classification output module is used to identify the category of the textile to be identified using the trained intelligent textile recognition model.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed, it implements the intelligent textile identification method as described in any one of claims 1 to 8.