DSASPP: Depthwise Separable Atrous Spatial Pyramid Pooling for PCB Surface Defect Detection
Abstract
:1. Introduction
- Utilize the K-means++ clustering algorithm to re-cluster the initial anchor box parameters and adopt 1-IoU as the distance metric to enhance the model’s capacity to detect defective targets in smaller areas;
- In this paper, we design and propose the Depthwise Separable Atrous Spatial Pyramid Pooling (DSASPP) module, which constructs atrous convolution branches with different dilated rates and global average pooling branches to improve the correlation between local and global information. We also introduce depthwise separable convolution using the Gaussian error linear Unit (GELU) as activation function in atrous convolution blocks to balance precision and number of parameters.
2. Methods
2.1. DSASPP-YOLOv5 Network
2.2. K-Means++ Clustering Algorithm
- A sample point is chosen at random from the project dataset as the first initial clustering center ;
- Define the farthest distance between each sample point and the current existing clustering center as . As shown in Equation (2), the probability of each sample point being selected as the next clustering center is defined as , and in this paper, we use the roulette wheel method to select a new clustering center based on the size of the probability .
- Repeat process 2. until k clustering centers are selected.
2.3. DSASPP Module
- Using the same dilation rate consecutively or using a set of dilation rate values with a common factor relationship other than 1, both of which may cause “Gridding Effect” and result in local information loss;
- The ReLU function used in the improved ASPP has certain defects, which may cause the problem of “Dying ReLU” and make some effective information lost;
- In practice, the ASPP module often introduces a significant number of additional parameters while increasing accuracy, which is not worth the cost for industrial application scenarios with detection speed requirements.
- The first component is the first branch, which utilizes a standard convolution in order to maintain the original receptive field;
- The second part is the second to the fourth branch, using atrous convolution with a convolution kernel size and dilation rate of 2, 3, and 5 to obtain different size receptive fields while enhancing feature extraction. We decreased the total quantity of parameters in this study by introducing depthwise separable convolution, where the activation function part is chosen to be the theoretically better GELU function;
- The third component is the fifth branch, which introduces global average pooling so as to obtain global features, improves the model’s stability and accuracy, and suppresses the overfitting phenomenon in the network.
2.3.1. Atrous Convolution
- The dilation rate of different layers should not have a common factor relationship other than 1, otherwise the problem of the “Gridding Effect” at higher levels remains;
- Define “the maximum distance between two non-zero values” as :
2.3.2. GELU Activation Function
2.3.3. Depthwise Separable Convolution
3. Experimental Results and Analysis
3.1. Experimental Environment
3.2. Evaluation Metrics
3.3. Model Performance Evaluation
3.3.1. K-Means++ Clustering Result Analysis
3.3.2. DSASPP Experimental Analysis
3.4. Ablation Experiments
3.5. Comparison with Other Models
3.6. Validation and Visualization
4. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Dilberoglu, U.M.; Gharehpapagh, B.; Yaman, U.; Dolen, M. The Role of Additive Manufacturing in the Era of Industry 4.0. Procedia Manuf. 2017, 11, 545–554. [Google Scholar] [CrossRef]
- Ling, Q.; Isa, N.A.M. Printed Circuit Board Defect Detection Methods Based on Image Processing, Machine Learning and Deep Learning: A Survey. IEEE Access 2023, 11, 15921–15944. [Google Scholar] [CrossRef]
- Ding, R.W.; Dai, L.H.; Li, G.P.; Liu, H. TDD-net: A tiny defect detection network for printed circuit boards. CAAI Trans. Intell. Technol. 2019, 4, 110–116. [Google Scholar] [CrossRef]
- Karnik, N.; Bora, U.; Bhadri, K.; Kadambi, P.; Dhatrak, P. A comprehensive study on current and future trends towards the characteristics and enablers of industry 4.0. J. Ind. Inf. Integr. 2022, 27, 100294. [Google Scholar] [CrossRef]
- Li, Y.F.; Li, S.Y. Defect detection of bare printed circuit boards based on gradient direction information entropy and uniform local binary patterns. Circuit World 2017, 43, 145–151. [Google Scholar] [CrossRef]
- Wu, X.; Ge, Y.X.; Zhang, Q.F.; Zhang, D.L. PCB Defect Detection Using Deep Learning Methods. In Proceedings of the 24th IEEE International Conference on Computer Supported Cooperative Work in Design (IEEE CSCWD), Dalian, China, 5–7 May 2021; pp. 873–876. [Google Scholar] [CrossRef]
- Raj, A.; Sajeena, A. Defects Detection in PCB Using Image Processing for Industrial Applications. In Proceedings of the International Conference on Inventive Communication and Computational Technologies (ICICCT), Coimbatore, India, 20–21 April 2018; pp. 1077–1079. [Google Scholar]
- Lee, Y.; Lin, Y.; Wahba, G. Multicategory Support Vector Machines: Theory and Application to the Classification of Microarray Data and Satellite Radiance Data. J. Am. Stat. Assoc. 2004, 99, 67–81. [Google Scholar] [CrossRef]
- Rokach, L.; Maimon, O. Top-Down Induction of Decision Trees Classifiers—A Survey. IEEE Trans. Syst. Man Cybern. Part C (Appl. Rev.) 2005, 35, 476–487. [Google Scholar] [CrossRef]
- Doerr, B.; Huu Phuoc, L.; Makhmara, R.; Ta Duy, N. Fast Genetic Algorithms. In Proceedings of the Genetic and Evolutionary Computation Conference (GECCO), Berlin, Germany, 15–19 July 2017; pp. 777–784. [Google Scholar] [CrossRef]
- Girshick, R.; Donahue, J.; Darrell, T.; Malik, J. Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of the 27th IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Columbus, OH, USA, 23–28 June 2014; pp. 580–587. [Google Scholar] [CrossRef]
- Girshick, R. Fast R-CNN. In Proceedings of the IEEE International Conference on Computer Vision, Santiago, Chile, 7–13 December 2015; pp. 1440–1448. [Google Scholar] [CrossRef]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. IEEE Trans. Pattern Anal. Mach. Intell. 2017, 39, 1137–1149. [Google Scholar] [CrossRef]
- He, K.; Gkioxari, G.; Dollar, P.; Girshick, R. Mask R-CNN. In Proceedings of the 16th IEEE International Conference on Computer Vision (ICCV), Venice, Italy, 22–29 October 2017; pp. 2980–2988. [Google Scholar] [CrossRef]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.Y.; Berg, A.C. SSD: Single Shot MultiBox Detector. In Proceedings of the 14th European Conference on Computer Vision (ECCV), Amsterdam, The Netherlands, 8–16 October 2016; Volume 9905, pp. 21–37. [Google Scholar] [CrossRef]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You Only Look Once: Unified, Real-Time Object Detection. In Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Las Vegas, NV, USA, 27–30 June 2016; pp. 779–788. [Google Scholar] [CrossRef]
- Redmon, J.; Farhadi, A. YOLO9000: Better, Faster, Stronger. In Proceedings of the 30th IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA, 21–26 July 2017; pp. 6517–6525. [Google Scholar] [CrossRef]
- Redmon, J.; Farhadi, A. YOLOv3: An Incremental Improvement. arXiv 2018, arXiv:1804.02767. [Google Scholar]
- Bochkovskiy, A.; Wang, C.Y.; Liao, H.Y.M. YOLOv4: Optimal Speed and Accuracy of Object Detection. arXiv 2020, arXiv:2004.10934. [Google Scholar]
- Zhang, C.; Shi, W.; Li, X.; Zhang, H.; Liu, H. Improved bare PCB defect detection approach based on deep feature learning. J. Eng. 2018, 2018, 1415–1420. [Google Scholar] [CrossRef]
- Xie, H.; Li, Y.; Li, X.; He, L. A method for surface defect detection of printed circuit board based on improved YOLOv4. In Proceedings of the 2021 IEEE 2nd International Conference on Big Data, Artificial Intelligence and Internet of Things Engineering (ICBAIE), Nanchang, China, 26–28 March 2021; pp. 851–857. [Google Scholar]
- Adibhatla, V.A.; Chih, H.C.; Hsu, C.C.; Cheng, J.; Abbod, M.F.; Shieh, J.S. Defect detection in printed circuit boards using you-only-look-once convolutional neural networks. Electronics 2020, 9, 1547. [Google Scholar] [CrossRef]
- Ding, R.; Zhang, C.; Zhu, Q.; Liu, H. Unknown defect detection for printed circuit board based on multi-scale deep similarity measure method. J. Eng. 2020, 2020, 388–393. [Google Scholar] [CrossRef]
- Lee, Y.H.; Kim, Y. Comparison of CNN and YOLO for Object Detection. J. Semicond. Disp. Technol. 2020, 19, 85–92. [Google Scholar]
- Wu, Z.; Zhang, D.; Shao, Y.; Zhang, X.; Zhang, X.; Feng, Y.; Cui, P. Using YOLOv5 for garbage classification. In Proceedings of the 2021 4th International Conference on Pattern Recognition and Artificial Intelligence (PRAI), Yibin, China, 20–22 August 2021; pp. 35–38. [Google Scholar]
- Băjenescu, T.M. Miniaturisation of electronic components and the problem of devices overheating. EEA-Electroteh. Electron. Autom. 2021, 69, 53–58. [Google Scholar] [CrossRef]
- Ping, Y.; Li, H.; Hao, B.; Guo, C.; Wang, B. Beyond k-Means plus plus: Towards better cluster exploration with geometrical information. Pattern Recognit. 2024, 146, 110036. [Google Scholar] [CrossRef]
- Chen, L.C.; Papandreou, G.; Kokkinos, I.; Murphy, K.; Yuille, A.L. DeepLab: Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs. IEEE Trans. Pattern Anal. Mach. Intell. 2018, 40, 834–848. [Google Scholar] [CrossRef] [PubMed]
- Wang, P.; Chen, P.; Yuan, Y.; Liu, D.; Huang, Z.; Hou, X.; Cottrell, G. Understanding convolution for semantic segmentation. In Proceedings of the 2018 IEEE Winter Conference on Applications of Computer Vision (WACV), Lake Tahoe, NV, USA, 12–15 March 2018; pp. 1451–1460. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification. In Proceedings of the IEEE International Conference on Computer Vision, Santiago, Chile, 7–13 December 2015; pp. 1026–1034. [Google Scholar] [CrossRef]
- Hendrycks, D.; Gimpel, K. Gaussian error linear units (gelus). arXiv 2016, arXiv:1606.08415. [Google Scholar]
- SIfre, L.; Mallat, S. Rigid-motion scattering for texture classiflcation. arXiv 2014, arXiv:1403.1687. [Google Scholar]
- Chollet, F. Xception: Deep learning with depthwise separable convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 1251–1258. [Google Scholar]
- Howard, A.G.; Zhu, M.; Chen, B.; Kalenichenko, D.; Wang, W.; Weyand, T.; Andreetto, M.; Adam, H. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv 2017, arXiv:1704.04861. [Google Scholar]
- Hu, B.; Wang, J. Detection of PCB Surface Defects with Improved Faster-RCNN and Feature Pyramid Network. IEEE Access 2020, 8, 108335–108345. [Google Scholar] [CrossRef]
- Zhou, T.; Zhang, J.; Su, H.; Zou, W.; Zhang, B. EDDs: A series of Efficient Defect Detectors for fabric quality inspection. Measurement 2021, 172, 108885. [Google Scholar] [CrossRef]
- Diamini, S.; Kuo, C.F.J.; Chao, S.M. Developing a surface mount technology defect detection system for mounted devices on printed circuit boards using a MobileNetV2 with Feature Pyramid Network. Eng. Appl. Artif. Intell. 2023, 121, 105875. [Google Scholar] [CrossRef]
- Chen, S.H.; Tsai, C.C. SMD LED chips defect detection using a YOLOV3-dense model. Adv. Eng. Inform. 2021, 47, 101255. [Google Scholar] [CrossRef]
Class | Original Images | Enhance Images |
---|---|---|
Missing_hole | 115 | 690 |
Mouse_bite | 115 | 690 |
Open_circuit | 116 | 696 |
Short | 116 | 696 |
Spur | 115 | 690 |
Spurious_copper | 116 | 696 |
Totle | 693 | 4158 |
Feature Map | Anchor Box |
---|---|
(7,7) (12,12) (16,11) | |
(10,17) (15,15) (14,22) | |
(24,14) (19,20) (27,24) |
Dilation Rates | mAP_0.5 (%) | mAP_0.5:0.95 (%) |
---|---|---|
1,2,2,2 | 96.56 | 60.13 |
1,6,12,18 | 96.82 | 60.06 |
1,2,3,7 | 96.91 | 60.38 |
1,2,3,5 | 97.23 | 60.82 |
Model | Params (M) | mAP_0.5 (%) | mAP_0.5:0.95 (%) | Model Size (MB) |
---|---|---|---|---|
ASPP | 15.29 | 97.23 | 60.82 | 29.4 |
ASPP + ReLU | 15.30 | 97.33 | 62.25 | 29.4 |
ASPP + PReLU | 15.30 | 97.42 | 63.31 | 29.4 |
ASPP + GELU | 15.30 | 97.63 | 64.46 | 29.4 |
DSASPP | 9.03 | 97.58 | 62.31 | 17.4 |
Different Modules | Params (M) | P (%) | R (%) | mAP_0.5 (%) | |||
---|---|---|---|---|---|---|---|
YOLO v5 | DA | k-means++ | DSASPP | ||||
✓ | 7.04 | 96.30 | 95.40 | 95.91 | |||
✓ | ✓ | 7.04 | 97.27 | 94.34 | 96.96 | ||
✓ | ✓ | ✓ | 7.04 | 98.58 | 95.45 | 98.04 | |
✓ | ✓ | ✓ | ✓ | 9.03 | 99.15 | 96.56 | 98.62 |
Model | Backbone | Params (M) | mAP (%) | FPS (f/s) |
---|---|---|---|---|
Faster-RCNN | VGG16 | 43.89 | 93.47 | 16.49 |
Faster-RCNN | EfficientNet | 7.68 | 91.04 | 28.81 |
Faster-RCNN | MobileNetV2 | 19.90 | 91.48 | 24.96 |
YOLOv3 | DarkNet53 | 62.60 | 95.22 | 30.54 |
YOLOv5 | CSPNet | 7.04 | 95.91 | 112.51 |
Ours | CSPNet + DSASPP | 9.03 | 98.62 | 101.67 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Xu, Y.; Huo, H. DSASPP: Depthwise Separable Atrous Spatial Pyramid Pooling for PCB Surface Defect Detection. Electronics 2024, 13, 1490. https://doi.org/10.3390/electronics13081490
Xu Y, Huo H. DSASPP: Depthwise Separable Atrous Spatial Pyramid Pooling for PCB Surface Defect Detection. Electronics. 2024; 13(8):1490. https://doi.org/10.3390/electronics13081490
Chicago/Turabian StyleXu, Yuhang, and Hua Huo. 2024. "DSASPP: Depthwise Separable Atrous Spatial Pyramid Pooling for PCB Surface Defect Detection" Electronics 13, no. 8: 1490. https://doi.org/10.3390/electronics13081490
APA StyleXu, Y., & Huo, H. (2024). DSASPP: Depthwise Separable Atrous Spatial Pyramid Pooling for PCB Surface Defect Detection. Electronics, 13(8), 1490. https://doi.org/10.3390/electronics13081490