IP Library Granted Patent US 12,597,113
Granted Patent B2
US 12,597,113 · App. 18/483,396 · Granted Apr 7, 2026

Fabric defect detection method

Inventors: Lingjun Zhang (Hangzhou City, CN); Hua Zhang (Hangzhou City, CN); Yifan Wu (Hangzhou City, CN); Yifei Wu (Hangzhou City, CN)
Assignee: Hangzhou Dianzi University
G06T7/0004G06T2207/20081G06T2207/20084G06T2207/30124
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,597,113
App. No.
18/483,396
Granted
Apr 7, 2026
Kind
B2
Abstract

The present disclosure provides a fabric defect detection method, including the following steps: constructing a data set; preprocessing the data set; constructing a region-based convolutional neural network (R-CNN) model for fabric defect detection; where the R-CNN model for fabric defect detection includes four convolutional layers, four max-pooling layers, and two fully connected layers; training the R-CNN model for fabric defect detection; and reducing a number of false negative (FN) samples by classification threshold reduction. The present disclosure provides a novel R-CNN model for fabric defect detection. The model provides a desirable feature detection accuracy, has a low running cost, and is easy to implement, such that the model can be better applicable to actual operations in an industrial environment.

Claims (142)

1 . A fabric defect detection method, comprising the following steps:

step 1: constructing a data set, comprising:

adopting four different data sets, wherein in addition to three existing data sets of TILDA, MVTec, and Stains, a new self-built data set is constructed; the self-built data set comprises two parts for a training phase and a testing phase, respectively; and the three existing data are only used during the testing phase;

wherein the self-built data set comprises images from two different sources in include fabric defect sample images from Cotton Incorporated and fabric images from network; the fabric defect sample images from Cotton Incorporated comprise 194 512×512 fabric images in six defect types for comprehensive representation of fabric defect categories: in order to supplement and increase a number of samples in the self-built data set, the fabric images from network comprise texture images in six defect types, wherein each defect typo comprises 200 non-defective image samples and 10 defective image samples, there is only one defect in each image, a total of 1,454 images re used as samples, and the images e an ed with an open source tool Labelme;

step 2: preprocessing the data set;

step 3: constructing a region-based convolutional neural network (R-CNN) model for fabric defect detection; wherein

the R-CNN model for fabric defect detection comprises four convolutional layers, four max-pooling layers, and two fully connected layers;

step 4: training the R-CNN model for fabric defect detection; and

step 5: reducing a number of false negative (FN) samples by classification threshold reduction.

2 . The fabric defect detection method according to claim 1 , wherein step 2 specifically-comprises:

(1) image size adjustment:

scaling the fabric defect sample images from Cotton Incorporated and the fabric images from network in the self-built data set through a resize function; and

on the basis of an original image aspect ratio of 512×512, conducting shrinking and testing, finding an image size suitable for the R-CNN model, and determining that an input size is fixed at 150×150; and

(2) gray level transformation:

a gray level of each pixel in the image is a weighted average of three monochromatic colors red (R), green (G), and blue (B):

D= 0.299 R+ 0.587 G+ 0.114 B

converting the images in the self-built data set into a gray level histogram, wherein the gray level of the pixel falls between 100 and 200, and details cannot be highlighted; correcting the gray level of the pixel in the image by gray level histogram equalization;

a formula of the gray level histogram equalization is as follows:

h

(

v

)

=

round

(

cdf

(

v

)

-

cdf

(

min

)

cdf

(

max

)

-

cdf

(

min

)

)

×

(

L

-

1

)

L=256 is a gray level series, cdf is a cumulative distribution function, and min and max are minimum and maximum gray levels in the gray level histogram, respectively; and a round function returns an integer result after decimal rounding.

3 . The fabric defect detection method according to claim 2 , wherein step 3 specifically comprises:

the R-CNN model for fabric defect detection comprises the four convolutional layers, the four max-pooling layers, and the two fully connected layers;

each of the four convolutional layers is connected with one of the four max-pooling layers, and a last one of the four max-pooling layers is sequentially connected with the two fully connected layers; the four max-pooling layers each have a convolution kernel size of 2×2; the following table shows the four convolutional layers, the four max-pooling layers, and the two fully connected layers, as well as hyperparameters, and an input image is 150×150×1;

Layer

Output feature map

Hyperparameter

Conv1

150 × 150 × 64

F = 64, K = 5, S = 1, p = 2

Max-pool 1

75 × 75 × 64

S = 2

Conv2

75 × 75 × 64

F = 64, K = 5, S = 1, p = 2

Max-pool 2

38 × 38 × 64

S = 2

Conv3

38 × 38 × 128

F = 128, K = 3, S = 1, p = 2

Max-pool 3

13 × 13 × 128

S = 3

Conv4

13 × 13 × 128

F = 128, K = 3, S = 1, p = 2

Max-pool 4

5 × 5 × 128

S = 3

Fully connected

256

Neuron 256

layer 1

Fully connected

128

Neuron 128

layer 2

F represents a number of feature maps, K represents the convolution kernel size, S represents a convolutional stride, and p represents padding; and a neuron activation function is ReLu; and

a loss function adopts binary cross-entropy loss, with a formula as follows:

Loss

=

-

1

N

i

=

1

N

yi

·

log

(

p

(

yi

)

)

+

(

1

-

y

i

)

log

(

1

-

p

(

yi

)

)

y i is a label with a value of 1; and (y) is a prediction result of N samples, that is, a probability that a sample is a defective image.

4 . The fabric defect detection method according to claim 3 , wherein step 4 comprises:

conducting visualizing intermediate activation, and visually displaying the feature maps output by each of the four convolutional layers and the four max-pooling layers in a R-CNN to verify a training situation of the network; wherein the visualizing intermediate activation is conducive to displaying characteristics of false positive and false negative samples to better debug the R-CNN model;

setting “batch_size” to 8, such that the R-CNN model selects batches of data each time during the training to allow processing to improve a training speed; and

training the R-CNN model for fabric defect detection with a preprocessed self-built data set obtained in step 2 until the loss function reaches an optimal degree of convergence; and testing the R-CNN model for fabric defect detection on the four different testing data sets.

5 . The fabric defect detection method according to claim 4 , wherein step 5 comprises:

outputting a probability that a predicted image is a defect function through sigmoid using the fully connected layer 2 of the R-CNN for fabric defect detection, and mapping the probability to a binary classification, wherein a defective sample is defined as a positive sample P; two types of samples, false negative (FN) and false positive (FP) are generated; in an actual industrial environment, a number of fabrics with defects is much smaller than a number of fabrics without defects during mass production, that is, a number of positive samples P is much smaller than a number of negative samples N; a larger number of positive samples P and negative samples N that need to be manually reviewed and verified means a greater cost in manual review and verification; and

a test result shows that the FN samples provided by an R-CNN network classifier for fabric defect detection are mostly close to a classification threshold, and an FN sample higher than the classification threshold is classified as a defective sample; after the classification threshold reduction is conducted, FN samples classified as non-defective samples by a detection system are reclassified as the defective samples to reduce an occurrence frequency of the FN samples; the reclassifying is conducted to better divide positive and negative categories of fabric samples and reduce the cost of manual review.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 9, 2023
From: ZHANG, LINGJUN; ZHANG, HUA; WU, YIFAN; WU, YIFEI
To: HANGZHOU DIANZI UNIVERSITY
Reel/Frame 065163/0164 →
Priority Claims (1)
CN 202211571542.5 · Dec 8, 2022 · national
Continuity (1)
Related Publication 20240193752A1 · Jun 13, 2024
References Cited (8)
US 12223633B2 · Sun · 2025 [cited by examiner]
US 12406337B2 · Weinmann · 2025 [cited by examiner]
US 20210117717A1 · Ha · 2021 [cited by examiner]
US 20210142110A1 · Tian · 2021 [cited by examiner]
US 20230196541A1 · Laszlo · 2023 [cited by examiner]
US 20240193752A1 · Zhang · 2024 [cited by examiner]
CN 107169956B · 2020 [cited by examiner]
Almeida, Tomás, Filipe Moutinho, and João Pedro Matos-Carvalho. “Fabric defect detection with deep learning and false negative reduction.” IEEE Access 9 (2021): 81936-81945. (Year: 2021). [cited by examiner]