Printed fabric pattern quality monitoring method based on multiple models
Through multi-model fusion technology, including multi-spectral cameras, GAN, Swin Transformer, dynamic convolution and One-Class SVM, the error and missed detection of quality detection of complex textures and rich details of printed fabrics is solved, and high-precision and efficient quality monitoring of printed fabrics is achieved.
Patent Information
- Application Number
- CN202510169887.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-17
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2045-02-17
AI Technical Summary
Existing visual inspection technologies have problems of mis-checking and missed inspection when dealing with subtle differences, complex textures and high-density overlapping areas of printed fabrics, which is difficult to meet the needs of high-standard quality control.
Multi-model methods are adopted, including multi-spectral cameras to acquire images, generate adversarial networks (GANs) to enhance image quality, image segmentation model combined with Swin Transformer and dynamic convolution, and flower pattern detection model built by One-Class SVM to achieve accurate segmentation, feature extraction and quality detection of printed fabrics.
Through multi-model fusion, accurate segmentation and feature extraction of printed fabrics are achieved, which significantly improves the accuracy and efficiency of quality detection, and can better identify complex textures and rich details of printed fabric patterns.
Smart Images

Figure CN119648699B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of visual detection, and in particular to a printed cloth pattern quality monitoring method based on multiple models. Background Art
[0002] In modern textile production, printed fabrics are widely used in clothing, home decoration and other fields with their colorful patterns and diverse designs. However, the stability and consistency of printed fabric quality are crucial for both manufacturers and consumers. Therefore, how to effectively monitor the quality of printed fabric patterns has become a key challenge in the textile industry.
[0003] Traditional quality monitoring methods mainly rely on manual observation and detection, which is not only time-consuming and laborious, but also easily affected by human subjective factors, resulting in false detection and missed detection. With the rapid development of computer vision and artificial intelligence technology, automated and intelligent quality monitoring methods have emerged, providing a fast and efficient solution.
[0004] Although existing visual inspection technology has made great progress in image recognition resolution and detail extraction, it is still difficult to handle subtle differences, complex textures and high-density overlapping areas. This is especially true when it comes to printed fabrics that are very similar or have complex designs, which makes the system prone to false detection or missed detection, and cannot meet high-standard quality control requirements. Summary of the invention
[0005] In order to solve the above problems, the purpose of the present invention is to provide a printed cloth pattern quality monitoring method based on multiple models, which can realize accurate segmentation and feature extraction of printed cloth on the basis of ensuring the quality of image input, and realize comprehensive quality detection by fusing multiple feature information.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] A method for monitoring the quality of printed fabric patterns based on multiple models comprises the following steps:
[0008] S1: Use a multispectral camera to collect images, obtain multispectral image data of printed cloth, and pre-process;
[0009] S2: Generative adversarial network (GAN) is introduced, and the generator in GAN is used to enhance the image quality, including denoising and detail enhancement, to improve the input quality of the image, as follows:
[0010] The GAN includes a generator and a discriminator, as follows:
[0011] The generator consists of an input layer, a residual block, and an output layer;
[0012] Input layer: accepts the preprocessed multispectral image as input x;
[0013] Residual block: used to maintain and process details and reduce overfitting;
[0014] Add skip connections between multiple layers of the generator to preserve low-level detail features;
[0015] Output layer: finally generates an enhanced single-band image or multi-band image;
[0016] Discriminator: It uses a multi-layer convolutional network to achieve downsampling through gradually reduced convolution operations, and finally outputs a judgment on the authenticity of the generated image;
[0017] Adversarial loss of the GAN :
[0018] ;
[0019] in, is the output probability of the discriminator D for the input being the true sample x, is the output probability of the discriminator D for generating the sample G(z); is the expected loss of the real data sample; is the expected loss for generating data samples;
[0020] Use mean squared error as content loss , ensuring that the basic structure of the generated image is consistent with the standard:
[0021] ;
[0022] in, is the expectation of the input-output pair (x, y); y is the real target image corresponding to the input data x; Represents the Euclidean norm of a vector; Generate samples corresponding to the input data x;
[0023] The total loss combines adversarial loss and content loss to balance image realism and detail fidelity:
[0024] ;
[0025] in, and is the loss weight;
[0026] S3: Combine Swin Transformer with dynamic convolution to build an image segmentation model, and based on the image segmentation model, accurately segment the printed cloth and extract each printed area;
[0027] S4: According to the segmented image data, the color, texture and pattern features of the print are obtained, and fusion features are constructed;
[0028] S5: Construct a printed fabric pattern detection model, identify abnormal patterns that do not meet quality requirements based on fusion features, and obtain the quality score of the printed fabric according to the detection results of the printed fabric pattern detection model.
[0029] Further, preprocessing is as follows:
[0030] Calibrate using a standard grayscale card of known reflectivity as a reference:
[0031]
[0032] Where I is the original image, is the grayscale card value of the shot, G ref It is the standard value of the grayscale card; is the calibrated data;
[0033] Adjust the gain of the red, green, and blue channels so that the response of the white area on the three channels tends to be consistent. The RGB value of the white reference is (R w ,G w ,B w ) ,but:
[0034] ;
[0035] Among them, R, G, and B are the red, green, and blue values of the original image respectively; , , are the red, green and blue values after calibration respectively;
[0036] Correct lens distortion using the radial distortion coefficient model:
[0037] ;
[0038] Where, (u, v) is the pixel coordinate before radial distortion correction; is the pixel coordinate after radial distortion correction; k 1 ,k 2 ,k 3 is the radial distortion coefficient; r is the distance from the pixel to the center of the image;
[0039] Tangential distortion correction corrects distortion caused by misalignment of the lens axis with the sensor:
[0040] ;
[0041] Among them, p1, p2 are tangential distortion coefficients; Final calibrated pixel coordinates;
[0042] The rectified coordinates are used for remapping to produce an undistorted image.
[0043] Furthermore, the image segmentation model includes an input layer, a Swin Transformer encoder, a dynamic convolution module, a decoder, and an output layer, as follows:
[0044] The input layer receives the denoised and detail-enhanced multispectral image as input, and the preliminary convolution is used to perform basic feature extraction and downsampling;
[0045] The Swin Transformer encoder provides global feature modeling capabilities from shallow to deep through a layered design. It divides the image into non-overlapping windows (patches), performs multi-head self-attention calculations on the input feature map at each layer, and processes it in combination with the offset window mechanism to obtain the initial feature map X.
[0046] The dynamic convolution module fine-tunes deep features through adaptive convolution layers, generates adaptive convolution kernels based on input, and generates convolution kernels as an input transformation, which is then applied to the feature map;
[0047] The decoder uses deconvolution to gradually recover details, uses information obtained from skip connections to support detail completion, and converts the previously encoded features into output segment graphs;
[0048] The output layer passes a 1x1 convolution layer through the reconstructed high-resolution feature map to obtain the category probability of each pixel, and uses the Softmax activation function to map the final output into a segmentation category probability map.
[0049] Furthermore, the Swin Transformer encoder includes a SW-MSA module and a multi-layer perceptron, as follows:
[0050] The SW-MSA module divides the input image into non-overlapping windows (patches) of the same size, each of which is flattened and linearly mapped to a high-dimensional feature space;
[0051] In the hierarchical representation of the image, the feature map is divided into multiple non-overlapping windows, and attention calculation is performed independently in each window. For each window, a multi-head self-attention mechanism is used to perform attention weighting on local features through matrix calculation of queries, keys, and values:
[0052]
[0053] Among them, Q, K, and V are the matrices of query, key, and value respectively; is the scaling factor;
[0054] The receptive field of feature representation is gradually increased through the hierarchical structure, so that information from local to global is gradually integrated during the encoding process. Between consecutive layers, the window division is offset to promote information exchange between windows.
[0055]
[0056] Among them, W-MSA represents the multi-head self-attention module of the offset window, LN is Layer Normalization, and MLP is the multi-layer perceptron structure; l It is l The multilayer perceptron performs nonlinear transformation on the output of the SW-MSA module and performs linear mapping.
[0057] Furthermore, the dynamic convolution module is as follows:
[0058] Extract the global information of the initial feature map X and use global pooling or downsampling convolution to reduce the dimension of the feature map;
[0059] Based on the initial feature map X, generate the convolution kernel W(x):
[0060] ;
[0061] in, W 1 ,W 2 is the weight matrix, b 1 ,b 2 is the bias, σ is the activation function; is a fully connected layer;
[0062] Use the generated convolution kernel W(x) to perform the convolution operation:
[0063]
[0064] Among them, Y is the output feature map, Represents the application of the convolution operation;
[0065] The activation function ReLU is applied to the output feature map Y, and regularization is performed to prevent overfitting. Finally, the regularized feature map Y′ is input into the subsequent network layer.
[0066] Furthermore, S4 is specifically:
[0067] Convert the segmented image to the HSV color space suitable for color analysis and convert the RGB value of each pixel:
[0068] Calculate the color histogram of each area to represent the color characteristics of the area;
[0069] Use Gabor filters to extract texture information and capture texture features of specific scales and directions:
[0070] Use Canny edge detection and contour detection to extract the shape features of the flower pattern;
[0071] The color, texture, and pattern features are concatenated into a global feature vector.
[0072] Furthermore, S5 is specifically:
[0073] Based on One-Class SVM, a printed cloth pattern detection model is constructed. , calculate its deviation , which is a measure of its distance from the hyperplane:
[0074]
[0075] in, is the weight vector, which is the parameter used to define the hyperplane in One-Class SVM; is the RBF kernel function; ρ is the bias term;
[0076] According to the quality score Q, the quality of the sample is reflected. The smaller the deviation, the higher the quality.
[0077]
[0078] Where α is the scaling parameter.
[0079] Furthermore, the printed cloth pattern detection model is built based on One-Class SVM, as follows:
[0080] Use RBF as the kernel function to enhance the nonlinear characteristics of the model:
[0081] ;
[0082] Among them, x i, x j are two data points in the input space; is the learning parameter; is the kernel function;
[0083] Train the One-Class SVM model to find the hyperplane that best represents the normal sample data. The goal is to pass (W c ,ρ) to maximize the distance from the origin:
[0084] ;
[0085] Where W c is the weight vector, is bias; is the slack variable; For the input comprehensive feature vectors, N is the total number of comprehensive feature vectors, ρ is the bias term of the hyperplane, is a hyperparameter.
[0086] The present invention has the following beneficial effects:
[0087] 1. The present invention realizes accurate segmentation and feature extraction of printed cloth on the basis of ensuring the quality of image input, and realizes comprehensive quality detection by integrating multiple feature information;
[0088] 2. The present invention can capture spectral information beyond the visible light range through a multispectral camera, thereby providing more comprehensive fabric feature details, making tiny color and texture differences more obvious, and facilitating accurate identification and analysis of printed patterns. The denoising function of the GAN generator can significantly reduce noise interference in the image, thereby improving the image clarity and detail retention capability.
[0089] 3. The present invention combines the long-range feature modeling capability of Swin Transformer with the flexible characteristics of dynamic convolution to adaptively process complex texture patterns, which helps to achieve significant improvement in segmentation accuracy at different detail levels, especially in complex textures and printed fabric patterns with multiple details. BRIEF DESCRIPTION OF THE DRAWINGS
[0090] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0091] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:
[0092] refer to Figure 1 In this embodiment, a method for monitoring the quality of printed fabric patterns based on multiple models is provided, comprising the following steps:
[0093] S1: Use a multispectral camera to collect images, obtain multispectral image data of printed cloth, and pre-process;
[0094] S2: Generative adversarial network (GAN) is introduced, and the generator in GAN is used to enhance the image quality, including denoising and detail enhancement, to improve the input quality of the image, as follows:
[0095] The GAN includes a generator and a discriminator, as follows:
[0096] The generator consists of an input layer, a residual block, and an output layer;
[0097] Input layer: accepts the preprocessed multispectral image as input x;
[0098] Residual block: used to maintain and process details and reduce overfitting;
[0099] Add skip connections between multiple layers of the generator to preserve low-level detail features;
[0100] Output layer: finally generates an enhanced single-band image or multi-band image;
[0101] Discriminator: It uses a multi-layer convolutional network to achieve downsampling through gradually reduced convolution operations, and finally outputs a judgment on the authenticity of the generated image;
[0102] Adversarial loss of the GAN :
[0103] ;
[0104] in, is the output probability of the discriminator D for the input being the true sample x, is the output probability of the discriminator D for generating the sample G(z); is the expected loss of the real data sample; is the expected loss for generating data samples;
[0105] Use mean squared error as content loss , ensuring that the basic structure of the generated image is consistent with the standard:
[0106] ;
[0107] in, is the expectation of the input-output pair (x, y); y is the real target image corresponding to the input data x; Represents the Euclidean norm of a vector; Generate samples corresponding to the input data x;
[0108] The total loss combines adversarial loss and content loss to balance image realism and detail fidelity:
[0109] ;
[0110] in, and is the loss weight;
[0111] S3: Combine Swin Transformer with dynamic convolution to build an image segmentation model to effectively deal with complex textures and printed areas with rich details; improve training efficiency through mixed precision training; and accurately segment printed cloth based on the image segmentation model to extract each printed area;
[0112] S4: According to the segmented image data, the color, texture and pattern features of the print are obtained, and fusion features are constructed;
[0113] S5: Construct a printed fabric pattern detection model, identify abnormal patterns that do not meet quality requirements based on fusion features, and obtain the quality score of the printed fabric according to the detection results of the printed fabric pattern detection model.
[0114] In this embodiment, the preprocessing is as follows:
[0115] Calibrate using a standard grayscale card of known reflectivity as a reference:
[0116]
[0117] Where I is the original image, is the grayscale card value of the shot, G ref It is the standard value of the grayscale card; is the calibrated data;
[0118] Adjust the gain of the red, green, and blue channels so that the response of the white area on the three channels tends to be consistent. The RGB value of the white reference is (R w ,G w ,B w ) ,but:
[0119] ;
[0120] Among them, R, G, and B are the red, green, and blue values of the original image respectively; , , are the red, green and blue values after calibration respectively;
[0121] Correct lens distortion using the radial distortion coefficient model:
[0122] ;
[0123] Where, (u, v) is the pixel coordinate before radial distortion correction; is the pixel coordinate after radial distortion correction; k 1 ,k 2 ,k 3 is the radial distortion coefficient; r is the distance from the pixel to the center of the image;
[0124] Tangential distortion correction corrects distortion caused by misalignment of the lens axis with the sensor:
[0125] ;
[0126] Among them, p1, p2 are tangential distortion coefficients; Final calibrated pixel coordinates;
[0127] The rectified coordinates are used for remapping to produce an undistorted image.
[0128] In this embodiment, the image segmentation model includes an input layer, a Swin Transformer encoder, a dynamic convolution module, a decoder, and an output layer, as follows:
[0129] The input layer receives the denoised and detail-enhanced multispectral image as input, and the preliminary convolution is used to perform basic feature extraction and downsampling;
[0130] The Swin Transformer encoder provides global feature modeling capabilities from shallow to deep through a layered design. It divides the image into non-overlapping windows (patches), performs multi-head self-attention calculations on the input feature map at each layer, and processes it in combination with the offset window mechanism to obtain the initial feature map X.
[0131] The dynamic convolution module fine-tunes deep features through adaptive convolution layers, generates adaptive convolution kernels based on input, and generates convolution kernels as an input transformation, which is then applied to the feature map;
[0132] The decoder uses deconvolution to gradually recover details, uses information obtained from skip connections to support detail completion, and converts the previously encoded features into output segment graphs;
[0133] The output layer passes a 1x1 convolution layer through the reconstructed high-resolution feature map to obtain the category probability of each pixel, and uses the Softmax activation function to map the final output into a segmentation category probability map.
[0134] In this embodiment, the Swin Transformer encoder includes a SW-MSA module and a multi-layer perceptron, as follows:
[0135] The SW-MSA module divides the input image into non-overlapping windows (patches) of the same size, each of which is flattened and linearly mapped to a high-dimensional feature space;
[0136] In the hierarchical representation of the image, the feature map is divided into multiple non-overlapping windows, and attention calculation is performed independently in each window. For each window, a multi-head self-attention mechanism is used to perform attention weighting on local features through matrix calculation of queries, keys, and values:
[0137]
[0138] Among them, Q, K, and V are the matrices of query, key, and value respectively; is the scaling factor;
[0139] The receptive field of feature representation is gradually increased through the hierarchical structure, so that information from local to global is gradually integrated during the encoding process. Between consecutive layers, the window division is offset to promote information exchange between windows.
[0140]
[0141] Among them, W-MSA represents the multi-head self-attention module of the offset window, LN is Layer Normalization, and MLP is the multi-layer perceptron structure; l It is l The multilayer perceptron performs nonlinear transformation on the output of the SW-MSA module and performs linear mapping.
[0142] In this embodiment, the dynamic convolution module is as follows:
[0143] Extract the global information of the initial feature map X and use global pooling or downsampling convolution to reduce the dimension of the feature map;
[0144] Based on the initial feature map X, generate the convolution kernel W(x):
[0145] ;
[0146] in, W 1 ,W 2 is the weight matrix, b 1 ,b 2 is the bias, σ is the activation function; is a fully connected layer;
[0147] Use the generated convolution kernel W(x) to perform the convolution operation:
[0148]
[0149] Among them, Y is the output feature map, Represents the application of the convolution operation;
[0150] The activation function ReLU is applied to the output feature map Y, and regularization is performed to prevent overfitting. Finally, the regularized feature map Y′ is input into the subsequent network layer.
[0151] In this embodiment, S4 is specifically:
[0152] Convert the segmented image to the HSV color space suitable for color analysis and convert the RGB value of each pixel:
[0153] Calculate the color histogram of each area to represent the color characteristics of the area;
[0154] Use Gabor filters to extract texture information and capture texture features of specific scales and directions:
[0155] Use Canny edge detection and contour detection to extract the shape features of the flower pattern;
[0156] The color, texture, and pattern features are concatenated into a global feature vector.
[0157] In this embodiment, S5 is specifically:
[0158] Based on One-Class SVM, a printed cloth pattern detection model is constructed. , calculate its deviation , which is a measure of its distance from the hyperplane:
[0159]
[0160] in, is the weight vector, which is the parameter used to define the hyperplane in One-Class SVM; is the RBF kernel function; ρ is the bias term;
[0161] According to the quality score Q, the quality of the sample is reflected. The smaller the deviation, the higher the quality.
[0162]
[0163] Where α is the scaling parameter.
[0164] In this embodiment, the printed cloth pattern detection model is constructed based on One-Class SVM, as follows:
[0165] Use RBF as the kernel function to enhance the nonlinear characteristics of the model:
[0166] ;
[0167] Among them, x i, x j are two data points in the input space; is the learning parameter; is the kernel function;
[0168] Train the One-Class SVM model to find the hyperplane that best represents the normal sample data. The goal is to pass (W c ,ρ) to maximize the distance from the origin:
[0169] ;
[0170] Where W c is the weight vector, is bias; is the slack variable; For the input comprehensive feature vectors, N is the total number of comprehensive feature vectors, ρ is the bias term of the hyperplane, is a hyperparameter.
[0171] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0172] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1A device that provides the functions specified in a block or multiple blocks.
[0173] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0174] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0175] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.
Claims
1. A method for monitoring the quality of printed fabric patterns based on multiple models, characterized in that: The following steps are involved: S1: Use a multispectral camera to collect images, obtain multispectral image data of printed cloth, and pre-process; S2: Generative adversarial network (GAN) is introduced, and the generator in GAN is used to enhance the image quality, including denoising and detail enhancement, to improve the input quality of the image, as follows: The GAN includes a generator and a discriminator, as follows: The generator consists of an input layer, a residual block, and an output layer; Input layer: accepts the preprocessed multispectral image as input x; Residual block: used to maintain and process details and reduce overfitting; Add skip connections between multiple layers of the generator to preserve low-level detail features; Output layer: finally generates an enhanced single-band image or multi-band image; Discriminator: It uses a multi-layer convolutional network to achieve downsampling through gradually reduced convolution operations, and finally outputs a judgment on the authenticity of the generated image; Adversarial loss of the GAN : ; in, is the output probability of the discriminator D for the input being the true sample x, is the output probability of the discriminator D for generating the sample G(z); is the expected loss of the real data sample; is the expected loss for generating data samples; Use mean squared error as content loss , ensuring that the basic structure of the generated image is consistent with the standard: ; in, is the expectation of the input-output pair (x, y); y is the real target image corresponding to the input data x; Represents the Euclidean norm of a vector; Generate samples corresponding to the input data x; The total loss combines adversarial loss and content loss to balance image realism and detail fidelity: ; in, and is the loss weight; S3: Combine Swin Transformer with dynamic convolution to build an image segmentation model, and based on the image segmentation model, accurately segment the printed cloth and extract each printed area; S4: According to the segmented image data, the color, texture and pattern features of the print are obtained, and fusion features are constructed; S5: constructing a printed cloth pattern detection model, identifying abnormal patterns that do not meet quality requirements based on fusion features, and obtaining a quality score for the printed cloth according to the detection results of the printed cloth pattern detection model; The S5 is specifically: Based on One-Class SVM, a printed cloth pattern detection model is constructed. , calculate its deviation , which is a measure of its distance from the hyperplane: ; in, is the weight vector, which is the parameter used to define the hyperplane in One-Class SVM; is the RBF kernel function; ρ is the bias term; According to the quality score Q, the quality of the sample is reflected. The smaller the deviation, the higher the quality. ; Where α is the scaling parameter.
2. The method for monitoring the quality of printed cloth patterns based on multiple models according to claim 1, characterized in that: The preprocessing is specifically as follows: Calibrate using a standard grayscale card of known reflectivity as a reference: ; Where I is the original image, is the grayscale card value of the shot, G ref It is the standard value of the grayscale card; is the calibrated data; Adjust the gain of the red, green, and blue channels so that the response of the white area on the three channels tends to be consistent. The RGB value of the white reference is (R w ,G w ,B w ) ,but: ; Among them, R, G, and B are the red, green, and blue values of the original image respectively; , , are the red, green and blue values after calibration respectively; Correct lens distortion using the radial distortion coefficient model: ; Where, (u, v) is the pixel coordinate before radial distortion correction; is the pixel coordinate after radial distortion correction; k 1 ,k 2 ,k 3 is the radial distortion coefficient; r is the distance from the pixel to the center of the image; Tangential distortion correction corrects distortion caused by misalignment of the lens axis with the sensor: ; Among them, p1, p2 are tangential distortion coefficients; Final calibrated pixel coordinates; The rectified coordinates are used for remapping to produce an undistorted image.
3. The method for monitoring the quality of printed cloth patterns based on multiple models according to claim 1, characterized in that: The image segmentation model includes an input layer, a Swin Transformer encoder, a dynamic convolution module, a decoder and an output layer, as follows: The input layer receives the denoised and detail-enhanced multispectral image as input, and the preliminary convolution is used to perform basic feature extraction and downsampling; The Swin Transformer encoder provides global feature modeling capabilities from shallow to deep through a layered design. It divides the image into non-overlapping window patches, performs multi-head self-attention calculations on the input feature map at each layer, and processes it in combination with the offset window mechanism to obtain the initial feature map X. The dynamic convolution module fine-tunes deep features through adaptive convolution layers, generates adaptive convolution kernels based on input, and generates convolution kernels as an input transformation, which is then applied to the feature map; The decoder uses deconvolution to gradually recover details, uses information obtained from skip connections to support detail completion, and converts the previously encoded features into output segment graphs; The output layer passes a 1x1 convolution layer through the reconstructed high-resolution feature map to obtain the category probability of each pixel, and uses the Softmax activation function to map the final output into a segmentation category probability map.
4. The method for monitoring the quality of printed cloth patterns based on multiple models according to claim 3, characterized in that: The Swin Transformer encoder includes a SW-MSA module and a multi-layer perceptron, as follows: The SW-MSA module divides the input image into non-overlapping window patches of the same size, each of which is flattened and linearly mapped to a high-dimensional feature space; In the hierarchical representation of the image, the feature map is divided into multiple non-overlapping windows, and attention calculation is performed independently in each window. For each window, a multi-head self-attention mechanism is used to perform attention weighting on local features through matrix calculation of queries, keys, and values: ; Among them, Q, K, and V are the matrices of query, key, and value respectively; is the scaling factor; The receptive field of feature representation is gradually increased through the hierarchical structure, so that information from local to global is gradually integrated during the encoding process. Between consecutive layers, the window division is offset to promote information exchange between windows. Among them, W-MSA represents the multi-head self-attention module of the offset window, LN is Layer Normalization, and MLP is the multi-layer perceptron structure; l It is l The multilayer perceptron performs nonlinear transformation on the output of the SW-MSA module and performs linear mapping.
5. The method for monitoring the quality of printed fabric patterns based on multiple models according to claim 3, characterized in that: The dynamic convolution module is specifically as follows: Extract the global information of the initial feature map X and use global pooling or downsampling convolution to reduce the dimension of the feature map; Based on the initial feature map X, generate the convolution kernel W(x): ; in, W 1 ,W 2 is the weight matrix, b 1 ,b 2 is the bias, σ is the activation function; Flatten(.) is the fully connected layer; Use the generated convolution kernel W(x) to perform the convolution operation: ; Among them, Y is the output feature map, Represents the application of the convolution operation; The activation function ReLU is applied to the output feature map Y, and regularization is performed to prevent overfitting. Finally, the regularized feature map Y′ is input into the subsequent network layer.
6. The method for monitoring the quality of printed cloth patterns based on multiple models according to claim 1, characterized in that: The S4 is specifically: Convert the segmented image to the HSV color space suitable for color analysis and convert the RGB value of each pixel: Calculate the color histogram of each area to represent the color characteristics of the area; Use Gabor filters to extract texture information and capture texture features of specific scales and directions: Use Canny edge detection and contour detection to extract the shape features of the flower pattern; The color, texture, and pattern features are concatenated into a global feature vector.
7. The method for monitoring the quality of printed cloth patterns based on multiple models according to claim 1, characterized in that: The printed cloth pattern detection model is built based on One-Class SVM, as follows: Use RBF as the kernel function to enhance the nonlinear characteristics of the model: ; Among them, x i, x j are two data points in the input space; is the learning parameter; is the kernel function; Train the One-Class SVM model to find the hyperplane that best represents the normal sample data. The goal is to pass (W c ,ρ) to maximize the distance from the origin: ; Where W c is the weight vector, is bias; is the slack variable; For the input comprehensive feature vectors, N is the total number of comprehensive feature vectors, ρ is the bias term, It is a super parameter.
Citation Information
Patent Citations
Digital printing online defect detection system and implementation method thereof
CN111127383A
Ceramic watermark carrier recovery method based on deep neural network
CN113284037A