SlideShare a Scribd company logo
International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021
DOI: 10.5121/ijaia.2021.12402 23
FABRIC DEFECT DETECTION BASED ON
IMPROVED FASTER RCNN
Yuan He, Han-Dong Zhang, Xin-Yue Huang and Francis Eng Hock Tay
Department of Mechanical Engineering, National University of Singapore, Singapore
ABSTRACT
In the production process of fabric, defect detection plays an important role in the control of product
quality. Consider that traditional manual fabric defect detection method are time-consuming and
inaccuracy, utilizing computer vision technology to automatically detect fabric defects can better fulfill the
manufacture requirement. In this project, we improved Faster RCNN with convolutional block attention
module (CBAM) to detect fabric defects. Attention module is introduced from graph neural network, it can
infer the attention map from the intermediate feature map and multiply the attention map to adaptively
refine the feature. This method improve the performance of classification and detection without increase
the computation-consuming. The experiment results show that Faster RCNN with attention module can
efficient improve the classification accuracy.
KEYWORDS
Fabric defects detection, Faster RCNN, Convolutional block attention module, Deep learning
1. INTRODUCTION
In order to produce high quality garments, it is an important step to apply a defect detection link
in the process of fabric manufacturing to ensure the quality. Defect detecting is the process to
find out and locate defects on the surface of fabric. Finding out defects on fabric also improves
the efficiency of manufacturing process by abandoning unqualified intermediate products.
Traditionally, manual inspection which carried out on wooden board is the only method to assure
the quality of textile. Sometimes workers also do fine defects detection with the help of
equipment like magnifiers and microscopes. Manual defect detection can do prompt correction of
small defects. However, error may occur due to fatigue, and small defects are usually undetected
[1].
Since fabric defect detection has a great effect on the quality control of textile manufacture and
the conventional manual inspection method does not suit the requirement of developed automated
manufacture, automatic fabric defects detection becomes a natural way to improve fabric quality
and lower labor cost. Fortunately, with the development of deep learning technology and the
progress of computer vision technology, a new automated fabric detection method which can
replace manual inspection appears. By applying computer vision and machine learning
technology, automated visual inspection is widely used to detect the surface defects of machined
parts and components. According to the research of Rajalingappaa Shanmugamani [2] published
in 2015, visual inspection method can provide rapid quantitative assessment and improve quality
and productivity.
Two defects detection algorithms are compared in this project, the Faster RCNN and Faster
RCNN with convolutional block attention module (CBAM). The difference between these two
International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021
24
algorithms is that the backbone net is different. The backbone net for Faster RCNN is Resnet-
50[21], which is a 50 layers deep neural network and used for feature extraction of defects,
classification and regression. CBAM will combine with Resnet-50 to improve the performance.
Both algorithm detector is Faster RCNN. By comparing the result of two detect algorithms, the
role of attention module will be revealed, and the effect of the faster R-CNN is going to be
shown.
2. RELATED WORK
At present, textile defects detection approaches can be simply divided into spectral approach and
learning approach. Gabor filters provide the optimal joint position in spatial and frequency
domain [3], it becomes the most popular approach in spectral-based method. The initial
application of Gabor filter is to build a filter bank with numerous sets of filters, which is
predetermined the parameters in frequency and orientation [4]. In [5], Shu calculates the
frequency and direction data obtained from 16 Gabor filters convolution with 4 different angles
and scales to detect fabric defects. This method accuracy will be affected by the computationally
intensive and the frequency plane coverage. Bodnarova [6] utilizes optimal filters to reduce the
amount of filters, the computation time is greatly reduced resulting in an increased speed of
detection. However, the correct choice of optimal filter is difficult and crucial. Tong [7] has
developed composite differential evolution (CoDE) to optimize the parameters of Gabor filters,
and get high performance in limited samples. LI [8] integrated Gabor filter and Gaussian mixture
model to inspect simple texture defects, the classification accuracy from 360 images of 9
different defect types reach 87%.
Neural network has advantages in feature extraction, segmentation and optimization tasks of
fabric defects detection area [9, 10]. In 2001, Stojanovic [11] proposed a three-layer back-
propagation neural network for low-cost fabric real-time detection, and the accuracy achieved
86%. Kumar [12] combines forward neural network with Principal Component Analysis (PCA)
for faster detection. In [13], Kuoproposes a three-layers back-propagation neural network to
detect white fabric defects. This model a high dimensional system by non-linear regression
algorithm, achieve 91.88% recognition accuracy for 160 simple defects image. Asimilar
architecture of network is proposed in [14], the detection accuracy of holes and oil stain of twill
fabric reach 91% and 100%. However, the amount of sample is limit and the reliability is
unknown. Semnani and Vadood [15] develop an intelligent model based on artificial neural
network to estimate the appearance of knitted fabrics.
The current textile defect detection field mainly uses adjusted Faster RCNN algorithms as
backbone network for inspection. Since textile industry is an important industry in China,
researchers from China have more sufficient dataset to experiment. In the past two years, Che
[16], Cai [17] and An [18] proposed their improved Faster RCNN method to recognize and
localize the fabric defects, and got good performance. However, they chose to describe their
algorithm in Chinese, which makes it difficult to communicate with other researchers. Zhou [19]
combined Faster RCNN with Feature Pyramid Network and Deformable Convolution Network to
accurately extract the defects, and reduced the time-consuming. The dataset Zhou’ group
usedwas established in 2007 (DAGM dataset), the quality of fabric image is relatively poor, and
the types of defects also small. Therefore, it is questionable whether this algorithm can be used
for real-time detection. Peng [20] introduced an improved prior anchor network to enhance the
Faster RCNN performance. Peng’ group used amount of industrial cloth data to train the network,
and achieve 98.6% accuracy. Unfortunately, the dataset is still not released, and the result of this
algorithm is unreliable.
International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021
25
3. METHOD
3.1. Date Augmentation
In this paper, we collected 185 fabric defect images in three different types from textile factory.
They are broken hole, fly yarn and drop needle. Since the database is too small, we adapt random
real-time data augmentation to increase the amount of image, we flip the image in horizontal and
vertical direction, and distort the image.
(a) (b) (c)
(d) (e) (f)
Fig 1. The examples of fabric defects image and augmentation results. (a) is drop needle. (b) is broken
hole. (c) is fly yarn. (d) and (e) are (b) flipped in horizonal and vertical direction, (f) is (b) distorted and
resized in standard size.
The shape of image needs to be resized to 600 × 600 before training. In order to ensure no
distortion, we scale the original image to a certain proportion and add gray bars (scale on the long
side, fill 0 on the short side), and the resulting new image shape is 512 × 512. In the validation
process, just need to resize images normally to ensure the same size suitable for neural network.
While in the training process, there is warpAffine for database augmentation. We use random
scaling (from 0.25 to 1.75), random cropping, random flip (probability is 0.5) and color jittering.
Unfortunately, our dataset size is not enough for multiple augmentation method. Random
augmentation will actually lead to decrease in accuracy. After several experiment, we only use
our dataset as input. The dataset contains 500 defects image and 1500 defects free images.
International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021
26
3.2. Faster RCNN
Faster R-CNN does the job of object detection in this project. It is developed based on R-CNN
and Fast R-CNN technology and was proposed by Girshick and his team in 2015 [21]. Faster R-
CNN integrates the step of creating boundary boxes into CNN model. The overall frame of Faster
R-CNN is shown in Figure 2. Faster RCNN contains four main parts, which are convolution
layers, region proposal network, region of interest (RoI) pooling and classification.
In this paper, we use ResNet-50 [22] as the backbone net. Firstly, the input fabric defects image
feature map is extracted by convolutional layer with ReLu activation function and pooling layers.
Region proposal network (RPN) is used to generate proposals with feature matrix. We use
boundary conditions and non-maximum suppression [23] to select the appropriate anchor on
feature map. The output of regression layer indicates the coordinate position of fabric defect. RoI
pools collect region proposal and feature maps, the bounding box regression provides the final
exact target box position.
Table 1. ResNet-50 Architecture
Layer Name Output Size ResNet-50
conv1 112 × 112 × 64 7 × 7, 64, stride 2
conv2_x 56 × 156 × 64
3 × 3 max pool, stride 2
[
1 × 1, 64
3 × 3, 64
1 × 1, 256
] × 3
conv3_x 28 × 28 × 128 [
1 × 1, 128
3 × 3, 128
1 × 1, 512
] × 4
conv4_x 14 × 14 × 256 [
1 × 1, 256
3 × 3, 256
1 × 1, 1024
] × 23
conv5_x 7 × 7 × 512 [
1 × 1, 512
3 × 3, 512
1 × 1, 2048
] × 3
average pool 1 × 1 × 512
softmax 1000
CBAM (Convolutional Block Attention Module) [24] is an efficient improvement algorithm in
detection presented by Sanghyun Woo, Jongchan Park and their team in 2018. The structure of
these two modules shows in Figure 3.The function of the entire attention module can be
expressed by the following two equations. The first equation represents the function of channel
attention module and the second equation shows the function of spatial attention module.
International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021
27
Fig 2. An illustration of Faster R-CNN model
Fig 3. Diagram of each attention sub-modules
𝐹′
= 𝑀𝑐(𝐹) ⊕ 𝐹 (1)
𝐹′′
= 𝑀𝑠(𝐹′) ⊕ 𝐹′
⊕ represents element-wise multiplication. 𝑀𝑐 represents the operation of attention extraction
on the channel dimension, and𝑀𝑠represents the operation of attention extraction on the spatial
dimension. 𝐹 ∈ ℝ𝐻×𝑊×𝐶
is the intermediate feature map, 𝐹′
is the product of feature map
after channel attention module process, 𝐹′′
represents the final output feature map after
channel attention and spatial attention. 𝐻 means the height of input feature map, 𝑊 is the
width of input feature map. C is the channel number of input feature map.
Resize
600 × 600 × 3
Backbone (Resnet50)
Feature map
38 × 38 × 1024
3 × 3 conv
1 × 1 conv
1 × 1 conv
Proposal
Softmax
RoI Pooling
RPN
FC layers
FC layers
FC layers
Softmax
Bbox reg
Bbox reg
Class
Position
International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021
28
Fig 4. CBAM integrated with a ResBlock in ResNet
As shown in Figure 3, the input feature map suffers global average-pooling 𝐹𝑎𝑣𝑔
𝑐
and globalmaxi-
pooling𝐹𝑚𝑎𝑥
𝑐
in channel attention module. It is worth to note that the global average pooling and
global maximum pooling are used in parallel, which can minimize the information loss during the
pooling process. 𝐹𝑎𝑣𝑔
𝑐
and 𝐹𝑚𝑎𝑥
𝑐
forward to a shared network which composed of multi-layer
perceptron with one-hidden layer, to produce channel attention map 𝑀𝑐. It can be represented as
following equation (2):
𝑀𝑐(𝐹) = 𝜎 (𝑀𝐿𝑃(𝐴𝑣𝑔𝑃𝑜𝑜𝑙(𝐹)) + 𝑀𝐿𝑃(𝑀𝑎𝑥𝑃𝑜𝑜𝑙(𝐹)))
= 𝜎(𝑊1(𝑊0(𝐹𝑎𝑣𝑔
𝑐
)) + 𝑊1(𝑊0(𝐹𝑚𝑎𝑥
𝑐
))) (2)
Where 𝜎 presents sigmoid function, 𝑊0 ∈ ℝ𝐶/𝑟×𝐶
,𝑊1 ∈ ℝ𝐶×𝐶/𝑟
is the MLP layers wight, 𝑟 is the
reduction rate. First layer has ReLu activation function.
Different from channel attention module, spatial attention module applies a convolutional layer to
generate a spatial attention map to concatenate max-pooling and average-pooling. It can be
represented as following equation (2):
𝑀𝑐(𝐹) = 𝜎 (𝑓7×7(𝐴𝑣𝑔𝑃𝑜𝑜𝑙(𝐹));𝑀𝐿𝑃(𝑀𝑎𝑥𝑃𝑜𝑜𝑙(𝐹)))
= 𝜎(𝑓7×7|𝐹𝑎𝑣𝑔
𝑠
;𝐹𝑚𝑎𝑥
𝑠 |) (3)
Where 𝜎 presents sigmoid function, 𝑓7×7
represents a convolution operation with 7 × 7 size
filter. In this paper, we use sequential arrangement attention modules.
4. EXPERIMENT AND RESULT
In this paper, we used 90 percent samples in the database as training dataset. For one experiment,
50 epochs are run with a base learning rate of 0.001 and 0.0001 with another 50 epochs. In both
of the two iteration stages, the learning rate will decay to 92% of the original in each iteration.
Batch size is 1 and we carry 2 experiments for each method separately. Totally, we have taken
40,000 iterations on each method. The test environment is a HP desktop with an Inter(R)
Core(TM) i5-4200 3.3 GHZ CPU, the simulation software is python2.7.
(a) (b)
International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021
29
(c) (d)
(e)
(f)
Fig 3. Results display and comparison between the different backbones: Resnet50 (left figure) and
Resnet50 + CBAM (right figure). (a), (b) drop needle, (c), (d), (e)broken hole, (f) fly yarn.
There are 185 images in the database, 10% of which is test dataset. Limited by the sample size,
only 3 types of defects are involved in training and testing. All of the three types of defects can
be detected under both the Faster R-CNN with a modified backbone net and the normal one as
shown in the Fig 3. we just show some examples of the detection results. It can be seen that both
these two methods can detect the fabric defects accurately. For the two figures in each group, the
left one is the result of the normal Faster R-CNN using Resnet 50 as backbone; the right one is
the result of the Faster R-CNN with a modified backbone using Resnet50 and CBAM. Both of
the two experiments use Faster R-CNN as the detector. It is clear that using Faster R-CNN with
CBAM leads a higher confidence of the detected defect object compared with the normal one.
After adapting CBAM, the confidence is 2%-3% higher than before. Therefore, the detection
model can be regarded more reliable.
Table 2. Object detection AP (%) of each class and mAP (%) on the test dataset.
Backbone Detector AP of broken
hole
AP of drop
needle
AP of fly
yarn
mAP
ResNet-50 Faster R-CNN 93.26 61.03 55.50 69.93
ResNet-50+CBAM Faster R-CNN 95.31 61.89 55.48 70.89
Global recognizable ratio is the percentage of samples that can be recognized in all test samples.
Correspondingly, we can describe the percentage of samples that can be recognized in a certain
class in all samples of that class as class recognizable ratio. Broken hole is the most easily to be
detected since its structure feature is obvious and simple. As for drop needle, it is not very easy to
be detected since it has many kinds of different structures in the database. Fly yarn is most
difficult to be detected since its sample size is small and it does not have special structures.
International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021
30
Table 3. Global recognizable ratio (%) and class recognizable ratio (%) on the test dataset.
Backbone Detector Global ratio Broken hole Drop needle Fly
yarn
ResNet-50 Faster R-CNN 46 86 50 36
ResNet-50+CBAM Faster R-CNN 62 100 56 67
In addition, to determine whether every recognized sample is classified correctly, the ratio of
samples with correct classification in all samples that can be recognized is accuracy. It can also
be divided into global accuracy and category accuracy, like the recognizable ratio. Adapting
CBAM makes the global accuracy becomes 1% higher than before. For each class, the accuracy
of drop needle is the highest, although it is not easy to be detected out, its accuracy is high. With
CBAM, broken hole can reach 100% accuracy and accuracy of fly yarn is also improved.
Table 4. Global accuracy (%) and class accuracy (%) of each class on the test dataset.
Backbone Detector Global accuracy Broken hole Drop needle Fly
yarn
ResNet-50 Faster R-CNN 87 83 100 71
ResNet-
50+CBAM
Faster R-CNN 88 100 100 83
In the experiment, we use RGB images with shape (600,600,3) to simulate the real manufacturing
environment for training and testing. The detection speed is 1.10 images per second, which
proved this model is not suitable for the real-time detection. If the video captured by industrial
camera is input, this model will cause a significant delay. The detection speed shows in [19] and
[20] is close to 19 images per second. However, they use the grey level image with shape
(128,128). Theoretically, the design of RPN requiring high computation-consuming, which leads
to the slow detection speed. Application of CBAM in our experiment used to improve the
detection accuracy, but how to improve the detection speed is still a research gap which need to
be solved in the future.
5. CONCLUSIONS
In this paper, we introduce a kind of attention mechanism called CBAM into Faster RCNN and
compare the performance of normal Faster RCNN and the improved Faster RCNN with CBAM
in fabric defects detection area. For Faster RCNN part, we use Resnet50 as the backbone to
extract the feature map, feature map is used in the RoI pooling directly and RPN for proposal
extraction meanwhile. Soft-NMS is involved in the RPN and classifier to remove the extra boxes
and improve the detection accuracy. CBAM is a simple and effective attention module for feed
forward convolutional neural networks.
Given an intermediate feature map, the CBAM module sequentially infers the attention map
along two independent dimensions (channel and space), and then multiplies the attention map
with the input feature map for adaptive feature optimization. Since CBAM is a lightweight
general-purpose module, the overhead of this module can be ignored and it can be seamlessly
integrated into any CNN architecture, and it can be trained end-to-end together with the basic
CNN. The Channel Attention Module compresses the feature map in the spatial dimension to
obtain a one-dimensional vector before performing the operation. When compressing in the
spatial dimension, not only Average Pooling but also Max Pooling is considered. Average
Pooling and Max Pooling can be used to aggregate the spatial information of the feature map,
send it to a shared network, compress the spatial dimension of the input feature map, and sum and
International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021
31
merge element by element to generate a channel attention map. As far as a picture is concerned,
channel attention focuses on which content on the picture is important. Average pooling has
feedback for each pixel on the feature map, while maximum pooling is used for gradient back
propagation calculation, only the place with the largest response in the feature map has gradient
feedback.
In this paper experiment is carried out with the normal Faster RCNN with and without CBAM to
verify the positive effect of the CBAM attention module. The experiment result proved CBAM
can get better accuracy and recognizable ratio in our fabric defect database. Dueto the difference
in image quality and pattern complexity, some defects cannot be successfully detected. Collecting
fruitfulness high-quality fabric defect and defect-free image, updating existing network model
will be the focus of future research. The different training time between CBAM and Faster
RCNN is negligible. However, compared with the traditional approaches, the training time is
more time-consuming. Reduce the required time for training the model, realize real-time
detection is crucial to whether this technology can be applied in industrial production, which is
also the focus of future research.
REFERENCES
[1] Ngan, H. Y., Pang, G. K., & Yung, N. H. (2011). Automated fabric defect detection—a review.
Image and vision computing, 29(7), 442-458.
[2] Shanmugamani, R., Sadique, M., &Ramamoorthy, B. (2015). Detection and classification of surface
defects of gun barrels using computer vision and machine learning. Measurement, 60, 222-230.
[3] Kumar, A., & Pang, G. K. (2002). Defect detection in textured materials using Gabor filters. IEEE
Transactions on industry applications, 38(2), 425-440.
[4] Mak, K. L., & Peng, P. (2008). An automated inspection system for textile fabrics based on Gabor
filters. Robotics and Computer-Integrated Manufacturing, 24(3), 359-369.
[5] Shu, Y., & Tan, Z. (2004). Fabric defects automatic detection using Gabor filters. In Fifth World
Congress on Intelligent Control and Automation (IEEE Cat. No. 04EX788)(Vol. 4, pp. 3378-3380).
IEEE.
[6] Bodnarova, A., Bennamoun, M., & Latham, S. (2002). Optimal Gabor filters for textile flaw
detection. Pattern recognition, 35(12), 2973-2991.
[7] Tong, L., Wong, W. K., &Kwong, C. K. (2016). Differential evolution-based optimal Gabor filter
model for fabric inspection. Neurocomputing, 173, 1386-1401.
[8] Zhang, Y., Lu, Z., & Li, J. (2009). Fabric defect detection and classification using gabor filters and
gaussian mixture model. In Asian conference on computer vision (pp. 635-644). Springer, Berlin,
Heidelberg.
[9] Jain, A. K., Duin, R. P. W., & Mao, J. (2000). Statistical pattern recognition: A review. IEEE
Transactions on pattern analysis and machine intelligence, 22(1), 4-37.
[10] Egmont-Petersen, M., de Ridder, D., &Handels, H. (2002). Image processing with neural networks—
a review. Pattern recognition, 35(10), 2279-2301.
[11] Stojanovic, R., Mitropulos, P., Koulamas, C., Karayiannis, Y., Koubias, S., & Papadopoulos, G.
(2001). Real-time vision-based system for textile fabric inspection. Real-Time Imaging, 7(6), 507-
518.
[12] Kumar, A. (2003). Neural network based detection of local textile defects. Pattern Recognition, 36(7),
1645-1659.
[13] Kuo, C. F. J., Lee, C. J., & Tsai, C. C. (2003). Using a neural network to identify fabric defects in
dynamic cloth inspection. Textile Research Journal, 73(3), 238-244.
[14] Yin, Y., Zhang, K., & Lu, W. (2009). Textile flaw classification by wavelet reconstruction and BP
neural network. In International Symposium on Neural Networks (pp. 694-701). Springer, Berlin,
Heidelberg.
[15] Semnani, D., &Vadood, M. (2010). Improvement of intelligent methods for evaluating the apparent
quality of knitted fabrics. Engineering Applications of Artificial Intelligence, 23(2), 217-221.
International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021
32
[16] Che, Xiang-jiu(2019). Fabric defect recognition algorithm based on improved Fast RCNN. Jilin
DaxueXuebao. Gongxue Ban = Journal of Jilin University. Engineering and Technology Edition,
1(1), 2038.
[17] Cai, Zhao-Xin. (2021). Fabric Defect Recognition System Based on Faster RCNN.
JisuanjiXitongYingyong, 2, 83.
[18] An, Meng. (2021). Fabric Defect Detection Method Based on Improved Faster R-CNN
.XiaoXxnWeixinJisuanjiXitong, 42(5), 1029.
[19] Zhou, H., Jang, B., Chen, Y., &Troendle, D. (2020, September). Exploring Faster RCNN for Fabric
Defect Detection. In 2020 Third International Conference on Artificial Intelligence for Industries
(AI4I) (pp. 52-55). IEEE.
[20] Peng, P., Wang, Y., Hao, C., Zhu, Z., Liu, T., & Zhou, W. (2020). Automatic Fabric Defect Detection
Method Using PRAN-Net. Applied Sciences, 10(23), 8434.
[21] Ren, S., He, K., Girshick, R., & Sun, J. (2015). Faster r-cnn: Towards real-time object detection with
region proposal networks. arXiv preprint arXiv:1506.01497.
[22] He, K., Zhang, X., Ren, S., & Sun, J. (2016). Deep residual learning for image recognition. In
Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 770-778).
[23] Neubeck, A., & Van Gool, L. (2006, August). Efficient non-maximum suppression. In 18th
International Conference on Pattern Recognition (ICPR'06) (Vol. 3, pp. 850-855). IEEE
[24] Woo, S., Park, J., Lee, J. Y., &Kweon, I. S. (2018). Cbam: Convolutional block attention module. In
Proceedings of the European conference on computer vision (ECCV) (pp. 3-19).
AUTHORS
Yuan He is a Ph.d. Candidate in National University of Singapore, Singapore. He
received the B.Sc. degress in Northeastern University, P.R. China. His research interests
include defects detection, computer vision and image processing.
Dr. Francis TAY is currently an Associate Professor with the Department of
Mechanical Engineering, Faculty of Engineering, National University of Singapore. Dr.
Tay is the Deputy Director (Industry) for the Centre of Intelligent Products and
Manufacturing Systems, where he takes charge of research projects involving industry
and the Centre.
Zhang Handong is a master candidate in National University of Singapore, Singapore.
He received the B.S. in Harbin Institute of Technology, P.R. China. His research
interests include defects detection and mechanical design.
Xin-Yue Huang is a Master Candidate in University of Singapore, Singapore. She
received the B.Sc. degree in Sichuang University, P.R. China. Her research interests
include computer vision and image processing.

More Related Content

PDF
PREDICTIVE MODEL FOR MAIZE STEM BORERS’ CLASSIFICATION IN PRECISION FARMING
PDF
IRJET - Detection of Skin Cancer using Convolutional Neural Network
PDF
Classify Rice Disease Using Self-Optimizing Models and Edge Computing with A...
PPTX
Tomato leaves diseases detection approach based on support vector machines
PDF
IRJET - Grape Leaf Diseases Classification using Transfer Learning
PDF
Smart Fruit Classification using Neural Networks
PDF
IRJET- Detection and Classification of Skin Diseases using Different Colo...
PPTX
Classification of Apple diseases through machine learning
PREDICTIVE MODEL FOR MAIZE STEM BORERS’ CLASSIFICATION IN PRECISION FARMING
IRJET - Detection of Skin Cancer using Convolutional Neural Network
Classify Rice Disease Using Self-Optimizing Models and Edge Computing with A...
Tomato leaves diseases detection approach based on support vector machines
IRJET - Grape Leaf Diseases Classification using Transfer Learning
Smart Fruit Classification using Neural Networks
IRJET- Detection and Classification of Skin Diseases using Different Colo...
Classification of Apple diseases through machine learning

What's hot (20)

PDF
A new swarm intelligence information technique for improving information bala...
PDF
Skin Cancer Detection and Classification
PDF
IRJET - Automating the Identification of Forest Animals and Alerting in Case ...
PDF
Palm print recognition based on harmony search algorithm
PDF
IRJET - Disease Detection in Plant using Machine Learning
PDF
IRJET- Plant Leaf Disease Detection using Image Processing
PDF
IRJET- Detection and Classification of Leaf Diseases
PDF
IRJET- Leaf Disease Detecting using CNN Technique
PDF
IRJET- Anomaly Detection System in CCTV Derived Videos
PDF
Adapting New Data In Intrusion Detection Systems
PDF
IRJET - Identification of Malarial Parasites using Deep Learning
PDF
Pattern recognition using video surveillance for wildlife applications
PDF
IRJET- Detection & Classification of Melanoma Skin Cancer
PDF
MitoGame: Gamification Method for Detecting Mitosis from Histopathological I...
PDF
Leaf Disease Detection and Selection of Fertilizers using Artificial Neural N...
PPT
Detection of plant diseases
PDF
research publication
PDF
IRJET- Detection of Plant Leaf Diseases using Machine Learning
PDF
Melanoma Skin Cancer Detection using Image Processing and Machine Learning
A new swarm intelligence information technique for improving information bala...
Skin Cancer Detection and Classification
IRJET - Automating the Identification of Forest Animals and Alerting in Case ...
Palm print recognition based on harmony search algorithm
IRJET - Disease Detection in Plant using Machine Learning
IRJET- Plant Leaf Disease Detection using Image Processing
IRJET- Detection and Classification of Leaf Diseases
IRJET- Leaf Disease Detecting using CNN Technique
IRJET- Anomaly Detection System in CCTV Derived Videos
Adapting New Data In Intrusion Detection Systems
IRJET - Identification of Malarial Parasites using Deep Learning
Pattern recognition using video surveillance for wildlife applications
IRJET- Detection & Classification of Melanoma Skin Cancer
MitoGame: Gamification Method for Detecting Mitosis from Histopathological I...
Leaf Disease Detection and Selection of Fertilizers using Artificial Neural N...
Detection of plant diseases
research publication
IRJET- Detection of Plant Leaf Diseases using Machine Learning
Melanoma Skin Cancer Detection using Image Processing and Machine Learning
Ad

Similar to FABRIC DEFECT DETECTION BASED ON IMPROVED FASTER RCNN (20)

PDF
Automatic fabric defect detection employing deep learning
PDF
Fabric Defect Detection by using Neural Network technique
PPTX
templates.pptx
PDF
A REVIEW OF DETECTION OF STRUCTURAL VARIABILITY IN TEXTILES USING IMAGE PROCE...
PDF
A Review on Fabric Defect Detection Techniques
PDF
IRJET- Fabric Defect Classification using Modular Neural Network
PPTX
Automatic Fabric Defect Detection with a Wide-And-Compact Network
PDF
IRJET- Defect Detection in Fabric using Image Processing Technique
PDF
Comparison of Performances of Spectral Based Approaches on Fabric Defect Dete...
PDF
Fabric Defect Detaction in Frequency Domain Using Fourier Analysis
PDF
IRJET- Metal Crack Detection using Image Processing
PDF
IRJET- Real Time Vision System for Thread Counting in Woven Fabric
PDF
textile fabric defects
PDF
IRJET- Fabric Defect Detection using Discrete Wavelet Transform
PDF
IRJET- Identification of Scene Images using Convolutional Neural Networks - A...
PDF
IRJET- Artificial Intelligence for Unearthing Yarn Breakage
PDF
IRJET- Real-Time Object Detection using Deep Learning: A Survey
PDF
L041246977
PPTX
DEVELOPMENT OF GEAR PROFILE INSPECTION USING MACHINE LEARNING.pptx
PDF
A Literature Survey: Neural Networks for object detection
Automatic fabric defect detection employing deep learning
Fabric Defect Detection by using Neural Network technique
templates.pptx
A REVIEW OF DETECTION OF STRUCTURAL VARIABILITY IN TEXTILES USING IMAGE PROCE...
A Review on Fabric Defect Detection Techniques
IRJET- Fabric Defect Classification using Modular Neural Network
Automatic Fabric Defect Detection with a Wide-And-Compact Network
IRJET- Defect Detection in Fabric using Image Processing Technique
Comparison of Performances of Spectral Based Approaches on Fabric Defect Dete...
Fabric Defect Detaction in Frequency Domain Using Fourier Analysis
IRJET- Metal Crack Detection using Image Processing
IRJET- Real Time Vision System for Thread Counting in Woven Fabric
textile fabric defects
IRJET- Fabric Defect Detection using Discrete Wavelet Transform
IRJET- Identification of Scene Images using Convolutional Neural Networks - A...
IRJET- Artificial Intelligence for Unearthing Yarn Breakage
IRJET- Real-Time Object Detection using Deep Learning: A Survey
L041246977
DEVELOPMENT OF GEAR PROFILE INSPECTION USING MACHINE LEARNING.pptx
A Literature Survey: Neural Networks for object detection
Ad

Recently uploaded (20)

PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
additive manufacturing of ss316l using mig welding
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
Geodesy 1.pptx...............................................
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPT
Mechanical Engineering MATERIALS Selection
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
DOCX
573137875-Attendance-Management-System-original
PPTX
Safety Seminar civil to be ensured for safe working.
PPTX
web development for engineering and engineering
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
CH1 Production IntroductoryConcepts.pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Embodied AI: Ushering in the Next Era of Intelligent Systems
additive manufacturing of ss316l using mig welding
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Geodesy 1.pptx...............................................
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Mechanical Engineering MATERIALS Selection
bas. eng. economics group 4 presentation 1.pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
573137875-Attendance-Management-System-original
Safety Seminar civil to be ensured for safe working.
web development for engineering and engineering
Internet of Things (IOT) - A guide to understanding
CH1 Production IntroductoryConcepts.pptx

FABRIC DEFECT DETECTION BASED ON IMPROVED FASTER RCNN

  • 1. International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021 DOI: 10.5121/ijaia.2021.12402 23 FABRIC DEFECT DETECTION BASED ON IMPROVED FASTER RCNN Yuan He, Han-Dong Zhang, Xin-Yue Huang and Francis Eng Hock Tay Department of Mechanical Engineering, National University of Singapore, Singapore ABSTRACT In the production process of fabric, defect detection plays an important role in the control of product quality. Consider that traditional manual fabric defect detection method are time-consuming and inaccuracy, utilizing computer vision technology to automatically detect fabric defects can better fulfill the manufacture requirement. In this project, we improved Faster RCNN with convolutional block attention module (CBAM) to detect fabric defects. Attention module is introduced from graph neural network, it can infer the attention map from the intermediate feature map and multiply the attention map to adaptively refine the feature. This method improve the performance of classification and detection without increase the computation-consuming. The experiment results show that Faster RCNN with attention module can efficient improve the classification accuracy. KEYWORDS Fabric defects detection, Faster RCNN, Convolutional block attention module, Deep learning 1. INTRODUCTION In order to produce high quality garments, it is an important step to apply a defect detection link in the process of fabric manufacturing to ensure the quality. Defect detecting is the process to find out and locate defects on the surface of fabric. Finding out defects on fabric also improves the efficiency of manufacturing process by abandoning unqualified intermediate products. Traditionally, manual inspection which carried out on wooden board is the only method to assure the quality of textile. Sometimes workers also do fine defects detection with the help of equipment like magnifiers and microscopes. Manual defect detection can do prompt correction of small defects. However, error may occur due to fatigue, and small defects are usually undetected [1]. Since fabric defect detection has a great effect on the quality control of textile manufacture and the conventional manual inspection method does not suit the requirement of developed automated manufacture, automatic fabric defects detection becomes a natural way to improve fabric quality and lower labor cost. Fortunately, with the development of deep learning technology and the progress of computer vision technology, a new automated fabric detection method which can replace manual inspection appears. By applying computer vision and machine learning technology, automated visual inspection is widely used to detect the surface defects of machined parts and components. According to the research of Rajalingappaa Shanmugamani [2] published in 2015, visual inspection method can provide rapid quantitative assessment and improve quality and productivity. Two defects detection algorithms are compared in this project, the Faster RCNN and Faster RCNN with convolutional block attention module (CBAM). The difference between these two
  • 2. International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021 24 algorithms is that the backbone net is different. The backbone net for Faster RCNN is Resnet- 50[21], which is a 50 layers deep neural network and used for feature extraction of defects, classification and regression. CBAM will combine with Resnet-50 to improve the performance. Both algorithm detector is Faster RCNN. By comparing the result of two detect algorithms, the role of attention module will be revealed, and the effect of the faster R-CNN is going to be shown. 2. RELATED WORK At present, textile defects detection approaches can be simply divided into spectral approach and learning approach. Gabor filters provide the optimal joint position in spatial and frequency domain [3], it becomes the most popular approach in spectral-based method. The initial application of Gabor filter is to build a filter bank with numerous sets of filters, which is predetermined the parameters in frequency and orientation [4]. In [5], Shu calculates the frequency and direction data obtained from 16 Gabor filters convolution with 4 different angles and scales to detect fabric defects. This method accuracy will be affected by the computationally intensive and the frequency plane coverage. Bodnarova [6] utilizes optimal filters to reduce the amount of filters, the computation time is greatly reduced resulting in an increased speed of detection. However, the correct choice of optimal filter is difficult and crucial. Tong [7] has developed composite differential evolution (CoDE) to optimize the parameters of Gabor filters, and get high performance in limited samples. LI [8] integrated Gabor filter and Gaussian mixture model to inspect simple texture defects, the classification accuracy from 360 images of 9 different defect types reach 87%. Neural network has advantages in feature extraction, segmentation and optimization tasks of fabric defects detection area [9, 10]. In 2001, Stojanovic [11] proposed a three-layer back- propagation neural network for low-cost fabric real-time detection, and the accuracy achieved 86%. Kumar [12] combines forward neural network with Principal Component Analysis (PCA) for faster detection. In [13], Kuoproposes a three-layers back-propagation neural network to detect white fabric defects. This model a high dimensional system by non-linear regression algorithm, achieve 91.88% recognition accuracy for 160 simple defects image. Asimilar architecture of network is proposed in [14], the detection accuracy of holes and oil stain of twill fabric reach 91% and 100%. However, the amount of sample is limit and the reliability is unknown. Semnani and Vadood [15] develop an intelligent model based on artificial neural network to estimate the appearance of knitted fabrics. The current textile defect detection field mainly uses adjusted Faster RCNN algorithms as backbone network for inspection. Since textile industry is an important industry in China, researchers from China have more sufficient dataset to experiment. In the past two years, Che [16], Cai [17] and An [18] proposed their improved Faster RCNN method to recognize and localize the fabric defects, and got good performance. However, they chose to describe their algorithm in Chinese, which makes it difficult to communicate with other researchers. Zhou [19] combined Faster RCNN with Feature Pyramid Network and Deformable Convolution Network to accurately extract the defects, and reduced the time-consuming. The dataset Zhou’ group usedwas established in 2007 (DAGM dataset), the quality of fabric image is relatively poor, and the types of defects also small. Therefore, it is questionable whether this algorithm can be used for real-time detection. Peng [20] introduced an improved prior anchor network to enhance the Faster RCNN performance. Peng’ group used amount of industrial cloth data to train the network, and achieve 98.6% accuracy. Unfortunately, the dataset is still not released, and the result of this algorithm is unreliable.
  • 3. International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021 25 3. METHOD 3.1. Date Augmentation In this paper, we collected 185 fabric defect images in three different types from textile factory. They are broken hole, fly yarn and drop needle. Since the database is too small, we adapt random real-time data augmentation to increase the amount of image, we flip the image in horizontal and vertical direction, and distort the image. (a) (b) (c) (d) (e) (f) Fig 1. The examples of fabric defects image and augmentation results. (a) is drop needle. (b) is broken hole. (c) is fly yarn. (d) and (e) are (b) flipped in horizonal and vertical direction, (f) is (b) distorted and resized in standard size. The shape of image needs to be resized to 600 × 600 before training. In order to ensure no distortion, we scale the original image to a certain proportion and add gray bars (scale on the long side, fill 0 on the short side), and the resulting new image shape is 512 × 512. In the validation process, just need to resize images normally to ensure the same size suitable for neural network. While in the training process, there is warpAffine for database augmentation. We use random scaling (from 0.25 to 1.75), random cropping, random flip (probability is 0.5) and color jittering. Unfortunately, our dataset size is not enough for multiple augmentation method. Random augmentation will actually lead to decrease in accuracy. After several experiment, we only use our dataset as input. The dataset contains 500 defects image and 1500 defects free images.
  • 4. International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021 26 3.2. Faster RCNN Faster R-CNN does the job of object detection in this project. It is developed based on R-CNN and Fast R-CNN technology and was proposed by Girshick and his team in 2015 [21]. Faster R- CNN integrates the step of creating boundary boxes into CNN model. The overall frame of Faster R-CNN is shown in Figure 2. Faster RCNN contains four main parts, which are convolution layers, region proposal network, region of interest (RoI) pooling and classification. In this paper, we use ResNet-50 [22] as the backbone net. Firstly, the input fabric defects image feature map is extracted by convolutional layer with ReLu activation function and pooling layers. Region proposal network (RPN) is used to generate proposals with feature matrix. We use boundary conditions and non-maximum suppression [23] to select the appropriate anchor on feature map. The output of regression layer indicates the coordinate position of fabric defect. RoI pools collect region proposal and feature maps, the bounding box regression provides the final exact target box position. Table 1. ResNet-50 Architecture Layer Name Output Size ResNet-50 conv1 112 × 112 × 64 7 × 7, 64, stride 2 conv2_x 56 × 156 × 64 3 × 3 max pool, stride 2 [ 1 × 1, 64 3 × 3, 64 1 × 1, 256 ] × 3 conv3_x 28 × 28 × 128 [ 1 × 1, 128 3 × 3, 128 1 × 1, 512 ] × 4 conv4_x 14 × 14 × 256 [ 1 × 1, 256 3 × 3, 256 1 × 1, 1024 ] × 23 conv5_x 7 × 7 × 512 [ 1 × 1, 512 3 × 3, 512 1 × 1, 2048 ] × 3 average pool 1 × 1 × 512 softmax 1000 CBAM (Convolutional Block Attention Module) [24] is an efficient improvement algorithm in detection presented by Sanghyun Woo, Jongchan Park and their team in 2018. The structure of these two modules shows in Figure 3.The function of the entire attention module can be expressed by the following two equations. The first equation represents the function of channel attention module and the second equation shows the function of spatial attention module.
  • 5. International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021 27 Fig 2. An illustration of Faster R-CNN model Fig 3. Diagram of each attention sub-modules 𝐹′ = 𝑀𝑐(𝐹) ⊕ 𝐹 (1) 𝐹′′ = 𝑀𝑠(𝐹′) ⊕ 𝐹′ ⊕ represents element-wise multiplication. 𝑀𝑐 represents the operation of attention extraction on the channel dimension, and𝑀𝑠represents the operation of attention extraction on the spatial dimension. 𝐹 ∈ ℝ𝐻×𝑊×𝐶 is the intermediate feature map, 𝐹′ is the product of feature map after channel attention module process, 𝐹′′ represents the final output feature map after channel attention and spatial attention. 𝐻 means the height of input feature map, 𝑊 is the width of input feature map. C is the channel number of input feature map. Resize 600 × 600 × 3 Backbone (Resnet50) Feature map 38 × 38 × 1024 3 × 3 conv 1 × 1 conv 1 × 1 conv Proposal Softmax RoI Pooling RPN FC layers FC layers FC layers Softmax Bbox reg Bbox reg Class Position
  • 6. International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021 28 Fig 4. CBAM integrated with a ResBlock in ResNet As shown in Figure 3, the input feature map suffers global average-pooling 𝐹𝑎𝑣𝑔 𝑐 and globalmaxi- pooling𝐹𝑚𝑎𝑥 𝑐 in channel attention module. It is worth to note that the global average pooling and global maximum pooling are used in parallel, which can minimize the information loss during the pooling process. 𝐹𝑎𝑣𝑔 𝑐 and 𝐹𝑚𝑎𝑥 𝑐 forward to a shared network which composed of multi-layer perceptron with one-hidden layer, to produce channel attention map 𝑀𝑐. It can be represented as following equation (2): 𝑀𝑐(𝐹) = 𝜎 (𝑀𝐿𝑃(𝐴𝑣𝑔𝑃𝑜𝑜𝑙(𝐹)) + 𝑀𝐿𝑃(𝑀𝑎𝑥𝑃𝑜𝑜𝑙(𝐹))) = 𝜎(𝑊1(𝑊0(𝐹𝑎𝑣𝑔 𝑐 )) + 𝑊1(𝑊0(𝐹𝑚𝑎𝑥 𝑐 ))) (2) Where 𝜎 presents sigmoid function, 𝑊0 ∈ ℝ𝐶/𝑟×𝐶 ,𝑊1 ∈ ℝ𝐶×𝐶/𝑟 is the MLP layers wight, 𝑟 is the reduction rate. First layer has ReLu activation function. Different from channel attention module, spatial attention module applies a convolutional layer to generate a spatial attention map to concatenate max-pooling and average-pooling. It can be represented as following equation (2): 𝑀𝑐(𝐹) = 𝜎 (𝑓7×7(𝐴𝑣𝑔𝑃𝑜𝑜𝑙(𝐹));𝑀𝐿𝑃(𝑀𝑎𝑥𝑃𝑜𝑜𝑙(𝐹))) = 𝜎(𝑓7×7|𝐹𝑎𝑣𝑔 𝑠 ;𝐹𝑚𝑎𝑥 𝑠 |) (3) Where 𝜎 presents sigmoid function, 𝑓7×7 represents a convolution operation with 7 × 7 size filter. In this paper, we use sequential arrangement attention modules. 4. EXPERIMENT AND RESULT In this paper, we used 90 percent samples in the database as training dataset. For one experiment, 50 epochs are run with a base learning rate of 0.001 and 0.0001 with another 50 epochs. In both of the two iteration stages, the learning rate will decay to 92% of the original in each iteration. Batch size is 1 and we carry 2 experiments for each method separately. Totally, we have taken 40,000 iterations on each method. The test environment is a HP desktop with an Inter(R) Core(TM) i5-4200 3.3 GHZ CPU, the simulation software is python2.7. (a) (b)
  • 7. International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021 29 (c) (d) (e) (f) Fig 3. Results display and comparison between the different backbones: Resnet50 (left figure) and Resnet50 + CBAM (right figure). (a), (b) drop needle, (c), (d), (e)broken hole, (f) fly yarn. There are 185 images in the database, 10% of which is test dataset. Limited by the sample size, only 3 types of defects are involved in training and testing. All of the three types of defects can be detected under both the Faster R-CNN with a modified backbone net and the normal one as shown in the Fig 3. we just show some examples of the detection results. It can be seen that both these two methods can detect the fabric defects accurately. For the two figures in each group, the left one is the result of the normal Faster R-CNN using Resnet 50 as backbone; the right one is the result of the Faster R-CNN with a modified backbone using Resnet50 and CBAM. Both of the two experiments use Faster R-CNN as the detector. It is clear that using Faster R-CNN with CBAM leads a higher confidence of the detected defect object compared with the normal one. After adapting CBAM, the confidence is 2%-3% higher than before. Therefore, the detection model can be regarded more reliable. Table 2. Object detection AP (%) of each class and mAP (%) on the test dataset. Backbone Detector AP of broken hole AP of drop needle AP of fly yarn mAP ResNet-50 Faster R-CNN 93.26 61.03 55.50 69.93 ResNet-50+CBAM Faster R-CNN 95.31 61.89 55.48 70.89 Global recognizable ratio is the percentage of samples that can be recognized in all test samples. Correspondingly, we can describe the percentage of samples that can be recognized in a certain class in all samples of that class as class recognizable ratio. Broken hole is the most easily to be detected since its structure feature is obvious and simple. As for drop needle, it is not very easy to be detected since it has many kinds of different structures in the database. Fly yarn is most difficult to be detected since its sample size is small and it does not have special structures.
  • 8. International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021 30 Table 3. Global recognizable ratio (%) and class recognizable ratio (%) on the test dataset. Backbone Detector Global ratio Broken hole Drop needle Fly yarn ResNet-50 Faster R-CNN 46 86 50 36 ResNet-50+CBAM Faster R-CNN 62 100 56 67 In addition, to determine whether every recognized sample is classified correctly, the ratio of samples with correct classification in all samples that can be recognized is accuracy. It can also be divided into global accuracy and category accuracy, like the recognizable ratio. Adapting CBAM makes the global accuracy becomes 1% higher than before. For each class, the accuracy of drop needle is the highest, although it is not easy to be detected out, its accuracy is high. With CBAM, broken hole can reach 100% accuracy and accuracy of fly yarn is also improved. Table 4. Global accuracy (%) and class accuracy (%) of each class on the test dataset. Backbone Detector Global accuracy Broken hole Drop needle Fly yarn ResNet-50 Faster R-CNN 87 83 100 71 ResNet- 50+CBAM Faster R-CNN 88 100 100 83 In the experiment, we use RGB images with shape (600,600,3) to simulate the real manufacturing environment for training and testing. The detection speed is 1.10 images per second, which proved this model is not suitable for the real-time detection. If the video captured by industrial camera is input, this model will cause a significant delay. The detection speed shows in [19] and [20] is close to 19 images per second. However, they use the grey level image with shape (128,128). Theoretically, the design of RPN requiring high computation-consuming, which leads to the slow detection speed. Application of CBAM in our experiment used to improve the detection accuracy, but how to improve the detection speed is still a research gap which need to be solved in the future. 5. CONCLUSIONS In this paper, we introduce a kind of attention mechanism called CBAM into Faster RCNN and compare the performance of normal Faster RCNN and the improved Faster RCNN with CBAM in fabric defects detection area. For Faster RCNN part, we use Resnet50 as the backbone to extract the feature map, feature map is used in the RoI pooling directly and RPN for proposal extraction meanwhile. Soft-NMS is involved in the RPN and classifier to remove the extra boxes and improve the detection accuracy. CBAM is a simple and effective attention module for feed forward convolutional neural networks. Given an intermediate feature map, the CBAM module sequentially infers the attention map along two independent dimensions (channel and space), and then multiplies the attention map with the input feature map for adaptive feature optimization. Since CBAM is a lightweight general-purpose module, the overhead of this module can be ignored and it can be seamlessly integrated into any CNN architecture, and it can be trained end-to-end together with the basic CNN. The Channel Attention Module compresses the feature map in the spatial dimension to obtain a one-dimensional vector before performing the operation. When compressing in the spatial dimension, not only Average Pooling but also Max Pooling is considered. Average Pooling and Max Pooling can be used to aggregate the spatial information of the feature map, send it to a shared network, compress the spatial dimension of the input feature map, and sum and
  • 9. International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021 31 merge element by element to generate a channel attention map. As far as a picture is concerned, channel attention focuses on which content on the picture is important. Average pooling has feedback for each pixel on the feature map, while maximum pooling is used for gradient back propagation calculation, only the place with the largest response in the feature map has gradient feedback. In this paper experiment is carried out with the normal Faster RCNN with and without CBAM to verify the positive effect of the CBAM attention module. The experiment result proved CBAM can get better accuracy and recognizable ratio in our fabric defect database. Dueto the difference in image quality and pattern complexity, some defects cannot be successfully detected. Collecting fruitfulness high-quality fabric defect and defect-free image, updating existing network model will be the focus of future research. The different training time between CBAM and Faster RCNN is negligible. However, compared with the traditional approaches, the training time is more time-consuming. Reduce the required time for training the model, realize real-time detection is crucial to whether this technology can be applied in industrial production, which is also the focus of future research. REFERENCES [1] Ngan, H. Y., Pang, G. K., & Yung, N. H. (2011). Automated fabric defect detection—a review. Image and vision computing, 29(7), 442-458. [2] Shanmugamani, R., Sadique, M., &Ramamoorthy, B. (2015). Detection and classification of surface defects of gun barrels using computer vision and machine learning. Measurement, 60, 222-230. [3] Kumar, A., & Pang, G. K. (2002). Defect detection in textured materials using Gabor filters. IEEE Transactions on industry applications, 38(2), 425-440. [4] Mak, K. L., & Peng, P. (2008). An automated inspection system for textile fabrics based on Gabor filters. Robotics and Computer-Integrated Manufacturing, 24(3), 359-369. [5] Shu, Y., & Tan, Z. (2004). Fabric defects automatic detection using Gabor filters. In Fifth World Congress on Intelligent Control and Automation (IEEE Cat. No. 04EX788)(Vol. 4, pp. 3378-3380). IEEE. [6] Bodnarova, A., Bennamoun, M., & Latham, S. (2002). Optimal Gabor filters for textile flaw detection. Pattern recognition, 35(12), 2973-2991. [7] Tong, L., Wong, W. K., &Kwong, C. K. (2016). Differential evolution-based optimal Gabor filter model for fabric inspection. Neurocomputing, 173, 1386-1401. [8] Zhang, Y., Lu, Z., & Li, J. (2009). Fabric defect detection and classification using gabor filters and gaussian mixture model. In Asian conference on computer vision (pp. 635-644). Springer, Berlin, Heidelberg. [9] Jain, A. K., Duin, R. P. W., & Mao, J. (2000). Statistical pattern recognition: A review. IEEE Transactions on pattern analysis and machine intelligence, 22(1), 4-37. [10] Egmont-Petersen, M., de Ridder, D., &Handels, H. (2002). Image processing with neural networks— a review. Pattern recognition, 35(10), 2279-2301. [11] Stojanovic, R., Mitropulos, P., Koulamas, C., Karayiannis, Y., Koubias, S., & Papadopoulos, G. (2001). Real-time vision-based system for textile fabric inspection. Real-Time Imaging, 7(6), 507- 518. [12] Kumar, A. (2003). Neural network based detection of local textile defects. Pattern Recognition, 36(7), 1645-1659. [13] Kuo, C. F. J., Lee, C. J., & Tsai, C. C. (2003). Using a neural network to identify fabric defects in dynamic cloth inspection. Textile Research Journal, 73(3), 238-244. [14] Yin, Y., Zhang, K., & Lu, W. (2009). Textile flaw classification by wavelet reconstruction and BP neural network. In International Symposium on Neural Networks (pp. 694-701). Springer, Berlin, Heidelberg. [15] Semnani, D., &Vadood, M. (2010). Improvement of intelligent methods for evaluating the apparent quality of knitted fabrics. Engineering Applications of Artificial Intelligence, 23(2), 217-221.
  • 10. International Journal of Artificial Intelligence & Applications (IJAIA), Vol.12, No.4, July 2021 32 [16] Che, Xiang-jiu(2019). Fabric defect recognition algorithm based on improved Fast RCNN. Jilin DaxueXuebao. Gongxue Ban = Journal of Jilin University. Engineering and Technology Edition, 1(1), 2038. [17] Cai, Zhao-Xin. (2021). Fabric Defect Recognition System Based on Faster RCNN. JisuanjiXitongYingyong, 2, 83. [18] An, Meng. (2021). Fabric Defect Detection Method Based on Improved Faster R-CNN .XiaoXxnWeixinJisuanjiXitong, 42(5), 1029. [19] Zhou, H., Jang, B., Chen, Y., &Troendle, D. (2020, September). Exploring Faster RCNN for Fabric Defect Detection. In 2020 Third International Conference on Artificial Intelligence for Industries (AI4I) (pp. 52-55). IEEE. [20] Peng, P., Wang, Y., Hao, C., Zhu, Z., Liu, T., & Zhou, W. (2020). Automatic Fabric Defect Detection Method Using PRAN-Net. Applied Sciences, 10(23), 8434. [21] Ren, S., He, K., Girshick, R., & Sun, J. (2015). Faster r-cnn: Towards real-time object detection with region proposal networks. arXiv preprint arXiv:1506.01497. [22] He, K., Zhang, X., Ren, S., & Sun, J. (2016). Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 770-778). [23] Neubeck, A., & Van Gool, L. (2006, August). Efficient non-maximum suppression. In 18th International Conference on Pattern Recognition (ICPR'06) (Vol. 3, pp. 850-855). IEEE [24] Woo, S., Park, J., Lee, J. Y., &Kweon, I. S. (2018). Cbam: Convolutional block attention module. In Proceedings of the European conference on computer vision (ECCV) (pp. 3-19). AUTHORS Yuan He is a Ph.d. Candidate in National University of Singapore, Singapore. He received the B.Sc. degress in Northeastern University, P.R. China. His research interests include defects detection, computer vision and image processing. Dr. Francis TAY is currently an Associate Professor with the Department of Mechanical Engineering, Faculty of Engineering, National University of Singapore. Dr. Tay is the Deputy Director (Industry) for the Centre of Intelligent Products and Manufacturing Systems, where he takes charge of research projects involving industry and the Centre. Zhang Handong is a master candidate in National University of Singapore, Singapore. He received the B.S. in Harbin Institute of Technology, P.R. China. His research interests include defects detection and mechanical design. Xin-Yue Huang is a Master Candidate in University of Singapore, Singapore. She received the B.Sc. degree in Sichuang University, P.R. China. Her research interests include computer vision and image processing.