A high-effective multitask surface defect detection method based on CBAM and atrous convolution
간접 관련 산업용 섬유 · (17) 스펀본드 부직포 (1) 에어백(3) 자동차 인테리어 소재(9) 타이어코드
기본 정보
- 저자
- DOI
- 10.1299/jamdsm.2022jamdsm0063
- 저널
- Journal of Advanced Mechanical Design Systems and Manufacturing
- 발행년도
- 2022
- 발행기관
- Japan Society Mechanical Engineers
- 피인용수
- 6
- 라이선스
- cc-by-nc-nd
- 논문 유형
- –
- 언어
- –
- 원문 페이지
- https://doi.org/10.1299/jamdsm.2022jamdsm0063
- 토픽
- Surface Roughness and Optical Measurements
- OpenAlex ID
- W4313156136
평가 내용
- 관련도
- 간접 관련
- 사업분야
- 산업용 섬유 · (17) 스펀본드 부직포
- 부 분야
- (1) 에어백, (3) 자동차 인테리어 소재, (9) 타이어코드
- R&D 측면
- 분석·모델링
- 확신도
- 0.80
- 근거 용어
- surface defect detection, deep learning, machine vision, segmentation, industrial products
- 판단 근거
- 이 논문은 산업 제품의 표면 결함을 탐지하기 위한 딥러닝 기반의 비전 검사 알고리즘을 다루고 있습니다. 이는 코오롱인더스트리의 섬유, 타이어코드, 자동차 소재 등 다양한 제조 공정의 품질 관리(QC) 자동화 시스템에 적용 가능한 기술입니다.
- R&D 활용 포인트
- 에어백 원단, 타이어코드, 부직포 등 고부가가치 산업용 섬유 및 필름 제조 공정에서 실시간 표면 결함(스크래치, 오염, 미세 구멍 등)을 자동으로 검출하는 스마트 팩토리 검사 시스템 구축에 활용 가능합니다.
- 평가 입력
- 본문 58,972자 중 30,032자 발췌
초록
본문 58,972자
본문 펼치기
섹션 본문 67문단 · 68,805자
(제목 없음)
1Given the shortcomings of conventional machine vision-based surface defect detection methods, including their low accuracy, long development cycle, and poor generalization ability, this paper proposes a surface defect detection model based on the convolutional block attention module and atrous convolution. This model combines the surface defect segmentation task of the product with the classification task, obtains contextual information of the image at multiple scales using atrous spatial pyramid pooling, and then uses the convolutional block attention module to reallocate the weighting of the network to enhance focus on the defect area and improve the discrimination of extracted features. In addition, atrous convolution was introduced in the deep network to simplify the model when used in defect segmentation tasks and enhances the real-time performance of the model defect detection method. Experiments show the superior accuracy and real-time performance of the proposed model when compared with current mainstream surface defect detection methods and indicate its wide applicability in the detection of surface defects in industrial products. relationship between inputs and outputs hidden in a large amount of training data by using a multi-layer neural network structure, which does not need any precise mathematical expression. Qiu et al. proposed a three-stage defect detection model, which uses a fully convolutional network (FCN) as the basic framework. In the model, separable convolution is used instead of standard convolution to efficiently achieve the pixel-level segmentation of defect images(Qiu et al., 2019). Zhao et al. constructed the model using an auto-encoder (AE) and generative adversarial networks (GANs) and then used local binary pattern (LBP) to detect and locate defects (Zhao et al., 2018). He et al. combined convolutional auto-encoders (CAEs) and GANs to construct a model to accurately detect and classify defects on seven hot-rolled plates (He et al., 2019). Mei et al. proposed a defect detection and localization method that only requires training on non-defect images. It combines the idea of an image pyramid hierarchy with convolutional denoising autoencoder (CDAE) networks to perform defect detection on texture images (Mei et al., 2018). He et al. proposed an end-to-end steel surface defect detection method, which uses a baseline CNN to generate feature maps at each stage, and then the proposed multilevel feature fusion network (MFN) to fuse multiple hierarchical features (He et al., 2020). For these multi-level features, the region proposal network (RPN) is used to generate a region of interest (ROI). For each ROI, a classifier and a bounding box regressor generate the final detection result. Tang et al. proposed an end-to-end spatial attention bilinear convolutional neural network (SA-BCNN), combining the spatial attention mechanism in the deep convolutional neural network and bilinear pool technology, which can enhance the representation ability of CNN and extract more detailed image features, to improve the defect detection ability of the model (Tang et al., 2020). To address the difficulty of defect data collection and the expenses of labeling, He et al. proposed a multi-training semi-supervised method based on DCGAN and Resnet18 and applied it to steel surface defect classification. The method uses GAN to generate a large number of unlabeled samples, and then trains them with classifiers of two different learning strategies. The labeled and unlabeled samples are fused into the semi-supervised learning process to provide sufficient defect data (He et al., 2019).Similarly, Su et al. proposed a new approach to defect segmentation using generative adversarial networks. First, the GAN-based method removes the defect region in the input defective image to obtain a defect-free image while keeping the background almost unchanged. Then, the subtracted image is obtained by taking the difference between the defective input image and the generated defect-free image. Finally, the defect region can be segmented by thresholding the subtracted image(Su et al., 2021). Lin et al. proposed Normal Background Regularization and Crop-and-Paste operations, using abundant Normal image training models without defects to segment defect data with few-shot learning, to prevent model overfitting caused by very limited defect training images (Lin et al., 2020). Although the above-mentioned deep learning-based defect detection methods have solved part of the task of defect detection, the network structure constructed by some methods is too complex to satisfy the real-time requirements for defect detection in an industrial environment. In addition, some networks cannot effectively eliminate the influence of background information on defect images in a relatively complex acquisition environment, which causes part of background noise to be mistaken for defect pixels and affects the accuracy of the defect detection method.Hence, we propose a deep learning network model based on the convolutional block attention module (CBAM)(Woo et al., 2018)and atrous convolution(Yu and Koltun, 2016). The model is composed of a segmentation network and a decision network. The segmentation network and the decision network share some parameters, and the segmentation results of the segmentation network can help the decision network to more accurately detect defects. Our model performs better than current mainstream defect detection methods on both KolektorSDD and magnetic tile datasets. The main contributions are as follows:1) A surface defect detection model based on CBAM and atrous convolution is proposed to detect and segment product surface defects, which can satisfy the high accuracy and real-time requirements of industrial defect detection.2) The CBAM with negligible overheads was introduced into the segmentation network. It can not only improve the ability of the CNN to process fine-grained image classification but also reallocate the weighting of feature maps, enhancing the feature extraction ability of the network and improving the detection performance of the network. 3) We replace the standard convolution with atrous convolution in the segmentation network, and expand the receptive field while maintaining the same parameters and computations, simplify the model parameters and computational amount, and enhance the real-time performance of the model for defect detection. In addition, to address the gridding effect of atrous convolution, we used hybrid dilated convolution to design the structure of the convolutional layers, which means all the pixels of the input sample are involved in the calculation and As a common choice, we also evaluated the magnetic tile dataset (MTD)(Huang et al., 2020), which included 1344 non-defective and defected images, totaling 392 defective images and 952 normal images. The defects were divided into 5 categories, namely, blowhole, break, crack, fray, and uneven defects. Samples of normal and defective images are shown inFig. 6. Similarly, this dataset is divided into a training set and a test set at a ratio of 7:3. The allocation details are shown inTable 3.Performance metricsThe model can be evaluated in terms of accuracy and real-time performance. The average precision (AP), falsepositive (FP), and false-negative (FN) results were used as performance metrics to measure the accuracy of the model. In this paper, samples with defective areas were known called positive samples, while the samples without defective pixels were called negative samples. Therefore, FP is the number of non-defective samples that are mistaken for defective samples, and FN represents the number of defective samples mistaken as non-defective samples. The primary metric used in evaluating the accuracy of the model is AP, which is more appropriate than FP or FN, since AP is calculated as the area under the precision-recall curve and accurately captures the performance of the model under different threshold values as a single value. As an alternative method, floating-point operations (FLOPs) and the parameter size of the network can be used to evaluate the real-time performance of the model. The FLOPs can be understood as the computation amount of the model, which is used to measure the complexity of the model.
Introduction
2In industrial manufacturing, in order to ensure the quality of products, the most effective way is to inspect the surface of the product. Usually, it is trained workers who identify complex surface defects, but this method is susceptible to worker inexperience and subjective factors. This time-consuming and unreliable process cannot be adapted to the developing trend of industrial automation. With the development of intelligent manufacturing, defect detection technology based on machine vision (MV) is favored by most scholars. Sun et al. proposed a background subtraction method based on the Gaussian mixture model to extract the feature area of weld defects and designed a weld detection and classification algorithm (Sun et al., 2019). Shen et al. used template matching and sub-pixel precision to precisely position a printed circuit board (PCB) and then used smart cameras and industrial robots to complete the PCB defect detection (Shen et al., 2018). Huang et al. used a support vector machine (SVM) classifier to identify six common glass bottle defects, which addresses the low classification accuracy of existing machine vision defect detection systems (Huang et al., 2016). Xie et al. proposed an improved sub-pixel detection algorithm combining coarse and fine positioning, using Otsu's method to achieve sub-pixel precise positioning (Xie et al., 2016). The above methods can satisfy the defect detection and classification requirements for specific problems to a certain extent. However, it is difficult to satisfy the real-time, high-accuracy, and generality requirements of defect detection in most industrial environments using defect detection methods based on machine vision due to their long development cycle, the interference of acquisition environmental noise, and the difficulty in finding a general template as a reference for various detection objects.
3In recent years, with the development of deep learning (DL), especially the in-depth study of convolutional neural networks (CNNs), deep learning has been successfully applied to various image-related tasks (Krizhevsky et al., 2012). Different from conventional machine vision methods, a deep learning algorithm can effectively learn the mapping improves the performance of the network. In this paper, the most suitable configuration of atrous convolution layer is found through ablation studies. 4) Atrous spatial pyramid pooling (ASPP) (Chen et al., 2017) is used to obtain multi-scale information of images, to enhance the detection ability of defects of different sizes of the model and enhance the universality of the model.
Relevant theoretical
4To extract better features, accelerate the detection speed of the model, and enhance the real-time performance of the model, the CBAM, atrous convolution, and ASPP were introduced into the segmentation network model.
Convolutional block attention module
5The attention mechanism was first proposed in the images (Mnih et al., 2014). The introduction of the attention mechanism in the image field is a very critical technique to enable the deep network model to better focus on a local area of interest to the user while suppressing other areas that are not important. In recent years, models based on attention mechanisms have become a hot research topic and are widely used in various types of deep learning tasks such as natural language processing, image recognition (Wang et al., 2017;Xu et al., 2020), and speech recognition. CBAM is also one of many attention mechanisms, not only telling the user where to focus on but also enhancing the feature extraction ability of the area of interest. It is composed of a channel attention module and a spatial attention module that perform attention operations on the channel and spatial dimensions of the image, respectively. In addition, the use of CBAM can also improve the representational ability of CNN, force CNN to extract fine-grained image features, and make the extracted features more discriminative. The network structure of CBAM is shown in Fig. 1. The module first performs channel attention operation on the feature map to increase the weighting of effective channels and reduce the weighting of invalid channels. As shown in Eq. (1), where c M refers to the channel attention module, F is the input feature map, and the variables avg c F , max c F represent the use of average pooling and max pooling operations to aggregate the spatial information of the feature map, respectively.
6The Hadamard product operation can be carried out between the feature graph F generated by the channel attention module and the input feature graph F to obtain the input of the spatial attention module. The spatial attention module is then used to increase the attention given to the regions of interest in the spatial dimension. This is shown in Eq. (2) Xie, Xu, Li, Wang and Wan, Journal of Advanced Mechanical Design, Systems, and Manufacturing, Vol.16, No.6 (2022) Finally, the modified feature map is generated by Hadamard product of the feature graph F of the perform spatial attention module and the input feature map F .
Atrous convolution
7In the field of image semantic segmentation, it is often necessary to make dense predictions of the full resolution of the image. The designed network not only needs to pay attention to local information but also global information, which requires the network to have a larger receptive field. In general, in order to obtain a larger receptive field, a typical segmentation network uses a large-size convolution kernel with a large number of parameters, so the network becomes relatively complex and requires a lot of computing resources. Atrous convolution is a kind of convolution method proposed to solve this problem. It can increase the receptive field of the network and reduce the training time of the model while maintaining the number of network parameters and calculations. Many classical semantic segmentation networks have also adopted this idea of convolution, such as the Deeplab series (Chen et al., 2014;Chen et al., 2016). Deeplab replaces standard convolution in the network with atrous convolution, and the multi-scale atrous convolution operation of the input image can be performed, greatly reducing the complexity of the network. SSD and RFBNet ) also refer to this convolution method to simplify the network in object detection.
8Atrous convolution is often used to deal with how global information is needed in image segmentation or the need for long sequence information in speech text. It introduces a hyper-parameter called a "dilation rate" to the standard convolution, which defines the distance between each element of the convolution kernel. In other words, compared with standard convolution, atrous convolution adds a new hyper-parameter of dilation rate, whose value is equal to the number of intervals between elements of the convolution kernel. Standard convolution is actually atrous convolution with a dilation rate of 1. The introduction of atrous convolution to the network can not only avoid information loss caused by the pooling operation but also increase the receptive field of the network, allowing the network to better capture the global information of the input image. For example, by adding a hole to the standard convolution, the original 3×3 standard convolution kernel can have a larger receptive field of a 5×5 (dilated rate = 2) standard convolution kernel with the same number of parameters and calculation, which avoids the downsampling operation. Atrous convolution is defined as:
9where f[i] and g [i] are the input and output feature maps respectively, k[l] represents the convolution kernel of length l, and r is the dilated rate of the atrous convolution. When the atrous convolution is performing the convolution operation, the value of the atrous position is 0. Figure 2 illustrates the atrous convolution kernels with three different dilation rates. From left to right are the atrous convolution kernels with dilation rates r = 1, 2, and 4. As the dilation rate increases, the receptive field of the convolution kernel also becomes larger, corresponding to 3×3, 5×5, and 9×9 kernel, respectively. The receptive field of the atrous convolution is calculated as Eq. (4):
10where r is the dilation rate, k is the size of the convolution kernel, and R is the actual receptive field. Although atrous convolution has the above advantages, the random design of the dilation rate in the atrous convolution or any combination of atrous convolution in the network may greatly reduce the performance of the network. Wang et al. pointed out that blindly designing the dilation rate of the atrous convolution will make some pixels of the input sample not participate in the calculation, resulting in the gridding effect and affecting the accuracy of the network . This problem can be avoided by following hybrid dilated convolution in designing the structure of atrous convolution in the network.
Atrous spatial pyramid pooling
11Another challenge of deep convolutional neural networks for image segmentation is dealing with the existence of objects at multiple scales. A common method used to solve this is to combine the images of different scales obtained from the input image by rescaling the operation as the input of the network (Rudolph et al., 2018). This method can indeed improve the segmentation effect of the model but it also creates a computational burden, which hinders the realtime performance of the model. Another effective method is to use ASPP to resample the feature maps obtained by the deep convolutional neural network at different scales to obtain feature maps with rich contextual information.
12Motivated by spatial pyramid pooling (He et al., 2014), Chen et al. proposed ASPP, which uses multiple parallel atrous convolutions with different dilation rates to perform multi-scale sampling for a given feature map (Chen et al., 2016). This is equivalent to using multiple convolution kernels with different receptive fields to resample a given feature map, so the contextual information provided by the image can be captured at multiple scales. In order to further capture global information, Chen et al. augmented ASPP with image-level features (Chen et al., 2017). Figure 3 shows the structure of ASPP with an augmented image-level feature. The improved ASPP uses one 1×1 convolution, three 3×3 atrous convolutions with dilation rates equal to 6, 12, and 18, and image-level feature pooling to perform multi-scale sampling on the input feature map. The resulting features were then concat to obtain an output feature map with rich contextual information.
13Three kinds of atrous convolution kernels with different dilation rates.
Surface defect detection method based on CBAM and atrous convolution
14A surface defect detection model based on CBAM and atrous convolution was designed, as shown in Fig. 4. The model is mainly composed of a segmentation network and a decision network that are used to segment and detect surface defects, respectively. In the segmentation network, the data features of the input samples are first learned and a binary segmentation map is generated. Each pixel in the input samples is taken as a separate training sample for the network to increase the effective number of training samples and avoid overfitting. In the decision network, the feature map learned in the segmentation network and the segmentation results generated are used as the input of the decision network. The segmentation result is used to help the decision network better judge whether the input sample contains defects. Then, a denser and smaller space feature map is obtained after a series of convolutional and pooling operations, followed by the fully connected layer (FC) and sigmoid activation function. The final obtained input sample is the predicted value of the defective image. Fig. 4 The network model structure of the proposed.
15It has been noted that CNN has poor performance in fine-grained image classification, but the surface defect segmentation task needs to deal with defects at the pixel level (Zheng et al., 2017;Lin et al., 2018). Therefore, a CBAM with negligible overheads was introduced into the segmentation network. It can not only improve the ability of the CNN to process fine-grained image classification but also reallocate the weighting of feature maps, improve the attention given to the region of interest, and suppress other invalid information. At the same time, the atrous convolution layer was also designed following the idea of HDC in the segmentation network, which increases the receptive field of the network and simplifies the complexity of the model. In addition, in order to obtain multi-scale information from images, features with rich contextual information are extracted by ASPP to improve the accuracy of the segmentation results of the segmentation network with a small overhead. These factors allow the designed model to satisfy the requirements of high accuracy and strong real-time performance for the industrial surface defect detection method.
Design of the segmentation network
16First, the segmentation network learns the features of the input samples from 8 convolutional layers and 3 pooling layers and generates a feature map with 128 channels. In Fig. 4, 2-conv and 4-conv represent the atrous convolution dilation rates of 2 and 4, respectively. The convolution layer mentioned includes the batch normalization (BN) and nonlinear ReLU layer. When designing the convolutional layer, the kernel size is 3, the stride is 1, and the dilation rate is [1, 2, 4] as a basic convolution block, which satisfies the idea of HDC design. The use of a 2×2 kernel pooling layer in the network can not only reduce the computational burden of the network but also eliminate the interference information of invalid noise. Next, ASPP is used to further obtain multi-scale information of the image. Before passing through two convolutional layers with 512 channels, a 1×1 convolutional layer is used to map the number of channels of the feature map to 512 for consistency with the number of subsequent convolutional layer channels. Then, the CBAM is used to adjust the weight distribution of the feature maps to create a stronger representational ability and improve the segmentation accuracy of the segmentation network. Finally, a 1×1 convolutional layer and a sigmoid activation function are used to map the output results between 0 and 1 to generate a single-channel segmentation result whose resolution is 1/8 of the input image. The structure of the segmentation network and the detailed parameters settings are shown in Table 1. Xie, Xu, Li, Wang and Wan, Journal of Advanced Mechanical Design, Systems, and Manufacturing, Vol.16, No.6 (2022)
Design of the decision network
17The decision network connects the feature map (512 channels) modified by the CBAM in the segmentation network with the segmentation result (1 channel) output by the segmentation network and produces a feature map with 513 channels as the input of the decision network (see Fig. 4). In order to force the decision network to learn global information more easily and reduce the number of network calculations, a max-pooling layer with a step size of 2 is used to halve the length and width of the feature map. Then, a 3×3 convolutional layer and two residual blocks are used to learn the feature map after pooling. Each convolutional layer is followed by a BN and nonlinear ReLU layer to accelerate network convergence. Finally, max pooling and average pooling were carried out for the learned feature map and the single-channel output of the segmentation network, respectively, and were connected to obtain 66 output neurons. The output of the decision network was obtained through the FC layer and the sigmoid activation function. The specific network structure and parameter configuration of the decision network are shown in Table 2.
Model training
18The segmentation task of the segmentation network and the classification task of the decision network can be regarded as the binary classification problem at the pixel level and the image level, respectively. Therefore, the crossentropy loss function of the binary classification (namely BCE loss) is used to train the network. The loss function of the decision network is shown as Eq. (5)
19where x represents the image-level training sample and y(x) is the label of the input sample x. A value of 1 indicates that the input sample x is a defect image (positive samples), while a value of 0 corresponds to a non-defect image (negative samples). In addition, is the parameter learned by the network, and the probability value of the input sample x belonging to the defective sample through the parameter is represented by
20. The loss function of the segmentation network is shown as Eq. (6).
21The pixel point set of the input sample x is represented by X, N is the total number of pixels in the input sample x, while h, w represents the length and width of the input image respectively. Since the scale of the objects trained by the segmentation network and the decision network are not consistent, it is necessary to train the segmentation network and the decision network separately to achieve a better effect. The specific method is to first train the segmentation network at the pixel level from 0 and then freeze the trained weights. Only the decision networks are trained at the image level. Fine-tuning the decision network avoids the issue of overfitting from the large number of weights in the segmentation network.
22In addition, the number of positive and negative samples in the train set are also extremely unbalanced. In this dataset, the number of negative samples is about 8 times higher than the number of positive samples, and the number of pixels in the non-defective area is also much higher than in the defective area. If this phenomenon is ignored, the imbalance will not only slow down the convergence speed of the network but also affect the final detection performance of the model. Therefore, we adopted a new sampling method instead of the original random sampling method to alleviate the imbalance in the dataset. Specifically, the positive and negative samples were trained alternately to ensure that samples of the same category were not continuously trained. In this way, the imbalance in the data set is alleviated.
Experimental evaluation 4.1 Dataset
23The surface defect dataset (KolektorSDD) (Tabernik et al., 2020) is was constructed from defected electrical commutators by the Kolektor team. The surface area of each electrical commutator was completely covered with eight images, which were collected in an industrial environment with a resolution of 1408×512 pixels to ensure high-quality images. A total of 50 defective electrical commutators were sampled in the dataset, each with up to eight relevant surfaces, and a total of 399 images were collected. There were 52 positive sample images with defective areas, and the remaining 347 images were negative samples without defective pixels. In the experiment described herein, the dataset is divided into a train set and a test set at a ratio of 7:3. There are 279 images in the train set, of which 33 are defective images and the rest are non-defective images with no defective pixels. Some positive samples with defective pixels and negative samples without defective pixels are shown in Fig. 5. The first and second rows are non-defective samples and annotations, while the third and fourth rows are the defective samples of defective pixels and annotations.
Implementation details
24The network structure was implemented using the PyTorch (Paszke et al., 2017) framework. Both the segmentation network and the decision network were trained using the Adam (Kingma et al., 2014) optimizer with the exponential decay parameters 1 = 0.9 and 2 = 0.99. The dilation rate of the atrous convolution block is 1, 2, 4, the kernel size is 3, and the stride size is 1. The learning rate of the segmentation network was set to 0.01 and the batch size was set to 5, while the learning rate and the batch size of the decision network were set to 0.1 and 7, respectively. The segmentation network and the decision network trained 100 epoch and 20 epoch iterations, respectively, to reach convergence on the KolektorSDD. Due to the limitation of the experimental equipment, the resolution of the input image was preprocessed, and the resolution of each image was set to 704×256 pixels. In the MTD, the segmentation network and the decision network respectively trained 920 epochs and 160 epochs to convergence, and the resolution of the input image was set as 500×500.
25The experimental development environment is as follows: CPU: AMD Ryzen 5 3600 6-core Processor@ 3.60GHz; GPU: NVIDIA GeForce RTX2060 with 6G memory; software environment: PyCharm, python 3.7.4.
Comparison with other methods
26To verify the effectiveness and superiority of the proposed method, this paper compares the proposed method with several mainstream image segmentation methods based on deep learning. The following will be evaluated from the accuracy and real-time performance of the model.
Accuracy comparison of models
27Experiment 1. Because the detection results of the decision network are more important than the segmentation results of the segmentation network, the evaluation of the decision network is only regarded as the final result to measure the quality of the model. In this paper, the proposed model and other mainstream models based on image segmentation are trained and tested on the KolektorSDD dataset, and the accuracy of the model is evaluated by FN, FP, and AP performance metrics. The results are shown in Table 4. It can be seen from Table 4 that the method proposed in this paper is noticeably superior to the other three methods, reaching the detection result of zero errors. Our model had an AP that was 3.9, 2, and 0.1% more precise than the U-Net (Ronneberger et al., 2015), DeepLab v3+ , and Segmentation decision net (Tabernik et al., 2020) models, respectively, which satisfies the high-accuracy industry requirements for the surface defect detection of products.
Real-time comparison of models
28Experiment 2. In this experiment, the real-time performances of several models are compared and evaluated. The results of the evaluation are measured by the calculation amount of the model, the size of the parameters, and the detection time of a single image. The results are shown in Table 5. Table 5 shows that the model proposed in this paper takes only 18 ms to detect a single image. Compared with the U-Net and Segmentation decision net models, our model is faster by 44 and 30 ms, respectively. The main reason for this is that our model makes fewer calculations and uses fewer parameters, which are only one-third and one-half that of the U-Net and Segmentation decision net models, respectively. DeepLab v3+ with atrous convolution is also used in the model. The number of parameters and calculation amount of the model were only 18.2 GMac and 5.8 M, and the detection time of a single image was less than that of our model.
29In an industrial environment, the accuracy and real-time detection of product surface defects are equally important. If we only blindly pursue the accuracy of the detection model and constantly deepen the layers of the network model, then the real-time performance of the model will inevitably be hindered. Therefore, a better product surface defect detection model needs to balance accuracy and real-time performance. To provide a more obvious comparison effect, the comparison results of the above four models on the KolektorSDD dataset were analyzed in regard to the accuracy and real-time performance of the model (Fig. 7). Compared with the U-Net and Segmentation decision nets, the average accuracy of our model and the detection speed of a single image were respectively higher and faster. Compared with the DeepLab v3+ model, although our model takes slightly longer to detect a single image, the accuracy of the defect image detection model is significantly higher.
Comparison of model results
30Experiment 3. In order to demonstrate the effect of the above four models on the detection and segmentation of product surface defects, the experimental results of the four models on the KolektorSDD dataset were collected (Fig. 8). In Fig. 8(a), the detection ability of each model for the defect sample is shown, and Fig. 8(b) shows the detection ability for the non-defect sample. In Figs. 8(a) and 8(b), the first column is the input original image, the last column is the ground truth label corresponding to the original image, and the middle four columns represent the detection and segmentation results of each model. The value in the segmentation results image represents the probability of the input image being a defect image. The results of Fig. 8(a) show that the defect area segmented by our model on the defect image is closer to the ground truth label, and the probability of predicting that the image is a defect image is also higher. It can be concluded from Fig. 8(b) that our model can exclude the interference of noise when processing non-defective samples and can differentiate non-defective samples more accurately.
The model is evaluated on MTD
31Experiment 4. To verify the universality and effectiveness of the model, our model is also evaluated on the MTD dataset. In the MTD, we calculate the area under the receiver operating characteristic (AUROC) curve of the image level on each test set to measure the performance of the model defect detection method. As can be seen from Table 6, our model achieved the highest AUROC curve of 99.4%, up to 22.8% higher than that of other models (Rudolph et al., 2020, Huang et al., 2020Samet et al., 2018;Thomas et al., 2021). It can be seen from the data in the last two columns of Table 6 that the complexity of our model is much lower than that of other models, and the amount of calculations and parameter size is only 32.61 GMac and 5.37 M, respectively. Although the amount of computation of our model is higher than that of DifferNet, the number of parameters employed was much fewer and the AUC of our model was 1.7% higher compared to DifferNet. Unlike other networks, DifferNet is mainly composed of fully connected layers and has fewer convolution layers. However, fully connected layers contribute much less to model computation and much more to the model parameter number compared to convolution layers. This explains the large number of parameters, shown in Table 6, as well as the lower computational ability of DifferNet compared to other models. The ROC curve in Fig. 9 shows that our method provides a higher true positive rate for any false positive rate.
Ablation studies
32To better understand the influence of CBAM, atrous convolution, and ASPP modules on model performance, ablation experiments were conducted. All the studies were conducted using the same computer equipment. CBAM, atrous convolution, and ASPP modules were added to the proposed model gradually, and the KolektorSDD dataset was configured with the same hyperparameter for training and testing and the experimental results are shown in Table 7. The first three columns respectively indicate whether CBAM, atrous convolution, or ASPP modules are embedded in the model, while the last three columns show the performance of the corresponding models. It can be seen from rows 1 and 2 of Table 7 that the introduction of CBAM can effectively improve the detection accuracy of the model with negligible overheads. This is because CBAM not only improves the representational ability of CNN but also allocates different weights according to the importance of information, which greatly improves the accuracy of the model. Comparing rows 2 and 3, the introduction of atrous convolution into the network will greatly reduce the number of computations and parameters in the network. It greatly simplifies the network structure of the model, speeds up the detection speed of the model, and ensures that its detection performance is not affected. Based on the data shown in rows 3 and 4, it can be concluded that the introduction of ASPP in the model can greatly increase the capability of the model to detect defects, which verifies the effectiveness of the multi-scale sampling method for a given feature map with different rates of atrous convolution. Therefore, the combination of CBAM, atrous convolution, and ASPP technology in the model can not only improve the detection accuracy of the network but also reduce its complexity, thus achieving a good balance between the accuracy and real-time performance of the model in the detection of defects.
33In order to obtain the most reasonable dilation rate configuration of the atrous convolution block, we grouped every 3 blocks and changed their dilation rates. As shown in Table 8, we conducted experiments on 5 groups of convolution blocks with different dilation rates, where (1, 2, 1) represents the dilation rates of 3 blocks as 1, 2, and 1, respectively. It can be concluded from Table 8 that as the expansion rate increases, the receptive field of the model also increases. The accuracy of the model defect detection method first increases and then decreases as the expansion rate increases, reaching a maximum when the dilation rate is (1, 2, 4). It was found that when the receptive field of the network becomes too large, the receptive field may lose image detail, reducing the defect detection accuracy of the model. Therefore, we chose the atrous convolution block with a dilation rate of (1, 2, 4) as the final model configuration.
Conclusion
34In this paper, an efficient surface defect detection model based on CBAM and atrous convolution has been proposed for the detection of product surface defects in an industrial environment, effectively performing segmentation and detection tasks to detect the surface defects of the products. In addition, CBAM, atrous convolution, and ASPP were introduced into the segmentation network and achieved good results in both accuracy and speed of detection. Experimental results revealed that the proposed model performed better than current mainstream defect detection methods for both KolektorSDD and magnetic tile datasets. However, when training the segmentation network, a small number of images with pixel-level annotations on defective images were still needed as training data. To remove the limitation of the required pixel-level annotation data on the model, improving the learning method of the entire model to weakly supervised or even unsupervised learning has become the direction of subsequent research.
Introduction
35In industrial manufacturing, in order to ensure the quality of products, the most effective way is to inspect the surface of the product. Usually, it is trained workers who identify complex surface defects, but this method is susceptible to worker inexperience and subjective factors. This time-consuming and unreliable process cannot be adapted to the developing trend of industrial automation. With the development of intelligent manufacturing, defect detection technology based on machine vision (MV) is favored by most scholars. Sun et al. proposed a background subtraction method based on the Gaussian mixture model to extract the feature area of weld defects and designed a weld detection and classification algorithm (Sun et al., 2019). Shen et al. used template matching and sub-pixel precision to precisely position a printed circuit board (PCB) and then used smart cameras and industrial robots to complete the PCB defect detection (Shen et al., 2018). Huang et al. used a support vector machine (SVM) classifier to identify six common glass bottle defects, which addresses the low classification accuracy of existing machine vision defect detection systems (Huang et al., 2016). Xie et al. proposed an improved sub-pixel detection algorithm combining coarse and fine positioning, using Otsu's method to achieve sub-pixel precise positioning (Xie et al., 2016). The above methods can satisfy the defect detection and classification requirements for specific problems to a certain extent. However, it is difficult to satisfy the real-time, high-accuracy, and generality requirements of defect detection in most industrial environments using defect detection methods based on machine vision due to their long development cycle, the interference of acquisition environmental noise, and the difficulty in finding a general template as a reference for various detection objects.
36In recent years, with the development of deep learning (DL), especially the in-depth study of convolutional neural networks (CNNs), deep learning has been successfully applied to various image-related tasks (Krizhevsky et al., 2012). Different from conventional machine vision methods, a deep learning algorithm can effectively learn the mapping improves the performance of the network. In this paper, the most suitable configuration of atrous convolution layer is found through ablation studies. 4) Atrous spatial pyramid pooling (ASPP) (Chen et al., 2017) is used to obtain multi-scale information of images, to enhance the detection ability of defects of different sizes of the model and enhance the universality of the model.
Relevant theoretical
37To extract better features, accelerate the detection speed of the model, and enhance the real-time performance of the model, the CBAM, atrous convolution, and ASPP were introduced into the segmentation network model.
Convolutional block attention module
38The attention mechanism was first proposed in the images (Mnih et al., 2014). The introduction of the attention mechanism in the image field is a very critical technique to enable the deep network model to better focus on a local area of interest to the user while suppressing other areas that are not important. In recent years, models based on attention mechanisms have become a hot research topic and are widely used in various types of deep learning tasks such as natural language processing, image recognition (Wang et al., 2017;Xu et al., 2020), and speech recognition. CBAM is also one of many attention mechanisms, not only telling the user where to focus on but also enhancing the feature extraction ability of the area of interest. It is composed of a channel attention module and a spatial attention module that perform attention operations on the channel and spatial dimensions of the image, respectively. In addition, the use of CBAM can also improve the representational ability of CNN, force CNN to extract fine-grained image features, and make the extracted features more discriminative. The network structure of CBAM is shown in Fig. 1. The module first performs channel attention operation on the feature map to increase the weighting of effective channels and reduce the weighting of invalid channels. As shown in Eq. (1), where c M refers to the channel attention module, F is the input feature map, and the variables avg c F , max c F represent the use of average pooling and max pooling operations to aggregate the spatial information of the feature map, respectively.
39The Hadamard product operation can be carried out between the feature graph F generated by the channel attention module and the input feature graph F to obtain the input of the spatial attention module. The spatial attention module is then used to increase the attention given to the regions of interest in the spatial dimension. This is shown in Eq. (2) Xie, Xu, Li, Wang and Wan, Journal of Advanced Mechanical Design, Systems, and Manufacturing, Vol.16, No.6 (2022) Finally, the modified feature map is generated by Hadamard product of the feature graph F of the perform spatial attention module and the input feature map F .
Atrous convolution
40In the field of image semantic segmentation, it is often necessary to make dense predictions of the full resolution of the image. The designed network not only needs to pay attention to local information but also global information, which requires the network to have a larger receptive field. In general, in order to obtain a larger receptive field, a typical segmentation network uses a large-size convolution kernel with a large number of parameters, so the network becomes relatively complex and requires a lot of computing resources. Atrous convolution is a kind of convolution method proposed to solve this problem. It can increase the receptive field of the network and reduce the training time of the model while maintaining the number of network parameters and calculations. Many classical semantic segmentation networks have also adopted this idea of convolution, such as the Deeplab series (Chen et al., 2014;Chen et al., 2016). Deeplab replaces standard convolution in the network with atrous convolution, and the multi-scale atrous convolution operation of the input image can be performed, greatly reducing the complexity of the network. SSD and RFBNet ) also refer to this convolution method to simplify the network in object detection.
41Atrous convolution is often used to deal with how global information is needed in image segmentation or the need for long sequence information in speech text. It introduces a hyper-parameter called a "dilation rate" to the standard convolution, which defines the distance between each element of the convolution kernel. In other words, compared with standard convolution, atrous convolution adds a new hyper-parameter of dilation rate, whose value is equal to the number of intervals between elements of the convolution kernel. Standard convolution is actually atrous convolution with a dilation rate of 1. The introduction of atrous convolution to the network can not only avoid information loss caused by the pooling operation but also increase the receptive field of the network, allowing the network to better capture the global information of the input image. For example, by adding a hole to the standard convolution, the original 3×3 standard convolution kernel can have a larger receptive field of a 5×5 (dilated rate = 2) standard convolution kernel with the same number of parameters and calculation, which avoids the downsampling operation. Atrous convolution is defined as:
42where f[i] and g [i] are the input and output feature maps respectively, k[l] represents the convolution kernel of length l, and r is the dilated rate of the atrous convolution. When the atrous convolution is performing the convolution operation, the value of the atrous position is 0. Figure 2 illustrates the atrous convolution kernels with three different dilation rates. From left to right are the atrous convolution kernels with dilation rates r = 1, 2, and 4. As the dilation rate increases, the receptive field of the convolution kernel also becomes larger, corresponding to 3×3, 5×5, and 9×9 kernel, respectively. The receptive field of the atrous convolution is calculated as Eq. (4):
43where r is the dilation rate, k is the size of the convolution kernel, and R is the actual receptive field. Although atrous convolution has the above advantages, the random design of the dilation rate in the atrous convolution or any combination of atrous convolution in the network may greatly reduce the performance of the network. Wang et al. pointed out that blindly designing the dilation rate of the atrous convolution will make some pixels of the input sample not participate in the calculation, resulting in the gridding effect and affecting the accuracy of the network . This problem can be avoided by following hybrid dilated convolution in designing the structure of atrous convolution in the network.
Atrous spatial pyramid pooling
44Another challenge of deep convolutional neural networks for image segmentation is dealing with the existence of objects at multiple scales. A common method used to solve this is to combine the images of different scales obtained from the input image by rescaling the operation as the input of the network (Rudolph et al., 2018). This method can indeed improve the segmentation effect of the model but it also creates a computational burden, which hinders the realtime performance of the model. Another effective method is to use ASPP to resample the feature maps obtained by the deep convolutional neural network at different scales to obtain feature maps with rich contextual information.
45Motivated by spatial pyramid pooling (He et al., 2014), Chen et al. proposed ASPP, which uses multiple parallel atrous convolutions with different dilation rates to perform multi-scale sampling for a given feature map (Chen et al., 2016). This is equivalent to using multiple convolution kernels with different receptive fields to resample a given feature map, so the contextual information provided by the image can be captured at multiple scales. In order to further capture global information, Chen et al. augmented ASPP with image-level features (Chen et al., 2017). Figure 3 shows the structure of ASPP with an augmented image-level feature. The improved ASPP uses one 1×1 convolution, three 3×3 atrous convolutions with dilation rates equal to 6, 12, and 18, and image-level feature pooling to perform multi-scale sampling on the input feature map. The resulting features were then concat to obtain an output feature map with rich contextual information.
46Three kinds of atrous convolution kernels with different dilation rates.
Surface defect detection method based on CBAM and atrous convolution
47A surface defect detection model based on CBAM and atrous convolution was designed, as shown in Fig. 4. The model is mainly composed of a segmentation network and a decision network that are used to segment and detect surface defects, respectively. In the segmentation network, the data features of the input samples are first learned and a binary segmentation map is generated. Each pixel in the input samples is taken as a separate training sample for the network to increase the effective number of training samples and avoid overfitting. In the decision network, the feature map learned in the segmentation network and the segmentation results generated are used as the input of the decision network. The segmentation result is used to help the decision network better judge whether the input sample contains defects. Then, a denser and smaller space feature map is obtained after a series of convolutional and pooling operations, followed by the fully connected layer (FC) and sigmoid activation function. The final obtained input sample is the predicted value of the defective image. Fig. 4 The network model structure of the proposed.
48It has been noted that CNN has poor performance in fine-grained image classification, but the surface defect segmentation task needs to deal with defects at the pixel level (Zheng et al., 2017;Lin et al., 2018). Therefore, a CBAM with negligible overheads was introduced into the segmentation network. It can not only improve the ability of the CNN to process fine-grained image classification but also reallocate the weighting of feature maps, improve the attention given to the region of interest, and suppress other invalid information. At the same time, the atrous convolution layer was also designed following the idea of HDC in the segmentation network, which increases the receptive field of the network and simplifies the complexity of the model. In addition, in order to obtain multi-scale information from images, features with rich contextual information are extracted by ASPP to improve the accuracy of the segmentation results of the segmentation network with a small overhead. These factors allow the designed model to satisfy the requirements of high accuracy and strong real-time performance for the industrial surface defect detection method.
Design of the segmentation network
49First, the segmentation network learns the features of the input samples from 8 convolutional layers and 3 pooling layers and generates a feature map with 128 channels. In Fig. 4, 2-conv and 4-conv represent the atrous convolution dilation rates of 2 and 4, respectively. The convolution layer mentioned includes the batch normalization (BN) and nonlinear ReLU layer. When designing the convolutional layer, the kernel size is 3, the stride is 1, and the dilation rate is [1, 2, 4] as a basic convolution block, which satisfies the idea of HDC design. The use of a 2×2 kernel pooling layer in the network can not only reduce the computational burden of the network but also eliminate the interference information of invalid noise. Next, ASPP is used to further obtain multi-scale information of the image. Before passing through two convolutional layers with 512 channels, a 1×1 convolutional layer is used to map the number of channels of the feature map to 512 for consistency with the number of subsequent convolutional layer channels. Then, the CBAM is used to adjust the weight distribution of the feature maps to create a stronger representational ability and improve the segmentation accuracy of the segmentation network. Finally, a 1×1 convolutional layer and a sigmoid activation function are used to map the output results between 0 and 1 to generate a single-channel segmentation result whose resolution is 1/8 of the input image. The structure of the segmentation network and the detailed parameters settings are shown in Table 1. Xie, Xu, Li, Wang and Wan, Journal of Advanced Mechanical Design, Systems, and Manufacturing, Vol.16, No.6 (2022)
Design of the decision network
50The decision network connects the feature map (512 channels) modified by the CBAM in the segmentation network with the segmentation result (1 channel) output by the segmentation network and produces a feature map with 513 channels as the input of the decision network (see Fig. 4). In order to force the decision network to learn global information more easily and reduce the number of network calculations, a max-pooling layer with a step size of 2 is used to halve the length and width of the feature map. Then, a 3×3 convolutional layer and two residual blocks are used to learn the feature map after pooling. Each convolutional layer is followed by a BN and nonlinear ReLU layer to accelerate network convergence. Finally, max pooling and average pooling were carried out for the learned feature map and the single-channel output of the segmentation network, respectively, and were connected to obtain 66 output neurons. The output of the decision network was obtained through the FC layer and the sigmoid activation function. The specific network structure and parameter configuration of the decision network are shown in Table 2.
Model training
51The segmentation task of the segmentation network and the classification task of the decision network can be regarded as the binary classification problem at the pixel level and the image level, respectively. Therefore, the crossentropy loss function of the binary classification (namely BCE loss) is used to train the network. The loss function of the decision network is shown as Eq. (5)
52where x represents the image-level training sample and y(x) is the label of the input sample x. A value of 1 indicates that the input sample x is a defect image (positive samples), while a value of 0 corresponds to a non-defect image (negative samples). In addition, is the parameter learned by the network, and the probability value of the input sample x belonging to the defective sample through the parameter is represented by
53. The loss function of the segmentation network is shown as Eq. (6).
54The pixel point set of the input sample x is represented by X, N is the total number of pixels in the input sample x, while h, w represents the length and width of the input image respectively. Since the scale of the objects trained by the segmentation network and the decision network are not consistent, it is necessary to train the segmentation network and the decision network separately to achieve a better effect. The specific method is to first train the segmentation network at the pixel level from 0 and then freeze the trained weights. Only the decision networks are trained at the image level. Fine-tuning the decision network avoids the issue of overfitting from the large number of weights in the segmentation network.
55In addition, the number of positive and negative samples in the train set are also extremely unbalanced. In this dataset, the number of negative samples is about 8 times higher than the number of positive samples, and the number of pixels in the non-defective area is also much higher than in the defective area. If this phenomenon is ignored, the imbalance will not only slow down the convergence speed of the network but also affect the final detection performance of the model. Therefore, we adopted a new sampling method instead of the original random sampling method to alleviate the imbalance in the dataset. Specifically, the positive and negative samples were trained alternately to ensure that samples of the same category were not continuously trained. In this way, the imbalance in the data set is alleviated.
Experimental evaluation 4.1 Dataset
56The surface defect dataset (KolektorSDD) (Tabernik et al., 2020) is was constructed from defected electrical commutators by the Kolektor team. The surface area of each electrical commutator was completely covered with eight images, which were collected in an industrial environment with a resolution of 1408×512 pixels to ensure high-quality images. A total of 50 defective electrical commutators were sampled in the dataset, each with up to eight relevant surfaces, and a total of 399 images were collected. There were 52 positive sample images with defective areas, and the remaining 347 images were negative samples without defective pixels. In the experiment described herein, the dataset is divided into a train set and a test set at a ratio of 7:3. There are 279 images in the train set, of which 33 are defective images and the rest are non-defective images with no defective pixels. Some positive samples with defective pixels and negative samples without defective pixels are shown in Fig. 5. The first and second rows are non-defective samples and annotations, while the third and fourth rows are the defective samples of defective pixels and annotations.
Implementation details
57The network structure was implemented using the PyTorch (Paszke et al., 2017) framework. Both the segmentation network and the decision network were trained using the Adam (Kingma et al., 2014) optimizer with the exponential decay parameters 1 = 0.9 and 2 = 0.99. The dilation rate of the atrous convolution block is 1, 2, 4, the kernel size is 3, and the stride size is 1. The learning rate of the segmentation network was set to 0.01 and the batch size was set to 5, while the learning rate and the batch size of the decision network were set to 0.1 and 7, respectively. The segmentation network and the decision network trained 100 epoch and 20 epoch iterations, respectively, to reach convergence on the KolektorSDD. Due to the limitation of the experimental equipment, the resolution of the input image was preprocessed, and the resolution of each image was set to 704×256 pixels. In the MTD, the segmentation network and the decision network respectively trained 920 epochs and 160 epochs to convergence, and the resolution of the input image was set as 500×500.
58The experimental development environment is as follows: CPU: AMD Ryzen 5 3600 6-core Processor@ 3.60GHz; GPU: NVIDIA GeForce RTX2060 with 6G memory; software environment: PyCharm, python 3.7.4.
Comparison with other methods
59To verify the effectiveness and superiority of the proposed method, this paper compares the proposed method with several mainstream image segmentation methods based on deep learning. The following will be evaluated from the accuracy and real-time performance of the model.
Accuracy comparison of models
60Experiment 1. Because the detection results of the decision network are more important than the segmentation results of the segmentation network, the evaluation of the decision network is only regarded as the final result to measure the quality of the model. In this paper, the proposed model and other mainstream models based on image segmentation are trained and tested on the KolektorSDD dataset, and the accuracy of the model is evaluated by FN, FP, and AP performance metrics. The results are shown in Table 4. It can be seen from Table 4 that the method proposed in this paper is noticeably superior to the other three methods, reaching the detection result of zero errors. Our model had an AP that was 3.9, 2, and 0.1% more precise than the U-Net (Ronneberger et al., 2015), DeepLab v3+ , and Segmentation decision net (Tabernik et al., 2020) models, respectively, which satisfies the high-accuracy industry requirements for the surface defect detection of products.
Real-time comparison of models
61Experiment 2. In this experiment, the real-time performances of several models are compared and evaluated. The results of the evaluation are measured by the calculation amount of the model, the size of the parameters, and the detection time of a single image. The results are shown in Table 5. Table 5 shows that the model proposed in this paper takes only 18 ms to detect a single image. Compared with the U-Net and Segmentation decision net models, our model is faster by 44 and 30 ms, respectively. The main reason for this is that our model makes fewer calculations and uses fewer parameters, which are only one-third and one-half that of the U-Net and Segmentation decision net models, respectively. DeepLab v3+ with atrous convolution is also used in the model. The number of parameters and calculation amount of the model were only 18.2 GMac and 5.8 M, and the detection time of a single image was less than that of our model.
62In an industrial environment, the accuracy and real-time detection of product surface defects are equally important. If we only blindly pursue the accuracy of the detection model and constantly deepen the layers of the network model, then the real-time performance of the model will inevitably be hindered. Therefore, a better product surface defect detection model needs to balance accuracy and real-time performance. To provide a more obvious comparison effect, the comparison results of the above four models on the KolektorSDD dataset were analyzed in regard to the accuracy and real-time performance of the model (Fig. 7). Compared with the U-Net and Segmentation decision nets, the average accuracy of our model and the detection speed of a single image were respectively higher and faster. Compared with the DeepLab v3+ model, although our model takes slightly longer to detect a single image, the accuracy of the defect image detection model is significantly higher.
Comparison of model results
63Experiment 3. In order to demonstrate the effect of the above four models on the detection and segmentation of product surface defects, the experimental results of the four models on the KolektorSDD dataset were collected (Fig. 8). In Fig. 8(a), the detection ability of each model for the defect sample is shown, and Fig. 8(b) shows the detection ability for the non-defect sample. In Figs. 8(a) and 8(b), the first column is the input original image, the last column is the ground truth label corresponding to the original image, and the middle four columns represent the detection and segmentation results of each model. The value in the segmentation results image represents the probability of the input image being a defect image. The results of Fig. 8(a) show that the defect area segmented by our model on the defect image is closer to the ground truth label, and the probability of predicting that the image is a defect image is also higher. It can be concluded from Fig. 8(b) that our model can exclude the interference of noise when processing non-defective samples and can differentiate non-defective samples more accurately.
The model is evaluated on MTD
64Experiment 4. To verify the universality and effectiveness of the model, our model is also evaluated on the MTD dataset. In the MTD, we calculate the area under the receiver operating characteristic (AUROC) curve of the image level on each test set to measure the performance of the model defect detection method. As can be seen from Table 6, our model achieved the highest AUROC curve of 99.4%, up to 22.8% higher than that of other models (Rudolph et al., 2020, Huang et al., 2020Samet et al., 2018;Thomas et al., 2021). It can be seen from the data in the last two columns of Table 6 that the complexity of our model is much lower than that of other models, and the amount of calculations and parameter size is only 32.61 GMac and 5.37 M, respectively. Although the amount of computation of our model is higher than that of DifferNet, the number of parameters employed was much fewer and the AUC of our model was 1.7% higher compared to DifferNet. Unlike other networks, DifferNet is mainly composed of fully connected layers and has fewer convolution layers. However, fully connected layers contribute much less to model computation and much more to the model parameter number compared to convolution layers. This explains the large number of parameters, shown in Table 6, as well as the lower computational ability of DifferNet compared to other models. The ROC curve in Fig. 9 shows that our method provides a higher true positive rate for any false positive rate.
Ablation studies
65To better understand the influence of CBAM, atrous convolution, and ASPP modules on model performance, ablation experiments were conducted. All the studies were conducted using the same computer equipment. CBAM, atrous convolution, and ASPP modules were added to the proposed model gradually, and the KolektorSDD dataset was configured with the same hyperparameter for training and testing and the experimental results are shown in Table 7. The first three columns respectively indicate whether CBAM, atrous convolution, or ASPP modules are embedded in the model, while the last three columns show the performance of the corresponding models. It can be seen from rows 1 and 2 of Table 7 that the introduction of CBAM can effectively improve the detection accuracy of the model with negligible overheads. This is because CBAM not only improves the representational ability of CNN but also allocates different weights according to the importance of information, which greatly improves the accuracy of the model. Comparing rows 2 and 3, the introduction of atrous convolution into the network will greatly reduce the number of computations and parameters in the network. It greatly simplifies the network structure of the model, speeds up the detection speed of the model, and ensures that its detection performance is not affected. Based on the data shown in rows 3 and 4, it can be concluded that the introduction of ASPP in the model can greatly increase the capability of the model to detect defects, which verifies the effectiveness of the multi-scale sampling method for a given feature map with different rates of atrous convolution. Therefore, the combination of CBAM, atrous convolution, and ASPP technology in the model can not only improve the detection accuracy of the network but also reduce its complexity, thus achieving a good balance between the accuracy and real-time performance of the model in the detection of defects.
66In order to obtain the most reasonable dilation rate configuration of the atrous convolution block, we grouped every 3 blocks and changed their dilation rates. As shown in Table 8, we conducted experiments on 5 groups of convolution blocks with different dilation rates, where (1, 2, 1) represents the dilation rates of 3 blocks as 1, 2, and 1, respectively. It can be concluded from Table 8 that as the expansion rate increases, the receptive field of the model also increases. The accuracy of the model defect detection method first increases and then decreases as the expansion rate increases, reaching a maximum when the dilation rate is (1, 2, 4). It was found that when the receptive field of the network becomes too large, the receptive field may lose image detail, reducing the defect detection accuracy of the model. Therefore, we chose the atrous convolution block with a dilation rate of (1, 2, 4) as the final model configuration.
Conclusion
67In this paper, an efficient surface defect detection model based on CBAM and atrous convolution has been proposed for the detection of product surface defects in an industrial environment, effectively performing segmentation and detection tasks to detect the surface defects of the products. In addition, CBAM, atrous convolution, and ASPP were introduced into the segmentation network and achieved good results in both accuracy and speed of detection. Experimental results revealed that the proposed model performed better than current mainstream defect detection methods for both KolektorSDD and magnetic tile datasets. However, when training the segmentation network, a small number of images with pixel-level annotations on defective images were still needed as training data. To remove the limitation of the required pixel-level annotation data on the model, improving the learning method of the entire model to weakly supervised or even unsupervised learning has become the direction of subsequent research.
참고문헌 25건
- U-Net: Convolutional Networks for Biomedical Image Segmentation Lecture notes in computer science · Springer Science+Business Media · 2015 10.1007/978-3-319-24574-4_28
- DeepLab: Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs IEEE Transactions on Pattern Analysis and Machine Intelligence · IEEE Computer Society · 2017 10.1109/tpami.2017.2699184
- Understanding Convolution for Semantic Segmentation 2018 10.1109/wacv.2018.00163
- Bilinear Convolutional Neural Networks for Fine-Grained Visual Recognition IEEE Transactions on Pattern Analysis and Machine Intelligence · IEEE Computer Society · 2017 10.1109/tpami.2017.2723400
- Learning Multi-attention Convolutional Neural Network for Fine-Grained Image Recognition 2017 10.1109/iccv.2017.557
- An Unsupervised-Learning-Based Approach for Automated Defect Inspection on Textured Surfaces IEEE Transactions on Instrumentation and Measurement · Institute of Electrical and Electronics Engineers · 2018 10.1109/tim.2018.2795178
- A Surface Defect Detection Method Based on Positive Samples Lecture notes in computer science · Springer Science+Business Media · 2018 10.1007/978-3-319-97310-4_54
- CBAM: Convolutional Block Attention Module Lecture notes in computer science · Springer Science+Business Media · 2018 10.1007/978-3-030-01234-2_1
- Surface defect saliency of magnetic tile The Visual Computer · Springer Science+Business Media · 2018 10.1007/s00371-018-1588-5
- Design and Implementation of PCB Detection and Classification System Based on Machine Vision Lecture notes in electrical engineering · Springer Science+Business Media · 2018 10.1007/978-981-13-2375-1_32
- An Effective Method of Weld Defect Detection and Classification Based on Machine Vision IEEE Transactions on Industrial Informatics · Institute of Electrical and Electronics Engineers · 2019 10.1109/tii.2019.2896357
- An improved industrial sub-pixel edge detection algorithm based on coarse and precise location Journal of Ambient Intelligence and Humanized Computing · Springer Science+Business Media · 2019 10.1007/s12652-019-01232-2
- Surface defect classification of steels with a new semi-supervised learning method Optics and Lasers in Engineering · Elsevier BV · 2019 10.1016/j.optlaseng.2019.01.011
- A High-Efficiency Fully Convolutional Networks for Pixel-Wise Surface Defect Detection IEEE Access · Institute of Electrical and Electronics Engineers · 2019 10.1109/access.2019.2894420
- An End-to-End Steel Surface Defect Detection Approach via Fusing Multiple Hierarchical Features IEEE Transactions on Instrumentation and Measurement · Institute of Electrical and Electronics Engineers · 2019 10.1109/tim.2019.2915404
- Semi-supervised defect classification of steel surface based on multi-training and generative adversarial network Optics and Lasers in Engineering · Elsevier BV · 2019 10.1016/j.optlaseng.2019.06.020
- Residual Attention Network for Image Classification 2017 10.1109/cvpr.2017.683
- Receptive Field Block Net for Accurate and Fast Object Detection Lecture notes in computer science · Springer Science+Business Media · 2018 10.1007/978-3-030-01252-6_24
- Encoder-Decoder with Atrous Separable Convolution for Semantic Image Segmentation Lecture notes in computer science · Springer Science+Business Media · 2018 10.1007/978-3-030-01234-2_49
- A Weakly Supervised Surface Defect Detection Based on Convolutional Neural Network IEEE Access · Institute of Electrical and Electronics Engineers · 2020 10.1109/access.2020.2977821
- Nondestructive Defect Detection in Castings by Using Spatial Attention Bilinear Convolutional Neural Network IEEE Transactions on Industrial Informatics · Institute of Electrical and Electronics Engineers · 2020 10.1109/tii.2020.2985159
- Segmentation-based deep-learning approach for surface-defect detection Journal of Intelligent Manufacturing · Springer Science+Business Media · 2019 10.1007/s10845-019-01476-x
- SSD: Single Shot MultiBox Detector Lecture notes in computer science · Springer Science+Business Media · 2016 10.1007/978-3-319-46448-0_2
- Same Same But DifferNet: Semi-Supervised Defect Detection with Normalizing Flows 2021 10.1109/wacv48630.2021.00195
- Few-Shot Defect Segmentation Leveraging Abundant Defect-Free Training Samples Through Normal Background Regularization And Crop-And-Paste Operation 2022 IEEE International Conference on Multimedia and Expo (ICME) · 2021 10.1109/icme51207.2021.9428468