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

Bearing surface defect detection based on improved convolutional neural network

간접 관련 엔지니어링 플라스틱 · (23) 컴파운드 (17) 스펀본드 부직포(19) 석유수지

기본 정보

저자
  1. Xian Fu — Department of Computer and Information Engineering, Hubei Normal University, Huangshi 435000, China
  2. Yang Xiao — Department of Computer and Information Engineering, Hubei Normal University, Huangshi 435000, China
  3. Ningning Zhang — Department of Computer and Information Engineering, Hubei Normal University, Huangshi 435000, China
  4. RuoGu Zhang — Department of Computer and Information Engineering, Hubei Normal University, Huangshi 435000, China
  5. Zhuzhu Zhang — Department of Computer and Information Engineering, Hubei Normal University, Huangshi 435000, China
  6. Aoqun Jin — Department of Computer and Information Engineering, Hubei Normal University, Huangshi 435000, China
  7. Ruiwen Ye — Department of Computer and Information Engineering, Hubei Normal University, Huangshi 435000, China
  8. Huiling Zhang — Department of Computer and Information Engineering, Hubei Normal University, Huangshi 435000, China; Huangshi Bangke Technology Co., Ltd., Huangshi 435000, China
DOI
10.3934/mbe.2023549
저널
Mathematical Biosciences & Engineering
발행년도
2023
발행기관
Arizona State University
피인용수
7
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.3934/mbe.2023549
토픽
Surface Roughness and Optical Measurements
OpenAlex ID
W4377287009

평가 내용

관련도
간접 관련
사업분야
엔지니어링 플라스틱 · (23) 컴파운드
부 분야
(17) 스펀본드 부직포, (19) 석유수지
R&D 측면
분석·모델링
확신도
0.70
근거 용어
defect detection, convolutional neural network, YOLOv5, visual inspection, surface defect
판단 근거
본 논문은 베어링 표면 결함을 자동으로 검출하는 딥러닝 알고리즘(YOLOv5 개선)에 관한 연구입니다. 이는 코오롱인더스트리의 직접적인 제품 연구는 아니나, 산업용 섬유(부직포), 석유수지, 타이어코드 등 제조 공정 중 발생하는 표면 결함을 자동 검사하는 비전 검사 시스템(AI Inspection) 기술로 전용 가능합니다.
R&D 활용 포인트
제조 공정 내 품질 관리 자동화를 위한 AI 비전 검사 모델 개발 및 실시간 결함 탐지 시스템 구축에 활용 가능합니다.
평가 입력
본문 36,338자

초록

This paper addresses the issue of artificial visual inspection being overly reliant on subjective experience and the difficulty for the human eye to accurately identify dense and non-significant defects. To solve this problem, we have implemented an automatic object detection algorithm based on an improved version of YOLOv5.First, we use the K-means++ clustering algorithm to automatically calculate the Anchor of the model to reduce the effect of the close location of the initial clustering centers on the clustering of the sample data.Second, we add the Coordinate Attention (CA) attention mechanism to the model to allow the model to better capture and understand important features in the images. Then, we add a new detection layer with a downsampling multiplier of 4 to the Neck network to improve the precision of the model. Finally, we use the lightweight network MobileNetV3 instead of YOLOv5's backbone network to reduce the model detection time overhead.Our model achieves 85.87% mAP, which is 6.44% better than the YOLOv5 network, and the detection time for a single image is only 54ms, which is 50% faster than the YOLOv5 network. After testing, we have proven that our proposed algorithm can quickly and accurately detect the condition of bearing appearance defects, improving detection efficiency and reducing costs.

본문 36,338자

본문 펼치기
[http://www.aimspress.com/journal/mbe](http://http://www.aimspress.com/journal/mbe) _Research article_ MBE, 20(7): 12341–12359. [DOI: 10.3934/mbe.2023549](http://dx.doi.org/10.3934/mbe.2023549) Received: 21 March 2023 Revised: 27 April 2023 Accepted: 04 May 2023 Published: 22 May 2023 # Bearing surface defect detection based on improved convolutional neural network Xian Fu <sup>1</sup> , Xiao Yang <sup>1,*</sup> , Ningning Zhang <sup>1</sup> , RuoGu Zhang <sup>1</sup> , Zhuzhu Zhang <sup>1</sup> , Aoqun Jin <sup>1</sup> , Ruiwen Ye <sup>1</sup> and Huiling Zhang <sup>2</sup> 1 Department of Computer and Information Engineering, Hubei Normal University, Huangshi 435000, China 2 Huangshi Bangke Technology Co., Ltd., Huangshi 435000, China - Correspondence: Email: 2497865883@qq.com. Abstract: This paper addresses the issue of artificial visual inspection being overly reliant on subjective experience and the difficulty for the human eye to accurately identify dense and non-significant defects. To solve this problem, we have implemented an automatic object detection algorithm based on an improved version of YOLOv5.First, we use the K-means++ clustering algorithm to automatically calculate the Anchor of the model to reduce the effect of the close location of the initial clustering centers on the clustering of the sample data.Second, we add the Coordinate Attention (CA) attention mechanism to the model to allow the model to better capture and understand important features in the images. Then, we add a new detection layer with a downsampling multiplier of 4 to the Neck network to improve the precision of the model. Finally, we use the lightweight network MobileNetV3 instead of YOLOv5’s backbone network to reduce the model detection time overhead.Our model achieves 85.87% mAP, which is 6.44% better than the YOLOv5 network, and the detection time for a single image is only 54ms, which is 50% faster than the YOLOv5 network. After testing, we have proven that our proposed algorithm can quickly and accurately detect the condition of bearing appearance defects, improving detection efficiency and reducing costs. Keywords: target detection; defect detection; attention mechanism; lightweight network 1. Introduction Bearings are essential components of freight trains during operation, and their working environment demands them to have three characteristics: high-speed rotation, high pressure, and low fault tolerance. Defects can appear on the bearing surface during production due to improper assembly, poor lubrication, and improper storage. The condition of the bearings determines the safety of the train, so 12342 maintenance personnel must regularly overhaul the train’s bearings and carry out corresponding maintenance treatments according to the types of defects. Currently, industrial production primarily relies on manual visual inspections to detect bearing surface defects, which places too much emphasis on the inspector’s experience. The variety of defects and their manifestations, along with non-significant defects, increases the difficulty of inspectors’ detection, and the inspection workshop’s environment is not conducive to extended periods of inspector work. Several researchers have proposed methods for detecting defects on bearing surfaces. L. Eren and A. Karahoca [1] improved the bearing defect detection procedure by wavelet transform and Radial Basis Function (RBF) neural network. Kankar and Sharma [2] used Artificial Neural Network (ANN) and Support Vector Machine(SVM) to detect defects on the bearing surface from the perspective of bearing vibration signals. Tastimur and Karakose [3] used a deep learning framework in the visual task of bearing defect detection to complete automatic detection of four types of bearing defects. Senanayaka and Khang [4] proposed a fault diagnosis method based on convolutional neural network pattern recognition, which can effectively detect not only single faults but also multiple faults simultaneously. Sobie and Freitas [5] applied proven statistical feature-based methods to convolutional neural networks to improve the accuracy of mechanical fault detection. Sadoughi and Hu [6] used bearings and their physical knowledge of bearings and their fault features as input to a deep neural network to propose a convolutional neural network (PCNN) based on physical characteristics for simultaneous detection of multiple bearings. Kim and Lee [7] applied deep learning models to detect ball bearing faults under complex conditions and obtained very high accuracy. Bapir and Aydin [8] used variational modal decomposition and convolutional neural network to complete the feature extraction and classification of bearing surface defects. Kone and Yatsugi [9] proposed an adaptively tuned convolutional neural network for the detection of multiple scratches defects on bearing surfaces. Chen and Yu [10] improved the Faster R-CNN model for fabric defect detection by embedding Gabor kernels and using a two-stage training method based on Genetic Algorithm and back-propagation. Luo and Yang [11] proposed a decoupled two-stage object detection framework for FPCB surface defect detection that achieved state-of-the-art accuracy. Zhang and Ma [12] proposed and evaluated a sparse regular diagnosis algorithm for feature enhancement in planetary gearbox fault diagnosis. The detection model needs to implement the classification and localization of the target defects to obtain statistical information about the class and location of the bearing defects. YOLO is one of the most important target detection models, offering advantages in terms of accuracy and speed. In this paper, we propose an improved YOLOv5 model for bearing surface target defect detection. Due to the curvature and texture of the bearing surface, detection presents certain challenges. In addition, we found that the target defect area only accounts for 0.03% of the bearing surface area, yet our model still achieved an mAP of 85.87%. To support our research, we formed a private dataset called “SKFKS2022”. In practical applications, our model performs well. The detection time for a single image is only 54 ms, which can meet the requirements of real-time detection in industrial applications. 2. Dataset The dataset is composed of two parts. One part is a unified image collection of bearing defects that was created using industrial cameras with the help of engineers from the factory inspection center, and is from freight train service station. The other part of the data is publicly available from the "Severstal: _Mathematical Biosciences and Engineering_ Volume 20, Issue 7, 12341–12359. 12343 Steel Defect Detection" competition on the Kaggle website, and is the steel surface defects dataset. In total, there are 1406 images with a resolution of 2048 × 2048. Due to the limited data collected, only 50 images of the remaining 17 defect types were accumulated. Therefore, the main types of defects studied were identified as scratch, corrosion, peeling, and rolling skin. Figure 1 shows the four types of targets. Figure 1. 4 types of defective targets. 3. Method _3.1._ _YOLOv5 model_ The YOLO series [13] is a regression-based target detection algorithm that creatively combines the Region of Interest (RoI) module and detection phases into one to improve the detection speed. YOLOv5 model mainly consists of Backbone, Neck and Head. The structure of YOLOv5 is shown in Figure 2. _Mathematical Biosciences and Engineering_ Volume 20, Issue 7, 12341–12359. 12344 Feature extraction network Detection layers of different scales Feature fusion network 3x 6x 9x 3x Input image CBS <mark>CBS</mark> <mark>C3</mark> <mark>CBS</mark> <mark>C3</mark> CBS <mark>C3</mark> <mark>CBS</mark> C3 SPPF Detection layer Conv2d Detection Conv2d layer Detection 3x C3_F <mark>CBS</mark> <mark>Concat</mark> C3_F <mark>CBS</mark> <mark>Concat</mark> layer C3_F Conv2d 3x <mark>Concat</mark> Upsample <mark>CBS</mark> C3_F <mark>Concat</mark> <mark>Upsample</mark> CBS 3x 3x Figure 2. The structure of YOLOv5. _3.2._ _Prior box_ The prior box is a box of different sizes and aspect ratios preset on the image in advance to help the model learn the location and size of the target more easily, and the reasonable setting of the Anchor greatly affects the performance of the final model. The K-means++ algorithm [14] uses an "additive" strategy to select the initial clustering centers, maximizing the distance between them. This strategy ensures that the model achieves the highest prior frame and improves detection accuracy. The steps of the K-means++ algorithm are as follows [15]: Algorithm 1: K-means++ clustering algorithm Input: Dataset X={ _x_ 1, _x_ 2, ..., _xn_ }, n is the number of data Output: Cluster center points { _c_ 1, _c_ 2, ..., _ck_ }, k is the number of center points Algorithm steps: 1) Randomly select one point from the dataset as the initial clustering center point _c_ 1; 2) Calculate the minimum distance D( _x_ ) between each sample and the currently existing cluster center; _D_ ( _x_ ) <sup>2</sup> 3)Take one new center _ci_, choosing _x_ ∈ _X_ with maximum probability P(x) = <u>�</u> _x_ ∈ _X_ <sup>_D_</sup> <sup>(</sup> <sup>_x_</sup> <sup>)2</sup> <sup>~~;~~</sup> 4) Repeat step 2). Until k cluster centers are selected; 5) Clustering is done according to the classical K-means algorithm, until convergence. _Mathematical Biosciences and Engineering_ Volume 20, Issue 7, 12341–12359. 12345 _3.3._ _Adding the attention mechanism module_ Since the same type of defect manifests itself in various ways and the data contains both densely detected targets and non-significantly detected targets. For this reason, we introduce the Coordinate Attention(CA) [16]. It allows the network to extract regions of interest, resist the interference of confusing information and focus on the key information of valid targets. CA is a type of attention mechanism that can be used to enhance the feature representation capabilities of mobile networks. It takes intermediate features as input and outputs enhanced features of the same size. CA focuses on both channel and spatial attention attention attention mechanisms. It first aggregates feature maps along the vertical and horizontal directions, respectively, into two separate feature maps with directionality. This transformation allows the attention module to capture long-term dependencies along one spatial direction and to preserve precise location information along the other spatial direction. The CA structure [16] is shown in Figure 3. Input Residual _C_ × _H_ × 1 _C_ × _H_ × 1 _C_ × _H_ × 1 Re-weight _C_ × _H_ × _W_ X Avg Pool Y Avg Pool Concat + Conv2d BatchNorm + Non-linear split Conv2d Conv2d Sigmoid Sigmoid _C_ × _H_ × _W_ _C_ × 1 × _W_ _C/r_ × 1 × _(W+H)_ _C/r_ × 1 × _(W+H)_ _C_ × 1 × _W_ _C_ × 1 × _W_ Output Figure 3. CA structure. In Figure 4, we can see the model’s structure with the newly added CA attention mechanism. This feature is incorporated after the SPPF module to improve the model’s semantic perception capabilities. _Mathematical Biosciences and Engineering_ Volume 20, Issue 7, 12341–12359. 12346 Input image <mark>CBS</mark> <mark>CBS</mark> <mark>C3_3</mark> <mark>CBS</mark> <mark>C3_6</mark> <mark>CBS</mark> <mark>C3_9</mark> <mark>CBS</mark> C3_3 SPPF <mark>Concat</mark> <mark>Upsample</mark> <mark>CBS</mark> <mark>C3_F_3</mark> <mark>Concat</mark> <mark>Upsample</mark> <mark>CBS</mark> CA module C3_F_3 <mark>CBS</mark> <mark>Concat</mark> C3_F_3 <mark>CBS</mark> <mark>Concat</mark> Conv2d Conv2d Detection layer Detection layer Conv2d Detection Detection layerlayer C3_F_3 Conv2d layerlayer Figure 4. Network structure after adding CA module. Input image <mark>CBS</mark> <mark>CBS</mark> <mark>C3_3</mark> <mark>CBS</mark> <mark>C3_6</mark> <mark>CBS</mark> <mark>C3_9</mark> <mark>CBS</mark> C3_3 SPPF <mark>Upsample</mark> <mark>CBS</mark> C3_F_3 <mark>Concat</mark> <mark>Upsample</mark> <mark>CBS</mark> C3_F_3 <mark>Concat</mark> <mark>Upsample</mark> <mark>CBS</mark> CA module <mark>Concat</mark> C3_F_3 <mark>CBS</mark> <mark>Concat</mark> C3_F_3 <mark>CBS</mark> <mark>Concat</mark> C3_F_3 <mark>CBS</mark> <mark>Concat</mark> C3_F_3 Conv2d Detection Conv2d layer Conv2d Detection layer Detection Conv2d layer Detection layer Figure 5. Network structure after adding new detection layer. _3.4._ _Adding new detection module_ To improve the model’s detection accuracy and reduce the miss detection rate for small defects, we added a detection head for small target detection based on increased attention. The detection layer _Mathematical Biosciences and Engineering_ Volume 20, Issue 7, 12341–12359. 12347 responsible for detecting small targets in the YOLOv5 model is obtained by downsampling the original image by a factor of 8. However, excessive downsampling results in an excessive area of pixel points on the output feature map, making it difficult to retain feature information for smaller target defects. To address this, we construct a detection layer for small targets by splicing the feature map of the shallow network with the feature map of the deep network. The size of the new detection layer will be 4 times the size of the input image for downsampling, and the size of the feature map of the detection layer will be expanded to 512 × 512. See Figure 5 for the improved structure, where the red box indicates the newly added detection module calculation process is illustrated in Figure 6. DG × DG × N Din × Din × C N × DK × DK × C Convolution Kernel Feature Map Feature Map Figure 6. Standard convolution process. _3.5._ _Lightweight network_ In real-world scenarios, the model needs to perform defect inference and analysis within a specific timeframe. YOLOv5’s backbone network employs numerous C3 modules and standard convolutional modules for feature extraction. The feature extraction of the standard convolutional layer is completed in the same step as the feature combination, and the standard convolutional. The number of parameters generated by the standard convolution process is Eq (3.1), where _DK_ represents the kernel size in the convolution operation, _DG_ represents the size of the output feature map, C represents the number of channels in the input feature map, and N represents the number of convolution kernels. _DG_ × _DG_ × _Dk_ × _Dk_ × _C_ × _N_ (3.1) MobileNetV3 [17] uses depth-separable convolution, which combines channel-by-channel convolution for feature extraction with point-by-point 1 × 1 convolution kernels for feature map updimensioning. This is illustrated in Figure 7. _Mathematical Biosciences and Engineering_ Volume 20, Issue 7, 12341–12359. 12348 DG × DG × C N × 1 × 1 × C Feature Map Din × Din × C Feature Map DG × DG × C Feature Map Feature Map DG × DG × C N × 1 × 1 × C Convolution Kernel Dk × Dk × C Convolution Kernel ( a ) ( b ) Figure 7. Deeply separable convolution process. The number of covariates generated by the degree-separable convolution process is Eq (3.2). The comparison of the number of covariates between the two convolution methods is Eq (3.3). If the convolution kernel size of the backbone network is 3 × 3, the computational effort using the depthseparable convolution is about 1/8 to 1/9 of that of the standard convolution. We use MobileNetV3 lightweight network to replace the backbone network of YOLOv5, which can reduce the computation and the model inference time. _DG_ × _DG_ × _Dk_ × _Dk_ × _C_ + _DG_ × _DG_ × 1 × 1 × _N_ × _C_ (3.2) _<u>DG</u>_ × _<u>DG</u>_ × _<u>Dk</u>_ × _<u>Dk</u>_ × _<u>C</u>_ <u>+</u> _<u>DG</u>_ × _<u>DG</u>_ × 1 × 1 × _<u>N</u>_ × _<u>C</u>_ = <sup><u>1</u></sup> <u>1</u> _<u>Dk</u>_ × _<u>Dk</u>_ × _<u>C</u>_ <u>+</u> _<u>DG</u>_ × _<u>DG</u>_ × 1 × 1 × _<u>N</u>_ × _<u>C</u>_ = <sup><u>1</u></sup> _DG_ × _DG_ × _Dk_ × _Dk_ × _C_ × _N_ _N_ <sup><u>1</u></sup> <u>1</u> _N_ <sup>+</sup> _Dk_ (3.3) 2 Figure 8 shows the overall structure of the model after replacing the backbone network. Conv2d <mark>Concat</mark> C3_F <mark>CBS</mark> <mark>Concat</mark> C3_F <mark>CBS</mark> <mark>Concat</mark> C3_F <mark>CBS</mark> <mark>Concat</mark> C3_F Detection Conv2d layer <mark>Upsample</mark> <mark>CBS</mark> C3_F <mark>Concat</mark> Upsample <mark>CBS</mark> C3_F <mark>Concat</mark> <mark>Upsample</mark> <mark>CBS</mark> CA module 3x 3x 3x 3x Detection Conv2d layer 3x 6x 9x 9x Input image <mark>M_CBS</mark> <mark>M_CBS</mark> <mark>M_C3</mark> <mark>M_CBS</mark> <mark>M_C3</mark> <mark>M_CBS</mark> <mark>M_C3</mark> <mark>M_CBS</mark> <mark>M_C3</mark> SPPF 3x 3x Conv2d Detection layer Detection layer Figure 8. Schematic diagram of our improved model. _Mathematical Biosciences and Engineering_ Volume 20, Issue 7, 12341–12359. 12349 4. Experiments _4.1._ _Data augmentation_ Due to the insufficient number of samples, morphological processes such as contrast enhancement, left-right flip, and random image Gaussian blur were performed on the collected data, with the effect shown in Figure 9, to produce similar but different sample data and expand the size of the dataset. Figure 9. Morphological treatment effect. The original image contains 350 images of rolled skin defects, 357 images of peeling defects, 348 images of corrosion defects, and 351 images of abrasion defects, for a total of 1406 images. The number of images increased to 4900 after data enhancement, and Figure 10 shows the change of the number of each target. 1400 1225 1225 1225 1225 1200 1000 800 600 400 200 0 350 357 348 351 Peeling Spalling Corrosion Scratch Figure 10. Number of samples in each category after data augmentation. _Mathematical Biosciences and Engineering_ Volume 20, Issue 7, 12341–12359. 12350 The training set, validation set, and test set are divided according to the ratio of 6:2:2, as shown in Table 1. Table 1. Statistics of image dataset. <u>Train</u> <u>Validation</u> <u>Test</u> <u>Total</u> <u>2940</u> <u>980</u> <u>980</u> <u>4900</u> _4.2._ _Experiment configuration and evaluation index_ We use Ubuntu 18.04 as the operating system, a GTX TITAN V 8G as the GPU, and PyTorch 1.13.0 as the deep learning framework. During training, the batch size was 4, the iterations epoch was 100, and the learning rate was 10 <sup>−3</sup> . The evaluation metrics used in the experiments were precision, recall, average precision (AP), mAP, speed and leakage rate. The precision (P) and recall (R) are as follows. _<u>TP</u>_ _P_ = _TP_ + _FP_ <sup>,</sup> (4.1) _<u>TP</u>_ _R_ = _TP_ + _FN_ <sup>,</sup> (4.2) where TP is the number of samples that were positive and also correctly classified as positive. FP is the number of samples that were negative but incorrectly classified as positive. FN is the number of samples that were positive but classified as negative. After obtaining P and R for each category, the precision-recall (P-R) curve can be displayed. AP is represented by the P-R curve and the area surrounded by coordinates, and mAP is the average of the AP values for all categories. AP and mAP are calculated as follows. - 1 _AP_ = _PR_ d _R_, (4.3) 0 _mAP_ = <sup><u>1</u></sup> _N_ _N_ _k_ =1 _AP_ ( _k_ ), (4.4) where N represents the total number of categories, and represents the AP of the category K. The model detection speed is the average time for each image tested by the model. First, all the time consumed by each model to predict all the test set images was counted. Then the average time required for each image prediction was calculated based on the number of test set images. It is important to note that the time we calculated includes the time consumed by the pre-processing, inference, and post-processing processes for each image. Leakage rate of the model is the ratio of the number of undetected targets to the total number of actual targets. _4.3._ _Experimental results_ 4.3.1. YOLOv5 Table 2 shows the results of the network model comparison experiments. Faster R-CNN has the highest accuracy, but it requires the most time overhead. The detection accuracy of YOLOv5 and _Mathematical Biosciences and Engineering_ Volume 20, Issue 7, 12341–12359. 12351 YOLOv7 is comparable, but YOLOv7 consumes more memory than YOLOv5 during detection. This drawback is particularly significant in resource-constrained environments. Considering both the accuracy of the model and the detection speed, we selected YOLOv5 as the original model for this study for subsequent experiments. Table 2. Comparison experiments. <u>Model</u> <u>Accuracy %</u> <u>Speed (ms)</u> Faster R-CNN [18] 83.73 264 SSD [19] 80.71 242 RetinaNet [20] 82.92 216 YOLOv3 [21] 78.85 103 YOLOv5 79.03 71 YOLOv6 [22] 76.14 78 YOLOv7 [23] 78.94 81 <u>YOLOv8 [24]</u> <u>81.15</u> <u>96</u> 4.3.2. K-means++ The default clustering algorithm of YOLOv5 is the K-means algorithm, and Figure 11 shows the results of the K-means and K-means++ clustering algorithms for clustering the same defective sample data. The results from Figure 11(b) show that the K-means algorithm is sensitive to the initialization of the central cluster, and Figure 11(c) shows that the K-means++ algorithm can better complete the clustering of the sample data when the initial cluster centers are close together. (a) Sample Data (b) K-means Clustering results (c) K-means++ Clustering results Figure 11. Comparison of clustering results. Figure 12 shows the comparison of the loss function curves of the YOLOv5 model taking the two clustering methods. Taking the K-means algorithm has been in a large oscillation state without showing a convergence trend, while taking the K-means++ clustering algorithm starts to converge slowly and stabilizes at 58 epochs. _Mathematical Biosciences and Engineering_ Volume 20, Issue 7, 12341–12359. 12352 Figure 12. Loss curve comparison. Comparison of Table 3 shows that the mAP value of the model improved by 0.4% after using the K-means++ algorithm. Table 3. Comparison of models adopting clustering algorithms. <u>Method</u> <u>mAP@0.5/%</u> YOLOv5 79.03 <u>YOLOv5+K-means++</u> <u>79.43</u> Table 4. Comparison of models with added attention mechanisms. <u>Method</u> <u>mAP@0.5/%</u> YOLOv5+K-means++ 79.43 YOLOv5+K-means++ +SE 81.74 <u>YOLOv5+K-means++ +CA</u> <u>84.42</u> 4.3.3. Adding the attention mechanism module To enhance the model’s performance, the Squeeze-and-Excitation (SE) module and the CA module are incorporated. A comparison of the loss function curves of the model with the addition of these two attention mechanisms is illustrated in Figure 13. The network loss function is minimized by adding CA module. _Mathematical Biosciences and Engineering_ Volume 20, Issue 7, 12341–12359. 12353 Figure 13. Loss curve comparison. Figure 14. Detection effect of small targets. Table 4 shows the comparative results of the models with the addition of the two attention mech _Mathematical Biosciences and Engineering_ Volume 20, Issue 7, 12341–12359. 12354 anisms. Adding the attention mechanism can improve the detection precision of the network model, and the highest mAP is obtained after adding CA attention. Figure 14 shows the detection effect of the model on target defects after adding the attention mechanism. For the same data, the model with the original model and the model after using the K-means++ clustering algorithm were consistent in detecting the target defects, and 13 target defects were detected. After adding SE attention, the model detected 14 target defects. After adding CA attention, the model detected 15 target defects. Compared with that without adding the attention mechanism, the detection effect of the model is improved, but the model still misses non-significant target defects and dense target defects seriously. Although adding the CA attention module is as unsatisfactory as adding the SE attention module for small target detection, the CA loss function is the smallest and the mAP value is the highest; therefore, the CA attention module is chosen to be added to the improved model. 4.3.4. Adding detection module A comparison of the loss function curves of the model before and after adding the new detection layer is shown in Figure 15. The improved model converges slower, but the oscillation frequency is relatively smaller and the loss values are lower. Figure 15. Loss curve comparison. As seen in Table 5, the mAP value of the our network with the addition of the new detection layer increased by 2.29%, and also deepened the network depth, leading to an increase in the computation of the improved model and an increase in the detection time of a single image from 117 ms to 231 ms. Although this scheme can increase the detection accuracy of small targets, the complexity of the network leads to a decrease in the inference speed to the extent that it is impossible to real-time detection problem. Follow-up experiments were conducted to lighten the model to improve the inference speed of the model. _Mathematical Biosciences and Engineering_ Volume 20, Issue 7, 12341–12359. 12355 Table 5. Comparison of models with the addition of new detection layers. <u>Method</u> <u>mAP@0.5/%</u> <u>Speed (ms)</u> YOLOv5+K-means++ +CA 84.42 149 <u>YOLOv5+K-means++ +CA+New detection layer</u> <u>86.71</u> <u>231</u> 4.3.5. Lightweight network Figure 16 shows the change of the loss function of each model during the training process. The loss value of the model after replacing the backbone network is higher than before the improvement, which is due to the fact that the MobileNetV3 module drastically reduces the number of parameters during the operation, resulting in a decrease in the ability of the model to represent the features. Figure 16. Loss curve comparison. According to Table 6, the mAP value of our final model is reduced by 0.84% compared to the model before the improvement, and the detection precision is reduced. However, the detection speed of a single image is reduced from 231 ms to 54 ms. Table 6. Comparison of model performance using different methods. <u>Method</u> <u>mAP@0.5/%</u> <u>Speed (ms)</u> YOLOv5+K-means++ +CA 84.42 149 YOLOv5+K-means++ +CA+New detection layer 86.71 231 <u>Ours</u> <u>85.87</u> <u>54</u> Figure 17 shows the detection effect of the model for target defect detection after the introduction of the lightweight network. The left shows the model before the introduction of the lightweight network, _Mathematical Biosciences and Engineering_ Volume 20, Issue 7, 12341–12359. 12356 which detected 20 target defects. On the right is our model with 18 target defects detected. When four different improvement methods are gradually added, our model can substantially improve the detection efficiency of the model within a reasonable sacrifice of detection accuracy. This detection effect is consistent with the results in Table 6. Figure 17. Detection effect of small targets. _4.4._ _Training e_ ff _ect analysis_ Figure 18 shows the comparison between our model and the original network YOLOv5 to detect the target defects. Our model can detect the defects missed by the original model and does not mistakenly detect the stitching traces of the images as scratch-like defects with higher detection accuracy. Figure 18. Overall detection effect comparison. Figure 19. Non-significant defect detection effect comparison. _Mathematical Biosciences and Engineering_ Volume 20, Issue 7, 12341–12359. 12357 Figure 19 shows the comparison of detection results on non-significant defects. Our model has higher detection accuracy and more precise localization for small-sized target defects. The comparison in Table 7 shows that the mAP value of our model increased from 79.43% to 85.87%, an increase of 6.44%. The leakage rate for 4 types of defects detection is reduced by 1.34%. The detection time of a single image is shortened from 71 ms to 54 ms, a reduction of 17 ms. The single image detection speed of our model is improved by 30%. Table 7. Comparison of detection of improved models. <u>Method</u> <u>Leakage rate%</u> <u>mAP@0.5/%</u> <u>Speed (ms)</u> YOLOv5+K-means++ 8.12 79.43 71 <u>Ours</u> <u>6.78</u> <u>85.87</u> <u>54</u> 5. Conclusions The experimental results of our model for bearing surface defect detection show that it can automatically extract the target features in complex images, significantly improve the detection of nonsignificant defect targets, and the detection speed and accuracy of detection can meet the requirements of actual production, which can quickly and accurately detect the condition of bearing appearance defects, improve detection efficiency and reduce costs. Conflict of interest All authors declare no conflicts of interest in this paper. References 1. L. Eren, A. Karahoca, M. J. Devaney, Neural network based motor bearing fault detection, in _Proceedings_ _of_ _the_ _21st_ _IEEE_ _Instrumentation_ _and_ _Measurement_ _Technology_ _Conference_ _(IEEE_ _Cat. No. 04CH37510)_, 3 [(2004), 1657–1660. https://doi.org/10.1109/IMTC.2004.1351399](http://dx.doi.org/https://doi.org/10.1109/IMTC.2004.1351399) 2. P. K. Kankar, S. C. Sharma, S. P. Harsha, Fault diagnosis of ball bearings using machine learning methods, _Expert Syst. Appl._, 38 [(2011), 1876–1886. https://doi.org/10.1016/j.eswa.2010.07.119](http://dx.doi.org/https://doi.org/10.1016/j.eswa.2010.07.119) 3. C. Tastimur, M. Karakose, I. Aydın, E. Akin, Defect diagnosis of rolling element bearing using deep learning, in _2018_ _International_ _Conference_ _on_ _Artificial_ _Intelligence_ _and_ _Data_ _Process-_ _ing(IDAP)_ [, (2018), 1–5. https://doi.org/10.1109/IDAP.2018.8620743](http://dx.doi.org/https://doi.org/10.1109/IDAP.2018.8620743) 4. J. S. Senanayaka, H. V. Khang, K. G. Robbersmyr, Multiple fault diagnosis of electric powertrains under variable speeds using convolutional neural networks, in _2018_ _XIII_ _International_ _Conference_ _on_ _Electrical_ _Machines(ICEM)_, (2018), 1900–1905. [https://doi.org/10.1109/ICELMACH.2018.8507096](http://dx.doi.org/https://doi.org/10.1109/ICELMACH.2018.8507096) 5. C. Sobie, C. Freitas, M. Nicolai, Simulation-driven machine learning: Bearing fault classification, _Mech. Syst. Signal Process._, 99 [(2018), 403–419. https://doi.org/10.1016/j.ymssp.2017.06.025](http://dx.doi.org/https://doi.org/10.1016/j.ymssp.2017.06.025) 6. M. Sadoughi, C. Hu, Physics-based convolutional neural network for fault diagnosis of rolling element bearings, _IEEE Sens. J._, 19 [(2019), 4181–4192. https://doi.org/10.1109/JSEN.2019.2898634](http://dx.doi.org/https://doi.org/10.1109/JSEN.2019.2898634) _Mathematical Biosciences and Engineering_ Volume 20, Issue 7, 12341–12359. 12358 7. D. W. Kim, E. S. Lee, W. K. Jang, B. H. Kim, Y. H. Seo, Effect of data preprocessing methods and hyperparameters on accuracy of ball bearing fault detection based on deep learning, _Adv. Mech._ _Eng._, 14 [(2022), 1900–1905. https://doi.org/10.1177/16878132221078494](http://dx.doi.org/https://doi.org/10.1177/16878132221078494) 8. A. Bapir, <sup>˙</sup> I. Aydin, A comparative analysis of 1D convolutional neural networks for bearing fault diagnosis, in _2022 International Conference on Decision Aid Sciences and Applications (DASA)_, [(2022), 1406–1411. https://doi.org/10.1109/DASA54658.2022.9765229](http://dx.doi.org/https://doi.org/10.1109/DASA54658.2022.9765229) 9. S. E. M. P. Kone, K. Yatsugi, Y. Mizuno, H. Nakamura, Application of convolutional neural network for fault diagnosis of bearing scratch of an induction motor, _Appl. Sci._, 12 (2022), 1406– [1411. https://doi.org/10.3390/app12115513](http://dx.doi.org/https://doi.org/10.3390/app12115513) 10. M. Chen, L. Yu, C. Zhi, Improved faster R-CNN for fabric defect detection based on Gabor filter with genetic algorithm optimization, _Comput._ _Ind._, 134 (2022), 103551. [https://doi.org/10.1016/j.compind.2021.103551](http://dx.doi.org/https://doi.org/10.1016/j.compind.2021.103551) 11. J. Luo, Z. Yang, S. Li, Y. Wu, FPCB surface defect detection: A decoupled two-stage object detection framework, _IEEE_ _Trans._ _Instrum._ _Meas._, 70 (2021), 1–11. [https://doi.org/10.1109/TIM.2021.3092510](http://dx.doi.org/https://doi.org/10.1109/TIM.2021.3092510) 12. X. Zhang, R. Ma, M. Li, Feature enhancement based on regular sparse model for planetary Gearbox fault diagnosis, _IEEE_ _Trans._ _Instrum._ _Meas._, 71 (2022), 1–16. [https://doi.org/10.1109/TIM.2022.3176244](http://dx.doi.org/https://doi.org/10.1109/TIM.2022.3176244) 13. J. Redmon, S. Divvala, R. Girshick, A. Farhadi, You only look once: Unified, real-time object detection, in _Proceedings_ _of_ _the_ _IEEE_ _conference_ _on_ _computer_ _vision_ _and_ _pattern_ _recognition_, [(2016), 779–788. https://doi.org/10.48550/arXiv.1506.02640](http://dx.doi.org/https://doi.org/10.48550/arXiv.1506.02640) 14. B. Bahmani, B. Moseley, A. Vattani, Scalable k-means++, preprint, arXiv:1203.6402. [https://doi.org/10.48550/arXiv.1203.6402](http://dx.doi.org/https://doi.org/10.48550/arXiv.1203.6402) 15. G. Yuan, J. Liu, H. Liu, Detection of cigarette appearance defects based on improved YOLOv4, _Electron. Res. Arch._, 31 [(2023), 1344–1346. https://doi.org/10.3934/era.2023069](http://dx.doi.org/https://doi.org/10.3934/era.2023069) 16. Q. Hou, D. Zhou, J. Feng, Coordinate attention for efficient mobile network design, in _Proceedings_ _of the IEEE_ / _CVF Conference on Computer Vision and Pattern Recognition_, (2021), 13708–13717. [https://doi.org/10.48550/arXiv.2103.02907](http://dx.doi.org/https://doi.org/10.48550/arXiv.2103.02907) 17. A. Howard, M. Sandler, G. Chu, Searching for mobilenetv3, in _Proceedings_ _of_ _the_ _IEEE_ / _CVF_ _International_ _Conference_ _on_ _Computer_ _Vision_, (2019), 1314–1324. [https://doi.org/10.1109/ICCV.2019.00140](http://dx.doi.org/https://doi.org/10.1109/ICCV.2019.00140) 18. S. Ren, K. He, R. Girshick, Faster r-cnn: Towards real-time object detection with region proposal networks, _Adv. Neural Inf. Process. Syst._, 28 [(2015). https://doi.org/10.48550/arXiv.1506.01497](http://dx.doi.org/https://doi.org/10.48550/arXiv.1506.01497) 19. W. Liu, D. Anguelov, D. Erhan, SSD: Single shot multiBox detector, in _Com-_ _puter_ _Vision–ECCV_ _2016._ _ECCV_ _2016._ _Lecture_ _Notes_ _in_ _Computer_ _Science_, (2016), 21–37. [https://doi.org/10.1007/978-3-319-46448-0_2](http://dx.doi.org/https://doi.org/10.1007/978-3-319-46448-0_2) 20. T. Y. Lin, P. Goyal, R. Girshick, Focal loss for dense object detection, in _Pro-_ _ceedings_ _of_ _the_ _IEEE_ _International_ _Conference_ _on_ _Computer_ _Vision_, (2017), 2980–2988. [https://doi.org/10.48550/arXiv.1708.02002](http://dx.doi.org/https://doi.org/10.48550/arXiv.1708.02002) _Mathematical Biosciences and Engineering_ Volume 20, Issue 7, 12341–12359. 12359 21. J. Redmon, A. Farhadi, Yolov3: An incremental improvement, preprint, arXiv:1804.02767. [https://doi.org/10.48550/arXiv.1804.02767](http://dx.doi.org/https://doi.org/10.48550/arXiv.1804.02767) 22. C. Li, L. Li, H. Jiang, YOLOv6: A single-stage object detection framework for industrial applications, [preprint, arXiv:2209.02976. https://doi.org/10.48550/arXiv.2209.02976](http://dx.doi.org/https://doi.org/10.48550/arXiv.2209.02976) 23. C. Y. Wang, A. Bochkovskiy, H. Y. M. Liao, YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors, preprint, arXiv:2207.02696. [https://doi.org/10.48550/arXiv.2207.02696](http://dx.doi.org/https://doi.org/10.48550/arXiv.2207.02696) 24. J. Terven, D. Cordova-Esparza, A comprehensive review of YOLO: From YOLOv1 to YOLOv8 and beyond, [preprint, arXiv:2304.00501. https://doi.org/10.48550/arXiv.2304.00501](http://dx.doi.org/https://doi.org/10.48550/arXiv.2304.00501) © 2023 the Author(s), licensee AIMS Press. This is an open access article distributed under the terms of the Creative Commons Attribution License [(http://creativecommons.org/licenses/by/4.0)](http://creativecommons.org/licenses/by/4.0) _Mathematical Biosciences and Engineering_ Volume 20, Issue 7, 12341–12359.

섹션 본문 69문단 · 20,683자

(제목 없음)

1This paper addresses the issue of artificial visual inspection being overly reliant on subjective experience and the difficulty for the human eye to accurately identify dense and non-significant defects.To solve this problem, we have implemented an automatic object detection algorithm based on an improved version of YOLOv5.First, we use the K-means++ clustering algorithm to automatically calculate the Anchor of the model to reduce the effect of the close location of the initial clustering centers on the clustering of the sample data.Second, we add the Coordinate Attention (CA) attention mechanism to the model to allow the model to better capture and understand important features in the images.Then, we add a new detection layer with a downsampling multiplier of 4 to the Neck network to improve the precision of the model.Finally, we use the lightweight network MobileNetV3 instead of YOLOv5's backbone network to reduce the model detection time overhead.Our model achieves 85.87% mAP, which is 6.44% better than the YOLOv5 network, and the detection time for a single image is only 54ms, which is 50% faster than the YOLOv5 network.After testing, we have proven that our proposed algorithm can quickly and accurately detect the condition of bearing appearance defects, improving detection efficiency and reducing costs.

Introduction

2Bearings are essential components of freight trains during operation, and their working environment demands them to have three characteristics: high-speed rotation, high pressure, and low fault tolerance.Defects can appear on the bearing surface during production due to improper assembly, poor lubrication, and improper storage.The condition of the bearings determines the safety of the train, so maintenance personnel must regularly overhaul the train's bearings and carry out corresponding maintenance treatments according to the types of defects.Currently, industrial production primarily relies on manual visual inspections to detect bearing surface defects, which places too much emphasis on the inspector's experience.The variety of defects and their manifestations, along with non-significant defects, increases the difficulty of inspectors' detection, and the inspection workshop's environment is not conducive to extended periods of inspector work.

3Several researchers have proposed methods for detecting defects on bearing surfaces.L. Eren and A. Karahoca [1] improved the bearing defect detection procedure by wavelet transform and Radial Basis Function (RBF) neural network.Kankar and Sharma [2] used Artificial Neural Network (ANN) and Support Vector Machine(SVM) to detect defects on the bearing surface from the perspective of bearing vibration signals.Tastimur and Karakose [3] used a deep learning framework in the visual task of bearing defect detection to complete automatic detection of four types of bearing defects.Senanayaka and Khang [4] proposed a fault diagnosis method based on convolutional neural network pattern recognition, which can effectively detect not only single faults but also multiple faults simultaneously.Sobie and Freitas [5] applied proven statistical feature-based methods to convolutional neural networks to improve the accuracy of mechanical fault detection.Sadoughi and Hu [6] used bearings and their physical knowledge of bearings and their fault features as input to a deep neural network to propose a convolutional neural network (PCNN) based on physical characteristics for simultaneous detection of multiple bearings.Kim and Lee [7] applied deep learning models to detect ball bearing faults under complex conditions and obtained very high accuracy.Bapir and Aydin [8] used variational modal decomposition and convolutional neural network to complete the feature extraction and classification of bearing surface defects.Kone and Yatsugi [9] proposed an adaptively tuned convolutional neural network for the detection of multiple scratches defects on bearing surfaces.Chen and Yu [10] improved the Faster R-CNN model for fabric defect detection by embedding Gabor kernels and using a two-stage training method based on Genetic Algorithm and back-propagation.Luo and Yang [11] proposed a decoupled two-stage object detection framework for FPCB surface defect detection that achieved state-of-the-art accuracy.Zhang and Ma [12] proposed and evaluated a sparse regular diagnosis algorithm for feature enhancement in planetary gearbox fault diagnosis.

4The detection model needs to implement the classification and localization of the target defects to obtain statistical information about the class and location of the bearing defects.YOLO is one of the most important target detection models, offering advantages in terms of accuracy and speed.In this paper, we propose an improved YOLOv5 model for bearing surface target defect detection.Due to the curvature and texture of the bearing surface, detection presents certain challenges.In addition, we found that the target defect area only accounts for 0.03% of the bearing surface area, yet our model still achieved an mAP of 85.87%.To support our research, we formed a private dataset called "SKF-KS2022".In practical applications, our model performs well.The detection time for a single image is only 54 ms, which can meet the requirements of real-time detection in industrial applications.

Dataset

5The dataset is composed of two parts.One part is a unified image collection of bearing defects that was created using industrial cameras with the help of engineers from the factory inspection center, and is from freight train service station.The other part of the data is publicly available from the "Severstal:

6Steel Defect Detection" competition on the Kaggle website, and is the steel surface defects dataset.In total, there are 1406 images with a resolution of 2048 × 2048.Due to the limited data collected, only 50 images of the remaining 17 defect types were accumulated.Therefore, the main types of defects studied were identified as scratch, corrosion, peeling, and rolling skin.Figure 1 shows the four types of targets.

YOLOv5 model

7The YOLO series [13] is a regression-based target detection algorithm that creatively combines the Region of Interest (RoI) module and detection phases into one to improve the detection speed.YOLOv5 model mainly consists of Backbone, Neck and Head.The structure of YOLOv5 is shown in Figure 2.

Prior box

8The prior box is a box of different sizes and aspect ratios preset on the image in advance to help the model learn the location and size of the target more easily, and the reasonable setting of the Anchor greatly affects the performance of the final model.The K-means++ algorithm [14] uses an "additive" strategy to select the initial clustering centers, maximizing the distance between them.This strategy ensures that the model achieves the highest prior frame and improves detection accuracy.

9The steps of the K-means++ algorithm are as follows [15]:

is the number of center points

10Algorithm steps:

111) Randomly select one point from the dataset as the initial clustering center point c 1 ;

122) Calculate the minimum distance D(x) between each sample and the currently existing cluster center;

133)Take one new center c i , choosing x ∈ X with maximum probability P(x) = D(x) 2

14x∈X D(x) 2 ; 4) Repeat step 2).Until k cluster centers are selected; 5) Clustering is done according to the classical K-means algorithm, until convergence.

Adding the attention mechanism module

15Since the same type of defect manifests itself in various ways and the data contains both densely detected targets and non-significantly detected targets.For this reason, we introduce the Coordinate Attention(CA) [16].It allows the network to extract regions of interest, resist the interference of confusing information and focus on the key information of valid targets.

16CA is a type of attention mechanism that can be used to enhance the feature representation capabilities of mobile networks.It takes intermediate features as input and outputs enhanced features of the same size.CA focuses on both channel and spatial attention attention attention mechanisms.It first aggregates feature maps along the vertical and horizontal directions, respectively, into two separate feature maps with directionality.This transformation allows the attention module to capture long-term dependencies along one spatial direction and to preserve precise location information along the other spatial direction.The CA structure [16] is shown in Figure 3.

17In Figure 4, we can see the model's structure with the newly added CA attention mechanism.This feature is incorporated after the SPPF module to improve the model's semantic perception capabilities.

Adding new detection module

18To improve the model's detection accuracy and reduce the miss detection rate for small defects, we added a detection head for small target detection based on increased attention.The detection layer responsible for detecting small targets in the YOLOv5 model is obtained by downsampling the original image by a factor of 8.However, excessive downsampling results in an excessive area of pixel points on the output feature map, making it difficult to retain feature information for smaller target defects.To address this, we construct a detection layer for small targets by splicing the feature map of the shallow network with the feature map of the deep network.The size of the new detection layer will be 4 times the size of the input image for downsampling, and the size of the feature map of the detection layer will be expanded to 512 × 512.See Figure 5 for the improved structure, where the red box indicates the newly added detection module calculation process is illustrated in Figure 6.

Lightweight network

19In real-world scenarios, the model needs to perform defect inference and analysis within a specific timeframe.YOLOv5's backbone network employs numerous C3 modules and standard convolutional modules for feature extraction.The feature extraction of the standard convolutional layer is completed in the same step as the feature combination, and the standard convolutional.

20The number of parameters generated by the standard convolution process is Eq (3.1), where D K represents the kernel size in the convolution operation, D G represents the size of the output feature map, C represents the number of channels in the input feature map, and N represents the number of convolution kernels.

21MobileNetV3 [17] uses depth-separable convolution, which combines channel-by-channel convolution for feature extraction with point-by-point 1 × 1 convolution kernels for feature map updimensioning.This is illustrated in Figure 7.The number of covariates generated by the degree-separable convolution process is Eq (3.2).The comparison of the number of covariates between the two convolution methods is Eq (3.3).If the convolution kernel size of the backbone network is 3 × 3, the computational effort using the depthseparable convolution is about 1/8 to 1/9 of that of the standard convolution.We use MobileNetV3 lightweight network to replace the backbone network of YOLOv5, which can reduce the computation and the model inference time.

22Figure 8 shows the overall structure of the model after replacing the backbone network.

Data augmentation

23Due to the insufficient number of samples, morphological processes such as contrast enhancement, left-right flip, and random image Gaussian blur were performed on the collected data, with the effect shown in Figure 9, to produce similar but different sample data and expand the size of the dataset.The training set, validation set, and test set are divided according to the ratio of 6:2:2, as shown in Table 1.

Experiment configuration and evaluation index

24We use Ubuntu 18.04 as the operating system, a GTX TITAN V 8G as the GPU, and PyTorch 1.13.0 as the deep learning framework.During training, the batch size was 4, the iterations epoch was 100, and the learning rate was 10 −3 .

25The evaluation metrics used in the experiments were precision, recall, average precision (AP), mAP, speed and leakage rate.The precision (P) and recall (R) are as follows.

P =

26T P T P + FP , (4.1)

27where TP is the number of samples that were positive and also correctly classified as positive.FP is the number of samples that were negative but incorrectly classified as positive.FN is the number of samples that were positive but classified as negative.

28After obtaining P and R for each category, the precision-recall (P-R) curve can be displayed.AP is represented by the P-R curve and the area surrounded by coordinates, and mAP is the average of the AP values for all categories.AP and mAP are calculated as follows.

29where N represents the total number of categories, and represents the AP of the category K.

30The model detection speed is the average time for each image tested by the model.First, all the time consumed by each model to predict all the test set images was counted.Then the average time required for each image prediction was calculated based on the number of test set images.It is important to note that the time we calculated includes the time consumed by the pre-processing, inference, and post-processing processes for each image.

31Leakage rate of the model is the ratio of the number of undetected targets to the total number of actual targets.

YOLOv5

32Table 2 shows the results of the network model comparison experiments.Faster R-CNN has the highest accuracy, but it requires the most time overhead.The detection accuracy of YOLOv5 and YOLOv7 is comparable, but YOLOv7 consumes more memory than YOLOv5 during detection.This drawback is particularly significant in resource-constrained environments.Considering both the accuracy of the model and the detection speed, we selected YOLOv5 as the original model for this study for subsequent experiments.Table 2. Comparison experiments.

Model

33Accuracy % Speed (ms) Faster R-CNN [18] 83.73 264 SSD [19] 80.71 242 RetinaNet [20] 82.92 216 YOLOv3 [21] 78.85 103 YOLOv5 79.03 71 YOLOv6 [22] 76.14 78 YOLOv7 [23] 78.94 81 YOLOv8 [24] 81.15 96

K-means++

34The default clustering algorithm of YOLOv5 is the K-means algorithm, and Figure 11 shows the results of the K-means and K-means++ clustering algorithms for clustering the same defective sample data.

35The results from Figure 11 Comparison of Table 3 shows that the mAP value of the model improved by 0.4% after using the K-means++ algorithm.To enhance the model's performance, the Squeeze-and-Excitation (SE) module and the CA module are incorporated.A comparison of the loss function curves of the model with the addition of these two attention mechanisms is illustrated in Figure 13.The network loss function is minimized by adding CA module.Table 4 shows the comparative results of the models with the addition of the two attention mech-anisms.Adding the attention mechanism can improve the detection precision of the network model, and the highest mAP is obtained after adding CA attention.

36Figure 14 shows the detection effect of the model on target defects after adding the attention mechanism.For the same data, the model with the original model and the model after using the K-means++ clustering algorithm were consistent in detecting the target defects, and 13 target defects were detected.After adding SE attention, the model detected 14 target defects.After adding CA attention, the model detected 15 target defects.Compared with that without adding the attention mechanism, the detection effect of the model is improved, but the model still misses non-significant target defects and dense target defects seriously.

37Although adding the CA attention module is as unsatisfactory as adding the SE attention module for small target detection, the CA loss function is the smallest and the mAP value is the highest; therefore, the CA attention module is chosen to be added to the improved model.As seen in Table 5, the mAP value of the our network with the addition of the new detection layer increased by 2.29%, and also deepened the network depth, leading to an increase in the computation of the improved model and an increase in the detection time of a single image from 117 ms to 231 ms.Although this scheme can increase the detection accuracy of small targets, the complexity of the network leads to a decrease in the inference speed to the extent that it is impossible to real-time detection problem.Follow-up experiments were conducted to lighten the model to improve the inference speed of the model.According to Table 6, the mAP value of our final model is reduced by 0.84% compared to the model before the improvement, and the detection precision is reduced.However, the detection speed of a single image is reduced from 231 ms to 54 ms. Figure 17 shows the detection effect of the model for target defect detection after the introduction of the lightweight network.The left shows the model before the introduction of the lightweight network, which detected 20 target defects.On the right is our model with 18 target defects detected.When four different improvement methods are gradually added, our model can substantially improve the detection efficiency of the model within a reasonable sacrifice of detection accuracy.This detection effect is consistent with the results in Table 6.

Training effect analysis

38Figure 18 shows the comparison between our model and the original network YOLOv5 to detect the target defects.Our model can detect the defects missed by the original model and does not mistakenly detect the stitching traces of the images as scratch-like defects with higher detection accuracy.Figure 19 shows the comparison of detection results on non-significant defects.Our model has higher detection accuracy and more precise localization for small-sized target defects.

39The comparison in Table 7 shows that the mAP value of our model increased from 79.43% to 85.87%, an increase of 6.44%.The leakage rate for 4 types of defects detection is reduced by 1.34%.The detection time of a single image is shortened from 71 ms to 54 ms, a reduction of 17 ms.The single image detection speed of our model is improved by 30%.

40Table 7.Comparison of detection of improved models.

Method

41Leakage rate% mAP@0.5/%Speed (ms) YOLOv5+K-means++ 8.12 79.43 71 Ours 6.78 85.87 54

Conclusions

42The experimental results of our model for bearing surface defect detection show that it can automatically extract the target features in complex images, significantly improve the detection of nonsignificant defect targets, and the detection speed and accuracy of detection can meet the requirements of actual production, which can quickly and accurately detect the condition of bearing appearance defects, improve detection efficiency and reduce costs.

Figure 1 .

43Figure 1. 4 types of defective targets.

Figure 2 .

44Figure 2. The structure of YOLOv5.

Figure 4 .Figure 5 .

45Figure 4. Network structure after adding CA module.

Figure 6 .

46Figure 6.Standard convolution process.

Figure 7 .

47Figure 7. Deeply separable convolution process.

Figure 8 .

48Figure 8. Schematic diagram of our improved model.

Figure 9 .

49Figure 9. Morphological treatment effect.

Figure 10 .

50Figure 10.Number of samples in each category after data augmentation.

51(b) show that the K-means algorithm is sensitive to the initialization of the central cluster, and Figure11(c) shows that the K-means++ algorithm can better complete the clustering of the sample data when the initial cluster centers are close together.

52(a) Sample Data (b) K-means Clustering results (c) K-means++ Clustering results

Figure 11 .

53Figure 11.Comparison of clustering results.

Figure 12 shows

54Figure 12 shows the comparison of the loss function curves of the YOLOv5 model taking the two clustering methods.Taking the K-means algorithm has been in a large oscillation state without showing a convergence trend, while taking the K-means++ clustering algorithm starts to converge slowly and stabilizes at 58 epochs.

Figure 12 .

55Figure 12.Loss curve comparison.

Figure 13 .

56Figure 13.Loss curve comparison.

Figure 14 .

57Figure 14.Detection effect of small targets.

4. 3 . 4 .

58Adding detection module A comparison of the loss function curves of the model before and after adding the new detection layer is shown in Figure 15.The improved model converges slower, but the oscillation frequency is relatively smaller and the loss values are lower.

Figure 15 .

59Figure 15.Loss curve comparison.

Figure 16

60Figure16shows the change of the loss function of each model during the training process.The loss value of the model after replacing the backbone network is higher than before the improvement, which is due to the fact that the MobileNetV3 module drastically reduces the number of parameters during the operation, resulting in a decrease in the ability of the model to represent the features.

Figure 16 .

61Figure 16.Loss curve comparison.

Figure 17 .

62Figure 17.Detection effect of small targets.

Figure 18 .

63Figure 18.Overall detection effect comparison.

Figure 19 .

64Figure 19.Non-significant defect detection effect comparison.

Table 1 .

65Statistics of image dataset.

Table 3 .

66Comparison of models adopting clustering algorithms.

Table 4 .

67Comparison of models with added attention mechanisms.

Table 5 .

68Comparison of models with the addition of new detection layers.

Table 6 .

69Comparison of model performance using different methods.

참고문헌 11건

  1. Fault diagnosis of ball bearings using machine learning methods Expert Systems with Applications · Elsevier BV · 2010 10.1016/j.eswa.2010.07.119
  2. Simulation-driven machine learning: Bearing fault classification Mechanical Systems and Signal Processing · Elsevier BV · 2017 10.1016/j.ymssp.2017.06.025
  3. Multiple Fault Diagnosis of Electric Powertrains Under Variable Speeds Using Convolutional Neural Networks 2018 10.1109/icelmach.2018.8507096
  4. Defect Diagnosis of Rolling Element Bearing using Deep Learning 2018 10.1109/idap.2018.8620743
  5. Physics-Based Convolutional Neural Network for Fault Diagnosis of Rolling Element Bearings IEEE Sensors Journal · IEEE Sensors Council · 2019 10.1109/jsen.2019.2898634
  6. FPCB Surface Defect Detection: A Decoupled Two-Stage Object Detection Framework IEEE Transactions on Instrumentation and Measurement · Institute of Electrical and Electronics Engineers · 2021 10.1109/tim.2021.3092510
  7. Improved faster R-CNN for fabric defect detection based on Gabor filter with Genetic Algorithm optimization Computers in Industry · Elsevier BV · 2021 10.1016/j.compind.2021.103551
  8. Effect of data preprocessing methods and hyperparameters on accuracy of ball bearing fault detection based on deep learning Advances in Mechanical Engineering · SAGE Publishing · 2022 10.1177/16878132221078494
  9. Application of Convolutional Neural Network for Fault Diagnosis of Bearing Scratch of an Induction Motor Applied Sciences · Multidisciplinary Digital Publishing Institute · 2022 10.3390/app12115513
  10. Feature Enhancement Based on Regular Sparse Model for Planetary Gearbox Fault Diagnosis IEEE Transactions on Instrumentation and Measurement · Institute of Electrical and Electronics Engineers · 2022 10.1109/tim.2022.3176244
  11. Detection of cigarette appearance defects based on improved YOLOv4 Electronic Research Archive · American Institute of Mathematical Sciences · 2023 10.3934/era.2023069