원시데이터 수집 시스템
선정목록으로

A Method for Surface Defect Detection Based on Multiscale Feature Fusion and Pyramid Attention

간접 관련 산업용 섬유 · (17) 스펀본드 부직포 (3) 자동차 인테리어 소재(11) 배리어 필름(12) 증착 필름

기본 정보

저자
  1. Ying Tang — School of Computer Science and Artificial Intelligence, Changzhou University, Changzhou, China
  2. Hongyuan Wang — School of Computer Science and Artificial Intelligence, Changzhou University, Changzhou, China
  3. Qunying Zhou — School of Computer Science and Artificial Intelligence, Changzhou University, Changzhou, China
  4. Boyan Sun — School of Computer Science and Artificial Intelligence, Changzhou University, Changzhou, China
DOI
10.1109/access.2024.3374131
저널
IEEE Access
발행년도
2024
발행기관
Institute of Electrical and Electronics Engineers
피인용수
0
라이선스
cc-by-nc-nd
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1109/access.2024.3374131
토픽
Surface Roughness and Optical Measurements
OpenAlex ID
W4392449567

평가 내용

관련도
간접 관련
사업분야
산업용 섬유 · (17) 스펀본드 부직포
부 분야
(3) 자동차 인테리어 소재, (11) 배리어 필름, (12) 증착 필름
R&D 측면
분석·모델링
확신도
0.70
근거 용어
surface defect detection, industrial production, convolutional neural networks, multi-scale feature fusion, quality control
판단 근거
본 논문은 산업 생산 공정 중 제품 표면의 결함을 탐지하는 딥러닝 알고리즘을 다루고 있습니다. 이는 코오롱인더스트리의 부직포(17), 자동차 소재(3), 필름(11, 12) 등 다양한 제조 공정의 품질 관리(Quality Control) 시스템에 적용 가능한 기술입니다.
R&D 활용 포인트
섬유, 필름, 인공피혁 등 코오롱인더스트리의 주요 제품 제조 공정에서 비전 검사(Vision Inspection) 시스템의 정확도를 높이고 불량률을 낮추는 AI 모델 고도화에 활용 가능합니다.
평가 입력
본문 42,244자 중 30,032자 발췌

초록

The two-stage defect detection model needs to pay attention to the results of the segmentation network and the classification network, and the results of the segmentation network will have an impact on the classification network. Previous models ignored shallow features in the segmentation network and used relatively simple classification networks that could not make good use of the features of the segmentation network. This paper proposes a surface defect detection algorithm based on multi-scale feature fusion and pyramid attention(MFFPA). First, a multi-scale feature fusion module is added to the segmentation network to fuse shallow features and extract more comprehensive feature information; then a pyramid attention module is added to the classification network to increase the receptive field of the model and enhance the discriminative ability of the model. The method proposed in this article was verified on four datasets, and the experimental results show that the added module can effectively improve the accuracy of the model.

본문 42,244자

본문 펼치기
Date of publication xxxx 00, 0000, date of current version xxxx 00, 0000. _Digital Object Identifier 10.1109/ACCESS.2023.1120000_ ## A Method for Surface Defect Detection Based on Multiscale Feature Fusion and Pyramid Attention YING TANG <sup>1</sup>, HONGYUAN WANG <sup>1</sup>, QUNYING ZHOU <sup>1</sup>, AND BOYAN SUN <sup>1</sup> 1School of Computer Science and Artificial Intelligence, Changzhou University, 213000, China Corresponding author: HongYuan Wang (e-mail: hywang@cczu.edu.cn). This work was supported by the National Natural Science Foundation of China under Grant 61976028, and the Postgraduate Research & Practice Innovation Program of Jiangsu Province under Grant KYCX22_ 3068. ABSTRACT The two-stage defect detection model needs to pay attention to the results of the segmentation network and the classification network, and the results of the segmentation network will have an impact on the classification network. Previous models ignored shallow features in the segmentation network and used relatively simple classification networks that could not make good use of the features of the segmentation network. This paper proposes a surface defect detection algorithm based on multi-scale feature fusion and pyramid attention(MFFPA). First, a multi-scale feature fusion module is added to the segmentation network to fuse shallow features and extract more comprehensive feature information; then a pyramid attention module is added to the classification network to increase the receptive field of the model and enhance the discriminative ability of the model. The method proposed in this article was verified on four datasets, and the experimental results show that the added module can effectively improve the accuracy of the model. INDEX TERMS Channel attention,Convolutional neural networks,Defect detection, Multi scale feature fusion. I. INTRODUCTION RODUCT defect detection is an indispensable process in industrial production, during production monitoring, # P may occur with the degraded images, some recent image processing methods[1–5] are considered as the pre-processing steps to handle them. In addition, previous defect detection required manual screening, which was costly and inefficient, making it difficult to cover large-scale quality inspection needs. In recent years, with the continuous development of computer vision technology, algorithms based on machine learning and deep learning have begun to be applied in the field of industrial defect detection[6]. As shown in Fig.1, according to different data labels, deep learning models in defect detection can be divided into fully supervised learning models, unsupervised learning models, hybrid supervised learning models, and weakly supervised learning models[7]. The defect samples used in fully supervised learning model training all have pixel-level annotations.[8, 9]. Unsupervised learning models only use defect-free samples for training, but the accuracy of the model is lower compared to fully supervised learning models[10, 11]. Weakly supervised learning models use image-level labeled data for classification or segmentation, which can effectively utilize the data to improve the accuracy of the model[12][13]. Both unsupervised learning models and Unsupervised Weakly supervised Mixed supervision Fully supervised FIGURE 1. As shown above, data labelling in defect detection has been classified into four cases. weakly supervised learning models reduce the cost of data labeling, but the model accuracy is obviously insufficient compared with fully supervised learning models. Therefore, in the field of defect detection, some researchers have begun to use hybrid supervised learning methods, This method adds a small amount of pixel level sample data on the basis of weakly supervised learning, effectively improving the accuracy of the model.[14].Compared with weakly supervised learning, hybrid supervised learning is more flexible and can achieve better results by labeling a small amount of data at the pixel level. Previous hybrid supervised models composed an overall model by building associated sub-models, which played a guiding and strengthening role between different tasks. For example, the MixSup model proposed by Jakob et al.[15], the prediction map generated by the segmentation network of this model is concatenated with the feature map of the classification network through pooling layers, providing guidance for the final classification result. However, this model ignores the shallow features of the segmentation network and uses a relatively simple classification network.The state-of-the-art methods is MaMiNet proposed by Luo et al[16], This method achieved better results by adding external attention, but also increased the inference time of the model. In response to the problems mentioned above, this paper proposes a surface detection model based on multi-scale feature fusion and pyramid attention based on the MixSup model. This model can effectively enhance the feature extraction capability of the model and greatly improve the classification accuracy of the model. And by utilizing shallow features and reducing the number of channels for deep features, the computational complexity of the model is reduced. The main contributions of this paper are as follows: 1) This paper proposes a multi-scale feature fusion module with local sensing ability, this module can effectively fuse the shallow features of the model and improve the feature extraction capability of the model. 2) This article proposes an improved pyramid attention module, which allows the model to obtain multi-scale information, focus on more important channel features. 3) The model proposed in this article had a faster inference time than the previous best method, and the performance of the model is also competitive. II. RELATED WORK _A._ _DEFECT DETECTION_ As early as 2012, Masci et al. have used convolutional neural network to classify defects in steel[17]. But Masci et al. used a shallow network and later in 2017, Kim et al. used a deeper convolutional neural network, VGG16, for defect detection[18].In 2018 Wang et al. used a convolutional neural network based on a classification approach to achieve high accuracy in cloth defect detection[19].In 2019, Liu et al. used a lightweight MobileNet-SSD network for defect detection and achieved faster detection speed[20] ].In 2020, Huang et al.[21] introduced multi-scale features using multiple parallel null convolutional layers. Since fully supervised learning requires a large amount of labeled data, some researchers began to use Few-shot learning for defect detection.In 2023, Bao et al. proposed Triplet-Graph Reasoning Network (TGRNet)[22],achieved universal defect detection of metals with few samples. Feng et al.[23] used space-squeeze attention (SSA) module to aggregate multiscale context information of defect features.Xie et al.proposed a new Few-Shot Anomaly Detection method called GraphCore[24], which uses a small amount of normal samples to achieve fast training of new products and competitive accuracy performance. Unsupervised learning does not require defective samples for training, and is also favored by many researchers.In 2021 Marco et al. used a normalised streaming approach on the MVTEC dataset to achieve the best results for unsupervised anomaly detection [25]. In 2024,Batzner et al. con Segmentation Network Classification Network _Lseg_ _Lcls_ C Concat Pyramid Attention 232 64 64 128 256 512 513 <mark>Fully Connected</mark> 32×1 32×1 66×1 1×1 1×1 640 C Outlook <mark>avg-pooling</mark> C Attention 256 256 32 C FIGURE 2. Network structure diagram. global max-pooling global avg-pooling global max-pooling global avg-pooling 2 VOLUME 11 2023 n Conv avg-pooling max-pooling C Concat Kernel_size:n 15 256 OutLook Attention C 256 5 5 5 5 5 64 128 C 232 5 5 5 32 64 64 64 1 512 1 640 64 64 64 64 64 32 FIGURE 3. Segmentation network structure diagram. structed a lightweight teacher-student model[26],achieved detection speed of 2ms. Hyun et al. employs contrastive representation learning to collect and distribute features in a way that produces a target-oriented and easily separable representation.This article uses a hybrid supervised learning method to reduce the data annotation cost caused by full supervision. Using only a small amount of pixel-level annotation data can greatly improve the AP of the model. _B._ _ATTENTION MECHANISM_ In 2015, Xu et al.[27] proposed a visual attention theory, which introduced the attention mechanism into the field of computer vision for the first time. Later, Jie et al.[28] proposed a Squeeze-and-excitation networks(SE) to calculate the weight of each channel, and Hu et al.[29] used spatial attention to assign weights to the pixel points of each feature map. Inspired by these studies, a series of studies such as CBAM[30], SCSE [31], and CoordAttention[32] fused channel attention with spatial attention to achieve better results. The above models have been simplified in some studies, Gcnet [33] proposed a simpler spatial attention module, and ECA-Net [34]introduced one-dimensional convolution to reduce the number of parameters of the model.In order to effectively obtain and utilize the spatial information of feature maps at different scales, Zhang et al. proposed an efficient pyramid squeeze attention net(EPSA)[35]. _C._ _MULTI-SCALE FEATURE FUSION_ Multi-scale feature fusion is a common target detection technology. Its main function is to integrate features of different depths and different levels in order to better utilize multiscale features to reduce the semantic gaps between different layers.In 2017, Lin et al. proposed the classic feature pyramid network(FPN)[36],which fusion feature from deep layer to shallow layer.In 2020,Tan et al. proposed BiFPN[37],which fusion feature bidirectionally.Then in 2023, Quan et al. proposed a Centralized Feature Pyramid module[38]to optimize global information,make full use of the same scale of information.Wang et al. proposed a gather-and-distribute module[39], which use different fusion methods for low-stage features and high-stage features. III. METHOD As shown in Fig.2, the defect detection model proposed in this paper consists of segmentation network and classification network. After global average pooling and global maximum pooling, the features of the final output of the segmentation network are spliced with the final output of the classification network, which plays a guiding role in the final results of the model. _A._ _SEGMENTATION NETWORK_ The structure diagram of the segmentation network is shown in Fig 3. The input image passed through three stages, and each stage is composed of a 2 _×_ 2 maximum pool layer and several 5 _×_ 5 convolution layers. Select the feature map of the last layer of each stage to obtain the feature map of 64 channels, 64 channels and 128 channels respectively, and then use the average pool to sample the feature map down. By concatenating the downsampled feature maps, 256 channel feature maps are obtained and further fed into the outlookattention module[40],obtain the relationship between feature points and surrounding feature points, and further extract local features. The 128 channel feature map output from the last stage is convoluted by 15 _×_ 15 to obtain 256 feature maps. The large convolution kernel can effectively VOLUME 11 2023 3 <mark>Softmax</mark> <mark>CA Weight module</mark> Conv 3×3 64 64 256 256 Conv 5×5 513 256 Conv 5×5 256 256 32 max-pooling 256 Conv 1×1 64 Conv 1×1 64 C × Conv 7×7 Conv 9×9 64 C × Concat Element-wise product Softmax Reshape K 2  ~~~~ FIGURE 4. Classification network structure diagram. increase the receptive field of the model and bring better segmentation effect. At the end of dividing the network, the feature map output by the fusion module is Concatenated with the feature map output by 15 _×_ 15 convolution, and a single channel feature map is obtained by convolution. The feature map is used to calculate the segmentation loss and the final classification loss. _B._ _OUTLOOKATTENTION_ In order to enhance the local perception ability of the model, outlookattention module is added to the multi-scale feature fusion module.As shown in Fig 5.outlookattention module is divided into two branches. The branch at the top of the picture is the weight production module. The feature map generates weights as shown in equation 1. X denotetd the input feature map. At the down of the pictureis,the local window features of the input feature map are obtained by linear layer and unfold operations as shown in equation 2. Finally, as shown in equation 3 the weight is multiplied and accumulated with the feature after Softmax operation to get the final output. _A_ = Reshape(fc( _x_ )) (1) _V_ = f _c_ ( _x_ ) matrix multiplication W <u>Fold</u> C Linear K 2 K K C K2  K2 K2  K2 Linear+Unfold H H W C - (2) _,_ 0 _≤_ _m, n < K_ _V_ ∆ _i,j_ = _Vi_ + _m−_ _<u>K</u>_ 2 <sup>_, Vj_</sup> <sup>+</sup> <sup>_n−_</sup> <sup>_<u>K</u>_</sup> 2 (3) FIGURE 5. OutLookAttention structure diagram. feature map of 513 channels from the segmentation network to max pooling layer and convolutional layer, reduced the size of the feature maps and the number of channels. Then, the multiscale information of the feature map is obtained by convolution of different kernel sizes. After, the feature maps are concatenated together to calculate the attention weight, and the features of different scales are weighted after softmax operation. Finally, the feature map is reduced to 32 channels through convolution operation. The feature map of 32 channels is used to calculate the final classification loss through global average pooling and global maximum pooling. _D._ _COORDINATE ATTENTION_ Different from the SE Weight module used in EPSA, this paper used Coordinate Attention to calculate attention weights. AS shown in Fig 4, the input features are pooled in two directions, which can encode the spatial information into the attention map. Then, similar to SE Weight module, the attention weight matrix is obtained by convolution. Finally, the weights of the two directions are obtained by splitting operation. _Y_ = - m _atmul_ 0 _≤m,n<K_ S _oftmax_ ( _A_ ) _, V_ ∆ _i,ji_ + _m−_ _<u>K</u>_ 2 <sup>_,_</sup> _j_ + _n−_ <sup>_<u>K</u>_</sup> 2 _C._ _CLASSIFICATION NETWORK_ The structure diagram of the classification network is shown in Fig 5. The classification network first sends the 4 VOLUME 11 2023 C Concat S Split Conv+ Sigmoid C×H×1 C×H×1 C Conv+Relu S Conv+ Sigmoid H W C global avg-pooling global avg-pooling C×W×1 C×1× <mark>W</mark> C×1×W FIGURE 6. Coordinate Attention structure diagram. _E._ _LOSS FUNCTIONS AND EVALUATION INDICATORS_ The loss function used in this paper is shown in equation 4: _L_ = _λ ∗_ _γ ∗_ _Lseg_ + (1 _−_ _λ_ ) _∗_ _θ ∗_ _Lcls_ (4) where _Lseg_ denotes the loss of segmentation network and _Lcls_ denotes the loss of classification network. _λ_ is the weight of the balancing factor responsible for balancing the losses of the two networks, _γ_ is an indicator of the presence or absence of pixel-level labeling, and _θ_ is an additional classification loss weight. In industrial production quality control, products are categorized into defective and non-defective, and the classification result of the image determines whether the product is discarded or not. Therefore, in all experiments, this paper focuses on the classification result of each image. Based on the above considerations, this paper uses AP and AUC as evaluation metrics.The AP evaluation metric is averaged over the Precision corresponding to each threshold, calculated as shown in equation 5: - 1 _AP_ = _p_ ( _r_ ) _dr_ (5) 0 is calculated as shown in equation 8, Where T is the time for the model to inference a picture. _FPS_ = <u>100</u> <u>�1</u> (8) 100 <sup>_T_</sup> IV. EXPERIMENTS _A._ _DATASET_ The experiments in this paper use four datasets that are currently dominant in defect detection: the KolektorSDD (KSDD) dataset[41], the DAGM dataset[42], the KolektorSDD2 dataset (KSDD2)[15] and the Severstal Steel defect dataset (STEEL)[43]. The KSDD dataset was provided by the Kolektor Group doo defect production program. It contains a total of 399 images, 52 of which have visible defects and the remaining 347 images are normal images, each of which has a size of approximately 500*1240 pixels. The DAGM dataset was provided by the International Pattern Recognition Association. A total of 3450 images are included, and the size of each image is 1600*256 pixels. The KSDD2 dataset is provided by the Kolektor Group doo defective production program. A total of 3335 images are included, of which 356 images have visible defects and the remaining 2979 images are normal images, each of which has a size of approximately 230*640 pixels. The training set consists of 246 images with defects and 2085 images without defects and the test set consists of 110 images with defects and 894 images without defects; The STEEL dataset is a steel surface defects dataset provided by Severstal, there are a total of 18074 grayscale images with 4 classifications, and the image size is 1600*256 pixels. There are a total of 12568 images in the training set, containing 7095 defective images and 5473 normal images. Only a subset of this dataset is used in this paper. _B._ _EXPERIMENTAL SETUP_ The experimental setup of this paper is as follows: (1) Regarding the number of pixel-level annotations N in the KSDD dataset, the settings in this paper are [0, 5, 10, 15, 20, 33]. the Batchsize size is 1, the learning rate is initialized to 0.01, and the number of iterations is 50 epochs; (2) Regarding the number of pixel-level annotations N in the DAGM dataset, the setting in this paper is [0, 5, 15, 45, 1000]. the Batchsize size is 1, the learning rate is initialized to 0.05, and the number of iterations is 70 epochs; (3) Regarding the number of pixel-level annotations N in the KSDD2 dataset, the setting in this paper is [0, 16, 53, 126, 246]. the Batchsize size is 1, the learning rate is initialized to 0.01, and the number of iterations is 50 epochs; (4) Positive samples N of STEEL dataset is set as [0,10,50,150,300,750], Batchsize size is 10, Learning rate is initialized as 0.1, and the number of iterations is 90 epochs. This paper focuses on three sets of experiments: (1) Test the AP of the model on the KSDD dataset, DAGM dataset, KSDD2 dataset, and STEEL dataset Where _p_ ( _r_ )Indicates the accuracy of the model, which is calculated as shown in equation 6.TP denotes the number of samples that are correctly classified as positive examples, and FP denotes the number of samples that are incorrectly classified as positive examples. _<u>TP</u>_ _Precision_ = (6) _TP_ + _FP_ The AUC value is the area under the ROC curve, when different thresholds are taken, multiple sets of coordinates are obtained,the coordinates are calculated as shown in equation 7, TN indicates the number of samples that are correctly classified as negative cases, and FN indicates the number of samples that are incorrectly classified as negative cases. This evaluation index can effectively see the ability of the model to recognize positive samples. _x_ : _FP/_ ( _FP_ + _TN_ ) (7) _y_ : _TP/_ ( _TP_ + _FN_ ) Also for further comparison, this paper adds the model’s inference time (FPS) as an evaluation index to assess the detection speed by the time of inference of one picture, which VOLUME 11 2023 5 (2) Using the KSDD2 dataset to verify the effectiveness of the multi-scale feature fusion module and pyramid attention module; (3) The effects of different weight modules in the pyramid attention module on the AP and AUC of the model were tested on the KSDD2 dataset. The experiments in this paper are based on the Ubuntu16.04 system, and the code running environment is Python 3.8, Pytorh 1.8.0, and torchvision 0.9.0. The GPU used in the experiment is RTX2080Ti (video memory: 11GB). The code running environment for FPS calculation is Python 3.8, Pytorh 2.1.2, and torchvision 0.10.0. The GPU used in the experiment is GTX1080Ti (video memory: 11GB). _C._ _COMPARISON EXPERIMENT_ In order to verify the effectiveness of the proposed improvements in this paper, this paper compares with the detection algorithms with excellent results in recent years on the KSDD2 dataset and the STEEL dataset, and the unsupervised methods compared to this article are F-AnoGAN proposed in 2019 [44],Uninf student proposed in 2020[45], SGSF proposed in 2022[46]. The fully-supervised method are SDA proposed in 2020[41],PSIC-Net proposed in 2021[47]. The mixed-supervised method are TNN proposed in2020[14],Mix sup proposedin 2021[15],DSR proposed in 2022[48], MaMi proposed in 2023[16]. As shown in Table1, Comparison experiments on the KSDD dataset show that in the weakly supervised case, the AP of this paper is 94.72%, which is 3.78% lower than the current best method;in the fully supervised case, the AP of this paper is 100%, which is the same as the previous best method. TABLE 1. Experimental results of the KSDD dataset <u>Methods</u> <u>F-AnoGAN</u> <u>SDA</u> <u>Uninf student</u> <u>Mix Sup</u> <u>MaMi</u> <u>MFFPA</u> <u>N=0</u> <u>39.4</u> <u>57.1</u> <u>93.4</u> <u>98.5</u> <u>94.72</u> <u>N=5</u> <u>99.1</u> <u>99.5</u> <u>98.95</u> <u>N=10</u> <u>99.4</u> <u>99.7</u> <u>99.02</u> <u>N=15</u> <u>99.2</u> <u>100</u> <u>99.11</u> <u>N=20</u> <u>99.9</u> <u>100</u> <u>100</u> <u>N=33</u> <u>99.9</u> <u>100</u> <u>100</u> <u>100</u> As shown in Table 2, Comparative experiments on the DAGM dataset show that in the weakly supervised case, the AP of this paper is 82.9%, which is a 2% improvement over the previous best method, and in the fully supervised case, the AP of this paper is 100%,which is the same as the previous best method. TABLE 2. Experimental results of the DAGM dataset <u>Methods</u> <u>F-AnoGAN</u> <u>Uninf student</u> <u>Mix Sup</u> <u>MaMi</u> <u>MFFPA</u> <u>N=0</u> <u>19.5</u> <u>66.8</u> <u>74</u> <u>80.9</u> <u>82.9</u> <u>N=5</u> <u>94.6</u> <u>100</u> <u>99.2</u> <u>N=15</u> <u>100</u> <u>100</u> <u>N=45</u> <u>100</u> <u>100</u> <u>N=1000</u> <u>100</u> <u>100</u> As shown in Table3, experiments on the STEEL dataset show that in the weakly supervised case, the AP of this paper is 95.51%, which is a 3.91% improvement over the previous best method. TABLE 3. Experimental results of the STEEL dataset <u>Methods</u> <u>F-AnoGAN</u> <u>Uninf student</u> <u>TNN</u> <u>Mix Sup</u> <u>MFFPA</u> <u>N=0</u> <u>50.9</u> <u>54.9</u> <u>91.6</u> <u>95.51</u> <u>N=10</u> <u>92.7</u> <u>96.32</u> <u>N=50</u> <u>93.2</u> <u>97.10</u> <u>N=150</u> <u>96.9</u> <u>98.57</u> <u>N=300</u> <u>98.1</u> <u>98.67</u> <u>N=750</u> <u>98.74</u> <u>98.8</u> <u>98.94</u> As shown in Table6, comparing experiments on the KSDD2 dataset, the AP of this paper is 88.01% in the weaklysupervised case, which is a 0.81% improvement over the previous best method, and in the fully-supervised case, the AP of this paper is 95.6%, which is 0.6% lower than the current best method. _D._ _VISUALIZATION RESULTS_ As shown in Fig.7, at the top of the image are the scores for defect detection, When defects are detected and classified correctly, the use of multi-scale feature fusion module and pyramid attention module can make the scope of attention of the model wider, and the model has better discrimination ability in the defective parts. Moreover, when no defects are detected, the model before improvement will have classification errors. After improvement, the model can accurately judge and has higher identification ability. From the visualization results, it can be seen that the proposed multi-scale feature fusion module and pyramid attention module can effectively enhance the feature extraction ability and discrimination ability of the model. Baseline MFF-Net FIGURE 7. Visualisation of results diagram _E._ _ABLATION STUDIES_ In order to investigate the effect of the multi scale fusion module(MFF) and pyramid attention module(PA) on the model, several groups of comparative experiments were 6 VOLUME 11 2023 TABLE 4. Experimental results of the KSDD2 dataset <u>Methods</u> <u>F-AnoGAN</u> <u>SDA</u> <u>Uninf student</u> <u>Mix Sup</u> <u>PSIC</u> <u>SGSF</u> <u>DSR</u> <u>MaMi</u> <u>MFFPA</u> <u>N=0</u> <u>55.0</u> <u>65.3</u> <u>74.4</u> <u>86.3</u> <u>87.2</u> <u>80</u> <u>88.01</u> <u>N=16</u> <u>82.3</u> <u>91.4</u> <u>89.7</u> <u>91.49</u> <u>N=53</u> <u>89.4</u> <u>94.6</u> <u>92.3</u> <u>93.05</u> <u>N=126</u> <u>92.2</u> <u>94.1</u> <u>94.16</u> <u>N=246</u> <u>68.7</u> <u>95.4</u> <u>93.3</u> <u>95.2</u> <u>96.2</u> <u>95.60</u> carried out in this paper. Table 5 and Table 6 shows the results of the ablation experiments on the KSDD2 dataset in this paper. When the number of pixel level annotations n=0, adding MFF module can improve AP by 6.94%; In all cases, AP increased by 3.44%; When the number of labels is n=0, the AP increases by 11.15% by adding PA module. In all cases, AP increased by 4.71%. When adding MFF module and PA module at the same time, AP was 88.01% in the case of only image level annotation, which was 13.5% higher than baseline. In all cases, the AP of this experiment increased by 5.94%. The experimental structure proves that adding MFF module and PA module at the same time can effectively improve the AP of the model. When the evaluation metric is AUC and pixel level annotations N=0, adding MFF module can improve AUC by 1.23%; Adding PA module, AUC increased by 5.58%; When used at the same time, AUC increased by 4.38%. In all cases, using MFF module and PA module, this method also has 2.13% improvement. Experimental results show that the proposed model can effectively detect defects, and also show that the introduction of shallow features will affect the AUC of the model. TABLE 5. Ablation experimental results of the KSDD2 dataset(evaluation metrics:AP) <u>pixel-level annotation</u> <u>Baseline</u> <u>MFF</u> <u>PA</u> <u>MFF+PA</u> <u>N=0</u> <u>74.51</u> <u>81.45</u> <u>85.66</u> <u>88.01</u> <u>N=16</u> <u>82.31</u> <u>87.84</u> <u>90.01</u> <u>91.49</u> <u>N=53</u> <u>89.45</u> <u>91.85</u> <u>92.33</u> <u>93.05</u> <u>N=126</u> <u>92.30</u> <u>93.84</u> <u>93.42</u> <u>94.16</u> <u>N=246</u> <u>94.02</u> <u>94.82</u> <u>94.72</u> <u>95.60</u> <u>Average</u> <u>86.52</u> <u>89.96</u> <u>91.23</u> <u>92.46</u> TABLE 6. Ablation experimental results of the KSDD2 dataset(evaluation metrics:AUC)) <u>pixel-level annotation</u> <u>Baseline</u> <u>MFF</u> <u>PA</u> <u>MF+PA</u> <u>N=0</u> <u>89.49</u> <u>90.72</u> <u>95.07</u> <u>93.87</u> <u>N=16</u> <u>92.13</u> <u>94.62</u> <u>97.34</u> <u>95.59</u> <u>N=53</u> <u>95.99</u> <u>96.39</u> <u>97.78</u> <u>97.15</u> <u>N=126</u> <u>96.54</u> <u>97.48</u> <u>98.13</u> <u>97.46</u> <u>N=246</u> <u>97.92</u> <u>98.49</u> <u>98.60</u> <u>98.63</u> <u>Average</u> <u>94.41</u> <u>95.54</u> <u>97.38</u> <u>96.54</u> As shown in Table7 and Table8, the results of the ablation experiments on the use of Attention weight module. When using AP as an evaluation metric, using CA has approximately 1% improvement compared to SE.When using AUC as an evaluation metric, as seen form the Table8, Using SE or CA as attention weights, there is not much difference in AUC between the two. The experimental results show that using channel attention in classification networks can effectively improve the model’s AUC. TABLE 7. Ablation experimental results of the Attention weight module(evaluation metrics:AP) <u>N=0</u> <u>N=16</u> <u>N=53</u> <u>N=126</u> <u>N=246</u> <u>Baseline</u> <u>74.51</u> <u>82.31</u> <u>89.45</u> <u>92.30</u> <u>94.02</u> <u>SE</u> <u>84.86</u> <u>86.53</u> <u>90.01</u> <u>92.92</u> <u>94.45</u> <u>CA</u> <u>85.66</u> <u>90.01</u> <u>92.33</u> <u>93.42</u> <u>94.72</u> TABLE 8. Ablation experimental results of the Attention weight module(evaluation metrics:AUC) <u>N=0</u> <u>N=16</u> <u>N=53</u> <u>N=126</u> <u>N=246</u> <u>Baseline</u> <u>89.49</u> <u>92.13</u> <u>95.99</u> <u>96.54</u> <u>97.92</u> <u>SE</u> <u>95.21</u> <u>95.18</u> <u>97.21</u> <u>97.86</u> <u>98.57</u> <u>CA</u> <u>95.07</u> <u>97.34</u> <u>97.78</u> <u>98.13</u> <u>98.60</u> _F._ _ANALYSIS OF MODEL PARAMETERS AND FLOPS_ As shown in Table9, compared with the baseline, it can be seen that by introducing shallow features and reducing the number of channels in the last layer of the segmentation network, the parameter count of the model is reduced by 27.8%, and the FLOPs is reduced by 30.57%. Compared with MaMiNet, the parameter count of the model is only 67.1% of MaMiNet, and the FLOPs is only 65.69% of MaMiNet, The model is also higher than the previous best model on FPS, fully demonstrating the efficiency of the model. TABLE 9. Model parametric quantities and computational analysis <u>MFF</u> <u>PA</u> <u>Params</u> <u>FLOPs</u> <u>FPS</u> <u>Baseline</u> <u>15.64M</u> <u>47.99G</u> <u>35.15</u> ✓ <u>8.58M</u> <u>31.79G</u> <u>46.03</u> ✓ <u>10.87M</u> <u>32.35G</u> <u>46.24</u> ✓ ✓ <u>11.29M</u> <u>33.32G</u> <u>41.15</u> <u>MaMiNe</u> <u>16.82M</u> <u>50.72G</u> <u>32.86</u> V. CONCLUSION The existing two-stage surface defect detection model ignores the shallow characteristics of the segmented network, and the classification network can not effectively utilize the VOLUME 11 2023 7 characteristics of the segmented network transmission. This paper proposes a two-stage detection model based on multiscale feature fusion and pyramid attention. Ablation experiments show that the multi-scale feature fusion module proposed in this paper can effectively use shallow features and improve the accuracy of the model. In addition, the pyramid attention module proposed in this paper can obtain more comprehensive feature information and effectively improve the discrimination ability of the model. The experimental results on the KSDD2 dataset show that the model proposed in this paper achieves excellent results with less computational overhead. In future work, we will further study how to effectively integrate multi-scale features. The multi-scale feature fusion module used in this paper is relatively rough, without considering the relationship between features of adjacent layers, and the outlookattention also affects the inference speed of the model. In the next step, we will study how to better integrate multi-scale features and seek better ways to replace outlookattention. REFERENCES [1] E. Chen, S. Chen, T. Ye, and Y. Liu, ‘‘Degradation adaptive neural network for jointly single image dehazing and desnowing,’’ _Frontiers_ _of_ _Computer_ _Science_, vol. 18, no. 2, 2024. [2] C. Li, E. Hu, X. Zhang, H. Zhou, H. Xiong, and Y. Liu, ‘‘Visibility restoration for real-world hazy images via improved physical model and gaussian total variation,’’ _Frontiers of Computer Science_, vol. 18, no. 1, pp. 1–3, 2024. [3] Y. Liu, Z. Yan, J. Tan, and Y. Li, ‘‘Multi-purpose ori ented single nighttime image haze removal based on unified variational retinex model,’’ _IEEE_ _Transactions_ _on Circuits and Systems for Video Technology_, vol. 33, no. 4, pp. 1643–1657, 2022. [4] J. Zhang, Y. Cao, Z.-J. Zha, and D. Tao, ‘‘Nighttime de hazing with a synthetic benchmark,’’ in _Proceedings of_ _the 28th ACM international conference on multimedia_, 2020, pp. 2355–2363. [5] Y. Liu, Z. Yan, S. Chen, T. Ye, W. Ren, and E. Chen, ‘‘Nighthazeformer: Single nighttime haze removal using prior query transformer,’’ in _Proceedings of the 31st_ _ACM_ _International_ _Conference_ _on_ _Multimedia_, 2023, pp. 4119–4128. [6] X. Zihao, W. Hongyuan, Q. Pengyu, D. Weidong, Z. Ji, and C. Fuhua, ‘‘Printed surface defect detection model based on positive samples.’’ _Computers,_ _Materials_ _&_ _Continua_, vol. 72, no. 3, 2022. [7] X. Fang, Q. Luo, B. Zhou, C. Li, and L. Tian, ‘‘Research progress of automated visual surface defect detection for industrial metal planar materials,’’ _Sensors_, vol. 20, no. 18, p. 5136, 2020. [8] Z. Li, X. Tian, X. Liu, Y. Liu, and X. Shi, ‘‘A two-stage industrial defect detection framework based on improved-yolov5 and optimized-inception-resnetv2 models,’’ _Applied Sciences_, vol. 12, no. 2, p. 834, 2022. [9] F. Li and Q. Xi, ‘‘Defectnet: Toward fast and effective defect detection,’’ _IEEE_ _Transactions_ _on_ _Instrumenta-_ _tion and Measurement_, vol. 70, pp. 1–9, 2021. [10] P. Bergmann, M. Fauser, D. Sattlegger, and C. Steger, ‘‘Mvtec ad–a comprehensive real-world dataset for unsupervised anomaly detection,’’ in _Proceedings_ _of_ _the_ _IEEE/CVF_ _conference_ _on_ _computer_ _vision_ _and_ _pattern_ _recognition_, 2019, pp. 9592–9600. [11] M. Jonak, S. Jezek, and R. Burget, ‘‘Evaluation of nested u-net models performance on mvtec ad dataset,’’ in _2022_ _14th_ _International_ _Congress_ _on_ _Ultra_ _Modern_ _Telecommunications_ _and_ _Control_ _Systems_ _and_ _Work-_ _shops (ICUMT)_ . IEEE, 2022, pp. 70–75. [12] Q. Li, A. Arnab, and P. H. Torr, ‘‘Weakly-and semi supervised panoptic segmentation,’’ in _Proceedings_ _of_ _the_ _European_ _conference_ _on_ _computer_ _vision_ _(ECCV)_, 2018, pp. 102–118. [13] C. Ge, J. Wang, J. Wang, Q. Qi, H. Sun, and J. Liao, ‘‘Towards automatic visual inspection: A weakly supervised learning method for industrial applicable object detection,’’ _Computers in Industry_, vol. 121, p. 103232, 2020. [14] J. Božič, D. Tabernik, and D. Skočaj, ‘‘End-to-end train ing of a two-stage neural network for defect detection,’’ in _2020 25th International Conference on Pattern_ _Recognition (ICPR)_ . IEEE, 2021, pp. 5619–5626. [15] Božič, Jakob and Tabernik, Domen and Skočaj, Danijel, ‘‘Mixed supervision for surface-defect detection: From weakly to fully supervised learning,’’ _Computers in In-_ _dustry_, vol. 129, p. 103459, 2021. [16] X. Luo, S. Li, Y. Wang, T. Zhan, X. Shi, and B. Liu, ‘‘Maminet: Memory-attended multi-inference network for surface-defect detection,’’ _Computers_ _in_ _Industry_, vol. 145, p. 103834, 2023. [17] J. Masci, U. Meier, D. Ciresan, J. Schmidhuber, and G. Fricout, ‘‘Steel defect classification with maxpooling convolutional neural networks,’’ in _The_ _2012_ _international_ _joint_ _conference_ _on_ _neural_ _networks_ _(IJCNN)_ . IEEE, 2012, pp. 1–6. [18] S. Kim, W. Kim, Y.-K. Noh, and F. C. Park, ‘‘Trans fer learning for automated optical inspection,’’ in _2017 international joint conference on neural networks_ _(IJCNN)_ . IEEE, 2017, pp. 2517–2524. [19] T. Wang, Y. Chen, M. Qiao, and H. Snoussi, ‘‘A fast and robust convolutional neural network-based defect detection model in product quality control,’’ _The Inter-_ _national_ _Journal_ _of_ _Advanced_ _Manufacturing_ _Technol-_ _ogy_, vol. 94, pp. 3465–3471, 2018. [20] Z. Liu, K. Liu, J. Zhong, Z. Han, and W. Zhang, ‘‘A high precision positioning approach for catenary support components with multiscale difference,’’ _IEEE_ _Trans-_ _actions_ _on_ _Instrumentation_ _and_ _Measurement_, vol. 69, no. 3, pp. 700–711, 2019. [21] Y. Huang, C. Qiu, X. Wang, S. Wang, and K. Yuan, ‘‘A compact convolutional neural network for surface defect 8 VOLUME 11 2023 inspection,’’ _Sensors_, vol. 20, no. 7, p. 1974, 2020. [22] Y. Bao, K. Song, J. Liu, Y. Wang, Y. Yan, H. Yu, and X. Li, ‘‘Triplet-graph reasoning network for fewshot metal generic surface defect segmentation,’’ _IEEE_ _Transactions_ _on_ _Instrumentation_ _and_ _Measurement_, vol. 70, pp. 1–11, 2021. [23] H. Feng, K. Song, W. Cui, Y. Zhang, and Y. Yan, ‘‘Cross position aggregation network for few-shot strip steel surface defect segmentation,’’ _IEEE_ _Transactions_ _on_ _Instrumentation_ _and_ _Measurement_, vol. 72, pp. 1–10, 2023. [24] G. Xie, J. Wang, J. Liu, Y. Jin, and F. Zheng, ‘‘Push ing the limits of fewshot anomaly detection in industry vision: Graphcore,’’ in _The Eleventh International Con-_ _ference on Learning Representations_, 2022. [25] M. Rudolph, B. Wandt, and B. Rosenhahn, ‘‘Same same but differnet: Semi-supervised defect detection with normalizing flows,’’ in _Proceedings_ _of_ _the_ _IEEE/CVF_ _winter_ _conference_ _on_ _applications_ _of_ _computer_ _vision_, 2021, pp. 1907–1916. [26] K. Batzner, L. Heckler, and R. König, ‘‘Efficientad: Accurate visual anomaly detection at millisecond-level latencies,’’ in _Proceedings_ _of_ _the_ _IEEE/CVF_ _Winter_ _Conference on Applications of Computer Vision_, 2024, pp. 128–138. [27] K. Xu, J. Ba, R. Kiros, K. Cho, A. Courville, R. Salakhudinov, R. Zemel, and Y. Bengio, ‘‘Show, attend and tell: Neural image caption generation with visual attention,’’ in _International conference on machine_ _learning_ . PMLR, 2015, pp. 2048–2057. [28] J. Hu, L. Shen, and G. Sun, ‘‘Squeeze-and-excitation networks,’’ in _Proceedings_ _of_ _the_ _IEEE_ _conference_ _on_ _computer_ _vision_ _and_ _pattern_ _recognition_, 2018, pp. 7132–7141. [29] J. Hu, L. Shen, S. Albanie, G. Sun, and A. Vedaldi, ‘‘Gather-excite: Exploiting feature context in convolutional neural networks,’’ _Advances_ _in_ _neural_ _informa-_ _tion processing systems_, vol. 31, 2018. [30] S. Woo, J. Park, J.-Y. Lee, and I. S. Kweon, ‘‘Cbam: Convolutional block attention module,’’ in _Proceedings_ _of the European conference on computer vision (ECCV)_, 2018, pp. 3–19. [31] A. G. Roy, N. Navab, and C. Wachinger, ‘‘Recalibrating fully convolutional networks with spatial and channel “squeeze and excitation” blocks,’’ _IEEE transactions on_ _medical imaging_, vol. 38, no. 2, pp. 540–549, 2018. [32] Q. Hou, D. Zhou, and J. Feng, ‘‘Coordinate attention for efficient mobile network design,’’ in _Proceedings of the_ _IEEE/CVF_ _conference_ _on_ _computer_ _vision_ _and_ _pattern_ _recognition_, 2021, pp. 13 713–13 722. [33] Y. Cao, J. Xu, S. Lin, F. Wei, and H. Hu, ‘‘Gcnet: Non local networks meet squeeze-excitation networks and beyond,’’ in _Proceedings of the IEEE/CVF international_ _conference on computer vision workshops_, 2019, pp. 0– 0. [34] J. Wang, Y. Chen, R. Chakraborty, and S. X. Yu, ‘‘Or thogonal convolutional neural networks,’’ in _Proceed-_ _ings_ _of_ _the_ _IEEE/CVF_ _conference_ _on_ _computer_ _vision_ _and pattern recognition_, 2020, pp. 11 505–11 515. [35] H. Zhang, K. Zu, J. Lu, Y. Zou, and D. Meng, ‘‘Epsanet: An efficient pyramid squeeze attention block on convolutional neural network,’’ in _Proceedings_ _of_ _the_ _Asian_ _Conference on Computer Vision_, 2022, pp. 1161–1177. [36] T.-Y. Lin, P. Dollár, R. Girshick, K. He, B. Hariharan, and S. Belongie, ‘‘Feature pyramid networks for object detection,’’ in _Proceedings of the IEEE conference_ _on_ _computer_ _vision_ _and_ _pattern_ _recognition_, 2017, pp. 2117–2125. [37] M. Tan, R. Pang, and Q. V. Le, ‘‘Efficientdet: Scalable and efficient object detection,’’ in _Proceedings_ _of_ _the_ _IEEE/CVF_ _conference_ _on_ _computer_ _vision_ _and_ _pattern_ _recognition_, 2020, pp. 10 781–10 790. [38] Y. Quan, D. Zhang, L. Zhang, and J. Tang, ‘‘Centralized feature pyramid for object detection,’’ _IEEE_ _Transac-_ _tions on Image Processing_, 2023. [39] C. Wang, W. He, Y. Nie, J. Guo, C. Liu, Y. Wang, and K. Han, ‘‘Gold-yolo: Efficient object detector via gather-and-distribute mechanism,’’ _Advances in Neural_ _Information Processing Systems_, vol. 36, 2024. [40] L. Yuan, Q. Hou, Z. Jiang, J. Feng, and S. Yan, ‘‘Volo: Vision outlooker for visual recognition,’’ _IEEE_ _trans-_ _actions_ _on_ _pattern_ _analysis_ _and_ _machine_ _intelligence_, vol. 45, no. 5, pp. 6575–6586, 2022. [41] D. Tabernik, S. Šela, J. Skvarč, and D. Skočaj, ‘‘Segmentation-based deep-learning approach for surface-defect detection,’’ _Journal_ _of_ _Intelligent_ _Manufacturing_, vol. 31, no. 3, pp. 759–776, 2020. [42] M. Wieler and T. Hahn, ‘‘Weakly supervised learning for industrial optical inspection,’’ in _DAGM symposium_ _in_, vol. 6, 2007. [43] i. i. O. Alexey Grishin, BorisV, ‘‘Severstal: Steel defect detection,’’ Kaggle. https://kaggle.com/competitions/severstal-steel-defectdetection, 2019. [44] T. Schlegl, P. Seeböck, S. M. Waldstein, G. Langs, and U. Schmidt-Erfurth, ‘‘f-anogan: Fast unsupervised anomaly detection with generative adversarial networks,’’ _Medical_ _image_ _analysis_, vol. 54, pp. 30–44, 2019. [45] P. Bergmann, M. Fauser, D. Sattlegger, and C. Ste ger, ‘‘Uninformed students: Student-teacher anomaly detection with discriminative latent embeddings,’’ in _Proceedings of the IEEE/CVF conference on computer_ _vision and pattern recognition_, 2020, pp. 4183–4192. [46] P. Xing, Y. Sun, and Z. Li, ‘‘Self-supervised guided segmentation framework for unsupervised anomaly detection,’’ _arXiv preprint arXiv:2209.12440_, 2022. [47] L. Lei, S. Sun, Y. Zhang, H. Liu, and W. Xu, ‘‘Psic-net: Pixel-wise segmentation and image-wise classification network for surface defects,’’ _Machines_, vol. 9, no. 10, p. 221, 2021. [48] V. Zavrtanik, M. Kristan, and D. Skočaj, ‘‘Dsr–a dual VOLUME 11 2023 9 subspace re-projection network for surface anomaly detection,’’ in _European_ _conference_ _on_ _computer_ _vision_ . Springer, 2022, pp. 539–554. YING TANG received the B.E degree from North University of China in 2021.He is currently pursuing a master’s degree in engineering at Changzhou University. His main research interests include computer vision, defect detection. HONGYUAN WANG received his PhD in computer science from Nanjing University of Science and Technology. He is currently a professor, PhD supervisor, and senior member of CCF. His main research interests are computer vision, pattern recognition, and intelligent systems. QUNYING ZHOU received the B.S. degree in mathematics from Huaiyin Normal University, in 2021. She is currently pursuing the M.E. degree with Changzhou University. Her research interests include computer vision and defect detection. BOYAN SUN graduated from Changzhou University in 2023, with a Master of Engineering degree.His main research interests include computer vision and defect detection. 10 VOLUME 11 2023

섹션 본문 65문단 · 24,365자

(제목 없음)

1The two-stage defect detection model needs to pay attention to the results of the segmentation network and the classification network, and the results of the segmentation network will have an impact on the classification network.Previous models ignored shallow features in the segmentation network and used relatively simple classification networks that could not make good use of the features of the segmentation network.This paper proposes a surface defect detection algorithm based on multi-scale feature fusion and pyramid attention(MFFPA).First, a multi-scale feature fusion module is added to the segmentation network to fuse shallow features and extract more comprehensive feature information; then a pyramid attention module is added to the classification network to increase the receptive field of the model and enhance the discriminative ability of the model.The method proposed in this article was verified on four datasets, and the experimental results show that the added module can effectively improve the accuracy of the model.INDEX TERMSChannel attention, convolutional neural networks, defect detection, multi scale feature fusion.Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

I. INTRODUCTION

2Product defect detection is an indispensable process in industrial production, during production monitoring, may occur with the degraded images, some recent image processing methods [1], [2], [3], [4], [5] are considered as the pre-processing steps to handle them.In addition, previous defect detection required manual screening, which was costly and inefficient, making it difficult to cover large-scale quality inspection needs.In recent years, with the continuous development of computer vision technology, algorithms based on machine learning and deep learning have begun to be applied in the field of industrial defect detection [6].

3As shown in Fig. 1, according to different data labels, deep learning models in defect detection can be divided into fully supervised learning models, unsupervised learning models, hybrid supervised learning models, and weakly

4The associate editor coordinating the review of this manuscript and approving it for publication was Shovan Barma .supervised learning models [7].The defect samples used in fully supervised learning model training all have pixel-level annotations [8], [9].Unsupervised learning models only use defect-free samples for training, but the accuracy of the model is lower compared to fully supervised learning models [10], [11].Weakly supervised learning models use image-level labeled data for classification or segmentation, which can effectively utilize the data to improve the accuracy of the model [12], [13].Both unsupervised learning models and weakly supervised learning models reduce the cost of data labeling, but the model accuracy is obviously insufficient compared with fully supervised learning models.Therefore, in the field of defect detection, some researchers have begun to use hybrid supervised learning methods, This method adds a small amount of pixel level sample data on the basis of weakly supervised learning, effectively improving the accuracy of the model [14].Compared with weakly supervised learning, hybrid supervised learning is more flexible and can achieve better results by labeling a small amount of data at the pixel level.Previous hybrid supervised models composed an overall model by building associated sub-models, which played a guiding and strengthening role between different tasks.For example, the MixSup model proposed by Jakob et al. [15], the prediction map generated by the segmentation network of this model is concatenated with the feature map of the classification network through pooling layers, providing guidance for the final classification result.However, this model ignores the shallow features of the segmentation network and uses a relatively simple classification network.The state-of-the-art methods is MaMiNet proposed by Luo et al. [16], This method achieved better results by adding external attention, but also increased the inference time of the model.

5In response to the problems mentioned above, this paper proposes a surface detection model based on multi-scale feature fusion and pyramid attention based on the MixSup model.This model can effectively enhance the feature extraction capability of the model and greatly improve the classification accuracy of the model.And by utilizing shallow features and reducing the number of channels for deep features, the computational complexity of the model is reduced.The main contributions of this paper are as follows:

61) This paper proposes a multi-scale feature fusion module with local sensing ability, this module can effectively fuse the shallow features of the model and improve the feature extraction capability of the model.

72) This article proposes an improved pyramid attention module, which allows the model to obtain multiscale information, focus on more important channel features.

83) The model proposed in this article had a faster inference time than the previous best method, and the performance of the model is also competitive.

II. RELATED WORK A. DEFECT DETECTION

9As early as 2012, Masci et al. have used convolutional neural network to classify defects in steel [17].But Masci et al. used a shallow network and later in 2017, Kim et al. used a deeper convolutional neural network, VGG16, for defect detection [18].In 2018 Wang et al. used a convolutional neural network based on a classification approach to achieve high accuracy in cloth defect detection [19].In 2019, Liu et al. used a lightweight MobileNet-SSD network for defect detection and achieved faster detection speed [20].In 2020, Huang et al. [21] introduced multi-scale features using multiple parallel null convolutional layers.

10Since fully supervised learning requires a large amount of labeled data, some researchers began to use Few-shot learning for defect detection.In 2023, Bao et al. proposed Triplet-Graph Reasoning Network (TGRNet) [22], achieved universal defect detection of metals with few samples.Feng et al. [23] used space-squeeze attention (SSA) module to aggregate multiscale context information of defect features.Xie et al. proposed a new Few-Shot Anomaly Detection method called GraphCore [24], which uses a small amount of normal samples to achieve fast training of new products and competitive accuracy performance.

11Unsupervised learning does not require defective samples for training, and is also favored by many researchers.In 2021 Marco et al. used a normalised streaming approach on the MVTEC dataset to achieve the best results for unsupervised anomaly detection [25].In 2024, Batzner et al. constructed a lightweight teacher-student model [26],achieved detection speed of 2ms.Hyun et al. employs contrastive representation learning to collect and distribute features in a way that produces a target-oriented and easily separable representation.This article uses a hybrid supervised learning method to reduce the data annotation cost caused by full supervision.Using only a small amount of pixel-level annotation data can greatly improve the AP of the model.

B. ATTENTION MECHANISM

12In 2015, Xu et al. [27] proposed a visual attention theory, which introduced the attention mechanism into the field of computer vision for the first time.Later, Hu et al. [28] proposed a Squeeze-and-excitation networks(SE) to calculate the weight of each channel, and Hu et al. [29] used spatial attention to assign weights to the pixel points of each feature map.Inspired by these studies, a series of studies such as CBAM [30], SCSE [31], and CoordAttention [32] fused channel attention with spatial attention to achieve better results.The above models have been simplified in some studies, Gcnet [33] proposed a simpler spatial attention module, and ECA-Net [34]introduced one-dimensional convolution to reduce the number of parameters of the model.In order to effectively obtain and utilize the spatial information of feature maps at different scales, Zhang et al. proposed an efficient pyramid squeeze attention net(EPSA) [35].

C. MULTI-SCALE FEATURE FUSION

13Multi-scale feature fusion is a common target detection technology.Its main function is to integrate features of different depths and different levels in order to better utilize multi-scale features to reduce the semantic gaps between different layers.In 2017, Lin et al. proposed the classic feature pyramid network(FPN) [36],which fusion feature from deep layer to shallow layer.In 2020, Tan et al. proposed BiFPN [37],which fusion feature bidirectionally.Then in 2023, Quan et al. proposed a Centralized Feature Pyramid module [38]to optimize global information,make full use of the same scale of information.Wang et al. proposed a gather-anddistribute module [39], which use different fusion methods for low-stage features and high-stage features.

III. METHOD

14As shown in Fig. 2, the defect detection model proposed in this paper consists of segmentation network and classification network.After global average pooling and global maximum pooling, the features of the final output of the segmentation network are spliced with the final output of the classification network, which plays a guiding role in the final results of the model.

A. SEGMENTATION NETWORK

15The structure diagram of the segmentation network is shown in Fig 3 .The input image passed through three stages, and each stage is composed of a 2 × 2 maximum pool layer and several 5 × 5 convolution layers.Select the feature map of the last layer of each stage to obtain the feature map of 64 channels, 64 channels and 128 channels respectively, and then use the average pool to sample the feature map down.By concatenating the downsampled feature maps, 256 channel feature maps are obtained and further fed into the outlookattention module [40],obtain the relationship between feature points and surrounding feature points, and further extract local features.The 128 channel feature map output from the last stage is convoluted by 15 × 15 to obtain 256 feature maps.The large convolution kernel can effectively increase the receptive field of the model and bring better segmentation effect.At the end of dividing the network, the feature map output by the fusion module is Concatenated with the feature map output by 15 × 15 convolution, and a single channel feature map is obtained by convolution.The feature map is used to calculate the segmentation loss and the final classification loss.

B. OUTLOOKATTENTION

16In order to enhance the local perception ability of the model, outlookattention module is added to the multi-scale feature fusion module.As shown in Fig 5 .outlookattentionmodule is divided into two branches.The branch at the top of the picture is the weight production module.The feature map generates weights as shown in equation 1. X denoted the input feature map.At the down of the pictureis,the local window features of the input feature map are obtained by linear layer and unfold operations as shown in equation 2. Finally, as shown in equation 3 the weight is multiplied and accumulated with the feature after Softmax operation to get the final output.

E. LOSS FUNCTIONS AND EVALUATION INDICATORS

17The loss function used in this paper is shown in equation 4:

18where L seg denotes the loss of segmentation network and L cls denotes the loss of classification network.λ is the weight of the balancing factor responsible for balancing the losses of the two networks, γ is an indicator of the presence or absence of pixel-level labeling, and θ is an additional classification loss weight.

19In industrial production quality control, products are categorized into defective and non-defective, and the classification result of the image determines whether the product is discarded or not.Therefore, in all experiments, this paper focuses on the classification result of each image.Based on the above considerations, this paper uses AP and AUC as evaluation metrics.The AP evaluation metric is averaged over the Precision corresponding to each threshold, calculated as shown in equation 5:

20where p (r)Indicates the accuracy of the model, which is calculated as shown in equation 6.TP denotes the number of samples that are correctly classified as positive examples, and FP denotes the number of samples that are incorrectly classified as positive examples.

21The AUC value is the area under the ROC curve, when different thresholds are taken, multiple sets of coordinates are obtained,the coordinates are calculated as shown in equation 7, TN indicates the number of samples that are correctly classified as negative cases, and FN indicates the number of samples that are incorrectly classified as negative cases.This evaluation index can effectively see the ability of the model to recognize positive samples.

22x : FP/ (FP + TN ) y : TP/ (TP + FN )

23Also for further comparison, this paper adds the model's inference time (FPS) as an evaluation index to assess the detection speed by the time of inference of one picture, which is calculated as shown in equation 8, Where T is the time for the model to inference a picture.Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

IV. EXPERIMENTS A. DATASET

24The experiments in this paper use four datasets that are currently dominant in defect detection: the KolektorSDD (KSDD) dataset [41], the DAGM dataset [42], the Kolek-torSDD2 dataset (KSDD2) [15] and the Severstal Steel defect dataset (STEEL) [43].

25The KSDD dataset was provided by the Kolektor Group doo defect production program.It contains a total of 399 images, 52 of which have visible defects and the remaining 347 images are normal images, each of which has a size of approximately 500*1240 pixels.

26The DAGM dataset was provided by the International Pattern Recognition Association.A total of 3450 images are included, and the size of each image is 1600*256 pixels.

27The KSDD2 dataset is provided by the Kolektor Group doo defective production program.A total of 3335 images are included, of which 356 images have visible defects and the remaining 2979 images are normal images, each of which has a size of approximately 230*640 pixels.The training set consists of 246 images with defects and 2085 images without defects and the test set consists of 110 images with defects and 894 images without defects;

28The STEEL dataset is a steel surface defects dataset provided by Severstal, there are a total of 18074 grayscale images with 4 classifications, and the image size is 1600*256 pixels.There are a total of 12568 images in the training set, containing 7095 defective images and 5473 normal images.Only a subset of this dataset is used in this paper.

B. EXPERIMENTAL SETUP

29The experimental setup of this paper is as follows:

30(1) Regarding the number of pixel-level annotations N in the KSDD dataset, the settings in this paper are [0, 5,10,15,20,33].the Batchsize size is 1, the learning rate is initialized to 0.01, and the number of iterations is 50 epochs;

31(2) Regarding the number of pixel-level annotations N in the DAGM dataset, the setting in this paper is [0, 5,15,45,1000]. the Batchsize size is 1, the learning rate is initialized to 0.05, and the number of iterations is 70 epochs;

32(3) Regarding the number of pixel-level annotations N in the KSDD2 dataset, the setting in this paper is [0, 16,53,126,246].the Batchsize size is 1, the learning rate is initialized to 0.01, and the number of iterations is 50 epochs;

33(4) Positive samples N of STEEL dataset is set as [0,10,50,150,300,750], Batchsize size is 10, Learning rate is initialized as 0.1, and the number of iterations is 90 epochs.This paper focuses on three sets of experiments:

34(1) Test the AP of the model on the KSDD dataset, DAGM dataset, KSDD2 dataset, and STEEL dataset (2) Using the KSDD2 dataset to verify the effectiveness of the multi-scale feature fusion module and pyramid attention module;

35(3) The effects of different weight modules in the pyramid attention module on the AP and AUC of the model were tested on the KSDD2 dataset.

36The experiments in this paper are based on the Ubuntu16.04system, and the code running environment is Python 3.8, Pytorh 1.8.0, and torchvision 0.9.0.The GPU used in the experiment is RTX2080Ti (video memory: 11GB).The code running environment for FPS calculation is Python 3.8, Pytorh 2.1.2,and torchvision 0.10.0.The GPU used in the experiment is GTX1080Ti (video memory: 11GB).

C. COMPARISON EXPERIMENT

37In order to verify the effectiveness of the proposed improvements in this paper, this paper compares with the detection algorithms with excellent results in recent years on the KSDD2 dataset and the STEEL dataset, and the unsupervised methods compared to this article are F-AnoGAN proposed in 2019 [44],Uninf student proposed in 2020 [45], SGSF proposed in 2022 [46].The fully-supervised method are SDA proposed in 2020 [41],PSIC-Net proposed in 2021 [47].The mixed-supervised method are TNN proposed in2020 [14],Mix sup proposed in 2021 [15],DSR proposed in 2022 [48], MaMi proposed in 2023 [16].

38As shown in Table1, Comparison experiments on the KSDD dataset show that in the weakly supervised case, the AP of this paper is 94.72%, which is 3.78% lower than the current best method;in the fully supervised case, the AP of this paper is 100%, which is the same as the previous best method.

39As shown in Table 2, Comparative experiments on the DAGM dataset show that in the weakly supervised case, the AP of this paper is 82.9%, which is a 2% improvement over the previous best method, and in the fully supervised case, the AP of this paper is 100%,which is the same as the previous best method.

40As shown in Table3, experiments on the STEEL dataset show that in the weakly supervised case, the AP of this paper is 95.51%, which is a 3.91% improvement over the previous best method.

41As shown in Table6, comparing experiments on the KSDD2 dataset, the AP of this paper is 88.01% in the weaklysupervised case, which is a 0.81% improvement over the previous best method, and in the fully-supervised case, the AP of this paper is 95.6%, which is 0.6% lower than the current best method.

D. VISUALIZATION RESULTS

42As shown in Fig. 7, at the top of the image are the scores for defect detection, When defects are detected and classified correctly, the use of multi-scale feature fusion module and pyramid attention module can make the scope of attention of the model wider, and the model has better discrimination ability in the defective parts.Moreover, when no defects are detected, the model before improvement will have classification errors.After improvement, the model can accurately judge and has higher identification ability.From the visualization results, it can be seen that the proposed multi-scale feature fusion module and pyramid attention module can effectively enhance the feature extraction ability and discrimination ability of the model.

E. ABLATION STUDIES

43In order to investigate the effect of the multi scale fusion module(MFF) and pyramid attention module(PA) on the model, several groups of comparative experiments were carried out in this paper.Table 5 and Table 6 shows the results of the ablation experiments on the KSDD2 dataset in this paper.

44When the number of pixel level annotations n=0, adding MFF module can improve AP by 6.94%;In all cases, AP increased by 3.44%; When the number of labels is n=0, the AP increases by 11.15% by adding PA module.In all cases, AP increased by 4.71%.When adding MFF module and PA module at the same time, AP was 88.01% in the case of only image level annotation, which was 13.5% higher than baseline.In all cases, the AP of this experiment increased by 5.94%.The experimental structure proves that adding MFF module and PA module at the same time can effectively improve the AP of the model.

45When the evaluation metric is AUC and pixel level annotations N=0, adding MFF module can improve AUC by 1.23%; Adding PA module, AUC increased by 5.58%; When used at the same time, AUC increased by 4.38%.In all cases, using MFF module and PA module, this method also has 2.13% improvement.Experimental results show that the proposed model can effectively detect defects, and also show that the introduction of shallow features will affect the AUC of the model.

46As shown in Table7 and Table8, the results of the ablation experiments on the use of Attention weight module.When using AP as an evaluation metric, using CA has approximately 1% improvement compared to SE.When using AUC as an evaluation metric, as seen from the Table8, Using SE or CA as attention weights, there is not much difference in AUC between the two.The experimental results show that using channel attention in classification networks can effectively improve the model's AUC.

F. ANALYSIS OF MODEL PARAMETERS AND FLOPS

47As shown in Table9, compared with the baseline, it can be seen that by introducing shallow features and reducing the number of channels in the last layer of the segmentation network, the parameter count of the model is reduced by 27.8%, and the FLOPs is reduced by 30.57%.Compared with MaMiNet, the parameter count of the model is only 67.1% of MaMiNet, and the FLOPs is only 65.69% of MaMiNet, The model is also higher than the previous best model on FPS, fully demonstrating the efficiency of the model.

V. CONCLUSION

48The existing two-stage surface defect detection model ignores the shallow characteristics of the segmented network, and the classification network cannot effectively utilize the characteristics of the segmented network transmission.This paper proposes a two-stage detection model based on multi-scale feature fusion and pyramid attention.Ablation experiments show that the multi-scale feature fusion module proposed in this paper can effectively use shallow features and improve the accuracy of the model.In addition, the pyramid attention module proposed in this paper can obtain more comprehensive feature information and effectively improve the discrimination ability of the model.The experimental results on the KSDD2 dataset show that the model proposed in this paper achieves excellent results with less computational overhead.

49In future work, we will further study how to effectively integrate multi-scale features.The multi-scale feature fusion module used in this paper is relatively rough, without considering the relationship between features of adjacent layers, and the outlookattention also affects the inference speed of the model.In the next step, we will study how to better integrate multi-scale features and seek better ways to replace outlookattention.

FIGURE 1 .

50FIGURE 1.As shown above, data labelling in defect detection has been classified into four cases.

FIGURE 2 .

51FIGURE 2. Network structure diagram.

FIGURE 3 .

52FIGURE 3. Segmentation network structure diagram.

C

53. CLASSIFICATION NETWORKThe structure diagram of the classification network is shown inFig 5.The classification network first sends the feature map of 513 channels from the segmentation network to max pooling layer and convolutional layer, reduced the size of the feature maps and the number of channels.Then, the multiscale information of the feature map is obtained by convolution of different kernel sizes.After, the feature maps are concatenated together to calculate the attention weight, and the features of different scales are weighted after softmax operation.Finally, the feature map is reduced to 32 channels through convolution operation.The feature map of 32 channels is used to calculate the final classification loss through global average pooling and global maximum pooling.D. COORDINATE ATTENTION Different from the SE Weight module used in EPSA, this paper used Coordinate Attention to calculate attention weights.AS shown in Fig 4, the input features are pooled in two directions, which can encode the spatial information into the attention map.Then, similar to SE Weight module, the attention weight matrix is obtained by convolution.Finally, the weights of the two directions are obtained by splitting operation.

FIGURE 4 .FIGURE 5 .

54FIGURE 4. Classification network structure diagram.

FIGURE 6 .

55FIGURE 6. Coordinate Attention structure diagram.

FIGURE 7 .

56FIGURE 7. Visualisation of results diagram.

TABLE 1 .

57Experimental results of the KSDD dataset.

TABLE 2 .

58Experimental results of the DAGM dataset.

TABLE 3 .

59Experimental results of the STEEL dataset.

TABLE 4 .

60Experimental results of the KSDD2 dataset.

TABLE 5 .

61Ablation experimental results of the KSDD2 dataset(evaluation metrics:AP).

TABLE 6 .

62Ablation experimental results of the KSDD2 dataset(evaluation metrics:AUC)).

TABLE 7 .

63Ablation experimental results of the Attention weight module(evaluation metrics:AP).

TABLE 8 .

64Ablation experimental results of the Attention weight module(evaluation metrics:AUC).

TABLE 9 .

65Model parametric quantities and computational analysis.

참고문헌 42건

  1. Steel defect classification with Max-Pooling Convolutional Neural Networks 2022 International Joint Conference on Neural Networks (IJCNN) · 2012 10.1109/ijcnn.2012.6252468
  2. Feature Pyramid Networks for Object Detection 2017 10.1109/cvpr.2017.106
  3. Transfer learning for automated optical inspection 2022 International Joint Conference on Neural Networks (IJCNN) · 2017 10.1109/ijcnn.2017.7966162
  4. A fast and robust convolutional neural network-based defect detection model in product quality control The International Journal of Advanced Manufacturing Technology · Springer Science+Business Media · 2017 10.1007/s00170-017-0882-0
  5. Squeeze-and-Excitation Networks 2018 10.1109/cvpr.2018.00745
  6. Weakly- and Semi-supervised Panoptic Segmentation Lecture notes in computer science · Springer Science+Business Media · 2018 10.1007/978-3-030-01267-0_7
  7. Recalibrating Fully Convolutional Networks With Spatial and Channel “Squeeze and Excitation” Blocks IEEE Transactions on Medical Imaging · Institute of Electrical and Electronics Engineers · 2018 10.1109/tmi.2018.2867261
  8. f-AnoGAN: Fast unsupervised anomaly detection with generative adversarial networks Medical Image Analysis · Elsevier BV · 2019 10.1016/j.media.2019.01.010
  9. MVTec AD — A Comprehensive Real-World Dataset for Unsupervised Anomaly Detection 2019 10.1109/cvpr.2019.00982
  10. A High-Precision Positioning Approach for Catenary Support Components With Multiscale Difference IEEE Transactions on Instrumentation and Measurement · Institute of Electrical and Electronics Engineers · 2019 10.1109/tim.2019.2905905
  11. GCNet: Non-Local Networks Meet Squeeze-Excitation Networks and Beyond 2019 10.1109/iccvw.2019.00246
  12. A Compact Convolutional Neural Network for Surface Defect Inspection Sensors · Multidisciplinary Digital Publishing Institute · 2020 10.3390/s20071974
  13. Towards automatic visual inspection: A weakly supervised learning method for industrial applicable object detection Computers in Industry · Elsevier BV · 2020 10.1016/j.compind.2020.103232
  14. Orthogonal Convolutional Neural Networks 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) · 2020 10.1109/cvpr42600.2020.01152
  15. Uninformed Students: Student-Teacher Anomaly Detection With Discriminative Latent Embeddings 2020 10.1109/cvpr42600.2020.00424
  16. EfficientDet: Scalable and Efficient Object Detection 2020 10.1109/cvpr42600.2020.01079
  17. Research Progress of Automated Visual Surface Defect Detection for Industrial Metal Planar Materials Sensors · Multidisciplinary Digital Publishing Institute · 2020 10.3390/s20185136
  18. Nighttime Dehazing with a Synthetic Benchmark Proceedings of the 30th ACM International Conference on Multimedia · 2020 10.1145/3394171.3413763
  19. Segmentation-based deep-learning approach for surface-defect detection Journal of Intelligent Manufacturing · Springer Science+Business Media · 2019 10.1007/s10845-019-01476-x
  20. Same Same But DifferNet: Semi-Supervised Defect Detection with Normalizing Flows 2021 10.1109/wacv48630.2021.00195
  21. DefectNet: Toward Fast and Effective Defect Detection IEEE Transactions on Instrumentation and Measurement · Institute of Electrical and Electronics Engineers · 2021 10.1109/tim.2021.3067221
  22. Mixed supervision for surface-defect detection: From weakly to fully supervised learning Computers in Industry · Elsevier BV · 2021 10.1016/j.compind.2021.103459
  23. End-to-end training of a two-stage neural network for defect detection 2022 26th International Conference on Pattern Recognition (ICPR) · 2021 10.1109/icpr48806.2021.9412092
  24. Triplet-Graph Reasoning Network for Few-Shot Metal Generic Surface Defect Segmentation IEEE Transactions on Instrumentation and Measurement · Institute of Electrical and Electronics Engineers · 2021 10.1109/tim.2021.3083561
  25. Coordinate Attention for Efficient Mobile Network Design 2021 10.1109/cvpr46437.2021.01350
  26. PSIC-Net: Pixel-Wise Segmentation and Image-Wise Classification Network for Surface Defects Machines · Multidisciplinary Digital Publishing Institute · 2021 10.3390/machines9100221
  27. A Two-Stage Industrial Defect Detection Framework Based on Improved-YOLOv5 and Optimized-Inception-ResnetV2 Models Applied Sciences · Multidisciplinary Digital Publishing Institute · 2022 10.3390/app12020834
  28. Printed Surface Defect Detection Model Based on Positive Samples Computers, materials & continua/Computers, materials & continua (Print) · 2022 10.32604/cmc.2022.026943
  29. CBAM: Convolutional Block Attention Module arXiv (Cornell University) · Cornell University · 2018 10.48550/arxiv.1807.06521
  30. VOLO: Vision Outlooker for Visual Recognition IEEE Transactions on Pattern Analysis and Machine Intelligence · IEEE Computer Society · 2022 10.1109/tpami.2022.3206108
  31. Self-Supervised Guided Segmentation Framework for Unsupervised Anomaly Detection arXiv (Cornell University) · Cornell University · 2022 10.48550/arxiv.2209.12440
  32. Evaluation of Nested U-Net models performance on MVTec AD dataset 2022 10.1109/icumt57764.2022.9943348
  33. MaMiNet: Memory-attended multi-inference network for surface-defect detection Computers in Industry · Elsevier BV · 2022 10.1016/j.compind.2022.103834
  34. DSR – A Dual Subspace Re-Projection Network for Surface Anomaly Detection Lecture notes in computer science · Springer Science+Business Media · 2022 10.1007/978-3-031-19821-2_31
  35. Multi-Purpose Oriented Single Nighttime Image Haze Removal Based on Unified Variational Retinex Model IEEE Transactions on Circuits and Systems for Video Technology · Institute of Electrical and Electronics Engineers · 2022 10.1109/tcsvt.2022.3214430
  36. Cross Position Aggregation Network for Few-Shot Strip Steel Surface Defect Segmentation IEEE Transactions on Instrumentation and Measurement · Institute of Electrical and Electronics Engineers · 2023 10.1109/tim.2023.3246519
  37. EPSANet: An Efficient Pyramid Squeeze Attention Block on Convolutional Neural Network Lecture notes in computer science · Springer Science+Business Media · 2023 10.1007/978-3-031-26313-2_33
  38. Centralized Feature Pyramid for Object Detection IEEE Transactions on Image Processing · Institute of Electrical and Electronics Engineers · 2023 10.1109/tip.2023.3297408
  39. NightHazeFormer: Single Nighttime Haze Removal Using Prior Query Transformer 2023 10.1145/3581783.3611744
  40. Degradation-adaptive neural network for jointly single image dehazing and desnowing Frontiers of Computer Science · Higher Education Press · 2024 10.1007/s11704-023-2764-y
  41. Visibility restoration for real-world hazy images via improved physical model and Gaussian total variation Frontiers of Computer Science · Higher Education Press · 2024 10.1007/s11704-023-3394-0
  42. Weakly Supervised Learning for Industrial Optical Inspection Zenodo (CERN European Organization for Nuclear Research) · CERN European Organization for Nuclear Research · 2007 10.5281/zenodo.8086136