You are on page 1of 5

Proceedings of the 41st Chinese Control Conference

July 25-27, 2022, Hefei, China

A Deep Learning Based Surface Defect Detection Method with


Coarse Granularity for Corrugated Fuel Tubes
Zongze Wu1,2 , Zizhuo Zhang1 , Jun Xu1 Qiang Ling*1,2
1. University of Science and Technology of China, Hefei 230026, China;
E-mail: qling@ustc.edu.cn.
2. Institute of Artificial Intelligence, Hefei Comprehensive National Science Center, Hefei 230031, China.

Abstract:
Surface defect detection is a crucial task to achieve the automation goal in industrial production process. Nowadays, owing to
the rapid development of computer vision, lots of detection methods based on deep learning have been proposed and applied in
industrial manufacturing process. However, different from other deep learning tasks, the rarity of labeled defect training samples
makes it a great challenge to attain expected performance for the surface defect detection of corrugated fuel tubes. To address this
issue, this paper proposes a network with rougher detection granularity to obtain higher accuracy and recall rate. The boundary
of detected defects will be less precise, which, however, is much less important than the gain of detection accuracy and is a
tolerable cost. Experiments on two different datasets are carried out to demonstrate the effectiveness of this proposed method.

Key Words: Deep learning, Surface defect detection, Coarse granularity

1 Introduction auxiliary detection. Therefore, the research of defect detec-


tion algorithm is favored by the industry and tends to be a
Quality supervision is a crucial part in industrial produc- hotspot of computer vision.
tion since it is necessary to ensure the quality of products The existing defect detection methods mainly include tar-
strictly while improving the production efficiency and guar- get detection and semantic segmentation, among which se-
anteeing the brand image. In the past decades, with the de- mantic segmentation based algorithms are more common in
velopment and popularization of industrial automation tech- application. Bian X et al.[[1]] proposed a defect detection
nology, the main labor consumption in industrial production algorithm based on semantic segmentation algorithm. They
is gradually shifting from production to quality supervision. resize the input images into different scales, then send those
Therefore, it tends to be a great demand for automatic defect images into corresponding models built for different scales,
detection technology with effective algorithms to reduce the the obtained results will be integrated and then sent into
waste of labor resources. a new network to get the final segmentation results. This
Over the recent years, benefiting from the rapid develop- method works with a large network structure, causing low
ment of computer vision owing to deep learning, more and calculation speed, but effectively address the problem of d-
more visual perception algorithms have been applied to in- ifferent defect scales. Chen J et al.[[2]] combined SSD[[3]],
dustrial inspection operations in order to detect the surface YOLO[[4]] and other classical target detection algorithms
defects of industrial products instead of human eyes. Most of based on bounding box to construct a cascade network with
the existing defect detection algorithms utilizing deep learn- different detection levels from rough to precise, realizing the
ing are based on target detection method or semantic seg- process of defect location to classification. Qiu L[[5]] com-
mentation algorithm. The target detection method can only bined these two algorithms. They first roughly separated the
get the position and size of defects, but cannot perceive the region potentially containing defects with a segmentation al-
shape of defects. It requires plenty of labeled data for train- gorithm, after which they applied the target detection method
ing to avoid serious problem of missing detection. The se- to the segmentation results so as to obtain the location of de-
mantic segmentation method can obtain the overall location fects with high possibility. In this way, a more accurate dis-
and shape information of defects. However, the characteris- tribution of defects was obtained. Finally, they conducted a
tic of pixel-by-pixel classification and the general situation second segmentation to these locations along with a smooth-
that some defects are similar to the background will lead to ing operation to obtain the more precise results.
many false detections and increase the cost of image label- These algorithms have achieved good results for large in-
ing. Besides, the industrial products produced by differen- dustrial products with significant defects, but not for small
t manufacturing processes have different attributes, which scale defect target detection, which is common in the pro-
makes it difficult to develop a general defect detection al- duction process of corrugated fuel tubes. Most of the defects
gorithm to deal with all kinds of industrial products. In spite in the inner surface of corrugated fuel tubes are small tar-
of kinds of shortcomings and challenges, defect detections gets. Such small defect targets occupy only a small area in
methods based on computer vision are effective to reduce the the whole image and are difficult to be captured by semantic
manpower consumption through detection automation and segmentation network. Meanwhile, for small target samples,
the usual target detection algorithms are difficult to achieve
This work was supported in part the Key Science and Technology
Project of Anhui Province under Grant 202203f07020002, and in part by the expected detection precision under a small number of
the Technological Innovation Project for New Energy and Intelligent Net- labeled samples. Therefore, it is hard for target detection al-
worked Automobile Industry of Anhui Province(Research, Development gorithms to detect the defects with small area of the inner
and Industrialization of Intelligent Cameras).

6725
Authorized licensed use limited to: BEIHANG UNIVERSITY. Downloaded on October 27,2022 at 10:34:22 UTC from IEEE Xplore. Restrictions apply.
Fig. 1: Architecture of the proposed model

Fig. 2: Inner surface defects of corrugated fuel tubes

surface of corrugated fuel tubes. Except for the small target- false detection rate and missing detection rate of the model.
s, another problem is the complex background. Because the 4)The block classification module is the main innovation
inner surface of the corrugated fuel tubes is undulating and of this paper. It improves the model performance signifi-
has a large amount of shadow area, the pixel-level seman- cantly. The model with the block classification module can
tic segmentation tends to classify the shadow part as defects, obtain larger model capacity with fewer training samples, at
resulting in false detection. the expense of a little descent of localization precision, so as
The main contributions of this paper are as below: to effectively improve detection accuracy and recall rate.
1) In this paper, a high precision corrugated fuel tubes de- 2 Methodology And Design
fect detection model is designed, which greatly improves the
detection accuracy of the inner surface defects of corrugated 2.1 System Overview
fuel tubes by using the mechanism of multi-head attention, In this work, surface defect detection is regarded as a
manual Gaussian weight and block classification. block-wise task. The architecture of the proposed approach
2)Due to the uneven distribution of defects, we make s- includes five components: i) feature extraction network; i-
tatistics on the defect center positions of the corrugated fuel i) adaptive average pooling layer; iii)manual weight module;
tubes in the images, set the manual weight that follows the iv) multi-head attention module; v) block classification mod-
Gaussian distribution, and increase the weights of the po- ule.
sitions with frequent defects to reduce the rate of missing In this work, surface defect detection is regarded as a
detection. block-wise task. The architecture of the proposed approach
3)At the same time, in view of defects with variable includes five components: i) feature extract network; ii)
shapes, we use multi-head attention module to extract more adaptive average pooling module; iii) manual weight mod-
abundant features for defects of different shapes, which im- ule; iv) multi-head attention module; v) block classification
proves the classification accuracy of blocks, and reduces the module.

6726
Authorized licensed use limited to: BEIHANG UNIVERSITY. Downloaded on October 27,2022 at 10:34:22 UTC from IEEE Xplore. Restrictions apply.
Fig. 3: Defect detection results of corrugated fuel tubes

1) First, input a batch size of raw images and correspond- layers are optimized by stochastic gradient descent during
ing ground truth to the network, and extract the features back propagation.
through the feature extraction network. A series of convo-
2.3 Adaptive Average Pooling Layer
lution and pooling operations will be applied to each sample
image, and the model learns the effective features through The main purpose of this layer is to compress the feature
forward propagation. During the forward propagation, the maps obtained by the feature extraction module. The size of
output feature maps combined with the ground truth are used the feature maps will be fixed and matched with the num-
to calculate the loss. Then the back propagation algorithm ber of image blocks that is set at the beginning. Meanwhile,
makes the loss descend so as to optimize the model. benefiting from this pooling operation, the number of pa-
2) Next, these feature maps will be resized into a fixed s- rameters is reduced, which speed up the subsequent process
cale through the adaptive average pooling layer, which helps of inference. It can also help preventing the risk of over-
to reduce the number of model parameters, speed up the sub- fitting, which appears important while considering the fact
sequent inference process and reduce the risk of over-fitting. that datasets related to the task of defect detection are usual-
3) Then, the feature maps will be secondary processed ly much smaller than other tasks.
with the manual weight module and the multi-head attention 2.4 Manual Weight Module
module.
The manual weight module can be regarded as a way of
4) Finally, feed these feature maps into the block classifi-
deep supervision. We take statistics on the center positions
cation module to conduct the final prediction on the blocks.
of defects in each image, and decide to set a weight that fol-
The output will be a binary matrix with a small scale corre-
lows Gaussian distribution to make the model more sensitive
sponding to the existence of defects in each block.
to those positions with frequent defects, in order to reduce
2.2 Feature Extraction Module the rate of missing detection.
We adopt VGG16[[6]] network as our feature extraction 2.5 Block Classification Module
network, which is of small structure and has outstanding fea-
Traditional semantic segmentation algorithms detect tar-
ture extraction ability as well as fast inference speed. The
gets by classifying pixel by pixel, which is inflexible. Al-
module is pretrained with ImageNet[[7]] dataset and fine-
though it is potential to obtain sharp edges of defects, the
tuned with our own dataset.There are 13 convolution layers
pixel-wise style causes lots of calculating resources waste
included by this module in total. Each convolution layer is
and model redundancy. Since the urge for a sharp localiza-
followed by a batch layer and an activation layer. All these
tion edge is not so strong when comparing with the detec-

6727
Authorized licensed use limited to: BEIHANG UNIVERSITY. Downloaded on October 27,2022 at 10:34:22 UTC from IEEE Xplore. Restrictions apply.
Fig. 4: Defect detection results on MT defect dataset

tion accuracy, it is surely more economic to set the detection Table 1: Performance on different datasets
granularity larger than a pixel. Another significant benefit Dataset mIOU(%) recall rate(%)
is that the model capacity corresponding to detection can be defect of corrugated fuel tubes 73.1 78.8
larger even though the amount of samples does not increase. MT defect dataset 82.6 88.2
We divide the raw images into N×N blocks, and process
the raw labels into a matrix with the corresponding scale of
N×N. In this way, we can treat each block as a single pixel
while utilizing the semantic segmentation algorithm. 3.2 Data Augmentation
The defect detection datasets are usually small due to the
high cost of manual label making and the rarity of defec-
t images. However, deep learning-based methods require a
3 Experimental Results great amount of labeled samples. The basic and most com-
mon method to solve the over-fitting issue caused by the lack
3.1 Datasets of dataset is data augmentation. We flip the images (up and
down / left and right) to make the datasets increase to 4 times
Datasets Description: In this work, we use two different
than the original.
datasets for experiments. The first is a small corrugated fuel
tube dataset labeled by ourselves. The second is a public 3.3 Evaluation Metrics
surface defect dataset called MT defect dataset. We apply mean intersection-over-union(mIOU) and recall
1) Corrugated Fuel Tube Dataset: The total number of rate as the main performance metrics. However, the mIOU
samples is no more than 150. It is divided in the ratio of we use is slightly different from the others. We calculate
8:1:1 into training set, validation set and test set. mIOU by block-level instead of pixel-level, since we apply
2) MT defect dataset: The magnetic-tile defect dataset is a larger detection granularity.
presented in [[8]] which contains 1344 defect images with
corresponding pixel-level labels. It includes five different 3.4 Experiment Results and Analysis
types of defects: uneven, fray, crack, blowhole, and break. The output of our model is in the form of a matrix of N ×
The resolutions of all the images are different. There are a N . To make it more visible, we transform it into the form of
series of severe noise contained in the images, which makes a bounding box.
a big challenge for detection. We also divide them in the 1) Detection results on Corrugated Fuel Tube Dataset: the
ratio of 8:1:1 under each type, respectively. mIOU is 73.1%, the recall rate is 78.8%, as shown in Table 1.

6728
Authorized licensed use limited to: BEIHANG UNIVERSITY. Downloaded on October 27,2022 at 10:34:22 UTC from IEEE Xplore. Restrictions apply.
The visual results are shown in Fig 3. It can be seen that
the model is capable to recognize the small defects. The
shortcoming is also obvious that the detection box is much
bigger than the area that the defect occupies.
2) Detection results on MT defect dataset: the mIOU is
82.6%, the recall rate is 88.2%, as shown in Table 1. The
visual results are shown in Fig 4. It can be seen that the
background of each image is full of all kinds of noises. The
model successfully predicts the correct positions of defects
even under such complex background. However, the disad-
vantage is that the model can not effectively obtain the edges
of defects.
4 Conclusion
In this work, a defect detection network for surface de-
fect detection for the inner surface of corrugated fuel tubes
is proposed. The architecture of the proposed approach in-
cludes feature extract network,adaptive average pooling lay-
er, manual weight module, multi-head attention module and
block classification module. To address the issue of over-
fitting caused by the lack of samples, we change the detec-
tion granularity from pixel-level to block-level, which is d-
ifferent from traditional semantic segmentation algorithms.
We carry out our experiments on our self-made corrugated
fuel tubes defect dataset and a public MT defect dataset. The
results are acceptable for the real detection process.
References
[1] Xiao Bian, Ser Nam Lim, and Ning Zhou. Multiscale fully
convolutional network with application to industrial inspection.
In 2016 IEEE Winter Conference on Applications of Computer
Vision (WACV), pages 1–8, 2016.
[2] Junwen Chen, Zhigang Liu, Hongrui Wang, Alfredo Nunez,
and Zhiwei Han. Automatic defect detection of fasteners on
the catenary support device using deep convolutional neural
network. IEEE Transactions on Instrumentation and Measure-
ment, 67(2):257–269, 2018.
[3] Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian
Szegedy, Scott Reed, Cheng-Yang Fu, and Alexander C. Berg.
Ssd: Single shot multibox detector. In Bastian Leibe, Jiri
Matas, Nicu Sebe, and Max Welling, editors, Computer Vision
– ECCV 2016, pages 21–37, Cham, 2016. Springer Internation-
al Publishing.
[4] Joseph Redmon, Santosh Divvala, Ross Girshick, and Al-
i Farhadi. You only look once: Unified, real-time object de-
tection. In 2016 IEEE Conference on Computer Vision and
Pattern Recognition (CVPR), pages 779–788, 2016.
[5] Lingteng Qiu, Xiao hong Wu, and Zhiyang Yu. A high-
efficiency fully convolutional networks for pixel-wise surface
defect detection. IEEE Access, 2019.
[6] Karen Simonyan and Andrew Zisserman. Very deep convolu-
tional networks for large-scale image recognition. CoRR, ab-
s/1409.1556, 2015.
[7] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Im-
agenet classification with deep convolutional neural networks.
In Proceedings of the 25th International Conference on Neu-
ral Information Processing Systems - Volume 1, NIPS’12, page
10971105, Red Hook, NY, USA, 2012. Curran Associates Inc.
[8] Yibin Huang, Congying Qiu, Yue Guo, Xiaonan Wang, and
Kui Yuan. Surface defect saliency of magnetic tile. 06 2018.

6729
Authorized licensed use limited to: BEIHANG UNIVERSITY. Downloaded on October 27,2022 at 10:34:22 UTC from IEEE Xplore. Restrictions apply.

You might also like