A textile color difference identification method for optimizing a process

By using the MobileNetV2 network to filter target regions, combining grayscale variance and gradient consistency, and preprocessing with wavelet decomposition and a lightweight CNN attention module, multi-dimensional color difference determination and particle swarm optimization algorithm are introduced to optimize process parameters. This solves the problems of detection bias and low production efficiency in textile color difference recognition, and realizes high-precision automated production.

CN121330317BActive Publication Date: 2026-04-28SHANDONG DEMIAN NEW MATERIAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANDONG DEMIAN NEW MATERIAL TECHNOLOGY CO LTD
Filing Date
2025-11-03
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing textile color difference recognition technologies suffer from inaccurate target area selection, loss of color detail information due to noise reduction methods, misjudgment or omission of color difference, and lack of automatic optimization mechanism for process parameters, resulting in low production efficiency and increased costs.

Method used

The MobileNetV2 network is used for target region screening. Combined with grayscale variance and gradient consistency judgment, wavelet decomposition and lightweight CNN attention module are used for preprocessing. A multi-dimensional color difference judgment mechanism is introduced, and the process is optimized by particle swarm optimization algorithm.

Benefits of technology

It achieves accurate target area detection, preserves color details, reduces misjudgments, automatically optimizes process parameters, improves color difference recognition accuracy, shortens production cycle, and reduces costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121330317B_ABST
    Figure CN121330317B_ABST
Patent Text Reader

Abstract

The present application belongs to the field of image processing, and particularly relates to a textile color difference identification method for optimizing process. The method first selects a textile detection area, filters out a qualified target area avoiding edges and wrinkles through MobileNetV2 semantic analysis, gray variance calculation and gradient consistency judgment, then collects the area image and obtains the standard color parameters of the corresponding standard process; during the pre-processing of the collected image, wavelet decomposition is used to separate high and low frequency subbands, and the high frequency subband is weighted and fused with a lightweight CNN attention module to denoise, and then the actual color parameters are extracted; the actual and standard color parameters are compared, and the color difference is determined through the double-layer mechanism of initial screening of color saturation and hue angle combined with fine judgment of multi-channel deviation factor; if there is color difference, the process parameters are optimized by particle swarm algorithm. The present application improves the identification accuracy, reduces the false and missed judgment, does not need manual trial and error, shortens the production cycle, reduces the cost, and is suitable for intelligent production.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing, and in particular relates to a method for identifying color differences in textiles for optimizing processes. Background Technology

[0002] Color consistency in textiles is a core indicator of their quality, directly impacting product appearance, brand reputation, and market competitiveness. During mass production, factors such as batch variations in raw materials, fluctuations in dyeing temperature, and insufficient precision in controlling dyeing time often result in color differences between the actual produced textiles and those produced using standard processes. With downstream industries like apparel and home furnishings demanding increasingly higher quality textiles, and with the growing need for improved testing efficiency driven by intelligent manufacturing trends, traditional methods relying on manual visual inspection for color differences are no longer sufficient to meet the quality control requirements of modern textile production. These methods suffer from inherent flaws such as high subjectivity, low efficiency, difficulty in quantification, and inability to be linked to process adjustments. Existing technologies for color difference identification in textiles still have several limitations: In the sample collection stage, most technologies lack an effective target area screening mechanism, easily including non-target areas such as edges and wrinkles in the detection, leading to deviations in subsequent color parameter extraction; in addition, traditional noise reduction methods often use a single filtering method, which can easily lose color detail information while removing noise, affecting the accuracy of actual color parameters; in the color difference judgment process, it is often only compared with standard values ​​by single-dimensional parameters such as lightness and hue, without combining multi-channel color deviation, distribution consistency, etc. for comprehensive analysis, which is prone to misjudgment or omission; more importantly, most existing technologies only stay at the level of color difference identification, lacking a closed-loop linkage mechanism with process parameter adjustment, and cannot automatically optimize process parameters based on color difference results, requiring repeated trial and error based on human experience, which not only prolongs the production cycle but also increases production costs, making it difficult to achieve the integration of process optimization and color difference control. Summary of the Invention

[0003] In view of the technical problems existing in the background art described above, the present invention proposes a method for identifying color differences in textiles for optimizing processes.

[0004] To achieve the above objectives, the technical solution adopted by the present invention includes the following steps:

[0005] S1. Textile sample collection: Select the target area of ​​the textile to be tested, and collect the physical sample image of the target area under preset uniform collection conditions; at the same time, obtain the standard color parameters obtained by the standard process corresponding to the textile.

[0006] S2. Preprocess the collected textile sample images to remove image noise and extract the actual color parameters of the physical sample images from the target area.

[0007] S3. Compare the actual color parameters obtained with the standard color parameters respectively, and compare them according to the preset standard threshold. If the comparison exceeds the standard threshold range, it is determined that there is a color difference defect.

[0008] S4. For textiles with color difference defects, the particle swarm optimization algorithm is used to optimize and adjust the process parameters to minimize the color difference defects.

[0009] The actual color parameters and standard color parameters are obtained by using the CIELab internationally recognized color space parameters, including lightness values. Red-green deviation value Yellow-blue deviation value ; Calculated based on color space parameters, including color saturation values With color angle and the deviation coefficient, where, , The arithmetic mean of the corresponding parameters of no less than 30 standard samples from the same batch is selected as the standard color parameter.

[0010] Preferably, the target area in step S1 is a fabric area that avoids edges and wrinkles; after selecting the target area, it is also necessary to determine whether the target area meets the requirements, specifically including:

[0011] S11. Use the MobileNetV2 network to perform semantic analysis on the initial target region image to obtain the mask of the target region image; if there is a region with a mask of 0, it indicates that it is an edge region;

[0012] S12. Based on the determination that the region is not an edge region, the original image is converted to a grayscale image using weighted grayscale conversion. And divide the grayscale image into Non-overlapping local blocks, denoted as a single local block. ;

[0013] S13, Calculate each Gray variance: ,in For the k-th local image patch The average gray level, Let be the gray value of the grayscale image at pixel coordinates (i,j);

[0014] S14, Calculation Gradient direction consistency coefficient: ,in The full-image horizontal and vertical gradients are based on the Sobel operator; if three consecutive adjacent blocks satisfy the gray-level variance... Greater than the preset threshold and Based on the high concentration of gradient direction and grayscale changes, it was determined that there were folds in this area;

[0015] S15. If it is determined to be a non-edge area and there are no wrinkles, it is judged as a qualified target area.

[0016] Preferably, the specific implementation of preprocessing the acquired textile sample image in step S2 to remove image noise and extract the actual color parameters of the physical sample image from the target area includes:

[0017] S21. Convert the collected textile sample images to the CIE Lab color space, and separate the lightness channel L, the red-green color channel a, and the yellow-blue color channel b; perform wavelet decomposition on the three channels L, a, and b respectively to obtain the high-frequency sub-bands and low-frequency sub-bands of each channel. The mathematical expression of wavelet decomposition is:

[0018] ,in, For the first Low-frequency subband coefficient of layer, For the first High-frequency subband coefficient of the layer, These are the coefficients of the low-pass filter. Here are the high-pass filter coefficients, and r is the number of decomposition layers, r = 1, 2, 3. This represents the downsampling result of the low-frequency subband coefficients of the (r-1)th layer. This represents the downsampling result of the high-frequency subband coefficients of the (r-1)th layer;

[0019] S22. Construct a lightweight CNN attention module. For each high-frequency subband, extract features through depthwise separable convolution, and then enhance the non-linear representation using the Swish activation function. This applies to the features of the high-frequency subbands in layers 1, 2, and 3. By using 1×1 convolution and upsampling / downsampling operations, features are unified to the same scale, resulting in a multi-scale unified feature set. ;

[0020] S23. Calculate the similarity matrix between uniform features at different scales to quantify the information association between features: ,in For unified feature maps at different scales, For the feature similarity matrix, Using the L2 norm, multi-scale features are weighted and fused based on the similarity matrix to enhance cross-scale information interaction: ,in For adaptive fusion weights , ⊙ represents element-wise multiplication;

[0021] S24, Integrating Features Channel attention and spatial attention weighting are performed sequentially. First, channel attention weighting is performed, and the spatial dimension is compressed through global average pooling. Then, the channel weights are learned through a fully connected layer.

[0022] ,in For global average pooling It is a fully connected layer. Channel attention weights;

[0023] A spatial attention mechanism is introduced to weight the spatial dimensions. The channel dimensions are compressed through convolution operations, and then the spatial weights are obtained through sigmoid activation.

[0024] ,in Spatial attention weights, For average pooling, For max pooling, For feature splicing;

[0025] S25, Adjust channel weights Spatial weights Element-wise multiplication yields the final attention weights, which are then weighted for the high-frequency subband coefficients of each layer.

[0026] S26. Perform inverse wavelet transform on the weighted high-frequency subband and low-frequency subband to obtain the denoised Lab image.

[0027] Preferably, in step S3, the actual color parameters are compared with the standard color parameters respectively, and the comparison is based on a preset standard threshold. If the comparison exceeds the standard threshold range, it is determined that there is a color difference defect. The specific implementation is as follows: First, the color saturation values ​​of the actual color parameters and the standard color parameters are compared. With color angle The samples are compared. If both meet the set threshold, they are considered to be initially qualified; otherwise, they are considered to have color difference defects. After the initial qualification, a second round of judgment is performed. The mean deviation of colorimetry and the center deviation of colorimetry between the actual sample and the standard sample are calculated respectively. Then, the deviation factor is obtained. If the deviation factor is less than or equal to the set threshold, it is considered that there are no color difference defects; otherwise, it is considered that there are color difference defects.

[0028] As a preferred approach, the mean chromaticity deviation and the center chromaticity deviation of the actual sample and the standard sample are calculated separately, and then the specific implementation of the deviation factor is obtained as follows:

[0029] S31. For the actual samples within the target area. and standard samples Calculate the mean deviation for each channel separately. The mean deviation is calculated as follows: ,in, These are the width and height of the target area, respectively. include and The mean deviation of each channel is calculated using the above method. ;

[0030] S32. Further calculate the mean difference of each channel. , , Then, it is merged into a multi-channel chromaticity mean deviation. ;

[0031] S33. For both the actual sample and the standard sample, calculate the chromaticity center variance for each channel. The calculation method for the chromaticity center variance is as follows: ;get ;

[0032] S34. Further calculate the mean variance of the chromaticity center of each channel. , , By integrating the actual and standard chromaticity center variances, the multi-channel chromaticity center deviation is obtained. ;

[0033] S35, Multi-channel chromaticity mean deviation and multi-channel chromaticity center deviation The deviation factor is obtained by comparing the values.

[0034] Preferably, in step S4, the specific implementation of using particle swarm optimization to optimize and adjust the process parameters that minimize the color difference defect in textiles with color difference defects is as follows: with the goal of minimizing the deviation factor, the number of particles is set, and each particle corresponds to a set of process parameter combinations. Within the value range of each process parameter, the initial position of each particle is generated by uniform random sampling. Particle swarm optimization is performed iteratively to update the velocity and position of the particles. When the number of iterations reaches the preset maximum value, the iteration stops. At this time, the process parameter combination corresponding to the globally optimal position is the process parameter that minimizes the color difference defect.

[0035] Compared with existing technologies, the advantages and positive effects of this invention are as follows: Target region selection uses MobileNetV2 semantic analysis combined with grayscale variance and gradient consistency judgment to accurately eliminate edge and wrinkle interference, avoiding detection bias; preprocessing employs wavelet decomposition and a lightweight CNN attention module to preserve color details during noise reduction, overcoming the information loss problem of traditional filtering; color difference judgment uses a two-layer mechanism of initial screening based on color saturation and hue angle combined with fine-tuning based on multi-channel deviation factors to reduce false positives and false negatives; and particle swarm optimization is used to automatically optimize process parameters. No manual trial and error is required, which improves color difference recognition accuracy, shortens production cycle, reduces costs, and adapts to the needs of intelligent production. Attached Figure Description

[0036] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0037] Figure 1 This is a schematic diagram of the structural process of a textile color difference identification method for optimizing processes. Detailed Implementation

[0038] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described below in conjunction with the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0039] Numerous specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways than those described herein, and therefore the invention is not limited to the specific embodiments disclosed in the following specification.

[0040] In practice, existing textiles often exhibit color difference issues that deviate from standard samples. Traditional detection methods primarily rely on manual visual comparison, whose judgments are significantly influenced by subjective factors such as lighting, experience, and visual fatigue, and lack unified quantitative standards. Furthermore, even if color difference issues are identified, they cannot guide process adjustments, forcing producers to repeatedly dye samples to correct parameters. This not only wastes dye and energy but also prolongs production cycles and reduces production line efficiency. To overcome these problems and achieve objective identification, intelligent judgment, and automated process optimization of textile color differences, a textile color difference identification method for process optimization is proposed.

[0041] To ensure the stability and comparability of the test data, textile sample images were first acquired under uniform lighting conditions and camera parameters. Simultaneously, the color parameters generated by the textile under standard processing methods were read as a comparison reference. During sample acquisition, the target area should avoid fabric edges, wrinkles, stains, or shadow areas to ensure that the measured color reflects only the true fabric color.

[0042] The actual color parameters and standard color parameters are obtained by using the CIELab internationally recognized color space parameters, including lightness values. Red-green deviation value Yellow-blue deviation value ; Calculated based on color space parameters, including color saturation values With color angle and the deviation coefficient, where, , The arithmetic mean of the corresponding parameters of no fewer than 30 standard samples from the same batch was selected as the standard color parameters. Specifically, to achieve high-precision acquisition of actual color parameters and standard color parameters, the internationally recognized CIELab color space model was used to perform color quantification analysis on the acquired textile images. First, the samples were photographed under standard D65 illumination to ensure consistent color reproduction. The system converted the RGB images to the CIELab color space and extracted the lightness value (L), red-green deviation value (a), and yellow-blue deviation value (b) of each pixel to ensure that the color parameters were consistent with the characteristics of human visual perception. Subsequently, the color saturation and hue angle were calculated based on the color space parameters, where color saturation describes the purity of the color and hue angle characterizes the hue direction. To further characterize the overall color differences, the system introduced a deviation coefficient and constructed a comprehensive deviation quantification index by combining the differences in lightness, color saturation, and hue angle. To establish a standard comparison benchmark, the color space parameters of no fewer than 30 standard samples from the same batch were statistically analyzed, and their arithmetic mean was calculated as the standard color parameters. This method can effectively eliminate random errors caused by a single standard sample, ensuring the stability and repeatability of subsequent color difference determination.

[0043] The target region is a fabric area that avoids edges and wrinkles. After selecting the target region, it is necessary to determine whether the target region meets the requirements. Specifically, this involves: performing semantic analysis on the initial target region image using a MobileNetV2 network to obtain a mask for the target region image; if there is a region with a mask of 0, it indicates an edge region; based on the determination that it is a non-edge region, the original image is converted to a grayscale image using weighted grayscale conversion. And divide the grayscale image into Non-overlapping local blocks, denoted as a single local block. ; calculate each Gray variance: ,in For the k-th local image patch The average gray level, Let i be the grayscale value of the grayscale image at pixel coordinates (i,j); calculate Gradient direction consistency coefficient: ,in The full-image horizontal and vertical gradients are based on the Sobel operator; if three consecutive adjacent blocks satisfy the gray-level variance... Greater than the preset threshold and By combining the high concentration of gradient direction and grayscale changes, the presence of wrinkles in the region is determined; if it is determined to be a non-edge region and there are no wrinkles, it is judged as a qualified target region. This step can effectively avoid illumination distortion caused by edge transitions and surface wrinkles, and improve the stability and accuracy of subsequent color analysis.

[0044] To improve the accuracy of color parameter extraction, the target region image needs to undergo systematic preprocessing before analysis. Considering the following common shortcomings in existing technologies: First, traditional color extraction methods often use direct RGB channel mean or histogram statistics, failing to consider uneven illumination distribution and differences in device imaging characteristics, leading to severe color shifts; second, while conventional smoothing and filtering algorithms (such as median filtering and Gaussian filtering) can suppress noise, they also destroy the micro-texture and color transition features of the textile surface, causing loss of chromaticity and saturation information; third, on complex fabric surfaces, local reflections, shadows, and texture undulations can cause spatial discontinuities in the color parameter extraction results, failing to accurately reflect the true color difference distribution. Therefore, a multi-scale wavelet decomposition and attention feature fusion image preprocessing method is proposed. First, the target region image is converted from RGB space to the CIELab international standard color space to separate brightness and chromaticity information, avoiding interference from illumination changes on the color recognition results. Then, multi-scale wavelet decomposition is performed on each channel, decomposing the image into sub-band layers of different frequencies, where the low-frequency sub-band describes the overall brightness trend, and the high-frequency sub-band contains detail and texture information. Through this multi-scale decomposition process, the system can achieve hierarchical modeling of color texture features. In the denoising stage, a lightweight convolutional neural network attention module is introduced to perform weighted analysis on high-frequency subbands at different scales. This module identifies the feature channels that contribute most to color changes through channel attention and highlights key local regions through spatial attention, thus achieving a dynamic balance between noise suppression and detail enhancement. This method can adaptively identify and suppress abnormal regions such as uneven illumination and imaging reflections, making the preprocessed results more consistent with the true color distribution. Furthermore, feature fusion achieves multi-layer feature interaction and information fidelity through upsampling, subsampling, and residual connection structures. In the reconstruction stage, inverse wavelet transform is used to recover the complete image. Unlike traditional smoothing filters, this method removes random noise while preserving the color transition gradients and detailed textures of the textile surface, making color parameter extraction smoother, more continuous, and physically interpretable. Finally, the preprocessed target region image possesses high signal-to-noise ratio and high color fidelity. This method not only effectively solves the problems of uneven illumination, noise interference, and texture distortion in existing technologies, but also achieves structured feature enhancement and color information purification of images, providing a reliable input foundation for subsequent Lab parameter calculation, color difference evaluation, and process optimization. Specifically, the acquired textile sample images are converted into the CIE Lab color space, and the lightness channel L, red-green chromaticity channel a, and yellow-blue chromaticity channel b are separated. Wavelet decomposition is then performed on the L, a, and b channels respectively to obtain the high-frequency and low-frequency sub-bands of each channel. The mathematical expression of wavelet decomposition is as follows: ,in, For the first Low-frequency subband coefficient of layer, For the first High-frequency subband coefficient of the layer, These are the coefficients of the low-pass filter. Here are the high-pass filter coefficients, and r is the number of decomposition layers, r = 1, 2, 3. This represents the downsampling result of the low-frequency subband coefficients of the (r-1)th layer. The downsampling results are for the coefficients of the high-frequency subband at layer r-1. A lightweight CNN attention module is constructed. For each high-frequency subband, features are extracted through depthwise separable convolution, and then enhanced with the Swish activation function to improve the nonlinear expression. This applies to the features of the high-frequency subbands at layers 1, 2, and 3. By using 1×1 convolution and upsampling / downsampling operations, features are unified to the same scale, resulting in a multi-scale unified feature set. Calculate the similarity matrix between uniform features at different scales to quantify the information association between features: ,in For unified feature maps at different scales, For the feature similarity matrix, Using the L2 norm, multi-scale features are weighted and fused based on the similarity matrix to enhance cross-scale information interaction: ,in For adaptive fusion weights ⊙ represents element-wise multiplication; it combines features. Channel attention and spatial attention weighting are performed sequentially. First, channel attention weighting is performed, and the spatial dimension is compressed through global average pooling. Then, the channel weights are learned through a fully connected layer. ,in For global average pooling It is a fully connected layer. To determine the channel attention weights, a spatial attention mechanism is introduced, which weights the spatial dimension by compressing the channel dimension through convolution operations and then activating it with a sigmoid function to obtain the spatial weights. ,in Spatial attention weights, For average pooling, For max pooling, Feature concatenation; channel weights Spatial weights The final attention weights are obtained by multiplying element by element, and the coefficients of the high-frequency subbands of each layer are weighted. Finally, the inverse wavelet transform is performed on the weighted high-frequency subbands and low-frequency subbands to obtain the denoised Lab image.

[0045] To achieve quantitative identification of color differences, the pre-processed actual color parameters are compared with the standard parameters corresponding to the standard process. The acquired actual color parameters are compared with the standard color parameters separately, and a preset standard threshold is used for comparison. If the comparison exceeds the standard threshold range, a color difference defect is determined to exist. Specifically, the color saturation values ​​of the actual color parameters and the standard color parameters are first compared... With color angle The samples are compared. If both meet the set threshold, they are considered to be initially qualified; otherwise, they are considered to have color difference defects. After the initial qualification, a second round of judgment is performed. The mean deviation of colorimetry and the center deviation of colorimetry between the actual sample and the standard sample are calculated respectively. Then, the deviation factor is obtained. If the deviation factor is less than or equal to the set threshold, it is considered that there are no color difference defects; otherwise, it is considered that there are color difference defects.

[0046] The specific implementation of obtaining the deviation factor is based on actual samples within the target region. and standard samples Calculate the mean deviation for each channel separately. The mean deviation is calculated as follows: ,in, These are the width and height of the target area, respectively. include and The mean deviation of each channel is calculated using the above method. Further calculate the mean difference of each channel. , , Then, it is merged into a multi-channel chromaticity mean deviation. For both actual and standard samples, the chromaticity center variance of each channel is calculated. The calculation method for the chromaticity center variance is as follows: ;get Further calculate the mean variance of the chromaticity center for each channel. , , By integrating the actual and standard chromaticity center variances, the multi-channel chromaticity center deviation is obtained. ; Multi-channel chromaticity mean deviation and multi-channel chromaticity center deviation A deviation factor is obtained by comparing the values. In general, traditional color difference detection relies on single-channel color difference or simple Euclidean distance judgment, which cannot fully reflect the overall consistency of color distribution and visual perception differences, and is prone to misjudgment under changes in brightness or local shadows. This invention introduces a multi-dimensional analysis mechanism of lightness, saturation, and hue angle, and constructs a deviation factor by combining the ratio of multi-channel mean deviation to central variance, thus achieving a comprehensive measurement of color differences. This method not only considers the overall color shift but also reflects the concentration and stability of color distribution, making the judgment results more consistent with human visual perception. Through the design of a dual-layer judgment mechanism, a fine-grained review can be performed after initial detection, effectively avoiding misjudgments and omissions. Compared with traditional methods, this scheme maintains high robustness and consistency under different lighting conditions and fabric textures, significantly improving the accuracy and reliability of color difference recognition.

[0047] Finally, to fundamentally solve the problem of color difference, a particle swarm optimization algorithm is introduced to automatically adjust the dyeing and finishing process. For textiles with color difference defects, the particle swarm optimization algorithm is used to optimize the process parameters to minimize these defects. The basic idea is to search for the combination of process parameters that minimizes the color difference deviation factor as the objective function. With minimizing the deviation factor as the objective, the number of particles is set, and each particle corresponds to a set of process parameter combinations. Within the value range of each process parameter, uniform random sampling is used to generate the initial position of each particle. Particle swarm optimization iteratively updates the velocity and position of the particles. Iteration stops when the number of iterations reaches a preset maximum value. At this point, the process parameter combination corresponding to the globally optimal position is the process parameter that minimizes the color difference defect. Specifically, in the algorithm initialization phase, the number of particles is set, and each particle represents a possible combination of process parameters. The system generates the initial position of each particle through uniform random sampling within each parameter range and assigns it a random initial velocity. Subsequently, based on the color difference detection results under the current parameter combination, the corresponding deviation factor value is calculated. This value serves as the objective function of the particle, and its reciprocal serves as the fitness function, used to measure the quality of the parameter combination. During the iteration process, each particle updates its velocity and position based on its own historical best position (individual best) and the swarm's historical best position (global best), gradually approaching the global optimal solution. An inertia weight factor and a learning factor are introduced during velocity updates to balance global exploration and local convergence capabilities, preventing the algorithm from getting trapped in local optima. After each iteration, the system recalculates the deviation factor for all particles. If the global optimal value continues to decrease, it indicates that the combination of process parameters is approaching an ideal state. When the number of iterations reaches a preset maximum or the global optimal value stabilizes, the algorithm stops iterating. At this point, the parameter combination corresponding to the position of the particle with the highest fitness in the particle swarm is the optimal process parameter. This parameter is automatically fed back to the production control module for adjusting the dyeing and finishing process. Through this mechanism, the optimal dyeing conditions can be adaptively sought to minimize color difference defects.

[0048] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments for application in other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A method for identifying color differences in textiles for optimizing processes, characterized in that, Includes the following steps: S1. Textile sample collection: Select the target area of ​​the textile to be tested, and collect the physical sample image of the target area under preset uniform collection conditions; at the same time, obtain the standard color parameters obtained by the standard process corresponding to the textile. S2. Preprocess the collected textile sample images to remove image noise and extract the actual color parameters of the physical sample images from the target area. S3. Compare the actual color parameters obtained with the standard color parameters respectively, and compare them according to the preset standard threshold. If the comparison exceeds the standard threshold range, it is determined that there is a color difference defect. S4. For textiles with color difference defects, the particle swarm optimization algorithm is used to optimize and adjust the process parameters to minimize the color difference defects. The actual color parameters and standard color parameters are obtained by using the CIELab internationally recognized color space parameters, including lightness values. Red-green deviation value Yellow-blue deviation value ; Calculate color saturation values ​​based on color space parameters With color angle and the deviation coefficient, where, , Select the arithmetic mean of the corresponding parameters of no less than 30 standard samples from the same batch as the standard color parameters; In step S1, the target area is the fabric area that avoids edges and wrinkles. After selecting the target area, it is necessary to determine whether the target area meets the requirements. This is specifically implemented by: S11. Use the MobileNetV2 network to perform semantic analysis on the initial target region image to obtain the mask of the target region image; if there is a region with a mask of 0, it indicates that it is an edge region; S12. Based on the determination that it is a non-edge region, convert the original image to a grayscale image using weighted grayscale. And divide the grayscale image into Non-overlapping local blocks, denoted as a single local block. ; S13, Calculate each Gray variance: ,in For the k-th local image patch The average gray level, Let be the gray value of the grayscale image at pixel coordinates (i,j); S14, Calculation Gradient direction consistency coefficient: ,in The full-image horizontal and vertical gradients are based on the Sobel operator; if three consecutive adjacent blocks satisfy the gray-level variance... Greater than the preset threshold and Based on the high concentration of gradient direction and grayscale changes, it was determined that there were folds in this area; S15. If it is determined to be a non-edge area and there are no wrinkles, it is judged as a qualified target area.

2. The textile color difference identification method for optimizing processes according to claim 1, characterized in that, The specific implementation of preprocessing the acquired textile sample image in step S2 to remove image noise and extract the actual color parameters of the physical sample image from the target area includes: S21. Convert the collected textile sample images to the CIE Lab color space, and separate the lightness channel, red-green color channel, and yellow-blue color channel; perform wavelet decomposition on each of the three channels to obtain the high-frequency sub-band and low-frequency sub-band of each channel. The mathematical expression of wavelet decomposition is as follows: ,in, For the first Low-frequency subband coefficient of layer, For the first High-frequency subband coefficient of the layer, These are the coefficients of the low-pass filter. Here are the high-pass filter coefficients, and r is the number of decomposition layers, r = 1, 2, 3. This represents the downsampling result of the low-frequency subband coefficients of the (r-1)th layer. This represents the downsampling result of the high-frequency subband coefficients of the (r-1)th layer; S22. Construct a lightweight CNN attention module. For each high-frequency subband, extract features through depthwise separable convolution, and then enhance the non-linear representation using the Swish activation function. This applies to the features of the high-frequency subbands in layers 1, 2, and 3. By using 1×1 convolution and upsampling / downsampling operations, features are unified to the same scale, resulting in a multi-scale unified feature set. ; S23. Calculate the similarity matrix between uniform features at different scales to quantify the information association between features: ,in For unified feature maps at different scales, For the feature similarity matrix, Using the L2 norm, multi-scale features are weighted and fused based on the similarity matrix to enhance cross-scale information interaction: ,in For adaptive fusion weights, , ⊙ represents element-wise multiplication; S24, Integrating Features Channel attention and spatial attention weighting are performed sequentially. First, channel attention weighting is performed, and the spatial dimension is compressed through global average pooling. Then, the channel weights are learned through a fully connected layer. ,in For global average pooling It is a fully connected layer. Channel attention weights; A spatial attention mechanism is introduced to weight the spatial dimensions. The channel dimensions are compressed through convolution operations, and then the spatial weights are obtained through sigmoid activation. ,in Spatial attention weights, For average pooling, For max pooling, For feature splicing; S25, Adjust channel weights Spatial weights Element-wise multiplication yields the final attention weights, which are then weighted for the high-frequency subband coefficients of each layer. S26. Perform inverse wavelet transform on the weighted high-frequency subband and low-frequency subband to obtain the denoised Lab image.

3. The textile color difference identification method for optimizing processes according to claim 1, characterized in that, In step S3, the actual color parameters are compared with the standard color parameters. The comparison is based on a preset standard threshold. If the comparison exceeds the standard threshold range, it is determined that a color difference defect exists. Specifically, this is achieved by first comparing the color saturation values ​​of the actual color parameters and the standard color parameters. With color angle The samples are compared. If both meet the set threshold, they are considered to be initially qualified; otherwise, they are considered to have color difference defects. After the initial qualification, a second round of judgment is performed. The mean deviation of colorimetry and the center deviation of colorimetry between the actual sample and the standard sample are calculated respectively. Then, the deviation factor is obtained. If the deviation factor is less than or equal to the set threshold, it is considered that there are no color difference defects; otherwise, it is considered that there are color difference defects.

4. The textile color difference identification method for optimizing processes according to claim 3, characterized in that, The mean chromaticity deviation and the center chromaticity deviation of the actual sample and the standard sample are calculated respectively, and then the specific implementation of the deviation factor is obtained as follows: S31. For the actual samples within the target area. and standard samples Calculate the mean deviation for each channel separately. The mean deviation is calculated as follows: ,in, These are the width and height of the target area, respectively. include and The mean deviation of each channel is calculated using the above method. ; S32. Further calculate the mean difference of each channel. , , Then, it is merged into a multi-channel chromaticity mean deviation. ; S33. For both the actual sample and the standard sample, calculate the chromaticity center variance for each channel. The calculation method for the chromaticity center variance is as follows: ;get ; S34. Further calculate the mean variance of the chromaticity center of each channel. , , By integrating the actual and standard chromaticity center variances, the multi-channel chromaticity center deviation is obtained. ; S35, Multi-channel chromaticity mean deviation and multi-channel chromaticity center deviation The deviation factor is obtained by comparing the values.

5. The textile color difference identification method for optimizing processes according to claim 1, characterized in that, In step S4, the particle swarm optimization algorithm is used to optimize the process of textiles with color difference defects to obtain the process parameters that minimize the color difference defects. Specifically, with the goal of minimizing the deviation factor, the number of particles is set, and each particle corresponds to a set of process parameter combinations. Within the value range of each process parameter, the initial position of each particle is generated by uniform random sampling. Particle swarm optimization is performed iteratively to update the velocity and position of the particles. When the number of iterations reaches the preset maximum value, the iteration stops. At this time, the process parameter combination corresponding to the globally optimal position is the process parameter that minimizes the color difference defects.

Citation Information

Patent Citations

  • Textile color difference detection method based on artificial intelligence

    CN117095067A

  • Textile color deviation detection method

    CN119515776A