A texture fabric defect detection method and medium based on an unsupervised mode

Through the unsupervised pattern of textured fabric defect detection method, the defect marking diagram is generated using image chunking and feature descriptors, which solves the problems of low automation and strong subjectivity of artificial visual detection, and achieves efficient and objective fabric defect detection.

CN115937075BActive Publication Date: 2025-08-05SOUTH CHINA UNIV OF TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210973848.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-15
Publication Date
2025-08-05
Estimated Expiration
2042-08-15

AI Technical Summary

Technical Problem

In the prior art, fabric defect detection relies on artificial vision, has low degree of automation and the detection results are affected by subjective factors, resulting in false detection and missed inspection, making it difficult to achieve efficient and objective fabric quality control.

Method used

The textured fabric defect detection method is adopted in an unsupervised mode. By equally chunking images, calculating texture background feature descriptors, generating chunking weight maps and significance maps, combined with bilateral filtering technology, defect marking maps are generated to improve detection accuracy.

Benefits of technology

The detection rate of fabric defect detection and the quantity and quality of defect sample library are improved, and automated and objective fabric defect detection is realized, which is suitable for different application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115937075B_ABST
    Figure CN115937075B_ABST
Patent Text Reader

Abstract

The present invention discloses a texture fabric defect detection method and medium based on an unsupervised model, comprising: equally dividing an input image into blocks to obtain a plurality of sub-images of equal size; using blocks at the edges of the sub-images as a set of texture background regions to be selected, obtaining a set of feature vectors of the selected texture background regions; removing outliers in the geometry of the selected texture background regions, using the remaining regions as texture backgrounds, and calculating texture background feature descriptors; traversing all blocks of the image and generating a block weight map based on the degree of deviation from the texture background; performing bilateral filtering on the input image to obtain a multi-channel center-surround mechanism saliency map; fusing the block weight map with the saliency map to generate a defect labeling map, thereby completing texture fabric defect detection. The present invention aims to improve the defect detection rate during the fabric defect detection process, and at the same time, improve the quantity and quality of the fabric defect sample library during the detection process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine vision, and in particular to a textured fabric defect detection method and medium based on an unsupervised mode. Background Art

[0002] For a long time, fabric defect detection has relied on manual vision. This method has numerous drawbacks. First, its level of automation is extremely low, with manual inspection speeds typically hovering around 20 meters per minute. Second, manual visual inspection is not an objective and consistent evaluation method. Its results are influenced by subjective factors such as worker fatigue and stress, often leading to false positives and missed inspections.

[0003] Fabric quality control is the most important and fundamental issue faced by fabric manufacturers. It is very important for reducing costs and gaining an advantage in international market competition. The use of unsupervised detection mode can realize automatic texture fabric defect detection in different application scenarios and improve the final quality of the product. Summary of the Invention

[0004] In order to overcome the above-mentioned shortcomings and deficiencies of the prior art, the purpose of the present invention is to provide a texture fabric defect detection method and medium based on an unsupervised model, which can improve the detection rate of defects in the fabric defect detection process and at the same time improve the quantity and quality of the fabric defect sample library during the detection process.

[0005] The purpose of the present invention is achieved through the following technical solutions:

[0006] A textured fabric defect detection method based on an unsupervised model, comprising:

[0007] Divide the input image into equal blocks to obtain multiple sub-images of equal size;

[0008] The blocks located at the edge of the sub-image are used as a set of texture and background regions to be selected, and a set of feature vectors of the texture and background regions to be selected is obtained;

[0009] Remove outliers in the geometry of the texture background area to be selected, use the remaining area as the texture background, and calculate the texture background feature descriptor;

[0010] Traverse all blocks of the image and generate a block weight map based on the degree of deviation from the texture background;

[0011] Perform bilateral filtering on the input image to obtain a multi-channel center-surround mechanism saliency map;

[0012] The block weight map is fused with the saliency map to generate a defect labeling map to complete texture fabric defect detection.

[0013] Furthermore, the input image is divided into equal blocks, specifically:

[0014] The input image is cut into rectangles of a certain proportion without loss or overlap to obtain multiple sub-images, and then the sub-images are sorted according to the Z-shaped sorting method.

[0015] Furthermore, the blocks located at the edge of the sub-image as a set of texture background areas to be selected further include the following steps:

[0016] The gray-level co-occurrence matrix of the sub-image is obtained, and the entropy and contrast features are further obtained. The above features of the two gray-level co-occurrence matrices are combined into a two-dimensional feature vector as the feature vector of the sub-image.

[0017] Furthermore, the outliers in the geometry of the texture background area to be selected are removed, and the remaining area is used as the texture background to calculate the texture background feature descriptor, specifically:

[0018] The two maximum vector points are set as initial clustering points, and the extracted two-dimensional feature vectors are divided into two categories by the k-means unsupervised clustering method. The feature clusters with fewer samples are removed, and the vector mean Fmean of the remaining feature clusters is used as the texture background descriptor.

[0019] Furthermore, the method traverses all blocks of the image and generates a block weight map according to the degree of deviation from the texture background, specifically:

[0020] The block weight map is generated based on the Euclidean distance between the feature vector of each block and the texture background descriptor as the weight value.

[0021] Furthermore, the block weight map is generated based on the Euclidean distance between the feature vector of each block and the texture background descriptor as a weight value, specifically:

[0022] Set a threshold. If the Euclidean distance between the feature vector of the current traversed sub-image and the descriptor Fmean is less than the threshold, the current block is regarded as the background area, and the pixel value of this area is set to 0 in the weight map. If the Euclidean distance is greater than the threshold, the calculated Euclidean distance is used as the weight value of the block, and the weight value is mapped to the pixel value of the block weight map.

[0023] Furthermore, the input image is subjected to bilateral filtering to obtain a multi-channel center-surround mechanism saliency map, specifically:

[0024] The color space of the bilaterally filtered image is converted from RGB color space to CIE-Lab color space, and the mean of the L, a, and b channels is calculated respectively. The Euclidean distance between the values of all pixels in the corresponding channel and the mean is mapped to the pixel values at the corresponding position of the saliency image to obtain a multi-channel center-surround mechanism saliency map.

[0025] Furthermore, the threshold is calculated based on the texture background descriptor in the following manner:

[0026]

[0027] Among them, e is the adaptive threshold, max, min, and mean are the maximum, minimum, and mean values of the texture background descriptor, respectively.

[0028] Furthermore, the block weight map and the saliency map are fused in a 1:1 ratio.

[0029] A storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the textured fabric defect detection method.

[0030] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0031] The present invention aims to improve the performance of fabric defect detection. For different application scenarios of detection and processing tasks,

[0032] The present invention can be operated in an unsupervised mode, has wide applicability, and possesses adaptive processing capabilities.

[0033] The present invention aims to improve the defect detection rate in the process of fabric defect detection and, at the same time, improve the quantity and quality of the fabric defect sample library during the detection process. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a flow chart of a texture fabric defect detection method based on an unsupervised mode according to the present invention;

[0035] Figure 2 is a flow chart of generating a texture background descriptor in an embodiment of the present invention;

[0036] Figure 3 This is a flow chart of removing non-background clusters using k-means clustering in an embodiment of the present invention;

[0037] Figure 4 It is a positional relationship diagram of two pixels in the gray-level co-occurrence matrix principle. DETAILED DESCRIPTION

[0038] The present invention will be further described in detail below with reference to the examples, but the embodiments of the present invention are not limited thereto.

[0039] like Figure 1 As shown, a texture fabric defect detection method based on an unsupervised model includes the following steps:

[0040] Step 1: Obtain the image block weight map, specifically:

[0041] The input image is divided into a certain number of equal blocks, and the input image is cut out losslessly and without overlap according to a rectangle with a certain proportion relative to the input image, and divided into a series of sub-images of equal size.

[0042] For example: divide the 8x8 image into 64 small images, each small image is a rectangle, and then sort the multiple sub-images according to the Z-shaped sorting method.

[0043] The blocks located at the edge of the sub-image are used as a set of texture and background regions to be selected, and a set of feature vectors of the texture and background regions to be selected is obtained.

[0044] Specifically, the blocks at the edge of the rectangular sub-image are used as the set of texture background areas to be selected, and the entropy (Entropv) and contrast (Contrast) features of the gray-level co-occurrence matrix are obtained for the images in the set. The two gray-level co-occurrence matrix features are combined into a two-dimensional feature vector F n ={Ent, Con}, as the feature description operator of the sub-image, further obtain the feature vector set of the texture background area to be selected.

[0045] like Figure 2 As shown, the rectangular blocks numbered 1, 4, 5, 8, 25, 32, 33, 40, 57, 59, 60 and 64 are edge pixels.

[0046] The gray level co-occurrence matrix principle, the position relationship between two pixels is as follows Figure 4 shown.

[0047] A grayscale image with a size of Ly×Lx and an eight-bit number has 256 levels, so the corresponding gray-level co-occurrence matrix size is 256×256.

[0048] Use ordered real number pairs (m, n), (m, n = 0, 1, 2, ..., 255) to represent the grayscale values of two points. Let the coordinates of the reference point be (x0, y0) and the coordinates of the other point be (x1, y1). Then the statistical result N when θ = 0° is θ,d (m, n) can be expressed as the following formula. In this invention, a gray-level co-occurrence matrix with θ=0° and d=1 is used.

[0049] N 0°,d (m, n)=#{((x0, y0), (x1, y1))∈(L y ×L x )×(L y ×L x )|

[0050] y0-y1=0, |x0-x1|=d,

[0051] I(x0, y0)=m, I(x1, y1)=n}

[0052] P θ,d (m, n) can represent the probability of the combination appearing in direction θ and distance d:

[0053]

[0054] N θ,d (m, n) is the number of occurrences of grayscale pairs with ordered pair values (m, n), (m, n = 0, 1, 2, ..., 255), and N is the total number of grayscale pairs.

[0055] Then the 256-order gray-level co-occurrence matrix P θ,d It can be expressed as:

[0056]

[0057] Feature calculation based on gray-level co-occurrence matrix:

[0058] Entropy:

[0059]

[0060] Contrast:

[0061]

[0062] Get the feature set F of the texture background area to be selected = {F1, F2, F3, ... F n}.

[0063] Remove outliers in the geometry of the candidate texture background area, use the remaining area as the texture background, and calculate the texture background feature descriptor.

[0064] Specifically:

[0065] like Figure 3 As shown in the figure, outliers in the feature set of the selected texture background area are removed, and the image blocks corresponding to the remaining vectors are regarded as texture background. The two maximum vector points are set as initial clustering points, and the extracted two-dimensional feature vectors are divided into two categories by the k-means unsupervised clustering method. The feature clusters with fewer samples are removed, and the vector mean F of the remaining feature clusters is calculated. mean As a texture background descriptor.

[0066] Traverse all blocks of the image and generate a block weight map based on the degree of deviation from the texture background;

[0067] Specifically: a threshold is set, and the threshold is calculated based on the texture background descriptor described above, and the calculation method is:

[0068]

[0069] e is the adaptive threshold, max, min, and mean are the maximum, minimum, and mean values of the texture background descriptor, respectively.

[0070] Traverse all blocks of the input image and calculate the corresponding gray-level co-occurrence matrix eigenvector F n The Euclidean distance to the texture background descriptor Fmean is used as the weight value to generate the block weight map. If the Euclidean distance between the feature vector of the current traversed sub-image and the descriptor Fmean is less than the threshold, the current block is considered as the background area, and the pixel values of this area in the weight map are set to 0. If the Euclidean distance is greater than the threshold, the calculated Euclidean distance is used as the weight value of the block, and the weight value is mapped to the pixel value of the block weight map.

[0071] Step 2: Obtain a multi-channel saliency map: Perform bilateral filtering on the input image and generate a saliency map based on the center-surround mechanism.

[0072] The input image is subjected to bilateral filtering to remove noise and retain edge features. Bilateral filtering is a nonlinear filter that can achieve the effect of maintaining edges, reducing noise and smoothing. After bilateral filtering, the texture background of the image is suppressed, while information such as the edges of defects can be retained.

[0073] A saliency map is obtained for the bilaterally filtered image. The color space of the bilaterally filtered image is converted from RGB color space to CIE-Lab color space. The mean of the entire image is calculated in the L, a, and b channel images respectively. The Euclidean distance between the values of all pixels in the corresponding channel and the mean is mapped to the pixel values at the corresponding position in the saliency image.

[0074] Step 3: The block weight map is fused with the saliency map to generate a defect marker map to complete the texture fabric defect detection.

[0075] Specifically: the block weight map and the saliency map are fused to generate a defect labeling map, and the block weight map and the saliency map generated above are fused in a 1:1 ratio through a linear fusion method to generate a defect labeling map with pixel-level defect description.

[0076] Embodiments of the present invention also provide a computer-readable storage medium. Based on Embodiment 1, the computer-readable storage medium stores computer-executable instructions for causing a computer to execute an unsupervised textured fabric defect detection method according to some embodiments of the present invention. This computer-readable storage medium according to embodiments of the present invention can improve the performance of fabric defect detection and is applicable to detection in various scenarios. This invention can operate in an unsupervised manner, has broad applicability, and possesses adaptive processing capabilities.

[0077] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be considered as equivalent replacement methods and are included in the scope of protection of the present invention.

Claims

1. A texture fabric defect detection method based on an unsupervised model, characterized in that: include: Divide the input image into equal blocks to obtain multiple sub-images of equal size; The blocks located at the edge of the sub-image are used as a set of texture and background regions to be selected, and a set of feature vectors of the texture and background regions to be selected is obtained; Remove outliers in the geometry of the texture background area to be selected, use the remaining area as the texture background, and calculate the texture background feature descriptor; Traverse all blocks of the image and generate a block weight map based on the degree of deviation from the texture background; Perform bilateral filtering on the input image to obtain a multi-channel center-surround mechanism saliency map; The block weight map is fused with the saliency map to generate a defect marker map to complete texture fabric defect detection; The blocks located at the edge of the sub-image as a set of texture background areas to be selected further include the following steps: Obtain the gray-level co-occurrence matrix of the sub-image, further obtain the entropy and contrast features, and combine the above features of the two gray-level co-occurrence matrices into a two-dimensional feature vector as the feature vector of the sub-image; The method traverses all blocks of the image and generates a block weight map according to the degree of deviation from the texture background, specifically: Generate a block weight map based on the Euclidean distance between the feature vector of each block and the texture background descriptor as the weight value; The block weight map is generated based on the Euclidean distance between the feature vector of each block and the texture background descriptor as the weight value, specifically: Set a threshold. If the Euclidean distance between the feature vector of the current traversed sub-image and the descriptor Fmean is less than the threshold, the current block is regarded as the background area, and the pixel value of this area is set to 0 in the weight map. If the Euclidean distance is greater than the threshold, the calculated Euclidean distance is used as the weight value of the block, and the weight value is mapped to the pixel value of the block weight map.

2. The textured fabric defect detection method according to claim 1, characterized in that: The input image is divided into equal blocks, specifically: The input image is cut into rectangles of a certain proportion without loss or overlap to obtain multiple sub-images, and then the sub-images are sorted according to the Z-shaped sorting method.

3. The textured fabric defect detection method according to claim 1, characterized in that: The method removes outliers in the geometry of the texture background area to be selected, takes the remaining area as the texture background, and calculates the texture background feature descriptor, specifically: The two maximum vector points are set as initial clustering points, and the extracted two-dimensional feature vectors are divided into two categories by the k-means unsupervised clustering method. The feature clusters with fewer samples are removed, and the vector mean Fmean of the remaining feature clusters is used as the texture background descriptor.

4. The textured fabric defect detection method according to claim 1, characterized in that: The input image is subjected to bilateral filtering to obtain a multi-channel center-surround mechanism saliency map, specifically: The color space of the bilaterally filtered image is converted from RGB color space to CIE-Lab color space, and the mean of the L, a, and b channels is calculated respectively. The Euclidean distance between the values of all pixels in the corresponding channel and the mean is mapped to the pixel values at the corresponding position of the saliency image to obtain a multi-channel center-surround mechanism saliency map.

5. The textured fabric defect detection method according to claim 1, characterized in that: The threshold is calculated based on the texture background descriptor as follows: Among them, e is the adaptive threshold, max, min, and mean are the maximum, minimum, and mean values of the texture background descriptor, respectively.

6. The textured fabric defect detection method according to claim 1, characterized in that: The block weight map and the saliency map are fused in a 1:1 ratio.

7. A computer storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the textured fabric defect detection method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and system for detecting defects of textile surface based on significance detection

    CN107064160A

  • Textile defect detection method based on low-rank sparse matrix decomposition

    CN111862027A